зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1218456 - Simplify CheckHandleEventForAnchorsPreconditions. r=smaug
I've checked that this doesn't change behavior in the test-case for bug 30178, which is just an imagemap inside a link. Overall it'd be weird if we needed this for area-inside-a but not for stuff like nested links. Differential Revision: https://phabricator.services.mozilla.com/D37407 --HG-- extra : moz-landing-system : lando
This commit is contained in:
Родитель
23a7cb7a68
Коммит
16bfd6e375
|
@ -523,21 +523,9 @@ bool nsGenericHTMLElement::CheckHandleEventForAnchorsPreconditions(
|
|||
EventChainVisitor& aVisitor) {
|
||||
MOZ_ASSERT(nsCOMPtr<Link>(do_QueryObject(this)),
|
||||
"should be called only when |this| implements |Link|");
|
||||
if (!aVisitor.mPresContext) {
|
||||
// When disconnected, only <a> should navigate away per
|
||||
// https://html.spec.whatwg.org/#cannot-navigate
|
||||
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 disconnected, only <a> should navigate away per
|
||||
// https://html.spec.whatwg.org/#cannot-navigate
|
||||
return IsInComposedDoc() || IsHTMLElement(nsGkAtoms::a);
|
||||
}
|
||||
|
||||
void nsGenericHTMLElement::GetEventTargetParentForAnchors(
|
||||
|
|
Загрузка…
Ссылка в новой задаче