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

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

Issue 1602773005: Respect break-inside:avoid on table rows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updated Created 4 years, 8 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1997 Martin Jones (mjones@kde.org) 2 * Copyright (C) 1997 Martin Jones (mjones@kde.org)
3 * (C) 1997 Torben Weis (weis@kde.org) 3 * (C) 1997 Torben Weis (weis@kde.org)
4 * (C) 1998 Waldo Bastian (bastian@kde.org) 4 * (C) 1998 Waldo Bastian (bastian@kde.org)
5 * (C) 1999 Lars Knoll (knoll@kde.org) 5 * (C) 1999 Lars Knoll (knoll@kde.org)
6 * (C) 1999 Antti Koivisto (koivisto@kde.org) 6 * (C) 1999 Antti Koivisto (koivisto@kde.org)
7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. 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 981 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 992
993 bool LayoutTableCell::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localR ect) const 993 bool LayoutTableCell::backgroundIsKnownToBeOpaqueInRect(const LayoutRect& localR ect) const
994 { 994 {
995 // If this object has layer, the area of collapsed borders should be transpa rent 995 // If this object has layer, the area of collapsed borders should be transpa rent
996 // to expose the collapsed borders painted on the underlying layer. 996 // to expose the collapsed borders painted on the underlying layer.
997 if (hasLayer() && table()->collapseBorders()) 997 if (hasLayer() && table()->collapseBorders())
998 return false; 998 return false;
999 return LayoutBlockFlow::backgroundIsKnownToBeOpaqueInRect(localRect); 999 return LayoutBlockFlow::backgroundIsKnownToBeOpaqueInRect(localRect);
1000 } 1000 }
1001 1001
1002 LayoutUnit LayoutTableCell::calculatePaginationStrutToFitContent(LayoutUnit offs et, LayoutUnit strutToNextPage, LayoutUnit contentLogicalHeight) const
1003 {
1004 // If break-inside:avoid/forbid is set on a cell we should avoid setting a s trut on lines unless the cell is taller than the page,
1005 // in which case we've no choice but to allow it. This special-casing is nee ded because cells don't propagate struts like normal
1006 // layout blocks - the struts are managed directly by the section when it la ys out rows and cells.
1007 LayoutUnit pageLogicalHeight = pageLogicalHeightForOffset(offset);
1008 if (toLayoutBox(parent())->getPaginationBreakability() != AllowAnyBreaks && table()->vBorderSpacing() + logicalHeight() + contentLogicalHeight < pageLogical Height)
mstensho (USE GERRIT) 2016/04/04 21:05:39 I still think this looks strange. We have decided
1009 return LayoutUnit();
1010 return LayoutBlockFlow::calculatePaginationStrutToFitContent(offset, strutTo NextPage, contentLogicalHeight);
1011 }
1012
1002 } // namespace blink 1013 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698