Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(104)

Unified Diff: third_party/WebKit/Source/core/frame/FrameView.cpp

Issue 2812523003: Update layer position on scroll origin change (Closed)
Patch Set: Add Test Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/frame/FrameView.cpp
diff --git a/third_party/WebKit/Source/core/frame/FrameView.cpp b/third_party/WebKit/Source/core/frame/FrameView.cpp
index f38a80e5fa6048784cd43d080aa45094efbfdb5a..e51cafef27f6a253ead7fe7326f2b9f3a2d846cb 100644
--- a/third_party/WebKit/Source/core/frame/FrameView.cpp
+++ b/third_party/WebKit/Source/core/frame/FrameView.cpp
@@ -739,7 +739,7 @@ void FrameView::AdjustViewSize() {
const IntPoint origin(-rect.X(), -rect.Y());
if (ScrollOrigin() != origin) {
- ScrollableArea::SetScrollOrigin(origin);
+ SetScrollOrigin(origin);
// setContentSize (below) also calls updateScrollbars so we can avoid
// updating scrollbars twice by skipping the call here when the content
// size does not change.
@@ -4347,10 +4347,8 @@ void FrameView::UpdateScrollbars() {
void FrameView::AdjustScrollOffsetFromUpdateScrollbars() {
ScrollOffset clamped = ClampScrollOffset(GetScrollOffset());
- if (clamped != GetScrollOffset() || ScrollOriginChanged()) {
- ScrollableArea::SetScrollOffset(clamped, kClampingScroll);
- ResetScrollOriginChanged();
- }
+ if (clamped != GetScrollOffset() || ScrollOriginChanged())
+ SetScrollOffset(clamped, kClampingScroll);
}
void FrameView::ScrollContentsIfNeeded() {
@@ -4533,6 +4531,18 @@ void FrameView::PositionScrollbarLayers() {
PositionScrollCornerLayer(LayerForScrollCorner(), ScrollCornerRect());
}
+bool FrameView::UpdateAfterCompositingChange() {
+ if (ScrollOriginChanged()) {
+ // If the scroll origin changed, we need to update the layer position on
+ // the compositor since the offset itself might not have changed.
+ LayoutViewItem layout_view_item = this->GetLayoutViewItem();
+ if (!layout_view_item.IsNull() && layout_view_item.UsesCompositing())
+ layout_view_item.Compositor()->FrameViewDidScroll();
+ ResetScrollOriginChanged();
+ }
+ return false;
+}
+
bool FrameView::UserInputScrollable(ScrollbarOrientation orientation) const {
Document* document = GetFrame().GetDocument();
Element* fullscreen_element = Fullscreen::FullscreenElementFrom(*document);

Powered by Google App Engine
This is Rietveld 408576698