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..0abb334b79287969e1b4521cee1e00556631b63c 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.previousSibling() && m_layoutBlock.childrenInline()) { |
|
chrishtr
2016/01/14 23:29:32
Why can't we always use this path? Is it really to
Xianzhu
2016/01/14 23:41:41
Do you mean use the path also for non-printing pai
chrishtr
2016/01/14 23:56:00
I mean: why can't we have the same cull rect behav
Xianzhu
2016/01/15 01:51:00
The added logic will cause unnecessary paints whic
chrishtr
2016/01/15 02:20:02
Ok. Now my question is: why are the rects broken i
Xianzhu
2016/01/15 05:06:44
The PDF clickable rects are to let the PDF viewers
|
| + // 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); |
| + } |
| + |
| if (m_layoutBlock.hasOverflowModel() && m_layoutBlock.usesCompositedScrolling()) { |
| overflowRect.unite(m_layoutBlock.layoutOverflowRect()); |
| overflowRect.move(-m_layoutBlock.scrolledContentOffset()); |