| 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 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 m_matchedRules.append(MatchedRule(rule, specificity, cascadeOrder, styleShee
tIndex, parentStyleSheet)); | 84 m_matchedRules.append(MatchedRule(rule, specificity, cascadeOrder, styleShee
tIndex, parentStyleSheet)); |
| 85 } | 85 } |
| 86 | 86 |
| 87 void ElementRuleCollector::clearMatchedRules() | 87 void ElementRuleCollector::clearMatchedRules() |
| 88 { | 88 { |
| 89 m_matchedRules.clear(); | 89 m_matchedRules.clear(); |
| 90 } | 90 } |
| 91 | 91 |
| 92 inline StyleRuleList* ElementRuleCollector::ensureStyleRuleList() | 92 inline StyleRuleList* ElementRuleCollector::ensureStyleRuleList() |
| 93 { | 93 { |
| 94 #if ENABLE(OILPAN) |
| 95 if (!m_styleRuleList) |
| 96 m_styleRuleList = new StyleRuleList(); |
| 97 return m_styleRuleList; |
| 98 #else |
| 94 if (!m_styleRuleList) | 99 if (!m_styleRuleList) |
| 95 m_styleRuleList = StyleRuleList::create(); | 100 m_styleRuleList = StyleRuleList::create(); |
| 96 return m_styleRuleList.get(); | 101 return m_styleRuleList.get(); |
| 102 #endif |
| 97 } | 103 } |
| 98 | 104 |
| 99 inline StaticCSSRuleList* ElementRuleCollector::ensureRuleList() | 105 inline StaticCSSRuleList* ElementRuleCollector::ensureRuleList() |
| 100 { | 106 { |
| 101 if (!m_cssRuleList) | 107 if (!m_cssRuleList) |
| 102 m_cssRuleList = StaticCSSRuleList::create(); | 108 m_cssRuleList = StaticCSSRuleList::create(); |
| 103 return m_cssRuleList.get(); | 109 return m_cssRuleList.get(); |
| 104 } | 110 } |
| 105 | 111 |
| 106 void ElementRuleCollector::addElementStyleProperties(const StylePropertySet* pro
pertySet, bool isCacheable) | 112 void ElementRuleCollector::addElementStyleProperties(const StylePropertySet* pro
pertySet, bool isCacheable) |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 | 234 |
| 229 void ElementRuleCollector::sortAndTransferMatchedRules() | 235 void ElementRuleCollector::sortAndTransferMatchedRules() |
| 230 { | 236 { |
| 231 if (m_matchedRules.isEmpty()) | 237 if (m_matchedRules.isEmpty()) |
| 232 return; | 238 return; |
| 233 | 239 |
| 234 sortMatchedRules(); | 240 sortMatchedRules(); |
| 235 | 241 |
| 236 if (m_mode == SelectorChecker::CollectingStyleRules) { | 242 if (m_mode == SelectorChecker::CollectingStyleRules) { |
| 237 for (unsigned i = 0; i < m_matchedRules.size(); ++i) | 243 for (unsigned i = 0; i < m_matchedRules.size(); ++i) |
| 238 ensureStyleRuleList()->m_list.append(m_matchedRules[i].ruleData()->r
ule()); | 244 ensureStyleRuleList()->append(m_matchedRules[i].ruleData()->rule()); |
| 239 return; | 245 return; |
| 240 } | 246 } |
| 241 | 247 |
| 242 if (m_mode == SelectorChecker::CollectingCSSRules) { | 248 if (m_mode == SelectorChecker::CollectingCSSRules) { |
| 243 for (unsigned i = 0; i < m_matchedRules.size(); ++i) | 249 for (unsigned i = 0; i < m_matchedRules.size(); ++i) |
| 244 appendCSSOMWrapperForRule(const_cast<CSSStyleSheet*>(m_matchedRules[
i].parentStyleSheet()), m_matchedRules[i].ruleData()->rule()); | 250 appendCSSOMWrapperForRule(const_cast<CSSStyleSheet*>(m_matchedRules[
i].parentStyleSheet()), m_matchedRules[i].ruleData()->rule()); |
| 245 return; | 251 return; |
| 246 } | 252 } |
| 247 | 253 |
| 248 // Now transfer the set of matched rules over to our list of declarations. | 254 // Now transfer the set of matched rules over to our list of declarations. |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 // should not see the element's treescope. Because RuleSet has no | 347 // should not see the element's treescope. Because RuleSet has no |
| 342 // information about "scope". | 348 // information about "scope". |
| 343 int firstRuleIndex = -1, lastRuleIndex = -1; | 349 int firstRuleIndex = -1, lastRuleIndex = -1; |
| 344 RuleRange ruleRange(firstRuleIndex, lastRuleIndex); | 350 RuleRange ruleRange(firstRuleIndex, lastRuleIndex); |
| 345 collectMatchingRules(MatchRequest(ruleSet), ruleRange); | 351 collectMatchingRules(MatchRequest(ruleSet), ruleRange); |
| 346 | 352 |
| 347 return !m_matchedRules.isEmpty(); | 353 return !m_matchedRules.isEmpty(); |
| 348 } | 354 } |
| 349 | 355 |
| 350 } // namespace blink | 356 } // namespace blink |
| OLD | NEW |