Skip to content

Commit

Permalink
Correct step in matches()
Browse files Browse the repository at this point in the history
It needs to pass this rather than an undefined variable. Also clean up the algorithm a bit.

Fixes #921.
  • Loading branch information
annevk committed Jan 19, 2021
1 parent 8f3ee85 commit fd6673c
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -6796,23 +6796,20 @@ method, when invoked, must run these steps:
<li>Return null.
</ol>

The <dfn method for=Element><code>matches(<var>selectors</var>)</code></dfn> and
<dfn method for=Element><code>webkitMatchesSelector(<var>selectors</var>)</code></dfn> methods, when
invoked, must run these steps:
<p>The <dfn method for=Element><code>matches(<var>selectors</var>)</code></dfn> and
<dfn method for=Element><code>webkitMatchesSelector(<var>selectors</var>)</code></dfn> method steps
are:

<ol>
<li>Let <var>s</var> be the result of
<a>parse a selector</a> from <var>selectors</var>.
<li><p>Let <var>s</var> be the result of <a>parse a selector</a> from <var>selectors</var>.
[[!SELECTORS4]]

<li>If <var>s</var> is failure, <a>throw</a> a
"{{SyntaxError!!exception}}" {{DOMException}}.
<li><p>If <var>s</var> is failure, then <a>throw</a> a "{{SyntaxError!!exception}}"
{{DOMException}}.

<li>Return true if the result of
<a>match a selector against an element</a>, using
<var>s</var>, <var>element</var>, and
<a>:scope element</a> <a>this</a>,
returns success, and false otherwise. [[!SELECTORS4]]
<li><p>If the result of <a>match a selector against an element</a>, using <var>s</var>,
<a>this</a>, and <a>:scope element</a> <a>this</a>, returns success, then return true; otherwise,
return false. [[!SELECTORS4]]
</ol>

<hr>
Expand Down Expand Up @@ -10000,6 +9997,7 @@ Chris Dumez,
Chris Paris,
Chris Rebert,
Cyrille Tuzi,
Dan Burzo,
Daniel Glazman,
Darin Fisher,
David Bruant,
Expand Down

0 comments on commit fd6673c

Please sign in to comment.