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

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

Issue 2839183002: Refactor scroll updates after layout. (Closed)
Patch Set: rebase Created 3 years, 7 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, 2007, 2008, 2009, 2010, 2013 Apple Inc. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2013 Apple Inc.
8 * All rights reserved. 8 * All rights reserved.
9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 9 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
10 * 10 *
(...skipping 520 matching lines...) Expand 10 before | Expand all | Expand 10 after
531 // layout here instead of walking through individual parts of the tree. 531 // layout here instead of walking through individual parts of the tree.
532 // crbug.com/442737 532 // crbug.com/442737
533 for (auto& caption : captions_) 533 for (auto& caption : captions_)
534 caption->LayoutIfNeeded(); 534 caption->LayoutIfNeeded();
535 535
536 for (LayoutTableSection* section = TopSection(); section; 536 for (LayoutTableSection* section = TopSection(); section;
537 section = SectionBelow(section)) { 537 section = SectionBelow(section)) {
538 section->LayoutIfNeeded(); 538 section->LayoutIfNeeded();
539 section->LayoutRows(); 539 section->LayoutRows();
540 section->ComputeOverflowFromCells(); 540 section->ComputeOverflowFromCells();
541 section->UpdateLayerTransformAfterLayout(); 541 section->UpdateAfterLayout();
542 section->AddVisualEffectOverflow(); 542 section->AddVisualEffectOverflow();
543 } 543 }
544 } 544 }
545 545
546 bool LayoutTable::RecalcChildOverflowAfterStyleChange() { 546 bool LayoutTable::RecalcChildOverflowAfterStyleChange() {
547 DCHECK(ChildNeedsOverflowRecalcAfterStyleChange()); 547 DCHECK(ChildNeedsOverflowRecalcAfterStyleChange());
548 ClearChildNeedsOverflowRecalcAfterStyleChange(); 548 ClearChildNeedsOverflowRecalcAfterStyleChange();
549 549
550 // If the table sections we keep pointers to have gone away then the table 550 // If the table sections we keep pointers to have gone away then the table
551 // will be rebuilt and overflow will get recalculated anyway so return early. 551 // will be rebuilt and overflow will get recalculated anyway so return early.
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
728 } 728 }
729 729
730 // position the table sections 730 // position the table sections
731 LayoutTableSection* section = top_section; 731 LayoutTableSection* section = top_section;
732 while (section) { 732 while (section) {
733 section->SetLogicalLocation( 733 section->SetLogicalLocation(
734 LayoutPoint(section_logical_left, LogicalHeight())); 734 LayoutPoint(section_logical_left, LogicalHeight()));
735 735
736 SetLogicalHeight(LogicalHeight() + section->LogicalHeight()); 736 SetLogicalHeight(LogicalHeight() + section->LogicalHeight());
737 737
738 section->UpdateLayerTransformAfterLayout(); 738 section->UpdateAfterLayout();
739 section->AddVisualEffectOverflow(); 739 section->AddVisualEffectOverflow();
740 740
741 section = SectionBelow(section); 741 section = SectionBelow(section);
742 } 742 }
743 743
744 SetLogicalHeight(LogicalHeight() + border_and_padding_after); 744 SetLogicalHeight(LogicalHeight() + border_and_padding_after);
745 745
746 // Lay out bottom captions. 746 // Lay out bottom captions.
747 for (unsigned i = 0; i < captions_.size(); i++) { 747 for (unsigned i = 0; i < captions_.size(); i++) {
748 if (captions_[i]->Style()->CaptionSide() != ECaptionSide::kBottom) 748 if (captions_[i]->Style()->CaptionSide() != ECaptionSide::kBottom)
749 continue; 749 continue;
750 LayoutCaption(*captions_[i], layouter); 750 LayoutCaption(*captions_[i], layouter);
751 } 751 }
752 752
753 UpdateLogicalHeight(); 753 UpdateLogicalHeight();
754 754
755 // table can be containing block of positioned elements. 755 // table can be containing block of positioned elements.
756 bool dimension_changed = old_logical_width != LogicalWidth() || 756 bool dimension_changed = old_logical_width != LogicalWidth() ||
757 old_logical_height != LogicalHeight(); 757 old_logical_height != LogicalHeight();
758 LayoutPositionedObjects(dimension_changed); 758 LayoutPositionedObjects(dimension_changed);
759 759
760 UpdateLayerTransformAfterLayout();
761
762 ComputeOverflow(ClientLogicalBottom()); 760 ComputeOverflow(ClientLogicalBottom());
763 UpdateAfterLayout(); 761 UpdateAfterLayout();
764 762
765 if (state.IsPaginated() && IsPageLogicalHeightKnown()) { 763 if (state.IsPaginated() && IsPageLogicalHeightKnown()) {
766 block_offset_to_first_repeatable_header_ = state.PageLogicalOffset( 764 block_offset_to_first_repeatable_header_ = state.PageLogicalOffset(
767 *this, top_section ? top_section->LogicalTop() : LayoutUnit()); 765 *this, top_section ? top_section->LogicalTop() : LayoutUnit());
768 } 766 }
769 } 767 }
770 768
771 // FIXME: This value isn't the intrinsic content logical height, but we need 769 // FIXME: This value isn't the intrinsic content logical height, but we need
(...skipping 965 matching lines...) Expand 10 before | Expand all | Expand 10 after
1737 } 1735 }
1738 1736
1739 LayoutUnit LayoutTable::PaddingRight() const { 1737 LayoutUnit LayoutTable::PaddingRight() const {
1740 if (CollapseBorders()) 1738 if (CollapseBorders())
1741 return LayoutUnit(); 1739 return LayoutUnit();
1742 1740
1743 return LayoutBlock::PaddingRight(); 1741 return LayoutBlock::PaddingRight();
1744 } 1742 }
1745 1743
1746 } // namespace blink 1744 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/layout/LayoutReplaced.cpp ('k') | third_party/WebKit/Source/core/layout/LayoutTableSection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698