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

Side by Side Diff: Source/core/rendering/RenderTableSection.cpp

Issue 162613007: Reduce the number of parameters to LayoutStateMaintainer by one (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « Source/core/rendering/RenderTableRow.cpp ('k') | Source/core/rendering/RenderVTTCue.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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, 2008, 2009, 2010 Apple Inc. All rights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010 Apple Inc. All rights reserved.
8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com) 8 * Copyright (C) 2006 Alexey Proskuryakov (ap@nypop.com)
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 601 matching lines...) Expand 10 before | Expand all | Expand 10 after
612 int RenderTableSection::calcRowLogicalHeight() 612 int RenderTableSection::calcRowLogicalHeight()
613 { 613 {
614 #ifndef NDEBUG 614 #ifndef NDEBUG
615 SetLayoutNeededForbiddenScope layoutForbiddenScope(this); 615 SetLayoutNeededForbiddenScope layoutForbiddenScope(this);
616 #endif 616 #endif
617 617
618 ASSERT(!needsLayout()); 618 ASSERT(!needsLayout());
619 619
620 RenderTableCell* cell; 620 RenderTableCell* cell;
621 621
622 LayoutStateMaintainer statePusher(view()); 622 LayoutStateMaintainer statePusher(this);
623 623
624 m_rowPos.resize(m_grid.size() + 1); 624 m_rowPos.resize(m_grid.size() + 1);
625 625
626 // We ignore the border-spacing on any non-top section as it is already incl uded in the previous section's last row position. 626 // We ignore the border-spacing on any non-top section as it is already incl uded in the previous section's last row position.
627 if (this == table()->topSection()) 627 if (this == table()->topSection())
628 m_rowPos[0] = table()->vBorderSpacing(); 628 m_rowPos[0] = table()->vBorderSpacing();
629 else 629 else
630 m_rowPos[0] = 0; 630 m_rowPos[0] = 0;
631 631
632 SpanningRenderTableCells rowSpanCells; 632 SpanningRenderTableCells rowSpanCells;
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
709 ASSERT(needsLayout()); 709 ASSERT(needsLayout());
710 ASSERT(!needsCellRecalc()); 710 ASSERT(!needsCellRecalc());
711 ASSERT(!table()->needsSectionRecalc()); 711 ASSERT(!table()->needsSectionRecalc());
712 712
713 LayoutRectRecorder recorder(*this); 713 LayoutRectRecorder recorder(*this);
714 714
715 // addChild may over-grow m_grid but we don't want to throw away the memory too early as addChild 715 // addChild may over-grow m_grid but we don't want to throw away the memory too early as addChild
716 // can be called in a loop (e.g during parsing). Doing it now ensures we hav e a stable-enough structure. 716 // can be called in a loop (e.g during parsing). Doing it now ensures we hav e a stable-enough structure.
717 m_grid.shrinkToFit(); 717 m_grid.shrinkToFit();
718 718
719 LayoutStateMaintainer statePusher(view(), this, locationOffset(), style()->i sFlippedBlocksWritingMode()); 719 LayoutStateMaintainer statePusher(this, locationOffset(), style()->isFlipped BlocksWritingMode());
720 720
721 const Vector<int>& columnPos = table()->columnPositions(); 721 const Vector<int>& columnPos = table()->columnPositions();
722 722
723 SubtreeLayoutScope layouter(this); 723 SubtreeLayoutScope layouter(this);
724 for (unsigned r = 0; r < m_grid.size(); ++r) { 724 for (unsigned r = 0; r < m_grid.size(); ++r) {
725 Row& row = m_grid[r].row; 725 Row& row = m_grid[r].row;
726 unsigned cols = row.size(); 726 unsigned cols = row.size();
727 // First, propagate our table layout's information to the cells. This wi ll mark the row as needing layout 727 // First, propagate our table layout's information to the cells. This wi ll mark the row as needing layout
728 // if there was a column logical width change. 728 // if there was a column logical width change.
729 for (unsigned startColumn = 0; startColumn < cols; ++startColumn) { 729 for (unsigned startColumn = 0; startColumn < cols; ++startColumn) {
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
864 864
865 // Set the width of our section now. The rows will also be this width. 865 // Set the width of our section now. The rows will also be this width.
866 setLogicalWidth(table()->contentLogicalWidth()); 866 setLogicalWidth(table()->contentLogicalWidth());
867 m_overflow.clear(); 867 m_overflow.clear();
868 m_overflowingCells.clear(); 868 m_overflowingCells.clear();
869 m_forceSlowPaintPathWithOverflowingCell = false; 869 m_forceSlowPaintPathWithOverflowingCell = false;
870 870
871 int vspacing = table()->vBorderSpacing(); 871 int vspacing = table()->vBorderSpacing();
872 unsigned nEffCols = table()->numEffCols(); 872 unsigned nEffCols = table()->numEffCols();
873 873
874 LayoutStateMaintainer statePusher(view(), this, locationOffset(), style()->i sFlippedBlocksWritingMode()); 874 LayoutStateMaintainer statePusher(this, locationOffset(), style()->isFlipped BlocksWritingMode());
875 875
876 for (unsigned r = 0; r < totalRows; r++) { 876 for (unsigned r = 0; r < totalRows; r++) {
877 // Set the row's x/y position and width/height. 877 // Set the row's x/y position and width/height.
878 if (RenderTableRow* rowRenderer = m_grid[r].rowRenderer) { 878 if (RenderTableRow* rowRenderer = m_grid[r].rowRenderer) {
879 rowRenderer->setLocation(LayoutPoint(0, m_rowPos[r])); 879 rowRenderer->setLocation(LayoutPoint(0, m_rowPos[r]));
880 rowRenderer->setLogicalWidth(logicalWidth()); 880 rowRenderer->setLogicalWidth(logicalWidth());
881 rowRenderer->setLogicalHeight(m_rowPos[r + 1] - m_rowPos[r] - vspaci ng); 881 rowRenderer->setLogicalHeight(m_rowPos[r + 1] - m_rowPos[r] - vspaci ng);
882 rowRenderer->updateLayerTransform(); 882 rowRenderer->updateLayerTransform();
883 } 883 }
884 884
(...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 else 1710 else
1711 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1711 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1712 1712
1713 cell->setLogicalLocation(cellLocation); 1713 cell->setLogicalLocation(cellLocation);
1714 1714
1715 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled()) 1715 if (!RuntimeEnabledFeatures::repaintAfterLayoutEnabled())
1716 view()->addLayoutDelta(oldCellLocation - cell->location()); 1716 view()->addLayoutDelta(oldCellLocation - cell->location());
1717 } 1717 }
1718 1718
1719 } // namespace WebCore 1719 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderTableRow.cpp ('k') | Source/core/rendering/RenderVTTCue.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698