本家Stack OverflowでHTMLの質問をしたら、仕様が変わったという話

とある人(筆者ではない)が本家Stack Overflowでfigure要素に関する質問をしたら、HTML Living Standardの明確化が行われたという話。こういうとき、英語で質問できると専門家(というかSpec Editor's)が直接回答してくれるのはつよいよなぁ…と改めて思ったり(英語力ください)。

What does reference mean in when using figure?
https://stackoverflow.com/questions/45070672/what-does-reference-mean-in-when-using-figure
dfn what it means for elements to be “referenced” by sideshowbarker · Pull Request #2841 · whatwg/html
https://github.com/whatwg/html/pull/2841

変更が入った(というか追加された)のは主に以下の部分

Elements can be referenced (referred to) in some way, either explicitly or implicitly. One way that an element in the DOM can be explicitly referenced is by giving an id attribute to the element, and then creating a hyperlink with that id attribute's value as the fragment for the hyperlink's href attribute value. Hyperlinks are not necessary for a reference, however; any manner of referring to the element in question will suffice.

Consider the following figure element, which is given an id attribute:

<figure id="module-script-graph">
  <img src="module-script-graph.svg"
       alt="Module A depends on module B, which depends
            on modules C and D.">
  <figcaption>Figure 27: a simple module graph</figcaption>
</figure>

A hyperlink-based reference could be created using the a element, like so:

As we can see in <a href="#module-script-graph">figure 27</a>, ...

試訳するならこんな感じか。

要素は、何らかの方法で明示的にまたは暗黙的に参照される(参照する)ことがある。 DOMにおける要素を明示的に参照できる方法の1つは、要素にid属性を与えて、そのid属性の値をハイパーリンクのhref属性値のフラグメントとしてハイパーリンクを作成することである。しかし、参照にはハイパーリンクは必須ではない。問題の要素を参照する任意の方法で十分である。
id要素が与えられる、次のfigure要素を考えてみよう:

<figure id="module-script-graph">
  <img src="module-script-graph.svg"
       alt="Module A depends on module B, which depends
            on modules C and D.">
  <figcaption>Figure 27: a simple module graph</figcaption>
</figure>

ハイパーリンクベースの参照は、要素を使用して作成することができる。このように:

As we can see in <a href="#module-script-graph">figure 27</a>, ...


…とまあ、教科書のような体裁であれば、図表番号付きの図表をfigureマークアップした上で、(ハイパーリンクで)参照するというのが仕様の意図するところ、というのがかなりクリアーになったんじゃないでしょうか。あるいは、Wordでいうところの相互参照に使うと言ったほうが分かりやすいという人もいるかもしれません。

WHATWG HTML Standard Developer Editionの話

長らく更新が止まっているDeveloper Edition(https://developers.whatwg.org/)だけども、このたびhttps://html.spec.whatwg.org/dev/とURLを新たに更新が再開されている。(The WHATWG Blog — The Developer’s Edition of HTML makes a comeback

Review on utilization of `w-nodev` annotation · Issue #1488 · whatwg/htmlとしてissueを立ててからほぼ丸1年でこのエントリーを書いている、というのも何かの因果でしょうか。いずれにせよ、Editorが直接Developer Editionの面倒を見てくれるので、維持され続ける可能性はぐんと上がったと言えるのかなと(そして、現在W3C側のHTMLにこれに相当するものはないと認識している。誰かW3C Web Plat WGに圧力を掛けてみてはいかがでしょうか)。

日本語訳のほうも一応Developer Editionを作成してみたhttps://momdo.github.io/html/dev/。その性質上、全部日本語になっていることが理想状態なんだけども、かなり長い間更新をサボっていたので、至る所に訳抜けがあるよねって言う。まあ、当面は本の執筆をしつつ、おかしな訳を直していく感じかなあ…。