| 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 21 matching lines...) Expand all Loading... |
| 32 #include "sky/engine/core/css/StyleRule.h" | 32 #include "sky/engine/core/css/StyleRule.h" |
| 33 #include "sky/engine/core/css/StyleSheetContents.h" | 33 #include "sky/engine/core/css/StyleSheetContents.h" |
| 34 #include "sky/engine/core/css/resolver/StyleResolver.h" | 34 #include "sky/engine/core/css/resolver/StyleResolver.h" |
| 35 #include "sky/engine/core/dom/Document.h" | 35 #include "sky/engine/core/dom/Document.h" |
| 36 #include "sky/engine/core/dom/shadow/ElementShadow.h" | 36 #include "sky/engine/core/dom/shadow/ElementShadow.h" |
| 37 #include "sky/engine/core/dom/shadow/ShadowRoot.h" | 37 #include "sky/engine/core/dom/shadow/ShadowRoot.h" |
| 38 #include "sky/engine/core/html/HTMLStyleElement.h" | 38 #include "sky/engine/core/html/HTMLStyleElement.h" |
| 39 | 39 |
| 40 namespace blink { | 40 namespace blink { |
| 41 | 41 |
| 42 ScopedStyleResolver::ScopedStyleResolver(TreeScope& scope) |
| 43 : m_scope(scope) |
| 44 { |
| 45 } |
| 46 |
| 42 void ScopedStyleResolver::addRulesFromSheet(CSSStyleSheet* cssSheet, StyleResolv
er* resolver) | 47 void ScopedStyleResolver::addRulesFromSheet(CSSStyleSheet* cssSheet, StyleResolv
er* resolver) |
| 43 { | 48 { |
| 44 m_authorStyleSheets.append(cssSheet); | 49 m_authorStyleSheets.append(cssSheet); |
| 45 unsigned index = m_authorStyleSheets.size() - 1; | 50 unsigned index = m_authorStyleSheets.size() - 1; |
| 46 StyleSheetContents* sheet = cssSheet->contents(); | 51 StyleSheetContents* sheet = cssSheet->contents(); |
| 47 | 52 |
| 48 AddRuleFlags addRuleFlags = RuleHasNoSpecialState; | 53 AddRuleFlags addRuleFlags = RuleHasNoSpecialState; |
| 49 const RuleSet& ruleSet = sheet->ensureRuleSet(addRuleFlags); | 54 const RuleSet& ruleSet = sheet->ensureRuleSet(addRuleFlags); |
| 50 resolver->addMediaQueryResults(ruleSet.viewportDependentMediaQueryResults())
; | 55 resolver->addMediaQueryResults(ruleSet.viewportDependentMediaQueryResults())
; |
| 51 resolver->processScopedRules(ruleSet, cssSheet, index, treeScope().rootNode(
)); | 56 resolver->processScopedRules(ruleSet, cssSheet, index, treeScope().rootNode(
)); |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 100 contextFlags |= SelectorChecker::ScopeContainsLastMatchedElement; | 105 contextFlags |= SelectorChecker::ScopeContainsLastMatchedElement; |
| 101 | 106 |
| 102 RuleRange ruleRange = collector.matchedResult().ranges.authorRuleRange(); | 107 RuleRange ruleRange = collector.matchedResult().ranges.authorRuleRange(); |
| 103 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) { | 108 for (size_t i = 0; i < m_authorStyleSheets.size(); ++i) { |
| 104 MatchRequest matchRequest(&m_authorStyleSheets[i]->contents()->ruleSet()
, includeEmptyRules, &m_scope->rootNode(), m_authorStyleSheets[i], applyAuthorSt
yles, i); | 109 MatchRequest matchRequest(&m_authorStyleSheets[i]->contents()->ruleSet()
, includeEmptyRules, &m_scope->rootNode(), m_authorStyleSheets[i], applyAuthorSt
yles, i); |
| 105 collector.collectMatchingRules(matchRequest, ruleRange, static_cast<Sele
ctorChecker::ContextFlags>(contextFlags), cascadeScope, cascadeOrder); | 110 collector.collectMatchingRules(matchRequest, ruleRange, static_cast<Sele
ctorChecker::ContextFlags>(contextFlags), cascadeScope, cascadeOrder); |
| 106 } | 111 } |
| 107 } | 112 } |
| 108 | 113 |
| 109 } // namespace blink | 114 } // namespace blink |
| OLD | NEW |