Skip to content

Commit

Permalink
When releasing a resize in full screen video, the video content brief…
Browse files Browse the repository at this point in the history
…ly flashes to its original size

https://bugs.webkit.org/show_bug.cgi?id=260558
rdar://113771996

Reviewed by Tim Horton.

When releasing a resize of a window on visionOS that contains a fixed-position element, the element's size
briefly becomes its original size.

In `_endLiveResize`, we create a snapshot view and put it on top of the web content. The snapshot is then
removed in the completion handler of a `doAfterNextPresentationUpdate` call.

However, by the time the transaction commit happens in the presentation update, two important
updates have yet to happen:
1. A visible content rect update
2. A geometry update

The visible content rect update needs to happen before the commit so that all the new sizes are updated.
However, `doAfterNextPresentationUpdate` does not ensure this. To fix, bundle a VCR update inside the
`UpdateGeometry` message, and then have the web page update the VCRs when receiving the message.

The geometry update of the drawing area was not happening because its size was never being set. When a
geometry uodate is deferred, `_frameOrBoundsMayHaveChanged` skips setting all the relevant new values.
Instead, all these values are (theoretically) set in `_didStopDeferringGeometryUpdates`. However,
`_didStopDeferringGeometryUpdates` was missing setting the size of the drawing area.

As a result, in `sendUpdateGeometry`, the layout size and other changes were being updated, but the
drawing area size was the old value. It then eventually does get updated on the next UIKit layout via
`frameOrBoundsMayHaveChanged`, but by that point the snapshot view has already been removed.

Fix by simply ensuring that `_didStopDeferringGeometryUpdates` also updates the drawing area size.

* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h:
* Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm:
(-[WKWebView _createVisibleRectUpdateInfo]):
(-[WKWebView _didStopDeferringGeometryUpdates]):
* Source/WebKit/UIProcess/PageClient.h:
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.h:
(WebKit::RemoteLayerTreeDrawingAreaProxy::setLastVisibleContentRectUpdate):
(WebKit::RemoteLayerTreeDrawingAreaProxy::lastVisibleContentRectUpdate const):
* Source/WebKit/UIProcess/RemoteLayerTree/RemoteLayerTreeDrawingAreaProxy.mm:
(WebKit::RemoteLayerTreeDrawingAreaProxy::sendUpdateGeometry):
* Source/WebKit/UIProcess/ios/PageClientImplIOS.h:
* Source/WebKit/UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::createVisibleRectUpdateInfo):
* Source/WebKit/UIProcess/ios/WKContentView.h:
* Source/WebKit/UIProcess/ios/WKContentView.mm:
(-[WKContentView createVisibleRectUpdateInfoFromVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:viewStability:enclosedInScrollableAncestorView:sendEvenIfUnchanged:]):
(-[WKContentView didUpdateVisibleRect:unobscuredRect:contentInsets:unobscuredRectInScrollViewCoordinates:obscuredInsets:unobscuredSafeAreaInsets:inputViewBounds:scale:minimumScale:viewStability:enclosedInScrollableAncestorView:sendEvenIfUnchanged:]):
* Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm:
* Source/WebKit/WebProcess/WebPage/DrawingArea.h:
* Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.h:
* Source/WebKit/WebProcess/WebPage/RemoteLayerTree/RemoteLayerTreeDrawingArea.mm:
(WebKit::RemoteLayerTreeDrawingArea::updateGeometry):

Canonical link: https://commits.webkit.org/267652@main
  • Loading branch information
rr-codes committed Sep 5, 2023
1 parent 362ae6d commit 0de5d9c
Show file tree
Hide file tree
Showing 17 changed files with 130 additions and 25 deletions.
5 changes: 5 additions & 0 deletions Source/WebKit/UIProcess/API/ios/WKWebViewIOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,10 @@ namespace WebKit {
enum class TapHandlingResult : uint8_t;
}

namespace WebKit {
class VisibleContentRectUpdateInfo;
}

@interface WKWebView (WKViewInternalIOS)

- (void)_setupScrollAndContentViews;
Expand Down Expand Up @@ -94,6 +98,7 @@ enum class TapHandlingResult : uint8_t;
- (void)_willInvokeUIScrollViewDelegateCallback;
- (void)_didInvokeUIScrollViewDelegateCallback;

