forked from web-platform-tests/wpt
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HTML: the condition for opening a popup by window.open, and BarProp v…
…alues for each case For whatwg/html#5872 and whatwg/html#4431
- Loading branch information
Showing
2 changed files
with
106 additions
and
0 deletions.
There are no files selected for viewing
91 changes: 91 additions & 0 deletions
91
...r-creating-and-navigating-browsing-contexts-by-name/open-features-is-popup-condition.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,91 @@ | ||
<!DOCTYPE html> | ||
<meta charset="utf-8"> | ||
<title>HTML: window.open `features`: condition for is popup</title> | ||
<meta name=timeout content=long> | ||
<link rel="help" href="https://html.spec.whatwg.org/multipage/window-object.html#window-open-steps"> | ||
|
||
<!-- user agents are not required to support open features other than `noopener` | ||
and on some platforms position and size features don't make sense --> | ||
<meta name="flags" content="may" /> | ||
|
||
<script src="/resources/testharness.js"></script> | ||
<script src="/resources/testharnessreport.js"></script> | ||
<script src="/common/PrefixedPostMessage.js"></script> | ||
<script> | ||
var windowURL = 'resources/is-popup-barprop.html'; | ||
|
||
[ | ||
[undefined, true], | ||
|
||
["locationbar", true], | ||
["locationbar=yes", true], | ||
["locationbar=no", true], | ||
|
||
["menubar", true], | ||
["menubar=yes", true], | ||
["menubar=no", true], | ||
|
||
["resizable", true], | ||
["resizable=yes", true], | ||
["resizable=no", true], | ||
|
||
["scrollbars", true], | ||
["scrollbars=yes", true], | ||
["scrollbars=no", true], | ||
|
||
["status", true], | ||
["status=yes", true], | ||
["status=no", true], | ||
|
||
["titlebar", true], | ||
["titlebar=yes", true], | ||
["titlebar=no", true], | ||
|
||
["toolbar", true], | ||
["toolbar=yes", true], | ||
["toolbar=no", true], | ||
|
||
["close", true], | ||
["close=yes", true], | ||
["close=no", true], | ||
|
||
["minimizable", true], | ||
["minimizable=yes", true], | ||
["minimizable=no", true], | ||
|
||
["personalbar", true], | ||
["personalbar=yes", true], | ||
["personalbar=no", true], | ||
|
||
["left=500", true], | ||
["screenX=500", true], | ||
|
||
["top=500", true], | ||
["screenY=500", true], | ||
|
||
["width=500", false], | ||
["innerWidth=500", false], | ||
|
||
["outerWidth=500", true], | ||
|
||
["height=500", true], | ||
["innerHeight=500", true], | ||
|
||
["outerHeight=500", true], | ||
].forEach(([features, visible]) => { | ||
async_test(t => { | ||
var prefixedMessage = new PrefixedMessageTest(); | ||
prefixedMessage.onMessage(t.step_func_done((data, e) => { | ||
e.source.close(); | ||
assert_equals(data.locationbar, visible, `window.locationbar.visible`); | ||
assert_equals(data.menubar, visible, `window.menubar.visible`); | ||
assert_equals(data.personalbar, visible, `window.personalbar.visible`); | ||
assert_equals(data.scrollbars, visible, `window.scrollbars.visible`); | ||
assert_equals(data.statusbar, visible, `window.statusbar.visible`); | ||
assert_equals(data.toolbar, visible, `window.toolbar.visible`); | ||
})); | ||
var win = window.open(prefixedMessage.url(windowURL), '', features); | ||
}, `${format_value(features)} should set BarProp visibility to ${visible}`); | ||
}); | ||
|
||
</script> |
15 changes: 15 additions & 0 deletions
15
...pis-for-creating-and-navigating-browsing-contexts-by-name/resources/is-popup-barprop.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<script src="/common/PrefixedPostMessage.js"></script> | ||
<script> | ||
var prefixedMessage = new PrefixedMessageResource(); | ||
function sendBarProps() { | ||
prefixedMessage.postToOpener({ | ||
locationbar: window.locationbar.visible, | ||
menubar: window.menubar.visible, | ||
personalbar: window.personalbar.visible, | ||
scrollbars: window.scrollbars.visible, | ||
statusbar: window.statusbar.visible, | ||
toolbar: window.toolbar.visible, | ||
}); | ||
} | ||
window.addEventListener('load', sendBarProps); | ||
</script> |