Changeset 271656 in webkit


Ignore:
Timestamp:
Jan 20, 2021 11:01:57 AM (18 months ago)
Author:
jer.noble@apple.com
Message:

[Mac] Netflix controls do not fade out after entering fullscreen
https://bugs.webkit.org/show_bug.cgi?id=220472
<rdar://70602577>

Reviewed by Eric Carlson.

Test: TestWebKitAPI/Tests/mac/FullscreenPointerLeave.mm

Netflix uses a "pointerleave" event over their playback controls to trigger setting their "fade out controls"
timer, but a "pointerleave" event isn't fired when the element moves out from under the pointer (either due to
style changes, or the window screen location moving due to entering fullscreen).

Work around this behavior by sending a synthetic mouse event after entering fullscreen, which causes the
"pointerleave" event to be fired if, indeed, the pointer is no longer over the element in question.

  • UIProcess/mac/WKFullScreenWindowController.mm:

(-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):

Location:
trunk
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r271650 r271656  
     12021-01-20  Jer Noble  <jer.noble@apple.com>
     2
     3        [Mac] Netflix controls do not fade out after entering fullscreen
     4        https://bugs.webkit.org/show_bug.cgi?id=220472
     5        <rdar://70602577>
     6
     7        Reviewed by Eric Carlson.
     8
     9        Test: TestWebKitAPI/Tests/mac/FullscreenPointerLeave.mm
     10
     11        Netflix uses a "pointerleave" event over their playback controls to trigger setting their "fade out controls"
     12        timer, but a "pointerleave" event isn't fired when the element moves out from under the pointer (either due to
     13        style changes, or the window screen location moving due to entering fullscreen).
     14
     15        Work around this behavior by sending a synthetic mouse event after entering fullscreen, which causes the
     16        "pointerleave" event to be fired if, indeed, the pointer is no longer over the element in question.
     17
     18        * UIProcess/mac/WKFullScreenWindowController.mm:
     19        (-[WKFullScreenWindowController finishedEnterFullScreenAnimation:]):
     20
    1212021-01-20  Kate Cheney  <katherine_cheney@apple.com>
    222
  • trunk/Source/WebKit/UIProcess/mac/WKFullScreenWindowController.mm

    r271171 r271656  
    3131#import "AppKitSPI.h"
    3232#import "LayerTreeContext.h"
     33#import "NativeWebMouseEvent.h"
    3334#import "VideoFullscreenManagerProxy.h"
    3435#import "WKAPICast.h"
     
    397398        [self _manager]->didExitFullScreen();
    398399        [self _manager]->setAnimatingFullScreen(false);
     400
     401        // FIXME(53342): remove once pointer events fire when elements move out from under the pointer.
     402        NSEvent *fakeEvent = [NSEvent mouseEventWithType:NSEventTypeMouseMoved
     403            location:[NSEvent mouseLocation]
     404            modifierFlags:[[NSApp currentEvent] modifierFlags]
     405            timestamp:[NSDate timeIntervalSinceReferenceDate]
     406            windowNumber:[[_webView window] windowNumber]
     407            context:nullptr
     408            eventNumber:0
     409            clickCount:0
     410            pressure:0];
     411        WebKit::NativeWebMouseEvent webEvent(fakeEvent, nil, _webView);
     412        _page->handleMouseEvent(webEvent);
    399413    }
    400414
  • trunk/Tools/TestWebKitAPI/TestWebKitAPI.xcodeproj/project.pbxproj

    r271459 r271656  
    10531053                CDD68F0D22C18317000CF0AE /* WKWebViewCloseAllMediaPresentations.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDD68F0C22C18317000CF0AE /* WKWebViewCloseAllMediaPresentations.mm */; };
    10541054                CDE195B51CFE0B880053D256 /* FullscreenTopContentInset.html in Copy Resources */ = {isa = PBXBuildFile; fileRef = CDE195B21CFE0ADE0053D256 /* FullscreenTopContentInset.html */; };
     1055                CDE77D2525A6591C00D4115E /* FullscreenPointerLeave.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDE77D2425A6591C00D4115E /* FullscreenPointerLeave.mm */; };
    10551056                CDED342F249DDE0E0002AE7A /* AudioRoutingArbitration.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDED342E249DDD9D0002AE7A /* AudioRoutingArbitration.mm */; };
    10561057                CDF0B78A216D48DC00421ECC /* CloseWebViewDuringEnterFullscreen.mm in Sources */ = {isa = PBXBuildFile; fileRef = CDF0B789216D484300421ECC /* CloseWebViewDuringEnterFullscreen.mm */; };
     
    14281429                                F47728991E4AE3C1007ABF6A /* full-page-contenteditable.html in Copy Resources */,
    14291430                                F4E0A28B211E4A2B00AF7C7F /* full-page-dropzone.html in Copy Resources */,
     1431                                CDB4776225568E2700FF5D2A /* full-screen-scroll-position.html in Copy Resources */,
    14301432                                F4F405BC1D4C0D1C007A9707 /* full-size-autoplaying-video-with-audio.html in Copy Resources */,
    14311433                                CD78E11E1DB7EE2A0014A2DE /* FullscreenDelegate.html in Copy Resources */,
     
    27872789                CDE195B21CFE0ADE0053D256 /* FullscreenTopContentInset.html */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.html; path = FullscreenTopContentInset.html; sourceTree = "<group>"; };
    27882790                CDE195B31CFE0ADE0053D256 /* TopContentInset.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TopContentInset.mm; sourceTree = "<group>"; };
     2791                CDE77D2425A6591C00D4115E /* FullscreenPointerLeave.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = FullscreenPointerLeave.mm; sourceTree = "<group>"; };
    27892792                CDED342E249DDD9D0002AE7A /* AudioRoutingArbitration.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = AudioRoutingArbitration.mm; sourceTree = "<group>"; };
    27902793                CDF0B789216D484300421ECC /* CloseWebViewDuringEnterFullscreen.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = CloseWebViewDuringEnterFullscreen.mm; sourceTree = "<group>"; };
     
    38243827                                93575C551D30366E000D604D /* focus-inputs.html */,
    38253828                                F46128D8211E496300D9FADB /* full-page-dropzone.html */,
     3829                                CDB477612556894B00FF5D2A /* full-screen-scroll-position.html */,
    38263830                                F4F405BA1D4C0CF8007A9707 /* full-size-autoplaying-video-with-audio.html */,
    38273831                                CD78E11B1DB7EA360014A2DE /* FullscreenDelegate.html */,
     
    45234527                                1A7E8B33181208DE00AEB74A /* FragmentNavigation.mm */,
    45244528                                CDB213BC24EF522800FDE301 /* FullscreenFocus.mm */,
     4529                                CDE77D2425A6591C00D4115E /* FullscreenPointerLeave.mm */,
    45254530                                CDBFCC431A9FF44800A7B691 /* FullscreenZoomInitialFrame.mm */,
    45264531                                51EB125824C68589000CB030 /* HIDGamepads.mm */,
     
    52695274                                CD78E11D1DB7EA660014A2DE /* FullscreenDelegate.mm in Sources */,
    52705275                                CDB213BD24EF522800FDE301 /* FullscreenFocus.mm in Sources */,
     5276                                CDE77D2525A6591C00D4115E /* FullscreenPointerLeave.mm in Sources */,
     5277                                CDB477602556886800FF5D2A /* FullScreenScrollPosition.mm in Sources */,
    52715278                                CDBFCC451A9FF45300A7B691 /* FullscreenZoomInitialFrame.mm in Sources */,
    52725279                                83DB79691EF63B3C00BFA5E5 /* Function.cpp in Sources */,
Note: See TracChangeset for help on using the changeset viewer.