whatwg/dom

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

Closed

#870 opened on Jun 11, 2020

 (4 comments) (0 reactions) (0 assignees)HTML (338 forks)batch import
clarificationgood first issue

Repository metrics

Stars
 (1,728 stars)
PR merge metrics
 (Avg merge 56d 18h) (6 merged PRs in 30d)

Description

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.

Contributor guide