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 // |page| is the page the row is on relative to the start of the table. | |
| 257 void SetPositionOfRepeatingFooterGroupOnPage(unsigned page, | |
| 258 LayoutUnit position) { | |
| 259 if (position_of_repeating_footer_group_on_page_.size() <= page) | |
| 260 position_of_repeating_footer_group_on_page_.Grow(page + 1); | |
| 261 position_of_repeating_footer_group_on_page_[page] = position; | |
| 262 } | |
| 263 const LayoutUnit GetPositionOfRepeatingFooterGroupOnPage(int page) const { | |
| 264 return position_of_repeating_footer_group_on_page_[page]; | |
| 265 } | |
| 266 unsigned PagesWithRepeatingFooters() const { | |
|
mstensho (USE GERRIT)
2017/05/10 10:59:03
Could you squeeze "Count" (or some synonym) into t
| |
| 267 return position_of_repeating_footer_group_on_page_.size(); | |
| 268 } | |
| 269 | |
| 256 LayoutTableSection* Header() const { | 270 LayoutTableSection* Header() const { |
| 257 // TODO(mstensho): We should ideally DCHECK(!needsSectionRecalc()) here, but | 271 // TODO(mstensho): We should ideally DCHECK(!needsSectionRecalc()) here, but |
| 258 // we currently cannot, due to crbug.com/693212 | 272 // we currently cannot, due to crbug.com/693212 |
| 259 return head_; | 273 return head_; |
| 260 } | 274 } |
| 261 LayoutTableSection* Footer() const { | 275 LayoutTableSection* Footer() const { |
| 262 DCHECK(!NeedsSectionRecalc()); | 276 DCHECK(!NeedsSectionRecalc()); |
| 263 return foot_; | 277 return foot_; |
| 264 } | 278 } |
| 265 LayoutTableSection* FirstBody() const { | 279 LayoutTableSection* FirstBody() const { |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 438 void AddCaption(const LayoutTableCaption*); | 452 void AddCaption(const LayoutTableCaption*); |
| 439 void RemoveCaption(const LayoutTableCaption*); | 453 void RemoveCaption(const LayoutTableCaption*); |
| 440 void AddColumn(const LayoutTableCol*); | 454 void AddColumn(const LayoutTableCol*); |
| 441 void RemoveColumn(const LayoutTableCol*); | 455 void RemoveColumn(const LayoutTableCol*); |
| 442 | 456 |
| 443 void PaintBoxDecorationBackground(const PaintInfo&, | 457 void PaintBoxDecorationBackground(const PaintInfo&, |
| 444 const LayoutPoint&) const final; | 458 const LayoutPoint&) const final; |
| 445 | 459 |
| 446 void PaintMask(const PaintInfo&, const LayoutPoint&) const final; | 460 void PaintMask(const PaintInfo&, const LayoutPoint&) const final; |
| 447 | 461 |
| 448 void SubtractCaptionRect(LayoutRect&) const; | 462 enum CaptionSelector { BottomCaptionsOnly, AllCaptions }; |
| 463 void SubtractCaptionRect(LayoutRect&, | |
| 464 CaptionSelector captions = AllCaptions) const; | |
| 449 | 465 |
| 450 bool IsLogicalWidthAuto() const; | 466 bool IsLogicalWidthAuto() const; |
| 451 | 467 |
| 452 // When table headers are repeated, we need to know the offset from the block | 468 // 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 | 469 // start of the fragmentation context to the first occurrence of the table |
| 454 // header. | 470 // header. |
| 455 LayoutUnit BlockOffsetToFirstRepeatableHeader() const { | 471 LayoutUnit BlockOffsetToFirstRepeatableHeader() const { |
| 456 return block_offset_to_first_repeatable_header_; | 472 return block_offset_to_first_repeatable_header_; |
| 457 } | 473 } |
| 458 | 474 |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 548 // LayoutTable. | 564 // LayoutTable. |
| 549 mutable Vector<ColumnStruct> effective_columns_; | 565 mutable Vector<ColumnStruct> effective_columns_; |
| 550 | 566 |
| 551 // Holds the logical layout positions of effective columns, and the last item | 567 // Holds the logical layout positions of effective columns, and the last item |
| 552 // (whose index is numEffectiveColumns()) holds the position of the imaginary | 568 // (whose index is numEffectiveColumns()) holds the position of the imaginary |
| 553 // column after the last column. | 569 // column after the last column. |
| 554 // Because of the last item, m_effectiveColumnPositions.size() is always | 570 // Because of the last item, m_effectiveColumnPositions.size() is always |
| 555 // numEffectiveColumns() + 1. | 571 // numEffectiveColumns() + 1. |
| 556 mutable Vector<int> effective_column_positions_; | 572 mutable Vector<int> effective_column_positions_; |
| 557 | 573 |
| 574 mutable Vector<LayoutUnit> position_of_repeating_footer_group_on_page_; | |
| 575 | |
| 558 // The captions associated with this object. | 576 // The captions associated with this object. |
| 559 mutable Vector<LayoutTableCaption*> captions_; | 577 mutable Vector<LayoutTableCaption*> captions_; |
| 560 | 578 |
| 561 // Holds pointers to LayoutTableCol objects for <col>s and <colgroup>s under | 579 // Holds pointers to LayoutTableCol objects for <col>s and <colgroup>s under |
| 562 // this table. | 580 // this table. |
| 563 // There is no direct relationship between the size of and index into this | 581 // 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. | 582 // vector and those of m_effectiveColumns because they hold different things. |
| 565 mutable Vector<LayoutTableCol*> column_layout_objects_; | 583 mutable Vector<LayoutTableCol*> column_layout_objects_; |
| 566 | 584 |
| 567 mutable LayoutTableSection* head_; | 585 mutable LayoutTableSection* head_; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 622 if (first_body_) | 640 if (first_body_) |
| 623 return first_body_; | 641 return first_body_; |
| 624 return foot_; | 642 return foot_; |
| 625 } | 643 } |
| 626 | 644 |
| 627 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTable, IsTable()); | 645 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTable, IsTable()); |
| 628 | 646 |
| 629 } // namespace blink | 647 } // namespace blink |
| 630 | 648 |
| 631 #endif // LayoutTable_h | 649 #endif // LayoutTable_h |
| OLD | NEW |