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

Side by Side Diff: third_party/WebKit/Source/core/layout/compositing/CompositedLayerMapping.cpp

Issue 2499853002: Fixed clip resize for document.rootScroller with inertTopControls (Closed)
Patch Set: Fixed typo Created 4 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) 2009, 2010, 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2009, 2010, 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
45 #include "core/layout/LayoutPart.h" 45 #include "core/layout/LayoutPart.h"
46 #include "core/layout/LayoutVideo.h" 46 #include "core/layout/LayoutVideo.h"
47 #include "core/layout/LayoutView.h" 47 #include "core/layout/LayoutView.h"
48 #include "core/layout/api/LayoutAPIShim.h" 48 #include "core/layout/api/LayoutAPIShim.h"
49 #include "core/layout/api/LayoutPartItem.h" 49 #include "core/layout/api/LayoutPartItem.h"
50 #include "core/layout/compositing/PaintLayerCompositor.h" 50 #include "core/layout/compositing/PaintLayerCompositor.h"
51 #include "core/page/ChromeClient.h" 51 #include "core/page/ChromeClient.h"
52 #include "core/page/Page.h" 52 #include "core/page/Page.h"
53 #include "core/page/scrolling/ScrollingCoordinator.h" 53 #include "core/page/scrolling/ScrollingCoordinator.h"
54 #include "core/page/scrolling/StickyPositionScrollingConstraints.h" 54 #include "core/page/scrolling/StickyPositionScrollingConstraints.h"
55 #include "core/page/scrolling/TopDocumentRootScrollerController.h"
55 #include "core/paint/ObjectPaintInvalidator.h" 56 #include "core/paint/ObjectPaintInvalidator.h"
56 #include "core/paint/PaintInfo.h" 57 #include "core/paint/PaintInfo.h"
57 #include "core/paint/PaintLayerPainter.h" 58 #include "core/paint/PaintLayerPainter.h"
58 #include "core/paint/PaintLayerStackingNodeIterator.h" 59 #include "core/paint/PaintLayerStackingNodeIterator.h"
59 #include "core/paint/PaintTiming.h" 60 #include "core/paint/PaintTiming.h"
60 #include "core/paint/ScrollableAreaPainter.h" 61 #include "core/paint/ScrollableAreaPainter.h"
61 #include "core/paint/TransformRecorder.h" 62 #include "core/paint/TransformRecorder.h"
62 #include "core/plugins/PluginView.h" 63 #include "core/plugins/PluginView.h"
63 #include "platform/LengthFunctions.h" 64 #include "platform/LengthFunctions.h"
64 #include "platform/RuntimeEnabledFeatures.h" 65 #include "platform/RuntimeEnabledFeatures.h"
(...skipping 1187 matching lines...) Expand 10 before | Expand all | Expand 10 after
1252 1253
1253 void CompositedLayerMapping::updateScrollingLayerGeometry( 1254 void CompositedLayerMapping::updateScrollingLayerGeometry(
1254 const IntRect& localCompositingBounds) { 1255 const IntRect& localCompositingBounds) {
1255 if (!m_scrollingLayer) 1256 if (!m_scrollingLayer)
1256 return; 1257 return;
1257 1258
1258 ASSERT(m_scrollingContentsLayer); 1259 ASSERT(m_scrollingContentsLayer);
1259 LayoutBox* layoutBox = toLayoutBox(layoutObject()); 1260 LayoutBox* layoutBox = toLayoutBox(layoutObject());
1260 IntRect overflowClipRect = 1261 IntRect overflowClipRect =
1261 pixelSnappedIntRect(layoutBox->overflowClipRect(LayoutPoint())); 1262 pixelSnappedIntRect(layoutBox->overflowClipRect(LayoutPoint()));
1263
1264 const TopDocumentRootScrollerController& globalRootScrollerController =
1265 layoutBox->document().frameHost()->globalRootScrollerController();
1266
1267 if (&m_owningLayer == globalRootScrollerController.rootScrollerPaintLayer()) {
1268 LayoutRect clipRect =
1269 layoutBox->document().layoutView()->overflowClipRect(LayoutPoint());
1270 DCHECK(clipRect.size() == LayoutSize(pixelSnappedIntRect(clipRect).size()));
1271 overflowClipRect.setSize(pixelSnappedIntRect(clipRect).size());
1272 }
1273
1262 FloatPoint scrollPosition = 1274 FloatPoint scrollPosition =
1263 m_owningLayer.getScrollableArea()->scrollPosition(); 1275 m_owningLayer.getScrollableArea()->scrollPosition();
1264 m_scrollingLayer->setPosition(FloatPoint( 1276 m_scrollingLayer->setPosition(FloatPoint(
1265 overflowClipRect.location() - localCompositingBounds.location() + 1277 overflowClipRect.location() - localCompositingBounds.location() +
1266 roundedIntSize(m_owningLayer.subpixelAccumulation()))); 1278 roundedIntSize(m_owningLayer.subpixelAccumulation())));
1267 m_scrollingLayer->setSize(FloatSize(overflowClipRect.size())); 1279 m_scrollingLayer->setSize(FloatSize(overflowClipRect.size()));
1268 1280
1269 IntSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromLayoutObject(); 1281 IntSize oldScrollingLayerOffset = m_scrollingLayer->offsetFromLayoutObject();
1270 m_scrollingLayer->setOffsetFromLayoutObject( 1282 m_scrollingLayer->setOffsetFromLayoutObject(
1271 -toIntSize(overflowClipRect.location())); 1283 -toIntSize(overflowClipRect.location()));
(...skipping 2061 matching lines...) Expand 10 before | Expand all | Expand 10 after
3333 } else if (graphicsLayer == m_decorationOutlineLayer.get()) { 3345 } else if (graphicsLayer == m_decorationOutlineLayer.get()) {
3334 name = "Decoration Layer"; 3346 name = "Decoration Layer";
3335 } else { 3347 } else {
3336 ASSERT_NOT_REACHED(); 3348 ASSERT_NOT_REACHED();
3337 } 3349 }
3338 3350
3339 return name; 3351 return name;
3340 } 3352 }
3341 3353
3342 } // namespace blink 3354 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698