diff --git a/css/elements.css b/css/elements.css index 7a6c0934..ad2183a2 100644 --- a/css/elements.css +++ b/css/elements.css @@ -769,6 +769,24 @@ table.lightweight-table th { vertical-align: baseline; } +/* for non-clause-like link targets, apply a fading highlight + and a persistent focus-associated highlight */ +@keyframes highlight-target-bg { + 0% { + background-color: rgba(249, 241, 172, 1); + } + 100% { + background-color: rgba(249, 241, 172, 0) + } +} +#spec-container :target:not(emu-annex, emu-clause, emu-intro, emu-note, body) { + animation: highlight-target-bg 2.5s ease-out; +} +#spec-container :target:focus-within:not(:has(:not(a))) { + animation: none; + background-color: rgba(249, 241, 172, 1); +} + /* diff styles */ ins { background-color: #e0f8e0; diff --git a/src/Dfn.ts b/src/Dfn.ts index d2da9e1b..b048b98f 100644 --- a/src/Dfn.ts +++ b/src/Dfn.ts @@ -7,6 +7,10 @@ import Builder from './Builder'; /*@internal*/ export default class Dfn extends Builder { static async enter({ spec, node, clauseStack }: Context) { + if (!node.hasAttribute('tabindex')) { + node.setAttribute('tabindex', '-1'); + } + const parentClause = clauseStack[clauseStack.length - 1]; if (!parentClause) return; diff --git a/test/baselines/generated-reference/autolinking.html b/test/baselines/generated-reference/autolinking.html index f1f8fe75..e2d51ec8 100644 --- a/test/baselines/generated-reference/autolinking.html +++ b/test/baselines/generated-reference/autolinking.html @@ -11,12 +11,12 @@

1 Autolinking

Type, type, Type(), type()

%Array% and %ArrayPrototype% from ES6 should link (but not %Arrayprototype%).

-

Lowercase

-

strict mode

-

%Percent%

-

extra spaces

-

Await

-

Variants

+

Lowercase

+

strict mode

+

%Percent%

+

extra spaces

+

Await

+

Variants

𝔽(x)

diff --git a/test/baselines/generated-reference/dfn.html b/test/baselines/generated-reference/dfn.html index b88711bc..62abe80b 100644 --- a/test/baselines/generated-reference/dfn.html +++ b/test/baselines/generated-reference/dfn.html @@ -14,9 +14,9 @@

Intro

1 dfn

-

The term dfn means the dfn tag. Other mentions of dfn in this clause should not be auto-linked.

+

The term dfn means the dfn tag. Other mentions of dfn in this clause should not be auto-linked.

-

Terms with ids are called id dfns. Since this dfn has an id, other occurences +

Terms with ids are called id dfns. Since this dfn has an id, other occurences of id dfns may autolink.

diff --git a/test/baselines/generated-reference/oldids.html b/test/baselines/generated-reference/oldids.html index 5cd176ce..b867e517 100644 --- a/test/baselines/generated-reference/oldids.html +++ b/test/baselines/generated-reference/oldids.html @@ -8,7 +8,7 @@

1 c1

-

This is some content and such.

+

This is some content and such.

1.1 c1.1

diff --git a/test/baselines/generated-reference/optional-parts.html b/test/baselines/generated-reference/optional-parts.html index 96610b63..37305ea8 100644 --- a/test/baselines/generated-reference/optional-parts.html +++ b/test/baselines/generated-reference/optional-parts.html @@ -10,7 +10,7 @@

1 Definitions of Normative Optional etc

-

Normative Optional is a defined term, as is Legacy. For comparison, "Deprecated" is not.

+

Normative Optional is a defined term, as is Legacy. For comparison, "Deprecated" is not.