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

Unified Diff: third_party/WebKit/Source/core/layout/LayoutView.cpp

Issue 1492143002: Add support for printing multicol containers, and enable it. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: code review Created 5 years 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/layout/LayoutView.cpp
diff --git a/third_party/WebKit/Source/core/layout/LayoutView.cpp b/third_party/WebKit/Source/core/layout/LayoutView.cpp
index 7fbda64d86f5f0f4c401489376ff2025f38420de..87c03483a421bcc65aacd97f0da39a769ec26ca6 100644
--- a/third_party/WebKit/Source/core/layout/LayoutView.cpp
+++ b/third_party/WebKit/Source/core/layout/LayoutView.cpp
@@ -38,6 +38,7 @@
#include "core/layout/LayoutPart.h"
#include "core/layout/LayoutQuote.h"
#include "core/layout/LayoutScrollbarPart.h"
+#include "core/layout/ViewFragmentationContext.h"
#include "core/layout/compositing/PaintLayerCompositor.h"
#include "core/page/Page.h"
#include "core/paint/PaintLayer.h"
@@ -238,8 +239,15 @@ void LayoutView::layout()
if (!document().paginated())
setPageLogicalHeight(0);
- if (shouldUsePrintingLayout())
+ if (shouldUsePrintingLayout()) {
m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth();
+ // TODO(mstensho): Get rid of m_pageLogicalHeight zero check. Currently, pageProperty() in
+ // PrintContext starts printing with zero height, so we have to cope for now.
+ if (!m_fragmentationContext && m_pageLogicalHeight)
+ m_fragmentationContext = adoptPtr(new ViewFragmentationContext(*this));
+ } else if (m_fragmentationContext) {
+ m_fragmentationContext.clear();
+ }
SubtreeLayoutScope layoutScope(*this);

Powered by Google App Engine
This is Rietveld 408576698