From 90803a54361b106d7215c0d079fce8c31e0ff3f6 Mon Sep 17 00:00:00 2001 From: Mason Freed Date: Thu, 3 Mar 2022 13:26:59 -0800 Subject: [PATCH] Add "true" to truthy values list for windowFeatures Prior to this CL, window.open(url, '', 'noopener=true') would treat 'noopener=true' as if noopener is false. This is currently per-spec [1] but there is a desire [2][3] to change that. [1] https://html.spec.whatwg.org/multipage/window-object.html#concept-window-open-features-parse-boolean [2] https://github.com/whatwg/html/pull/7425 [3] https://github.com/whatwg/html/issues/7399 Fixed: 1277613 Change-Id: I5b3a7e985a9bb392c2150846b50369cfcd9b05fa --- .../open-features-is-popup-condition.html | 13 ++++ .../support/windowFeature-values-target.html | 24 +++++++ .../window-open-noopener.html | 3 + .../window-open-windowfeatures-values.html | 72 +++++++++++++++++++ 4 files changed, 112 insertions(+) create mode 100644 html/browsers/the-window-object/support/windowFeature-values-target.html create mode 100644 html/browsers/the-window-object/window-open-windowfeatures-values.html diff --git a/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-is-popup-condition.html b/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-is-popup-condition.html index 3959b618e1d0bab..4f52e2e8de64fd5 100644 --- a/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-is-popup-condition.html +++ b/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/open-features-is-popup-condition.html @@ -26,48 +26,59 @@ // The explicit popup feature. ["popup", false], ["popup=1", false], + ["popup=true", false], ["popup=0", true], // Other feature alone results in popup. ["location", false], ["location=yes", false], + ["location=true", false], ["location=no", false], ["toolbar", false], ["toolbar=yes", false], + ["toolbar=true", false], ["toolbar=no", false], ["menubar", false], ["menubar=yes", false], + ["menubar=true", false], ["menubar=no", false], ["resizable", false], ["resizable=yes", false], + ["resizable=true", false], ["resizable=no", false], ], "single-2": [ ["scrollbars", false], ["scrollbars=yes", false], + ["scrollbars=true", false], ["scrollbars=no", false], ["status", false], ["status=yes", false], + ["status=true", false], ["status=no", false], ["titlebar", false], ["titlebar=yes", false], + ["titlebar=true", false], ["titlebar=no", false], ["close", false], ["close=yes", false], + ["close=true", false], ["close=no", false], ["minimizable", false], ["minimizable=yes", false], + ["minimizable=true", false], ["minimizable=no", false], ["personalbar", false], ["personalbar=yes", false], + ["personalbar=true", false], ["personalbar=no", false], ], "position": [ @@ -113,6 +124,8 @@ // The explicit popup feature has priority than others. ["popup=1,location,toolbar,menubar,resizable,scrollbars,status", false], + ["popup=yes,location,toolbar,menubar,resizable,scrollbars,status", false], + ["popup=true,location,toolbar,menubar,resizable,scrollbars,status", false], ["popup=0,location,toolbar,menubar,resizable,scrollbars", true], ], }; diff --git a/html/browsers/the-window-object/support/windowFeature-values-target.html b/html/browsers/the-window-object/support/windowFeature-values-target.html new file mode 100644 index 000000000000000..3a78ddf660544a7 --- /dev/null +++ b/html/browsers/the-window-object/support/windowFeature-values-target.html @@ -0,0 +1,24 @@ + diff --git a/html/browsers/the-window-object/window-open-noopener.html b/html/browsers/the-window-object/window-open-noopener.html index c3c706605492c5c..8d3a95df630eaee 100644 --- a/html/browsers/the-window-object/window-open-noopener.html +++ b/html/browsers/the-window-object/window-open-noopener.html @@ -18,6 +18,9 @@ { testDescription: "noopener=1 means the same as noopener", secondWindowFeatureString: "noopener=1", shouldReturnWindow: false }, + { testDescription: "noopener=true means the same as noopener", + secondWindowFeatureString: "noopener=true", + shouldReturnWindow: false }, { testDescription: "noopener=0 means lack of noopener", secondWindowFeatureString: "noopener=0", shouldReturnWindow: true }, diff --git a/html/browsers/the-window-object/window-open-windowfeatures-values.html b/html/browsers/the-window-object/window-open-windowfeatures-values.html new file mode 100644 index 000000000000000..32551dd8d70f1e1 --- /dev/null +++ b/html/browsers/the-window-object/window-open-windowfeatures-values.html @@ -0,0 +1,72 @@ + + + +window.open() windowFeature value parsing + + + + +