diff --git a/dom/html/nsGenericHTMLElement.cpp b/dom/html/nsGenericHTMLElement.cpp
index 536701e076..e811f6b462 100644
--- a/dom/html/nsGenericHTMLElement.cpp
+++ b/dom/html/nsGenericHTMLElement.cpp
@@ -585,22 +585,10 @@ nsGenericHTMLElement::CheckHandleEventForAnchorsPreconditions(EventChainVisitor&
{
NS_PRECONDITION(nsCOMPtr(do_QueryObject(this)),
"should be called only when |this| implements |Link|");
-
- if (!aVisitor.mPresContext) {
- // When not in the composed document DOM, only 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 target = aVisitor.mPresContext->EventStateManager()->
- GetEventTargetContent(aVisitor.mEvent);
-
- return !target || !target->IsHTMLElement(nsGkAtoms::area) ||
- IsHTMLElement(nsGkAtoms::area);
+ // When not in the composed document DOM, only 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