Files
firefox/testing/web-platform/tests/html/semantics/interactive-elements
yu han 4ac297d8a9 Bug 1598476 [wpt PR 20376] - Fixes click on inline element embedded in anchor inside <summary> breaks anchor., a=testonly
Automatic update from web-platform-tests
Fixes click on inline element embedded in anchor inside <summary> breaks anchor.

Previous to this CL, clicking on an inline element embedded in an anchor placed
inside a <summary> tag will expand the <details> section instead of navigating to
the anchor's href. However, when the anchor is placed outside of <summary>,
it behaves correctly.

The error is caused by DOMActivate event generated by the inline element. As
DOMActivate bubbles up, it bypasses the anchor's event handler, reaches the
<summary>, and is handled there. Once DOMActivate is handled, the original
click event stops propagating and terminates. This behavior, however, differs
from when the anchor tag is placed outside of the summary. DOMActivate isn't
handled, and the original click event keeps bubbling up till it's handled by
the anchor.

DOMActivate event is deprecated:
https://developer.mozilla.org/en-US/docs/Web/API/Element/DOMActivate_event.
However, since blink still has code that depends on it, replacing it is outside
of the scope for this fix. Instead, this fix is for the anchor element to
handle the DOMActivate event as it bubbles up. The anchor event handler checks
the underlying event of DOMActivate and handles it if it's a click.

I also looked at an alternative fix by trying to prevent the DOMActivate event
from bubbling up. But calling event.stopPropagation() doesn't work as the
EventDispatcher::DispatchEventPostProcess doesn't check this status.

Bug: 538283
Change-Id: I11fb072faa0563279d43a28e5dc19cee89906bf0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1928234
Reviewed-by: Kent Tamura <[email protected]>
Reviewed-by: Mason Freed <[email protected]>
Commit-Queue: Yu Han <[email protected]>
Cr-Commit-Position: refs/heads/master@{#718552}

--

wpt-commits: fa8e9c41c5581439f93897e7c2fe674f803bfa21
wpt-pr: 20376
2019-11-29 10:57:50 +00:00
..
…