Changeset 287818 in webkit
- Timestamp:
- Jan 9, 2022, 1:01:48 AM (5 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 12 edited
-
ChangeLog (modified) (1 diff)
-
dom/Document.cpp (modified) (3 diffs)
-
dom/Element.cpp (modified) (4 diffs)
-
html/HTMLFieldSetElement.cpp (modified) (2 diffs)
-
html/HTMLFormControlElement.cpp (modified) (3 diffs)
-
html/HTMLFormElement.cpp (modified) (2 diffs)
-
html/HTMLInputElement.cpp (modified) (1 diff)
-
html/HTMLOptGroupElement.cpp (modified) (1 diff)
-
html/HTMLOptionElement.cpp (modified) (3 diffs)
-
page/EventHandler.cpp (modified) (1 diff)
-
style/PseudoClassChangeInvalidation.cpp (modified) (3 diffs)
-
style/PseudoClassChangeInvalidation.h (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r287817 r287818 1 2022-01-09 Antti Koivisto <antti@apple.com> 2 3 Use IsNegation bit for more efficient pseudo-class style invalidation 4 https://bugs.webkit.org/show_bug.cgi?id=235003 5 6 Reviewed by Simon Fraser. 7 8 We now know if a given invalidation ruleset is for negated context. We can use this to avoid 9 unnecessary traversal in pseudo-class invalidation, similar to what we already do with classes. 10 11 * dom/Document.cpp: 12 (WebCore::Document::updateHoverActiveState): 13 * dom/Element.cpp: 14 (WebCore::Element::setActive): 15 (WebCore::Element::setFocus): 16 (WebCore::Element::setHasFocusWithin): 17 (WebCore::Element::setHovered): 18 (WebCore::Element::setBeingDragged): 19 20 Provide the value for invalidation. 21 22 * html/HTMLFieldSetElement.cpp: 23 (WebCore::HTMLFieldSetElement::addInvalidDescendant): 24 (WebCore::HTMLFieldSetElement::removeInvalidDescendant): 25 * html/HTMLFormControlElement.cpp: 26 (WebCore::HTMLFormControlElement::setAncestorDisabled): 27 (WebCore::HTMLFormControlElement::parseAttribute): 28 (WebCore::HTMLFormControlElement::updateValidity): 29 * html/HTMLFormElement.cpp: 30 (WebCore::HTMLFormElement::registerInvalidAssociatedFormControl): 31 (WebCore::HTMLFormElement::removeInvalidAssociatedFormControlIfNeeded): 32 * html/HTMLInputElement.cpp: 33 (WebCore::HTMLInputElement::setChecked): 34 * html/HTMLOptGroupElement.cpp: 35 (WebCore::HTMLOptGroupElement::parseAttribute): 36 * html/HTMLOptionElement.cpp: 37 (WebCore::HTMLOptionElement::parseAttribute): 38 (WebCore::HTMLOptionElement::setSelectedState): 39 * page/EventHandler.cpp: 40 (WebCore::EventHandler::internalKeyEvent): 41 * style/PseudoClassChangeInvalidation.cpp: 42 (WebCore::Style::PseudoClassChangeInvalidation::computeInvalidation): 43 (WebCore::Style::PseudoClassChangeInvalidation::collectRuleSets): 44 45 Setting a pseudo-class can only make a regular selector (not inside :not()) start matching. 46 Setting a pseudo-class can only make a negated selector (inside :not()) stop matching. 47 We only need to invalidate for the first case after the mutation has happened and for the second 48 case before it happens. 49 50 The cases are reversed when pseudo-class is unset. 51 52 (WebCore::Style::PseudoClassChangeInvalidation::invalidateBeforeChange): 53 (WebCore::Style::PseudoClassChangeInvalidation::invalidateAfterChange): 54 (WebCore::Style::PseudoClassChangeInvalidation::invalidateStyleWithRuleSets): Deleted. 55 * style/PseudoClassChangeInvalidation.h: 56 (WebCore::Style::emplace): 57 58 Add a helper since std::optional::emplace() is awkward to use with std::initializer_list. 59 60 (WebCore::Style::PseudoClassChangeInvalidation::PseudoClassChangeInvalidation): 61 (WebCore::Style::PseudoClassChangeInvalidation::~PseudoClassChangeInvalidation): 62 1 63 2022-01-08 Simon Fraser <simon.fraser@apple.com> 2 64 -
trunk/Source/WebCore/dom/Document.cpp
r287802 r287818 7458 7458 } 7459 7459 7460 auto changeState = [](auto& elements, auto pseudoClassType, auto && setter) {7460 auto changeState = [](auto& elements, auto pseudoClassType, auto value, auto&& setter) { 7461 7461 if (elements.isEmpty()) 7462 7462 return; 7463 7463 7464 Style::PseudoClassChangeInvalidation styleInvalidation { *elements.last(), pseudoClassType, Style::InvalidationScope::Descendants };7464 Style::PseudoClassChangeInvalidation styleInvalidation { *elements.last(), pseudoClassType, value, Style::InvalidationScope::Descendants }; 7465 7465 7466 7466 // We need to do descendant invalidation for each shadow tree separately as the style is per-scope. … … 7468 7468 for (auto& element : elements) { 7469 7469 if (hasShadowRootParent(*element)) 7470 shadowDescendantStyleInvalidations.append({ *element, pseudoClassType, Style::InvalidationScope::Descendants });7470 shadowDescendantStyleInvalidations.append({ *element, pseudoClassType, value, Style::InvalidationScope::Descendants }); 7471 7471 } 7472 7472 … … 7475 7475 }; 7476 7476 7477 changeState(elementsToClearActive, CSSSelector::PseudoClassActive, [](auto& element) {7477 changeState(elementsToClearActive, CSSSelector::PseudoClassActive, false, [](auto& element) { 7478 7478 element.setActive(false, false, Style::InvalidationScope::SelfChildrenAndSiblings); 7479 7479 }); 7480 changeState(elementsToSetActive, CSSSelector::PseudoClassActive, [](auto& element) {7480 changeState(elementsToSetActive, CSSSelector::PseudoClassActive, true, [](auto& element) { 7481 7481 element.setActive(true, false, Style::InvalidationScope::SelfChildrenAndSiblings); 7482 7482 }); 7483 changeState(elementsToClearHover, CSSSelector::PseudoClassHover, [](auto& element) {7483 changeState(elementsToClearHover, CSSSelector::PseudoClassHover, false, [](auto& element) { 7484 7484 element.setHovered(false, Style::InvalidationScope::SelfChildrenAndSiblings); 7485 7485 }); 7486 changeState(elementsToSetHover, CSSSelector::PseudoClassHover, [](auto& element) {7486 changeState(elementsToSetHover, CSSSelector::PseudoClassHover, true, [](auto& element) { 7487 7487 element.setHovered(true, Style::InvalidationScope::SelfChildrenAndSiblings); 7488 7488 }); -
trunk/Source/WebCore/dom/Element.cpp
r287803 r287818 792 792 } 793 793 794 void Element::setActive(bool flag, bool pause, Style::InvalidationScope invalidationScope)795 { 796 if ( flag== active())794 void Element::setActive(bool value, bool pause, Style::InvalidationScope invalidationScope) 795 { 796 if (value == active()) 797 797 return; 798 798 { 799 Style::PseudoClassChangeInvalidation styleInvalidation(*this, CSSSelector::PseudoClassActive, invalidationScope);800 document().userActionElements().setActive(*this, flag);799 Style::PseudoClassChangeInvalidation styleInvalidation(*this, CSSSelector::PseudoClassActive, value, invalidationScope); 800 document().userActionElements().setActive(*this, value); 801 801 } 802 802 … … 844 844 } 845 845 846 void Element::setFocus(bool flag, FocusVisibility visibility)847 { 848 if ( flag== focused())846 void Element::setFocus(bool value, FocusVisibility visibility) 847 { 848 if (value == focused()) 849 849 return; 850 850 851 Style::PseudoClassChangeInvalidation focusStyleInvalidation(*this, { CSSSelector::PseudoClassFocus, CSSSelector::PseudoClassFocusVisible});852 document().userActionElements().setFocused(*this, flag);851 Style::PseudoClassChangeInvalidation focusStyleInvalidation(*this, { { CSSSelector::PseudoClassFocus, value }, { CSSSelector::PseudoClassFocusVisible, value } }); 852 document().userActionElements().setFocused(*this, value); 853 853 854 854 // Shadow host with a slot that contain focused element is not considered focused. 855 855 for (auto* root = containingShadowRoot(); root; root = root->host()->containingShadowRoot()) { 856 root->setContainsFocusedElement( flag);856 root->setContainsFocusedElement(value); 857 857 root->host()->invalidateStyle(); 858 858 } 859 859 860 860 for (auto* element = this; element; element = element->parentElementInComposedTree()) 861 element->setHasFocusWithin( flag);862 863 setHasFocusVisible( flag&& (visibility == FocusVisibility::Visible || shouldAlwaysHaveFocusVisibleWhenFocused(*this)));864 } 865 866 void Element::setHasFocusVisible(bool flag)861 element->setHasFocusWithin(value); 862 863 setHasFocusVisible(value && (visibility == FocusVisibility::Visible || shouldAlwaysHaveFocusVisibleWhenFocused(*this))); 864 } 865 866 void Element::setHasFocusVisible(bool value) 867 867 { 868 868 if (!document().settings().focusVisibleEnabled()) … … 870 870 871 871 #if ASSERT_ENABLED 872 ASSERT(! flag|| focused());873 ASSERT(!focused() || !shouldAlwaysHaveFocusVisibleWhenFocused(*this) || flag);872 ASSERT(!value || focused()); 873 ASSERT(!focused() || !shouldAlwaysHaveFocusVisibleWhenFocused(*this) || value); 874 874 #endif 875 875 876 if (hasFocusVisible() == flag)877 return; 878 879 document().userActionElements().setHasFocusVisible(*this, flag);880 } 881 882 void Element::setHasFocusWithin(bool flag)883 { 884 if (hasFocusWithin() == flag)876 if (hasFocusVisible() == value) 877 return; 878 879 document().userActionElements().setHasFocusVisible(*this, value); 880 } 881 882 void Element::setHasFocusWithin(bool value) 883 { 884 if (hasFocusWithin() == value) 885 885 return; 886 886 { 887 Style::PseudoClassChangeInvalidation styleInvalidation(*this, CSSSelector::PseudoClassFocusWithin );888 document().userActionElements().setHasFocusWithin(*this, flag);889 } 890 } 891 892 void Element::setHovered(bool flag, Style::InvalidationScope invalidationScope)893 { 894 if ( flag== hovered())887 Style::PseudoClassChangeInvalidation styleInvalidation(*this, CSSSelector::PseudoClassFocusWithin, value); 888 document().userActionElements().setHasFocusWithin(*this, value); 889 } 890 } 891 892 void Element::setHovered(bool value, Style::InvalidationScope invalidationScope) 893 { 894 if (value == hovered()) 895 895 return; 896 896 { 897 Style::PseudoClassChangeInvalidation styleInvalidation(*this, CSSSelector::PseudoClassHover, invalidationScope);898 document().userActionElements().setHovered(*this, flag);897 Style::PseudoClassChangeInvalidation styleInvalidation(*this, CSSSelector::PseudoClassHover, value, invalidationScope); 898 document().userActionElements().setHovered(*this, value); 899 899 } 900 900 … … 903 903 } 904 904 905 void Element::setBeingDragged(bool flag)906 { 907 if ( flag== isBeingDragged())908 return; 909 910 Style::PseudoClassChangeInvalidation styleInvalidation(*this, CSSSelector::PseudoClassDrag );911 document().userActionElements().setBeingDragged(*this, flag);905 void Element::setBeingDragged(bool value) 906 { 907 if (value == isBeingDragged()) 908 return; 909 910 Style::PseudoClassChangeInvalidation styleInvalidation(*this, CSSSelector::PseudoClassDrag, value); 911 document().userActionElements().setBeingDragged(*this, value); 912 912 } 913 913 -
trunk/Source/WebCore/html/HTMLFieldSetElement.cpp
r287551 r287818 184 184 std::optional<Style::PseudoClassChangeInvalidation> styleInvalidation; 185 185 if (m_invalidDescendants.computesEmpty()) 186 styleInvalidation.emplace(*this, std::initializer_list<CSSSelector::PseudoClassType> { CSSSelector::PseudoClassValid, CSSSelector::PseudoClassInvalid});186 emplace(styleInvalidation, *this, { { CSSSelector::PseudoClassValid, false }, { CSSSelector::PseudoClassInvalid, true } }); 187 187 188 188 m_invalidDescendants.add(invalidFormControlElement); … … 196 196 std::optional<Style::PseudoClassChangeInvalidation> styleInvalidation; 197 197 if (m_invalidDescendants.computeSize() == 1) 198 styleInvalidation.emplace(*this, std::initializer_list<CSSSelector::PseudoClassType> { CSSSelector::PseudoClassValid, CSSSelector::PseudoClassInvalid});198 emplace(styleInvalidation, *this, { { CSSSelector::PseudoClassValid, true }, { CSSSelector::PseudoClassInvalid, false } }); 199 199 200 200 m_invalidDescendants.remove(formControlElement); -
trunk/Source/WebCore/html/HTMLFormControlElement.cpp
r287551 r287818 148 148 return; 149 149 150 Style::PseudoClassChangeInvalidation disabledInvalidation(*this, { CSSSelector::PseudoClassDisabled, CSSSelector::PseudoClassEnabled});150 Style::PseudoClassChangeInvalidation disabledInvalidation(*this, { { CSSSelector::PseudoClassDisabled, isDisabled }, { CSSSelector::PseudoClassEnabled, !isDisabled } }); 151 151 152 152 m_disabledByAncestorFieldset = isDisabled; … … 162 162 bool newDisabled = !value.isNull(); 163 163 if (m_disabled != newDisabled) { 164 Style::PseudoClassChangeInvalidation disabledInvalidation(*this, { CSSSelector::PseudoClassDisabled, CSSSelector::PseudoClassEnabled});164 Style::PseudoClassChangeInvalidation disabledInvalidation(*this, { { CSSSelector::PseudoClassDisabled, newDisabled }, { CSSSelector::PseudoClassEnabled, !newDisabled } }); 165 165 m_disabled = newDisabled; 166 166 disabledAttributeChanged(); … … 533 533 534 534 if (newIsValid != m_isValid) { 535 Style::PseudoClassChangeInvalidation styleInvalidation(*this, { CSSSelector::PseudoClassValid, CSSSelector::PseudoClassInvalid});535 Style::PseudoClassChangeInvalidation styleInvalidation(*this, { { CSSSelector::PseudoClassValid, newIsValid }, { CSSSelector::PseudoClassInvalid, !newIsValid } }); 536 536 537 537 m_isValid = newIsValid; -
trunk/Source/WebCore/html/HTMLFormElement.cpp
r287551 r287818 669 669 std::optional<Style::PseudoClassChangeInvalidation> styleInvalidation; 670 670 if (m_invalidAssociatedFormControls.computesEmpty()) 671 styleInvalidation.emplace(*this, std::initializer_list<CSSSelector::PseudoClassType> { CSSSelector::PseudoClassValid, CSSSelector::PseudoClassInvalid});671 emplace(styleInvalidation, *this, { { CSSSelector::PseudoClassValid, false }, { CSSSelector::PseudoClassInvalid, true } }); 672 672 673 673 m_invalidAssociatedFormControls.add(const_cast<HTMLFormControlElement&>(formControlElement)); … … 681 681 std::optional<Style::PseudoClassChangeInvalidation> styleInvalidation; 682 682 if (m_invalidAssociatedFormControls.computeSize() == 1) 683 styleInvalidation.emplace(*this, std::initializer_list<CSSSelector::PseudoClassType> { CSSSelector::PseudoClassValid, CSSSelector::PseudoClassInvalid});683 emplace(styleInvalidation, *this, { { CSSSelector::PseudoClassValid, true }, { CSSSelector::PseudoClassInvalid, false } }); 684 684 685 685 m_invalidAssociatedFormControls.remove(formControlElement); -
trunk/Source/WebCore/html/HTMLInputElement.cpp
r287551 r287818 976 976 } 977 977 978 void HTMLInputElement::setChecked(bool nowChecked)979 { 980 if (checked() == nowChecked)978 void HTMLInputElement::setChecked(bool isChecked) 979 { 980 if (checked() == isChecked) 981 981 return; 982 982 983 m_inputType->willUpdateCheckedness( nowChecked);984 985 Style::PseudoClassChangeInvalidation checkedInvalidation(*this, CSSSelector::PseudoClassChecked );983 m_inputType->willUpdateCheckedness(isChecked); 984 985 Style::PseudoClassChangeInvalidation checkedInvalidation(*this, CSSSelector::PseudoClassChecked, isChecked); 986 986 987 987 m_dirtyCheckednessFlag = true; 988 m_isChecked = nowChecked;988 m_isChecked = isChecked; 989 989 990 990 if (RadioButtonGroups* buttons = radioButtonGroups()) -
trunk/Source/WebCore/html/HTMLOptGroupElement.cpp
r287540 r287818 90 90 bool newDisabled = !value.isNull(); 91 91 if (m_isDisabled != newDisabled) { 92 Style::PseudoClassChangeInvalidation disabledInvalidation(*this, { CSSSelector::PseudoClassDisabled, CSSSelector::PseudoClassEnabled});92 Style::PseudoClassChangeInvalidation disabledInvalidation(*this, { { CSSSelector::PseudoClassDisabled, newDisabled }, { CSSSelector::PseudoClassEnabled, !newDisabled } }); 93 93 94 94 Vector<Style::PseudoClassChangeInvalidation> optionInvalidation; 95 95 for (auto& descendant : descendantsOfType<HTMLOptionElement>(*this)) 96 optionInvalidation.append({ descendant, { CSSSelector::PseudoClassDisabled, CSSSelector::PseudoClassEnabled} });96 optionInvalidation.append({ descendant, { { CSSSelector::PseudoClassDisabled, newDisabled }, { CSSSelector::PseudoClassEnabled, !newDisabled } } }); 97 97 98 98 m_isDisabled = newDisabled; -
trunk/Source/WebCore/html/HTMLOptionElement.cpp
r287540 r287818 179 179 bool newDisabled = !value.isNull(); 180 180 if (m_disabled != newDisabled) { 181 Style::PseudoClassChangeInvalidation disabledInvalidation(*this, { CSSSelector::PseudoClassDisabled, CSSSelector::PseudoClassEnabled});181 Style::PseudoClassChangeInvalidation disabledInvalidation(*this, { { CSSSelector::PseudoClassDisabled, newDisabled }, { CSSSelector::PseudoClassEnabled, !newDisabled } }); 182 182 m_disabled = newDisabled; 183 183 if (renderer() && renderer()->style().hasEffectiveAppearance()) … … 186 186 } else if (name == selectedAttr) { 187 187 // FIXME: Use PseudoClassChangeInvalidation in other elements that implement matchesDefaultPseudoClass(). 188 Style::PseudoClassChangeInvalidation defaultInvalidation(*this, CSSSelector::PseudoClassDefault );188 Style::PseudoClassChangeInvalidation defaultInvalidation(*this, CSSSelector::PseudoClassDefault, !value.isNull()); 189 189 m_isDefault = !value.isNull(); 190 190 … … 234 234 return; 235 235 236 Style::PseudoClassChangeInvalidation checkedInvalidation(*this, CSSSelector::PseudoClassChecked );236 Style::PseudoClassChangeInvalidation checkedInvalidation(*this, CSSSelector::PseudoClassChecked, selected); 237 237 238 238 m_isSelected = selected; -
trunk/Source/WebCore/page/EventHandler.cpp
r287731 r287818 3641 3641 3642 3642 if (element.focused() && userHasInteractedViaKeyword) { 3643 Style::PseudoClassChangeInvalidation focusVisibleStyleInvalidation(element, CSSSelector::PseudoClassFocusVisible );3643 Style::PseudoClassChangeInvalidation focusVisibleStyleInvalidation(element, CSSSelector::PseudoClassFocusVisible, true); 3644 3644 element.setHasFocusVisible(true); 3645 3645 } -
trunk/Source/WebCore/style/PseudoClassChangeInvalidation.cpp
r286598 r287818 52 52 }; 53 53 54 void PseudoClassChangeInvalidation::computeInvalidation(CSSSelector::PseudoClassType pseudoClass, InvalidationScope invalidationScope)54 void PseudoClassChangeInvalidation::computeInvalidation(CSSSelector::PseudoClassType pseudoClass, bool value, InvalidationScope invalidationScope) 55 55 { 56 56 bool shouldInvalidateCurrent = false; … … 73 73 74 74 for (auto& key : makePseudoClassInvalidationKeys(pseudoClass, m_element)) 75 collectRuleSets(key, invalidationScope);75 collectRuleSets(key, value, invalidationScope); 76 76 } 77 77 78 void PseudoClassChangeInvalidation::collectRuleSets(const PseudoClassInvalidationKey& key, InvalidationScope invalidationScope)78 void PseudoClassChangeInvalidation::collectRuleSets(const PseudoClassInvalidationKey& key, bool value, InvalidationScope invalidationScope) 79 79 { 80 80 auto& ruleSets = m_element.styleResolver().ruleSets(); … … 101 101 continue; 102 102 103 Invalidator::addToMatchElementRuleSets(m_matchElementRuleSets, invalidationRuleSet); 103 bool invalidateBeforeChange = invalidationRuleSet.isNegation == IsNegation::Yes ? value : !value; 104 if (invalidateBeforeChange) 105 Invalidator::addToMatchElementRuleSets(m_beforeChangeRuleSets, invalidationRuleSet); 106 else 107 Invalidator::addToMatchElementRuleSets(m_afterChangeRuleSets, invalidationRuleSet); 104 108 } 105 109 } 106 110 107 void PseudoClassChangeInvalidation::invalidate StyleWithRuleSets()111 void PseudoClassChangeInvalidation::invalidateBeforeChange() 108 112 { 109 Invalidator::invalidateWithMatchElementRuleSets(m_element, m_ matchElementRuleSets);113 Invalidator::invalidateWithMatchElementRuleSets(m_element, m_beforeChangeRuleSets); 110 114 } 115 116 void PseudoClassChangeInvalidation::invalidateAfterChange() 117 { 118 Invalidator::invalidateWithMatchElementRuleSets(m_element, m_afterChangeRuleSets); 119 } 120 111 121 112 122 } -
trunk/Source/WebCore/style/PseudoClassChangeInvalidation.h
r287540 r287818 36 36 class PseudoClassChangeInvalidation { 37 37 public: 38 PseudoClassChangeInvalidation(Element&, CSSSelector::PseudoClassType, InvalidationScope = InvalidationScope::All);39 PseudoClassChangeInvalidation(Element&, std::initializer_list< CSSSelector::PseudoClassType>, InvalidationScope = InvalidationScope::All);38 PseudoClassChangeInvalidation(Element&, CSSSelector::PseudoClassType, bool value, InvalidationScope = InvalidationScope::All); 39 PseudoClassChangeInvalidation(Element&, std::initializer_list<std::pair<CSSSelector::PseudoClassType, bool>>); 40 40 41 41 ~PseudoClassChangeInvalidation(); 42 42 43 43 private: 44 void computeInvalidation(CSSSelector::PseudoClassType, Style::InvalidationScope); 45 void collectRuleSets(const PseudoClassInvalidationKey&, InvalidationScope); 46 void invalidateStyleWithRuleSets(); 44 void computeInvalidation(CSSSelector::PseudoClassType, bool value, Style::InvalidationScope); 45 void collectRuleSets(const PseudoClassInvalidationKey&, bool value, InvalidationScope); 46 void invalidateBeforeChange(); 47 void invalidateAfterChange(); 47 48 48 49 const bool m_isEnabled; 49 50 Element& m_element; 50 51 51 Invalidator::MatchElementRuleSets m_matchElementRuleSets; 52 Invalidator::MatchElementRuleSets m_beforeChangeRuleSets; 53 Invalidator::MatchElementRuleSets m_afterChangeRuleSets; 52 54 }; 53 55 54 inline PseudoClassChangeInvalidation::PseudoClassChangeInvalidation(Element& element, CSSSelector::PseudoClassType pseudoClassType, Style::InvalidationScope invalidationScope) 56 inline void emplace(std::optional<PseudoClassChangeInvalidation>& invalidation, Element& element, std::initializer_list<std::pair<CSSSelector::PseudoClassType, bool>> pseudoClasses) 57 { 58 invalidation.emplace(element, pseudoClasses); 59 } 60 61 inline PseudoClassChangeInvalidation::PseudoClassChangeInvalidation(Element& element, CSSSelector::PseudoClassType pseudoClass, bool value, Style::InvalidationScope invalidationScope) 55 62 : m_isEnabled(element.needsStyleInvalidation()) 56 63 , m_element(element) … … 59 66 if (!m_isEnabled) 60 67 return; 61 computeInvalidation(pseudoClass Type, invalidationScope);62 invalidate StyleWithRuleSets();68 computeInvalidation(pseudoClass, value, invalidationScope); 69 invalidateBeforeChange(); 63 70 } 64 71 65 inline PseudoClassChangeInvalidation::PseudoClassChangeInvalidation(Element& element, std::initializer_list< CSSSelector::PseudoClassType> pseudoClasses, Style::InvalidationScope invalidationScope)72 inline PseudoClassChangeInvalidation::PseudoClassChangeInvalidation(Element& element, std::initializer_list<std::pair<CSSSelector::PseudoClassType, bool>> pseudoClasses) 66 73 : m_isEnabled(element.needsStyleInvalidation()) 67 74 , m_element(element) … … 70 77 return; 71 78 for (auto pseudoClass : pseudoClasses) 72 computeInvalidation(pseudoClass , invalidationScope);73 invalidate StyleWithRuleSets();79 computeInvalidation(pseudoClass.first, pseudoClass.second, Style::InvalidationScope::All); 80 invalidateBeforeChange(); 74 81 } 75 82 … … 78 85 if (!m_isEnabled) 79 86 return; 80 invalidate StyleWithRuleSets();87 invalidateAfterChange(); 81 88 } 82 89
Note:
See TracChangeset
for help on using the changeset viewer.