Skip to content

Commit

Permalink
Bug 1841505: postpone setting the popover invoker in the "show popove…
Browse files Browse the repository at this point in the history
…r" algo. r=emilio

See
<whatwg/html#9383 (comment)>.

Differential Revision: https://phabricator.services.mozilla.com/D182709

UltraBlame original commit: 0b5333b2ef93c5e4153ac198b577c6f54c5ad538
  • Loading branch information
marco-c committed Jul 16, 2023
1 parent cd82cd4 commit c7ff749
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 47 deletions.
24 changes: 5 additions & 19 deletions dom/base/Element.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22514,6 +22514,10 @@ Element
:
GetTopmostPopoverAncestor
(
const
Element
*
aInvoker
)
const
{
Expand Down Expand Up @@ -22682,27 +22686,9 @@ GetFlattenedTreeParentElement
)
)
;
RefPtr
<
Element
>
invoker
=
newPopover
-
>
GetPopoverData
(
)
-
>
GetInvoker
(
)
;
checkAncestor
(
invoker
aInvoker
)
;
return
Expand Down
10 changes: 4 additions & 6 deletions dom/base/Element.h
Original file line number Diff line number Diff line change
Expand Up @@ -1805,16 +1805,14 @@ IsPopoverOpen
)
const
;
mozilla
:
:
dom
:
:
Element
*
GetTopmostPopoverAncestor
(
const
Element
*
aInvoker
)
const
;
Expand Down
58 changes: 37 additions & 21 deletions dom/html/nsGenericHTMLElement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17183,7 +17183,7 @@ nsGenericHTMLElement
:
ShowPopoverInternal
(
nsGenericHTMLFormControlElementWithState
Element
*
aInvoker
ErrorResult
Expand All @@ -17193,26 +17193,6 @@ aRv
{
if
(
PopoverData
*
data
=
GetPopoverData
(
)
)
{
data
-
>
SetInvoker
(
aInvoker
)
;
}
if
(
!
CheckPopoverValidity
(
Expand Down Expand Up @@ -17241,6 +17221,25 @@ OwnerDoc
MOZ_ASSERT
(
!
GetPopoverData
(
)
|
|
!
GetPopoverData
(
)
-
>
GetInvoker
(
)
)
;
MOZ_ASSERT
(
!
OwnerDoc
(
)
Expand Down Expand Up @@ -17379,6 +17378,7 @@ ancestor
=
GetTopmostPopoverAncestor
(
aInvoker
)
;
if
Expand Down Expand Up @@ -17516,9 +17516,16 @@ true
true
)
;
{
auto
*
popoverData
=
GetPopoverData
(
)
;
popoverData
-
>
SetPopoverVisibilityState
Expand All @@ -17529,6 +17536,15 @@ PopoverVisibilityState
Showing
)
;
popoverData
-
>
SetInvoker
(
aInvoker
)
;
}
FocusPopover
(
)
Expand Down
2 changes: 1 addition & 1 deletion dom/html/nsGenericHTMLElement.h
Original file line number Diff line number Diff line change
Expand Up @@ -1070,7 +1070,7 @@ MOZ_CAN_RUN_SCRIPT
void
ShowPopoverInternal
(
nsGenericHTMLFormControlElementWithState
Element
*
aInvoker
ErrorResult
Expand Down

0 comments on commit c7ff749

Please sign in to comment.