Chromium Code Reviews| Index: third_party/WebKit/Source/core/paint/BlockPainter.cpp |
| diff --git a/third_party/WebKit/Source/core/paint/BlockPainter.cpp b/third_party/WebKit/Source/core/paint/BlockPainter.cpp |
| index d1371af3162d690059078612b5b307404f7c0f2e..a8ea198bc2f758824d0e632a86a3bcfa00767e44 100644 |
| --- a/third_party/WebKit/Source/core/paint/BlockPainter.cpp |
| +++ b/third_party/WebKit/Source/core/paint/BlockPainter.cpp |
| @@ -151,8 +151,6 @@ void BlockPainter::paintObject(const PaintInfo& paintInfo, const LayoutPoint& pa |
| return; |
| } |
| - // FIXME: When Skia supports annotation rect covering (https://code.google.com/p/skia/issues/detail?id=3872), |
| - // this rect may be covered by foreground and descendant drawings. Then we may need a dedicated paint phase. |
| if (paintPhase == PaintPhaseForeground && paintInfo.isPrinting()) |
| ObjectPainter(m_layoutBlock).addPDFURLRectIfNeeded(paintInfo, paintOffset); |
| @@ -213,6 +211,16 @@ void BlockPainter::paintCarets(const PaintInfo& paintInfo, const LayoutPoint& pa |
| bool BlockPainter::intersectsPaintRect(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) const |
| { |
| LayoutRect overflowRect = m_layoutBlock.visualOverflowRect(); |
| + |
| + if (paintInfo.isPrinting() && m_layoutBlock.isAnonymousBlock() && m_layoutBlock.childrenInline()) { |
|
chrishtr
2016/01/15 18:16:35
How about:
if (paintInfo.isPrinting())
return t
Xianzhu
2016/01/15 18:36:29
During printing, we paint each page separately (ht
|
| + // For case <a href="..."><div>...</div></a>, when m_layoutBlock is the anonymous container |
| + // of <a>, the anonymous container's visual overflow is empty, but we need to continue |
| + // painting to output <a>'s PDF URL rect which covers the continuations, as if we included |
| + // <a>'s PDF URL rect into m_layoutBlock's visual overflow. For simplicity, we just check |
| + // if the parent block intersects paint rect. |
| + return BlockPainter(toLayoutBlock(*m_layoutBlock.parent())).intersectsPaintRect(paintInfo, paintOffset); |
|
Xianzhu
2016/01/19 20:25:33
Now call m_layoutBlock.addElementVisualOverflowRec
|
| + } |
| + |
| if (m_layoutBlock.hasOverflowModel() && m_layoutBlock.usesCompositedScrolling()) { |
| overflowRect.unite(m_layoutBlock.layoutOverflowRect()); |
| overflowRect.move(-m_layoutBlock.scrolledContentOffset()); |