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

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: Remove internals.setPageScaleFactor, rename eventSender.scalePageBy. Created 7 years, 5 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.setInitialPageScaleOverride(-1);
7 eventSender.setPageScaleFactor(scale, 0, 0);
8 }
6 // FIXME: This is a hack for applyPageScaleFactorInCompositor() == false . 9 // FIXME: This is a hack for applyPageScaleFactorInCompositor() == false .
7 invScale = 1 / scale; 10 invScale = 1 / scale;
8 } else { 11 } else {
9 invScale = 1; 12 invScale = 1;
10 } 13 }
11 14
12 var overlay = document.createElement("div"); 15 var overlay = document.createElement("div");
13 overlay.style.position = "absolute"; 16 overlay.style.position = "absolute";
14 overlay.style.left = 0; 17 overlay.style.left = 0;
15 overlay.style.top = 0; 18 overlay.style.top = 0;
16 overlay.style.opacity = 0.5; 19 overlay.style.opacity = 0.5;
17 20
18 var rects = window.internals.nonFastScrollableRects(document); 21 var rects = window.internals.nonFastScrollableRects(document);
19 for (var i = 0; i < rects.length; i++) { 22 for (var i = 0; i < rects.length; i++) {
20 var rect = rects[i]; 23 var rect = rects[i];
21 var patch = document.createElement("div"); 24 var patch = document.createElement("div");
22 patch.style.position = "absolute"; 25 patch.style.position = "absolute";
23 patch.style.backgroundColor = "#00ff00"; 26 patch.style.backgroundColor = "#00ff00";
24 patch.style.left = rect.left * invScale + "px"; 27 patch.style.left = rect.left * invScale + "px";
25 patch.style.top = rect.top * invScale + "px"; 28 patch.style.top = rect.top * invScale + "px";
26 patch.style.width = rect.width * invScale + "px"; 29 patch.style.width = rect.width * invScale + "px";
27 patch.style.height = rect.height * invScale + "px"; 30 patch.style.height = rect.height * invScale + "px";
28 31
29 overlay.appendChild(patch); 32 overlay.appendChild(patch);
30 } 33 }
31 34
32 document.body.appendChild(overlay); 35 document.body.appendChild(overlay);
33 } 36 }
34 37
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698