Bug 251515

Summary: Regression?: MiniBrowser expands wrong elements by DOM Fullscreen API in certain case
Product: WebKit Reporter: Tetsuharu Ohzeki [UTC+9] <tetsuharu.ohzeki>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: jer.noble, ntim, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 229333    
Attachments:
Description Flags
MiniBrowser's actual behavior screenshots
none
Safari 16.3's behavior (expected) none

Description Tetsuharu Ohzeki [UTC+9] 2023-02-01 07:41:41 PST
Created attachment 464798 [details]
MiniBrowser's actual behavior screenshots

Environments
- macOS 13.2 (22D49), Apple Silicon
- https://commits.webkit.org/259663@main
	- rev 93e6542aebf91d6a023247a5068e8756eeae53d3

## Steps to Reproduce

1. Launch MiniBrowser by `./Tools/Scripts/run-minibrowser`  after finished the build
2. Open  [https://nocebo.jp/html5_video_fullscreen/](https://nocebo.jp/html5_video_fullscreen/) by the opened MiniBrowser.
3. Scroll to the embed Codepen iframe.
4. Click Big Buck Bunny’s thumbnail.

## Actual Result
- Please see "MiniBrowser's actual behavior screenshots"
- This happens in both of debug build and release build.
- The following output is dumped to my terminal.

```
1   HIToolbox                           0x00000001954e05c8 _ZN15MenuBarInstance22EnsureAutoShowObserverEv + 120
2   HIToolbox                           0x00000001954e0188 _ZN15MenuBarInstance14EnableAutoShowEv + 60
3   HIToolbox                           0x000000019544d8bc _ZN15MenuBarInstance21UpdateAggregateUIModeE21MenuBarAnimationStylehhh + 1184
4   HIToolbox                           0x00000001954e0004 _ZN15MenuBarInstance19SetFullScreenUIModeEjj + 180
5   AppKit                              0x000000018f2cfd1c -[NSApplication _setPresentationOptions:instance:flags:] + 956
6   AppKit                              0x000000018f165928 -[NSApplication _updateFullScreenPresentationOptionsForInstance:] + 404
7   CoreFoundation                      0x000000018bd82560 __CFNOTIFICATIONCENTER_IS_CALLING_OUT_TO_AN_OBSERVER__ + 148
8   CoreFoundation                      0x000000018be20044 ___CFXRegistrationPost_block_invoke + 88
9   CoreFoundation                      0x000000018be1ff8c _CFXRegistrationPost + 440
10  CoreFoundation                      0x000000018bd53b64 _CFXNotificationPost + 708
11  Foundation                          0x000000018cc4338c -[NSNotificationCenter postNotificationName:object:userInfo:] + 88
12  AppKit                              0x000000018f2d02a0 spacesNotificationHandler + 96
13  SkyLight                            0x00000001909bd214 _ZN12_GLOBAL__N_123notify_datagram_handlerEj15CGSDatagramTypePvmS1_ + 896
14  SkyLight                            0x0000000190ce94d4 _ZN21CGSDatagramReadStream26dispatchMainQueueDatagramsEv + 228
15  SkyLight                            0x0000000190ce93d0 ___ZN21CGSDatagramReadStream15mainQueueWakeupEv_block_invoke + 28
16  libdispatch.dylib                   0x000000018bb249dc _dispatch_call_block_and_release + 32
17  libdispatch.dylib                   0x000000018bb26504 _dispatch_client_callout + 20
18  libdispatch.dylib                   0x000000018bb34d1c _dispatch_main_queue_drain + 928
19  libdispatch.dylib                   0x000000018bb3496c _dispatch_main_queue_callback_4CF + 44
20  CoreFoundation                      0x000000018bdced40 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
21  CoreFoundation                      0x000000018bd8c7c0 __CFRunLoopRun + 2036
22  CoreFoundation                      0x000000018bd8b878 CFRunLoopRunSpecific + 612
23  HIToolbox                           0x000000019546bfa0 RunCurrentEventLoopInMode + 292
24  HIToolbox                           0x000000019546bde4 ReceiveNextEventCommon + 672
25  HIToolbox                           0x000000019546bb2c _BlockUntilNextEventMatchingListInModeWithFilter + 72
26  AppKit                              0x000000018f011838 _DPSNextEvent + 632
27  AppKit                              0x000000018f0109c8 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
28  AppKit                              0x000000018f004df8 -[NSApplication run] + 464
29  AppKit                              0x000000018efdc23c NSApplicationMain + 880
30  MiniBrowser                         0x00000001001bdedc main + 52
31  dyld                                0x000000018b983e50 start + 2544
1   HIToolbox                           0x000000019546b90c _ZN15MenuBarInstance22RemoveAutoShowObserverEv + 44
2   HIToolbox                           0x00000001954e0fbc _ZN15MenuBarInstance15DisableAutoShowEv + 36
3   HIToolbox                           0x000000019544d8c4 _ZN15MenuBarInstance21UpdateAggregateUIModeE21MenuBarAnimationStylehhh + 1192
4   HIToolbox                           0x00000001954e0004 _ZN15MenuBarInstance19SetFullScreenUIModeEjj + 180
5   AppKit                              0x000000018f2cfd1c -[NSApplication _setPresentationOptions:instance:flags:] + 956
6   AppKit                              0x000000018f165940 -[NSApplication _updateFullScreenPresentationOptionsForInstance:] + 428
7   AppKit                              0x000000018fa2c960 -[_NSFullScreenSpace(PresentationInstance) activateFullScreenPresentationOptions] + 148
8   AppKit                              0x000000018f886968 -[_NSExitFullScreenTransitionController _doSucceededToExitFullScreen] + 40
9   AppKit                              0x000000018f887440 __63-[_NSExitFullScreenTransitionController _performExitFullScreen]_block_invoke + 236
10  libxpc.dylib                        0x000000018ba1e42c _xpc_connection_reply_callout + 124
11  libxpc.dylib                        0x000000018ba1e31c _xpc_connection_call_reply_async + 88
12  libdispatch.dylib                   0x000000018bb26584 _dispatch_client_callout3 + 20
13  libdispatch.dylib                   0x000000018bb44710 _dispatch_mach_msg_async_reply_invoke + 344
14  libdispatch.dylib                   0x000000018bb34c70 _dispatch_main_queue_drain + 756
15  libdispatch.dylib                   0x000000018bb3496c _dispatch_main_queue_callback_4CF + 44
16  CoreFoundation                      0x000000018bdced40 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE__ + 16
17  CoreFoundation                      0x000000018bd8c7c0 __CFRunLoopRun + 2036
18  CoreFoundation                      0x000000018bd8b878 CFRunLoopRunSpecific + 612
19  HIToolbox                           0x000000019546bfa0 RunCurrentEventLoopInMode + 292
20  HIToolbox                           0x000000019546bde4 ReceiveNextEventCommon + 672
21  HIToolbox                           0x000000019546bb2c _BlockUntilNextEventMatchingListInModeWithFilter + 72
22  AppKit                              0x000000018f011838 _DPSNextEvent + 632
23  AppKit                              0x000000018f0109c8 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 728
24  AppKit                              0x000000018f004df8 -[NSApplication run] + 464
25  AppKit                              0x000000018efdc23c NSApplicationMain + 880
26  MiniBrowser                         0x00000001001bdedc main + 52
27  dyld                                0x000000018b983e50 start + 2544
```
Comment 1 Tetsuharu Ohzeki [UTC+9] 2023-02-01 07:43:11 PST
> ## Actual Result

MiniBrowser expands codepen's editor parts to fullscreen instead of Big Buck Bunny’s video


## Expected Behavior

- MiniBrowser should expands Big Buck Bunny’s video to fullscreen
Comment 2 Tetsuharu Ohzeki [UTC+9] 2023-02-01 07:43:34 PST
Created attachment 464799 [details]
Safari 16.3's behavior (expected)
Comment 3 Radar WebKit Bug Importer 2023-02-02 18:58:51 PST
<rdar://problem/104987995>