Skip to content

Commit

Permalink
Fix composedPath() even more
Browse files Browse the repository at this point in the history
The comparison needs to be "less than or equal", otherwise you don't prepend the items from the same level as the target.

In a "no shadow DOM" situation, all the items in the path before the current target won't be in the path, which is wrong.

This is tested by event-composed-path.html in WPT.
  • Loading branch information
emilio authored and annevk committed Jan 2, 2019
1 parent ee24b02 commit 37e62c0
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion dom.bs
Expand Up @@ -633,7 +633,7 @@ steps:
<li><p>If <var>path</var>[<var>index</var>]'s <a for=Event/path>root-of-closed-tree</a> is true,
then increase <var>currentHiddenLevel</var> by 1.

<li><p>If <var>currentHiddenLevel</var> is less than <var>maxHiddenLevel</var>, then
<li><p>If <var>currentHiddenLevel</var> is less than or equal to <var>maxHiddenLevel</var>, then
<a for=list>prepend</a> <var>path</var>[<var>index</var>]'s <a for=Event/path>item</a> to
<var>composedPath</var>.

Expand Down Expand Up @@ -9991,6 +9991,7 @@ Doug Schepers,
Edgar Chen,
Elisée Maurer,
Elliott Sprehn,
Emilio Cobos Álvarez,
Eric Bidelman,
Erik Arvidsson,
Gary Kacmarcik,
Expand Down

0 comments on commit 37e62c0

Please sign in to comment.