Implement safe triangle behavior for interest invokers on menuitem elements. [chromium/src : main]

0 views
Skip to first unread message

David Baron (Gerrit)

unread,
4:49 PM (7 hours ago) 4:49 PM
to David Baron, AyeAye, Dominic Farolino, David Bokan, chromium...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dbaro...@chromium.org, dgroga...@chromium.org, dtapuska+...@chromium.org
Attention needed from Joey Arhar

New activity on the change

Open in Gerrit

Related details

Attention is currently required from:
  • Joey Arhar
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I534be7d412b29ba82ac2084abe0ca01753785031
Gerrit-Change-Number: 7618663
Gerrit-PatchSet: 14
Gerrit-Owner: David Baron <dba...@chromium.org>
Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
Gerrit-CC: David Bokan <bo...@chromium.org>
Gerrit-CC: Dominic Farolino <d...@chromium.org>
Gerrit-Attention: Joey Arhar <jar...@chromium.org>
Gerrit-Comment-Date: Fri, 06 Mar 2026 21:49:38 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Joey Arhar (Gerrit)

unread,
6:18 PM (5 hours ago) 6:18 PM
to David Baron, AyeAye, Dominic Farolino, David Bokan, chromium...@chromium.org, blink-revie...@chromium.org, blink-re...@chromium.org, blink-rev...@chromium.org, blink-...@chromium.org, dbaro...@chromium.org, dgroga...@chromium.org, dtapuska+...@chromium.org
Attention needed from David Baron

Joey Arhar added 9 comments

File third_party/blink/renderer/core/dom/document.h
Line 1759, Patchset 14 (Latest): void SetMenuSafeTriangle(MenuSafeTriangle*);
void ClearMenuSafeTriangle();
Joey Arhar . unresolved

Is SetMenuSafeTriangle(nullptr) redundant with ClearMenuSafeTriangle? If so, want to remove ClearMenuSafeTriangle? If not, want to add a comment explaining the difference?

File third_party/blink/renderer/core/html/menu_safe_triangle.h
Line 63, Patchset 14 (Latest): // REVIEW: Should these be preserved as-is?
Joey Arhar . unresolved

How else would cancelable and behavior be preserved? Would we alternatively make this never cancelable?

Line 51, Patchset 14 (Latest): // REVIEW: Should these be preserved as-is?
Joey Arhar . unresolved

Does "these" refer to the InterestState? How else would it be preserved?

Line 35, Patchset 14 (Latest): void Recheck();
Joey Arhar . unresolved

A more descriptive name or a comment about when this is called and what it does would be nice

File third_party/blink/renderer/core/html/menu_safe_triangle.cc
Line 48, Patchset 14 (Latest): ContainerNode* item_parent = FlatTreeTraversal::Parent(*item);
if (IsA<HTMLFieldSetElement>(item_parent)) {
item_parent = FlatTreeTraversal::Parent(*item_parent);
}
if (!IsA<HTMLMenuListElement>(item_parent)) {
return;
}
Joey Arhar . unresolved

I thought that you'd be able to put divs and stuff in between these elements, but I didn't write the content model and I don't know what the current state of it is. Is there not a helper on the menuitem to find an ancestor menulist or menubar element?

Line 70, Patchset 14 (Latest): // Have the current safe triangle recheck its conditions so that it goes
// away if needed.
current_safe_triangle->Recheck();
Joey Arhar . unresolved

if it doesn't go away, then at the end of this method it will be replace on the document by the new one. Then what happens to the old one?

Line 86, Patchset 14 (Latest): // Maybe we shouldn't bother trying to use the last known mouse position
// when we're opening submenus via mechanisms other than mouse, and instead
// pass events through to this function (which is itself a bit of a pain).
Joey Arhar . unresolved

Yeah I was going to mention that using the current mouse position thing is kinda odd, but I figured that maybe there is no relevant event at all when you're hovering the cursor over an element for a certain amount of time, but I also don't know how interest invokers really works.

What even is the relevant event? I can see that passing it through ShowPopoverInternal could be annoying, but would it just be one new parameter for ShowPopoverInternal?

Line 100, Patchset 14 (Latest): // If the submenu is fragmented, we don't do a safe triangle.
Joey Arhar . unresolved

Is this even possible? Either way I guess returning is probably the best thing to do.

Line 272, Patchset 14 (Latest): Finish(true);
Joey Arhar . unresolved

want to put the parameter name as a comment?

Open in Gerrit

Related details

Attention is currently required from:
  • David Baron
Submit Requirements:
    • requirement satisfiedCode-Coverage
    • requirement satisfiedCode-Owners
    • requirement is not satisfiedCode-Review
    • requirement is not satisfiedNo-Unresolved-Comments
    • requirement is not satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I534be7d412b29ba82ac2084abe0ca01753785031
    Gerrit-Change-Number: 7618663
    Gerrit-PatchSet: 14
    Gerrit-Owner: David Baron <dba...@chromium.org>
    Gerrit-Reviewer: Joey Arhar <jar...@chromium.org>
    Gerrit-CC: David Bokan <bo...@chromium.org>
    Gerrit-CC: Dominic Farolino <d...@chromium.org>
    Gerrit-Attention: David Baron <dba...@chromium.org>
    Gerrit-Comment-Date: Fri, 06 Mar 2026 23:18:48 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    satisfied_requirement
    unsatisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages