[selectors] :local-link definition's comparison of URLs should be more precise than "matches"

Open Beginner friendly
#10,976 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
css
Domain
documentation

Research direction

Start at the “:local-link” pseudo-class section in the Selectors Level 4 draft and read the linked URL Standard definitions for URL equals, excluding fragments, and URL fragments. Update the comparison wording to use those precise concepts, then verify that the conditions for null and non-null target fragments remain explicit.

Written by the indexing model from the issue text.

Description

selectors-5

This is nitpicky, but "matches" tends to be ambiguous when applied to data structures like URLs. Sometimes it just means "equals", and other times it means something more complicated and sometimes unspecified. In this case, I think it means https://url.spec.whatwg.org/#concept-url-equals, conditionally with the exclude fragments flag, so you should say that.

The relevant text in https://drafts.csswg.org/selectors-4/#the-local-link-pseudo is:

It represents an element that is the source anchor of a hyperlink whose target’s absolute URL matches the element’s own document URL. If the hyperlink’s target includes a fragment URL, then the fragment URL of the current URL must also match; if it does not, then the fragment URL portion of the current URL is not taken into account in the comparison.

This might become:

It represents an element that is the source anchor of a hyperlink whose target’s absolute URL [=url/equals=] the element’s own document URL, with the [=url/equals/exclude fragments=] parameter set to true if the hyperlink’s target URL has a null [=url/fragment=].

Dominant language
Bikeshed
Stars
4.9k
Forks
816
Avg merge
2d 18h
Merged PRs (30d)
24

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from w3c/csswg-drafts

All issues in w3c/csswg-drafts

Similar issues

More Documentation issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.