-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
:has(~:dir(~)) should work #3801
Conversation
EWS run on previous version of this PR (hash 3b4bd1a) |
EWS run on previous version of this PR (hash 3f4a1ca)
|
EWS run on previous version of this PR (hash 3dd613d)
|
EWS run on previous version of this PR (hash d5046df)
|
EWS run on previous version of this PR (hash 390f61e) |
EWS run on previous version of this PR (hash 7dae483) |
webkit.org/b/64861 imported/w3c/web-platform-tests/css/selectors/dir-style-01a.html [ ImageOnlyFailure ] | ||
webkit.org/b/64861 imported/w3c/web-platform-tests/css/selectors/dir-style-01b.html [ ImageOnlyFailure ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wonder what is still wrong with these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's anti-aliasing issue. See #3842
No reviewer information in commit message, blocking PR #3801 |
|
https://bugs.webkit.org/show_bug.cgi?id=243093 Reviewed by Antti Koivisto. Implement :dir pseudo class invalidation. This patch introduces the notion of effective text direction which is stored in Node's rareDataBitfields. To signify whether this is used for text direction or not, another boolean value usesEffectiveTextDirection has been added to rareDataBitfields. Like https://commits.webkit.org/253764@main for :lang, this patch has an optimization to avoid using rareDataBitfields when the text direction matches that of the document element. * LayoutTests/TestExpectations: Removed image only failures from tests that are now passing. * LayoutTests/fast/css/dir-pseudo-container-query-expected.html: Added. * LayoutTests/fast/css/dir-pseudo-container-query-invalidation-expected.html: Added. * LayoutTests/fast/css/dir-pseudo-container-query-invalidation.html: Added. * LayoutTests/fast/css/dir-pseudo-container-query.html: Added. * LayoutTests/platform/win/TestExpectations: Skip the newly added tests since :dir isn't enabled yet. * Source/WebCore/css/SelectorCheckerTestFunctions.h (WebCore::matchesDirPseudoClass): Now uses effectiveTextDirection instead of computeDirectionality. * Source/WebCore/dom/Document.cpp: (WebCore::Document::childrenChanged): Calls setDocumentElementTextDirection. Note we need to explicitly check usesEffectiveTextDirection since effectiveTextDirection falls back to documentElementTextDirection. * Source/WebCore/dom/Document.h: (WebCore::Document::documentElementTextDirection const): Added. (WebCore::Document::setDocumentElementTextDirection): Added. * Source/WebCore/dom/Node.cpp: (WebCore::Node::incrementConnectedSubframeCount): (WebCore::Node::effectiveTextDirection const): Added. (WebCore::Node::setEffectiveTextDirection): Added. (WebCore::Node::setUsesEffectiveTextDirection): Added. * Source/WebCore/dom/Node.h: (WebCore::Node::usesEffectiveTextDirection const): Added. * Source/WebCore/html/HTMLElement.cpp: (WebCore::TextDirectionDirective): Added. (WebCore::parseTextDirection): Added. (WebCore::isValidDirValue): Now uses parseTextDirection. (WebCore::elementAffectsDirectionality): Moved up to be used in insertedIntoAncestor. (WebCore::HTMLElement::insertedIntoAncestor): Inherit the effective text direction from parent unless this is an input type=telephone. (WebCore::HTMLElement::removedFromAncestor): Added. Clear the inherited effective text direction. (WebCore::HTMLElement::computeDirectionality const): Removed. (WebCore::HTMLElement::dirAttributeChanged): Added the invalidation logic for each value type. Notably, when the new value is invalid, we inherit from the parent node unless this is an input type=telephone. (WebCore::HTMLElement::updateEffectiveDirectionality): Added. Implements the recursive invalidation for :dir pseudo class. (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildAttributeChanged): Update the effective text direction instead of simply invalidating the style. (WebCore::HTMLElement::updateEffectiveDirectionalityOfDirAuto): Ditto. (WebCore::HTMLElement::adjustDirectionalityIfNeededAfterChildrenChanged): * Source/WebCore/html/HTMLElement.h: * Source/WebCore/html/HTMLInputElement.cpp: (WebCore::HTMLInputElement::subtreeHasChanged): Don't call updateEffectiveDirectionalityOfDirAuto if this element hasn't been marked with selfOrPrecedingNodesAffectDirAuto. Otherwise, we'd set selfOrPrecedingNodesAffectDirAuto on input element without dir=auto. This was caught by new assertions. (WebCore::HTMLInputElement::setValue): Added a call to updateEffectiveDirectionalityOfDirAuto when selfOrPrecedingNodesAffectDirAuto is set. This is needed now that the effective text direction is cached as opposed to re-computed each time in computeDirectionality. * Source/WebCore/html/HTMLTextAreaElement.cpp: (WebCore::HTMLTextAreaElement::subtreeHasChanged): Same as HTMLInputElement. (WebCore::HTMLTextAreaElement::setValueCommon): Ditto. Canonical link: https://commits.webkit.org/254017@main
760a9df
to
ded49fa
Compare
Committed 254017@main (ded49fa): https://commits.webkit.org/254017@main Reviewed commits have been landed. Closing PR #3801 and removing active labels. |
ded49fa
760a9df
🛠 🧪 win🛠 mac-debug🧪 api-mac🧪 mac-wk1