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