| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/RuleFeature.h" | 5 #include "core/css/RuleFeature.h" |
| 6 | 6 |
| 7 #include "core/css/CSSSelectorList.h" | 7 #include "core/css/CSSSelectorList.h" |
| 8 #include "core/css/RuleSet.h" | 8 #include "core/css/RuleSet.h" |
| 9 #include "core/css/StylePropertySet.h" | 9 #include "core/css/StylePropertySet.h" |
| 10 #include "core/css/StyleRule.h" | 10 #include "core/css/StyleRule.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 m_document = HTMLDocument::create(); | 30 m_document = HTMLDocument::create(); |
| 31 RefPtrWillBeRawPtr<HTMLHtmlElement> html = HTMLHtmlElement::create(*m_do
cument); | 31 RefPtrWillBeRawPtr<HTMLHtmlElement> html = HTMLHtmlElement::create(*m_do
cument); |
| 32 html->appendChild(HTMLBodyElement::create(*m_document)); | 32 html->appendChild(HTMLBodyElement::create(*m_document)); |
| 33 m_document->appendChild(html.release()); | 33 m_document->appendChild(html.release()); |
| 34 | 34 |
| 35 m_document->body()->setInnerHTML("<b><i></i></b>", ASSERT_NO_EXCEPTION); | 35 m_document->body()->setInnerHTML("<b><i></i></b>", ASSERT_NO_EXCEPTION); |
| 36 } | 36 } |
| 37 | 37 |
| 38 void updateInvalidationSets(const String& selectorText) | 38 void updateInvalidationSets(const String& selectorText) |
| 39 { | 39 { |
| 40 CSSSelectorList selectorList = CSSParser::parseSelector(strictCSSParserC
ontext(), selectorText); | 40 CSSSelectorList selectorList = CSSParser::parseSelector(strictCSSParserC
ontext(), nullptr, selectorText); |
| 41 | 41 |
| 42 RefPtrWillBeRawPtr<StyleRule> styleRule = StyleRule::create(std::move(se
lectorList), MutableStylePropertySet::create(HTMLStandardMode)); | 42 RefPtrWillBeRawPtr<StyleRule> styleRule = StyleRule::create(std::move(se
lectorList), MutableStylePropertySet::create(HTMLStandardMode)); |
| 43 RuleData ruleData(styleRule.get(), 0, 0, RuleHasNoSpecialState); | 43 RuleData ruleData(styleRule.get(), 0, 0, RuleHasNoSpecialState); |
| 44 m_ruleFeatureSet.updateInvalidationSets(ruleData); | 44 m_ruleFeatureSet.updateInvalidationSets(ruleData); |
| 45 } | 45 } |
| 46 | 46 |
| 47 void collectInvalidationSetsForClass(InvalidationLists& invalidationLists, c
onst AtomicString& className) const | 47 void collectInvalidationSetsForClass(InvalidationLists& invalidationLists, c
onst AtomicString& className) const |
| 48 { | 48 { |
| 49 Element* element = Traversal<HTMLElement>::firstChild(*Traversal<HTMLEle
ment>::firstChild(*m_document->body())); | 49 Element* element = Traversal<HTMLElement>::firstChild(*Traversal<HTMLEle
ment>::firstChild(*m_document->body())); |
| 50 m_ruleFeatureSet.collectInvalidationSetsForClass(invalidationLists, *ele
ment, className); | 50 m_ruleFeatureSet.collectInvalidationSetsForClass(invalidationLists, *ele
ment, className); |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 expectClassInvalidation("c", invalidationLists.descendants); | 331 expectClassInvalidation("c", invalidationLists.descendants); |
| 332 | 332 |
| 333 updateInvalidationSets(".a .b"); | 333 updateInvalidationSets(".a .b"); |
| 334 | 334 |
| 335 invalidationLists.descendants.clear(); | 335 invalidationLists.descendants.clear(); |
| 336 collectInvalidationSetsForClass(invalidationLists, "a"); | 336 collectInvalidationSetsForClass(invalidationLists, "a"); |
| 337 expectClassesInvalidation("b", "c", invalidationLists.descendants); | 337 expectClassesInvalidation("b", "c", invalidationLists.descendants); |
| 338 } | 338 } |
| 339 | 339 |
| 340 } // namespace blink | 340 } // namespace blink |
| OLD | NEW |