script: Partially implement IntersectionObserver compute the intersection algo#42204
Conversation
|
🔨 Triggering try run (#21423105665) for Linux (WPT) |
|
Test results for linux-wpt from try job (#21423105665): Flaky unexpected result (38)
Stable unexpected results that are known to be intermittent (30)
Stable unexpected results (17)
|
|
|
5f63e0f to
a3c9828
Compare
|
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#58738) with upstreamable changes. |
| // Total offsets gained from traversing through multiple navigables. We use this to map the coordinate space. | ||
| // TODO: We should store the product sum of transformation matrices instead. But this should be enough to handle | ||
| // scrolling, simple translation, and offset from containing block. | ||
| let mut total_inter_document_offset = Vector2D::zero(); |
There was a problem hiding this comment.
The implementation is considered to avoid bloating the PR. Adding a mapping of coordinate spaces query would require much more changes in the code.
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#58738). |
|
✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#58738) title and body. |
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#58738). |
|
This should be ready for a review! My main concern is about the performance degradation, but theoretically, we are just implementing the correct steps of the algorithm. cc: @mrobinson @jdm @Loirooriol please let me know if you have some suggestion. Particularly if we want to split or include other part of the implementation in the PR. Cheers! |
| [position-absolute-overflow-visible-and-not-visible.html] | ||
| [ParentWithOverflowVisibleAndNotVisible] | ||
| expected: FAIL |
There was a problem hiding this comment.
These fails happens because we doesn't consider two axis independently, I have added a TODO about this.
xiaochengh
left a comment
There was a problem hiding this comment.
Looks good in general!
Thanks! Updated the WPTs, seems that I missed the WPTs after getting back to the issue. 😓 |
|
Oof, yet another merge conflict. |
Signed-off-by: Josh Matthews <josh@joshmatthews.net>
Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
28300c4 to
353f368
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#58738). |
Signed-off-by: Jo Steven Novaryo <steven.novaryo@gmail.com>
353f368 to
bc93154
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#58738). |
|
Please let us know when this is ready for merge, or there are substantial changes to be further reviewed. Thanks! |
I have nothing else to add for now. If there are no concer, we could proceed so that we could add |
|
⛔ Failed to properly merge the upstream pull request (web-platform-tests/wpt#58738). Please address any CI issues and try to merge manually. |

Depends on #42251 for the overflow query.
Use containing block queries to implement the iteration of step 3.2.7. Compute the Intersection of a Target Element and the Root within
IntersectionObserveralgorithm.Contrary to the algorithm in the spec that maps the coordinate space of the element for each iteration, we uses bounding client rect queries to get the appropriate clip rect. And, to handle the mapping between different coordinate spaces of iframes, we use a simple translation.
Due to the platform limitation, currently it would only handle the same
ScriptThreadbrowsing context. Therefore innaccuracy any usage with cross origin iframes is expected.Testing: Existing and new WPTs.
Part of: #35767
Co-authored-by: Josh Matthews josh@joshmatthews.net