Change behavior of window.open w.r.t. windowPreferences and popups
See [1] and [2] for more context, but this CL implements new behavior for how window.open() interprets the windowPreferences argument when deciding whether to open the window as a new tab or as a "popup", which is a separate window with minimal UI (toolbars, onmibox, etc.), and also what to return from the BarProp visible properties, e.g. window.toolbar.visible. The existing "trigger" behavior for popups will be retained by this CL, namely that a popup will be opened instead of a tab if: 1. the windowFeatures parameter is *not* empty, and 2. one of the following conditions is true: * both `location` and `toolbar` are false or missing * `menubar` is false or missing * `resizable is false or missing * `scrollbar` is false or missing * `status` is false or missing With this CL, an additional windowFeature called 'popup' is added, so that if 'popup' is present and truthy. Additionally, all BarProp properties (locationbar,menubar, personalbar,scrollbars,statusbar, and toolbar) will always return the same values, either false if a popup was opened, or true if a tab/window was opened. The spec for this behavior is part of the HTML spec: https://html.spec.whatwg.org/multipage/window-object.html#popup-window-is-requested The intent to ship is here: https://groups.google.com/a/chromium.org/g/blink-dev/c/q6ybnmxxvpE [1] https://github.com/whatwg/html/issues/5872 [2] https://github.com/whatwg/html/pull/6530 Fixed: 1192701 Change-Id: I50e745b1000d460c49085edd57d13f420b875ff3 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2950386 Reviewed-by: Joey Arhar <jarhar@chromium.org> Commit-Queue: Mason Freed <masonf@chromium.org> Cr-Commit-Position: refs/heads/main@{#943716}
This commit is contained in:

committed by
Chromium LUCI CQ

parent
14402656ab
commit
cdad240f28
content/child
third_party/blink
common
public
common
renderer
web_tests
external
wpt
html
browsers
the-window-object
apis-for-creating-and-navigating-browsing-contexts-by-name
open-features-is-popup-condition_combination-expected.txtopen-features-is-popup-condition_single-1-expected.txtopen-features-is-popup-condition_single-2-expected.txt
support
window-open-popup-behavior.htmlfast
@@ -398,6 +398,8 @@ void SetRuntimeFeaturesFromChromiumFeatures() {
|
||||
{"WebAppWindowControlsOverlay",
|
||||
features::kWebAppWindowControlsOverlay},
|
||||
{"WebAuthenticationConditionalUI", features::kWebAuthConditionalUI},
|
||||
{"WindowOpenNewPopupBehavior",
|
||||
blink::features::kWindowOpenNewPopupBehavior},
|
||||
{"SyncLoadDataUrlFonts", blink::features::kSyncLoadDataUrlFonts},
|
||||
{"CSSCascadeLayers", blink::features::kCSSCascadeLayers},
|
||||
// TODO(crbug.com/1185950): Remove this flag when the feature is fully
|
||||
|
4
third_party/blink/common/features.cc
vendored
4
third_party/blink/common/features.cc
vendored
@@ -265,6 +265,10 @@ const base::Feature kPurgeRendererMemoryWhenBackgrounded {
|
||||
#endif
|
||||
};
|
||||
|
||||
// Enables new behavior for window.open() and BarProp properties.
|
||||
const base::Feature kWindowOpenNewPopupBehavior{
|
||||
"WindowOpenNewPopupBehavior", base::FEATURE_ENABLED_BY_DEFAULT};
|
||||
|
||||
// Changes the default RTCPeerConnection constructor behavior to use Unified
|
||||
// Plan as the SDP semantics. When the feature is enabled, Unified Plan is used
|
||||
// unless the default is overridden (by passing {sdpSemantics:'plan-b'} as the
|
||||
|
1
third_party/blink/public/common/features.h
vendored
1
third_party/blink/public/common/features.h
vendored
@@ -97,6 +97,7 @@ BLINK_COMMON_EXPORT extern const base::Feature
|
||||
kPreviewsResourceLoadingHintsSpecificResourceTypes;
|
||||
BLINK_COMMON_EXPORT extern const base::Feature
|
||||
kPurgeRendererMemoryWhenBackgrounded;
|
||||
BLINK_COMMON_EXPORT extern const base::Feature kWindowOpenNewPopupBehavior;
|
||||
BLINK_COMMON_EXPORT extern const base::Feature kRTCUnifiedPlanByDefault;
|
||||
BLINK_COMMON_EXPORT extern const base::Feature
|
||||
kRTCDisallowPlanBOutsideDeprecationTrial;
|
||||
|
@@ -224,6 +224,14 @@ TEST_F(NavigationPolicyTest, NoOpener) {
|
||||
NavigationPolicy policy;
|
||||
} kCases[] = {
|
||||
{"", kNavigationPolicyNewForegroundTab},
|
||||
{"location,menubar,resizable,scrollbars,status",
|
||||
kNavigationPolicyNewForegroundTab},
|
||||
{"popup,location,menubar,resizable,scrollbars,status",
|
||||
kNavigationPolicyNewPopup},
|
||||
{"PoPuP,location,menubar,resizable,scrollbars,status",
|
||||
kNavigationPolicyNewPopup},
|
||||
{"popupFoo,location,menubar,resizable,scrollbars,status",
|
||||
kNavigationPolicyNewForegroundTab},
|
||||
{"something", kNavigationPolicyNewPopup},
|
||||
{"something, something", kNavigationPolicyNewPopup},
|
||||
{"notnoopener", kNavigationPolicyNewPopup},
|
||||
@@ -249,10 +257,13 @@ TEST_F(NavigationPolicyTest, NoOpenerAndNoReferrer) {
|
||||
{"", kNavigationPolicyNewForegroundTab},
|
||||
{"noopener, noreferrer", kNavigationPolicyNewForegroundTab},
|
||||
{"noopener, notreferrer", kNavigationPolicyNewPopup},
|
||||
{"noopener, notreferrer, popup", kNavigationPolicyNewPopup},
|
||||
{"notopener, noreferrer", kNavigationPolicyNewPopup},
|
||||
{"something, noopener, noreferrer", kNavigationPolicyNewPopup},
|
||||
{"noopener, noreferrer, something", kNavigationPolicyNewPopup},
|
||||
{"noopener, something, noreferrer", kNavigationPolicyNewPopup},
|
||||
{"notopener, noreferrer, popup", kNavigationPolicyNewPopup},
|
||||
{"notopener, noreferrer, popup=0", kNavigationPolicyNewForegroundTab},
|
||||
{"popup, noopener, noreferrer", kNavigationPolicyNewPopup},
|
||||
{"noopener, noreferrer, popup", kNavigationPolicyNewPopup},
|
||||
{"noopener, popup, noreferrer", kNavigationPolicyNewPopup},
|
||||
{"NoOpEnEr, NoReFeRrEr", kNavigationPolicyNewForegroundTab},
|
||||
};
|
||||
|
||||
@@ -270,12 +281,14 @@ TEST_F(NavigationPolicyTest, NoReferrer) {
|
||||
NavigationPolicy policy;
|
||||
} kCases[] = {
|
||||
{"", kNavigationPolicyNewForegroundTab},
|
||||
{"something", kNavigationPolicyNewPopup},
|
||||
{"something, something", kNavigationPolicyNewPopup},
|
||||
{"popup", kNavigationPolicyNewPopup},
|
||||
{"popup, something", kNavigationPolicyNewPopup},
|
||||
{"notreferrer", kNavigationPolicyNewPopup},
|
||||
{"notreferrer,popup", kNavigationPolicyNewPopup},
|
||||
{"notreferrer,popup=0", kNavigationPolicyNewForegroundTab},
|
||||
{"noreferrer", kNavigationPolicyNewForegroundTab},
|
||||
{"something, noreferrer", kNavigationPolicyNewPopup},
|
||||
{"noreferrer, something", kNavigationPolicyNewPopup},
|
||||
{"popup, noreferrer", kNavigationPolicyNewPopup},
|
||||
{"noreferrer, popup", kNavigationPolicyNewPopup},
|
||||
{"NoReFeRrEr", kNavigationPolicyNewForegroundTab},
|
||||
};
|
||||
|
||||
|
@@ -81,12 +81,8 @@ WebWindowFeatures GetWindowFeaturesFromString(const String& feature_string,
|
||||
return window_features;
|
||||
|
||||
bool ui_features_were_disabled = false;
|
||||
|
||||
// See crbug.com/1192701 for details, but we're working on changing the
|
||||
// popup-triggering conditions for window.open. This bool represents the "new"
|
||||
// state after this change.
|
||||
bool is_popup_with_new_behavior = false;
|
||||
|
||||
enum class PopupState { kUnknown, kPopup, kWindow };
|
||||
PopupState popup_state = PopupState::kUnknown;
|
||||
unsigned key_begin, key_end;
|
||||
unsigned value_begin, value_end;
|
||||
|
||||
@@ -186,8 +182,9 @@ WebWindowFeatures GetWindowFeaturesFromString(const String& feature_string,
|
||||
} else if (key_string == "width" || key_string == "innerwidth") {
|
||||
window_features.width_set = true;
|
||||
window_features.width = value;
|
||||
// Width will be the only trigger for a popup.
|
||||
is_popup_with_new_behavior = true;
|
||||
} else if (key_string == "popup") {
|
||||
// The 'popup' property explicitly triggers a popup.
|
||||
popup_state = value ? PopupState::kPopup : PopupState::kWindow;
|
||||
} else if (key_string == "height" || key_string == "innerheight") {
|
||||
window_features.height_set = true;
|
||||
window_features.height = value;
|
||||
@@ -224,17 +221,20 @@ WebWindowFeatures GetWindowFeaturesFromString(const String& feature_string,
|
||||
}
|
||||
}
|
||||
|
||||
// Existing logic from NavigationPolicy::NavigationPolicyForCreateWindow():
|
||||
if (dom_window && dom_window->document()) {
|
||||
bool is_popup_with_current_behavior = !window_features.tool_bar_visible ||
|
||||
!window_features.status_bar_visible ||
|
||||
!window_features.scrollbars_visible ||
|
||||
!window_features.menu_bar_visible ||
|
||||
!window_features.resizable;
|
||||
if (is_popup_with_current_behavior != is_popup_with_new_behavior) {
|
||||
UseCounter::Count(dom_window->document(),
|
||||
WebFeature::kWindowOpenNewPopupBehaviorMismatch);
|
||||
if (RuntimeEnabledFeatures::WindowOpenNewPopupBehaviorEnabled()) {
|
||||
bool is_popup = popup_state == PopupState::kPopup;
|
||||
if (popup_state == PopupState::kUnknown) {
|
||||
is_popup = !window_features.tool_bar_visible ||
|
||||
!window_features.menu_bar_visible ||
|
||||
!window_features.resizable ||
|
||||
!window_features.scrollbars_visible ||
|
||||
!window_features.status_bar_visible;
|
||||
}
|
||||
// If this is a popup, set all BarProps to false, and vice versa.
|
||||
window_features.tool_bar_visible = !is_popup;
|
||||
window_features.menu_bar_visible = !is_popup;
|
||||
window_features.scrollbars_visible = !is_popup;
|
||||
window_features.status_bar_visible = !is_popup;
|
||||
}
|
||||
|
||||
if (window_features.noreferrer)
|
||||
|
@@ -2689,6 +2689,11 @@
|
||||
depends_on: ["WebXRARModule"],
|
||||
status: "stable",
|
||||
},
|
||||
// New behavior for window.open's interpretation of the windowFeatures parameter.
|
||||
{
|
||||
name: "WindowOpenNewPopupBehavior",
|
||||
status: "stable",
|
||||
},
|
||||
// Extends window placement functionality for multi-screen devices. Also
|
||||
// exposes requisite information about displays connected to the device.
|
||||
{
|
||||
|
@@ -1,15 +0,0 @@
|
||||
This is a testharness.js-based test.
|
||||
PASS "location,toolbar,menubar,resizable,scrollbars,status" should set BarProp visibility to true
|
||||
PASS "location,menubar,resizable,scrollbars,status" should set BarProp visibility to true
|
||||
PASS "toolbar,menubar,resizable,scrollbars,status" should set BarProp visibility to true
|
||||
FAIL "resizable,scrollbars,status" should set BarProp visibility to false assert_equals: window.scrollbars.visible expected false but got true
|
||||
FAIL "location=no,menubar=no,resizable,scrollbars,status" should set BarProp visibility to false assert_equals: window.scrollbars.visible expected false but got true
|
||||
FAIL "location,toolbar,resizable,scrollbars,status" should set BarProp visibility to false assert_equals: window.locationbar.visible expected false but got true
|
||||
PASS "location,toolbar,menubar,scrollbars,status" should set BarProp visibility to true
|
||||
FAIL "location,toolbar,menubar,resizable=no,scrollbars,status" should set BarProp visibility to false assert_equals: window.locationbar.visible expected false but got true
|
||||
FAIL "location,toolbar,menubar,resizable,status" should set BarProp visibility to false assert_equals: window.locationbar.visible expected false but got true
|
||||
FAIL "location,toolbar,menubar,resizable,scrollbars" should set BarProp visibility to false assert_equals: window.locationbar.visible expected false but got true
|
||||
FAIL "popup=1,location,toolbar,menubar,resizable,scrollbars,status" should set BarProp visibility to false assert_equals: window.locationbar.visible expected false but got true
|
||||
FAIL "popup=0,location,toolbar,menubar,resizable,scrollbars" should set BarProp visibility to true assert_equals: window.statusbar.visible expected true but got false
|
||||
Harness: the test ran to completion.
|
||||
|
@@ -1,19 +0,0 @@
|
||||
This is a testharness.js-based test.
|
||||
PASS undefined should set BarProp visibility to true
|
||||
PASS "popup" should set BarProp visibility to false
|
||||
PASS "popup=1" should set BarProp visibility to false
|
||||
FAIL "popup=0" should set BarProp visibility to true assert_equals: window.locationbar.visible expected true but got false
|
||||
FAIL "location" should set BarProp visibility to false assert_equals: window.locationbar.visible expected false but got true
|
||||
FAIL "location=yes" should set BarProp visibility to false assert_equals: window.locationbar.visible expected false but got true
|
||||
PASS "location=no" should set BarProp visibility to false
|
||||
FAIL "toolbar" should set BarProp visibility to false assert_equals: window.locationbar.visible expected false but got true
|
||||
FAIL "toolbar=yes" should set BarProp visibility to false assert_equals: window.locationbar.visible expected false but got true
|
||||
PASS "toolbar=no" should set BarProp visibility to false
|
||||
FAIL "menubar" should set BarProp visibility to false assert_equals: window.menubar.visible expected false but got true
|
||||
FAIL "menubar=yes" should set BarProp visibility to false assert_equals: window.menubar.visible expected false but got true
|
||||
PASS "menubar=no" should set BarProp visibility to false
|
||||
PASS "resizable" should set BarProp visibility to false
|
||||
PASS "resizable=yes" should set BarProp visibility to false
|
||||
PASS "resizable=no" should set BarProp visibility to false
|
||||
Harness: the test ran to completion.
|
||||
|
@@ -1,21 +0,0 @@
|
||||
This is a testharness.js-based test.
|
||||
FAIL "scrollbars" should set BarProp visibility to false assert_equals: window.scrollbars.visible expected false but got true
|
||||
FAIL "scrollbars=yes" should set BarProp visibility to false assert_equals: window.scrollbars.visible expected false but got true
|
||||
PASS "scrollbars=no" should set BarProp visibility to false
|
||||
FAIL "status" should set BarProp visibility to false assert_equals: window.statusbar.visible expected false but got true
|
||||
FAIL "status=yes" should set BarProp visibility to false assert_equals: window.statusbar.visible expected false but got true
|
||||
PASS "status=no" should set BarProp visibility to false
|
||||
PASS "titlebar" should set BarProp visibility to false
|
||||
PASS "titlebar=yes" should set BarProp visibility to false
|
||||
PASS "titlebar=no" should set BarProp visibility to false
|
||||
PASS "close" should set BarProp visibility to false
|
||||
PASS "close=yes" should set BarProp visibility to false
|
||||
PASS "close=no" should set BarProp visibility to false
|
||||
PASS "minimizable" should set BarProp visibility to false
|
||||
PASS "minimizable=yes" should set BarProp visibility to false
|
||||
PASS "minimizable=no" should set BarProp visibility to false
|
||||
PASS "personalbar" should set BarProp visibility to false
|
||||
PASS "personalbar=yes" should set BarProp visibility to false
|
||||
PASS "personalbar=no" should set BarProp visibility to false
|
||||
Harness: the test ran to completion.
|
||||
|
24
third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/support/window-open-popup-target.html
vendored
Normal file
24
third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/support/window-open-popup-target.html
vendored
Normal file
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<script>
|
||||
var channelName = window.name;
|
||||
var channel = new BroadcastChannel(channelName);
|
||||
const allBarProps = [
|
||||
window.locationbar.visible,
|
||||
window.menubar.visible,
|
||||
window.personalbar.visible,
|
||||
window.scrollbars.visible,
|
||||
window.statusbar.visible,
|
||||
window.toolbar.visible
|
||||
];
|
||||
const allTrue = allBarProps.every(x=>x);
|
||||
const allFalse = allBarProps.every(x=>!x);
|
||||
channel.postMessage({isPopup: allFalse, mixedState: !allTrue && !allFalse});
|
||||
|
||||
// Because messages are not delivered synchronously and because closing a
|
||||
// browsing context prompts the eventual clearing of all task sources, this
|
||||
// document should not be closed until the opener document has confirmed
|
||||
// receipt.
|
||||
channel.onmessage = function() {
|
||||
window.close();
|
||||
};
|
||||
</script>
|
51
third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/window-open-popup-behavior.html
vendored
Normal file
51
third_party/blink/web_tests/external/wpt/html/browsers/the-window-object/window-open-popup-behavior.html
vendored
Normal file
@@ -0,0 +1,51 @@
|
||||
<!DOCTYPE html>
|
||||
<meta charset=utf-8>
|
||||
<meta name="timeout" content="long">
|
||||
<title>Window.open popup behavior</title>
|
||||
<link rel="author" href="masonf@chromium.org">
|
||||
<link rel="help" href="https://html.spec.whatwg.org/multipage/window-object.html#window-open-steps">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<script>
|
||||
function testOne(windowFeatures, expectPopup) {
|
||||
const windowName = Math.round(Math.random()*1e12);
|
||||
const channel = new BroadcastChannel(windowName);
|
||||
var w;
|
||||
promise_test(() => {
|
||||
return new Promise(resolve => {
|
||||
w = window.open("support/window-open-popup-target.html", windowName, windowFeatures);
|
||||
channel.addEventListener('message', resolve);
|
||||
}).then(e => {
|
||||
// Send message first so if asserts throw the popup is still closed
|
||||
channel.postMessage(null);
|
||||
assert_false(e.data.mixedState, "No mixed state");
|
||||
assert_equals(e.data.isPopup, expectPopup, "Popup state");
|
||||
});
|
||||
},`${windowFeatures} (expect ${expectPopup ? "popup" : "tab"})`);
|
||||
}
|
||||
|
||||
// No windowpreferences at all - tab.
|
||||
testOne(undefined, /*expectPopup=*/false);
|
||||
|
||||
// Test all permutations of these properties:
|
||||
const features = ["location","toolbar","menubar","resizable","scrollbars","status"];
|
||||
const nProps = features.length;
|
||||
const skip = 7; // To speed up the test, don't test all values. Skip 7 to pseudo-randomize.
|
||||
for(let i=0;i<2**nProps;i+=skip) {
|
||||
const enableVec = Number(i).toString(2).padStart(nProps,'0').split('').map(s => (s==="1"));
|
||||
let windowFeatures = [];
|
||||
for(let i=0;i<nProps;++i) {
|
||||
if (enableVec[i])
|
||||
windowFeatures.push(features[i] + "=yes");
|
||||
}
|
||||
windowFeatures = windowFeatures.join(',');
|
||||
// We get a popup we got windowFeatures, and any of them are false:
|
||||
const expectPopup = !!windowFeatures.length && (!(enableVec[0] || enableVec[1]) || !enableVec[2] || !enableVec[3] || !enableVec[4] || !enableVec[5]);
|
||||
testOne(windowFeatures, expectPopup);
|
||||
testOne(windowFeatures + ",noopener", /*expectPopup=*/false);
|
||||
testOne(windowFeatures + ",noreferrer", /*expectPopup=*/false);
|
||||
testOne(windowFeatures + ",popup", /*expectPopup=*/true); // "popup" feature = popup
|
||||
testOne(windowFeatures + ",noopener,noreferrer,popup", /*expectPopup=*/false);
|
||||
}
|
||||
</script>
|
@@ -1,119 +0,0 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>New Window Opener Test</title>
|
||||
<script src="../../../resources/js-test.js"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<script type="text/javascript">
|
||||
if (window.testRunner) {
|
||||
testRunner.dumpAsText();
|
||||
testRunner.waitUntilDone();
|
||||
testRunner.setPopupBlockingEnabled(false);
|
||||
}
|
||||
|
||||
|
||||
description(
|
||||
'This tests that the different arguments given to a new window are honored.<br/>\
|
||||
Take note that menubar is special and always on in Mac but not in Win.'
|
||||
);
|
||||
|
||||
var args = [ "scrollbars=yes,width=75,height=100"
|
||||
, "scrollbars=no,width=75,height=100"
|
||||
, "scrollbars=1,width=75,height=100"
|
||||
, "scrollbars=0,width=75,height=100"
|
||||
, "toolbar=yes,width=75,height=100"
|
||||
, "toolbar=no,width=75,height=100"
|
||||
, "toolbar=1,width=75,height=100"
|
||||
, "toolbar=0,width=75,height=100"
|
||||
, "status=yes,width=75,height=100"
|
||||
, "status=no,width=75,height=100"
|
||||
, "status=1,width=75,height=100"
|
||||
, "status=0,width=75,height=100"
|
||||
, "menubar=yes,width=75,height=100"
|
||||
, "menubar=no,width=75,height=100"
|
||||
, "menubar=1,width=75,height=100"
|
||||
, "menubar=0,width=75,height=100"
|
||||
, "location=yes,width=75,height=100"
|
||||
, "location=no,width=75,height=100"
|
||||
, "location=1,width=75,height=100"
|
||||
, "location=0,width=75,height=100"
|
||||
];
|
||||
|
||||
var actual = [ "newWin.scrollbars.visible", "newWin.scrollbars.visible", "newWin.scrollbars.visible", "newWin.scrollbars.visible"
|
||||
, "newWin.toolbar.visible", "newWin.toolbar.visible", "newWin.toolbar.visible", "newWin.toolbar.visible"
|
||||
, "newWin.statusbar.visible", "newWin.statusbar.visible", "newWin.statusbar.visible", "newWin.statusbar.visible"
|
||||
, "newWin.menubar.visible", "newWin.menubar.visible", "newWin.menubar.visible", "newWin.menubar.visible"
|
||||
, "newWin.locationbar.visible", "newWin.locationbar.visible", "newWin.locationbar.visible", "newWin.locationbar.visible"
|
||||
];
|
||||
|
||||
var expected = [ "true", "false", "true", "false"
|
||||
, "true", "false", "true", "false"
|
||||
, "true", "false", "true", "false"
|
||||
, "true", "isMenubarAlwaysExpected", "true", "isMenubarAlwaysExpected"
|
||||
, "true", "false", "true", "false"
|
||||
];
|
||||
|
||||
// Since Mac always shows the menu bar we need to special case it, but in
|
||||
// a way that does not require platform specific results.
|
||||
var isMacOSX = navigator.userAgent.indexOf("Mac OS X");
|
||||
var isMenubarAlwaysExpected;
|
||||
if (isMacOSX != -1)
|
||||
isMenubarAlwaysExpected = true;
|
||||
else
|
||||
isMenubarAlwaysExpected = false;
|
||||
|
||||
var testNum = 0;
|
||||
var lastTest = args.length;
|
||||
var newWin;
|
||||
|
||||
nextTest();
|
||||
function nextTest() {
|
||||
if (testNum == lastTest) {
|
||||
isSuccessfullyParsed();
|
||||
if (window.testRunner)
|
||||
testRunner.notifyDone();
|
||||
return;
|
||||
} else if (testNum == 0) {
|
||||
debug("");
|
||||
debug("Scrollbar");
|
||||
} else if (testNum == 4) {
|
||||
debug("");
|
||||
debug("Toolbar");
|
||||
} else if (testNum == 8) {
|
||||
debug("");
|
||||
debug("Statusbar");
|
||||
} else if (testNum == 12) {
|
||||
debug("");
|
||||
debug("Menubar");
|
||||
} else if (testNum == 16) {
|
||||
debug("");
|
||||
debug("Locationbar");
|
||||
}
|
||||
|
||||
//get the next test and run it.
|
||||
newWin = window.open("../resources/abe.png", "testWindow", args[testNum] );
|
||||
shouldBe(actual[testNum], expected[testNum]);
|
||||
++testNum;
|
||||
closeAndRunNextTest(newWin);
|
||||
}
|
||||
|
||||
function closeAndRunNextTest(winToClose) {
|
||||
winToClose.close();
|
||||
setTimeout(doneHandler, 1);
|
||||
|
||||
function doneHandler() {
|
||||
if (winToClose.closed) {
|
||||
setTimeout(nextTest, 1);
|
||||
return;
|
||||
}
|
||||
setTimeout(doneHandler, 1);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
@@ -16,7 +16,7 @@ function test()
|
||||
|
||||
function key()
|
||||
{
|
||||
window.open("about:blank", "", "status=0");
|
||||
window.open("about:blank", "", "popup");
|
||||
}
|
||||
</script>
|
||||
<body onload="test()">
|
||||
|
Reference in New Issue
Block a user