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 17 matching lines...) Expand all Loading... |
28 #include "core/css/resolver/ScopedStyleResolver.h" | 28 #include "core/css/resolver/ScopedStyleResolver.h" |
29 | 29 |
30 #include "core/HTMLNames.h" | 30 #include "core/HTMLNames.h" |
31 #include "core/css/CSSFontSelector.h" | 31 #include "core/css/CSSFontSelector.h" |
32 #include "core/css/CSSStyleSheet.h" | 32 #include "core/css/CSSStyleSheet.h" |
33 #include "core/css/FontFace.h" | 33 #include "core/css/FontFace.h" |
34 #include "core/css/PageRuleCollector.h" | 34 #include "core/css/PageRuleCollector.h" |
35 #include "core/css/RuleFeature.h" | 35 #include "core/css/RuleFeature.h" |
36 #include "core/css/StyleRule.h" | 36 #include "core/css/StyleRule.h" |
37 #include "core/css/StyleSheetContents.h" | 37 #include "core/css/StyleSheetContents.h" |
38 #include "core/css/resolver/StyleResolver.h" // For MatchRequest. | 38 #include "core/css/resolver/MatchRequest.h" |
39 #include "core/css/resolver/ViewportStyleResolver.h" | 39 #include "core/css/resolver/ViewportStyleResolver.h" |
40 #include "core/dom/Document.h" | 40 #include "core/dom/Document.h" |
41 #include "core/dom/StyleEngine.h" | 41 #include "core/dom/StyleEngine.h" |
42 #include "core/dom/shadow/ElementShadow.h" | 42 #include "core/dom/shadow/ElementShadow.h" |
43 #include "core/dom/shadow/ShadowRoot.h" | 43 #include "core/dom/shadow/ShadowRoot.h" |
44 #include "core/html/HTMLStyleElement.h" | 44 #include "core/html/HTMLStyleElement.h" |
45 #include "core/svg/SVGStyleElement.h" | 45 #include "core/svg/SVGStyleElement.h" |
46 | 46 |
47 namespace blink { | 47 namespace blink { |
48 | 48 |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 } | 196 } |
197 | 197 |
198 void ScopedStyleResolver::matchPageRules(PageRuleCollector& collector) | 198 void ScopedStyleResolver::matchPageRules(PageRuleCollector& collector) |
199 { | 199 { |
200 // Only consider the global author RuleSet for @page rules, as per the HTML5
spec. | 200 // Only consider the global author RuleSet for @page rules, as per the HTML5
spec. |
201 ASSERT(m_scope->rootNode().isDocumentNode()); | 201 ASSERT(m_scope->rootNode().isDocumentNode()); |
202 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) | 202 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) |
203 collector.matchPageRules(&m_authorStyleSheets[i]->contents()->ruleSet())
; | 203 collector.matchPageRules(&m_authorStyleSheets[i]->contents()->ruleSet())
; |
204 } | 204 } |
205 | 205 |
206 void ScopedStyleResolver::collectViewportRulesTo(StyleResolver* resolver) const | 206 void ScopedStyleResolver::collectViewportRulesTo(ViewportStyleResolver* resolver
) const |
207 { | 207 { |
208 if (!m_scope->rootNode().isDocumentNode()) | 208 if (!m_scope->rootNode().isDocumentNode()) |
209 return; | 209 return; |
210 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) | 210 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) |
211 resolver->viewportStyleResolver()->collectViewportRules(&m_authorStyleSh
eets[i]->contents()->ruleSet(), ViewportStyleResolver::AuthorOrigin); | 211 resolver->collectViewportRules(&m_authorStyleSheets[i]->contents()->rule
Set(), ViewportStyleResolver::AuthorOrigin); |
212 } | 212 } |
213 | 213 |
214 DEFINE_TRACE(ScopedStyleResolver) | 214 DEFINE_TRACE(ScopedStyleResolver) |
215 { | 215 { |
216 #if ENABLE(OILPAN) | 216 #if ENABLE(OILPAN) |
217 visitor->trace(m_scope); | 217 visitor->trace(m_scope); |
218 visitor->trace(m_authorStyleSheets); | 218 visitor->trace(m_authorStyleSheets); |
219 visitor->trace(m_keyframesRuleMap); | 219 visitor->trace(m_keyframesRuleMap); |
220 visitor->trace(m_treeBoundaryCrossingRuleSet); | 220 visitor->trace(m_treeBoundaryCrossingRuleSet); |
221 #endif | 221 #endif |
(...skipping 26 matching lines...) Expand all Loading... |
248 | 248 |
249 m_treeBoundaryCrossingRuleSet->append(RuleSubSet::create(parentStyleSheet, s
heetIndex, ruleSetForScope.release())); | 249 m_treeBoundaryCrossingRuleSet->append(RuleSubSet::create(parentStyleSheet, s
heetIndex, ruleSetForScope.release())); |
250 } | 250 } |
251 | 251 |
252 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) | 252 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) |
253 { | 253 { |
254 visitor->trace(m_ruleSet); | 254 visitor->trace(m_ruleSet); |
255 } | 255 } |
256 | 256 |
257 } // namespace blink | 257 } // namespace blink |
OLD | NEW |