mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1129066 - Ensure the click event is always dispatched to an element node. r=smaug
This commit is contained in:
parent
43c6f6331a
commit
164ea2c10c
@ -4434,6 +4434,14 @@ EventStateManager::CheckForAndDispatchClick(nsPresContext* aPresContext,
|
||||
nsCOMPtr<nsIPresShell> presShell = mPresContext->GetPresShell();
|
||||
if (presShell) {
|
||||
nsCOMPtr<nsIContent> mouseContent = GetEventTargetContent(aEvent);
|
||||
// Click events apply to *elements* not nodes. At this point the target
|
||||
// content may have been reset to some non-element content, and so we need
|
||||
// to walk up the closest ancestor element, just like we do in
|
||||
// nsPresShell::HandlePositionedEvent.
|
||||
while (mouseContent && !mouseContent->IsElement()) {
|
||||
mouseContent = mouseContent->GetParent();
|
||||
}
|
||||
|
||||
if (!mouseContent && !mCurrentTarget) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user