Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(178)

Side by Side Diff: Source/core/css/RuleSet.cpp

Issue 23601011: Have StyleResolver / StyleResolverState deal with Document references, not pointers (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update StyleResolverState as well Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/css/CSSToStyleMap.cpp ('k') | Source/core/css/resolver/FilterOperationResolver.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 { 408 {
409 ASSERT(sheet); 409 ASSERT(sheet);
410 410
411 const Vector<RefPtr<StyleRuleImport> >& importRules = sheet->importRules(); 411 const Vector<RefPtr<StyleRuleImport> >& importRules = sheet->importRules();
412 for (unsigned i = 0; i < importRules.size(); ++i) { 412 for (unsigned i = 0; i < importRules.size(); ++i) {
413 StyleRuleImport* importRule = importRules[i].get(); 413 StyleRuleImport* importRule = importRules[i].get();
414 if (importRule->styleSheet() && (!importRule->mediaQueries() || medium.e val(importRule->mediaQueries(), resolver))) 414 if (importRule->styleSheet() && (!importRule->mediaQueries() || medium.e val(importRule->mediaQueries(), resolver)))
415 addRulesFromSheet(importRule->styleSheet(), medium, resolver, scope) ; 415 addRulesFromSheet(importRule->styleSheet(), medium, resolver, scope) ;
416 } 416 }
417 417
418 bool hasDocumentSecurityOrigin = resolver && resolver->document()->securityO rigin()->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 != notFound; selectorIndex = ru le->selectorList().indexOfNextSelectorAfter(selectorIndex))
427 addRule(rule, selectorIndex, addRuleFlags); 427 addRule(rule, selectorIndex, addRuleFlags);
428 } 428 }
(...skipping 26 matching lines...) Expand all
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
OLDNEW
« no previous file with comments | « Source/core/css/CSSToStyleMap.cpp ('k') | Source/core/css/resolver/FilterOperationResolver.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698