зеркало из https://github.com/mozilla/gecko-dev.git
Bug 853456 - Walk up DOM tree to find target of links. r=mfinkle
This commit is contained in:
Родитель
11073b0e0a
Коммит
fcf2264c5f
|
@ -133,8 +133,12 @@ let WebAppRT = {
|
|||
handleEvent: function(event) {
|
||||
let target = event.target;
|
||||
|
||||
if (!(target instanceof HTMLAnchorElement) ||
|
||||
target.getAttribute("target") != "_blank") {
|
||||
// walk up the tree to find the nearest link tag
|
||||
while(target && !(target instanceof HTMLAnchorElement)) {
|
||||
target = target.parentNode;
|
||||
}
|
||||
|
||||
if (!target || target.getAttribute("target") != "_blank") {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче