Skip to content

Commit

Permalink
[iOS] Entering fullscreen from iframe without explicit viewport resul…
Browse files Browse the repository at this point in the history
…ts in badly cropped video

https://bugs.webkit.org/show_bug.cgi?id=270909
rdar://123725878

Reviewed by Eric Carlson.

Follow-up fix to 276138@main: resetViewportDefaultConfiguration() will not trigger viewportDidChange(),
and therefore calling those methods in that order can leave the calculated viewport in an inconsistent state.
Instead, ensure resetViewportDefaultConfiguration() is called before viewportDidChange() by calling
isInFullscreenChanged() before willEnterFullscreen().

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

Canonical link: https://commits.webkit.org/276427@main
  • Loading branch information
jernoble committed Mar 20, 2024
1 parent cc58b49 commit db57a9a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Source/WebKit/WebProcess/FullScreen/WebFullScreenManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -319,6 +319,8 @@ void WebFullScreenManager::willEnterFullScreen(WebCore::HTMLMediaElementEnums::V

ALWAYS_LOG(LOGIDENTIFIER, "<", m_element->tagName(), " id=\"", m_element->getIdAttribute(), "\">");

m_page->isInFullscreenChanged(WebPage::IsInFullscreenMode::Yes);

if (!m_element->document().fullscreenManager().willEnterFullscreen(*m_element, mode)) {
close();
return;
Expand All @@ -329,8 +331,6 @@ void WebFullScreenManager::willEnterFullScreen(WebCore::HTMLMediaElementEnums::V
return;
}

m_page->isInFullscreenChanged(WebPage::IsInFullscreenMode::Yes);

#if !PLATFORM(IOS_FAMILY)
m_page->hidePageBanners();
#endif
Expand Down

0 comments on commit db57a9a

Please sign in to comment.