Skip to content

Commit

Permalink
WebFullScreenManager should not call forceRepaintWithoutCallback()
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=244720

Reviewed by Jer Noble.

WebFullScreenManager is the only place that forceRepaintWithoutCallback() is called outside
of testing code. It's trying to make sure that layers are updated before the fullscreen
animation runs, but we can achieve that more cleanly using m_page.callAfterNextPresentationUpdate()
on the UI-process side.

Tested manually on youtube.com on macOS and iPad.

* Source/WebKit/UIProcess/WebFullScreenManagerProxy.cpp:
(WebKit::WebFullScreenManagerProxy::beganEnterFullScreen):
* Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp:
(WebKit::WebFullScreenManager::willEnterFullScreen):

Canonical link: https://commits.webkit.org/254132@main
  • Loading branch information
smfr committed Sep 3, 2022
1 parent 1aeb332 commit e2e7f87
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 4 additions & 1 deletion Source/WebKit/UIProcess/WebFullScreenManagerProxy.cpp
Expand Up @@ -183,7 +183,10 @@ void WebFullScreenManagerProxy::exitFullScreen()

void WebFullScreenManagerProxy::beganEnterFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
{
m_client.beganEnterFullScreen(initialFrame, finalFrame);
m_page.callAfterNextPresentationUpdate([weakThis = WeakPtr { *this }, initialFrame = initialFrame, finalFrame = finalFrame](CallbackBase::Error) {
if (weakThis)
weakThis->m_client.beganEnterFullScreen(initialFrame, finalFrame);
});
}

void WebFullScreenManagerProxy::beganExitFullScreen(const IntRect& initialFrame, const IntRect& finalFrame)
Expand Down
Expand Up @@ -203,7 +203,6 @@ void WebFullScreenManager::willEnterFullScreen()
m_page->hidePageBanners();
#endif
m_element->document().updateLayout();
m_page->forceRepaintWithoutCallback();
m_finalFrame = screenRectOfContents(m_element.get());
m_page->injectedBundleFullScreenClient().beganEnterFullScreen(m_page.get(), m_initialFrame, m_finalFrame);
}
Expand Down

0 comments on commit e2e7f87

Please sign in to comment.