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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
288 return false; | 288 return false; |
289 } | 289 } |
290 | 290 |
291 int PaginationStrutForRow(LayoutTableRow*, LayoutUnit logical_offset) const; | 291 int PaginationStrutForRow(LayoutTableRow*, LayoutUnit logical_offset) const; |
292 | 292 |
293 bool MapToVisualRectInAncestorSpaceInternal( | 293 bool MapToVisualRectInAncestorSpaceInternal( |
294 const LayoutBoxModelObject* ancestor, | 294 const LayoutBoxModelObject* ancestor, |
295 TransformState&, | 295 TransformState&, |
296 VisualRectFlags = kDefaultVisualRectFlags) const override; | 296 VisualRectFlags = kDefaultVisualRectFlags) const override; |
297 | 297 |
298 bool IsRepeatingHeaderGroup() const; | 298 bool IsRepeatingHeaderGroup() const { return is_repeating_header_group_; }; |
299 | 299 |
300 void UpdateLayout() override; | 300 void UpdateLayout() override; |
301 | 301 |
302 CellSpan FullSectionRowSpan() const { return CellSpan(0, grid_.size()); } | 302 CellSpan FullSectionRowSpan() const { return CellSpan(0, grid_.size()); } |
303 CellSpan FullTableEffectiveColumnSpan() const { | 303 CellSpan FullTableEffectiveColumnSpan() const { |
304 return CellSpan(0, Table()->NumEffectiveColumns()); | 304 return CellSpan(0, Table()->NumEffectiveColumns()); |
305 } | 305 } |
306 | 306 |
| 307 void DetermineIfHeaderGroupShouldRepeat() { |
| 308 is_repeating_header_group_ = HeaderGroupShouldRepeat(); |
| 309 } |
| 310 |
307 protected: | 311 protected: |
308 void StyleDidChange(StyleDifference, const ComputedStyle* old_style) override; | 312 void StyleDidChange(StyleDifference, const ComputedStyle* old_style) override; |
309 bool NodeAtPoint(HitTestResult&, | 313 bool NodeAtPoint(HitTestResult&, |
310 const HitTestLocation& location_in_container, | 314 const HitTestLocation& location_in_container, |
311 const LayoutPoint& accumulated_offset, | 315 const LayoutPoint& accumulated_offset, |
312 HitTestAction) override; | 316 HitTestAction) override; |
313 | 317 |
314 private: | 318 private: |
315 bool IsOfType(LayoutObjectType type) const override { | 319 bool IsOfType(LayoutObjectType type) const override { |
316 return type == kLayoutObjectTableSection || LayoutBox::IsOfType(type); | 320 return type == kLayoutObjectTableSection || LayoutBox::IsOfType(type); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
386 void RelayoutCellIfFlexed(LayoutTableCell&, int row_index, int row_height); | 390 void RelayoutCellIfFlexed(LayoutTableCell&, int row_index, int row_height); |
387 | 391 |
388 int LogicalHeightForRow(const LayoutTableRow&) const; | 392 int LogicalHeightForRow(const LayoutTableRow&) const; |
389 | 393 |
390 // Honor breaking restrictions inside the table row, and adjust position and | 394 // Honor breaking restrictions inside the table row, and adjust position and |
391 // size accordingly. | 395 // size accordingly. |
392 void AdjustRowForPagination(LayoutTableRow&, SubtreeLayoutScope&); | 396 void AdjustRowForPagination(LayoutTableRow&, SubtreeLayoutScope&); |
393 | 397 |
394 bool PaintedOutputOfObjectHasNoEffectRegardlessOfSize() const override; | 398 bool PaintedOutputOfObjectHasNoEffectRegardlessOfSize() const override; |
395 | 399 |
| 400 bool HeaderGroupShouldRepeat() const; |
| 401 |
396 struct TableGridRow { | 402 struct TableGridRow { |
397 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); | 403 DISALLOW_NEW_EXCEPT_PLACEMENT_NEW(); |
398 | 404 |
399 public: | 405 public: |
400 inline void SetRowLogicalHeightToRowStyleLogicalHeight(); | 406 inline void SetRowLogicalHeightToRowStyleLogicalHeight(); |
401 inline void UpdateLogicalHeightForCell(const LayoutTableCell*); | 407 inline void UpdateLogicalHeightForCell(const LayoutTableCell*); |
402 | 408 |
403 // The index is effective column index. | 409 // The index is effective column index. |
404 Vector<TableGridCell> grid_cells; | 410 Vector<TableGridCell> grid_cells; |
405 LayoutTableRow* row = nullptr; | 411 LayoutTableRow* row = nullptr; |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
448 | 454 |
449 // This boolean tracks if we have cells overlapping due to rowspan / colspan | 455 // This boolean tracks if we have cells overlapping due to rowspan / colspan |
450 // (see class comment above about when it could appear). | 456 // (see class comment above about when it could appear). |
451 // | 457 // |
452 // The use is to disable a painting optimization where we just paint the | 458 // The use is to disable a painting optimization where we just paint the |
453 // invalidated cells. | 459 // invalidated cells. |
454 bool has_multiple_cell_levels_; | 460 bool has_multiple_cell_levels_; |
455 | 461 |
456 // Whether any cell spans multiple rows or cols. | 462 // Whether any cell spans multiple rows or cols. |
457 bool has_spanning_cells_; | 463 bool has_spanning_cells_; |
| 464 |
| 465 // Header group should be painted on every page. |
| 466 bool is_repeating_header_group_; |
458 }; | 467 }; |
459 | 468 |
460 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, IsTableSection()); | 469 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTableSection, IsTableSection()); |
461 | 470 |
462 } // namespace blink | 471 } // namespace blink |
463 | 472 |
464 #endif // LayoutTableSection_h | 473 #endif // LayoutTableSection_h |
OLD | NEW |