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

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

Issue 2286543002: Add Length::isPercent and use it in tables. (Closed)
Patch Set: rebase 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
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, 2010, 2013 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc. All rights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
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 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 LayoutUnit borderAndPadding = borderAndPaddingBefore + borderAndPaddingAfter ; 345 LayoutUnit borderAndPadding = borderAndPaddingBefore + borderAndPaddingAfter ;
346 LayoutUnit computedLogicalHeight; 346 LayoutUnit computedLogicalHeight;
347 if (styleLogicalHeight.isFixed()) { 347 if (styleLogicalHeight.isFixed()) {
348 // HTML tables size as though CSS height includes border/padding, CSS ta bles do not. 348 // HTML tables size as though CSS height includes border/padding, CSS ta bles do not.
349 LayoutUnit borders = LayoutUnit(); 349 LayoutUnit borders = LayoutUnit();
350 // FIXME: We cannot apply box-sizing: content-box on <table> which other browsers allow. 350 // FIXME: We cannot apply box-sizing: content-box on <table> which other browsers allow.
351 if (isHTMLTableElement(node()) || style()->boxSizing() == BoxSizingBorde rBox) { 351 if (isHTMLTableElement(node()) || style()->boxSizing() == BoxSizingBorde rBox) {
352 borders = borderAndPadding; 352 borders = borderAndPadding;
353 } 353 }
354 computedLogicalHeight = LayoutUnit(styleLogicalHeight.value() - borders) ; 354 computedLogicalHeight = LayoutUnit(styleLogicalHeight.value() - borders) ;
355 } else if (styleLogicalHeight.hasPercent()) { 355 } else if (styleLogicalHeight.isPercentOrCalc()) {
356 computedLogicalHeight = computePercentageLogicalHeight(styleLogicalHeigh t); 356 computedLogicalHeight = computePercentageLogicalHeight(styleLogicalHeigh t);
357 } else if (styleLogicalHeight.isIntrinsic()) { 357 } else if (styleLogicalHeight.isIntrinsic()) {
358 computedLogicalHeight = computeIntrinsicLogicalContentHeightUsing(styleL ogicalHeight, logicalHeight() - borderAndPadding, borderAndPadding); 358 computedLogicalHeight = computeIntrinsicLogicalContentHeightUsing(styleL ogicalHeight, logicalHeight() - borderAndPadding, borderAndPadding);
359 } else { 359 } else {
360 ASSERT_NOT_REACHED(); 360 ASSERT_NOT_REACHED();
361 } 361 }
362 return computedLogicalHeight.clampNegativeToZero(); 362 return computedLogicalHeight.clampNegativeToZero();
363 } 363 }
364 364
365 void LayoutTable::layoutCaption(LayoutTableCaption& caption) 365 void LayoutTable::layoutCaption(LayoutTableCaption& caption)
(...skipping 1108 matching lines...) Expand 10 before | Expand all | Expand 10 after
1474 1474
1475 LayoutUnit LayoutTable::paddingRight() const 1475 LayoutUnit LayoutTable::paddingRight() const
1476 { 1476 {
1477 if (collapseBorders()) 1477 if (collapseBorders())
1478 return LayoutUnit(); 1478 return LayoutUnit();
1479 1479
1480 return LayoutBlock::paddingRight(); 1480 return LayoutBlock::paddingRight();
1481 } 1481 }
1482 1482
1483 } // namespace blink 1483 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutSlider.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableSection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698