OLD | NEW |
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 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
911 | 911 |
912 int LayoutTable::calcBorderStart() const | 912 int LayoutTable::calcBorderStart() const |
913 { | 913 { |
914 if (!collapseBorders()) | 914 if (!collapseBorders()) |
915 return LayoutBlock::borderStart(); | 915 return LayoutBlock::borderStart(); |
916 | 916 |
917 // Determined by the first cell of the first row. See the CSS 2.1 spec, sect
ion 17.6.2. | 917 // Determined by the first cell of the first row. See the CSS 2.1 spec, sect
ion 17.6.2. |
918 if (!numEffCols()) | 918 if (!numEffCols()) |
919 return 0; | 919 return 0; |
920 | 920 |
921 int borderWidth = 0; | 921 float borderWidth = 0; |
922 | 922 |
923 const BorderValue& tableStartBorder = style()->borderStart(); | 923 const BorderValue& tableStartBorder = style()->borderStart(); |
924 if (tableStartBorder.style() == BHIDDEN) | 924 if (tableStartBorder.style() == BHIDDEN) |
925 return 0; | 925 return 0; |
926 if (tableStartBorder.style() > BHIDDEN) | 926 if (tableStartBorder.style() > BHIDDEN) |
927 borderWidth = tableStartBorder.width(); | 927 borderWidth = tableStartBorder.width(); |
928 | 928 |
929 // TODO(dgrogan): This logic doesn't properly account for the first column i
n the first column-group case. | 929 // TODO(dgrogan): This logic doesn't properly account for the first column i
n the first column-group case. |
930 if (LayoutTableCol* column = colElement(0).innermostColOrColGroup()) { | 930 if (LayoutTableCol* column = colElement(0).innermostColOrColGroup()) { |
931 // FIXME: We don't account for direction on columns and column groups. | 931 // FIXME: We don't account for direction on columns and column groups. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
965 | 965 |
966 int LayoutTable::calcBorderEnd() const | 966 int LayoutTable::calcBorderEnd() const |
967 { | 967 { |
968 if (!collapseBorders()) | 968 if (!collapseBorders()) |
969 return LayoutBlock::borderEnd(); | 969 return LayoutBlock::borderEnd(); |
970 | 970 |
971 // Determined by the last cell of the first row. See the CSS 2.1 spec, secti
on 17.6.2. | 971 // Determined by the last cell of the first row. See the CSS 2.1 spec, secti
on 17.6.2. |
972 if (!numEffCols()) | 972 if (!numEffCols()) |
973 return 0; | 973 return 0; |
974 | 974 |
975 int borderWidth = 0; | 975 float borderWidth = 0; |
976 | 976 |
977 const BorderValue& tableEndBorder = style()->borderEnd(); | 977 const BorderValue& tableEndBorder = style()->borderEnd(); |
978 if (tableEndBorder.style() == BHIDDEN) | 978 if (tableEndBorder.style() == BHIDDEN) |
979 return 0; | 979 return 0; |
980 if (tableEndBorder.style() > BHIDDEN) | 980 if (tableEndBorder.style() > BHIDDEN) |
981 borderWidth = tableEndBorder.width(); | 981 borderWidth = tableEndBorder.width(); |
982 | 982 |
983 unsigned endColumn = numEffCols() - 1; | 983 unsigned endColumn = numEffCols() - 1; |
984 | 984 |
985 // TODO(dgrogan): This logic doesn't properly account for the last column in
the last column-group case. | 985 // TODO(dgrogan): This logic doesn't properly account for the last column in
the last column-group case. |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1019 return (borderWidth + (style()->isLeftToRightDirection() ? 1 : 0)) / 2; | 1019 return (borderWidth + (style()->isLeftToRightDirection() ? 1 : 0)) / 2; |
1020 } | 1020 } |
1021 | 1021 |
1022 void LayoutTable::recalcBordersInRowDirection() | 1022 void LayoutTable::recalcBordersInRowDirection() |
1023 { | 1023 { |
1024 // FIXME: We need to compute the collapsed before / after borders in the sam
e fashion. | 1024 // FIXME: We need to compute the collapsed before / after borders in the sam
e fashion. |
1025 m_borderStart = calcBorderStart(); | 1025 m_borderStart = calcBorderStart(); |
1026 m_borderEnd = calcBorderEnd(); | 1026 m_borderEnd = calcBorderEnd(); |
1027 } | 1027 } |
1028 | 1028 |
1029 int LayoutTable::borderBefore() const | 1029 LayoutUnit LayoutTable::borderBefore() const |
1030 { | 1030 { |
1031 if (collapseBorders()) { | 1031 if (collapseBorders()) { |
1032 recalcSectionsIfNeeded(); | 1032 recalcSectionsIfNeeded(); |
1033 return outerBorderBefore(); | 1033 return outerBorderBefore(); |
1034 } | 1034 } |
1035 return LayoutBlock::borderBefore(); | 1035 return LayoutBlock::borderBefore(); |
1036 } | 1036 } |
1037 | 1037 |
1038 int LayoutTable::borderAfter() const | 1038 LayoutUnit LayoutTable::borderAfter() const |
1039 { | 1039 { |
1040 if (collapseBorders()) { | 1040 if (collapseBorders()) { |
1041 recalcSectionsIfNeeded(); | 1041 recalcSectionsIfNeeded(); |
1042 return outerBorderAfter(); | 1042 return outerBorderAfter(); |
1043 } | 1043 } |
1044 return LayoutBlock::borderAfter(); | 1044 return LayoutBlock::borderAfter(); |
1045 } | 1045 } |
1046 | 1046 |
1047 int LayoutTable::outerBorderBefore() const | 1047 int LayoutTable::outerBorderBefore() const |
1048 { | 1048 { |
(...skipping 406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1455 | 1455 |
1456 LayoutUnit LayoutTable::paddingRight() const | 1456 LayoutUnit LayoutTable::paddingRight() const |
1457 { | 1457 { |
1458 if (collapseBorders()) | 1458 if (collapseBorders()) |
1459 return LayoutUnit(); | 1459 return LayoutUnit(); |
1460 | 1460 |
1461 return LayoutBlock::paddingRight(); | 1461 return LayoutBlock::paddingRight(); |
1462 } | 1462 } |
1463 | 1463 |
1464 } // namespace blink | 1464 } // namespace blink |
OLD | NEW |