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

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 723f31fd3f1dc3fcdd8e30e0a33f9d8bbbf69af5..a638b88307463fd71c84d7b27e5e0e41e59783fa 100644
--- a/third_party/WebKit/Source/core/paint/BlockPainter.cpp
+++ b/third_party/WebKit/Source/core/paint/BlockPainter.cpp
@@ -160,8 +160,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);
@@ -216,7 +214,19 @@ void BlockPainter::paintCarets(const PaintInfo& paintInfo, const LayoutPoint& pa
bool BlockPainter::intersectsPaintRect(const PaintInfo& paintInfo, const LayoutPoint& paintOffset) const
{
- LayoutRect overflowRect = m_layoutBlock.visualOverflowRect();
+ LayoutRect overflowRect;
+ if (paintInfo.isPrinting() && m_layoutBlock.isAnonymousBlock() && m_layoutBlock.childrenInline()) {
chrishtr 2016/01/19 23:25:42 Last nit I promise: is childrenInline() necessary
+ // 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.
+ Vector<LayoutRect> rects;
+ m_layoutBlock.addElementVisualOverflowRects(rects, LayoutPoint());
+ overflowRect = unionRect(rects);
+ } else {
+ overflowRect = m_layoutBlock.visualOverflowRect();
+ }
+
if (m_layoutBlock.hasOverflowModel() && m_layoutBlock.usesCompositedScrolling()) {
overflowRect.unite(m_layoutBlock.layoutOverflowRect());
overflowRect.move(-m_layoutBlock.scrolledContentOffset());
« no previous file with comments | « third_party/WebKit/Source/core/page/PrintContextTest.cpp ('k') | third_party/WebKit/Source/core/paint/InlinePainter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698