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

Unified Diff: LayoutTests/fast/overflow/hit-test-overflow-hidden-with-box-shadow.html

Issue 230943003: hitTest should check the location if it is inside borderBoxRect in case of overflow: hidden (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Review comments addressed Created 6 years, 8 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/fast/overflow/hit-test-overflow-hidden-with-box-shadow-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/overflow/hit-test-overflow-hidden-with-box-shadow.html
diff --git a/LayoutTests/fast/overflow/hit-test-overflow-hidden-with-box-shadow.html b/LayoutTests/fast/overflow/hit-test-overflow-hidden-with-box-shadow.html
new file mode 100644
index 0000000000000000000000000000000000000000..af5a7c1b57012fce8ca1a6e1ee8cc33cbf986952
--- /dev/null
+++ b/LayoutTests/fast/overflow/hit-test-overflow-hidden-with-box-shadow.html
@@ -0,0 +1,86 @@
+<!DOCTYPE html>
+<style>
+#shadow
+{
+ overflow: hidden;
+ position: absolute;
+ box-shadow: 0 0 50px #000;
+ height: 100px;
+ width: 100px;
+}
+#content
+{
+ display: block;
+ height: 200px;
+ width: 200px;
+ background: rgba(0,255,0,0.3);
+}
+</style>
+<script src="../../resources/js-test.js"></script>
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+function click(x, y)
+{
+ if (window.eventSender) {
+ eventSender.mouseMoveTo(x, y);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ }
+}
+
+function test(name, fn)
+{
+ debug("<br>" + name);
+ fn();
+}
+
+description("This test checks that div block should not get events on clicking the shadow outside div block.");
+
+function runTests()
+{
+
+ test("Focus should remain in the textarea", function() {
+ var textarea = document.getElementById("content");
+ var rect = textarea.getBoundingClientRect();
+ click(rect.left + 5, rect.top + 5);
+ shouldBeEqualToString("document.activeElement.tagName", "TEXTAREA");
+ });
+
+ // Click on the shadow at right of the div block.
+ test("Focus should move to the body", function() {
+ var shadow = document.getElementById("shadow");
+ var rect = shadow.getBoundingClientRect();
+ var x = rect.left + shadow.offsetWidth + 5;
+ var y = rect.top + 5;
+ click(x, y);
+ shouldBeEqualToString("document.activeElement.tagName", "BODY");
+ });
+
+ // Focus on the textarea to prepare for the next test.
+ test("Focus should remain in the textarea", function() {
+ var textarea = document.getElementById("content");
+ var rect = textarea.getBoundingClientRect();
+ click(rect.left + 5, rect.top + 5);
+ shouldBeEqualToString("document.activeElement.tagName", "TEXTAREA");
+ });
+
+ // Click on the shadow at bottom of the div block.
+ test("Focus should move to the body", function() {
+ var shadow = document.getElementById("shadow");
+ var rect = shadow.getBoundingClientRect();
+ var x = rect.left + 5;
+ var y = rect.top + shadow.offsetHeight + 5;
+ click(x, y);
+ shouldBeEqualToString("document.activeElement.tagName", "BODY");
+ });
+
+}
+</script>
+
+<body onload="runTests();">
+<div id="shadow">
+ <textarea id="content"></textarea>
+</div>
+</body>
« no previous file with comments | « no previous file | LayoutTests/fast/overflow/hit-test-overflow-hidden-with-box-shadow-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698