[IntersectionObserver] Fix cross-origin check for honoring rootMargin #25573
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
An issue on the IntersectionObserver spec repo raised the issue of
the precise limitation on rootMargin and rootBounds. The original spec
language refers to the "unit of related similar-origin browsing
contexts", which suggests that cross-origin same-site observations
could use rootMargin and rootBounds. That is incorrect; same-site
cross-origin observations should not be able to use rootMargin and
rootBounds.
Chromium already conforms to the more restrictive behavior; this CL
is just to add a test to enforce it.
w3c/IntersectionObserver#448
Separately, the existing cross-origin-iframe.sub.html test was disabled
due to flakiness; and then a subsequent code change broke the
cross-origin limitation for applying rootMargin, so the test has been
reliably failing. This patch fixes the cross-origin check and reenables
the test.
Change-Id: Ib864f9a9433b4d323ef73a3b2b5a8f645697c07c
Reviewed-on: https://chromium-review.googlesource.com/2411229
WPT-Export-Revision: b3687c029a506f75fc1c7e53c1f55b2783e5b2bc