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

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

Issue 1449623002: IntersectionObserver: second cut. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Add RuntimeEnabled flags to all idl's, fix test expectations. Created 4 years, 11 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 // Some of the js-test.js boilerplate will add stuff to the top of the document early
2 // enough to screw with frame offsets that are measured by the test. Delay all that
3 // jazz until the actual test code is finished.
4 setPrintTestResultsLazily();
5 var delayDescription = description;
6 var descriptionString = "";
7 var delayIsSuccessfullyParsed = isSuccessfullyParsed;
8 var isSuccessfullyParsed = function() {}
9 var description = function(msg) { descriptionString = msg }
10
11 if (window.testRunner)
12 testRunner.waitUntilDone();
13
14 function rectToString(rect) {
15 return "[" + rect.left + ", " + rect.right + ", " + rect.top + ", " + rect.bot tom + "]";
16 }
17
18 function entryToString(entry) {
19 var ratio = ((entry.intersectionRect.width * entry.intersectionRect.height) /
20 (entry.boundingClientRect.width * entry.boundingClientRect.height ));
21 return (
22 "boundingClientRect=" + rectToString(entry.boundingClientRect) + "\n" +
23 "intersectionRect=" + rectToString(entry.intersectionRect) + "\n" +
24 "visibleRatio=" + ratio + "\n" +
25 "rootBounds=" + rectToString(entry.rootBounds) + "\n" +
26 "target=" + entry.target + "\n" +
27 "time=" + entry.time);
28 }
29
30 function finishTest() {
31 if (descriptionString)
32 delayDescription(descriptionString);
33 delayIsSuccessfullyParsed();
34 finishJSTest();
35 if (window.testRunner)
36 testRunner.notifyDone();
37 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698