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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/intersection-observer/resources/helper-functions.js

Issue 1615573002: Set rootBounds to null for cross-origin observations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Get rid of js-test.js monkey patching Created 4 years, 10 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 unified diff | Download patch
OLDNEW
(Empty)
1 function clientRectToJson(rect) {
2 if (!rect)
3 return null;
4 return {
5 top: rect.top,
6 right: rect.right,
7 bottom: rect.bottom,
8 left: rect.left,
9 width: rect.width,
10 height: rect.height
11 };
12 }
13
14 function coordinatesToClientRectJson(top, right, bottom, left) {
15 return {
16 top: top,
17 right: right,
18 bottom: bottom,
19 left: left,
20 width: right - left,
21 height: bottom - top
22 };
23 }
24
25 function entryToJson(entry) {
26 return {
27 boundingClientRect: clientRectToJson(entry.boundingClientRect),
28 intersectionRect: clientRectToJson(entry.intersectionRect),
29 rootBounds: clientRectToJson(entry.rootBounds),
30 time: entry.time,
31 target: entry.target.id
32 };
33 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698