← Back to release summary

document.fragmentDirective

Category
DOM
Type
New or changed feature
Status
Enabled by default (Chrome 86)
Intent stage
Prepare to ship

Summary

This change moves window.location.fragmentDirective to document.fragmentDirective which seems like a more appropriate and safer place. It is a small change to the text-fragments feature in https://chromestatus.com/feature/4733392803332096. Text-fragments introduced an empty object at window.location.fragmentDirective as a means to feature detect the newly added text-fragment capability. window.location turns out to be a bad place for this functionality, see https://crbug.com/1057795.

Standards & signals

Docs: https://github.com/WICG/scroll-to-text-fragment/

Explainers: https://crbug.com/1057795 https://github.com/whatwg/html/issues/5523

View on chromestatus.com