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

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

Issue 2635143002: Changed EBoxSizing to an enum class and renamed its members (Closed)
Patch Set: Aded k prefix Created 3 years, 11 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. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
10 * 10 *
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 return computeIntrinsicLogicalWidthUsing( 366 return computeIntrinsicLogicalWidthUsing(
367 styleLogicalWidth, availableWidth, 367 styleLogicalWidth, availableWidth,
368 bordersPaddingAndSpacingInRowDirection()); 368 bordersPaddingAndSpacingInRowDirection());
369 369
370 // HTML tables' width styles already include borders and paddings, but CSS 370 // HTML tables' width styles already include borders and paddings, but CSS
371 // tables' width styles do not. 371 // tables' width styles do not.
372 LayoutUnit borders; 372 LayoutUnit borders;
373 bool isCSSTable = !isHTMLTableElement(node()); 373 bool isCSSTable = !isHTMLTableElement(node());
374 if (isCSSTable && styleLogicalWidth.isSpecified() && 374 if (isCSSTable && styleLogicalWidth.isSpecified() &&
375 styleLogicalWidth.isPositive() && 375 styleLogicalWidth.isPositive() &&
376 style()->boxSizing() == BoxSizingContentBox) 376 style()->boxSizing() == EBoxSizing::kContentBox)
377 borders = 377 borders =
378 borderStart() + borderEnd() + 378 borderStart() + borderEnd() +
379 (collapseBorders() ? LayoutUnit() : paddingStart() + paddingEnd()); 379 (collapseBorders() ? LayoutUnit() : paddingStart() + paddingEnd());
380 380
381 return minimumValueForLength(styleLogicalWidth, availableWidth) + borders; 381 return minimumValueForLength(styleLogicalWidth, availableWidth) + borders;
382 } 382 }
383 383
384 LayoutUnit LayoutTable::convertStyleLogicalHeightToComputedHeight( 384 LayoutUnit LayoutTable::convertStyleLogicalHeightToComputedHeight(
385 const Length& styleLogicalHeight) const { 385 const Length& styleLogicalHeight) const {
386 LayoutUnit borderAndPaddingBefore = 386 LayoutUnit borderAndPaddingBefore =
387 borderBefore() + (collapseBorders() ? LayoutUnit() : paddingBefore()); 387 borderBefore() + (collapseBorders() ? LayoutUnit() : paddingBefore());
388 LayoutUnit borderAndPaddingAfter = 388 LayoutUnit borderAndPaddingAfter =
389 borderAfter() + (collapseBorders() ? LayoutUnit() : paddingAfter()); 389 borderAfter() + (collapseBorders() ? LayoutUnit() : paddingAfter());
390 LayoutUnit borderAndPadding = borderAndPaddingBefore + borderAndPaddingAfter; 390 LayoutUnit borderAndPadding = borderAndPaddingBefore + borderAndPaddingAfter;
391 LayoutUnit computedLogicalHeight; 391 LayoutUnit computedLogicalHeight;
392 if (styleLogicalHeight.isFixed()) { 392 if (styleLogicalHeight.isFixed()) {
393 // HTML tables size as though CSS height includes border/padding, CSS tables 393 // HTML tables size as though CSS height includes border/padding, CSS tables
394 // do not. 394 // do not.
395 LayoutUnit borders = LayoutUnit(); 395 LayoutUnit borders = LayoutUnit();
396 // FIXME: We cannot apply box-sizing: content-box on <table> which other 396 // FIXME: We cannot apply box-sizing: content-box on <table> which other
397 // browsers allow. 397 // browsers allow.
398 if (isHTMLTableElement(node()) || 398 if (isHTMLTableElement(node()) ||
399 style()->boxSizing() == BoxSizingBorderBox) { 399 style()->boxSizing() == EBoxSizing::kBorderBox) {
400 borders = borderAndPadding; 400 borders = borderAndPadding;
401 } 401 }
402 computedLogicalHeight = LayoutUnit(styleLogicalHeight.value() - borders); 402 computedLogicalHeight = LayoutUnit(styleLogicalHeight.value() - borders);
403 } else if (styleLogicalHeight.isPercentOrCalc()) { 403 } else if (styleLogicalHeight.isPercentOrCalc()) {
404 computedLogicalHeight = computePercentageLogicalHeight(styleLogicalHeight); 404 computedLogicalHeight = computePercentageLogicalHeight(styleLogicalHeight);
405 } else if (styleLogicalHeight.isIntrinsic()) { 405 } else if (styleLogicalHeight.isIntrinsic()) {
406 computedLogicalHeight = computeIntrinsicLogicalContentHeightUsing( 406 computedLogicalHeight = computeIntrinsicLogicalContentHeightUsing(
407 styleLogicalHeight, logicalHeight() - borderAndPadding, 407 styleLogicalHeight, logicalHeight() - borderAndPadding,
408 borderAndPadding); 408 borderAndPadding);
409 } else { 409 } else {
(...skipping 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 } 1688 }
1689 1689
1690 LayoutUnit LayoutTable::paddingRight() const { 1690 LayoutUnit LayoutTable::paddingRight() const {
1691 if (collapseBorders()) 1691 if (collapseBorders())
1692 return LayoutUnit(); 1692 return LayoutUnit();
1693 1693
1694 return LayoutBlock::paddingRight(); 1694 return LayoutBlock::paddingRight();
1695 } 1695 }
1696 1696
1697 } // namespace blink 1697 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutBox.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableCell.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698