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

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

Issue 2701993002: DO NOT COMMIT: Results of running new (proposed) clang-format on Blink (Closed)
Patch Set: Created 3 years, 10 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 885 matching lines...) Expand 10 before | Expand all | Expand 10 after
896 896
897 for (unsigned i = 0; i < m_captions.size(); i++) 897 for (unsigned i = 0; i < m_captions.size(); i++)
898 m_minPreferredLogicalWidth = std::max( 898 m_minPreferredLogicalWidth = std::max(
899 m_minPreferredLogicalWidth, m_captions[i]->minPreferredLogicalWidth()); 899 m_minPreferredLogicalWidth, m_captions[i]->minPreferredLogicalWidth());
900 900
901 const ComputedStyle& styleToUse = styleRef(); 901 const ComputedStyle& styleToUse = styleRef();
902 // FIXME: This should probably be checking for isSpecified since you should be 902 // FIXME: This should probably be checking for isSpecified since you should be
903 // able to use percentage or calc values for min-width. 903 // able to use percentage or calc values for min-width.
904 if (styleToUse.logicalMinWidth().isFixed() && 904 if (styleToUse.logicalMinWidth().isFixed() &&
905 styleToUse.logicalMinWidth().value() > 0) { 905 styleToUse.logicalMinWidth().value() > 0) {
906 m_maxPreferredLogicalWidth = std::max( 906 m_maxPreferredLogicalWidth =
907 m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing( 907 std::max(m_maxPreferredLogicalWidth,
908 styleToUse.logicalMinWidth().value())); 908 adjustContentBoxLogicalWidthForBoxSizing(
909 m_minPreferredLogicalWidth = std::max( 909 styleToUse.logicalMinWidth().value()));
910 m_minPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing( 910 m_minPreferredLogicalWidth =
911 styleToUse.logicalMinWidth().value())); 911 std::max(m_minPreferredLogicalWidth,
912 adjustContentBoxLogicalWidthForBoxSizing(
913 styleToUse.logicalMinWidth().value()));
912 } 914 }
913 915
914 // FIXME: This should probably be checking for isSpecified since you should be 916 // FIXME: This should probably be checking for isSpecified since you should be
915 // able to use percentage or calc values for maxWidth. 917 // able to use percentage or calc values for maxWidth.
916 if (styleToUse.logicalMaxWidth().isFixed()) { 918 if (styleToUse.logicalMaxWidth().isFixed()) {
917 // We don't constrain m_minPreferredLogicalWidth as the table should be at 919 // We don't constrain m_minPreferredLogicalWidth as the table should be at
918 // least the size of its min-content, regardless of 'max-width'. 920 // least the size of its min-content, regardless of 'max-width'.
919 m_maxPreferredLogicalWidth = std::min( 921 m_maxPreferredLogicalWidth =
920 m_maxPreferredLogicalWidth, adjustContentBoxLogicalWidthForBoxSizing( 922 std::min(m_maxPreferredLogicalWidth,
921 styleToUse.logicalMaxWidth().value())); 923 adjustContentBoxLogicalWidthForBoxSizing(
924 styleToUse.logicalMaxWidth().value()));
922 m_maxPreferredLogicalWidth = 925 m_maxPreferredLogicalWidth =
923 std::max(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth); 926 std::max(m_minPreferredLogicalWidth, m_maxPreferredLogicalWidth);
924 } 927 }
925 928
926 // FIXME: We should be adding borderAndPaddingLogicalWidth here, but 929 // FIXME: We should be adding borderAndPaddingLogicalWidth here, but
927 // m_tableLayout->computePreferredLogicalWidths already does, so a bunch of 930 // m_tableLayout->computePreferredLogicalWidths already does, so a bunch of
928 // tests break doing this naively. 931 // tests break doing this naively.
929 clearPreferredLogicalWidthsDirty(); 932 clearPreferredLogicalWidthsDirty();
930 } 933 }
931 934
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after
1376 SkipEmptySectionsValue skipEmptySections) const { 1379 SkipEmptySectionsValue skipEmptySections) const {
1377 recalcSectionsIfNeeded(); 1380 recalcSectionsIfNeeded();
1378 1381
1379 if (section == m_head) 1382 if (section == m_head)
1380 return 0; 1383 return 0;
1381 1384
1382 LayoutObject* prevSection = 1385 LayoutObject* prevSection =
1383 section == m_foot ? lastChild() : section->previousSibling(); 1386 section == m_foot ? lastChild() : section->previousSibling();
1384 while (prevSection) { 1387 while (prevSection) {
1385 if (prevSection->isTableSection() && prevSection != m_head && 1388 if (prevSection->isTableSection() && prevSection != m_head &&
1386 prevSection != m_foot && (skipEmptySections == DoNotSkipEmptySections || 1389 prevSection != m_foot &&
1387 toLayoutTableSection(prevSection)->numRows())) 1390 (skipEmptySections == DoNotSkipEmptySections ||
1391 toLayoutTableSection(prevSection)->numRows()))
1388 break; 1392 break;
1389 prevSection = prevSection->previousSibling(); 1393 prevSection = prevSection->previousSibling();
1390 } 1394 }
1391 if (!prevSection && m_head && 1395 if (!prevSection && m_head &&
1392 (skipEmptySections == DoNotSkipEmptySections || m_head->numRows())) 1396 (skipEmptySections == DoNotSkipEmptySections || m_head->numRows()))
1393 prevSection = m_head; 1397 prevSection = m_head;
1394 return toLayoutTableSection(prevSection); 1398 return toLayoutTableSection(prevSection);
1395 } 1399 }
1396 1400
1397 LayoutTableSection* LayoutTable::sectionBelow( 1401 LayoutTableSection* LayoutTable::sectionBelow(
1398 const LayoutTableSection* section, 1402 const LayoutTableSection* section,
1399 SkipEmptySectionsValue skipEmptySections) const { 1403 SkipEmptySectionsValue skipEmptySections) const {
1400 recalcSectionsIfNeeded(); 1404 recalcSectionsIfNeeded();
1401 1405
1402 if (section == m_foot) 1406 if (section == m_foot)
1403 return nullptr; 1407 return nullptr;
1404 1408
1405 LayoutObject* nextSection = 1409 LayoutObject* nextSection =
1406 section == m_head ? firstChild() : section->nextSibling(); 1410 section == m_head ? firstChild() : section->nextSibling();
1407 while (nextSection) { 1411 while (nextSection) {
1408 if (nextSection->isTableSection() && nextSection != m_head && 1412 if (nextSection->isTableSection() && nextSection != m_head &&
1409 nextSection != m_foot && (skipEmptySections == DoNotSkipEmptySections || 1413 nextSection != m_foot &&
1410 toLayoutTableSection(nextSection)->numRows())) 1414 (skipEmptySections == DoNotSkipEmptySections ||
1415 toLayoutTableSection(nextSection)->numRows()))
1411 break; 1416 break;
1412 nextSection = nextSection->nextSibling(); 1417 nextSection = nextSection->nextSibling();
1413 } 1418 }
1414 if (!nextSection && m_foot && 1419 if (!nextSection && m_foot &&
1415 (skipEmptySections == DoNotSkipEmptySections || m_foot->numRows())) 1420 (skipEmptySections == DoNotSkipEmptySections || m_foot->numRows()))
1416 nextSection = m_foot; 1421 nextSection = m_foot;
1417 return toLayoutTableSection(nextSection); 1422 return toLayoutTableSection(nextSection);
1418 } 1423 }
1419 1424
1420 LayoutTableSection* LayoutTable::bottomSection() const { 1425 LayoutTableSection* LayoutTable::bottomSection() const {
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 } 1701 }
1697 1702
1698 LayoutUnit LayoutTable::paddingRight() const { 1703 LayoutUnit LayoutTable::paddingRight() const {
1699 if (collapseBorders()) 1704 if (collapseBorders())
1700 return LayoutUnit(); 1705 return LayoutUnit();
1701 1706
1702 return LayoutBlock::paddingRight(); 1707 return LayoutBlock::paddingRight();
1703 } 1708 }
1704 1709
1705 } // namespace blink 1710 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutTable.h ('k') | third_party/WebKit/Source/core/layout/LayoutTableCell.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698