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

Unified Diff: LayoutTests/fast/scrolling/scroll-to-origin-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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/scrolling/scroll-to-origin-no-layout-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/scrolling/scroll-to-origin-no-layout.html
diff --git a/LayoutTests/fast/scrolling/scroll-to-origin-no-layout.html b/LayoutTests/fast/scrolling/scroll-to-origin-no-layout.html
new file mode 100644
index 0000000000000000000000000000000000000000..48d701e1aa832b6f6af915e5bdb55ca70f523ce4
--- /dev/null
+++ b/LayoutTests/fast/scrolling/scroll-to-origin-no-layout.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<div id="spanner"></div>
+<script>
+spanner.style.height = "3000px";
+scrollTo(0, 1000);
+
+if (window.internals) {
+ var styleCount = internals.updateStyleAndReturnAffectedElementCount();
+ var layoutCount = internals.needsLayoutCount();
+ // scrollTo should have synchronously updated style and layout
+ shouldBe("styleCount", "0");
+ shouldBe("layoutCount", "0");
+}
+shouldBe("window.scrollY", "1000");
+
+spanner.style.height = "2000px";
+scrollTo(0, 0);
+
+if (window.internals) {
+ var styleCount = internals.updateStyleAndReturnAffectedElementCount();
+ var layoutCount = internals.needsLayoutCount();
+ // scrollTo should not need to synchronously updated style and layout
+ shouldNotBe("styleCount", "0");
+ shouldNotBe("layoutCount", "0");
+}
+shouldBe("window.scrollY", "0");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/scrolling/scroll-to-origin-no-layout-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698