fune/dom/base/test/file_focus_design_mode_inner.html
Edgar Chen 0916876268 Bug 1690747 - Should also check blur is allowed in BrowsingContext::Blur(); r=hsivonen
When binding delegates blur() to BrowsingContext::Blur, the remote side skips
the check given that there is no js on the stack, but we should not skip the
check. This only affects design-mode which allows the focus moving to the root
element.

Differential Revision: https://phabricator.services.mozilla.com/D104008
2021-02-09 14:56:56 +00:00

32 lines
614 B
HTML

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>activeElement design-mode inner document</title>
</head>
<body>
<h1>Inner</h1>
<script>
let innerlog = "innerlog:";
document.designmode = "on";
window.onmessage = function(e) {
if (e.data == "focus") {
document.documentElement.focus();
} else if (e.data == "getlog") {
innerlog += "activeElement:" + document.activeElement.tagName + ",";
parent.postMessage(innerlog, "*");
}
};
window.onfocus = function() {
innerlog += "windowfocus,";
};
window.onblur = function() {
innerlog += "windowblur,";
};
</script>
</body>
</html>