mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 877669 - nsXULPopupListener shouldn't prevent default if there are no attributes, r=neil
This commit is contained in:
parent
f3e50a82b2
commit
6d9aab9154
@ -201,10 +201,9 @@ nsXULPopupListener::HandleEvent(nsIDOMEvent* aEvent)
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open the popup and cancel the default handling of the event.
|
// Open the popup. LaunchPopup will call StopPropagation and PreventDefault
|
||||||
|
// in the right situations.
|
||||||
LaunchPopup(aEvent, targetContent);
|
LaunchPopup(aEvent, targetContent);
|
||||||
aEvent->StopPropagation();
|
|
||||||
aEvent->PreventDefault();
|
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
@ -328,21 +327,24 @@ nsXULPopupListener::LaunchPopup(nsIDOMEvent* aEvent, nsIContent* aTargetContent)
|
|||||||
{
|
{
|
||||||
nsresult rv = NS_OK;
|
nsresult rv = NS_OK;
|
||||||
|
|
||||||
nsIAtom* type = mIsContext ? nsGkAtoms::context : nsGkAtoms::popup;
|
|
||||||
|
|
||||||
nsAutoString identifier;
|
nsAutoString identifier;
|
||||||
mElement->GetAttr(kNameSpaceID_None, type, identifier);
|
nsIAtom* type = mIsContext ? nsGkAtoms::context : nsGkAtoms::popup;
|
||||||
|
bool hasPopupAttr = mElement->GetAttr(kNameSpaceID_None, type, identifier);
|
||||||
|
|
||||||
if (identifier.IsEmpty()) {
|
if (identifier.IsEmpty()) {
|
||||||
if (type == nsGkAtoms::popup) {
|
hasPopupAttr = mElement->GetAttr(kNameSpaceID_None,
|
||||||
mElement->GetAttr(kNameSpaceID_None, nsGkAtoms::menu, identifier);
|
mIsContext ? nsGkAtoms::contextmenu : nsGkAtoms::menu,
|
||||||
} else {
|
identifier) || hasPopupAttr;
|
||||||
mElement->GetAttr(kNameSpaceID_None, nsGkAtoms::contextmenu, identifier);
|
|
||||||
}
|
|
||||||
if (identifier.IsEmpty())
|
|
||||||
return rv;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (hasPopupAttr) {
|
||||||
|
aEvent->StopPropagation();
|
||||||
|
aEvent->PreventDefault();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (identifier.IsEmpty())
|
||||||
|
return rv;
|
||||||
|
|
||||||
// Try to find the popup content and the document.
|
// Try to find the popup content and the document.
|
||||||
nsCOMPtr<nsIDocument> document = mElement->GetDocument();
|
nsCOMPtr<nsIDocument> document = mElement->GetDocument();
|
||||||
if (!document) {
|
if (!document) {
|
||||||
|
Loading…
Reference in New Issue
Block a user