- (std::optional<WebKit::VisibleContentRectUpdateInfo>)_createVisibleContentRectUpdateInfo;
- (void)_scheduleVisibleContentRectUpdate;
- (void)_scheduleForcedVisibleContentRectUpdate;

Expand Down
58 changes: 50 additions & 8 deletions Source/WebKit/UIProcess/API/ios/WKWebViewIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -2255,6 +2255,18 @@ - (void)_frameOrBoundsWillChange
#endif
}

- (void)_updateDrawingAreaSize
{
BOOL sizeChanged = NO;
if (_page) {
if (auto drawingArea = _page->drawingArea())
sizeChanged = drawingArea->setSize(WebCore::IntSize(self.bounds.size));
}

if (sizeChanged && [self usesStandardContentView])
[_contentView setSizeChangedSinceLastVisibleContentRectUpdate:YES];
}

- (void)_frameOrBoundsMayHaveChanged
{
CGRect bounds = self.bounds;
Expand All @@ -2276,14 +2288,7 @@ - (void)_frameOrBoundsMayHaveChanged
_page->setDefaultUnobscuredSize(WebCore::FloatSize(bounds.size));
[self _recalculateViewportSizesWithMinimumViewportInset:_minimumViewportInset maximumViewportInset:_maximumViewportInset throwOnInvalidInput:NO];

BOOL sizeChanged = NO;
if (_page) {
if (auto drawingArea = _page->drawingArea())
sizeChanged = drawingArea->setSize(WebCore::IntSize(bounds.size));
}

if (sizeChanged & [self usesStandardContentView])
[_contentView setSizeChangedSinceLastVisibleContentRectUpdate:YES];
[self _updateDrawingAreaSize];
}

[_customContentView web_setMinimumSize:bounds.size];
Expand Down Expand Up @@ -2539,6 +2544,38 @@ - (BOOL)_shouldDeferGeometryUpdates
return _perProcessState.liveResizeParameters || _perProcessState.dynamicViewportUpdateMode != WebKit::DynamicViewportUpdateMode::NotResizing;
}

- (std::optional<WebKit::VisibleContentRectUpdateInfo>)_createVisibleContentRectUpdateInfo
{
auto viewStability = _viewStabilityWhenVisibleContentRectUpdateScheduled;

CGRect visibleRectInContentCoordinates = [self _visibleContentRect];

UIEdgeInsets computedContentInsetUnadjustedForKeyboard = [self _computedObscuredInset];
if (!_haveSetObscuredInsets)
computedContentInsetUnadjustedForKeyboard.bottom -= _totalScrollViewBottomInsetAdjustmentForKeyboard;

CGFloat scaleFactor = contentZoomScale(self);
CGRect unobscuredRect = UIEdgeInsetsInsetRect(self.bounds, computedContentInsetUnadjustedForKeyboard);
WebCore::FloatRect unobscuredRectInContentCoordinates = WebCore::FloatRect(_perProcessState.frozenUnobscuredContentRect ? _perProcessState.frozenUnobscuredContentRect.value() : [self convertRect:unobscuredRect toView:_contentView.get()]);
if (![_contentView sizeChangedSinceLastVisibleContentRectUpdate])
unobscuredRectInContentCoordinates.intersect([self _contentBoundsExtendedForRubberbandingWithScale:scaleFactor]);

auto contentInsets = [self currentlyVisibleContentInsetsWithScale:scaleFactor obscuredInsets:computedContentInsetUnadjustedForKeyboard];

return [_contentView createVisibleContentRectUpdateInfoFromVisibleRect:visibleRectInContentCoordinates
unobscuredRect:unobscuredRectInContentCoordinates
contentInsets:contentInsets
unobscuredRectInScrollViewCoordinates:unobscuredRect
obscuredInsets:_obscuredInsets
unobscuredSafeAreaInsets:[self _computedUnobscuredSafeAreaInset]
inputViewBounds:_inputViewBoundsInWindow
scale:scaleFactor
minimumScale:[_scrollView minimumZoomScale]
viewStability:viewStability
enclosedInScrollableAncestorView:scrollViewCanScroll([self _scroller])
sendEvenIfUnchanged:_alwaysSendNextVisibleContentRectUpdate];
}

- (void)_updateVisibleContentRects
{
auto viewStability = _viewStabilityWhenVisibleContentRectUpdateScheduled;
Expand Down Expand Up @@ -2768,6 +2805,9 @@ - (void)_didStopDeferringGeometryUpdates
{
[self _scheduleVisibleContentRectUpdate];

// This should do at least all the things that had been skipped in `-[WKWebView _frameOrBoundsMayHaveChanged]`,
// since geometry updates were deferred then.

CGRect newBounds = self.bounds;
auto newViewLayoutSize = [self activeViewLayoutSize:newBounds];
auto newMinimumUnobscuredSize = activeMinimumUnobscuredSize(self, newBounds);
Expand All @@ -2789,6 +2829,8 @@ - (void)_didStopDeferringGeometryUpdates
if (!_perProcessState.lastSentDeviceOrientation || newOrientation != _perProcessState.lastSentDeviceOrientation.value())
[self _dispatchSetDeviceOrientation:newOrientation];

[self _updateDrawingAreaSize];

while (!_callbacksDeferredDuringResize.isEmpty())
_callbacksDeferredDuringResize.takeLast()();
}
Expand Down
5 changes: 5 additions & 0 deletions Source/WebKit/UIProcess/PageClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
#include "PasteboardAccessIntent.h"
#include "SameDocumentNavigationType.h"
#include "ShareableBitmap.h"
#include "VisibleContentRectUpdateInfo.h"
#include "WebColorPicker.h"
#include "WebDateTimePicker.h"
#include "WebPopupMenuProxy.h"
Expand Down Expand Up @@ -679,6 +680,10 @@ class PageClient : public CanMakeWeakPtr<PageClient> {
virtual void didExitFullscreen() = 0;
#endif

#if PLATFORM(IOS_FAMILY)
virtual std::optional<WebKit::VisibleContentRectUpdateInfo> createVisibleContentRectUpdateInfo() = 0;
#endif

#if PLATFORM(GTK) || PLATFORM(WPE)
virtual WebKitWebResourceLoadManager* webResourceLoadManager() = 0;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class RemoteLayerTreeDrawingAreaProxy : public DrawingAreaProxy {

// For testing.
unsigned countOfTransactionsWithNonEmptyLayerChanges() const { return m_countOfTransactionsWithNonEmptyLayerChanges; }

protected:
void updateDebugIndicatorPosition();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
#import "LayerProperties.h"
#import "Logging.h"
#import "MessageSenderInlines.h"
#import "PageClient.h"
#import "RemoteLayerTreeDrawingAreaProxyMessages.h"
#import "RemotePageDrawingAreaProxy.h"
#import "RemotePageProxy.h"
Expand Down Expand Up @@ -142,7 +143,13 @@
m_lastSentSizeToContentAutoSizeMaximumSize = m_webPageProxy.sizeToContentAutoSizeMaximumSize();
m_lastSentSize = m_size;
m_isWaitingForDidUpdateGeometry = true;
m_webPageProxy.sendWithAsyncReply(Messages::DrawingArea::UpdateGeometry(m_size, false /* flushSynchronously */, MachSendRight()), [weakThis = WeakPtr { this }] {

std::optional<VisibleContentRectUpdateInfo> visibleRectUpdateInfo;
#if PLATFORM(IOS_FAMILY)
visibleRectUpdateInfo = m_webPageProxy.pageClient().createVisibleContentRectUpdateInfo();
#endif

m_webPageProxy.sendWithAsyncReply(Messages::DrawingArea::UpdateGeometry(m_size, visibleRectUpdateInfo, false /* flushSynchronously */, MachSendRight()), [weakThis = WeakPtr { this }] {
if (!weakThis)
return;
weakThis->didUpdateGeometry();
Expand Down
2 changes: 2 additions & 0 deletions Source/WebKit/UIProcess/ios/PageClientImplIOS.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,8 @@ class PageClientImpl final : public PageClientImplCocoa
void didExitFullscreen() final;
#endif

std::optional<WebKit::VisibleContentRectUpdateInfo> createVisibleContentRectUpdateInfo() override;

RetainPtr<WKContentView> contentView() const { return m_contentView.get(); }

WeakObjCPtr<WKContentView> m_contentView;
Expand Down
5 changes: 5 additions & 0 deletions Source/WebKit/UIProcess/ios/PageClientImplIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -886,6 +886,11 @@ static UIInterfaceOrientationMask toUIInterfaceOrientationMask(WebCore::ScreenOr
[webView() _didFailNavigation:navigation];
}

std::optional<WebKit::VisibleContentRectUpdateInfo> PageClientImpl::createVisibleContentRectUpdateInfo()
{
return [webView() _createVisibleContentRectUpdateInfo];
}

void PageClientImpl::didSameDocumentNavigationForMainFrame(SameDocumentNavigationType navigationType)
{
[webView() _didSameDocumentNavigationForMainFrame:navigationType];
Expand Down
13 changes: 13 additions & 0 deletions Source/WebKit/UIProcess/ios/WKContentView.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ class FloatRect;
namespace WebKit {
class DrawingAreaProxy;
class RemoteLayerTreeTransaction;
class VisibleContentRectUpdateInfo;
class WebFrameProxy;
class WebPageProxy;
class WebProcessProxy;
Expand Down Expand Up @@ -73,6 +74,18 @@ ALLOW_DEPRECATED_DECLARATIONS_END

- (instancetype)initWithFrame:(CGRect)frame processPool:(NakedRef<WebKit::WebProcessPool>)processPool configuration:(Ref<API::PageConfiguration>&&)configuration webView:(WKWebView *)webView;

- (std::optional<WebKit::VisibleContentRectUpdateInfo>)createVisibleContentRectUpdateInfoFromVisibleRect:(CGRect)visibleContentRect
unobscuredRect:(CGRect)unobscuredContentRect
contentInsets:(UIEdgeInsets)contentInsets
unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
obscuredInsets:(UIEdgeInsets)obscuredInsets
unobscuredSafeAreaInsets:(UIEdgeInsets)unobscuredSafeAreaInsets
inputViewBounds:(CGRect)inputViewBounds
scale:(CGFloat)zoomScale minimumScale:(CGFloat)minimumScale
viewStability:(OptionSet<WebKit::ViewStabilityFlag>)viewStability
enclosedInScrollableAncestorView:(BOOL)enclosedInScrollableAncestorView
sendEvenIfUnchanged:(BOOL)sendEvenIfUnchanged;

- (void)didUpdateVisibleRect:(CGRect)visibleRect
unobscuredRect:(CGRect)unobscuredRect
contentInsets:(UIEdgeInsets)contentInsets
Expand Down
37 changes: 29 additions & 8 deletions Source/WebKit/UIProcess/ios/WKContentView.mm
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ - (CGRect)_computeUnobscuredContentRectRespectingInputViewBounds:(CGRect)unobscu
return unobscuredContentRect;
}

- (void)didUpdateVisibleRect:(CGRect)visibleContentRect
- (std::optional<WebKit::VisibleContentRectUpdateInfo>)createVisibleContentRectUpdateInfoFromVisibleRect:(CGRect)visibleContentRect
unobscuredRect:(CGRect)unobscuredContentRect
contentInsets:(UIEdgeInsets)contentInsets
unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
Expand All @@ -529,7 +529,7 @@ - (void)didUpdateVisibleRect:(CGRect)visibleContentRect
{
auto drawingArea = _page->drawingArea();
if (!drawingArea)
return;
return std::nullopt;

MonotonicTime timestamp = MonotonicTime::now();
WebCore::VelocityData velocityData;
Expand All @@ -544,7 +544,7 @@ - (void)didUpdateVisibleRect:(CGRect)visibleContentRect
CGRect unobscuredContentRectRespectingInputViewBounds = [self _computeUnobscuredContentRectRespectingInputViewBounds:unobscuredContentRect inputViewBounds:inputViewBounds];
WebCore::FloatRect fixedPositionRectForLayout = _page->computeLayoutViewportRect(unobscuredContentRect, unobscuredContentRectRespectingInputViewBounds, _page->layoutViewportRect(), zoomScale, WebCore::LayoutViewportConstraint::ConstrainedToDocumentRect);

WebKit::VisibleContentRectUpdateInfo visibleContentRectUpdateInfo(
return WebKit::VisibleContentRectUpdateInfo {
visibleContentRect,
unobscuredContentRect,
floatBoxExtent(contentInsets),
Expand All @@ -559,21 +559,42 @@ - (void)didUpdateVisibleRect:(CGRect)visibleContentRect
self.webView._allowsViewportShrinkToFit,
enclosedInScrollableAncestorView,
velocityData,
downcast<WebKit::RemoteLayerTreeDrawingAreaProxy>(*drawingArea).lastCommittedLayerTreeTransactionID());
downcast<WebKit::RemoteLayerTreeDrawingAreaProxy>(*drawingArea).lastCommittedLayerTreeTransactionID()
};
}

- (void)didUpdateVisibleRect:(CGRect)visibleContentRect
unobscuredRect:(CGRect)unobscuredContentRect
contentInsets:(UIEdgeInsets)contentInsets
unobscuredRectInScrollViewCoordinates:(CGRect)unobscuredRectInScrollViewCoordinates
obscuredInsets:(UIEdgeInsets)obscuredInsets
unobscuredSafeAreaInsets:(UIEdgeInsets)unobscuredSafeAreaInsets
inputViewBounds:(CGRect)inputViewBounds
scale:(CGFloat)zoomScale minimumScale:(CGFloat)minimumScale
viewStability:(OptionSet<WebKit::ViewStabilityFlag>)viewStability
enclosedInScrollableAncestorView:(BOOL)enclosedInScrollableAncestorView
sendEvenIfUnchanged:(BOOL)sendEvenIfUnchanged
{
auto visibleContentRectUpdateInfo = [self createVisibleContentRectUpdateInfoFromVisibleRect:visibleContentRect unobscuredRect:unobscuredContentRect contentInsets:contentInsets unobscuredRectInScrollViewCoordinates:unobscuredRectInScrollViewCoordinates obscuredInsets:obscuredInsets unobscuredSafeAreaInsets:unobscuredSafeAreaInsets inputViewBounds:inputViewBounds scale:zoomScale minimumScale:minimumScale viewStability:viewStability enclosedInScrollableAncestorView:enclosedInScrollableAncestorView sendEvenIfUnchanged:sendEvenIfUnchanged];

LOG_WITH_STREAM(VisibleRects, stream << "-[WKContentView didUpdateVisibleRect]" << visibleContentRectUpdateInfo.dump());
if (!visibleContentRectUpdateInfo)
return;

bool inStableState = viewStability.isEmpty();

LOG_WITH_STREAM(VisibleRects, stream << "-[WKContentView didUpdateVisibleRect]" << visibleContentRectUpdateInfo->dump());

bool wasStableState = _page->inStableState();

_page->updateVisibleContentRects(visibleContentRectUpdateInfo, sendEvenIfUnchanged);
_page->updateVisibleContentRects(*visibleContentRectUpdateInfo, sendEvenIfUnchanged);

auto layoutViewport = _page->unconstrainedLayoutViewportRect();
_page->adjustLayersForLayoutViewport(_page->unobscuredContentRect().location(), layoutViewport, _page->displayedContentScale());

_sizeChangedSinceLastVisibleContentRectUpdate = NO;

drawingArea->updateDebugIndicator();
_page->drawingArea()->updateDebugIndicator();

[self updateFixedClippingView:layoutViewport];

if (wasStableState && !inStableState)
Expand Down
1 change: 1 addition & 0 deletions Source/WebKit/UIProcess/ios/WebPageProxyIOS.mm
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@
#import "PaymentAuthorizationViewController.h"
#import "PrintInfo.h"
#import "ProvisionalPageProxy.h"
#import "RemoteLayerTreeDrawingAreaProxy.h"
#import "RemoteLayerTreeHost.h"
#import "RemoteLayerTreeNode.h"
#import "RemoteLayerTreeTransaction.h"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
ASSERT(!m_isWaitingForDidUpdateGeometry);

willSendUpdateGeometry();
m_webPageProxy.sendWithAsyncReply(Messages::DrawingArea::UpdateGeometry(m_size, true /* flushSynchronously */, createFence()), [weakThis = WeakPtr { *this }] {
m_webPageProxy.sendWithAsyncReply(Messages::DrawingArea::UpdateGeometry(m_size, std::nullopt, true /* flushSynchronously */, createFence()), [weakThis = WeakPtr { *this }] {
if (!weakThis)
return;
weakThis->didUpdateGeometry();
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/WebProcess/WebPage/DrawingArea.h
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ class DrawingArea : public IPC::MessageReceiver, public WebCore::DisplayRefreshM
virtual bool addMilestonesToDispatch(OptionSet<WebCore::LayoutMilestone>) { return false; }

#if PLATFORM(COCOA)
virtual void updateGeometry(const WebCore::IntSize& viewSize, bool flushSynchronously, const WTF::MachSendRight& fencePort, CompletionHandler<void()>&&) = 0;
virtual void updateGeometry(const WebCore::IntSize& viewSize, const std::optional<VisibleContentRectUpdateInfo>&, bool flushSynchronously, const WTF::MachSendRight& fencePort, CompletionHandler<void()>&&) = 0;
#endif

#if USE(GRAPHICS_LAYER_WC)
Expand Down
2 changes: 1 addition & 1 deletion Source/WebKit/WebProcess/WebPage/DrawingArea.messages.in
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ messages -> DrawingArea NotRefCounted {
DisplayDidRefresh()

#if PLATFORM(COCOA)
UpdateGeometry(WebCore::IntSize viewSize, bool flushSynchronously, MachSendRight fencePort) -> ()
UpdateGeometry(WebCore::IntSize viewSize, std::optional<WebKit::VisibleContentRectUpdateInfo> info, bool flushSynchronously, MachSendRight fencePort) -> ()
SetDeviceScaleFactor(float deviceScaleFactor)
SetColorSpace(struct std::optional<WebCore::DestinationColorSpace> colorSpace)
SetViewExposedRect(std::optional<WebCore::FloatRect> viewExposedRect)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class RemoteLayerTreeDrawingArea : public DrawingArea, public WebCore::GraphicsL
void setNeedsDisplay() override;
void setNeedsDisplayInRect(const WebCore::IntRect&) override;
void scroll(const WebCore::IntRect& scrollRect, const WebCore::IntSize& scrollDelta) override;
void updateGeometry(const WebCore::IntSize& viewSize, bool flushSynchronously, const WTF::MachSendRight& fencePort, CompletionHandler<void()>&&) override;
void updateGeometry(const WebCore::IntSize& viewSize, const std::optional<VisibleContentRectUpdateInfo>&, bool flushSynchronously, const WTF::MachSendRight& fencePort, CompletionHandler<void()>&&) override;

WebCore::GraphicsLayerFactory* graphicsLayerFactory() override;
void setRootCompositingLayer(WebCore::Frame&, WebCore::GraphicsLayer*) override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,16 @@
scheduleRenderingUpdate(ScheduleRenderingUrgency::AsSoonAsPossible);
}

void RemoteLayerTreeDrawingArea::updateGeometry(const IntSize& viewSize, bool flushSynchronously, const WTF::MachSendRight&, CompletionHandler<void()>&& completionHandler)
void RemoteLayerTreeDrawingArea::updateGeometry(const IntSize& viewSize, const std::optional<VisibleContentRectUpdateInfo>& info, bool flushSynchronously, const WTF::MachSendRight&, CompletionHandler<void()>&& completionHandler)
{
IntSize size = viewSize;
IntSize contentSize = IntSize(-1, -1);

Ref webPage = m_webPage.get();

if (info)
webPage->updateVisibleContentRects(*info, info->timestamp());

if (!webPage->minimumSizeForAutoLayout().width() || webPage->autoSizingShouldExpandToViewHeight() || (!webPage->sizeToContentAutoSizeMaximumSize().width() && !webPage->sizeToContentAutoSizeMaximumSize().height()))
webPage->setSize(size);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class TiledCoreAnimationDrawingArea final : public DrawingArea {
void didCompleteRenderingUpdateDisplay() override;

// Message handlers.
void updateGeometry(const WebCore::IntSize& viewSize, bool flushSynchronously, const WTF::MachSendRight& fencePort, CompletionHandler<void()>&&) override;
void updateGeometry(const WebCore::IntSize& viewSize, const std::optional<VisibleContentRectUpdateInfo>&, bool flushSynchronously, const WTF::MachSendRight& fencePort, CompletionHandler<void()>&&) override;
void setDeviceScaleFactor(float) override;
void suspendPainting();
void resumePainting();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -506,7 +506,7 @@
ASSERT_NOT_REACHED();
}

void TiledCoreAnimationDrawingArea::updateGeometry(const IntSize& viewSize, bool flushSynchronously, const WTF::MachSendRight& fencePort, CompletionHandler<void()>&& completionHandler)
void TiledCoreAnimationDrawingArea::updateGeometry(const IntSize& viewSize, const std::optional<VisibleContentRectUpdateInfo>&, bool flushSynchronously, const WTF::MachSendRight& fencePort, CompletionHandler<void()>&& completionHandler)
{
m_inUpdateGeometry = true;

Expand Down

0 comments on commit 0de5d9c

Please sign in to comment.