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

Unified Diff: LayoutTests/scrollingcoordinator/non-fast-scrollable-animation.html

Issue 1256043007: Recompute slow scroll regions after overflow recalc (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address feedback Created 5 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/scrollingcoordinator/non-fast-scrollable-animation-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/scrollingcoordinator/non-fast-scrollable-animation.html
diff --git a/LayoutTests/scrollingcoordinator/non-fast-scrollable-animation.html b/LayoutTests/scrollingcoordinator/non-fast-scrollable-animation.html
new file mode 100644
index 0000000000000000000000000000000000000000..45e4ec7387dbfa99ae0a97809e21c6677d43bb26
--- /dev/null
+++ b/LayoutTests/scrollingcoordinator/non-fast-scrollable-animation.html
@@ -0,0 +1,73 @@
+<!DOCTYPE html>
+<style>
+ body {
+ margin: 0;
+ }
+
+ .container {
+ height: 250px;
+ width: 250px;
+ display: block;
+ }
+
+ #nonFastRegion {
+ height: 222px;
+ width: 222px;
+ display: block;
+ border: none;
+ }
+
+ #nonFastRegion.animate {
+ transform: translateX(100px) translateY(100px);
+ transition: transform 5ms;
+ }
+</style>
+
+<div class="container">
+ <iframe id='nonFastRegion' onload='runAfterLayoutAndPaint(window.runTests)'
+ srcdoc="<div style='height:1000px; width:1000px; background: linear-gradient(to bottom, red, white);'>This should be covered.</div>">
+ </iframe>
+</div>
+
+<p>A single square should be visible covered by a green overlay.</p>
+<div id="console"></div>
+
+<script src="../resources/js-test.js"></script>
+<script src="../resources/run-after-layout-and-paint.js"></script>
+<script src="resources/non-fast-scrollable-region-testing.js"></script>
+<script>
+ jsTestIsAsync = true;
+ // print result lazily to avoid layouts during the test
+ setPrintTestResultsLazily();
+ description('This test ensures that animating a non-fast scrollable area ' +
+ 'correctly updates list of non-fast scrollable rects ' +
+ '(See http://crbug.com/417345).');
+
+ runTests = function() {
+ nonFastScrollableRects = internals.nonFastScrollableRects(document);
+ shouldBe('nonFastScrollableRects.length', '1');
+ shouldBeEqualToString('rectToString(nonFastScrollableRects[0])', '[0, 0, 222, 222]');
+
+ // animating transforms hits an optimized layout path which is root cause of
+ // http://crbug.com/417345
+ var nonFast = document.getElementById('nonFastRegion');
+ nonFast.classList.add('animate');
+ shouldBe('internals.needsLayoutCount()', '0');
+
+ nonFast.addEventListener("transitionend", function() {
+ shouldBe('internals.needsLayoutCount()', '0');
Rick Byers 2015/08/06 03:19:47 I don't think this verifies that no layout occurre
+ runAfterLayoutAndPaint(function() {
+ shouldBe('internals.needsLayoutCount()', '0');
+ nonFastScrollableRects = internals.nonFastScrollableRects(document);
+ shouldBe('nonFastScrollableRects.length', '1');
+ shouldBeEqualToString('rectToString(nonFastScrollableRects[0])', '[100, 100, 222, 222]');
+
+ runAfterLayoutAndPaint(function() {
+ // Add green overlays to help visualize the test
+ drawNonFastScrollableRegionOverlays();
+ finishJSTest();
+ });
+ });
+ }, false);
+ }
+</script>
« no previous file with comments | « no previous file | LayoutTests/scrollingcoordinator/non-fast-scrollable-animation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698