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

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

Issue 222643002: Support tag names as invalidation set features. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased. Created 6 years, 8 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 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 } 102 }
103 } 103 }
104 104
105 // This method is somewhat conservative in what it accepts. 105 // This method is somewhat conservative in what it accepts.
106 RuleFeatureSet::InvalidationSetMode RuleFeatureSet::invalidationSetModeForSelect or(const CSSSelector& selector) 106 RuleFeatureSet::InvalidationSetMode RuleFeatureSet::invalidationSetModeForSelect or(const CSSSelector& selector)
107 { 107 {
108 bool foundDescendantRelation = false; 108 bool foundDescendantRelation = false;
109 bool foundIdent = false; 109 bool foundIdent = false;
110 for (const CSSSelector* component = &selector; component; component = compon ent->tagHistory()) { 110 for (const CSSSelector* component = &selector; component; component = compon ent->tagHistory()) {
111 111
112 // FIXME: next up: Tag. 112 if (component->m_match == CSSSelector::Class || component->m_match == CS SSelector::Id
113 if (component->m_match == CSSSelector::Class || component->m_match == CS SSelector::Id || component->isAttributeSelector() || component->isCustomPseudoEl ement()) { 113 || (component->m_match == CSSSelector::Tag && component->tagQName(). localName() != starAtom)
114 || component->isAttributeSelector() || component->isCustomPseudoElem ent()) {
114 if (!foundDescendantRelation) 115 if (!foundDescendantRelation)
115 foundIdent = true; 116 foundIdent = true;
116 } else if (component->pseudoType() == CSSSelector::PseudoHost || compone nt->pseudoType() == CSSSelector::PseudoAny) { 117 } else if (component->pseudoType() == CSSSelector::PseudoHost || compone nt->pseudoType() == CSSSelector::PseudoAny) {
117 if (const CSSSelectorList* selectorList = component->selectorList()) { 118 if (const CSSSelectorList* selectorList = component->selectorList()) {
118 for (const CSSSelector* selector = selectorList->first(); select or; selector = CSSSelectorList::next(*selector)) { 119 for (const CSSSelector* selector = selectorList->first(); select or; selector = CSSSelectorList::next(*selector)) {
119 InvalidationSetMode hostMode = invalidationSetModeForSelecto r(*selector); 120 InvalidationSetMode hostMode = invalidationSetModeForSelecto r(*selector);
120 if (hostMode == UseSubtreeStyleChange) 121 if (hostMode == UseSubtreeStyleChange)
121 return foundDescendantRelation ? UseLocalStyleChange : U seSubtreeStyleChange; 122 return foundDescendantRelation ? UseLocalStyleChange : U seSubtreeStyleChange;
122 if (!foundDescendantRelation && hostMode == AddFeatures) 123 if (!foundDescendantRelation && hostMode == AddFeatures)
123 foundIdent = true; 124 foundIdent = true;
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
426 if (RefPtr<DescendantInvalidationSet> invalidationSet = m_classInvalidationS ets.get(className)) 427 if (RefPtr<DescendantInvalidationSet> invalidationSet = m_classInvalidationS ets.get(className))
427 m_styleInvalidator.scheduleInvalidation(invalidationSet, element); 428 m_styleInvalidator.scheduleInvalidation(invalidationSet, element);
428 } 429 }
429 430
430 StyleInvalidator& RuleFeatureSet::styleInvalidator() 431 StyleInvalidator& RuleFeatureSet::styleInvalidator()
431 { 432 {
432 return m_styleInvalidator; 433 return m_styleInvalidator;
433 } 434 }
434 435
435 } // namespace WebCore 436 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/layout/display-none-no-relayout.html ('k') | Source/core/css/invalidation/DescendantInvalidationSet.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698