Skip to content

Commit 8e07cfd

Browse files
fix: prefer first non-zero rect for interactability checks
1 parent 926cd31 commit 8e07cfd

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

index.html

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4591,13 +4591,16 @@ <h3>Interactability</h3>
45914591
is the origin position of the rectangle
45924592
that is the intersection between
45934593
the element&apos;s first {{DOMRect}} of {{Element/getClientRects()}}
4594+
with non-zero width and height (or the first {{DOMRect}} if none have non-zero dimensions)
45944595
and the <a>initial viewport</a>.
45954596
It can be calculated this way:
45964597

45974598
<ol>
45984599
<li><p>Let <var>rectangle</var> be
4599-
the first object of the {{DOMRect}} collection
4600-
returned by calling {{Element/getClientRects()}} on <a><var>element</var></a>.
4600+
the first object in the {{DOMRect}} collection
4601+
returned by calling {{Element/getClientRects()}} on <a><var>element</var></a>
4602+
that has non-zero width and height,
4603+
or the first object in the collection if no such object is found.
46014604

46024605
<li><p>Let <var>left</var> be
46034606
<a>max</a>(0, <a>min</a>(<a>x coordinate</a>,

0 commit comments

Comments
 (0)