Conversation
Add viewport bounds check to elementFromPoint function.
|
All contributors have signed the CLA ✍️ ✅ |
recheck |
|
I have read the CLA Document and I hereby sign the CLA |
|
Can you provide an exact link that causes the performance issue? I think this change is likely to break sites. Since we don't change the viewport, any script that expects an element to become visible from a scroll or some other viewport change will hang. Also, while it might not be correct, all of our coordinates are document-based, not viewport based, e.g. getBoundingClientRect() doesn't consider the scroll position. So at least we're consistent. |
|
Summary
elementFromPoint()receives coordinates outside the viewportelementFromVerticalPoint()Motivation
CSSOM View requires negative coordinates or coordinates greater than the viewport dimensions to return
null. For very large y values, the existing traversal shortcut does not fire, so the browser unnecessarily walks the DOM and performs visibility checks.Testing
git diff --checkTEST_FILTER="WebApi: Document#element_from_point.html" make test