Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: third_party/WebKit/LayoutTests/intersection-observer/client-rect.html

Issue 2046113002: IntersectionObserver: use border bounding box for target rect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/intersection-observer/client-rect-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/intersection-observer/client-rect.html
diff --git a/third_party/WebKit/LayoutTests/intersection-observer/client-rect.html b/third_party/WebKit/LayoutTests/intersection-observer/client-rect.html
new file mode 100644
index 0000000000000000000000000000000000000000..c0ae7cbf57bd7498979f7c79602f55931b5a10bd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/intersection-observer/client-rect.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<script src="../resources/js-test.js"></script>
+<script src="../resources/intersection-observer-helper-functions.js"></script>
+<iframe id="iframe" srcdoc="<div id='target'><div style='width:1000px;height:1000px'></div></div>"></iframe>
+<script>
+description("Ensure that change.boundingClientRect matches change.target.getBoundingClientRect() for a clipped element with overflow inside an iframe.");
+
+var iframe = document.getElementById("iframe");
+var entries = [];
+var target;
+
+iframe.onload = function() {
+ target = iframe.contentDocument.getElementById("target");
+ new IntersectionObserver((changes) => {
+ entries.push(...changes);
+ }).observe(target);
+ waitForNotification(step0);
+};
+
+function step0() {
+ shouldBeEqualToNumber("entries.length", 1);
+ if (entries.length > 0) {
+ shouldBe("entries[0].boundingClientRect.top", "target.getBoundingClientRect().top");
+ shouldBe("entries[0].boundingClientRect.left", "target.getBoundingClientRect().left");
+ shouldBe("entries[0].boundingClientRect.width", "target.getBoundingClientRect().width");
+ shouldBe("entries[0].boundingClientRect.height", "target.getBoundingClientRect().height");
+ }
+ finishJSTest();
+}
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/intersection-observer/client-rect-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698