(scroll-to-text) fragmentDirectives should be allowed to be unique
What is the issue with the HTML Standard?
The PR for this feature is being upstreamed here https://github.com/whatwg/html/pull/11895. One of the things that is exposed by the idl (https://wicg.github.io/scroll-to-text-fragment/#dom-document-fragmentdirective) is the fragmentDirective that lists all of the directives parsed from the URL.
In order to limit the amount of work that a user-agent has to do for each directive, I think this should allow or mandate that when constructing these directives, we only keep a unique set.
@flackr @domfarolino
That API doesn't list any directives? It's just an empty object. Also, wouldn't listing them go against the privacy goals of this feature?
Agreed, I don't see the issue here. Of course it looks like Chromium's FragmentDirective interface is NOT empty, which is confusing to me for the reasons that @annevk brought up. @bokand, and insight into what's happening here?
The additional fields in Chromium are behind a flag and from additions we were considering and prototyping - I think we can remove them to avoid confusion...
The fragmentDirective interface was primarily intended as a way to feature detect and potential area for future extension but yeah, currently it's just empty.
In that case, this might be OK to close since the behavioral differences from the unique set in the implementation would not be observable.
But yeah, cleaning up the spec to avoid confusion would be great too!
But yeah, cleaning up the spec to avoid confusion would be great too!
Do you mean cleaning up Chromium's IDL?
However, searching for the same text fragment several times would introduce unnecessary work and would cause timing differences. So, from an user agent's point of view, it might make sense to make the list of text directives unique after parsing them from the fragment and before searching the document. I'm not sure this needs to be added to the spec though, or if that's just an implementation detail.