Skip to content
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

Expose document.fragmentDirective (feature detection for text fragments) #28784

Conversation

sideshowbarker
Copy link
Contributor

@sideshowbarker sideshowbarker commented May 20, 2024

04bd634

Expose document.fragmentDirective (feature detection for text fragments)
https://bugs.webkit.org/show_bug.cgi?id=273466

Reviewed by Ryosuke Niwa.

This change makes WebKit expose the document.fragmentDirective property
from https://wicg.github.io/scroll-to-text-fragment/#feature-detectability —
to enable developers to programmatically detect that WebKit supports the
scroll-to-text-fragment feature. (Controlled by the new preference
ScrollToTextFragmentFeatureDetectionEnabled, also introduced in this change.)

Otherwise, without this change, developers can’t programatically detect
that WebKit supports the scroll-to-text-fragment feature.

* LayoutTests/imported/w3c/web-platform-tests/scroll-to-text-fragment/scroll-to-text-fragment-api-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/scroll-to-text-fragment/scroll-to-text-fragment-api.html: Added.
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/CMakeLists.txt:
* Source/WebCore/DerivedSources-input.xcfilelist:
* Source/WebCore/DerivedSources-output.xcfilelist:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/bindings/js/WebCoreBuiltinNames.h:
* Source/WebCore/dom/Document.cpp:
* Source/WebCore/dom/Document.h:
(WebCore::Document::fragmentDirectiveForBindings):
* Source/WebCore/dom/Document.idl:
* Source/WebCore/page/FragmentDirective.h: Added.
(WebCore::FragmentDirective::create):
* Source/WebCore/page/FragmentDirective.idl: Added.

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

a5181e6

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

@sideshowbarker sideshowbarker self-assigned this May 20, 2024
@sideshowbarker sideshowbarker added the Scrolling Bugs related to main thread and off-main thread scrolling label May 20, 2024
@sideshowbarker sideshowbarker marked this pull request as draft May 20, 2024 10:54
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 20, 2024
@sideshowbarker sideshowbarker removed the merging-blocked Applied to prevent a change from being merged label May 20, 2024
@sideshowbarker sideshowbarker force-pushed the eng/Expose-document-fragmentDirective-feature-detection-for-text-fragments branch from 746608b to 3bfd05f Compare May 20, 2024 23:42
@rniwa rniwa requested review from megangardner and whsieh May 21, 2024 00:05
@rniwa
Copy link
Member

rniwa commented May 21, 2024

Can we add a runtime flag for this?

@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 21, 2024
@sideshowbarker sideshowbarker removed the merging-blocked Applied to prevent a change from being merged label May 21, 2024
@sideshowbarker sideshowbarker force-pushed the eng/Expose-document-fragmentDirective-feature-detection-for-text-fragments branch from 3bfd05f to 13a15e7 Compare May 21, 2024 03:17
@sideshowbarker sideshowbarker force-pushed the eng/Expose-document-fragmentDirective-feature-detection-for-text-fragments branch from 13a15e7 to 5940546 Compare May 21, 2024 03:23
@sideshowbarker sideshowbarker force-pushed the eng/Expose-document-fragmentDirective-feature-detection-for-text-fragments branch from 5940546 to 5c85717 Compare May 21, 2024 03:25
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 21, 2024
@sideshowbarker sideshowbarker removed the merging-blocked Applied to prevent a change from being merged label May 21, 2024
@sideshowbarker sideshowbarker force-pushed the eng/Expose-document-fragmentDirective-feature-detection-for-text-fragments branch from 5c85717 to 72737b0 Compare May 21, 2024 06:14
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 21, 2024
@sideshowbarker sideshowbarker removed the merging-blocked Applied to prevent a change from being merged label May 22, 2024
@sideshowbarker sideshowbarker force-pushed the eng/Expose-document-fragmentDirective-feature-detection-for-text-fragments branch from 72737b0 to 85f9265 Compare May 22, 2024 12:40
@sideshowbarker sideshowbarker force-pushed the eng/Expose-document-fragmentDirective-feature-detection-for-text-fragments branch from 85f9265 to 817a5bf Compare May 22, 2024 12:45
@sideshowbarker
Copy link
Contributor Author

