| Commit-Queue | +1 |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
? DynamicTo<HTMLElement>(menu_item_element->commandForElement())I think it is safer to use `DynamicTo<HTMLMenuListElement>(menu_item_element->commandForElement())`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
? DynamicTo<HTMLElement>(menu_item_element->commandForElement())I think it is safer to use `DynamicTo<HTMLMenuListElement>(menu_item_element->commandForElement())`.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Looks good, other than the target-is-menulist restriction question.
const HTMLMenuItemElement* menu_item_element =nit: `auto*` is easier to read here
const HTMLMenuItemElement* menu_item_element =nit: maybe just `menu_item`?
menu_item_element ? DynamicTo<HTMLMenuListElement>(I think it should likely be "legal" to do this:
```
<menuitem command=show-popover commandfor=foo></menuitem>
<div popover id=foo></div>
```
I.e. not sure why the target has to be a menulist?
If you agree with my comment above, it'd be good to add a test that shows you can do `command=show-popover` from a `<menuitem>`.
I also think, and I've mentioned this to Di (so double-check she hasn't already done it), that it'd be good to make a test where the entire `<menulist>` resides in an open popover. Menus should work just fine within a popover, and e.g. the outer popover shouldn't be inadvertently closed at any point.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
menu_item_element ? DynamicTo<HTMLMenuListElement>(I think it should likely be "legal" to do this:
```
<menuitem command=show-popover commandfor=foo></menuitem>
<div popover id=foo></div>
```I.e. not sure why the target has to be a menulist?
I suggested this restriction. I thought about it more and agree with Mason, menuitem should support all valid commands.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
nit: `auto*` is easier to read here
I suppose. I just hate `auto`! Done, though.
nit: maybe just `menu_item`?
Done
Di ZhangI think it should likely be "legal" to do this:
```
<menuitem command=show-popover commandfor=foo></menuitem>
<div popover id=foo></div>
```I.e. not sure why the target has to be a menulist?
I suggested this restriction. I thought about it more and agree with Mason, menuitem should support all valid commands.
Yeah this seems like a good idea. In my head I wasn't considering the other commands. I'll loosen this and add a test.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +1 |
If you agree with my comment above, it'd be good to add a test that shows you can do `command=show-popover` from a `<menuitem>`.
I also think, and I've mentioned this to Di (so double-check she hasn't already done it), that it'd be good to make a test where the entire `<menulist>` resides in an open popover. Menus should work just fine within a popover, and e.g. the outer popover shouldn't be inadvertently closed at any point.
I'll add a TODO on my list to add this kind of test after this CL, if that'a alright with you.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
const HTMLMenuItemElement* menu_item_element =Dominic Farolinonit: `auto*` is easier to read here
I suppose. I just hate `auto`! Done, though.
Why do you hate `auto`, out of curiosity? It can cause readability problems in some cases, but I don't think that's true when the line is something like:
`auto* foo = DynamicTo<SomeReallyGiantTypeNameThatWouldAppearTwice>(bar);`
Dominic FarolinoIf you agree with my comment above, it'd be good to add a test that shows you can do `command=show-popover` from a `<menuitem>`.
I also think, and I've mentioned this to Di (so double-check she hasn't already done it), that it'd be good to make a test where the entire `<menulist>` resides in an open popover. Menus should work just fine within a popover, and e.g. the outer popover shouldn't be inadvertently closed at any point.
I'll add a TODO on my list to add this kind of test after this CL, if that'a alright with you.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Commit-Queue | +2 |
const HTMLMenuItemElement* menu_item_element =Dominic Farolinonit: `auto*` is easier to read here
Mason FreedI suppose. I just hate `auto`! Done, though.
Why do you hate `auto`, out of curiosity? It can cause readability problems in some cases, but I don't think that's true when the line is something like:
`auto* foo = DynamicTo<SomeReallyGiantTypeNameThatWouldAppearTwice>(bar);`
Yeah in that example it makes sense. I hate it in the cases where it causes readability problems, and I just remain consistent with that at all times, even at the expense of verbosity. But I think my policy just doesn't make sense heh.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
[menu]: Fix toggle-menu command with light dismiss
`NearestTargetPopoverForInvoker()` finds the nearest target popover for
a given popover invoker that is a form control or button element.
Before this CL, this algorithm didn't consider HTMLMenuItemElements as
possible popover invokers, meaning it never returned relevant opened
HTMLMenuListElement popovers.
This CL updates this algorithm to consider HTMLMenuItemElement as a
popover invoker, and return its associated target menulist as a
popover. This corrects `FindTopmostRelatedPopover()`, which makes light
dismiss for clicks aimed at <menuitem>s work the same as <button>s.
Concretely, this ensures we do not double-activate a menuitem when we
click it and its popover is open. This fixes the behavior of the
`toggle-menu` command, ensuring it works the same as `toggle-popover`
on buttons/traditional popovers.
R=masonf
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
The WPT PR for this CL has been merged upstream! https://github.com/web-platform-tests/wpt/pull/53352
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |