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, 2009, 2010 Apple Inc. | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2010 Apple Inc. |
8 * All rights reserved. | 8 * All rights reserved. |
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 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 explicit LayoutTable(Element*); | 138 explicit LayoutTable(Element*); |
139 ~LayoutTable() override; | 139 ~LayoutTable() override; |
140 | 140 |
141 // Per CSS 3 writing-mode: "The first and second values of the | 141 // Per CSS 3 writing-mode: "The first and second values of the |
142 // 'border-spacing' property represent spacing between columns and rows | 142 // 'border-spacing' property represent spacing between columns and rows |
143 // respectively, not necessarily the horizontal and vertical spacing | 143 // respectively, not necessarily the horizontal and vertical spacing |
144 // respectively". | 144 // respectively". |
145 int HBorderSpacing() const { return h_spacing_; } | 145 int HBorderSpacing() const { return h_spacing_; } |
146 int VBorderSpacing() const { return v_spacing_; } | 146 int VBorderSpacing() const { return v_spacing_; } |
147 | 147 |
148 bool CollapseBorders() const { | 148 bool ShouldCollapseBorders() const { |
149 return Style()->BorderCollapse() == EBorderCollapse::kCollapse; | 149 return Style()->BorderCollapse() == EBorderCollapse::kCollapse; |
150 } | 150 } |
151 | 151 |
152 LayoutUnit BorderStart() const override { return LayoutUnit(border_start_); } | 152 LayoutUnit BorderStart() const override { return LayoutUnit(border_start_); } |
153 LayoutUnit BorderEnd() const override { return LayoutUnit(border_end_); } | 153 LayoutUnit BorderEnd() const override { return LayoutUnit(border_end_); } |
154 LayoutUnit BorderBefore() const override; | 154 LayoutUnit BorderBefore() const override; |
155 LayoutUnit BorderAfter() const override; | 155 LayoutUnit BorderAfter() const override; |
156 | 156 |
157 LayoutUnit BorderLeft() const override { | 157 LayoutUnit BorderLeft() const override { |
158 if (Style()->IsHorizontalWritingMode()) | 158 if (Style()->IsHorizontalWritingMode()) |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 return LayoutUnit(LayoutBlock::PaddingEnd().ToInt()); | 342 return LayoutUnit(LayoutBlock::PaddingEnd().ToInt()); |
343 } | 343 } |
344 LayoutUnit PaddingStart() const override { | 344 LayoutUnit PaddingStart() const override { |
345 return LayoutUnit(LayoutBlock::PaddingStart().ToInt()); | 345 return LayoutUnit(LayoutBlock::PaddingStart().ToInt()); |
346 } | 346 } |
347 | 347 |
348 LayoutUnit BordersPaddingAndSpacingInRowDirection() const { | 348 LayoutUnit BordersPaddingAndSpacingInRowDirection() const { |
349 // 'border-spacing' only applies to separate borders (see 17.6.1 The | 349 // 'border-spacing' only applies to separate borders (see 17.6.1 The |
350 // separated borders model). | 350 // separated borders model). |
351 return BorderStart() + BorderEnd() + | 351 return BorderStart() + BorderEnd() + |
352 (CollapseBorders() ? LayoutUnit() | 352 (ShouldCollapseBorders() ? LayoutUnit() |
353 : (PaddingStart() + PaddingEnd() + | 353 : (PaddingStart() + PaddingEnd() + |
354 BorderSpacingInRowDirection())); | 354 BorderSpacingInRowDirection())); |
355 } | 355 } |
356 | 356 |
357 // Return the first column or column-group. | 357 // Return the first column or column-group. |
358 LayoutTableCol* FirstColumn() const; | 358 LayoutTableCol* FirstColumn() const; |
359 | 359 |
360 struct ColAndColGroup { | 360 struct ColAndColGroup { |
361 ColAndColGroup() | 361 ColAndColGroup() |
362 : col(nullptr), | 362 : col(nullptr), |
363 colgroup(nullptr), | 363 colgroup(nullptr), |
364 adjoins_start_border_of_col_group(false), | 364 adjoins_start_border_of_col_group(false), |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
622 if (first_body_) | 622 if (first_body_) |
623 return first_body_; | 623 return first_body_; |
624 return foot_; | 624 return foot_; |
625 } | 625 } |
626 | 626 |
627 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTable, IsTable()); | 627 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTable, IsTable()); |
628 | 628 |
629 } // namespace blink | 629 } // namespace blink |
630 | 630 |
631 #endif // LayoutTable_h | 631 #endif // LayoutTable_h |
OLD | NEW |