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

Interoperability of 'The indicated part of the document' for HTML documents #2902

Closed
tkent-google opened this issue Aug 10, 2017 · 4 comments
Closed

Comments

@tkent-google
Copy link
Collaborator

@tkent-google tkent-google commented Aug 10, 2017

Spec: https://html.spec.whatwg.org/multipage/browsing-the-web.html#scroll-to-fragid:the-indicated-part-of-the-document-6
Test: http://w3c-test.org/html/browsers/browsing-the-web/scroll-to-fragid/

In the current specification, a rough algorithm to find "the indicated part of the document" for HTML documents is like:

  1. Search IDs for decoded fragid
  2. Search names for not-decoded fragid

However, it doesn't match to none of Chrome, Edge, Firefox, and Safari.

Chrome and Safari:

  1. Search IDs for not-decoded fragid
  2. Search names for not-decoded fragid
  3. Search IDs for decoded fragid
  4. Search names for decoded fragid

Firefox:

  1. Search IDs for decoded fragid
  2. Search decoded names for decoded fragid

Edge:

  1. Search IDs for decoded fragid
  2. Search names for decoded fragid
    (Note that Edge has different behavior in http: and file:.)

I hesitate to make Google Chrome match to the specification because it would introduce yet another incompatible implementation.

@annevk
Copy link
Member

@annevk annevk commented Aug 10, 2017

Hah, see #2901. It seems that I forgot to test searching <a name> for decoded fragments.

@annevk
Copy link
Member

@annevk annevk commented Aug 10, 2017

Does Chrome match "top" ASCII-case-insensitively after decoding?

@tkent-google
Copy link
Collaborator Author

@tkent-google tkent-google commented Aug 10, 2017

Does Chrome match "top" ASCII-case-insensitively after decoding?

Chrome and Safari check 'top' for both of not-decoded fragid and decoded fragid. So #top and #to%70 work. I don't think this behavior makes much sense.

  1. Search IDs for not-decoded fragid
  2. Search names for not-decoded fragid
  3. Check if not-decoded fragid is "top"
  4. Search IDs for decoded fragid
  5. Search names for decoded fragid
  6. Check if decoded fragid is "top"

@annevk
Copy link
Member

@annevk annevk commented Aug 10, 2017

It seems removing step 3 would not be observable. I don't really care what behavior we end up with as long as everyone aligns.

@annevk annevk closed this in c230f55 Aug 19, 2017
alice added a commit to alice/html that referenced this issue Jan 8, 2019
Chrome and Safari both do a literal match first before using the decoded fragment. Edge does something very similar, though seems to differ in :target handling. Firefox would like to align per https://bugzilla.mozilla.org/show_bug.cgi?id=1380323 as our compliant behavior causes issues.

Tests: web-platform-tests/wpt#6887.

Fixes whatwg#2902.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants