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

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

Issue 2469143002: Make siblingRules and uncommonAttributeRules private. (Closed)
Patch Set: Compile fixes Created 4 years, 1 month 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 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "core/css/resolver/SharedStyleFinder.h" 5 #include "core/css/resolver/SharedStyleFinder.h"
6 6
7 #include "core/css/RuleFeature.h" 7 #include "core/css/RuleFeature.h"
8 #include "core/css/RuleSet.h" 8 #include "core/css/RuleSet.h"
9 #include "core/css/parser/CSSParser.h" 9 #include "core/css/parser/CSSParser.h"
10 #include "core/dom/Document.h" 10 #include "core/dom/Document.h"
(...skipping 19 matching lines...) Expand all
30 30
31 void addSelector(const String& selector) { 31 void addSelector(const String& selector) {
32 StyleRuleBase* newRule = 32 StyleRuleBase* newRule =
33 CSSParser::parseRule(CSSParserContext(HTMLStandardMode, nullptr), 33 CSSParser::parseRule(CSSParserContext(HTMLStandardMode, nullptr),
34 nullptr, selector + "{color:pink}"); 34 nullptr, selector + "{color:pink}");
35 m_ruleSet->addStyleRule(static_cast<StyleRule*>(newRule), 35 m_ruleSet->addStyleRule(static_cast<StyleRule*>(newRule),
36 RuleHasNoSpecialState); 36 RuleHasNoSpecialState);
37 } 37 }
38 38
39 void finishAddingSelectors() { 39 void finishAddingSelectors() {
40 m_siblingRuleSet = makeRuleSet(m_ruleSet->features().siblingRules); 40 m_siblingRuleSet = makeRuleSet(m_ruleSet->features().siblingRules());
41 m_uncommonAttributeRuleSet = 41 m_uncommonAttributeRuleSet =
42 makeRuleSet(m_ruleSet->features().uncommonAttributeRules); 42 makeRuleSet(m_ruleSet->features().uncommonAttributeRules());
43 } 43 }
44 44
45 bool matchesUncommonAttributeRuleSet(Element& element) { 45 bool matchesUncommonAttributeRuleSet(Element& element) {
46 return matchesRuleSet(element, m_uncommonAttributeRuleSet); 46 return matchesRuleSet(element, m_uncommonAttributeRuleSet);
47 } 47 }
48 48
49 private: 49 private:
50 void SetUp() override { 50 void SetUp() override {
51 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600)); 51 m_dummyPageHolder = DummyPageHolder::create(IntSize(800, 600));
52 m_ruleSet = RuleSet::create(); 52 m_ruleSet = RuleSet::create();
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 ASSERT_TRUE(b); 175 ASSERT_TRUE(b);
176 176
177 EXPECT_FALSE(a->isDragged()); 177 EXPECT_FALSE(a->isDragged());
178 EXPECT_FALSE(b->isDragged()); 178 EXPECT_FALSE(b->isDragged());
179 179
180 EXPECT_TRUE(matchesUncommonAttributeRuleSet(*a)); 180 EXPECT_TRUE(matchesUncommonAttributeRuleSet(*a));
181 EXPECT_FALSE(matchesUncommonAttributeRuleSet(*b)); 181 EXPECT_FALSE(matchesUncommonAttributeRuleSet(*b));
182 } 182 }
183 183
184 } // namespace blink 184 } // 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