Re: [whatwg/dom] Make Attr inherit from Node again (#299)

> +       <li><p>If <var>node2Attribute</var> <a for=Node>equals</a> <var>attr1</var>, then return the
> +       result of adding {{Node/DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}} and
> +       {{Node/DOCUMENT_POSITION_PRECEDING}}.
> +
> +       <li><p>If <var>node2Attribute</var> <a for=Node>equals</a> <var>attr2</var>, then return the
> +       result of adding {{Node/DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}} and
> +       {{Node/DOCUMENT_POSITION_FOLLOWING}}.
> +      </ol>
> +    </ol>
> +
> +   <li><p>If <var>attr2</var>'s <a for=Attr>element</a> is non-null, then set <var>node2</var> to
> +   <var>attr2</var>'s <a for=Attr>element</a>.
> +  </ol>
> +
> + <li>
> +  <p>If <var>node1</var>'s <a for=tree>root</a> is not <var>node2</var>'s <a for=tree>root</a>, then

This is a stellar API, I think the web platform should have more just like this.

On a more serious note, I think that when you're comparing two detached Attr nodes, you'll actually end up way down in "Return DOCUMENT_POSITION_FOLLOWING" instead of this ridiculous branch like implementations seem to.

-- 
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/299/files/82df412250bd1321562cbe50574219860b976645#r75397386

Received on Thursday, 18 August 2016 21:59:44 UTC