Skip to content

Commit

Permalink
Merge pull request #4498 from w3c/sync_fdb85cda3c7fa7956f2c8db518e357…
Browse files Browse the repository at this point in the history
…3a7795a381

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.
  • Loading branch information
jgraham committed Jan 3, 2017
2 parents 14e5f5f + fdb85cd commit 7071a3d
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion cssom-view/elementFromPoint.html
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,9 @@
<div id="fieldset-div"
class="size" style="position: absolute; top: 0; left: 0">
</div>
<fieldset class="size" style="position: absolute; top: 100px; left: 100px">
<fieldset id="fieldset"
class="size"
style="position: absolute; top: 100px; left: 100px; border-radius: 100px">
<!-- Place the child span so the overflow area of the fieldset overlaps
the div -->
<span style="position: absolute; top: -100px; left: -100px; height: 1px; width: 1px"></span>
Expand Down Expand Up @@ -189,6 +191,14 @@
divRect.top + divRect.height/2),
fieldsetDiv,
"The fieldset should not cover up the div it doesn't even overlap");

var fieldset = document.getElementById("fieldset");
var rect = fieldset.getBoundingClientRect();
// A point 5px in from topleft will be outside the rounded border.
assert_not_equals(document.elementFromPoint(rect.left + 5,
rect.top + 5),
fieldset,
"The fieldset should not be hit by hit-tests outside its rounded border");
}, "Fieldsets");
done();
}
Expand Down

0 comments on commit 7071a3d

Please sign in to comment.