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

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

Issue 2011863005: Fix printing issue of list item with blank first line (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: virtual/threaded/printing/list-item-with-empty-first-line.html Created 4 years, 6 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
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "core/paint/BlockPainter.h" 5 #include "core/paint/BlockPainter.h"
6 6
7 #include "core/editing/DragCaretController.h" 7 #include "core/editing/DragCaretController.h"
8 #include "core/editing/FrameSelection.h" 8 #include "core/editing/FrameSelection.h"
9 #include "core/layout/LayoutFlexibleBox.h" 9 #include "core/layout/LayoutFlexibleBox.h"
10 #include "core/layout/LayoutInline.h" 10 #include "core/layout/LayoutInline.h"
(...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 { 215 {
216 LayoutRect overflowRect; 216 LayoutRect overflowRect;
217 if (paintInfo.isPrinting() && m_layoutBlock.isAnonymousBlock() && m_layoutBl ock.childrenInline()) { 217 if (paintInfo.isPrinting() && m_layoutBlock.isAnonymousBlock() && m_layoutBl ock.childrenInline()) {
218 // For case <a href="..."><div>...</div></a>, when m_layoutBlock is the anonymous container 218 // For case <a href="..."><div>...</div></a>, when m_layoutBlock is the anonymous container
219 // of <a>, the anonymous container's visual overflow is empty, but we ne ed to continue 219 // of <a>, the anonymous container's visual overflow is empty, but we ne ed to continue
220 // painting to output <a>'s PDF URL rect which covers the continuations, as if we included 220 // painting to output <a>'s PDF URL rect which covers the continuations, as if we included
221 // <a>'s PDF URL rect into m_layoutBlock's visual overflow. 221 // <a>'s PDF URL rect into m_layoutBlock's visual overflow.
222 Vector<LayoutRect> rects; 222 Vector<LayoutRect> rects;
223 m_layoutBlock.addElementVisualOverflowRects(rects, LayoutPoint()); 223 m_layoutBlock.addElementVisualOverflowRects(rects, LayoutPoint());
224 overflowRect = unionRect(rects); 224 overflowRect = unionRect(rects);
225 } else {
226 overflowRect = m_layoutBlock.visualOverflowRect();
227 } 225 }
226 overflowRect.unite(m_layoutBlock.visualOverflowRect());
228 227
229 if (m_layoutBlock.hasOverflowModel() && m_layoutBlock.usesCompositedScrollin g()) { 228 if (m_layoutBlock.hasOverflowModel() && m_layoutBlock.usesCompositedScrollin g()) {
230 overflowRect.unite(m_layoutBlock.layoutOverflowRect()); 229 overflowRect.unite(m_layoutBlock.layoutOverflowRect());
231 overflowRect.move(-m_layoutBlock.scrolledContentOffset()); 230 overflowRect.move(-m_layoutBlock.scrolledContentOffset());
232 } 231 }
233 m_layoutBlock.flipForWritingMode(overflowRect); 232 m_layoutBlock.flipForWritingMode(overflowRect);
234 overflowRect.moveBy(adjustedPaintOffset); 233 overflowRect.moveBy(adjustedPaintOffset);
235 return paintInfo.cullRect().intersectsCullRect(overflowRect); 234 return paintInfo.cullRect().intersectsCullRect(overflowRect);
236 } 235 }
237 236
238 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) 237 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint& paintOffset)
239 { 238 {
240 DCHECK(!m_layoutBlock.childrenInline()); 239 DCHECK(!m_layoutBlock.childrenInline());
241 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); 240 PaintInfo paintInfoForDescendants = paintInfo.forDescendants();
242 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); 241 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset);
243 } 242 }
244 243
245 } // namespace blink 244 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutObject.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698