mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-08-15 08:53:07 +09:00
Issue #2721 - Simplify CheckHandleEventForAnchorsPreconditions.
The special case check is no longer necessary after our changes in this issue and #2732 where <A> no longer applies as a link inside image maps.
This commit is contained in:
parent
c3f1c0cdba
commit
3b1fe322f7
1 changed files with 4 additions and 16 deletions
|
|
@ -585,22 +585,10 @@ nsGenericHTMLElement::CheckHandleEventForAnchorsPreconditions(EventChainVisitor&
|
|||
{
|
||||
NS_PRECONDITION(nsCOMPtr<Link>(do_QueryObject(this)),
|
||||
"should be called only when |this| implements |Link|");
|
||||
|
||||
if (!aVisitor.mPresContext) {
|
||||
// When not in the composed document DOM, only <a> should navigate away per
|
||||
// the exception in https://html.spec.whatwg.org/#cannot-navigate
|
||||
// Thanks, Google, for another ugly one. :|
|
||||
return IsInComposedDoc() || IsHTMLElement(nsGkAtoms::a);
|
||||
}
|
||||
|
||||
//Need to check if we hit an imagemap area and if so see if we're handling
|
||||
//the event on that map or on a link farther up the tree. If we're on a
|
||||
//link farther up, do nothing.
|
||||
nsCOMPtr<nsIContent> target = aVisitor.mPresContext->EventStateManager()->
|
||||
GetEventTargetContent(aVisitor.mEvent);
|
||||
|
||||
return !target || !target->IsHTMLElement(nsGkAtoms::area) ||
|
||||
IsHTMLElement(nsGkAtoms::area);
|
||||
// When not in the composed document DOM, only <a> should navigate away per
|
||||
// the exception in https://html.spec.whatwg.org/#cannot-navigate
|
||||
// Thanks, Google, for another ugly one. :|
|
||||
return IsInComposedDoc() || IsHTMLElement(nsGkAtoms::a);
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue