Bug 278150
Summary: | Missed click event when innerHTML addition assignment overwrites the container child nodes | ||
---|---|---|---|
Product: | WebKit | Reporter: | Lauro Moura <lmoura> |
Component: | UI Events | Assignee: | Abrar Rahman Protyasha <a_protyasha> |
Status: | NEW | ||
Severity: | Normal | CC: | karlcow, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=118743 |
Lauro Moura
Example:
- Mouse listeners on document
- Listeners append text nodes + br to a div with `container.innerHTML += ...`
Expected result (based on tests with Chromium and Firefox, not sure if it's covered by the spec, though):
- Clicking the div content triggers mousedown+mouseup+click in sequence
Actual result (tested with multiple WPE browsers, as of 282132@main):
- Only mousedown+mouseup get emitted.
- Click emission gets stopped in EventHandler.cpp::targetNodeForClickEvent(mousePressNode, mouseReleaseNode), with mousePressNode (through m_clickNode) null, as it gets replaced in the += operation of the JS listener.
Using `container.insertAdjacentHTML("beforeend", ...)` allows the originating nodes to live and the click gets delivered.
Is this a bug on WebKit side or is it something not yet covered by the spec?
(Example incoming)
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Karl Dubost
Laura, it would be great if you could upload a test case for this.
Radar WebKit Bug Importer
<rdar://problem/134470528>