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

Side by Side 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed. 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserv ed.
4 * 4 *
5 * This library is free software; you can redistribute it and/or 5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public 6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either 7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version. 8 * version 2 of the License, or (at your option) any later version.
9 * 9 *
10 * This library is distributed in the hope that it will be useful, 10 * This library is distributed in the hope that it will be useful,
(...skipping 20 matching lines...) Expand all
31 #include "core/html/HTMLIFrameElement.h" 31 #include "core/html/HTMLIFrameElement.h"
32 #include "core/html/HTMLVideoElement.h" 32 #include "core/html/HTMLVideoElement.h"
33 #include "core/inspector/InspectorTraceEvents.h" 33 #include "core/inspector/InspectorTraceEvents.h"
34 #include "core/layout/HitTestResult.h" 34 #include "core/layout/HitTestResult.h"
35 #include "core/layout/LayoutFlowThread.h" 35 #include "core/layout/LayoutFlowThread.h"
36 #include "core/layout/LayoutGeometryMap.h" 36 #include "core/layout/LayoutGeometryMap.h"
37 #include "core/layout/LayoutMedia.h" 37 #include "core/layout/LayoutMedia.h"
38 #include "core/layout/LayoutPart.h" 38 #include "core/layout/LayoutPart.h"
39 #include "core/layout/LayoutQuote.h" 39 #include "core/layout/LayoutQuote.h"
40 #include "core/layout/LayoutScrollbarPart.h" 40 #include "core/layout/LayoutScrollbarPart.h"
41 #include "core/layout/ViewFragmentationContext.h"
41 #include "core/layout/compositing/PaintLayerCompositor.h" 42 #include "core/layout/compositing/PaintLayerCompositor.h"
42 #include "core/page/Page.h" 43 #include "core/page/Page.h"
43 #include "core/paint/PaintLayer.h" 44 #include "core/paint/PaintLayer.h"
44 #include "core/paint/ViewPainter.h" 45 #include "core/paint/ViewPainter.h"
45 #include "core/svg/SVGDocumentExtensions.h" 46 #include "core/svg/SVGDocumentExtensions.h"
46 #include "platform/TraceEvent.h" 47 #include "platform/TraceEvent.h"
47 #include "platform/TracedValue.h" 48 #include "platform/TracedValue.h"
48 #include "platform/geometry/FloatQuad.h" 49 #include "platform/geometry/FloatQuad.h"
49 #include "platform/geometry/TransformState.h" 50 #include "platform/geometry/TransformState.h"
50 #include "platform/graphics/paint/PaintController.h" 51 #include "platform/graphics/paint/PaintController.h"
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
231 bool LayoutView::doingFullPaintInvalidation() const 232 bool LayoutView::doingFullPaintInvalidation() const
232 { 233 {
233 return m_frameView->needsFullPaintInvalidation(); 234 return m_frameView->needsFullPaintInvalidation();
234 } 235 }
235 236
236 void LayoutView::layout() 237 void LayoutView::layout()
237 { 238 {
238 if (!document().paginated()) 239 if (!document().paginated())
239 setPageLogicalHeight(0); 240 setPageLogicalHeight(0);
240 241
241 if (shouldUsePrintingLayout()) 242 if (shouldUsePrintingLayout()) {
242 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth() ; 243 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth() ;
244 // TODO(mstensho): Get rid of m_pageLogicalHeight zero check. Currently, pageProperty() in
245 // PrintContext starts printing with zero height, so we have to cope for now.
246 if (!m_fragmentationContext && m_pageLogicalHeight)
247 m_fragmentationContext = adoptPtr(new ViewFragmentationContext(*this ));
248 } else if (m_fragmentationContext) {
249 m_fragmentationContext.clear();
250 }
243 251
244 SubtreeLayoutScope layoutScope(*this); 252 SubtreeLayoutScope layoutScope(*this);
245 253
246 LayoutRect oldLayoutOverflowRect = layoutOverflowRect(); 254 LayoutRect oldLayoutOverflowRect = layoutOverflowRect();
247 255
248 // Use calcWidth/Height to get the new width/height, since this will take th e full page zoom factor into account. 256 // Use calcWidth/Height to get the new width/height, since this will take th e full page zoom factor into account.
249 bool relayoutChildren = !shouldUsePrintingLayout() && (!m_frameView 257 bool relayoutChildren = !shouldUsePrintingLayout() && (!m_frameView
250 || logicalWidth() != viewLogicalWidthForBoxSizing() 258 || logicalWidth() != viewLogicalWidthForBoxSizing()
251 || logicalHeight() != viewLogicalHeightForBoxSizing()); 259 || logicalHeight() != viewLogicalHeightForBoxSizing());
252 if (relayoutChildren) { 260 if (relayoutChildren) {
(...skipping 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
998 } 1006 }
999 1007
1000 void LayoutView::sendMediaPositionChangeNotifications(const IntRect& visibleRect ) 1008 void LayoutView::sendMediaPositionChangeNotifications(const IntRect& visibleRect )
1001 { 1009 {
1002 for (auto& media : m_mediaForPositionNotification) { 1010 for (auto& media : m_mediaForPositionNotification) {
1003 media->notifyPositionMayHaveChanged(visibleRect); 1011 media->notifyPositionMayHaveChanged(visibleRect);
1004 } 1012 }
1005 } 1013 }
1006 1014
1007 } // namespace blink 1015 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698