Skip to content

Conversation

@nt1m
Copy link
Member

@nt1m nt1m commented Dec 12, 2023

1d40c07

[:has() pseudo-class] Support invalidation for :any-link, :link and :-webkit-any-link
https://bugs.webkit.org/show_bug.cgi?id=262836
rdar://116616425

Reviewed by Darin Adler.

Move Node::isLink/setIsLink to Element, and make use of Style::PseudoClassChangeInvalidation in the setter.

Add a web platform test as well.

* LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/link-pseudo-class-in-has-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/link-pseudo-class-in-has.html: Added.
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::determineAccessibilityRoleFromNode const):
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::setIsLink):
* Source/WebCore/dom/Element.h:
(WebCore::Element::isLink const):
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::enclosingLinkEventParentOrSelf):
* Source/WebCore/dom/Node.h:
(WebCore::Node::isLink const): Deleted.
(WebCore::Node::setIsLink): Deleted.
* Source/WebCore/editing/Editing.cpp:
(WebCore::enclosingAnchorElement):
* Source/WebCore/html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::attributeChanged):
* Source/WebCore/html/parser/HTMLTreeBuilder.cpp:
(WebCore::disallowTelephoneNumberParsing):
* Source/WebCore/mathml/MathMLElement.cpp:
(WebCore::MathMLElement::attributeChanged):
* Source/WebCore/page/InteractionRegion.cpp:
(WebCore::interactionRegionForRenderedRegion):
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::addPDFURLRect const):
* Source/WebCore/svg/SVGAElement.cpp:
(WebCore::SVGAElement::svgAttributeChanged):
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
* Source/WebKitLegacy/mac/DOM/DOM.mm:
(-[DOMNode _linkElement]):

Canonical link: https://commits.webkit.org/271919@main

384cf40

Misc iOS, tvOS & watchOS macOS Linux Windows
✅ 🧪 style ✅ 🛠 ios ✅ 🛠 mac ✅ 🛠 wpe ✅ 🛠 wincairo
✅ 🧪 bindings ✅ 🛠 ios-sim ✅ 🛠 mac-AS-debug 🧪 wpe-wk2
✅ 🧪 webkitperl ✅ 🧪 ios-wk2 ✅ 🧪 api-mac ✅ 🧪 api-wpe
✅ 🧪 ios-wk2-wpt 🧪 mac-wk1 ✅ 🛠 gtk
✅ 🧪 api-ios ✅ 🧪 mac-wk2 ✅ 🧪 gtk-wk2
✅ 🛠 tv ✅ 🧪 mac-AS-debug-wk2 ✅ 🧪 api-gtk
✅ 🛠 tv-sim ✅ 🧪 mac-wk2-stress
🛠 🧪 merge ✅ 🛠 watch
✅ 🛠 🧪 unsafe-merge ✅ 🛠 watch-sim

@nt1m nt1m requested review from cdumez and rniwa as code owners December 12, 2023 05:39
@nt1m nt1m self-assigned this Dec 12, 2023
@nt1m nt1m added the CSS Cascading Style Sheets implementation label Dec 12, 2023
@nt1m nt1m force-pushed the eng/has-pseudo-class-Support-invalidation-for-any-link-link-and--webkit-any-link branch from faa23e5 to 0cc388d Compare December 12, 2023 05:45
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just node() is fine now. The this-> was needed in the old code because the name node was also a local variable.

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Dec 12, 2023
@nt1m nt1m removed the merging-blocked Applied to prevent a change from being merged label Dec 12, 2023
@nt1m nt1m force-pushed the eng/has-pseudo-class-Support-invalidation-for-any-link-link-and--webkit-any-link branch from 0cc388d to 236611c Compare December 12, 2023 06:00
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Dec 12, 2023
@nt1m nt1m removed the merging-blocked Applied to prevent a change from being merged label Dec 12, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Dec 12, 2023
@nt1m nt1m removed the merging-blocked Applied to prevent a change from being merged label Dec 12, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Dec 12, 2023
@nt1m nt1m force-pushed the eng/has-pseudo-class-Support-invalidation-for-any-link-link-and--webkit-any-link branch from 236611c to a21efb6 Compare December 12, 2023 06:21
@nt1m nt1m added safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks and removed merging-blocked Applied to prevent a change from being merged labels Dec 12, 2023
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label Dec 12, 2023
@nt1m nt1m removed merging-blocked Applied to prevent a change from being merged safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks labels Dec 12, 2023
@nt1m nt1m force-pushed the eng/has-pseudo-class-Support-invalidation-for-any-link-link-and--webkit-any-link branch from a21efb6 to 84b95a8 Compare December 12, 2023 06:44
@nt1m nt1m added the safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks label Dec 12, 2023
@nt1m nt1m force-pushed the eng/has-pseudo-class-Support-invalidation-for-any-link-link-and--webkit-any-link branch from 84b95a8 to 384cf40 Compare December 12, 2023 07:57
@nt1m nt1m added merge-queue Applied to send a pull request to merge-queue unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing and removed safe-merge-queue Applied to automatically send a pull-request to merge-queue after passing EWS checks labels Dec 12, 2023
…-webkit-any-link

