WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
[patch]
WIP
wip243172.patch (text/plain), 4.38 KB, created by
Ryosuke Niwa
on 2022-07-25 22:46:52 PDT
(
hide
)
Description:
WIP
Filename:
MIME Type:
Creator:
Ryosuke Niwa
Created:
2022-07-25 22:46:52 PDT
Size:
4.38 KB
patch
obsolete
>diff --git a/Source/WebCore/style/AttributeChangeInvalidation.cpp b/Source/WebCore/style/AttributeChangeInvalidation.cpp >index 05298d0afff8..f482899f1256 100644 >--- a/Source/WebCore/style/AttributeChangeInvalidation.cpp >+++ b/Source/WebCore/style/AttributeChangeInvalidation.cpp >@@ -28,6 +28,7 @@ > > #include "ElementIterator.h" > #include "ElementRareData.h" >+#include "PseudoClassChangeInvalidation.h" > #include "StyleInvalidationFunctions.h" > > namespace WebCore { >@@ -60,6 +61,24 @@ void AttributeChangeInvalidation::invalidateStyle(const QualifiedName& attribute > shouldInvalidateCurrent = true; > }); > >+ bool affectsLangPseudo = attributeName == HTMLNames::langAttr; >+ bool affectsDirPseudo = attributeName == HTMLNames::dirAttr; >+ if (affectsLangPseudo) { >+ traverseRuleFeatures(m_element, [&] (const RuleFeatureSet& features, bool mayAffectShadowTree) { >+ if (mayAffectShadowTree && features.pseudoClassTypes.contains(CSSSelector::PseudoClassLang)) >+ mayAffectStyleInShadowTree = true; >+ if (m_element.shadowRoot() && features.pseudoClassesAffectingHost.contains(CSSSelector::PseudoClassLang)) >+ shouldInvalidateCurrent = true; >+ }); >+ } else if (affectsDirPseudo) { >+ traverseRuleFeatures(m_element, [&] (const RuleFeatureSet& features, bool mayAffectShadowTree) { >+ if (mayAffectShadowTree && features.pseudoClassTypes.contains(CSSSelector::PseudoClassDir)) >+ mayAffectStyleInShadowTree = true; >+ if (m_element.shadowRoot() && features.pseudoClassesAffectingHost.contains(CSSSelector::PseudoClassDir)) >+ shouldInvalidateCurrent = true; >+ }); >+ } >+ > if (mayAffectStyleInShadowTree) { > // FIXME: More fine-grained invalidation. > m_element.invalidateStyleForSubtree(); >@@ -70,20 +89,37 @@ void AttributeChangeInvalidation::invalidateStyle(const QualifiedName& attribute > > auto& ruleSets = m_element.styleResolver().ruleSets(); > >- auto* invalidationRuleSets = ruleSets.attributeInvalidationRuleSets(attributeNameForLookups); >- if (!invalidationRuleSets) >- return; >+ if (auto* invalidationRuleSets = ruleSets.attributeInvalidationRuleSets(attributeNameForLookups)) { >+ for (auto& invalidationRuleSet : *invalidationRuleSets) { >+ for (auto* selector : invalidationRuleSet.invalidationSelectors) { >+ bool oldMatches = !oldValue.isNull() && SelectorChecker::attributeSelectorMatches(m_element, attributeName, oldValue, *selector); >+ bool newMatches = !newValue.isNull() && SelectorChecker::attributeSelectorMatches(m_element, attributeName, newValue, *selector); >+ if (oldMatches != newMatches) { >+ Invalidator::addToMatchElementRuleSets(m_matchElementRuleSets, invalidationRuleSet); >+ break; >+ } >+ } >+ } >+ } > >- for (auto& invalidationRuleSet : *invalidationRuleSets) { >- for (auto* selector : invalidationRuleSet.invalidationSelectors) { >- bool oldMatches = !oldValue.isNull() && SelectorChecker::attributeSelectorMatches(m_element, attributeName, oldValue, *selector); >- bool newMatches = !newValue.isNull() && SelectorChecker::attributeSelectorMatches(m_element, attributeName, newValue, *selector); >- if (oldMatches != newMatches) { >+ if (affectsLangPseudo) { >+ for (auto& key : makePseudoClassInvalidationKeys(CSSSelector::PseudoClassLang, m_element)) { >+ auto* invalidationRuleSets = ruleSets.pseudoClassInvalidationRuleSets(key); >+ if (!invalidationRuleSets) >+ continue; >+ for (auto& invalidationRuleSet : *invalidationRuleSets) >+ Invalidator::addToMatchElementRuleSets(m_matchElementRuleSets, invalidationRuleSet); >+ } >+ } else if (affectsDirPseudo) { >+ for (auto& key : makePseudoClassInvalidationKeys(CSSSelector::PseudoClassDir, m_element)) { >+ auto* invalidationRuleSets = ruleSets.pseudoClassInvalidationRuleSets(key); >+ if (!invalidationRuleSets) >+ continue; >+ for (auto& invalidationRuleSet : *invalidationRuleSets) > Invalidator::addToMatchElementRuleSets(m_matchElementRuleSets, invalidationRuleSet); >- break; >- } > } > } >+ > } > > void AttributeChangeInvalidation::invalidateStyleWithRuleSets()
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 243172
:
461200
|
461213
|
461214
|
461632