Skip to content

Commit

Permalink
Cherry-pick 8a09872. rdar://120492434
Browse files Browse the repository at this point in the history
    [iOS] youtube.com: Exiting fullscreen causes page to scroll down slightly, cropping top of video
    https://bugs.webkit.org/show_bug.cgi?id=269120
    rdar://120492434

    Reviewed by Aditya Keerthi.

    In 271567@main, we added a call to `scrollIntoView()` to ensure the element which was exiting
    fullscreen was visible in the viewport, no matter how much layout shifted the element during
    the fullscreen transition. However, this has the side effect of "pinning" the fullscreen element
    to the top of the page, which for the case of YouTube, is under the YouTube header bar.

    Instead, call `scrollIntoViewIfNotVisible()` (passing in `true` to center the element if
    offscreen) which is a no-op if the element is already visible.

    * Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp:
    (WebKit::WebFullScreenManager::didExitFullScreen):

    Canonical link: https://commits.webkit.org/274460@main

Identifier: 272448.607@safari-7618-branch
  • Loading branch information
jernoble authored and MyahCobbs committed Feb 23, 2024
1 parent 73eee08 commit 266e0b3
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ void WebFullScreenManager::didExitFullScreen()
// Ensure the element (and all its parent fullscreen elements) that just exited fullscreen are still in view:
while (!fullscreenElements.isEmpty()) {
auto element = fullscreenElements.takeLast();
element->scrollIntoView();
element->scrollIntoViewIfNotVisible(true);
}

clearElement();
Expand Down

0 comments on commit 266e0b3

Please sign in to comment.