Bug 197743
Summary: | document.elementsFromPoint does not return <label> parent of <input> | ||
---|---|---|---|
Product: | WebKit | Reporter: | Steven <steven> |
Component: | DOM | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED CONFIGURATION CHANGED | ||
Severity: | Normal | CC: | ahmad.saleem792, ap, bfulgham, rniwa, simon.fraser, webkit-bug-importer, zalan |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 12 | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Steven
In Safari 12 and Technology Preview, if a `<label>` element wraps an `<input>` element (`<label>Label text<input/></label>`), using `document.elementsFromPoint` with the x and y coordinates set to the `<input>` elements position does not return the parent `<label>`. If instead the `<label>` has a background color, the `<label>` then will be returned.
See https://codepen.io/straker/pen/qGbMvJ
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/50708365>
Ahmad Saleem
Output from all browsers (for broken test case because Comment 0 mentions that "background color" one works):
*** Safari 15.6 on macOS 12.5 ***
input
label#element-a
div
body
html
*** Firefox Nightly 105 ***
input
label#element-a
div
body
html
*** Chrome Canary 106 ***
input
label#element-a
div
body
html
_________-
Since all browsers are same and showing label value at same place, I am going to mark this "RESOLVED CONFIGURATION CHANGED" because it seems to be something fixed along the way.
If I am wrong, please reopen this bug with explanation or updated test case. Thanks!