Thanks to visit codestin.com
Credit goes to phabricator.services.mozilla.com

Page MenuHomePhabricator

Bug 1599415 trigger `focus` when details summary element is clicked r?TYLin
ClosedPublic

Authored by keithamus on Apr 27 2020, 9:08 AM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Feb 5, 9:50 PM
Unknown Object (File)
Jan 26 2026, 12:13 PM
Unknown Object (File)
Jan 26 2026, 12:34 AM
Unknown Object (File)
Dec 12 2025, 12:31 AM
Unknown Object (File)
Dec 11 2025, 11:38 PM
Unknown Object (File)
Dec 11 2025, 9:50 PM
Unknown Object (File)
Dec 11 2025, 9:49 PM
Unknown Object (File)
Dec 11 2025, 9:33 PM
Subscribers

Diff Detail

Event Timeline

phab-bot changed the visibility from "Custom Policy" to "Public (No Login Required)".
phab-bot changed the edit policy from "Custom Policy" to "Restricted Project (Project)".
phab-bot removed a project: secure-revision.
keithamus retitled this revision from Bug 1599415 trigger `focus` when details summary element is clicked to Bug 1599415 trigger `focus` when details summary element is clicked r?TYLin.
keithamus edited the summary of this revision. (Show Details)
keithamus added a reviewer: TYLin.

/cc @muan for co-authoring this with me!

Thanks for the patch! Does Safari pass this test? The mouse-focuses-form-control behavior is trying to match Mac platform behavior.

Thanks for the patch! Does Safari pass this test? The mouse-focuses-form-control behavior is trying to match Mac platform behavior.

Ah, from the bug it seems Safari does trigger focus for click on summary. So this looks fine to me though I'll let @TYLin confirm.

Thanks again!

TYLin added a reviewer: smaug.

I tested clicking <summary> on Safari 13.0.5 and Chrome 81 on macOS, both are focusable. So I'm OK to align <summary>'s focus behavior with other browsers on macOS.

Although I'm the original author of the modified code, but I'm not an expert in event handling. I'll defer the final judgment to one of the peer in the module, in case I missed something.

dom/html/HTMLSummaryElement.cpp
109

Please remove "on other platforms" since the main summary element is now focusable across all the platforms.

testing/web-platform/tests/html/semantics/interactive-elements/the-summary-element/click-behavior-optional.html
22–24 ↗(On Diff #267452)

Since Firefox's behavior is going to match other browsers in this patch, I would suggest changing the sentence after "but" to something like "but setting focus on a clicked summary tag is the current behavior on Windows and macOS for Chrome, Safari, and Firefox".

This revision is now accepted and ready to land.Apr 28 2020, 4:21 PM
testing/web-platform/tests/html/semantics/interactive-elements/the-summary-element/click-behavior-optional.html
1 ↗(On Diff #267452)

The name of the file should probably contain tentative in it, to hint the spec might not be super clear on this.

Hi keithamus,

If this patch is ready, you can use "Add Action" -> "Change Project Tag" to add "Check-in Needed" to let sheriff team to land this patch for you.

Thanks for the assistance @TYLin! Very new to this workflow 😛

I removed the parent revision D72602, which doesn't seem to be relevant to this patch.