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 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 for (unsigned i = 0; i < rules.size(); ++i) { | 201 for (unsigned i = 0; i < rules.size(); ++i) { |
202 const MinimalRuleData& info = rules[i]; | 202 const MinimalRuleData& info = rules[i]; |
203 ruleSet->addRule(info.m_rule, info.m_selectorIndex, info.m_flags); | 203 ruleSet->addRule(info.m_rule, info.m_selectorIndex, info.m_flags); |
204 } | 204 } |
205 } | 205 } |
206 | 206 |
207 void ScopedStyleResolver::addTreeBoundaryCrossingRules(const RuleSet& authorRule
s, CSSStyleSheet* parentStyleSheet, unsigned sheetIndex) | 207 void ScopedStyleResolver::addTreeBoundaryCrossingRules(const RuleSet& authorRule
s, CSSStyleSheet* parentStyleSheet, unsigned sheetIndex) |
208 { | 208 { |
209 bool isDocumentScope = treeScope().rootNode().isDocumentNode(); | 209 bool isDocumentScope = treeScope().rootNode().isDocumentNode(); |
210 if (authorRules.deepCombinatorOrShadowPseudoRules().isEmpty() | 210 if (authorRules.deepCombinatorOrShadowPseudoRules().isEmpty() |
211 && (isDocumentScope || (authorRules.shadowDistributedRules().isEmpty() &
& authorRules.shadowSlottedRules().isEmpty()))) | 211 && (isDocumentScope || (authorRules.contentPseudoElementRules().isEmpty(
) && authorRules.slottedPseudoElementRules().isEmpty()))) |
212 return; | 212 return; |
213 | 213 |
214 if (!authorRules.deepCombinatorOrShadowPseudoRules().isEmpty()) | 214 if (!authorRules.deepCombinatorOrShadowPseudoRules().isEmpty()) |
215 m_hasDeepOrShadowSelector = true; | 215 m_hasDeepOrShadowSelector = true; |
216 | 216 |
217 OwnPtrWillBeRawPtr<RuleSet> ruleSetForScope = RuleSet::create(); | 217 OwnPtrWillBeRawPtr<RuleSet> ruleSetForScope = RuleSet::create(); |
218 addRules(ruleSetForScope.get(), authorRules.deepCombinatorOrShadowPseudoRule
s()); | 218 addRules(ruleSetForScope.get(), authorRules.deepCombinatorOrShadowPseudoRule
s()); |
219 | 219 |
220 if (!isDocumentScope) { | 220 if (!isDocumentScope) { |
221 addRules(ruleSetForScope.get(), authorRules.shadowDistributedRules()); | 221 addRules(ruleSetForScope.get(), authorRules.contentPseudoElementRules())
; |
222 addRules(ruleSetForScope.get(), authorRules.shadowSlottedRules()); | 222 addRules(ruleSetForScope.get(), authorRules.slottedPseudoElementRules())
; |
223 } | 223 } |
224 | 224 |
225 if (!m_treeBoundaryCrossingRuleSet) { | 225 if (!m_treeBoundaryCrossingRuleSet) { |
226 m_treeBoundaryCrossingRuleSet = adoptPtrWillBeNoop(new CSSStyleSheetRule
SubSet()); | 226 m_treeBoundaryCrossingRuleSet = adoptPtrWillBeNoop(new CSSStyleSheetRule
SubSet()); |
227 treeScope().document().styleResolver()->addTreeBoundaryCrossingScope(tre
eScope().rootNode()); | 227 treeScope().document().styleResolver()->addTreeBoundaryCrossingScope(tre
eScope().rootNode()); |
228 } | 228 } |
229 | 229 |
230 m_treeBoundaryCrossingRuleSet->append(RuleSubSet::create(parentStyleSheet, s
heetIndex, ruleSetForScope.release())); | 230 m_treeBoundaryCrossingRuleSet->append(RuleSubSet::create(parentStyleSheet, s
heetIndex, ruleSetForScope.release())); |
231 } | 231 } |
232 | 232 |
233 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) | 233 DEFINE_TRACE(ScopedStyleResolver::RuleSubSet) |
234 { | 234 { |
235 visitor->trace(m_parentStyleSheet); | 235 visitor->trace(m_parentStyleSheet); |
236 visitor->trace(m_ruleSet); | 236 visitor->trace(m_ruleSet); |
237 } | 237 } |
238 | 238 |
239 } // namespace blink | 239 } // namespace blink |
OLD | NEW |