| 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 Apple Inc. All r
ights reserved. | 5 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012 Apple Inc. All r
ights 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 341 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 352 | 352 |
| 353 void RuleSet::addChildRules(const Vector<RefPtr<StyleRuleBase> >& rules, const M
ediaQueryEvaluator& medium, StyleResolver* resolver, const ContainerNode* scope,
bool hasDocumentSecurityOrigin, AddRuleFlags addRuleFlags) | 353 void RuleSet::addChildRules(const Vector<RefPtr<StyleRuleBase> >& rules, const M
ediaQueryEvaluator& medium, StyleResolver* resolver, const ContainerNode* scope,
bool hasDocumentSecurityOrigin, AddRuleFlags addRuleFlags) |
| 354 { | 354 { |
| 355 for (unsigned i = 0; i < rules.size(); ++i) { | 355 for (unsigned i = 0; i < rules.size(); ++i) { |
| 356 StyleRuleBase* rule = rules[i].get(); | 356 StyleRuleBase* rule = rules[i].get(); |
| 357 | 357 |
| 358 if (rule->isStyleRule()) { | 358 if (rule->isStyleRule()) { |
| 359 StyleRule* styleRule = static_cast<StyleRule*>(rule); | 359 StyleRule* styleRule = static_cast<StyleRule*>(rule); |
| 360 | 360 |
| 361 const CSSSelectorList& selectorList = styleRule->selectorList(); | 361 const CSSSelectorList& selectorList = styleRule->selectorList(); |
| 362 for (size_t selectorIndex = 0; selectorIndex != notFound; selectorIn
dex = selectorList.indexOfNextSelectorAfter(selectorIndex)) { | 362 for (size_t selectorIndex = 0; selectorIndex != kNotFound; selectorI
ndex = selectorList.indexOfNextSelectorAfter(selectorIndex)) { |
| 363 if (selectorList.hasShadowDistributedAt(selectorIndex)) { | 363 if (selectorList.hasShadowDistributedAt(selectorIndex)) { |
| 364 if (isDocumentScope(scope)) | 364 if (isDocumentScope(scope)) |
| 365 continue; | 365 continue; |
| 366 resolver->ruleSets().shadowDistributedRules().addRule(styleR
ule, selectorIndex, const_cast<ContainerNode*>(scope), addRuleFlags); | 366 resolver->ruleSets().shadowDistributedRules().addRule(styleR
ule, selectorIndex, const_cast<ContainerNode*>(scope), addRuleFlags); |
| 367 } else | 367 } else |
| 368 addRule(styleRule, selectorIndex, addRuleFlags); | 368 addRule(styleRule, selectorIndex, addRuleFlags); |
| 369 } | 369 } |
| 370 } else if (rule->isPageRule()) | 370 } else if (rule->isPageRule()) |
| 371 addPageRule(static_cast<StyleRulePage*>(rule)); | 371 addPageRule(static_cast<StyleRulePage*>(rule)); |
| 372 else if (rule->isMediaRule()) { | 372 else if (rule->isMediaRule()) { |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 } | 416 } |
| 417 | 417 |
| 418 bool hasDocumentSecurityOrigin = resolver && resolver->document().securityOr
igin()->canRequest(sheet->baseURL()); | 418 bool hasDocumentSecurityOrigin = resolver && resolver->document().securityOr
igin()->canRequest(sheet->baseURL()); |
| 419 AddRuleFlags addRuleFlags = static_cast<AddRuleFlags>((hasDocumentSecurityOr
igin ? RuleHasDocumentSecurityOrigin : 0) | (!scope ? RuleCanUseFastCheckSelecto
r : 0)); | 419 AddRuleFlags addRuleFlags = static_cast<AddRuleFlags>((hasDocumentSecurityOr
igin ? RuleHasDocumentSecurityOrigin : 0) | (!scope ? RuleCanUseFastCheckSelecto
r : 0)); |
| 420 | 420 |
| 421 addChildRules(sheet->childRules(), medium, resolver, scope, hasDocumentSecur
ityOrigin, addRuleFlags); | 421 addChildRules(sheet->childRules(), medium, resolver, scope, hasDocumentSecur
ityOrigin, addRuleFlags); |
| 422 } | 422 } |
| 423 | 423 |
| 424 void RuleSet::addStyleRule(StyleRule* rule, AddRuleFlags addRuleFlags) | 424 void RuleSet::addStyleRule(StyleRule* rule, AddRuleFlags addRuleFlags) |
| 425 { | 425 { |
| 426 for (size_t selectorIndex = 0; selectorIndex != notFound; selectorIndex = ru
le->selectorList().indexOfNextSelectorAfter(selectorIndex)) | 426 for (size_t selectorIndex = 0; selectorIndex != kNotFound; selectorIndex = r
ule->selectorList().indexOfNextSelectorAfter(selectorIndex)) |
| 427 addRule(rule, selectorIndex, addRuleFlags); | 427 addRule(rule, selectorIndex, addRuleFlags); |
| 428 } | 428 } |
| 429 | 429 |
| 430 void RuleSet::compactPendingRules(PendingRuleMap& pendingMap, CompactRuleMap& co
mpactMap) | 430 void RuleSet::compactPendingRules(PendingRuleMap& pendingMap, CompactRuleMap& co
mpactMap) |
| 431 { | 431 { |
| 432 PendingRuleMap::iterator end = pendingMap.end(); | 432 PendingRuleMap::iterator end = pendingMap.end(); |
| 433 for (PendingRuleMap::iterator it = pendingMap.begin(); it != end; ++it) { | 433 for (PendingRuleMap::iterator it = pendingMap.begin(); it != end; ++it) { |
| 434 OwnPtr<LinkedStack<RuleData> > pendingRules = it->value.release(); | 434 OwnPtr<LinkedStack<RuleData> > pendingRules = it->value.release(); |
| 435 CompactRuleMap::iterator compactRules = compactMap.add(it->key, nullptr)
.iterator; | 435 CompactRuleMap::iterator compactRules = compactMap.add(it->key, nullptr)
.iterator; |
| 436 | 436 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 455 compactPendingRules(pendingRules->shadowPseudoElementRules, m_shadowPseudoEl
ementRules); | 455 compactPendingRules(pendingRules->shadowPseudoElementRules, m_shadowPseudoEl
ementRules); |
| 456 m_linkPseudoClassRules.shrinkToFit(); | 456 m_linkPseudoClassRules.shrinkToFit(); |
| 457 m_cuePseudoRules.shrinkToFit(); | 457 m_cuePseudoRules.shrinkToFit(); |
| 458 m_focusPseudoClassRules.shrinkToFit(); | 458 m_focusPseudoClassRules.shrinkToFit(); |
| 459 m_universalRules.shrinkToFit(); | 459 m_universalRules.shrinkToFit(); |
| 460 m_pageRules.shrinkToFit(); | 460 m_pageRules.shrinkToFit(); |
| 461 m_viewportRules.shrinkToFit(); | 461 m_viewportRules.shrinkToFit(); |
| 462 } | 462 } |
| 463 | 463 |
| 464 } // namespace WebCore | 464 } // namespace WebCore |
| OLD | NEW |