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

Side by Side Diff: LayoutTests/fast/scrolling/scroll-to-origin-with-options-no-layout.html

Issue 1071983002: Don't force layout for scrollTo(0,0). (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Added comments Created 5 years, 8 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
(Empty)
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <div id="spanner"></div>
4 <script>
5 var styleCount, layoutCount;
6
7 function assertSyncLayout(sync) {
8 if (window.internals) {
9 styleCount = internals.updateStyleAndReturnAffectedElementCount();
10 layoutCount = internals.needsLayoutCount();
11 // scrollTo should have synchronously updated style and layout
12 if (sync) {
13 shouldBe("styleCount", "0");
14 shouldBe("layoutCount", "0");
15 } else {
16 shouldNotBe("styleCount", "0");
17 shouldNotBe("layoutCount", "0");
18 }
19 }
20 }
21
22 spanner.style.width = "3000px";
23 spanner.style.height = "3000px";
24 scrollTo({ left: 0, top: 1000});
25 assertSyncLayout(true);
26 shouldBe("window.scrollY", "1000");
27
28 scrollTo({ left: 1000, top: 1000});
29 assertSyncLayout(true);
30 shouldBe("window.scrollX", "1000");
31
32 spanner.style.height = "2000px";
33 scrollTo({ left: 0, top: 0});
34 assertSyncLayout(false);
35 shouldBe("window.scrollY", "0");
36
37 spanner.style.height = "1px";
38 scrollTo({ left: 0 });
39 assertSyncLayout(true);
40
41 spanner.style.height = "2px";
42 scrollTo({ top: 0 });
43 assertSyncLayout(true);
44
45 spanner.style.height = "3px";
46 scrollTo({ });
47 assertSyncLayout(true);
48 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698