Reference combinators /ref/

The reference combinator consists of two slashes with an intervening CSS qualified name, and separates two compound selectors, e.g. ''A /attr/ B''. The element represented by the first compound selector explicitly references the element represented by the second compound selector. Unless the host language defines a different syntax for expressing this relationship, this relationship is considered to exist if the value of the specified attribute on the first element is an IDREF or an ID selector referencing the second element. Attribute matching for reference combinators follow the same rules as for attribute selectors.
The following example highlights an input element when its <label> is focused or hovered-over:
		label:is(:hover, :focus) /for/ input,       /* association by "for" attribute */
		label:is(:hover, :focus):not([for]) input { /* association by containment */
			box-shadow: yellow 0 0 10px;
		}
		

The local link pseudo-class '':local-link''

The :local-link pseudo-class allows authors to style hyperlinks based on the users current location within a site and to differentiate site-internal versus site-external links. The (non-functional) '':local-link'' pseudo-class represents an element that is the source anchor of a hyperlink whose target's absolute URL matches the element's own document URL. Any fragment identifiers are stripped before matching the document's URL against the link's URL; otherwise all portions of the URL are considered.
For example, the following rule prevents links targeting the current page from being underlined when they are part of the navigation list:
nav :local-link { text-decoration: none; } 
As a functional pseudo-class, '':local-link()'' can also accept a non-negative integer as its sole argument, which, if the document's URL belongs to a hierarchical scheme, indicates the number of path levels to match:
The following example styles all site-external links with a dashed underline.
:not(:local-link(0)) { text-decoration-style: dashed; } 
Path segments are portions of the URL's path that are separated by forward slashes (/). If a segment is missing from the document's URL, a pseudo-class requiring that segment to match does not match anything.
So, given the links:
  1. <a href="http://www.example.com">Home</a>
  2. <a href="http://www.example.com/2011">2011</a>
  3. <a href="http://www.example.com/2011/03">March</a>
  4. <a href="http://www.example.com/2011/03/">March</a>
  5. <a href="http://www.example.com/2011/03/21">21 March</a>
  6. <a href="https://www.example.com/2011/03/">March</a>
  7. <a href="http://example.com/2011/03/">March</a>
and the styles:
  1. a:local-link {...}
  2. a:local-link(0) {...}
  3. a:local-link(1) {...}
  4. a:local-link(2) {...}
  5. a:local-link(3) {...}
  6. a:local-link(4) {...}
If the document's URL is http://www.example.com/2011/03/:
  1. Link 1 would receive Style B
  2. Link 2 would receive Styles B and C
  3. Link 3 would receive Styles B, C, and D
  4. Link 4 would also receive Styles A, B, C, D, and E
  5. Link 5 would receive Styles B, C, and D
  6. Link 6 would remain unstyled
  7. Link 7 would remain unstyled
  8. Style F would not be applied to anything
The "origin" of the URL is defined by RFC 6454, Section 4. The username, password, query string, and fragment portions of the URL are not considered when matching against '':local-link(n)''. If the document's URL does not belong to a hierarchical scheme, the functional pseudo-class matches nothing.

It's clear that, if the document URL has at least N segments, then '':local-link(N)'' only matches links whose URL has at least N segments. (This lets you assign consistent semantics to :local-link so that, for example, :local-link(2) means a "within-repo" link on GitHub.) What about if the document url has less than N segments, and the link is same-page? Should "null segments" count as matching, or not?