Bug 273466

Summary: Expose document.fragmentDirective (feature detection for text fragments)
Product: WebKit Reporter: Philip Jägenstedt <philip>
Component: ScrollingAssignee: sideshowbarker <mike>
Status: RESOLVED FIXED    
Severity: Normal CC: megan_gardner, mike, simon.fraser, thorton, tomac, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Philip Jägenstedt 2024-04-30 00:23:22 PDT
Spec: https://wicg.github.io/scroll-to-text-fragment/#feature-detectability

The purpose of document.fragmentDirective is to be able to feature detect support for text fragments, but according to https://caniuse.com/url-scroll-to-text-fragment Safari 16.1 shipped support for text fragments, but in my testing of Safari 17.4 and searching WebKit source, the feature detection bit isn't implemented.
Comment 1 Philip Jägenstedt 2024-04-30 00:26:12 PDT
I've also filed https://github.com/WICG/scroll-to-text-fragment/issues/257 for discussion.
Comment 2 Radar WebKit Bug Importer 2024-05-07 00:24:14 PDT
<rdar://problem/127650843>
Comment 3 sideshowbarker 2024-05-20 03:53:25 PDT
Pull request: https://github.com/WebKit/WebKit/pull/28784
Comment 4 sideshowbarker 2024-05-20 03:58:14 PDT
The https://github.com/WebKit/WebKit/pull/28784 PR doesn’t actually build yet — I’m getting a linking error with the bindings-generated code that I still need to sort out:

Undefined symbols for architecture arm64:
  "WebCore::JSFragmentDirective::getConstructor(JSC::VM&, JSC::JSGlobalObject const*)", referenced from:
      WebCore::jsDOMWindow_FragmentDirectiveConstructorGetter(JSC::JSGlobalObject&, WebCore::JSDOMWindow&) in UnifiedSource6.o

  "WebCore::toJS(JSC::JSGlobalObject*, WebCore::JSDOMGlobalObject*, WebCore::FragmentDirective&)", referenced from:
      JSC::JSValue WebCore::JSConverter<WebCore::IDLInterface<WebCore::FragmentDirective>>::convert<WebCore::FragmentDirective>(JSC::JSGlobalObject&, WebCore::JSDOMGlobalObject&, WebCore::FragmentDirective const&) in UnifiedSource6.o
      
ld: symbol(s) not found for architecture arm64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 5 EWS 2024-05-24 00:38:20 PDT
Committed 279258@main (04bd634bf209): <https://commits.webkit.org/279258@main>

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