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

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

Issue 2412923002: Top-align table cells in rows that cross fragmentainer boundaries. (Closed)
Patch Set: Let's keep the pagination strut substraction thing a bit longer, since removing it affects some DRT… Created 4 years, 2 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. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * This library is free software; you can redistribute it and/or 10 * This library is free software; you can redistribute it and/or
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 // LayoutTableCell's location includes the offset of it's containing 199 // LayoutTableCell's location includes the offset of it's containing
200 // LayoutTableRow, so we need to subtract that again here (as for 200 // LayoutTableRow, so we need to subtract that again here (as for
201 // LayoutTableCell::offsetFromContainer. 201 // LayoutTableCell::offsetFromContainer.
202 if (parent()) 202 if (parent())
203 adjustedLayerOffset -= parentBox()->locationOffset(); 203 adjustedLayerOffset -= parentBox()->locationOffset();
204 LayoutBox::addLayerHitTestRects(layerRects, currentLayer, adjustedLayerOffset, 204 LayoutBox::addLayerHitTestRects(layerRects, currentLayer, adjustedLayerOffset,
205 containerRect); 205 containerRect);
206 } 206 }
207 207
208 void LayoutTableCell::computeIntrinsicPadding(int rowHeight, 208 void LayoutTableCell::computeIntrinsicPadding(int rowHeight,
209 EVerticalAlign verticalAlign,
209 SubtreeLayoutScope& layouter) { 210 SubtreeLayoutScope& layouter) {
210 int oldIntrinsicPaddingBefore = intrinsicPaddingBefore(); 211 int oldIntrinsicPaddingBefore = intrinsicPaddingBefore();
211 int oldIntrinsicPaddingAfter = intrinsicPaddingAfter(); 212 int oldIntrinsicPaddingAfter = intrinsicPaddingAfter();
212 int logicalHeightWithoutIntrinsicPadding = pixelSnappedLogicalHeight() - 213 int logicalHeightWithoutIntrinsicPadding = pixelSnappedLogicalHeight() -
213 oldIntrinsicPaddingBefore - 214 oldIntrinsicPaddingBefore -
214 oldIntrinsicPaddingAfter; 215 oldIntrinsicPaddingAfter;
215 216
216 int intrinsicPaddingBefore = 0; 217 int intrinsicPaddingBefore = 0;
217 switch (style()->verticalAlign()) { 218 switch (verticalAlign) {
218 case VerticalAlignSub: 219 case VerticalAlignSub:
219 case VerticalAlignSuper: 220 case VerticalAlignSuper:
220 case VerticalAlignTextTop: 221 case VerticalAlignTextTop:
221 case VerticalAlignTextBottom: 222 case VerticalAlignTextBottom:
222 case VerticalAlignLength: 223 case VerticalAlignLength:
223 case VerticalAlignBaseline: { 224 case VerticalAlignBaseline: {
224 int baseline = cellBaselinePosition(); 225 int baseline = cellBaselinePosition();
225 if (baseline > borderBefore() + paddingBefore()) 226 if (baseline > borderBefore() + paddingBefore())
226 intrinsicPaddingBefore = section()->rowBaseline(rowIndex()) - 227 intrinsicPaddingBefore = section()->rowBaseline(rowIndex()) -
227 (baseline - oldIntrinsicPaddingBefore); 228 (baseline - oldIntrinsicPaddingBefore);
(...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after
1402 cb->adjustChildDebugRect(rect); 1403 cb->adjustChildDebugRect(rect);
1403 1404
1404 return rect; 1405 return rect;
1405 } 1406 }
1406 1407
1407 void LayoutTableCell::adjustChildDebugRect(LayoutRect& r) const { 1408 void LayoutTableCell::adjustChildDebugRect(LayoutRect& r) const {
1408 r.move(0, -intrinsicPaddingBefore()); 1409 r.move(0, -intrinsicPaddingBefore());
1409 } 1410 }
1410 1411
1411 } // namespace blink 1412 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTableCell.h ('k') | third_party/WebKit/Source/core/layout/LayoutTableSection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698