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

Unified Diff: third_party/WebKit/Source/core/paint/BlockPainter.cpp

Issue 1592493002: Fix links in inline continuations in printed PDF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 side-by-side diff with in-line comments
Download patch
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());

Powered by Google App Engine
This is Rietveld 408576698