<?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>321330</bug_id>
          
          <creation_ts>2026-08-07 14:43:43 -0700</creation_ts>
          <short_desc>[iOS] Pinching native video controls requests fullscreen repeatedly</short_desc>
          <delta_ts>2026-10-15 03:31:11 -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>Media</component>
          <version>Safari 26</version>
          <rep_platform>iPhone / iPad</rep_platform>
          <op_sys>iOS 26</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>
          
          <blocked>206854</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter>ingram.kalina</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>fred.wang</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>2238465</commentid>
    <comment_count>0</comment_count>
    <who name="">ingram.kalina</who>
    <bug_when>2026-08-07 14:43:43 -0700</bug_when>
    <thetext>Steps to reproduce:

1. On iPhone, load a page containing an inline &lt;video controls playsinline controlslist=&quot;nofullscreen&quot;&gt; element.
2. Place two fingers over the native controls and pinch outward past the threshold that enters fullscreen.

Observed behavior:

The native media controls request fullscreen repeatedly while the same pinch continues. The first request starts the fullscreen transition, while subsequent requests reach HTMLVideoElement.webkitEnterFullscreen() during the transition and raise InvalidStateError: The object is in an invalid state.

Expected behavior:

The native media controls should request fullscreen once per pinch gesture.

The issue is in IOSInlineMediaControls._pinchGestureRecognizerStateDidChange(). Once recognizer.scale exceeds MinimumScaleToEnterFullscreen, the method invokes iOSInlineMediaControlsRecognizedPinchInGesture() for every Changed state and again for the terminal Recognized/Ended state. MediaController then calls webkitEnterFullscreen() for each invocation.

Reproduced with a real two-finger gesture in the iOS 26.5 simulator. The same repeated requests occur when controlslist=&quot;nofullscreen&quot; is removed, so controlslist is part of the original reproduction but is not the cause. The behavior is also independent of playback state and playsinline.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2238473</commentid>
    <comment_count>1</comment_count>
    <who name="">ingram.kalina</who>
    <bug_when>2026-08-07 14:55:59 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/71185</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2240453</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2026-08-14 14:44:11 -0700</bug_when>
    <thetext>&lt;rdar://problem/184952141&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2264342</commentid>
    <comment_count>3</comment_count>
      <attachid>481836</attachid>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2026-10-15 02:28:05 -0700</bug_when>
    <thetext>Created attachment 481836
testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2264345</commentid>
    <comment_count>4</comment_count>
    <who name="Frédéric Wang Nélar">fred.wang</who>
    <bug_when>2026-10-15 02:37:57 -0700</bug_when>
    <thetext>I uploaded a tentative testcase, but I&apos;m not sure how to emulate the pinch in Device Hub without a trackpad.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2264359</commentid>
    <comment_count>5</comment_count>
    <who name="">ingram.kalina</who>
    <bug_when>2026-10-15 03:28:28 -0700</bug_when>
    <thetext>The layout test in PR 71185 lets you check the repeated fullscreen-request callback without emulating a pinch in Device Hub.

The test is:
LayoutTests/media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-pinch-enters-fullscreen-once.html

With the test and its expected-results file from the PR in your checkout, run from the repository root:

Tools/Scripts/run-webkit-tests --ios-simulator media/modern-media-controls/ios-inline-media-controls/ios-inline-media-controls-pinch-enters-fullscreen-once.html

It drives the recognizer through Began, Changed, Changed, Ended, then starts a second gesture. The cumulative delegate-call counts are:

                         Unpatched    Patched
First Changed                1           1
Second Changed               2           1
Ended                        3           1
Changed in a new gesture     4           2

This isolates the duplicate-request behavior; it doesn&apos;t exercise the actual fullscreen transition.

My end-to-end reproduction used XCUITest on the iOS 26.5 simulator. A window error listener displayed repeated “InvalidStateError: The object is in an invalid state.” messages on the diagnostic page. I haven&apos;t run your attachment yet.

Entering fullscreen itself is expected—the bug is the repeated requests within one gesture.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2264360</commentid>
    <comment_count>6</comment_count>
    <who name="">ingram.kalina</who>
    <bug_when>2026-10-15 03:31:11 -0700</bug_when>
    <thetext>For clarity, the counts above are unpatched → patched:

- First Changed: 1 → 1
- Second Changed: 2 → 1
- Ended: 3 → 1
- Changed in a new gesture: 4 → 2</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>481836</attachid>
            <date>2026-10-15 02:28:05 -0700</date>
            <delta_ts>2026-10-15 02:28:05 -0700</delta_ts>
            <desc>testcase</desc>
            <filename>321330.html</filename>
            <type>text/html</type>
            <size>255</size>
            <attacher name="Frédéric Wang Nélar">fred.wang</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxtZXRhIGNoYXJzZXQ9InV0Zi04Ii8+CjxtZXRhIG5hbWU9InZpZXdw
b3J0IiBjb250ZW50PSJ3aWR0aD1kZXZpY2Utd2lkdGgiIC8+Cjx2aWRlbyBpZD0idmlkZW8iIHNy
Yz0iaHR0cHM6Ly9hcmNoaXZlLm9yZy9kb3dubG9hZC9CaWdCdWNrQnVubnlfMTI0L0NvbnRlbnQv
YmlnX2J1Y2tfYnVubnlfNzIwcF9zdXJyb3VuZC5tcDQiIGNvbnRyb2xzIHBsYXlzaW5saW5lIGNv
bnRyb2xzbGlzdD0ibm9mdWxsc2NyZWVuIj4K
</data>

          </attachment>
      

    </bug>

</bugzilla>