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

Unified Diff: third_party/WebKit/LayoutTests/hittesting/hittest-overlapping-floats.html

Issue 2386553002: Hit test floats in visual painting order (Closed)
Patch Set: Created 4 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/hittesting/hittest-overlapping-floats.html
diff --git a/third_party/WebKit/LayoutTests/hittesting/hittest-overlapping-floats.html b/third_party/WebKit/LayoutTests/hittesting/hittest-overlapping-floats.html
new file mode 100644
index 0000000000000000000000000000000000000000..7e129fc3d71a058071cdd1cd16ee848cad56d0f4
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/hittesting/hittest-overlapping-floats.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<style>
+#left {
+ float: left;
+ width: 500px;
+ background: rgba(200, 200, 200, 0.8);
+ margin-right: -100px;
+}
+#left:hover {
+ background: rgb(200, 200, 200);
+}
+#right {
+ float: right;
+ width: 400px;
+ background-color: rgba(0, 128, 0, 0.8);
+ padding-bottom: 1px;
+}
+#right:hover {
+ background: rgb(0, 128, 0);
+}
+</style>
+<div style="width: 800px;">
+ <div id="left">foo</div>
+ <div id="right">bar</div>
+ <div style="height:0px; width:0px; clear:left;"></div>
+</div>
+<div id="log"></div>
+<script>
+test(function(t)
+{
+ var rightElement = document.getElementById("right");
+ var x = rightElement.offsetLeft + 10;
+ var y = rightElement.offsetTop + rightElement.offsetHeight / 2;
+
+ var element = document.elementFromPoint(x, y);
+ assert_equals(element.nodeName, 'DIV');
+ assert_equals(element.id, 'right');
+}, "elementFromPoint should return the topmost floating element when two floats overlap");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutBlockFlow.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698