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

Side by Side Diff: Source/core/layout/LayoutTableSection.cpp

Issue 1182053003: Use plain int for borders widths when possible (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 6 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
« no previous file with comments | « Source/core/layout/LayoutTable.cpp ('k') | Source/core/style/BorderData.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2008, 2009, 2010, 2013 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. All r ights 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 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after
1143 1143
1144 ASSERT(hasOverflowingCell == this->hasOverflowingCell()); 1144 ASSERT(hasOverflowingCell == this->hasOverflowingCell());
1145 } 1145 }
1146 1146
1147 int LayoutTableSection::calcBlockDirectionOuterBorder(BlockBorderSide side) cons t 1147 int LayoutTableSection::calcBlockDirectionOuterBorder(BlockBorderSide side) cons t
1148 { 1148 {
1149 unsigned totalCols = table()->numEffCols(); 1149 unsigned totalCols = table()->numEffCols();
1150 if (!m_grid.size() || !totalCols) 1150 if (!m_grid.size() || !totalCols)
1151 return 0; 1151 return 0;
1152 1152
1153 unsigned borderWidth = 0; 1153 int borderWidth = 0;
1154 1154
1155 const BorderValue& sb = side == BorderBefore ? style()->borderBefore() : sty le()->borderAfter(); 1155 const BorderValue& sb = side == BorderBefore ? style()->borderBefore() : sty le()->borderAfter();
1156 if (sb.style() == BHIDDEN) 1156 if (sb.style() == BHIDDEN)
1157 return -1; 1157 return -1;
1158 if (sb.style() > BHIDDEN) 1158 if (sb.style() > BHIDDEN)
1159 borderWidth = sb.width(); 1159 borderWidth = sb.width();
1160 1160
1161 const BorderValue& rb = side == BorderBefore ? firstRow()->style()->borderBe fore() : lastRow()->style()->borderAfter(); 1161 const BorderValue& rb = side == BorderBefore ? firstRow()->style()->borderBe fore() : lastRow()->style()->borderAfter();
1162 if (rb.style() == BHIDDEN) 1162 if (rb.style() == BHIDDEN)
1163 return -1; 1163 return -1;
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after
1198 return borderWidth / 2; 1198 return borderWidth / 2;
1199 } 1199 }
1200 1200
1201 int LayoutTableSection::calcInlineDirectionOuterBorder(InlineBorderSide side) co nst 1201 int LayoutTableSection::calcInlineDirectionOuterBorder(InlineBorderSide side) co nst
1202 { 1202 {
1203 unsigned totalCols = table()->numEffCols(); 1203 unsigned totalCols = table()->numEffCols();
1204 if (!m_grid.size() || !totalCols) 1204 if (!m_grid.size() || !totalCols)
1205 return 0; 1205 return 0;
1206 unsigned colIndex = side == BorderStart ? 0 : totalCols - 1; 1206 unsigned colIndex = side == BorderStart ? 0 : totalCols - 1;
1207 1207
1208 unsigned borderWidth = 0; 1208 int borderWidth = 0;
1209 1209
1210 const BorderValue& sb = side == BorderStart ? style()->borderStart() : style ()->borderEnd(); 1210 const BorderValue& sb = side == BorderStart ? style()->borderStart() : style ()->borderEnd();
1211 if (sb.style() == BHIDDEN) 1211 if (sb.style() == BHIDDEN)
1212 return -1; 1212 return -1;
1213 if (sb.style() > BHIDDEN) 1213 if (sb.style() > BHIDDEN)
1214 borderWidth = sb.width(); 1214 borderWidth = sb.width();
1215 1215
1216 if (LayoutTableCol* colGroup = table()->colElement(colIndex)) { 1216 if (LayoutTableCol* colGroup = table()->colElement(colIndex)) {
1217 const BorderValue& gb = side == BorderStart ? colGroup->style()->borderS tart() : colGroup->style()->borderEnd(); 1217 const BorderValue& gb = side == BorderStart ? colGroup->style()->borderS tart() : colGroup->style()->borderEnd();
1218 if (gb.style() == BHIDDEN) 1218 if (gb.style() == BHIDDEN)
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after
1647 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691). 1647 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691).
1648 if (!style()->isLeftToRightDirection()) 1648 if (!style()->isLeftToRightDirection())
1649 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1649 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1650 else 1650 else
1651 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1651 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1652 1652
1653 cell->setLogicalLocation(cellLocation); 1653 cell->setLogicalLocation(cellLocation);
1654 } 1654 }
1655 1655
1656 } // namespace blink 1656 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/layout/LayoutTable.cpp ('k') | Source/core/style/BorderData.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698