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 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // For case <a href="..."><div>...</div></a>, when m_layoutBlock is the
anonymous container | 219 // For case <a href="..."><div>...</div></a>, when m_layoutBlock is the
anonymous container |
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 bool usesCompositedScrolling = m_layoutBlock.hasOverflowModel() && m_layoutB
lock.usesCompositedScrolling(); |
230 overflowRect.unite(m_layoutBlock.layoutOverflowRect()); | 230 |
| 231 if (usesCompositedScrolling) { |
| 232 LayoutRect layoutOverflowRect = m_layoutBlock.layoutOverflowRect(); |
| 233 overflowRect.unite(layoutOverflowRect); |
| 234 } |
| 235 m_layoutBlock.flipForWritingMode(overflowRect); |
| 236 |
| 237 // Scrolling is applied in physical space, which is why it is after the flip
above. |
| 238 if (usesCompositedScrolling) { |
231 overflowRect.move(-m_layoutBlock.scrolledContentOffset()); | 239 overflowRect.move(-m_layoutBlock.scrolledContentOffset()); |
232 } | 240 } |
233 m_layoutBlock.flipForWritingMode(overflowRect); | 241 |
234 overflowRect.moveBy(adjustedPaintOffset); | 242 overflowRect.moveBy(adjustedPaintOffset); |
235 return paintInfo.cullRect().intersectsCullRect(overflowRect); | 243 return paintInfo.cullRect().intersectsCullRect(overflowRect); |
236 } | 244 } |
237 | 245 |
238 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) | 246 void BlockPainter::paintContents(const PaintInfo& paintInfo, const LayoutPoint&
paintOffset) |
239 { | 247 { |
240 DCHECK(!m_layoutBlock.childrenInline()); | 248 DCHECK(!m_layoutBlock.childrenInline()); |
241 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); | 249 PaintInfo paintInfoForDescendants = paintInfo.forDescendants(); |
242 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); | 250 m_layoutBlock.paintChildren(paintInfoForDescendants, paintOffset); |
243 } | 251 } |
244 | 252 |
245 } // namespace blink | 253 } // namespace blink |
OLD | NEW |