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

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

Issue 1448253002: Clip scrollbars to box bounds when they don't fit. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 1 month 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 // 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 // Our scrollbar widgets paint exactly when we tell them to, so that they wo rk properly with 67 // Our scrollbar widgets paint exactly when we tell them to, so that they wo rk properly with
68 // z-index. We paint after we painted the background/border, so that the scr ollbars will 68 // z-index. We paint after we painted the background/border, so that the scr ollbars will
69 // sit above the background/border. 69 // sit above the background/border.
70 paintOverflowControlsIfNeeded(localPaintInfo, adjustedPaintOffset); 70 paintOverflowControlsIfNeeded(localPaintInfo, adjustedPaintOffset);
71 } 71 }
72 72
73 void BlockPainter::paintOverflowControlsIfNeeded(const PaintInfo& paintInfo, con st LayoutPoint& paintOffset) 73 void BlockPainter::paintOverflowControlsIfNeeded(const PaintInfo& paintInfo, con st LayoutPoint& paintOffset)
74 { 74 {
75 PaintPhase phase = paintInfo.phase; 75 PaintPhase phase = paintInfo.phase;
76 if (m_layoutBlock.hasOverflowClip() && m_layoutBlock.style()->visibility() = = VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBloc kBackground) && paintInfo.shouldPaintWithinRoot(&m_layoutBlock) && !paintInfo.pa intRootBackgroundOnly()) { 76 if (m_layoutBlock.hasOverflowClip() && m_layoutBlock.style()->visibility() = = VISIBLE && (phase == PaintPhaseBlockBackground || phase == PaintPhaseChildBloc kBackground) && paintInfo.shouldPaintWithinRoot(&m_layoutBlock) && !paintInfo.pa intRootBackgroundOnly()) {
77 BoxClipper boxClipper(m_layoutBlock, paintInfo, paintOffset, ClipForScro llbars);
chrishtr 2015/11/19 17:29:52 Your use of BoxClipper is not quite right. For exa
skobes 2015/11/19 18:30:07 Done.
77 ScrollableAreaPainter(*m_layoutBlock.layer()->scrollableArea()).paintOve rflowControls(paintInfo.context, roundedIntPoint(paintOffset), paintInfo.cullRec t(), false /* paintingOverlayControls */); 78 ScrollableAreaPainter(*m_layoutBlock.layer()->scrollableArea()).paintOve rflowControls(paintInfo.context, roundedIntPoint(paintOffset), paintInfo.cullRec t(), false /* paintingOverlayControls */);
78 } 79 }
79 } 80 }
80 81
81 void BlockPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) 82 void BlockPainter::paintChildren(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
82 { 83 {
83 for (LayoutBox* child = m_layoutBlock.firstChildBox(); child; child = child- >nextSiblingBox()) 84 for (LayoutBox* child = m_layoutBlock.firstChildBox(); child; child = child- >nextSiblingBox())
84 paintChild(*child, paintInfo, paintOffset); 85 paintChild(*child, paintInfo, paintOffset);
85 } 86 }
86 87
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after
261 262
262 // We don't paint our own background, but we do let the kids paint their backgrounds. 263 // We don't paint our own background, but we do let the kids paint their backgrounds.
263 PaintInfo paintInfoForChild(paintInfo); 264 PaintInfo paintInfoForChild(paintInfo);
264 paintInfoForChild.phase = newPhase; 265 paintInfoForChild.phase = newPhase;
265 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock); 266 paintInfoForChild.updatePaintingRootForChildren(&m_layoutBlock);
266 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset); 267 m_layoutBlock.paintChildren(paintInfoForChild, paintOffset);
267 } 268 }
268 } 269 }
269 270
270 } // namespace blink 271 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698