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

Side by Side Diff: LayoutTests/scrollingcoordinator/resources/non-fast-scrollable-region-testing.js

Issue 18546003: Fix tests to avoid page scale reset when setting page scale. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Use setPageScaleFactorLimits(). Created 7 years, 4 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 | Annotate | Revision Log
OLDNEW
1 function runNonFastScrollableRegionTest(scale) { 1 function runNonFastScrollableRegionTest(scale) {
2 var invScale; 2 var invScale;
3 window.internals.settings.setMockScrollbarsEnabled(true); 3 window.internals.settings.setMockScrollbarsEnabled(true);
4 if (scale != undefined) { 4 if (scale != undefined) {
5 window.internals.setPageScaleFactor(scale, 0, 0); 5 if (window.eventSender)
6 eventSender.setPageScaleFactor(scale, 0, 0);
6 // FIXME: This is a hack for applyPageScaleFactorInCompositor() == false . 7 // FIXME: This is a hack for applyPageScaleFactorInCompositor() == false .
7 invScale = 1 / scale; 8 invScale = 1 / scale;
8 } else { 9 } else {
9 invScale = 1; 10 invScale = 1;
10 } 11 }
11 12
12 var overlay = document.createElement("div"); 13 var overlay = document.createElement("div");
13 overlay.style.position = "absolute"; 14 overlay.style.position = "absolute";
14 overlay.style.left = 0; 15 overlay.style.left = 0;
15 overlay.style.top = 0; 16 overlay.style.top = 0;
16 overlay.style.opacity = 0.5; 17 overlay.style.opacity = 0.5;
17 18
18 var rects = window.internals.nonFastScrollableRects(document); 19 var rects = window.internals.nonFastScrollableRects(document);
19 for (var i = 0; i < rects.length; i++) { 20 for (var i = 0; i < rects.length; i++) {
20 var rect = rects[i]; 21 var rect = rects[i];
21 var patch = document.createElement("div"); 22 var patch = document.createElement("div");
22 patch.style.position = "absolute"; 23 patch.style.position = "absolute";
23 patch.style.backgroundColor = "#00ff00"; 24 patch.style.backgroundColor = "#00ff00";
24 patch.style.left = rect.left * invScale + "px"; 25 patch.style.left = rect.left * invScale + "px";
25 patch.style.top = rect.top * invScale + "px"; 26 patch.style.top = rect.top * invScale + "px";
26 patch.style.width = rect.width * invScale + "px"; 27 patch.style.width = rect.width * invScale + "px";
27 patch.style.height = rect.height * invScale + "px"; 28 patch.style.height = rect.height * invScale + "px";
28 29
29 overlay.appendChild(patch); 30 overlay.appendChild(patch);
30 } 31 }
31 32
32 document.body.appendChild(overlay); 33 document.body.appendChild(overlay);
33 } 34 }
34 35
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698