whatwg/dom

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

Chiusa

#870 aperta il 11 giu 2020

 (4 commenti) (0 reazioni) (0 assegnatari)HTML (338 fork)batch import
clarificationgood first issue

Metriche repository

Star
 (1728 stelle)
Metriche merge PR
 (Merge medio 56g 18h) (6 PR mergiate in 30 g)

Descrizione

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.

Guida contributor