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, 2013 Apple Inc. All rights | 7 * Copyright (C) 2003, 2004, 2005, 2006, 2009, 2013 Apple Inc. All rights |
8 * reserved. | 8 * 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 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 void decreaseStart() { --m_start; } | 50 void decreaseStart() { --m_start; } |
51 void increaseEnd() { ++m_end; } | 51 void increaseEnd() { ++m_end; } |
52 | 52 |
53 void ensureConsistency(const unsigned); | 53 void ensureConsistency(const unsigned); |
54 | 54 |
55 private: | 55 private: |
56 unsigned m_start; | 56 unsigned m_start; |
57 unsigned m_end; | 57 unsigned m_end; |
58 }; | 58 }; |
59 | 59 |
| 60 inline bool operator==(const CellSpan& a, const CellSpan& b) { |
| 61 return a.start() == b.start() && a.end() == b.end(); |
| 62 } |
| 63 inline bool operator!=(const CellSpan& a, const CellSpan& b) { |
| 64 return !(a == b); |
| 65 } |
| 66 |
60 class LayoutTableCell; | 67 class LayoutTableCell; |
61 class LayoutTableRow; | 68 class LayoutTableRow; |
62 | 69 |
63 // LayoutTableSection is used to represent table row group (display: | 70 // LayoutTableSection is used to represent table row group (display: |
64 // table-row-group), header group (display: table-header-group) and footer group | 71 // table-row-group), header group (display: table-header-group) and footer group |
65 // (display: table-footer-group). | 72 // (display: table-footer-group). |
66 // | 73 // |
67 // The object holds the internal representation of the rows (m_grid). See | 74 // The object holds the internal representation of the rows (m_grid). See |
68 // recalcCells() below for some extra explanation. | 75 // recalcCells() below for some extra explanation. |
69 // | 76 // |
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
289 const LayoutObject* parent) const override { | 296 const LayoutObject* parent) const override { |
290 return createAnonymousWithParent(parent); | 297 return createAnonymousWithParent(parent); |
291 } | 298 } |
292 | 299 |
293 void paint(const PaintInfo&, const LayoutPoint&) const override; | 300 void paint(const PaintInfo&, const LayoutPoint&) const override; |
294 | 301 |
295 // Flip the rect so it aligns with the coordinates used by the rowPos and | 302 // Flip the rect so it aligns with the coordinates used by the rowPos and |
296 // columnPos vectors. | 303 // columnPos vectors. |
297 LayoutRect logicalRectForWritingModeAndDirection(const LayoutRect&) const; | 304 LayoutRect logicalRectForWritingModeAndDirection(const LayoutRect&) const; |
298 | 305 |
| 306 CellSpan fullTableRowSpan() const { return CellSpan(0, m_grid.size()); } |
| 307 CellSpan fullTableEffectiveColumnSpan() const { |
| 308 return CellSpan(0, table()->numEffectiveColumns()); |
| 309 } |
299 CellSpan dirtiedRows(const LayoutRect& visualRect) const; | 310 CellSpan dirtiedRows(const LayoutRect& visualRect) const; |
300 CellSpan dirtiedEffectiveColumns(const LayoutRect& visualRect) const; | 311 CellSpan dirtiedEffectiveColumns(const LayoutRect& visualRect) const; |
| 312 |
301 const HashSet<LayoutTableCell*>& overflowingCells() const { | 313 const HashSet<LayoutTableCell*>& overflowingCells() const { |
302 return m_overflowingCells; | 314 return m_overflowingCells; |
303 } | 315 } |
304 bool hasMultipleCellLevels() const { return m_hasMultipleCellLevels; } | 316 bool hasMultipleCellLevels() const { return m_hasMultipleCellLevels; } |
305 | 317 |
306 const char* name() const override { return "LayoutTableSection"; } | 318 const char* name() const override { return "LayoutTableSection"; } |
307 | 319 |
308 // Whether a section has opaque background depends on many factors, e.g. | 320 // Whether a section has opaque background depends on many factors, e.g. |
309 // border spacing, border collapsing, missing cells, etc. For simplicity, | 321 // border spacing, border collapsing, missing cells, etc. For simplicity, |
310 // just conservatively assume all table sections are not opaque. | 322 // just conservatively assume all table sections are not opaque. |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
394 void updateBaselineForCell(LayoutTableCell*, | 406 void updateBaselineForCell(LayoutTableCell*, |
395 unsigned row, | 407 unsigned row, |
396 int& baselineDescent); | 408 int& baselineDescent); |
397 | 409 |
398 bool hasOverflowingCell() const { | 410 bool hasOverflowingCell() const { |
399 return m_overflowingCells.size() || m_forceSlowPaintPathWithOverflowingCell; | 411 return m_overflowingCells.size() || m_forceSlowPaintPathWithOverflowingCell; |
400 } | 412 } |
401 | 413 |
402 void computeOverflowFromCells(unsigned totalRows, unsigned nEffCols); | 414 void computeOverflowFromCells(unsigned totalRows, unsigned nEffCols); |
403 | 415 |
404 CellSpan fullTableRowSpan() const { return CellSpan(0, m_grid.size()); } | |
405 CellSpan fullTableEffectiveColumnSpan() const { | |
406 return CellSpan(0, table()->numEffectiveColumns()); | |
407 } | |
408 | |
409 // These two functions take a rectangle as input that has been flipped by | 416 // These two functions take a rectangle as input that has been flipped by |
410 // logicalRectForWritingModeAndDirection. | 417 // logicalRectForWritingModeAndDirection. |
411 // The returned span of rows or columns is end-exclusive, and empty if | 418 // The returned span of rows or columns is end-exclusive, and empty if |
412 // start==end. | 419 // start==end. |
413 CellSpan spannedRows(const LayoutRect& flippedRect) const; | 420 CellSpan spannedRows(const LayoutRect& flippedRect) const; |
414 CellSpan spannedEffectiveColumns(const LayoutRect& flippedRect) const; | 421 CellSpan spannedEffectiveColumns(const LayoutRect& flippedRect) const; |
415 | 422 |
416 void setLogicalPositionForCell(LayoutTableCell*, | 423 void setLogicalPositionForCell(LayoutTableCell*, |
417 unsigned effectiveColumn) const; | 424 unsigned effectiveColumn) const; |
418 | 425 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
472 bool m_hasMultipleCellLevels; | 479 bool m_hasMultipleCellLevels; |
473 | 480 |
474 LayoutUnit m_offsetForRepeatingHeader; | 481 LayoutUnit m_offsetForRepeatingHeader; |
475 }; | 482 }; |
476 | 483 |
477 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, isTableSection()); | 484 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, isTableSection()); |
478 | 485 |
479 } // namespace blink | 486 } // namespace blink |
480 | 487 |
481 #endif // LayoutTableSection_h | 488 #endif // LayoutTableSection_h |
OLD | NEW |