Skip to content

Commit

Permalink
Merge LocalFrameView::layoutOrVisualViewportChanged into LocalFrameVi…
Browse files Browse the repository at this point in the history
…ew::updateLayoutViewport

https://bugs.webkit.org/show_bug.cgi?id=256355

Reviewed by NOBODY (OOPS!).

Merged LocalFrameView::layoutOrVisualViewportChanged into LocalFrameView::updateLayoutViewport.

* Source/WebCore/page/LocalFrameView.cpp:
(WebCore::LocalFrameView::updateLayoutViewport):
(WebCore::LocalFrameView::layoutOrVisualViewportChanged): Deleted.
* Source/WebCore/page/LocalFrameView.h:
  • Loading branch information
rniwa committed May 5, 2023
1 parent ec43790 commit 7b1c4ea
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 21 deletions.
30 changes: 11 additions & 19 deletions Source/WebCore/page/LocalFrameView.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1827,16 +1827,20 @@ void LocalFrameView::updateLayoutViewport()
LayoutPoint newOrigin = computeLayoutViewportOrigin(visualViewportRect(), minStableLayoutViewportOrigin(), maxStableLayoutViewportOrigin(), layoutViewport, StickToDocumentBounds);
setLayoutViewportOverrideRect(LayoutRect(newOrigin, m_layoutViewportOverrideRect.value().size()));
}
layoutOrVisualViewportChanged();
return;
} else {
LayoutPoint newLayoutViewportOrigin = computeLayoutViewportOrigin(visualViewportRect(), minStableLayoutViewportOrigin(), maxStableLayoutViewportOrigin(), layoutViewport, scrollBehaviorForFixedElements());
if (newLayoutViewportOrigin != m_layoutViewportOrigin) {
setBaseLayoutViewportOrigin(newLayoutViewportOrigin);
LOG_WITH_STREAM(Scrolling, stream << "layoutViewport changed to " << layoutViewportRect());
}
}
if (m_frame->settings().visualViewportAPIEnabled()) {
if (auto* window = m_frame->window())
window->visualViewport().update();

LayoutPoint newLayoutViewportOrigin = computeLayoutViewportOrigin(visualViewportRect(), minStableLayoutViewportOrigin(), maxStableLayoutViewportOrigin(), layoutViewport, scrollBehaviorForFixedElements());
if (newLayoutViewportOrigin != m_layoutViewportOrigin) {
setBaseLayoutViewportOrigin(newLayoutViewportOrigin);
LOG_WITH_STREAM(Scrolling, stream << "layoutViewport changed to " << layoutViewportRect());
if (auto scrollingCoordinator = this->scrollingCoordinator())
scrollingCoordinator->frameViewVisualViewportChanged(*this);
}
layoutOrVisualViewportChanged();
}

LayoutPoint LocalFrameView::minStableLayoutViewportOrigin() const
Expand Down Expand Up @@ -3284,18 +3288,6 @@ void LocalFrameView::updateTiledBackingAdaptiveSizing()
tiledBacking->setScrollability(computeScrollability());
}

// FIXME: This shouldn't be called from outside; LocalFrameView should call it when the relevant viewports change.
void LocalFrameView::layoutOrVisualViewportChanged()
{
if (m_frame->settings().visualViewportAPIEnabled()) {
if (auto* window = m_frame->window())
window->visualViewport().update();

if (auto scrollingCoordinator = this->scrollingCoordinator())
scrollingCoordinator->frameViewVisualViewportChanged(*this);
}
}

void LocalFrameView::unobscuredContentSizeChanged()
{
#if PLATFORM(IOS_FAMILY)
Expand Down
2 changes: 0 additions & 2 deletions Source/WebCore/page/LocalFrameView.h
Original file line number Diff line number Diff line change
Expand Up @@ -328,8 +328,6 @@ class LocalFrameView final : public FrameView {
// offsets from rubber-banding, and it takes zooming into account.
LayoutRect viewportConstrainedVisibleContentRect() const;

WEBCORE_EXPORT void layoutOrVisualViewportChanged();

LayoutRect rectForFixedPositionLayout() const;

void viewportContentsChanged();
Expand Down

0 comments on commit 7b1c4ea

Please sign in to comment.