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

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

Issue 1706793002: Don't add to uncommonAttributeRules for non-sharable cases. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp ('k') | no next file » | 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 static bool containsUncommonAttributeSelector(const CSSSelector& selector) 72 static bool containsUncommonAttributeSelector(const CSSSelector& selector)
73 { 73 {
74 const CSSSelector* current = &selector; 74 const CSSSelector* current = &selector;
75 for (; current; current = current->tagHistory()) { 75 for (; current; current = current->tagHistory()) {
76 // Allow certain common attributes (used in the default style) in the se lectors that match the current element. 76 // Allow certain common attributes (used in the default style) in the se lectors that match the current element.
77 if (current->isAttributeSelector() && !isCommonAttributeSelectorAttribut e(current->attribute())) 77 if (current->isAttributeSelector() && !isCommonAttributeSelectorAttribut e(current->attribute()))
78 return true; 78 return true;
79 if (selectorListContainsUncommonAttributeSelector(current)) 79 if (selectorListContainsUncommonAttributeSelector(current))
80 return true; 80 return true;
81 if (current->relationIsAffectedByPseudoContent()
82 || current->pseudoType() == CSSSelector::PseudoHost
83 || current->pseudoType() == CSSSelector::PseudoHostContext
84 || current->pseudoType() == CSSSelector::PseudoSlotted) {
85 return false;
86 }
81 if (current->relation() != CSSSelector::SubSelector) { 87 if (current->relation() != CSSSelector::SubSelector) {
82 current = current->tagHistory(); 88 current = current->tagHistory();
83 break; 89 break;
84 } 90 }
85 } 91 }
86 92
87 for (; current; current = current->tagHistory()) { 93 for (; current; current = current->tagHistory()) {
88 if (current->isAttributeSelector()) 94 if (current->isAttributeSelector())
89 return true; 95 return true;
90 if (selectorListContainsUncommonAttributeSelector(current)) 96 if (selectorListContainsUncommonAttributeSelector(current))
(...skipping 307 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 404
399 #ifndef NDEBUG 405 #ifndef NDEBUG
400 void RuleSet::show() const 406 void RuleSet::show() const
401 { 407 {
402 for (const auto& rule: m_allRules) 408 for (const auto& rule: m_allRules)
403 rule.selector().show(); 409 rule.selector().show();
404 } 410 }
405 #endif 411 #endif
406 412
407 } // namespace blink 413 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/css/RuleFeatureSetTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698