<?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>251247</bug_id>
          
          <creation_ts>2023-01-26 21:45:44 -0800</creation_ts>
          <short_desc>ASSERTION FAILED: m_element in WebFullScreenManager::setAnimatingFullScreen</short_desc>
          <delta_ts>2023-01-27 16:09:38 -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>WebKit Nightly Build</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Jean-Yves Avenard [:jya]">jean-yves.avenard</reporter>
          <assigned_to name="Jean-Yves Avenard [:jya]">jean-yves.avenard</assigned_to>
          <cc>ryanhaddad</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1928813</commentid>
    <comment_count>0</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2023-01-26 21:45:44 -0800</bug_when>
    <thetext>STR:

- In a debug build, open https://talk.objc.io/episodes/S01E338-attributed-string-builder-part-2
- Press play button to start playback
- In the bottom right corner of the video, press the button to go into full screen
- Press Esc key

Assertion on `ASSERT(m_element)` in void WebFullScreenManager::setAnimatingFullScreen(bool animating) 
https://searchfox.org/wubkat/rev/b66d5e5ea816cde25864cad0e14941127e725181/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp#327

```
(lldb) bt
* thread #1, queue = &apos;com.apple.main-thread&apos;, stop reason = EXC_BAD_ACCESS (code=1, address=0xbbadbeef)
    frame #0: 0x0000000131c3f2f0 JavaScriptCore`::WTFCrash() at Assertions.cpp:327:35
    frame #1: 0x0000000115bafd04 WebKit`WTFCrashWithInfo((null)=326, (null)=&quot;/Users/jyavenard/Work/webkit/OpenSource/Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp&quot;, (null)=&quot;void WebKit::WebFullScreenManager::setAnimatingFullScreen(bool)&quot;, (null)=3680) at Assertions.h:754:5
  * frame #2: 0x0000000117a6e490 WebKit`WebKit::WebFullScreenManager::setAnimatingFullScreen(this=0x000000016852e880, animating=false) at WebFullScreenManager.cpp:326:5
    frame #3: 0x000000011825df5c WebKit`auto void IPC::callMemberFunction&lt;WebKit::WebFullScreenManager, WebKit::WebFullScreenManager, void (bool), std::__1::tuple&lt;bool&gt; &gt;(this=0x000000016d9e9950, args=0x000000016d9e99f6)(bool), std::__1::tuple&lt;bool&gt;&amp;&amp;)::&apos;lambda&apos;(auto&amp;&amp;...)::operator()&lt;bool&gt;(auto&amp;&amp;...) const at HandleMessage.h:136:13
    frame #4: 0x000000011825de8c WebKit`decltype(__f=0x000000016d9e9950, __args=0x000000016d9e99f6)(std::declval&lt;bool&gt;())) std::__1::__invoke[abi:v15006]&lt;void IPC::callMemberFunction&lt;WebKit::WebFullScreenManager, WebKit::WebFullScreenManager, void (bool), std::__1::tuple&lt;bool&gt; &gt;(WebKit::WebFullScreenManager*, void (WebKit::WebFullScreenManager::*)(bool), std::__1::tuple&lt;bool&gt;&amp;&amp;)::&apos;lambda&apos;(auto&amp;&amp;...), bool&gt;(WebKit::WebFullScreenManager&amp;&amp;, bool&amp;&amp;) at invoke.h:394:23
    frame #5: 0x000000011825de5c WebKit`decltype(__f=0x000000016d9e9950, __t=size=1, (null)=__tuple_indices&lt;0UL&gt; @ 0x000000016d9e990f) std::__1::__apply_tuple_impl[abi:v15006]&lt;void IPC::callMemberFunction&lt;WebKit::WebFullScreenManager, WebKit::WebFullScreenManager, void (bool), std::__1::tuple&lt;bool&gt; &gt;(WebKit::WebFullScreenManager*, void (WebKit::WebFullScreenManager::*)(bool), std::__1::tuple&lt;bool&gt;&amp;&amp;)::&apos;lambda&apos;(auto&amp;&amp;...), std::__1::tuple&lt;bool&gt;, 0ul&gt;(WebKit::WebFullScreenManager&amp;&amp;, WebKit::WebFullScreenManager&amp;&amp;, std::__1::__tuple_indices&lt;0ul&gt;) at tuple:1789:1
    frame #6: 0x000000011825de1c WebKit`decltype(__f=0x000000016d9e9950, __t=size=1) std::__1::apply[abi:v15006]&lt;void IPC::callMemberFunction&lt;WebKit::WebFullScreenManager, WebKit::WebFullScreenManager, void (bool), std::__1::tuple&lt;bool&gt; &gt;(WebKit::WebFullScreenManager*, void (WebKit::WebFullScreenManager::*)(bool), std::__1::tuple&lt;bool&gt;&amp;&amp;)::&apos;lambda&apos;(auto&amp;&amp;...), std::__1::tuple&lt;bool&gt; &gt;(WebKit::WebFullScreenManager&amp;&amp;, WebKit::WebFullScreenManager&amp;&amp;) at tuple:1798:1
    frame #7: 0x000000011825ddec WebKit`void IPC::callMemberFunction&lt;WebKit::WebFullScreenManager, WebKit::WebFullScreenManager, void (bool), std::__1::tuple&lt;bool&gt; &gt;(object=0x000000016852e880, function=0c e4 a6 17 01 80 13 db 00 00 00 00 00 00 00 00, tuple=size=1)(bool), std::__1::tuple&lt;bool&gt;&amp;&amp;) at HandleMessage.h:134:5
    frame #8: 0x000000011825caf0 WebKit`void IPC::handleMessage&lt;Messages::WebFullScreenManager::SetAnimatingFullScreen, WebKit::WebFullScreenManager, WebKit::WebFullScreenManager, void (bool)&gt;(connection=0x000000010503ca50, decoder=0x00000001055ae2a0, object=0x000000016852e880, function=0c e4 a6 17 01 80 13 db 00 00 00 00 00 00 00 00)(bool)) at HandleMessage.h:230:5
    frame #9: 0x000000011825c1dc WebKit`WebKit::WebFullScreenManager::didReceiveWebFullScreenManagerMessage(this=0x000000016852e880, connection=0x000000010503ca50, decoder=0x00000001055ae2a0) at WebFullScreenManagerMessageReceiver.cpp:58:16
    frame #10: 0x0000000117a6cb6c WebKit`WebKit::WebFullScreenManager::didReceiveMessage(this=0x000000016852e880, connection=0x000000010503ca50, decoder=0x00000001055ae2a0) at WebFullScreenManager.cpp:133:5
    frame #11: 0x00000001182c8778 WebKit`WebKit::WebPage::didReceiveMessage(this=0x000000010980b208, connection=0x000000010503ca50, decoder=0x00000001055ae2a0) at WebPage.cpp:5458:30
    frame #12: 0x0000000118866060 WebKit`IPC::MessageReceiverMap::dispatchMessage(this=0x00000001050409c8, connection=0x000000010503ca50, decoder=0x00000001055ae2a0) at MessageReceiverMap.cpp:129:26
    frame #13: 0x00000001179e92d8 WebKit`WebKit::WebProcess::didReceiveMessage(this=0x0000000105040990, connection=0x000000010503ca50, decoder=0x00000001055ae2a0) at WebProcess.cpp:933:30
    frame #14: 0x0000000118839f24 WebKit`IPC::Connection::dispatchMessage(this=0x000000010503ca50, decoder=0x00000001055ae2a0) at Connection.cpp:1197:15
    frame #15: 0x000000011883a3e4 WebKit`IPC::Connection::dispatchMessage(this=0x000000010503ca50, message=IPC::Decoder @ 0x00000001055ae2a0) at Connection.cpp:1245:9
    frame #16: 0x000000011883a758 WebKit`IPC::Connection::dispatchOneIncomingMessage(this=0x000000010503ca50) at Connection.cpp:1310:5
    frame #17: 0x00000001188585ec WebKit`IPC::Connection::enqueueIncomingMessage(this=0x00000001054841d8)::$_17::operator()() const at Connection.cpp:1159:28
    frame #18: 0x000000011885852c WebKit`WTF::Detail::CallableWrapper&lt;IPC::Connection::enqueueIncomingMessage(std::__1::unique_ptr&lt;IPC::Decoder, std::__1::default_delete&lt;IPC::Decoder&gt; &gt;)::$_17, void&gt;::call(this=0x00000001054841d0) at Function.h:53:39
    frame #19: 0x0000000131c68290 JavaScriptCore`WTF::Function&lt;void ()&gt;::operator(this=0x000000016d9e9fa0)() const at Function.h:82:35
    frame #20: 0x0000000131d009f0 JavaScriptCore`WTF::RunLoop::performWork(this=0x0000000105010100) at RunLoop.cpp:147:9
    frame #21: 0x0000000131d05038 JavaScriptCore`WTF::RunLoop::performWork(context=0x0000000105010100) at RunLoopCF.cpp:46:37
    frame #22: 0x000000019b8f69f8 CoreFoundation`__CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 28
    frame #23: 0x000000019b8f698c CoreFoundation`__CFRunLoopDoSource0 + 176
    frame #24: 0x000000019b8f66fc CoreFoundation`__CFRunLoopDoSources0 + 244
    frame #25: 0x000000019b8f5304 CoreFoundation`__CFRunLoopRun + 828
    frame #26: 0x000000019b8f4874 CoreFoundation`CFRunLoopRunSpecific + 612
    frame #27: 0x000000019c868f0c Foundation`-[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 212
    frame #28: 0x000000019c8e18cc Foundation`-[NSRunLoop(NSRunLoop) run] + 64
    frame #29: 0x000000019b566594 libxpc.dylib`_xpc_objc_main + 860
    frame #30: 0x000000019b565eb4 libxpc.dylib`xpc_main + 108
    frame #31: 0x00000001167e5a4c WebKit`WebKit::XPCServiceMain((null)=1, (null)=0x000000016d9eb468) at XPCServiceMain.mm:207:5
    frame #32: 0x000000011880a834 WebKit`WKXPCServiceMain(argc=1, argv=0x000000016d9eb468) at WKMain.mm:35:12
    frame #33: 0x0000000102417f9c com.apple.WebKit.WebContent.Development`main(argc=1, argv=0x000000016d9eb468) at AuxiliaryProcessMain.cpp:30:12
    frame #34: 0x000000019b4bff28 dyld`start + 2236
