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

Editorial: Normalize HTML spec references using xref #1906

Merged
merged 6 commits into from
Apr 24, 2023

Conversation

adampage
Copy link
Member

@adampage adampage commented Apr 1, 2023

Closes #1903

A little editorial cleanup to normalize the way we reference HTML spec definitions for elements and attributes. I’ll leave a few notes in context below.


Preview | Diff

<td class="role-base">
<a href="https://www.w3.org/TR/html5/grouping-content.html#the-dl-element"><abbr title="Hypertext Markup Language">HTML</abbr> <code>dl</code></a>
</td>
<td class="role-base"><code>&lt;[^dl^]&gt;</code> in HTML</td>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I settled on a syntax convention of “<element-name> in HTML”, where just the element name is linked using its xref term. I kept (or added, where needed) the &lt; and &gt; brackets to aid in quick understandability/differentiation when referencing an HTML element versus a plain text role string or attribute name.

index.html Show resolved Hide resolved
@@ -12702,7 +12703,7 @@ <h2>Definitions of States and Properties (all aria-* attributes)</h2>
<tbody>
<tr>
<th class="property-related-head" scope="row">Related Concepts:</th>
<td class="property-related"><code>required</code> attribute in [[HTML]]</td>
<td class="property-related"><code>[^input/required^]</code> attribute in HTML</td>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We’ve got a few references to form-related attributes like required that could be misinterpreted as global attributes when they actually have multiple distinct HTML spec definitions, like [^input/required^] vs. [^textarea/required^] vs. [^select/required^]. For now, I just linked to the input-scoped definition and didn’t add any additional language to disambiguate. What do you think? Here are the applicable attributes I encountered:

  • placeholder
  • readonly
  • required

@@ -13435,7 +13436,7 @@ <h3>State and Property Attributes</h3>
</section>
<section id="host_general_focus">
<h2>Focus Navigation</h2>
<p>An implementing host language MUST provide support for the author to make all interactive elements focusable, that is, any renderable or event-receiving elements. An implementing host language MUST provide a facility to allow web authors to define whether these focusable, interactive elements appear in the default tab navigation order. The <code>tabindex</code> <a>attribute</a> in <abbr title="Hypertext Markup Language">HTML</abbr> is an example of one implementation.</p>
<p>An implementing host language MUST provide support for the author to make all interactive elements focusable, that is, any renderable or event-receiving elements. An implementing host language MUST provide a facility to allow web authors to define whether these focusable, interactive elements appear in the default tab navigation order. The <code>tabindex</code> <a>attribute</a> in HTML is an example of one implementation.</p>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TIL that when ReSpec encounters a unique <abbr> pattern in the document, it automatically generates identical <abbr> markup for all subsequent occurrences of the plain text abbreviation string. 🤩

Because I encountered a few explicit abbreviation markups for “HTML” during this PR, I found and left the first occurrence of “<abbr title="Hypertext Markup Language">HTML</abbr>on line 475, then simplified all later occurrences to just plain “HTML” to reduce noise in the document.

FWIW, it looks like we’ve got a ton more abbreviations we could simplify if that were desirable? E.g., “WAI-ARIA”, “DOM”, “API”. If anyone think that’s a good idea, please say the word — I’d be happy to do a separate PR for that.

*[TIL]: Today I learned
*[FWIW]: For what it’s worth

@adampage adampage self-assigned this Apr 1, 2023
@adampage adampage added the editorial a change to an example, note, spelling, grammar, or is related to publishing or the repo label Apr 1, 2023
@adampage adampage changed the title Normalize HTML spec references using xref Editorial: Normalize HTML spec references using xref Apr 4, 2023
@adampage
Copy link
Member Author

@spectranaut and @jnurthen, what do you think of this spot in the readme to add some xref authoring guidance?

@pkra
Copy link
Member

pkra commented Apr 18, 2023

@adampage I've opened #1918 for your suggestion

@pkra
Copy link
Member

pkra commented Apr 18, 2023

Oh sorry -- I misread the comment. You already added what you wanted here, correct?

@adampage
Copy link
Member Author

Thanks, @pkra — yep, I’ve already added an update to the readme in this PR.

@jnurthen jnurthen merged commit 10112f8 into w3c:main Apr 24, 2023
1 of 2 checks passed
github-actions bot added a commit that referenced this pull request Apr 24, 2023
SHA: 10112f8
Reason: push, by jnurthen

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
jnurthen added a commit that referenced this pull request Oct 10, 2023
Co-authored-by: James Nurthen <jnurthen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
editorial a change to an example, note, spelling, grammar, or is related to publishing or the repo
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cleanup links to HTML spec (maybe others?)
3 participants