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

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutView.cpp

Issue 1510353002: PrintContext::pageProperty() shouldn't use 0 as page height. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: No need to call updateLayout() manually. PrintContext::begin() does it for us. 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 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 return m_frameView->needsFullPaintInvalidation(); 234 return m_frameView->needsFullPaintInvalidation();
235 } 235 }
236 236
237 void LayoutView::layout() 237 void LayoutView::layout()
238 { 238 {
239 if (!document().paginated()) 239 if (!document().paginated())
240 setPageLogicalHeight(0); 240 setPageLogicalHeight(0);
241 241
242 if (shouldUsePrintingLayout()) { 242 if (shouldUsePrintingLayout()) {
243 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth() ; 243 m_minPreferredLogicalWidth = m_maxPreferredLogicalWidth = logicalWidth() ;
244 // TODO(mstensho): Get rid of m_pageLogicalHeight zero check. Currently, pageProperty() in 244 if (!m_fragmentationContext)
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 )); 245 m_fragmentationContext = adoptPtr(new ViewFragmentationContext(*this ));
248 } else if (m_fragmentationContext) { 246 } else if (m_fragmentationContext) {
249 m_fragmentationContext.clear(); 247 m_fragmentationContext.clear();
250 } 248 }
251 249
252 SubtreeLayoutScope layoutScope(*this); 250 SubtreeLayoutScope layoutScope(*this);
253 251
254 LayoutRect oldLayoutOverflowRect = layoutOverflowRect(); 252 LayoutRect oldLayoutOverflowRect = layoutOverflowRect();
255 253
256 // Use calcWidth/Height to get the new width/height, since this will take th e full page zoom factor into account. 254 // Use calcWidth/Height to get the new width/height, since this will take th e full page zoom factor into account.
(...skipping 749 matching lines...) Expand 10 before | Expand all | Expand 10 after
1006 } 1004 }
1007 1005
1008 void LayoutView::sendMediaPositionChangeNotifications(const IntRect& visibleRect ) 1006 void LayoutView::sendMediaPositionChangeNotifications(const IntRect& visibleRect )
1009 { 1007 {
1010 for (auto& media : m_mediaForPositionNotification) { 1008 for (auto& media : m_mediaForPositionNotification) {
1011 media->notifyPositionMayHaveChanged(visibleRect); 1009 media->notifyPositionMayHaveChanged(visibleRect);
1012 } 1010 }
1013 } 1011 }
1014 1012
1015 } // namespace blink 1013 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698