Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(64)

Side by Side Diff: third_party/WebKit/Source/core/layout/LayoutTable.h

Issue 2584143003: Repeat footers in paginated context (Closed)
Patch Set: bug 656232 Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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(unsigned page,
257 LayoutUnit position) const {
mstensho (USE GERRIT) 2017/04/24 11:57:16 Doesn't really look like a const method to me.
258 position_of_repeating_footer_group_on_page_.Grow(page + 1);
259 position_of_repeating_footer_group_on_page_[page] = position;
260 }
261 const LayoutUnit GetPositionOfRepeatingFooterGroupOnPage(int page) const {
mstensho (USE GERRIT) 2017/04/24 11:57:16 The previous method uses unsigned. This one uses i
262 return position_of_repeating_footer_group_on_page_[page];
263 }
264 const Vector<LayoutUnit>& PositionOfRepeatingFooterGroupOnPage() const {
265 return position_of_repeating_footer_group_on_page_;
266 }
267
256 LayoutTableSection* Header() const { 268 LayoutTableSection* Header() const {
257 // TODO(mstensho): We should ideally DCHECK(!needsSectionRecalc()) here, but 269 // TODO(mstensho): We should ideally DCHECK(!needsSectionRecalc()) here, but
258 // we currently cannot, due to crbug.com/693212 270 // we currently cannot, due to crbug.com/693212
259 return head_; 271 return head_;
260 } 272 }
261 LayoutTableSection* Footer() const { 273 LayoutTableSection* Footer() const {
262 DCHECK(!NeedsSectionRecalc()); 274 DCHECK(!NeedsSectionRecalc());
263 return foot_; 275 return foot_;
264 } 276 }
265 LayoutTableSection* FirstBody() const { 277 LayoutTableSection* FirstBody() const {
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
434 void PaintBoxDecorationBackground(const PaintInfo&, 446 void PaintBoxDecorationBackground(const PaintInfo&,
435 const LayoutPoint&) const final; 447 const LayoutPoint&) const final;
436 448
437 void PaintMask(const PaintInfo&, const LayoutPoint&) const final; 449 void PaintMask(const PaintInfo&, const LayoutPoint&) const final;
438 450
439 const CollapsedBorderValues& CollapsedBorders() const { 451 const CollapsedBorderValues& CollapsedBorders() const {
440 DCHECK(collapsed_borders_valid_); 452 DCHECK(collapsed_borders_valid_);
441 return collapsed_borders_; 453 return collapsed_borders_;
442 } 454 }
443 455
444 void SubtractCaptionRect(LayoutRect&) const; 456 void SubtractCaptionRect(LayoutRect&, bool after_only = false) const;
445 457
446 bool IsLogicalWidthAuto() const; 458 bool IsLogicalWidthAuto() const;
447 459
448 // When table headers are repeated, we need to know the offset from the block 460 // When table headers are repeated, we need to know the offset from the block
449 // start of the fragmentation context to the first occurrence of the table 461 // start of the fragmentation context to the first occurrence of the table
450 // header. 462 // header.
451 LayoutUnit BlockOffsetToFirstRepeatableHeader() const { 463 LayoutUnit BlockOffsetToFirstRepeatableHeader() const {
452 return block_offset_to_first_repeatable_header_; 464 return block_offset_to_first_repeatable_header_;
453 } 465 }
454 466
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 // LayoutTable. 556 // LayoutTable.
545 mutable Vector<ColumnStruct> effective_columns_; 557 mutable Vector<ColumnStruct> effective_columns_;
546 558
547 // Holds the logical layout positions of effective columns, and the last item 559 // Holds the logical layout positions of effective columns, and the last item
548 // (whose index is numEffectiveColumns()) holds the position of the imaginary 560 // (whose index is numEffectiveColumns()) holds the position of the imaginary
549 // column after the last column. 561 // column after the last column.
550 // Because of the last item, m_effectiveColumnPositions.size() is always 562 // Because of the last item, m_effectiveColumnPositions.size() is always
551 // numEffectiveColumns() + 1. 563 // numEffectiveColumns() + 1.
552 mutable Vector<int> effective_column_positions_; 564 mutable Vector<int> effective_column_positions_;
553 565
566 mutable Vector<LayoutUnit> position_of_repeating_footer_group_on_page_;
567
554 // The captions associated with this object. 568 // The captions associated with this object.
555 mutable Vector<LayoutTableCaption*> captions_; 569 mutable Vector<LayoutTableCaption*> captions_;
556 570
557 // Holds pointers to LayoutTableCol objects for <col>s and <colgroup>s under 571 // Holds pointers to LayoutTableCol objects for <col>s and <colgroup>s under
558 // this table. 572 // this table.
559 // There is no direct relationship between the size of and index into this 573 // There is no direct relationship between the size of and index into this
560 // vector and those of m_effectiveColumns because they hold different things. 574 // vector and those of m_effectiveColumns because they hold different things.
561 mutable Vector<LayoutTableCol*> column_layout_objects_; 575 mutable Vector<LayoutTableCol*> column_layout_objects_;
562 576
563 mutable LayoutTableSection* head_; 577 mutable LayoutTableSection* head_;
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
617 if (first_body_) 631 if (first_body_)
618 return first_body_; 632 return first_body_;
619 return foot_; 633 return foot_;
620 } 634 }
621 635
622 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTable, IsTable()); 636 DEFINE_LAYOUT_OBJECT_TYPE_CASTS(LayoutTable, IsTable());
623 637
624 } // namespace blink 638 } // namespace blink
625 639
626 #endif // LayoutTable_h 640 #endif // LayoutTable_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698