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

Side by Side 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: Use DOM offsets and subtract 5px from edges 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/scrollbars/scrollbar-visibility-hidden-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
leviw_travelin_and_unemployed 2013/11/20 19:33:26 Is this needed?
5 </head>
6 <body>
7 <!-- http://crbug.com/313908 -->
leviw_travelin_and_unemployed 2013/11/20 19:33:26 How about just putting this in the description?
8 <p>Test that the scrollbars of a visibility:hidden overflow:auto DIV do not part icipate in hit testing</p>
9
10 <div id="result">FAIL: script didn't run to completion.</div>
11
12 <div id="div1" style="position: absolute; top: 100px; width: 100px; height: 340p x; background-color: Pink; overflow: auto;">
13 <div id="div1Content" style="width: 100%; height: 500px;">
14 Div 1
15 </div>
16 </div>
17 <div id="div2" style="position: absolute; top: 120px; width: 100px; height: 300p x; background-color: Gold; overflow: auto; z-index: 1;">
18 <div id="div2Content" style="width: 200%; height: 500px;">
19 Div 2
20 </div>
21 </div>
22
23 <script>
24
25 if (window.testRunner)
26 testRunner.dumpAsText();
27
28 var div1 = document.getElementById("div1");
29 var div2 = document.getElementById("div2");
30
31 // First sanity check points that should be within div2's vertical and horiz ontal scrollbars
32 // when it's visible.
33 // Subtract 5px from the right (bottom) edge to get a point within the verti cal (horizontal) scrollbar.
34 var verticalPoint = [div2.offsetLeft + div2.offsetWidth - 5, div2.offsetTop + Math.floor(div2.offsetHeight / 2)];
35 var horizontalPoint = [div2.offsetLeft + Math.floor(div2.offsetWidth / 2), d iv2.offsetTop + div2.offsetHeight - 5];
36 var elem = document.elementFromPoint(verticalPoint[0], verticalPoint[1]);
37 var elem2 = document.elementFromPoint(horizontalPoint[0], horizontalPoint[1] );
38 if (elem.id != "div2" || elem2.id != "div2") {
39 document.getElementById("result").firstChild.data = "FAILURE: The elemen t at points (" + verticalPoint + ") and (" + horizontalPoint + ") should be div2 . You may need to turn on overflow scrollbars temporarily. (On Mac: Change the ' Show scroll bars' setting to 'Always'.)";
40 } else {
41 // Hide div2 by applying visibility:hidden and re-check.
42 document.getElementById("div2").style.visibility = "hidden";
43
44 elem = document.elementFromPoint(verticalPoint[0], verticalPoint[1]);
45 elem2 = document.elementFromPoint(horizontalPoint[0], horizontalPoint[1] );
46
47 if (elem.id != "div1") {
48 document.getElementById("result").firstChild.data = "FAILURE: The el ement at point (" + verticalPoint + ") should be div1.";
49 } else if (elem2.id != "div1Content") {
50 document.getElementById("result").firstChild.data = "FAILURE: The el ement at point (" + horizontalPoint + ") should be div1Content.";
51 } else {
52 document.getElementById("result").firstChild.data = "SUCCESS";
53 }
54 }
55
56 </script>
57 </body>
58 </html>
OLDNEW
« 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