Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(295)

Side by Side Diff: Source/core/css/resolver/ScopedStyleResolver.cpp

Issue 23264017: Implement support for unprefixed keyframes rules resolution. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSParser-in.cpp ('k') | Source/core/css/resolver/StyleResolver.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 3 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
4 * Copyright (C) 2012 Google Inc. All rights reserved. 4 * Copyright (C) 2012 Google Inc. All rights reserved.
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 317 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 KeyframesRuleMap::iterator it = m_keyframesRuleMap.find(animationName); 328 KeyframesRuleMap::iterator it = m_keyframesRuleMap.find(animationName);
329 if (it == m_keyframesRuleMap.end()) 329 if (it == m_keyframesRuleMap.end())
330 return 0; 330 return 0;
331 331
332 return it->value.get(); 332 return it->value.get();
333 } 333 }
334 334
335 void ScopedStyleResolver::addKeyframeStyle(PassRefPtr<StyleRuleKeyframes> rule) 335 void ScopedStyleResolver::addKeyframeStyle(PassRefPtr<StyleRuleKeyframes> rule)
336 { 336 {
337 AtomicString s(rule->name()); 337 AtomicString s(rule->name());
338 m_keyframesRuleMap.set(s.impl(), rule); 338 if (rule->isVendorPrefixed()) {
339 KeyframesRuleMap::iterator it = m_keyframesRuleMap.find(rule->name().imp l());
340 if (it == m_keyframesRuleMap.end())
341 m_keyframesRuleMap.set(s.impl(), rule);
342 else if (it->value->isVendorPrefixed())
343 m_keyframesRuleMap.set(s.impl(), rule);
344 } else {
345 m_keyframesRuleMap.set(s.impl(), rule);
346 }
339 } 347 }
340 348
341 inline RuleSet* ScopedStyleResolver::atHostRuleSetFor(const ShadowRoot* shadowRo ot) const 349 inline RuleSet* ScopedStyleResolver::atHostRuleSetFor(const ShadowRoot* shadowRo ot) const
342 { 350 {
343 HashMap<const ShadowRoot*, OwnPtr<RuleSet> >::const_iterator it = m_atHostRu les.find(shadowRoot); 351 HashMap<const ShadowRoot*, OwnPtr<RuleSet> >::const_iterator it = m_atHostRu les.find(shadowRoot);
344 return it != m_atHostRules.end() ? it->value.get() : 0; 352 return it != m_atHostRules.end() ? it->value.get() : 0;
345 } 353 }
346 354
347 void ScopedStyleResolver::matchHostRules(ElementRuleCollector& collector, bool i ncludeEmptyRules) 355 void ScopedStyleResolver::matchHostRules(ElementRuleCollector& collector, bool i ncludeEmptyRules)
348 { 356 {
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
419 collector.matchPageRules(m_authorStyle.get()); 427 collector.matchPageRules(m_authorStyle.get());
420 } 428 }
421 429
422 void ScopedStyleResolver::collectViewportRulesTo(StyleResolver* resolver) const 430 void ScopedStyleResolver::collectViewportRulesTo(StyleResolver* resolver) const
423 { 431 {
424 if (m_authorStyle) 432 if (m_authorStyle)
425 resolver->collectViewportRules(m_authorStyle.get()); 433 resolver->collectViewportRules(m_authorStyle.get());
426 } 434 }
427 435
428 } // namespace WebCore 436 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/CSSParser-in.cpp ('k') | Source/core/css/resolver/StyleResolver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698