Skip to content

Commit

Permalink
Use invalidateStyleInternal() for inline style invalidation
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=258970
rdar://111902537

Reviewed by Tim Nguyen.

It is more efficient than invalidateStyle() which has been made obsolete by fine-grained
pseudo-element invalidation.

* Source/WebCore/dom/StyledElement.cpp:
(WebCore::StyledElement::attributeChanged):
(WebCore::StyledElement::styleAttributeChanged):
(WebCore::StyledElement::invalidateStyleAttribute):

Canonical link: https://commits.webkit.org/265847@main
  • Loading branch information
anttijk committed Jul 7, 2023
1 parent 7446735 commit a9bf099
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions Source/WebCore/dom/StyledElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ void StyledElement::attributeChanged(const QualifiedName& name, const AtomString
styleAttributeChanged(newValue, reason);
else if (hasPresentationalHintsForAttribute(name)) {
elementData()->setPresentationalHintStyleIsDirty(true);
invalidateStyle();
invalidateStyleInternal();
}
}
}
Expand Down Expand Up @@ -155,7 +155,7 @@ void StyledElement::styleAttributeChanged(const AtomString& newStyleString, Attr

elementData()->setStyleAttributeIsDirty(false);

invalidateStyle();
invalidateStyleInternal();
InspectorInstrumentation::didInvalidateStyleAttr(*this);
}

Expand All @@ -167,7 +167,7 @@ void StyledElement::invalidateStyleAttribute()
}

elementData()->setStyleAttributeIsDirty(true);
invalidateStyle();
invalidateStyleInternal();

// In the rare case of selectors like "[style] ~ div" we need to synchronize immediately to invalidate.
if (styleResolver().ruleSets().hasComplexSelectorsForStyleAttribute()) {
Expand Down

0 comments on commit a9bf099

Please sign in to comment.