Re: [whatwg/dom] Further Attr node fixes for compareDocumentPosition() (#312)

> @@ -4176,11 +4167,13 @@ when invoked, must run these steps:
>    JavaScript implementations a cached <code class='lang-javascript'>Math.random()</code> value can
>    be used.
>  
> - <li><p>If <var>node1</var> is an <a>ancestor</a> of <var>node2</var>, then return the result of
> - adding {{Node/DOCUMENT_POSITION_CONTAINS}} to {{Node/DOCUMENT_POSITION_PRECEDING}}.
> + <li><p>If <var>node1</var> is an <a>ancestor</a> of <var>node2</var>, or <var>node1</var> is

Oh my, this is still a problem when an attribute is compared to a descendant of its element. Because one of *node1* and *node2* will become the attribute's element, either this or the next step will match. Maybe "If *node1* is an ancestor of *node2* <ins>and *attr1* is null</ins>, or *node1* is *node2* and *attr2* is non-null" and similarly for the next step?

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/312/files/96cb8745f57621bb3a5effe9211baf96f52c5849#r76777935

Received on Tuesday, 30 August 2016 11:37:49 UTC