OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) | 3 * (C) 2004-2005 Allan Sandfeld Jensen (kde@carewolf.com) |
4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) | 4 * Copyright (C) 2006, 2007 Nicholas Shanks (webkit@nickshanks.com) |
5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 Apple Inc.
All rights reserved. |
6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 6 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> | 7 * Copyright (C) 2007, 2008 Eric Seidel <eric@webkit.org> |
8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) | 8 * Copyright (C) 2008, 2009 Torch Mobile Inc. All rights reserved. (http://www.t
orchmobile.com/) |
9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. | 9 * Copyright (c) 2011, Code Aurora Forum. All rights reserved. |
10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 10 * Copyright (C) Research In Motion Limited 2011. All rights reserved. |
(...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 { | 183 { |
184 ASSERT(cssSheet); | 184 ASSERT(cssSheet); |
185 ASSERT(!cssSheet->disabled()); | 185 ASSERT(!cssSheet->disabled()); |
186 if (cssSheet->mediaQueries() && !m_medium->eval(cssSheet->mediaQueries(), &m
_viewportDependentMediaQueryResults)) | 186 if (cssSheet->mediaQueries() && !m_medium->eval(cssSheet->mediaQueries(), &m
_viewportDependentMediaQueryResults)) |
187 return; | 187 return; |
188 | 188 |
189 ContainerNode* scopingNode = ScopedStyleResolver::scopingNodeFor(document(),
cssSheet); | 189 ContainerNode* scopingNode = ScopedStyleResolver::scopingNodeFor(document(),
cssSheet); |
190 if (!scopingNode) | 190 if (!scopingNode) |
191 return; | 191 return; |
192 | 192 |
193 ScopedStyleResolver* resolver = ensureScopedStyleResolver(scopingNode); | 193 ScopedStyleResolver* resolver = m_styleTree.ensureScopedStyleResolver(*scopi
ngNode); |
194 ASSERT(resolver); | 194 ASSERT(resolver); |
195 resolver->addRulesFromSheet(cssSheet, *m_medium, this); | 195 resolver->addRulesFromSheet(cssSheet, *m_medium, this); |
196 } | 196 } |
197 | 197 |
198 void StyleResolver::appendPendingAuthorStyleSheets() | 198 void StyleResolver::appendPendingAuthorStyleSheets() |
199 { | 199 { |
200 setBuildScopedStyleTreeInDocumentOrder(false); | 200 setBuildScopedStyleTreeInDocumentOrder(false); |
201 for (WillBeHeapListHashSet<RawPtrWillBeMember<CSSStyleSheet>, 16>::iterator
it = m_pendingStyleSheets.begin(); it != m_pendingStyleSheets.end(); ++it) | 201 for (WillBeHeapListHashSet<RawPtrWillBeMember<CSSStyleSheet>, 16>::iterator
it = m_pendingStyleSheets.begin(); it != m_pendingStyleSheets.end(); ++it) |
202 appendCSSStyleSheet(*it); | 202 appendCSSStyleSheet(*it); |
203 | 203 |
(...skipping 28 matching lines...) Expand all Loading... |
232 m_features.clear(); | 232 m_features.clear(); |
233 m_siblingRuleSet.clear(); | 233 m_siblingRuleSet.clear(); |
234 m_uncommonAttributeRuleSet.clear(); | 234 m_uncommonAttributeRuleSet.clear(); |
235 m_needCollectFeatures = true; | 235 m_needCollectFeatures = true; |
236 } | 236 } |
237 | 237 |
238 void StyleResolver::processScopedRules(const RuleSet& authorRules, CSSStyleSheet
* parentStyleSheet, ContainerNode& scope) | 238 void StyleResolver::processScopedRules(const RuleSet& authorRules, CSSStyleSheet
* parentStyleSheet, ContainerNode& scope) |
239 { | 239 { |
240 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleKeyframes> > keyframesRul
es = authorRules.keyframesRules(); | 240 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleKeyframes> > keyframesRul
es = authorRules.keyframesRules(); |
241 for (unsigned i = 0; i < keyframesRules.size(); ++i) | 241 for (unsigned i = 0; i < keyframesRules.size(); ++i) |
242 ensureScopedStyleResolver(&scope)->addKeyframeStyle(keyframesRules[i]); | 242 m_styleTree.ensureScopedStyleResolver(scope)->addKeyframeStyle(keyframes
Rules[i]); |
243 | 243 |
244 m_treeBoundaryCrossingRules.addTreeBoundaryCrossingRules(authorRules, scope,
parentStyleSheet); | 244 m_treeBoundaryCrossingRules.addTreeBoundaryCrossingRules(authorRules, scope,
parentStyleSheet); |
245 | 245 |
246 // FIXME(BUG 72461): We don't add @font-face rules of scoped style sheets fo
r the moment. | 246 // FIXME(BUG 72461): We don't add @font-face rules of scoped style sheets fo
r the moment. |
247 if (scope.isDocumentNode()) { | 247 if (scope.isDocumentNode()) { |
248 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleFontFace> > fontFaceR
ules = authorRules.fontFaceRules(); | 248 const WillBeHeapVector<RawPtrWillBeMember<StyleRuleFontFace> > fontFaceR
ules = authorRules.fontFaceRules(); |
249 for (unsigned i = 0; i < fontFaceRules.size(); ++i) | 249 for (unsigned i = 0; i < fontFaceRules.size(); ++i) |
250 addFontFaceRule(&m_document, document().styleEngine()->fontSelector(
), fontFaceRules[i]); | 250 addFontFaceRule(&m_document, document().styleEngine()->fontSelector(
), fontFaceRules[i]); |
251 if (fontFaceRules.size()) | 251 if (fontFaceRules.size()) |
252 invalidateMatchedPropertiesCache(); | 252 invalidateMatchedPropertiesCache(); |
(...skipping 1342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1595 visitor->trace(m_viewportStyleResolver); | 1595 visitor->trace(m_viewportStyleResolver); |
1596 visitor->trace(m_features); | 1596 visitor->trace(m_features); |
1597 visitor->trace(m_siblingRuleSet); | 1597 visitor->trace(m_siblingRuleSet); |
1598 visitor->trace(m_uncommonAttributeRuleSet); | 1598 visitor->trace(m_uncommonAttributeRuleSet); |
1599 visitor->trace(m_watchedSelectorsRules); | 1599 visitor->trace(m_watchedSelectorsRules); |
1600 visitor->trace(m_treeBoundaryCrossingRules); | 1600 visitor->trace(m_treeBoundaryCrossingRules); |
1601 visitor->trace(m_pendingStyleSheets); | 1601 visitor->trace(m_pendingStyleSheets); |
1602 } | 1602 } |
1603 | 1603 |
1604 } // namespace WebCore | 1604 } // namespace WebCore |
OLD | NEW |