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

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

Issue 2298193002: Fragment blocks with non-visible overflow as normally when printing. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/printing/overflow-auto-expected.html ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved. 7 * Copyright (C) 2013 Adobe Systems Incorporated. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 4247 matching lines...) Expand 10 before | Expand all | Expand 10 after
4258 return computePercentageLogicalHeight(fakeLength) != -1; 4258 return computePercentageLogicalHeight(fakeLength) != -1;
4259 } 4259 }
4260 4260
4261 bool LayoutBox::hasUnsplittableScrollingOverflow() const 4261 bool LayoutBox::hasUnsplittableScrollingOverflow() const
4262 { 4262 {
4263 // We will paginate as long as we don't scroll overflow in the pagination di rection. 4263 // We will paginate as long as we don't scroll overflow in the pagination di rection.
4264 bool isHorizontal = isHorizontalWritingMode(); 4264 bool isHorizontal = isHorizontalWritingMode();
4265 if ((isHorizontal && !scrollsOverflowY()) || (!isHorizontal && !scrollsOverf lowX())) 4265 if ((isHorizontal && !scrollsOverflowY()) || (!isHorizontal && !scrollsOverf lowX()))
4266 return false; 4266 return false;
4267 4267
4268 // Fragmenting scrollbars is only problematic in interactive media, e.g. mul ticol on a
4269 // screen. If we're printing, which is non-interactive media, we should allo w objects with
4270 // non-visible overflow to be paginated as normally.
4271 if (document().printing())
4272 return false;
4273
4268 // We do have overflow. We'll still be willing to paginate as long as the bl ock 4274 // We do have overflow. We'll still be willing to paginate as long as the bl ock
4269 // has auto logical height, auto or undefined max-logical-height and a zero or auto min-logical-height. 4275 // has auto logical height, auto or undefined max-logical-height and a zero or auto min-logical-height.
4270 // Note this is just a heuristic, and it's still possible to have overflow u nder these 4276 // Note this is just a heuristic, and it's still possible to have overflow u nder these
4271 // conditions, but it should work out to be good enough for common cases. Pa ginating overflow 4277 // conditions, but it should work out to be good enough for common cases. Pa ginating overflow
4272 // with scrollbars present is not the end of the world and is what we used t o do in the old model anyway. 4278 // with scrollbars present is not the end of the world and is what we used t o do in the old model anyway.
4273 return !style()->logicalHeight().isIntrinsicOrAuto() 4279 return !style()->logicalHeight().isIntrinsicOrAuto()
4274 || (!style()->logicalMaxHeight().isIntrinsicOrAuto() && !style()->logica lMaxHeight().isMaxSizeNone() && (!style()->logicalMaxHeight().hasPercent() || pe rcentageLogicalHeightIsResolvable())) 4280 || (!style()->logicalMaxHeight().isIntrinsicOrAuto() && !style()->logica lMaxHeight().isMaxSizeNone() && (!style()->logicalMaxHeight().hasPercent() || pe rcentageLogicalHeightIsResolvable()))
4275 || (!style()->logicalMinHeight().isIntrinsicOrAuto() && style()->logical MinHeight().isPositive() && (!style()->logicalMinHeight().hasPercent() || percen tageLogicalHeightIsResolvable())); 4281 || (!style()->logicalMinHeight().isIntrinsicOrAuto() && style()->logical MinHeight().isPositive() && (!style()->logicalMinHeight().hasPercent() || percen tageLogicalHeightIsResolvable()));
4276 } 4282 }
4277 4283
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
4862 m_rareData->m_snapAreas->remove(&snapArea); 4868 m_rareData->m_snapAreas->remove(&snapArea);
4863 } 4869 }
4864 } 4870 }
4865 4871
4866 SnapAreaSet* LayoutBox::snapAreas() const 4872 SnapAreaSet* LayoutBox::snapAreas() const
4867 { 4873 {
4868 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr; 4874 return m_rareData ? m_rareData->m_snapAreas.get() : nullptr;
4869 } 4875 }
4870 4876
4871 } // namespace blink 4877 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/printing/overflow-auto-expected.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698