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

Side by Side Diff: Source/core/paint/BlockPainter.cpp

Issue 1332643002: Fix fixed-background offset issue (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "config.h" 5 #include "config.h"
6 #include "core/paint/BlockPainter.h" 6 #include "core/paint/BlockPainter.h"
7 7
8 #include "core/editing/DragCaretController.h" 8 #include "core/editing/DragCaretController.h"
9 #include "core/editing/FrameSelection.h" 9 #include "core/editing/FrameSelection.h"
10 #include "core/frame/Settings.h" 10 #include "core/frame/Settings.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 166
167 { 167 {
168 Optional<ScrollRecorder> scrollRecorder; 168 Optional<ScrollRecorder> scrollRecorder;
169 Optional<PaintInfo> scrolledPaintInfo; 169 Optional<PaintInfo> scrolledPaintInfo;
170 if (m_layoutBlock.hasOverflowClip()) { 170 if (m_layoutBlock.hasOverflowClip()) {
171 IntSize scrollOffset = m_layoutBlock.scrolledContentOffset(); 171 IntSize scrollOffset = m_layoutBlock.scrolledContentOffset();
172 if (m_layoutBlock.layer()->scrollsOverflow() || !scrollOffset.isZero ()) { 172 if (m_layoutBlock.layer()->scrollsOverflow() || !scrollOffset.isZero ()) {
173 scrollRecorder.emplace(*paintInfo.context, m_layoutBlock, paintP hase, scrollOffset); 173 scrollRecorder.emplace(*paintInfo.context, m_layoutBlock, paintP hase, scrollOffset);
174 scrolledPaintInfo.emplace(paintInfo); 174 scrolledPaintInfo.emplace(paintInfo);
175 scrolledPaintInfo->rect.move(scrollOffset); 175 scrolledPaintInfo->rect.move(scrollOffset);
176 scrolledPaintInfo->accumulatedScrollOffsetSincePaintContainer += scrollOffset;
176 } 177 }
177 } 178 }
178 179
179 // We're done. We don't bother painting any children. 180 // We're done. We don't bother painting any children.
180 if (paintPhase == PaintPhaseBlockBackground || paintInfo.paintRootBackgr oundOnly()) 181 if (paintPhase == PaintPhaseBlockBackground || paintInfo.paintRootBackgr oundOnly())
181 return; 182 return;
182 183
183 const PaintInfo& contentsPaintInfo = scrolledPaintInfo ? *scrolledPaintI nfo : paintInfo; 184 const PaintInfo& contentsPaintInfo = scrolledPaintInfo ? *scrolledPaintI nfo : paintInfo;
184 185
185 if (paintPhase != PaintPhaseSelfOutline) 186 if (paintPhase != PaintPhaseSelfOutline)
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after
272 273
273 // We don't paint our own background, but we do let the kids paint their backgrounds. 274 // We don't paint our own background, but we do let the kids paint their backgrounds.
274 PaintInfo paintInfoForChild(paintInfo); 275 PaintInfo paintInfoForChild(paintInfo);
275 paintInfoForChild.phase = newPhase; 276 paintInfoForChild.phase = newPhase;
276 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock); 277 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock);
277 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset); 278 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset);
278 } 279 }
279 } 280 }
280 281
281 } // namespace blink 282 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698