Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes click on inline element embedded in anchor inside <summary> bre…
…aks 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 <tkent@chromium.org> Reviewed-by: Mason Freed <masonfreed@chromium.org> Commit-Queue: Yu Han <yuzhehan@chromium.org> Cr-Commit-Position: refs/heads/master@{#718552}
- Loading branch information