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, 2008, 2009, 2010, 2013 Apple Inc. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 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 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 row.logical_height = logical_height; | 78 row.logical_height = logical_height; |
79 break; | 79 break; |
80 default: | 80 default: |
81 break; | 81 break; |
82 } | 82 } |
83 } | 83 } |
84 } | 84 } |
85 | 85 |
86 void CellSpan::EnsureConsistency(const unsigned maximum_span_size) { | 86 void CellSpan::EnsureConsistency(const unsigned maximum_span_size) { |
87 static_assert(std::is_same<decltype(start_), unsigned>::value, | 87 static_assert(std::is_same<decltype(start_), unsigned>::value, |
88 "Asserts below assume m_start is unsigned"); | 88 "Asserts below assume start_ is unsigned"); |
89 static_assert(std::is_same<decltype(end_), unsigned>::value, | 89 static_assert(std::is_same<decltype(end_), unsigned>::value, |
90 "Asserts below assume m_end is unsigned"); | 90 "Asserts below assume end_ is unsigned"); |
91 CHECK_LE(start_, maximum_span_size); | 91 CHECK_LE(start_, maximum_span_size); |
92 CHECK_LE(end_, maximum_span_size); | 92 CHECK_LE(end_, maximum_span_size); |
93 CHECK_LE(start_, end_); | 93 CHECK_LE(start_, end_); |
94 } | 94 } |
95 | 95 |
96 LayoutTableSection::CellStruct::CellStruct() : in_col_span(false) {} | 96 LayoutTableSection::CellStruct::CellStruct() : in_col_span(false) {} |
97 | 97 |
98 LayoutTableSection::CellStruct::~CellStruct() {} | 98 LayoutTableSection::CellStruct::~CellStruct() {} |
99 | 99 |
100 LayoutTableSection::LayoutTableSection(Element* element) | 100 LayoutTableSection::LayoutTableSection(Element* element) |
(...skipping 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 | 949 |
950 return row_pos_[grid_.size()]; | 950 return row_pos_[grid_.size()]; |
951 } | 951 } |
952 | 952 |
953 void LayoutTableSection::UpdateLayout() { | 953 void LayoutTableSection::UpdateLayout() { |
954 DCHECK(NeedsLayout()); | 954 DCHECK(NeedsLayout()); |
955 LayoutAnalyzer::Scope analyzer(*this); | 955 LayoutAnalyzer::Scope analyzer(*this); |
956 CHECK(!NeedsCellRecalc()); | 956 CHECK(!NeedsCellRecalc()); |
957 DCHECK(!Table()->NeedsSectionRecalc()); | 957 DCHECK(!Table()->NeedsSectionRecalc()); |
958 | 958 |
959 // addChild may over-grow m_grid but we don't want to throw away the memory | 959 // addChild may over-grow grid_ but we don't want to throw away the memory |
960 // too early as addChild can be called in a loop (e.g during parsing). Doing | 960 // too early as addChild can be called in a loop (e.g during parsing). Doing |
961 // it now ensures we have a stable-enough structure. | 961 // it now ensures we have a stable-enough structure. |
962 grid_.ShrinkToFit(); | 962 grid_.ShrinkToFit(); |
963 | 963 |
964 LayoutState state(*this); | 964 LayoutState state(*this); |
965 | 965 |
966 const Vector<int>& column_pos = Table()->EffectiveColumnPositions(); | 966 const Vector<int>& column_pos = Table()->EffectiveColumnPositions(); |
967 LayoutUnit row_logical_top(VBorderSpacingBeforeFirstRow()); | 967 LayoutUnit row_logical_top(VBorderSpacingBeforeFirstRow()); |
968 | 968 |
969 SubtreeLayoutScope layouter(*this); | 969 SubtreeLayoutScope layouter(*this); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1062 } | 1062 } |
1063 } | 1063 } |
1064 | 1064 |
1065 void LayoutTableSection::DistributeRemainingExtraLogicalHeight( | 1065 void LayoutTableSection::DistributeRemainingExtraLogicalHeight( |
1066 int& extra_logical_height) { | 1066 int& extra_logical_height) { |
1067 unsigned total_rows = grid_.size(); | 1067 unsigned total_rows = grid_.size(); |
1068 | 1068 |
1069 if (extra_logical_height <= 0 || !row_pos_[total_rows]) | 1069 if (extra_logical_height <= 0 || !row_pos_[total_rows]) |
1070 return; | 1070 return; |
1071 | 1071 |
1072 // FIXME: m_rowPos[totalRows] - m_rowPos[0] is the total rows' size. | 1072 // FIXME: row_pos_[total_rows] - row_pos_[0] is the total rows' size. |
1073 int total_row_size = row_pos_[total_rows]; | 1073 int total_row_size = row_pos_[total_rows]; |
1074 int total_logical_height_added = 0; | 1074 int total_logical_height_added = 0; |
1075 int previous_row_position = row_pos_[0]; | 1075 int previous_row_position = row_pos_[0]; |
1076 for (unsigned r = 0; r < total_rows; r++) { | 1076 for (unsigned r = 0; r < total_rows; r++) { |
1077 // weight with the original height | 1077 // weight with the original height |
1078 total_logical_height_added += extra_logical_height * | 1078 total_logical_height_added += extra_logical_height * |
1079 (row_pos_[r + 1] - previous_row_position) / | 1079 (row_pos_[r + 1] - previous_row_position) / |
1080 total_row_size; | 1080 total_row_size; |
1081 previous_row_position = row_pos_[r + 1]; | 1081 previous_row_position = row_pos_[r + 1]; |
1082 row_pos_[r + 1] += total_logical_height_added; | 1082 row_pos_[r + 1] += total_logical_height_added; |
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2174 bool LayoutTableSection::PaintedOutputOfObjectHasNoEffectRegardlessOfSize() | 2174 bool LayoutTableSection::PaintedOutputOfObjectHasNoEffectRegardlessOfSize() |
2175 const { | 2175 const { |
2176 // LayoutTableSection paints background from columns. | 2176 // LayoutTableSection paints background from columns. |
2177 if (Table()->HasColElements()) | 2177 if (Table()->HasColElements()) |
2178 return false; | 2178 return false; |
2179 return LayoutTableBoxComponent:: | 2179 return LayoutTableBoxComponent:: |
2180 PaintedOutputOfObjectHasNoEffectRegardlessOfSize(); | 2180 PaintedOutputOfObjectHasNoEffectRegardlessOfSize(); |
2181 } | 2181 } |
2182 | 2182 |
2183 } // namespace blink | 2183 } // namespace blink |
OLD | NEW |