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

Side by Side Diff: Source/core/frame/FrameView.cpp

Issue 747903005: Pass integer scroll position to CC if frameView has non-layered viewport constrained objects (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: call updateDescendantDependentFlags() before calling hasVisibleContent() otherwise it crashes Created 6 years 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> 2 * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
3 * 1999 Lars Knoll <knoll@kde.org> 3 * 1999 Lars Knoll <knoll@kde.org>
4 * 1999 Antti Koivisto <koivisto@kde.org> 4 * 1999 Antti Koivisto <koivisto@kde.org>
5 * 2000 Dirk Mueller <mueller@kde.org> 5 * 2000 Dirk Mueller <mueller@kde.org>
6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. 6 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved.
7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com) 7 * (C) 2006 Graham Dennis (graham.dennis@gmail.com)
8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * (C) 2006 Alexey Proskuryakov (ap@nypop.com)
9 * Copyright (C) 2009 Google Inc. All rights reserved. 9 * Copyright (C) 2009 Google Inc. All rights reserved.
10 * 10 *
(...skipping 1250 matching lines...) Expand 10 before | Expand all | Expand 10 after
1261 } 1261 }
1262 1262
1263 LayoutRect FrameView::viewportConstrainedVisibleContentRect() const 1263 LayoutRect FrameView::viewportConstrainedVisibleContentRect() const
1264 { 1264 {
1265 LayoutRect viewportRect = visibleContentRect(); 1265 LayoutRect viewportRect = visibleContentRect();
1266 // Ignore overhang. No-op when not using rubber banding. 1266 // Ignore overhang. No-op when not using rubber banding.
1267 viewportRect.setLocation(clampScrollPosition(scrollPosition())); 1267 viewportRect.setLocation(clampScrollPosition(scrollPosition()));
1268 return viewportRect; 1268 return viewportRect;
1269 } 1269 }
1270 1270
1271 bool FrameView::hasVisibleViewportConstrainedObjects() const
1272 {
1273 const ViewportConstrainedObjectSet* objects = viewportConstrainedObjects();
1274 if (!objects)
1275 return false;
1276 for (const RenderObject* renderer : *objects) {
1277 RenderLayer* layer = toRenderBoxModelObject(renderer)->layer();
1278 if (layer) {
1279 layer->updateDescendantDependentFlags();
1280 if (!layer->subtreeIsInvisible())
1281 return true;
1282 }
1283 }
1284 return false;
1285 }
1286
1271 void FrameView::viewportConstrainedVisibleContentSizeChanged(bool widthChanged, bool heightChanged) 1287 void FrameView::viewportConstrainedVisibleContentSizeChanged(bool widthChanged, bool heightChanged)
1272 { 1288 {
1273 if (!hasViewportConstrainedObjects()) 1289 if (!hasViewportConstrainedObjects())
1274 return; 1290 return;
1275 1291
1276 // If viewport is not enabled, frameRect change will cause layout size chang e and then layout. 1292 // If viewport is not enabled, frameRect change will cause layout size chang e and then layout.
1277 // Otherwise, viewport constrained objects need their layout flags set separ ately to ensure 1293 // Otherwise, viewport constrained objects need their layout flags set separ ately to ensure
1278 // they are positioned correctly. In the virtual-viewport pinch mode frame r ect changes wont 1294 // they are positioned correctly. In the virtual-viewport pinch mode frame r ect changes wont
1279 // necessarily cause a layout size change so only take this early-out if we' re in old-style 1295 // necessarily cause a layout size change so only take this early-out if we' re in old-style
1280 // pinch. 1296 // pinch.
(...skipping 2681 matching lines...) Expand 10 before | Expand all | Expand 10 after
3962 return; 3978 return;
3963 3979
3964 ScrollableArea::setScrollOrigin(origin); 3980 ScrollableArea::setScrollOrigin(origin);
3965 3981
3966 // Update if the scroll origin changes, since our position will be different if the content size did not change. 3982 // Update if the scroll origin changes, since our position will be different if the content size did not change.
3967 if (updatePositionAtAll && updatePositionSynchronously) 3983 if (updatePositionAtAll && updatePositionSynchronously)
3968 updateScrollbars(scrollOffsetDouble()); 3984 updateScrollbars(scrollOffsetDouble());
3969 } 3985 }
3970 3986
3971 } // namespace blink 3987 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698