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

Unified Diff: third_party/WebKit/LayoutTests/fast/overflow/overflow-clamp-after-transform-related-content-size-change.html

Issue 2524333003: Clamp scroll offset after overflow reclacs that are not layout inducing (Closed)
Patch Set: Created 4 years, 1 month 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 | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/overflow/overflow-clamp-after-transform-related-content-size-change.html
diff --git a/third_party/WebKit/LayoutTests/fast/overflow/overflow-clamp-after-transform-related-content-size-change.html b/third_party/WebKit/LayoutTests/fast/overflow/overflow-clamp-after-transform-related-content-size-change.html
new file mode 100644
index 0000000000000000000000000000000000000000..1c851f1054e443684c19e960fac08ed65a9975e8
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/overflow/overflow-clamp-after-transform-related-content-size-change.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<style>
+ #scroller {
+ height: 100px;
+ width: 100px;
+ overflow: scroll;
+ background-color: red;
+ }
+
+ #content {
+ width: 100px;
+ height: 100px;
+ background: green;
+ }
+</style>
+
+<div id="scroller">
+ <div id="content"></div>
+</div>
+
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<script>
+test(t => {
+ var scroller = document.querySelector("#scroller");
+ var content = document.querySelector("#content");
+
+ content.style.transform = "translateX(400px)";
+ assert_equals(scroller.scrollWidth, 500);
+
+ scroller.scrollLeft = 300;
+ assert_equals(scroller.scrollLeft, 300);
+
+ // make a non-layout inducing change that updates the overflow
+ content.style.transform = "translateX(100px)";
+ assert_equals(scroller.scrollWidth, 200);
+ assert_equals(scroller.scrollLeft, 200 - scroller.clientWidth /* max scroll offset */);
+}, "Verify that scroll offset clamps correctly when overflow rect is changed " +
+ " as a result of a transform (i.e., a non-layout inducing change)");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/paint/PaintLayerScrollableArea.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698