[webkit-changes] [WebKit/WebKit] a3084f: :dir pseudo class doesn't invalidate after removin...
Ryosuke Niwa
noreply at github.com
Tue Apr 25 02:27:34 PDT 2023
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a3084fe071c6918f900a19156c2d9e51f1c7dc10
https://github.com/WebKit/WebKit/commit/a3084fe071c6918f900a19156c2d9e51f1c7dc10
Author: Ryosuke Niwa <rniwa at webkit.org>
Date: 2023-04-25 (Tue, 25 Apr 2023)
Changed paths:
A LayoutTests/fast/css/dir-ltr-removal-expected.html
A LayoutTests/fast/css/dir-ltr-removal.html
A LayoutTests/fast/css/dir-rtl-removal-expected.html
A LayoutTests/fast/css/dir-rtl-removal.html
M Source/WebCore/html/HTMLElement.cpp
M Source/WebCore/html/HTMLElement.h
Log Message:
-----------
:dir pseudo class doesn't invalidate after removing dir content attribute from document element
https://bugs.webkit.org/show_bug.cgi?id=255568
Reviewed by Tim Nguyen and Antti Koivisto.
The bug was caused by dirAttributeChanged not calling HTMLElement::dirAttributeChanged not
updating the effective directionality state when removing a content attribute. Fixed the bug
by recursively invalidating the pseudo class state using updateEffectiveDirectionality,
which is now updated to take std::optional<TextDirection>.
Also removed redundant calls to HTMLElement::setUsesEffectiveTextDirection(true) in
HTMLElement::dirAttributeChanged.
* LayoutTests/fast/css/dir-ltr-removal-expected.html: Added.
* LayoutTests/fast/css/dir-ltr-removal.html: Added.
* LayoutTests/fast/css/dir-rtl-removal-expected.html: Added.
* LayoutTests/fast/css/dir-rtl-removal.html: Added.
* Source/WebCore/html/HTMLElement.cpp:
(WebCore::HTMLElement::dirAttributeChanged):
(WebCore::HTMLElement::updateEffectiveDirectionality):
Canonical link: https://commits.webkit.org/263357@main
More information about the webkit-changes
mailing list