whatwg/dom

Trouble understanding a parable of specification, under the "ensure pre-insertion validity" list of steps

クローズ

#870 opened on 2020/06/11

 (4 件のコメント) (0 件のリアクション) (0 人の担当者)HTML (338 件のフォーク)batch import
clarificationgood first issue

Repository metrics

Stars
 (1,728 個のスター)
PR merge metrics
 (平均マージ 56d 18h) (30d で 6 merged PRs)

説明

Under point 6 of the list of steps to take to "ensure pre-insertion validity", as part of an attempt to implement a procedure involving the particular list of steps, I am having trouble unambiguously interpreting the following statement:

parent has an element child, child is a doctype, or child is non-null and a doctype is following child.

The test described by the statement is only effective if the node is an element, as evidenced by text prior to the quote above. However, I am unsure if the expression quoted above is equivalent to:

"*parent* has an element child _and_ (emphasis mine) *child* is a doctype, or *child* is non-null and a doctype is following *child*."

or if it is equivalent to:

"*parent* has an element child, _or_ (emphasis mine) *child* is a doctype, or *child* is non-null and a doctype is following *child*."

When implementing the procedure conforming to the list of steps, proper interpretation, as you might imagine, is absolutely critical.

I am asking whether the sentence should be re-worded to remove the kind of difficulty I am experiencing, if I am on to anything here. Alternatively, perhaps there is a "how to read the specification"-kind of document somewhere, which explains how to interpret these kind of linguistic statements? I consider myself well versed in English, but feel free to point out if this is a mistake I am making somewhere.

There may be other statements where this kind of ambiguity surfaces, the one quoted above was just an example, and happens to be the one I am practically involved with.

コントリビューターガイド