Skip to content

Commit fdb85cd

Browse files
bzbarskyjgraham
authored andcommitted
Inherit a fieldset's border-radius down into its content wrapper box, so it doesn't leak out and mess up hit-testing in the corner areas when it has rounded borders.
Upstreamed from https://bugzilla.mozilla.org/show_bug.cgi?id=1326163
1 parent fcc4056 commit fdb85cd

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

cssom-view/elementFromPoint.html

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@
5959
<div id="fieldset-div"
6060
class="size" style="position: absolute; top: 0; left: 0">
6161
</div>
62-
<fieldset class="size" style="position: absolute; top: 100px; left: 100px">
62+
<fieldset id="fieldset"
63+
class="size"
64+
style="position: absolute; top: 100px; left: 100px; border-radius: 100px">
6365
<!-- Place the child span so the overflow area of the fieldset overlaps
6466
the div -->
6567
<span style="position: absolute; top: -100px; left: -100px; height: 1px; width: 1px"></span>
@@ -189,6 +191,14 @@
189191
divRect.top + divRect.height/2),
190192
fieldsetDiv,
191193
"The fieldset should not cover up the div it doesn't even overlap");
194+
195+
var fieldset = document.getElementById("fieldset");
196+
var rect = fieldset.getBoundingClientRect();
197+
// A point 5px in from topleft will be outside the rounded border.
198+
assert_not_equals(document.elementFromPoint(rect.left + 5,
199+
rect.top + 5),
200+
fieldset,
201+
"The fieldset should not be hit by hit-tests outside its rounded border");
192202
}, "Fieldsets");
193203
done();
194204
}

0 commit comments

Comments
 (0)