https://bugs.webkit.org/show_bug.cgi?id=262836
rdar://116616425

Reviewed by Darin Adler.

Move Node::isLink/setIsLink to Element, and make use of Style::PseudoClassChangeInvalidation in the setter.

Add a web platform test as well.

* LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/link-pseudo-class-in-has-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/css/selectors/invalidation/link-pseudo-class-in-has.html: Added.
* Source/WebCore/accessibility/AccessibilityNodeObject.cpp:
(WebCore::AccessibilityNodeObject::determineAccessibilityRoleFromNode const):
* Source/WebCore/dom/Element.cpp:
(WebCore::Element::setIsLink):
* Source/WebCore/dom/Element.h:
(WebCore::Element::isLink const):
* Source/WebCore/dom/Node.cpp:
(WebCore::Node::enclosingLinkEventParentOrSelf):
* Source/WebCore/dom/Node.h:
(WebCore::Node::isLink const): Deleted.
(WebCore::Node::setIsLink): Deleted.
* Source/WebCore/editing/Editing.cpp:
(WebCore::enclosingAnchorElement):
* Source/WebCore/html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::attributeChanged):
* Source/WebCore/html/parser/HTMLTreeBuilder.cpp:
(WebCore::disallowTelephoneNumberParsing):
* Source/WebCore/mathml/MathMLElement.cpp:
(WebCore::MathMLElement::attributeChanged):
* Source/WebCore/page/InteractionRegion.cpp:
(WebCore::interactionRegionForRenderedRegion):
* Source/WebCore/rendering/RenderObject.cpp:
(WebCore::RenderObject::addPDFURLRect const):
* Source/WebCore/svg/SVGAElement.cpp:
(WebCore::SVGAElement::svgAttributeChanged):
* Source/WebKit/WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::sendTapHighlightForNodeIfNecessary):
* Source/WebKitLegacy/mac/DOM/DOM.mm:
(-[DOMNode _linkElement]):

Canonical link: https://commits.webkit.org/271919@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/has-pseudo-class-Support-invalidation-for-any-link-link-and--webkit-any-link branch from 384cf40 to 1d40c07 Compare December 12, 2023 09:17
@webkit-commit-queue
Copy link
Collaborator

Committed 271919@main (1d40c07): https://commits.webkit.org/271919@main

Reviewed commits have been landed. Closing PR #21663 and removing active labels.

@webkit-commit-queue webkit-commit-queue merged commit 1d40c07 into WebKit:main Dec 12, 2023
@webkit-commit-queue webkit-commit-queue removed merge-queue Applied to send a pull request to merge-queue unsafe-merge-queue Applied to send a pull request to merge-queue, but skip building and testing labels Dec 12, 2023
@nt1m nt1m deleted the eng/has-pseudo-class-Support-invalidation-for-any-link-link-and--webkit-any-link branch December 12, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CSS Cascading Style Sheets implementation

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants