| OLD | NEW |
| 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 209 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 220 // of <a>, the anonymous container's visual overflow is empty, but we ne
ed to continue | 220 // of <a>, the anonymous container's visual overflow is empty, but we ne
ed to continue |
| 221 // painting to output <a>'s PDF URL rect which covers the continuations,
as if we included | 221 // painting to output <a>'s PDF URL rect which covers the continuations,
as if we included |
| 222 // <a>'s PDF URL rect into m_layoutBlock's visual overflow. | 222 // <a>'s PDF URL rect into m_layoutBlock's visual overflow. |
| 223 Vector<LayoutRect> rects; | 223 Vector<LayoutRect> rects; |
| 224 m_layoutBlock.addElementVisualOverflowRects(rects, LayoutPoint()); | 224 m_layoutBlock.addElementVisualOverflowRects(rects, LayoutPoint()); |
| 225 overflowRect = unionRect(rects); | 225 overflowRect = unionRect(rects); |
| 226 } | 226 } |
| 227 overflowRect.unite(m_layoutBlock.visualOverflowRect()); | 227 overflowRect.unite(m_layoutBlock.visualOverflowRect()); |
| 228 | 228 |
| 229 if (m_layoutBlock.hasOverflowModel() && m_layoutBlock.usesCompositedScrollin
g()) { | 229 if (m_layoutBlock.hasOverflowModel() && m_layoutBlock.usesCompositedScrollin
g()) { |
| 230 overflowRect.unite(m_layoutBlock.layoutOverflowRect()); | 230 LayoutRect layoutOverflowRect = m_layoutBlock.layoutOverflowRect(); |
| 231 overflowRect.move(-m_layoutBlock.scrolledContentOffset()); | 231 m_layoutBlock.flipForWritingMode(layoutOverflowRect); |
| 232 layoutOverflowRect.move(-m_layoutBlock.scrolledContentOffset()); |
| 233 overflowRect.unite(layoutOverflowRect); |
| 232 } | 234 } |
| 233 m_layoutBlock.flipForWritingMode(overflowRect); | 235 |
| 234 overflowRect.moveBy(adjustedPaintOffset); | 236 overflowRect.moveBy(adjustedPaintOffset); |
| 235 return paintInfo.cullRect().intersectsCullRect(overflowRect); | 237 return paintInfo.cullRect().intersectsCullRect(overflowRect); |
| 236 } | 238 } |
| 237 | 239 |
| 238 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) | 240 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) |
| 239 { | 241 { |
| 240 DCHECK(!m_layoutBlock.childrenInline()); | 242 DCHECK(!m_layoutBlock.childrenInline()); |
| 241 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); | 243 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); |
| 242 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); | 244 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); |
| 243 } | 245 } |
| 244 | 246 |
| 245 } // namespace blink | 247 } // namespace blink |
| OLD | NEW |