fix: prefer first non-zero rect for interactability checks#1965
fix: prefer first non-zero rect for interactability checks#1965juliandescottes wants to merge 1 commit into
Conversation
|
I don't understand the build failure here, it seems to complain about node but this is unrelated to my change? Edit: No idea why this only started failing now, but let's see: #1966 |
|
@juliandescottes can you please rebase? CI actions should no longer show this error. |
7be5558 to
8e07cfd
Compare
Sure,done! |
whimboo
left a comment
There was a problem hiding this comment.
Just two wording comments from my side.
| <p>An <a>element</a>'s <dfn data-lt="center point">in-view center point</dfn> | ||
| is the origin position of the rectangle | ||
| that is the intersection between | ||
| the element's first {{DOMRect}} of {{Element/getClientRects()}} | ||
| with non-zero width and height (or the first {{DOMRect}} if none have non-zero dimensions) | ||
| and the <a>initial viewport</a>. |
There was a problem hiding this comment.
| and the <a>initial viewport</a>. | |
| <p>An <a>element</a>'s <dfn data-lt="center point">in-view center point</dfn> | |
| is the origin position of the rectangle | |
| that is the intersection between | |
| the element's {{DOMRect}} and the <a>initial viewport</a>. | |
| The {{DOMRect}} is the first result of {{Element/getClientRects()}} | |
| with non-zero width and height, or the first result if none qualify. |
| <li><p>Let <var>rectangle</var> be | ||
| the first object of the {{DOMRect}} collection | ||
| returned by calling {{Element/getClientRects()}} on <a><var>element</var></a>. | ||
| the first object in the {{DOMRect}} collection | ||
| returned by calling {{Element/getClientRects()}} on <a><var>element</var></a> | ||
| that has non-zero width and height, | ||
| or the first object in the collection if no such object is found. | ||
|
|
There was a problem hiding this comment.
Another suggestion so that it reads better IMHO. Sadly I cannot get GitHub to let me create a suggestion. :(
Let rectangle be the first object in the DOMRect collection returned by calling getClientRects() on element whose width and height are both non-zero. If no such object exists, let rectangle be the first object in the collection.
Fixes #1961
This matches the implementation as updated in Firefox. WPT tests already cover potential edge cases related to this (web-platform-tests/wpt#60371)
This change is
Preview | Diff