Bug 197743

Summary: document.elementsFromPoint does not return <label> parent of <input>
Product: WebKit Reporter: Steven <steven>
Component: DOMAssignee: 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   

Description Steven 2019-05-09 11:04:31 PDT
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
Comment 1 Radar WebKit Bug Importer 2019-05-12 15:01:08 PDT
<rdar://problem/50708365>
Comment 2 Ahmad Saleem 2022-08-11 14:42:52 PDT
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!