(lldb) 
```</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1928815</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-01-26 21:46:26 -0800</bug_when>
    <thetext>&lt;rdar://problem/104728830&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1928818</commentid>
    <comment_count>2</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2023-01-26 21:56:57 -0800</bug_when>
    <thetext>In WKFullScreenWindowController finishedExitFullScreenAnimationAndExitImmediately, 

we have:
```
    // These messages must be sent after the swap or flashing will occur during forceRepaint:
    [self _manager]-&gt;didExitFullScreen();
    [self _manager]-&gt;setAnimatingFullScreen(false);
```

which calls via IPC:
WebFullScreenManager::didExitFullScreen() which will call `WebFullScreenManager ::clearElement();` which sets m_element to nullptr
followed by
WebFullScreenManager::setAnimatingFullScreen() which asserts that m_element isn&apos;t null.


This is a regression from bug 247991</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1928827</commentid>
    <comment_count>3</comment_count>
    <who name="Jean-Yves Avenard [:jya]">jean-yves.avenard</who>
    <bug_when>2023-01-26 23:00:43 -0800</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/9208</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1929061</commentid>
    <comment_count>4</comment_count>
    <who name="Ryan Haddad">ryanhaddad</who>
    <bug_when>2023-01-27 14:41:48 -0800</bug_when>
    <thetext>*** Bug 248093 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1929082</commentid>
    <comment_count>5</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-01-27 16:09:33 -0800</bug_when>
    <thetext>Committed 259513@main (4bbaaeffdd01): &lt;https://commits.webkit.org/259513@main&gt;

Reviewed commits have been landed. Closing PR #9208 and removing active labels.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>