<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>223751</bug_id>
          
          <creation_ts>2021-03-25 10:13:48 -0700</creation_ts>
          <short_desc>Standardize the condition for opening popup from window.open, and BarProp values</short_desc>
          <delta_ts>2024-08-25 19:38:16 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Tooru Fujisawa [:arai]">arai.unmht</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>woodlxf00</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1743805</commentid>
    <comment_count>0</comment_count>
    <who name="Tooru Fujisawa [:arai]">arai.unmht</who>
    <bug_when>2021-03-25 10:13:48 -0700</bug_when>
    <thetext>https://github.com/whatwg/html/issues/5872 is about standardizing when a popup is opened by `window.open` call.
https://github.com/whatwg/html/issues/4431 is about standardizing what value window&apos;s `BarProp` attributes (`window.locationbar.visible` etc) returns.

Draft proposal for fixing those issues in https://arai-a.github.io/window-open-features/proposal.html
I&apos;ll open spec and test PRs within a few days and post the URLs here.

The condition for opening popup in the proposal is based on the current Safari behavior, so no change is required for that part.
`BarProp` values in the proposal are different than the current Safari/WebKit behavior (they based on Chromium), so that part requires change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1743806</commentid>
    <comment_count>1</comment_count>
    <who name="Tooru Fujisawa [:arai]">arai.unmht</who>
    <bug_when>2021-03-25 10:14:32 -0700</bug_when>
    <thetext>Firefox bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1701001
Chromium bug: https://bugs.chromium.org/p/chromium/issues/detail?id=1192701</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1743818</commentid>
    <comment_count>2</comment_count>
    <who name="Tooru Fujisawa [:arai]">arai.unmht</who>
    <bug_when>2021-03-25 10:36:09 -0700</bug_when>
    <thetext>Spec PR: https://github.com/whatwg/html/pull/6530
test PR: https://github.com/web-platform-tests/wpt/pull/28243</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1746087</commentid>
    <comment_count>3</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2021-04-01 10:14:20 -0700</bug_when>
    <thetext>&lt;rdar://problem/76109253&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1810579</commentid>
    <comment_count>4</comment_count>
    <who name="Tooru Fujisawa [:arai]">arai.unmht</who>
    <bug_when>2021-11-01 01:59:34 -0700</bug_when>
    <thetext>the proposal is merged into the spec.

(In reply to Tooru Fujisawa [:arai] from comment #0)
&gt; The condition for opening popup in the proposal is based on the current
&gt; Safari behavior, so no change is required for that part.

The proposal was modified to follow Chromium behavior,
so this part requires change.

&gt; `BarProp` values in the proposal are different than the current
&gt; Safari/WebKit behavior (they based on Chromium), so that part requires
&gt; change.

This was my misunderstanding, and it&apos;s also different than current Chromium.
`BarProp` now returns whether the browsing context is opened by requesting popup or not, regardless of the actual visibility or each feature value.
anyway this part still requires change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1890307</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-08-10 09:32:54 -0700</bug_when>
    <thetext>WPT passes all WPT tests related BarProp:

https://wpt.fyi/results/html/browsers/the-window-object?label=master&amp;label=experimental&amp;aligned&amp;view=subtest&amp;q=barprop

Do we need to do something here? Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1890337</commentid>
    <comment_count>6</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-08-10 10:45:26 -0700</bug_when>
    <thetext>These tests are relevant ones:
http://w3c-test.org/html/browsers/the-window-object/apis-for-creating-and-navigating-browsing-contexts-by-name/</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1890411</commentid>
    <comment_count>7</comment_count>
    <who name="Tooru Fujisawa [:arai]">arai.unmht</who>
    <bug_when>2022-08-10 14:57:57 -0700</bug_when>
    <thetext>The latest file for the test is here
https://github.com/web-platform-tests/wpt/blob/master/html/browsers/the-window-object/open-close/open-features-is-popup-condition.html

that can be visible here:
https://wpt.fyi/results/html/browsers/the-window-object?label=master&amp;label=experimental&amp;aligned&amp;view=subtest&amp;q=open-features-is-popup-condition


Given the actual UI style is browser dependent, the testcase uses the relation between the `window.open`&apos;s features parameter and `BarProp.visible`, that represents &quot;is popup&quot; of browser context.

https://html.spec.whatwg.org/multipage/browsers.html#is-popup
&gt; A top-level browsing context has an is popup boolean. It is initially false.
&gt; 
&gt; NOTE:
&gt; The only mandatory impact in this specification of is popup is on the
&gt; visible getter of the relevant BarProp objects. However, user agents might
&gt; also use it in the following ways:
&gt; 
&gt;  * Deciding whether or not to provide a minimal web browser user interface
&gt;    for the browsing context.
&gt;  * Performing the optional steps in set up browsing context features.
&gt; 
&gt; In both cases user agents might additionally incorporate user preferences,
&gt; or present a choice as to whether to go down the popup route.
&gt; 
&gt; User agents that provides a minimal web browser user interface for such
&gt; popups are encouraged to not hide the browser&apos;s location bar.

https://html.spec.whatwg.org/multipage/window-object.html#window-open-steps
&gt; The window open steps, given a string url, a string target, and a string
&gt; features, are as follows:
&gt; ...
&gt;  4. Let tokenizedFeatures be the result of tokenizing features.
&gt; ...
&gt; 11. If windowType is either &quot;new and unrestricted&quot; or &quot;new with no opener&quot;,
&gt;     then:
&gt;   1. Set the target browsing context&apos;s is popup to the result of checking if
&gt;      a popup window is requested, given tokenizedFeatures.

https://html.spec.whatwg.org/multipage/window-object.html#popup-window-is-requested
&gt; To check if a popup window is requested, given tokenizedFeatures:
&gt;   1. If tokenizedFeatures is empty, then return false.
&gt;   2. If tokenizedFeatures[&quot;popup&quot;] exists, then return the result of parsing
&gt;      tokenizedFeatures[&quot;popup&quot;] as a boolean feature.
&gt;   3. Let location be the result of checking if a window feature is set,
&gt;      given tokenizedFeatures, &quot;location&quot;, and false.
&gt;   4. Let toolbar be the result of checking if a window feature is set,
&gt;      given tokenizedFeatures, &quot;toolbar&quot;, and false.
&gt;   5. If location and toolbar are both false, then return true.
&gt;   6. Let menubar be the result of checking if a window feature is set,
&gt;      given tokenizedFeatures, menubar&quot;, and false.
&gt;   7. If menubar is false, then return true.
&gt;   8. Let resizable be the result of checking if a window feature is set,
&gt;      given tokenizedFeatures, &quot;resizable&quot;, and true.
&gt;   9. If resizable is false, then return true.
&gt;  10. Let scrollbars be the result of checking if a window feature is set,
&gt;      given tokenizedFeatures, &quot;scrollbars&quot;, and false.
&gt;  11. If scrollbars is false, then return true.
&gt;  12. Let status be the result of checking if a window feature is set,
&gt;      given tokenizedFeatures, &quot;status&quot;, and false.
&gt;  13. If status is false, then return true.
&gt;  14. Return false.

https://html.spec.whatwg.org/multipage/window-object.html#dom-barprop-visible
&gt; The visible getter steps are:
&gt;   1. Let browsingContext be this&apos;s relevant global object&apos;s browsing context.
&gt;   2. If browsingContext is null, then return true.
&gt;   3. Return the negation of browsingContext&apos;s top-level browsing context&apos;s
&gt;      is popup.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>