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

Unified Diff: LayoutTests/scrollbars/scrollbar-visibility-hidden.html

Issue 68243009: Fix RenderBlock::nodeAtPoint() for scrollbars of hidden and pointer-events:none elements (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Improve the test by also checking within div2's (hidden) horizontal scrollbar Created 7 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 | LayoutTests/scrollbars/scrollbar-visibility-hidden-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/scrollbars/scrollbar-visibility-hidden.html
diff --git a/LayoutTests/scrollbars/scrollbar-visibility-hidden.html b/LayoutTests/scrollbars/scrollbar-visibility-hidden.html
new file mode 100644
index 0000000000000000000000000000000000000000..009608554c93b2b455853e7e01618bb823673b52
--- /dev/null
+++ b/LayoutTests/scrollbars/scrollbar-visibility-hidden.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8">
+</head>
+<body>
+<!-- http://crbug.com/313908 -->
+<p>Test that the scrollbars of a visibility:hidden overflow:auto DIV do not participate in hit testing</p>
+
+<div id="result">FAIL: script didn't run to completion.</div>
+
+<div id="div1" style="position: absolute; top: 100px; left: 0; width: 100px; height: 140px; background-color: Pink; overflow: auto;">
+<div id="div1Content" style="width: 100%; height: 500px;">
+ Div 1
+</div>
+</div>
+<div id="div2" style="position: absolute; top: 120px; left: 0; width: 100px; height: 100px; background-color: Gold; overflow: auto; z-index: 1;">
+<div id="div2Content" style="width: 200%; height: 500px;">
+ Div 2
+</div>
+</div>
+
+<script>
+
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ // First sanity check that the element at points (95, 170) and (50, 215) is div2 when it's visible.
+ var elem = document.elementFromPoint(95, 120 + 50);
tony 2013/11/18 17:26:55 We normally use dom position values (offsetTop/off
+ var elem2 = document.elementFromPoint(50, 120 + 95);
+ if (elem.id != "div2" || elem2.id != "div2") {
+ document.getElementById("result").firstChild.data = "FAILURE: The element at points (95, 170) and (50, 215) should be div2.";
+ } else {
+ // Hide div2 by applying visibility:hidden.
+ document.getElementById("div2").style.visibility = "hidden";
+
+ // (95, 170) would be within div2's vertical scrollbar if div2 were still visible.
tony 2013/11/18 17:26:55 It would probably be safer to subtract 5px from th
+ elem = document.elementFromPoint(95, 120 + 50);
+ // (50, 215) would be within div2's horizontal scrollbar if div2 were still visible.
+ elem2 = document.elementFromPoint(50, 120 + 95);
+
+ if (elem.id != "div1") {
+ document.getElementById("result").firstChild.data = "FAILURE: The element at point (95, 170) should be div1.";
+ } else if (elem2.id != "div1Content") {
+ document.getElementById("result").firstChild.data = "FAILURE: The element at point (50, 215) should be div1Content.";
+ } else {
+ document.getElementById("result").firstChild.data = "SUCCESS";
+ }
+ }
+
+</script>
+</body>
+</html>
« no previous file with comments | « no previous file | LayoutTests/scrollbars/scrollbar-visibility-hidden-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698