Skip to content

Commit cd6f532

Browse files
committed
[selectors] URI->URL, clean up :local-link section
1 parent 3f96ee1 commit cd6f532

2 files changed

Lines changed: 59 additions & 41 deletions

File tree

selectors/Overview.html

Lines changed: 33 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2431,23 +2431,36 @@ <h3 id=local-pseudo><span class=secno>7.3. </span> The local link
24312431
</div>
24322432

24332433
<p>The pseudo-class can also accept a non-negative integer as its sole
2434-
argument, which, if the document's URL is hierarchical, indicates the
2435-
number of path levels to match: an argument of ‘<code
2436-
class=css>0</code>’ represents a link element whose target is in the
2437-
same domain as the document's URL, ‘<code
2438-
class=css>1</code>’represents a link element whose target has the same
2439-
domain and first path segment, ‘<code class=css>2</code>’ represents a
2440-
link element whose target has the same domain, first, and second path
2441-
segments, etc. Path segments are portions of the URL's path that are
2442-
separated by forward slashes (/). If a segment is missing from the
2443-
document's URL, a pseudo-class requiring that segment to match does not
2444-
match anything. Similarly if the document's URL is not hierarchical, the
2445-
functional pseudo-class does not match anything. The scheme, username,
2446-
password, port, query string, and fragment portions of the URL are not
2447-
considered when matching against <code>:local-link(<var>n</var>)</code>.
2434+
argument, which, if the document's URL belongs to a hierarchical scheme,
2435+
indicates the number of path levels to match:
2436+
2437+
<ul>
2438+
<li><code class=css>:local-link(0)</code>’ represents a link element
2439+
whose target is in the same domain as the document's URL
24482440

2449-
<p class=issue>Is there such a thing as IRL? Because we do want this to
2450-
work for internationalized URLs, just not URNs.
2441+
<li><code class=css>:local-link(1)</code>’ represents a link element
2442+
whose target has the same domain and first path segment
2443+
2444+
<li><code class=css>:local-link(2)</code>’ represents a link element
2445+
whose target has the same domain, first, and second path segments
2446+
2447+
<li>etc.
2448+
</ul>
2449+
2450+
<div class=example>
2451+
<p>The following example styles all site-external links with a dashed
2452+
underline.
2453+
2454+
<pre>:not(:local-link(0)) { text-decoration-style: dashed; }</pre>
2455+
</div>
2456+
2457+
<p>Path segments are portions of the URL's path that are separated by
2458+
forward slashes (/). The scheme, username, password, port, query string,
2459+
and fragment portions of the URL are not considered when matching against
2460+
<code>:local-link(<var>n</var>)</code>. If a segment is missing from the
2461+
document's URL, a pseudo-class requiring that segment to match does not
2462+
match anything. If the document's URL does not belong to a hierarchical
2463+
scheme, the functional pseudo-class matches nothing.
24512464

24522465
<div class=example>
24532466
<p>So, given the links:
@@ -2496,12 +2509,10 @@ <h3 id=local-pseudo><span class=secno>7.3. </span> The local link
24962509
</ol>
24972510
</div>
24982511

2499-
<div class=example>
2500-
<p>The following example styles all site-external links with a dashed
2501-
underline.
2502-
2503-
<pre>:not(:local-link(0)) { text-decoration-style: dashed; }</pre>
2504-
</div>
2512+
<p class=issue> Should a <code>:local-link(2)</code> match a link from the
2513+
document <code>http://example.com/foo</code> to itself? (This would make
2514+
Style 5 apply to Link 4.) (Relatedly, should a link from a document at an
2515+
opaque URL to itself also match?)
25052516

25062517
<h3 id=the-target-pseudo><span class=secno>7.4. </span> The target
25072518
pseudo-class <a href="#target-pseudo"><code>:target</code></a></h3>

selectors/Overview.src.html

Lines changed: 26 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1611,21 +1611,28 @@ <h3 id="local-pseudo">
16111611
</div>
16121612

16131613
<p>The pseudo-class can also accept a non-negative integer as its sole argument,
1614-
which, if the document's URL is hierarchical,
1615-
indicates the number of path levels to match:
1616-
an argument of ''0'' represents a link element whose target is in the same domain as the document's URL,
1617-
''1''represents a link element whose target has the same domain and first path segment,
1618-
''2'' represents a link element whose target has the same domain, first, and second path segments, etc.
1619-
Path segments are portions of the URL's path that are separated by forward slashes (/).
1620-
If a segment is missing from the document's URL,
1621-
a pseudo-class requiring that segment to match does not match anything.
1622-
Similarly if the document's URL is not hierarchical,
1623-
the functional pseudo-class does not match anything.
1624-
The scheme, username, password, port, query string, and fragment portions of the URL are not considered
1625-
when matching against <code>:local-link(<var>n</var>)</code>.
1614+
which, if the document's URL belongs to a hierarchical scheme,
1615+
indicates the number of path levels to match:
1616+
<ul>
1617+
<li>'':local-link(0)'' represents a link element whose target is in the same domain as the document's URL
1618+
<li>'':local-link(1)'' represents a link element whose target has the same domain and first path segment
1619+
<li>'':local-link(2)'' represents a link element whose target has the same domain, first, and second path segments
1620+
<li>etc.
1621+
</ul>
16261622

1627-
<p class="issue">Is there such a thing as IRL? Because we do want this
1628-
to work for internationalized URLs, just not URNs.
1623+
<div class="example">
1624+
<p>The following example styles all site-external links with a dashed
1625+
underline.
1626+
<pre>:not(:local-link(0)) { text-decoration-style: dashed; }</pre>
1627+
</div>
1628+
1629+
<p>Path segments are portions of the URL's path that are separated by forward slashes (/).
1630+
The scheme, username, password, port, query string, and fragment portions of the URL are not considered
1631+
when matching against <code>:local-link(<var>n</var>)</code>.
1632+
If a segment is missing from the document's URL,
1633+
a pseudo-class requiring that segment to match does not match anything.
1634+
If the document's URL does not belong to a hierarchical scheme,
1635+
the functional pseudo-class matches nothing.
16291636

16301637
<div class="example">
16311638
<p>So, given the links:
@@ -1654,11 +1661,11 @@ <h3 id="local-pseudo">
16541661
</ol>
16551662
</div>
16561663

1657-
<div class="example">
1658-
<p>The following example styles all site-external links with a dashed
1659-
underline.
1660-
<pre>:not(:local-link(0)) { text-decoration-style: dashed; }</pre>
1661-
</div>
1664+
<p class="issue">
1665+
Should a <code>:local-link(2)</code> match a link from the document <code>http://example.com/foo</code>
1666+
to itself? (This would make Style 5 apply to Link 4.)
1667+
(Relatedly, should a link from a document at an opaque URL to itself also match?)
1668+
16621669

16631670
<h3 id="the-target-pseudo">
16641671
The target pseudo-class <code>:target</code></h3>

0 commit comments

Comments
 (0)