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

Side by Side Diff: Source/core/css/resolver/StyleResolver.cpp

Issue 338673002: Reduce the number of CachedUAStyles (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Return a create that somehow escaped Created 6 years, 6 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
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, 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 563 matching lines...) Expand 10 before | Expand all | Expand 10 after
574 } 574 }
575 575
576 static void addContentAttrValuesToFeatures(const Vector<AtomicString>& contentAt trValues, RuleFeatureSet& features) 576 static void addContentAttrValuesToFeatures(const Vector<AtomicString>& contentAt trValues, RuleFeatureSet& features)
577 { 577 {
578 for (size_t i = 0; i < contentAttrValues.size(); ++i) 578 for (size_t i = 0; i < contentAttrValues.size(); ++i)
579 features.addContentAttr(contentAttrValues[i]); 579 features.addContentAttr(contentAttrValues[i]);
580 } 580 }
581 581
582 void StyleResolver::adjustRenderStyle(StyleResolverState& state, Element* elemen t) 582 void StyleResolver::adjustRenderStyle(StyleResolverState& state, Element* elemen t)
583 { 583 {
584 StyleAdjuster adjuster(state.cachedUAStyle(), m_document.inQuirksMode()); 584 StyleAdjuster adjuster(m_document.inQuirksMode());
585 adjuster.adjustRenderStyle(state.style(), state.parentStyle(), element); 585 adjuster.adjustRenderStyle(state.style(), state.parentStyle(), element, stat e.cachedUAStyle());
586 } 586 }
587 587
588 // Start loading resources referenced by this style. 588 // Start loading resources referenced by this style.
589 void StyleResolver::loadPendingResources(StyleResolverState& state) 589 void StyleResolver::loadPendingResources(StyleResolverState& state)
590 { 590 {
591 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources()); 591 m_styleResourceLoader.loadPendingResources(state.style(), state.elementStyle Resources());
592 document().styleEngine()->fontSelector()->fontLoader()->loadPendingFonts(); 592 document().styleEngine()->fontSelector()->fontLoader()->loadPendingFonts();
593 } 593 }
594 594
595 PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS tyle* defaultParent, StyleSharingBehavior sharingBehavior, 595 PassRefPtr<RenderStyle> StyleResolver::styleForElement(Element* element, RenderS tyle* defaultParent, StyleSharingBehavior sharingBehavior,
(...skipping 909 matching lines...) Expand 10 before | Expand all | Expand 10 after
1505 visitor->trace(m_viewportStyleResolver); 1505 visitor->trace(m_viewportStyleResolver);
1506 visitor->trace(m_features); 1506 visitor->trace(m_features);
1507 visitor->trace(m_siblingRuleSet); 1507 visitor->trace(m_siblingRuleSet);
1508 visitor->trace(m_uncommonAttributeRuleSet); 1508 visitor->trace(m_uncommonAttributeRuleSet);
1509 visitor->trace(m_watchedSelectorsRules); 1509 visitor->trace(m_watchedSelectorsRules);
1510 visitor->trace(m_treeBoundaryCrossingRules); 1510 visitor->trace(m_treeBoundaryCrossingRules);
1511 visitor->trace(m_pendingStyleSheets); 1511 visitor->trace(m_pendingStyleSheets);
1512 } 1512 }
1513 1513
1514 } // namespace WebCore 1514 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleAdjuster.cpp ('k') | Source/core/css/resolver/StyleResolverState.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698