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

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

Issue 129633003: Add a first pass of a class descendant invalidator, and a containing RuleSetAnalyzer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Implement tree walk for descendant class invalidation. Created 6 years, 11 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/resolver/StyleResolver.h ('k') | Source/core/dom/Document.h » ('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, 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 644 matching lines...) Expand 10 before | Expand all | Expand 10 after
655 655
656 if (element == document().documentElement()) 656 if (element == document().documentElement())
657 resetDirectionAndWritingModeOnDocument(document()); 657 resetDirectionAndWritingModeOnDocument(document());
658 StyleResolverState state(document(), element, defaultParent, regionForStylin g); 658 StyleResolverState state(document(), element, defaultParent, regionForStylin g);
659 659
660 if (sharingBehavior == AllowStyleSharing && !state.distributedToInsertionPoi nt() && state.parentStyle()) { 660 if (sharingBehavior == AllowStyleSharing && !state.distributedToInsertionPoi nt() && state.parentStyle()) {
661 SharedStyleFinder styleFinder(state.elementContext(), m_features, m_sibl ingRuleSet.get(), m_uncommonAttributeRuleSet.get(), *this); 661 SharedStyleFinder styleFinder(state.elementContext(), m_features, m_sibl ingRuleSet.get(), m_uncommonAttributeRuleSet.get(), *this);
662 if (RefPtr<RenderStyle> sharedStyle = styleFinder.findSharedStyle()) 662 if (RefPtr<RenderStyle> sharedStyle = styleFinder.findSharedStyle())
663 return sharedStyle.release(); 663 return sharedStyle.release();
664 } 664 }
665
666 if (state.parentStyle()) { 665 if (state.parentStyle()) {
667 state.setStyle(RenderStyle::create()); 666 state.setStyle(RenderStyle::create());
668 state.style()->inheritFrom(state.parentStyle(), isAtShadowBoundary(eleme nt) ? RenderStyle::AtShadowBoundary : RenderStyle::NotAtShadowBoundary); 667 state.style()->inheritFrom(state.parentStyle(), isAtShadowBoundary(eleme nt) ? RenderStyle::AtShadowBoundary : RenderStyle::NotAtShadowBoundary);
669 } else { 668 } else {
670 state.setStyle(defaultStyleForElement()); 669 state.setStyle(defaultStyleForElement());
671 state.setParentStyle(RenderStyle::clone(state.style())); 670 state.setParentStyle(RenderStyle::clone(state.style()));
672 } 671 }
673 // contenteditable attribute (implemented by -webkit-user-modify) should 672 // contenteditable attribute (implemented by -webkit-user-modify) should
674 // be propagated from shadow host to distributed node. 673 // be propagated from shadow host to distributed node.
675 if (state.distributedToInsertionPoint()) { 674 if (state.distributedToInsertionPoint()) {
(...skipping 838 matching lines...) Expand 10 before | Expand all | Expand 10 after
1514 bool StyleResolver::mediaQueryAffectedByViewportChange() const 1513 bool StyleResolver::mediaQueryAffectedByViewportChange() const
1515 { 1514 {
1516 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) { 1515 for (unsigned i = 0; i < m_viewportDependentMediaQueryResults.size(); ++i) {
1517 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio n) != m_viewportDependentMediaQueryResults[i]->m_result) 1516 if (m_medium->eval(&m_viewportDependentMediaQueryResults[i]->m_expressio n) != m_viewportDependentMediaQueryResults[i]->m_result)
1518 return true; 1517 return true;
1519 } 1518 }
1520 return false; 1519 return false;
1521 } 1520 }
1522 1521
1523 } // namespace WebCore 1522 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/css/resolver/StyleResolver.h ('k') | Source/core/dom/Document.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698