Index: third_party/WebKit/LayoutTests/intersection-observer/resources/cross-origin-subframe.html |
diff --git a/third_party/WebKit/LayoutTests/http/tests/intersection-observer/resources/cross-origin-subframe.html b/third_party/WebKit/LayoutTests/intersection-observer/resources/cross-origin-subframe.html |
similarity index 76% |
rename from third_party/WebKit/LayoutTests/http/tests/intersection-observer/resources/cross-origin-subframe.html |
rename to third_party/WebKit/LayoutTests/intersection-observer/resources/cross-origin-subframe.html |
index edf34dcd2a591c09c7d4cc213bf175104acaf8ad..bda1a8c17d91c99ebd7b2e60a41ee2bcdaf57864 100644 |
--- a/third_party/WebKit/LayoutTests/http/tests/intersection-observer/resources/cross-origin-subframe.html |
+++ b/third_party/WebKit/LayoutTests/intersection-observer/resources/cross-origin-subframe.html |
@@ -1,9 +1,42 @@ |
<!DOCTYPE html> |
-<script src="/js-test-resources/intersection-observer-helper-functions.js"></script> |
<div style="height: 200px; width: 100px;"></div> |
<div id="target" style="background-color: green; width:100px; height:100px"></div> |
<div style="height: 200px; width: 100px;"></div> |
<script> |
+function clientRectToJson(rect) { |
+ if (!rect) |
+ return null; |
+ return { |
+ top: rect.top, |
+ right: rect.right, |
+ bottom: rect.bottom, |
+ left: rect.left, |
+ width: rect.width, |
+ height: rect.height |
+ }; |
+} |
+ |
+function coordinatesToClientRectJson(top, right, bottom, left) { |
+ return { |
+ top: top, |
+ right: right, |
+ bottom: bottom, |
+ left: left, |
+ width: right - left, |
+ height: bottom - top |
+ }; |
+} |
+ |
+function entryToJson(entry) { |
+ return { |
+ boundingClientRect: clientRectToJson(entry.boundingClientRect), |
+ intersectionRect: clientRectToJson(entry.intersectionRect), |
+ rootBounds: clientRectToJson(entry.rootBounds), |
+ time: entry.time, |
+ target: entry.target.id |
+ }; |
+} |
+ |
var port; |
var entries = []; |
var target = document.getElementById('target'); |