<?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>234976</bug_id>
          
          <creation_ts>2022-01-07 11:57:56 -0800</creation_ts>
          <short_desc>webkitRequestFullscreen fulfils but will not go into fullscreen with click handler that creates MediaStream and plays video</short_desc>
          <delta_ts>2022-01-10 09:48:31 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Media</component>
          <version>Safari 15</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="Will Morgan">will.morgan</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>jer.noble</cc>
    
    <cc>mark.burrett</cc>
    
    <cc>peng.liu6</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1829025</commentid>
    <comment_count>0</comment_count>
      <attachid>448616</attachid>
    <who name="Will Morgan">will.morgan</who>
    <bug_when>2022-01-07 11:57:56 -0800</bug_when>
    <thetext>Created attachment 448616
fs.html testbed

When I click a button that creates a MediaStream with getUserMedia, then plays a video that satisfies the autoplay criteria, then performs webkitRequestFullscreen (WRFS), the WRFS call return but no fullscreen resize event happens.

For compatibility with other browsers, especially with regard to anti-abuse and user activation, the advice is to first getUserMedia, then play a video, then finally requestFullscreen. This is because requestFullscreen clears user activation flags, which means that you can&apos;t getUserMedia afterwards.

This is the approach suggested here: https://github.com/whatwg/fullscreen/issues/152#issuecomment-494840412

My expected behaviour here would be for webkitRequestFullscreen to actually go into fullscreen, or at the very minimum if the WebKit team disagree with the WHATWG user activation approach, it should at least throw with a NotAllowedError.

This has downstream implications - sindresorhus&apos;s screenfull library returns a promise that never fulfils because WRFS doesn&apos;t throw and no change events happen. This effectively deadlocks any application that relies on entering fullscreen unless an arbitrary timeout is used.

I&apos;m discussing the same issue with the team at Mozilla: https://bugzilla.mozilla.org/show_bug.cgi?id=957558</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1829386</commentid>
    <comment_count>1</comment_count>
    <who name="Mark B">mark.burrett</who>
    <bug_when>2022-01-10 00:24:17 -0800</bug_when>
    <thetext>Is this issue common to macOS and iOS?
And is it new in Safari 15? Are all minor versions affected?
We would also appreciate feedback on whether the current behaviour is intended, and if so some guidance around avoiding the described deadlock.
If not, is a fix already in the pipeline?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1829510</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2022-01-10 09:48:31 -0800</bug_when>
    <thetext>&lt;rdar://problem/87346180&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>448616</attachid>
            <date>2022-01-07 11:57:56 -0800</date>
            <delta_ts>2022-01-07 11:57:56 -0800</delta_ts>
            <desc>fs.html testbed</desc>
            <filename>file_234976.txt</filename>
            <type>text/plain</type>
            <size>2341</size>
            <attacher name="Will Morgan">will.morgan</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+DQo8aHRtbD4NCiAgPGhlYWQ+DQogICAgPHRpdGxlPkZ1bGxzY3JlZW4g
KyBWaWRlbyBUZXN0PC90aXRsZT4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aXNGcygpKSwg
MjApDQogICAgICB9KQ0KICAgICAgO1siZnVsbHNjcmVlbmNoYW5nZSIsICJvbndlYmtpdGZ1bGxz
Y3JlZW5jaGFuZ2UiXS5mb3JFYWNoKChldikgPT4gew0KICAgICAgICBkb2N1bWVudC5ib2R5LmFk
ZEV2ZW50TGlzdGVuZXIoZXYsICgpID0+IHsNCiAgICAgICAgICBsb2coZXYgKyAiIGZpcmVkLCBm
dWxsc2NyZWVuIGlzOiAiICsgaXNGcygpKQ0KICAgICAgICB9KQ0KICAgICAgfSkNCiAgICAgIGRv
Y3VtZW50LnF1ZXJ5U2VsZWN0b3IoImJ1dHRvbiIpLmFkZEV2ZW50TGlzdGVuZXIoImNsaWNrIiwg
YXN5bmMgKCkgPT4gew0KICAgICAgICBjb25zdCBtZWRpYVN0cmVhbSA9IGF3YWl0IG5hdmlnYXRv
ci5tZWRpYURldmljZXMuZ2V0VXNlck1lZGlhKHsgdmlkZW86IHRydWUgfSkNCiAgICAgICAgY29u
c3QgdmlkZW8gPSBkb2N1bWVudC5nZXRFbGVtZW50QnlJZCgid2ViY2FtIikNCiAgICAgICAgdmlk
ZW8uc3JjT2JqZWN0ID0gbWVkaWFTdHJlYW0NCiAgICAgICAgYXdhaXQgdmlkZW8ucGxheSgpDQog
ICAgICAgIGF3YWl0IHJlcXVlc3RGdWxsc2NyZWVuKCkNCiAgICAgICAgbG9nKCJDbGljayBoYW5k
bGVyIGNvbXBsZXRlIikNCiAgICAgIH0pDQogICAgPC9zY3JpcHQ+DQogIDwvYm9keT4NCjwvaHRt
bD4NCg==
</data>

          </attachment>
      

    </bug>

</bugzilla>