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

Unified Diff: third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-iframe-body.html

Issue 1365853003: LayoutBox::scrollRectToVisible doesn't respect overflow:hidden property. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed typos Created 5 years, 3 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
Index: third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-iframe-body.html
diff --git a/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-iframe-body.html b/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-iframe-body.html
new file mode 100644
index 0000000000000000000000000000000000000000..cb7764afd1ebfc5e3e563ea5bf9289ea8023ec91
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/events/autoscroll-upwards-propagation-overflow-hidden-iframe-body.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<script type="text/javascript">
+ var maxScrollLeftiFrame;
+
+ setPrintTestResultsLazily();
+ jsTestIsAsync = true;
+ description("This test ensures that if an autoscroll starts from within a " +
+ "scrollable div in an iframe, it does not propagate to its non-scrollabe " +
+ "document body. Furthermore, it tests that if the body has only one of " +
+ "overflowX or overflowY set to hidden, the scrollable axis actually " +
+ "scrolls. Note that this test is pertaining to crbug.com/531525.");
+
+ function finishTest() {
+ eventSender.mouseUp();
+ var iframe = document.getElementById('partialScrolliFrame');
+ var iframeDoc = iframe.contentDocument;
+ // Because only overflowY:hidden is set, horizontal scroll should happen and
+ // vertical scroll shouldn't.
+ if (iframeDoc.scrollingElement.scrollTop == 0 && iframeDoc.scrollingElement.scrollLeft == maxScrollLeftiFrame) {
+ testPassed("Document didn't scroll.");
+ } else {
+ testFailed("Document scrolled although overflow:hidden.");
+ }
+ document.getElementById('partialScrolliFrame').style.display = 'none';
+ finishJSTest();
+ }
+
+ window.onload = function () {
+ var iframe = document.getElementById('partialScrolliFrame');
+ var iframeDoc = iframe.contentDocument;
+ iframeDoc.body.style.overflowY = "hidden"
+ maxScrollLeftiFrame = iframeDoc.scrollingElement.scrollWidth - iframe.contentWindow.innerWidth;
+
+ var element = iframeDoc.getElementById('select');
+ var x = iframe.offsetLeft + element.offsetLeft + 7;
+ var y = iframe.offsetTop + element.offsetTop + 7;
+ eventSender.dragMode = false;
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseMoveTo(x + 800, y);
+ eventSender.mouseMoveTo(x + 800, y + 500);
+ window.requestAnimationFrame(finishTest);
+ }
+</script>
+
+<iframe id="partialScrolliFrame" src="resources/page-with-scrollable-div.html"></iframe>
+

Powered by Google App Engine
This is Rietveld 408576698