| OLD | NEW |
| 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 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 | 109 |
| 110 for (Node* node : m_styleSheetCandidateNodes) { | 110 for (Node* node : m_styleSheetCandidateNodes) { |
| 111 ASSERT(isHTMLStyleElement(*node)); | 111 ASSERT(isHTMLStyleElement(*node)); |
| 112 CSSStyleSheet* sheet = toHTMLStyleElement(node)->sheet(); | 112 CSSStyleSheet* sheet = toHTMLStyleElement(node)->sheet(); |
| 113 if (sheet && (!sheet->mediaQueries() || medium.eval(sheet->mediaQueries(
)))) { | 113 if (sheet && (!sheet->mediaQueries() || medium.eval(sheet->mediaQueries(
)))) { |
| 114 sheets.append(sheet); | 114 sheets.append(sheet); |
| 115 } | 115 } |
| 116 } | 116 } |
| 117 } | 117 } |
| 118 | 118 |
| 119 const StyleRuleKeyframes* ScopedStyleResolver::keyframeStylesForAnimation(String
animationName) | |
| 120 { | |
| 121 for (auto& sheet : m_authorStyleSheets) { | |
| 122 // TODO(esprehn): Maybe just store the keyframes in a map? | |
| 123 for (auto& rule : sheet->contents()->ensureRuleSet().keyframesRules()) { | |
| 124 if (rule->name() == animationName) | |
| 125 return rule.get(); | |
| 126 } | |
| 127 } | |
| 128 return nullptr; | |
| 129 } | |
| 130 | |
| 131 void ScopedStyleResolver::collectMatchingAuthorRules(ElementRuleCollector& colle
ctor, CascadeOrder cascadeOrder) | 119 void ScopedStyleResolver::collectMatchingAuthorRules(ElementRuleCollector& colle
ctor, CascadeOrder cascadeOrder) |
| 132 { | 120 { |
| 133 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) { | 121 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) { |
| 134 MatchRequest matchRequest(&m_authorStyleSheets[i]->contents()->ensureRul
eSet(), m_authorStyleSheets[i].get(), i); | 122 MatchRequest matchRequest(&m_authorStyleSheets[i]->contents()->ensureRul
eSet(), m_authorStyleSheets[i].get(), i); |
| 135 collector.collectMatchingRules(matchRequest, cascadeOrder); | 123 collector.collectMatchingRules(matchRequest, cascadeOrder); |
| 136 } | 124 } |
| 137 } | 125 } |
| 138 | 126 |
| 139 void ScopedStyleResolver::collectMatchingHostRules(ElementRuleCollector& collect
or, CascadeOrder cascadeOrder) | 127 void ScopedStyleResolver::collectMatchingHostRules(ElementRuleCollector& collect
or, CascadeOrder cascadeOrder) |
| 140 { | 128 { |
| 141 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) { | 129 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) { |
| 142 MatchRequest matchRequest(&m_authorStyleSheets[i]->contents()->ensureRul
eSet(), m_authorStyleSheets[i].get(), i); | 130 MatchRequest matchRequest(&m_authorStyleSheets[i]->contents()->ensureRul
eSet(), m_authorStyleSheets[i].get(), i); |
| 143 collector.collectMatchingHostRules(matchRequest, cascadeOrder); | 131 collector.collectMatchingHostRules(matchRequest, cascadeOrder); |
| 144 } | 132 } |
| 145 } | 133 } |
| 146 | 134 |
| 147 } // namespace blink | 135 } // namespace blink |
| OLD | NEW |