Can we add a runtime flag for this?

OK, added ScrollToTextFragmentFeatureDetectionEnabled

@sideshowbarker sideshowbarker marked this pull request as ready for review May 22, 2024 13:09
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 22, 2024
@sideshowbarker sideshowbarker removed the merging-blocked Applied to prevent a change from being merged label May 22, 2024
@sideshowbarker sideshowbarker force-pushed the eng/Expose-document-fragmentDirective-feature-detection-for-text-fragments branch from 817a5bf to 8e807a0 Compare May 22, 2024 23:02
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 23, 2024
@sideshowbarker sideshowbarker removed the merging-blocked Applied to prevent a change from being merged label May 23, 2024
@sideshowbarker sideshowbarker force-pushed the eng/Expose-document-fragmentDirective-feature-detection-for-text-fragments branch from 8e807a0 to a5181e6 Compare May 23, 2024 15:52
@webkit-ews-buildbot webkit-ews-buildbot added the merging-blocked Applied to prevent a change from being merged label May 23, 2024
@sideshowbarker
Copy link
Contributor Author

@rniwa EWS is all green here now. OK for me to add the merge-queue label, or did you want for other reviewers to also review this?

@rniwa
Copy link
Member

rniwa commented May 24, 2024

You can land it now.

@sideshowbarker sideshowbarker added merge-queue Applied to send a pull request to merge-queue and removed merging-blocked Applied to prevent a change from being merged labels May 24, 2024
https://bugs.webkit.org/show_bug.cgi?id=273466

Reviewed by Ryosuke Niwa.

This change makes WebKit expose the document.fragmentDirective property
from https://wicg.github.io/scroll-to-text-fragment/#feature-detectability —
to enable developers to programmatically detect that WebKit supports the
scroll-to-text-fragment feature. (Controlled by the new preference
ScrollToTextFragmentFeatureDetectionEnabled, also introduced in this change.)

Otherwise, without this change, developers can’t programatically detect
that WebKit supports the scroll-to-text-fragment feature.

* LayoutTests/imported/w3c/web-platform-tests/scroll-to-text-fragment/scroll-to-text-fragment-api-expected.txt: Added.
* LayoutTests/imported/w3c/web-platform-tests/scroll-to-text-fragment/scroll-to-text-fragment-api.html: Added.
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml:
* Source/WebCore/CMakeLists.txt:
* Source/WebCore/DerivedSources-input.xcfilelist:
* Source/WebCore/DerivedSources-output.xcfilelist:
* Source/WebCore/DerivedSources.make:
* Source/WebCore/Headers.cmake:
* Source/WebCore/Sources.txt:
* Source/WebCore/WebCore.xcodeproj/project.pbxproj:
* Source/WebCore/bindings/js/WebCoreBuiltinNames.h:
* Source/WebCore/dom/Document.cpp:
* Source/WebCore/dom/Document.h:
(WebCore::Document::fragmentDirectiveForBindings):
* Source/WebCore/dom/Document.idl:
* Source/WebCore/page/FragmentDirective.h: Added.
(WebCore::FragmentDirective::create):
* Source/WebCore/page/FragmentDirective.idl: Added.

Canonical link: https://commits.webkit.org/279258@main
@webkit-commit-queue webkit-commit-queue force-pushed the eng/Expose-document-fragmentDirective-feature-detection-for-text-fragments branch from a5181e6 to 04bd634 Compare May 24, 2024 07:38
@webkit-commit-queue
Copy link
Collaborator

Committed 279258@main (04bd634): https://commits.webkit.org/279258@main

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

@webkit-commit-queue webkit-commit-queue merged commit 04bd634 into WebKit:main May 24, 2024
@webkit-commit-queue webkit-commit-queue removed the merge-queue Applied to send a pull request to merge-queue label May 24, 2024
@sideshowbarker sideshowbarker deleted the eng/Expose-document-fragmentDirective-feature-detection-for-text-fragments branch May 24, 2024 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Scrolling Bugs related to main thread and off-main thread scrolling
Projects
None yet
5 participants