Chromium Code Reviews| 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 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 246 } | 246 } |
| 247 void SetEffectiveColumnPosition(unsigned index, int position) { | 247 void SetEffectiveColumnPosition(unsigned index, int position) { |
| 248 // Note that if our horizontal border-spacing changed, our position will | 248 // Note that if our horizontal border-spacing changed, our position will |
| 249 // change but not our column's width. In practice, horizontal border-spacing | 249 // change but not our column's width. In practice, horizontal border-spacing |
| 250 // won't change often. | 250 // won't change often. |
| 251 column_logical_width_changed_ |= | 251 column_logical_width_changed_ |= |
| 252 effective_column_positions_[index] != position; | 252 effective_column_positions_[index] != position; |
| 253 effective_column_positions_[index] = position; | 253 effective_column_positions_[index] = position; |
| 254 } | 254 } |
| 255 | 255 |
| 256 void SetPositionOfRepeatingFooterGroupOnPage(int page, LayoutUnit position) { | |
|
mstensho (USE GERRIT)
2017/05/08 13:55:59
Could you document here that |page| is the page nu
rhogan
2017/05/09 19:57:15
Done.
| |
| 257 position_of_repeating_footer_group_on_page_.Grow(page + 1); | |
|
mstensho (USE GERRIT)
2017/05/08 13:55:59
Grow() requires that you're actually requesting gr
rhogan
2017/05/09 19:57:15
Done.
| |
| 258 position_of_repeating_footer_group_on_page_[page] = position; | |
| 259 } | |
| 260 const LayoutUnit GetPositionOfRepeatingFooterGroupOnPage(int page) const { | |
| 261 return position_of_repeating_footer_group_on_page_[page]; | |
| 262 } | |
| 263 const Vector<LayoutUnit>& PositionOfRepeatingFooterGroupOnPage() const { | |
| 264 return position_of_repeating_footer_group_on_page_; | |
| 265 } | |
| 266 | |
| 256 LayoutTableSection* Header() const { | 267 LayoutTableSection* Header() const { |
| 257 // TODO(mstensho): We should ideally DCHECK(!needsSectionRecalc()) here, but | 268 // TODO(mstensho): We should ideally DCHECK(!needsSectionRecalc()) here, but |
| 258 // we currently cannot, due to crbug.com/693212 | 269 // we currently cannot, due to crbug.com/693212 |
| 259 return head_; | 270 return head_; |
| 260 } | 271 } |
| 261 LayoutTableSection* Footer() const { | 272 LayoutTableSection* Footer() const { |
| 262 DCHECK(!NeedsSectionRecalc()); | 273 DCHECK(!NeedsSectionRecalc()); |
| 263 return foot_; | 274 return foot_; |
| 264 } | 275 } |
| 265 LayoutTableSection* FirstBody() const { | 276 LayoutTableSection* FirstBody() const { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 438 void AddCaption(const LayoutTableCaption*); | 449 void AddCaption(const LayoutTableCaption*); |
| 439 void RemoveCaption(const LayoutTableCaption*); | 450 void RemoveCaption(const LayoutTableCaption*); |
| 440 void AddColumn(const LayoutTableCol*); | 451 void AddColumn(const LayoutTableCol*); |
| 441 void RemoveColumn(const LayoutTableCol*); | 452 void RemoveColumn(const LayoutTableCol*); |
| 442 | 453 |
| 443 void PaintBoxDecorationBackground(const PaintInfo&, | 454 void PaintBoxDecorationBackground(const PaintInfo&, |
| 444 const LayoutPoint&) const final; | 455 const LayoutPoint&) const final; |
| 445 | 456 |
| 446 void PaintMask(const PaintInfo&, const LayoutPoint&) const final; | 457 void PaintMask(const PaintInfo&, const LayoutPoint&) const final; |
| 447 | 458 |
| 448 void SubtractCaptionRect(LayoutRect&) const; | 459 void SubtractCaptionRect(LayoutRect&, bool after_only = false) const; |
| 449 | 460 |
| 450 bool IsLogicalWidthAuto() const; | 461 bool IsLogicalWidthAuto() const; |
| 451 | 462 |
| 452 // When table headers are repeated, we need to know the offset from the block | 463 // When table headers are repeated, we need to know the offset from the block |
| 453 // start of the fragmentation context to the first occurrence of the table | 464 // start of the fragmentation context to the first occurrence of the table |
| 454 // header. | 465 // header. |
| 455 LayoutUnit BlockOffsetToFirstRepeatableHeader() const { | 466 LayoutUnit BlockOffsetToFirstRepeatableHeader() const { |
| 456 return block_offset_to_first_repeatable_header_; | 467 return block_offset_to_first_repeatable_header_; |
| 457 } | 468 } |
| 458 | 469 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 548 // LayoutTable. | 559 // LayoutTable. |
| 549 mutable Vector<ColumnStruct> effective_columns_; | 560 mutable Vector<ColumnStruct> effective_columns_; |
| 550 | 561 |
| 551 // Holds the logical layout positions of effective columns, and the last item | 562 // Holds the logical layout positions of effective columns, and the last item |
| 552 // (whose index is numEffectiveColumns()) holds the position of the imaginary | 563 // (whose index is numEffectiveColumns()) holds the position of the imaginary |
| 553 // column after the last column. | 564 // column after the last column. |
| 554 // Because of the last item, m_effectiveColumnPositions.size() is always | 565 // Because of the last item, m_effectiveColumnPositions.size() is always |
| 555 // numEffectiveColumns() + 1. | 566 // numEffectiveColumns() + 1. |
| 556 mutable Vector<int> effective_column_positions_; | 567 mutable Vector<int> effective_column_positions_; |
| 557 | 568 |
| 569 mutable Vector<LayoutUnit> position_of_repeating_footer_group_on_page_; | |
|
mstensho (USE GERRIT)
2017/05/08 13:55:59
Are you sure you shouldn't use <int> here? Tables
rhogan
2017/05/09 19:57:15
The row's logical top is stored as a LayoutUnit so
| |
| 570 | |
| 558 // The captions associated with this object. | 571 // The captions associated with this object. |
| 559 mutable Vector<LayoutTableCaption*> captions_; | 572 mutable Vector<LayoutTableCaption*> captions_; |
| 560 | 573 |
| 561 // Holds pointers to LayoutTableCol objects for <col>s and <colgroup>s under | 574 // Holds pointers to LayoutTableCol objects for <col>s and <colgroup>s under |
| 562 // this table. | 575 // this table. |
| 563 // There is no direct relationship between the size of and index into this | 576 // There is no direct relationship between the size of and index into this |
| 564 // vector and those of m_effectiveColumns because they hold different things. | 577 // vector and those of m_effectiveColumns because they hold different things. |
| 565 mutable Vector<LayoutTableCol*> column_layout_objects_; | 578 mutable Vector<LayoutTableCol*> column_layout_objects_; |
| 566 | 579 |
| 567 mutable LayoutTableSection* head_; | 580 mutable LayoutTableSection* head_; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 622 if (first_body_) | 635 if (first_body_) |
| 623 return first_body_; | 636 return first_body_; |
| 624 return foot_; | 637 return foot_; |
| 625 } | 638 } |
| 626 | 639 |
| 627 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTable, IsTable()); | 640 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTable, IsTable()); |
| 628 | 641 |
| 629 } // namespace blink | 642 } // namespace blink |
| 630 | 643 |
| 631 #endif // LayoutTable_h | 644 #endif // LayoutTable_h |
| OLD | NEW |