Backed out changeset 7904b2f23010 (bug 1775118) for causing wpt failures on focus-event-after-focusing-iframes.html CLOSED TREE

This commit is contained in:
Norisz Fay 2022-06-23 00:27:25 +03:00
Родитель e6f313b7d1
Коммит f628b0aef0
13 изменённых файлов: 43 добавлений и 65 удалений

Просмотреть файл

@ -15,10 +15,6 @@ function waitForMessage(target, checkFn) {
});
}
function start(w) {
w.postMessage("start", "*");
}
// This will send message to outer frame and also inner frame to ask them
// send the log they collect back, the logs of outer and inner will be
// concatenated.
@ -39,7 +35,6 @@ function runSingleTest(url, focusIframeFunction, expectedResult, description) {
let w = window.open(url);
t.add_cleanup(() => { w.close(); });
await waitForMessage(window, e => e.data === "ready");
start(w);
focusIframeFunction(w);
assert_equals(await getLog(w), expectedResult);
}, description);

Просмотреть файл

@ -7,11 +7,7 @@ let outerlog = "outerlog:";
let iframe = document.querySelector("iframe");
window.onmessage = function(e) {
if (e.data == "start") {
window.onfocus = function() {
outerlog += "windowfocus,";
};
} else if (e.data == "iframefocus") {
if (e.data == "iframefocus") {
iframe.focus();
} else if (e.data == "iframecontentWindowfocus") {
iframe.contentWindow.focus();
@ -25,6 +21,10 @@ window.onmessage = function(e) {
};
window.onload = function() {
window.onfocus = function() {
outerlog += "windowfocus,";
};
window.onblur = function() {
outerlog += "windowblur,";
};

Просмотреть файл

@ -7,11 +7,7 @@ let outerlog = "outerlog:";
let iframe = document.querySelector("iframe");
window.onmessage = function(e) {
if (e.data == "start") {
window.onfocus = function() {
outerlog += "windowfocus,";
};
} else if (e.data == "iframefocus") {
if (e.data == "iframefocus") {
iframe.focus();
} else if (e.data == "iframecontentWindowfocus") {
iframe.contentWindow.focus();
@ -25,6 +21,10 @@ window.onmessage = function(e) {
};
window.onload = function() {
window.onfocus = function() {
outerlog += "windowfocus,";
};
window.onblur = function() {
outerlog += "windowblur,";
};

Просмотреть файл

@ -16,10 +16,6 @@ function waitForEvent(target, event, checkFn) {
});
}
function start(w) {
w.postMessage("start", "*");
}
function focusInnerInput(w) {
w.postMessage("focusinnerinput", "*");
}
@ -55,7 +51,6 @@ async function runTest(t, url) {
let w = window.open(url);
t.add_cleanup(() => { w.close(); });
await waitForEvent(window, "message", e => e.data === "ready");
start(w);
// Calling input.focus() on inner iframe should move its document.activeElement to INPUT.
focusInnerInput(w);
assert_equals(await getLog(w), 'outerlog:windowblur,middlelog:innerlog:windowfocus,INPUT,');

Просмотреть файл

@ -15,10 +15,6 @@ function waitForEvent(target, event, checkFn) {
});
}
function start(w) {
w.postMessage("start", "*");
}
function focusIframe(w) {
w.postMessage("focus", "*");
}
@ -42,7 +38,6 @@ async function runTest(t, url) {
let w = window.open(url);
t.add_cleanup(() => { w.close(); });
await waitForEvent(window, "message", e => e.data === "ready");
start(w);
focusIframe(w);
assert_equals(await getLog(w), 'outerlog:willfocusiframe,windowblur,didfocusiframe,innerlog:windowfocus,');
focusIframe(w);

Просмотреть файл

@ -15,10 +15,6 @@ function waitForEvent(target, event, checkFn) {
});
}
function start(w) {
w.postMessage("start", "*");
}
function focusIframe(w) {
w.postMessage("focus", "*");
}
@ -42,7 +38,6 @@ async function runTest(t, url, expectResult) {
let w = window.open(url);
t.add_cleanup(() => { w.close(); });
await waitForEvent(window, "message", e => e.data === "ready");
start(w);
focusIframe(w);
assert_equals(await getLog(w), expectResult);
}

Просмотреть файл

@ -7,12 +7,8 @@ let outerlog = "outerlog:";
let iframe = document.querySelector("iframe");
window.onmessage = function(e) {
if (e.data == "ready") {
if (e.data == "ready") {
opener.postMessage(e.data, "*");
} else if (e.data == "start") {
window.onfocus = function() {
outerlog += "windowfocus,";
};
} else if (e.data == "focusinnerinput" || e.data == "focusinner" || e.data == "focusmiddle" || e.data == "getlog") {
iframe.contentWindow.postMessage(e.data, "*");
} else if (e.data == "focusouter") {

Просмотреть файл

@ -7,12 +7,8 @@ let outerlog = "outerlog:";
let iframe = document.querySelector("iframe");
window.onmessage = function(e) {
if (e.data == "ready") {
if (e.data == "ready") {
opener.postMessage(e.data, "*");
} else if (e.data == "start") {
window.onfocus = function() {
outerlog += "windowfocus,";
};
} else if (e.data == "focusinnerinput" || e.data == "focusinner" || e.data == "focusmiddle" || e.data == "getlog") {
iframe.contentWindow.postMessage(e.data, "*");
} else if (e.data == "focusouter") {
@ -23,6 +19,12 @@ window.onmessage = function(e) {
}
};
window.onload = function() {
window.onfocus = function() {
outerlog += "windowfocus,";
};
};
window.onblur = function() {
outerlog += "windowblur,";
};

Просмотреть файл

@ -7,11 +7,7 @@ let outerlog = "outerlog:";
let iframe = document.querySelector("iframe");
window.onmessage = function(e) {
if (e.data == "start") {
window.onfocus = function() {
outerlog += "windowfocus,";
};
} else if (e.data == "focus") {
if (e.data == "focus") {
iframe.contentWindow.postMessage("focus", "*");
} else if (e.data == "getlog") {
iframe.contentWindow.postMessage("getlog", "*");
@ -21,6 +17,10 @@ window.onmessage = function(e) {
};
window.onload = function() {
window.onfocus = function() {
outerlog += "windowfocus,";
};
window.onblur = function() {
outerlog += "windowblur,";
};

Просмотреть файл

@ -7,11 +7,7 @@ let outerlog = "outerlog:";
let iframe = document.querySelector("iframe");
window.onmessage = function(e) {
if (e.data == "start") {
window.onfocus = function() {
outerlog += "windowfocus,";
};
} else if (e.data == "focus") {
if (e.data == "focus") {
outerlog += "willfocusiframe,";
iframe.focus();
outerlog += "didfocusiframe,";
@ -23,6 +19,10 @@ window.onmessage = function(e) {
};
window.onload = function() {
window.onfocus = function() {
outerlog += "windowfocus,";
};
window.onblur = function() {
outerlog += "windowblur,";
};

Просмотреть файл

@ -7,11 +7,7 @@ let outerlog = "outerlog:";
let iframe = document.querySelector("iframe");
window.onmessage = function(e) {
if (e.data == "start") {
window.onfocus = function() {
outerlog += "windowfocus,";
};
} else if (e.data == "focus") {
if (e.data == "focus") {
outerlog += "willfocusiframe,";
document.querySelector("iframe").focus();
outerlog += "didfocusiframe,";
@ -23,6 +19,10 @@ window.onmessage = function(e) {
};
window.onload = function() {
window.onfocus = function() {
outerlog += "windowfocus,";
};
window.onblur = function() {
outerlog += "windowblur,";
};

Просмотреть файл

@ -7,11 +7,7 @@ let outerlog = "outerlog:";
let iframe = document.querySelector("iframe");
window.onmessage = function(e) {
if (e.data == "start") {
window.onfocus = function() {
outerlog += "windowfocus,";
};
} else if (e.data == "focus") {
if (e.data == "focus") {
iframe.contentWindow.postMessage("focus", "*");
} else if (e.data == "getlog") {
iframe.contentWindow.postMessage("getlog", "*");
@ -21,6 +17,10 @@ window.onmessage = function(e) {
};
window.onload = function() {
window.onfocus = function() {
outerlog += "windowfocus,";
};
window.onblur = function() {
outerlog += "windowblur,";
};

Просмотреть файл

@ -7,11 +7,7 @@ let outerlog = "outerlog:";
let iframe = document.querySelector("iframe");
window.onmessage = function(e) {
if (e.data == "start") {
window.onfocus = function() {
outerlog += "windowfocus,";
};
} else if (e.data == "focus") {
if (e.data == "focus") {
iframe.contentWindow.postMessage("focus", "*");
} else if (e.data == "getlog") {
iframe.contentWindow.postMessage("getlog", "*");
@ -21,6 +17,10 @@ window.onmessage = function(e) {
};
window.onload = function() {
window.onfocus = function() {
outerlog += "windowfocus,";
};
window.onblur = function() {
outerlog += "windowblur,";
};