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

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

Issue 82083002: Move viewport unit resolution to style recalc time (Closed) Base URL: https://chromium.googlesource.com/chromium/blink@master
Patch Set: rename browser zoom to page zoom Created 6 years, 11 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/RenderTableCell.h ('k') | Source/core/rendering/RenderText.h » ('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 RenderView* viewRenderer = view(); 622 LayoutStateMaintainer statePusher(view());
623 LayoutStateMaintainer statePusher(viewRenderer);
624 623
625 m_rowPos.resize(m_grid.size() + 1); 624 m_rowPos.resize(m_grid.size() + 1);
626 625
627 // 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.
628 if (this == table()->topSection()) 627 if (this == table()->topSection())
629 m_rowPos[0] = table()->vBorderSpacing(); 628 m_rowPos[0] = table()->vBorderSpacing();
630 else 629 else
631 m_rowPos[0] = 0; 630 m_rowPos[0] = 0;
632 631
633 SpanningRenderTableCells rowSpanCells; 632 SpanningRenderTableCells rowSpanCells;
634 #ifndef NDEBUG 633 #ifndef NDEBUG
635 HashSet<const RenderTableCell*> uniqueCells; 634 HashSet<const RenderTableCell*> uniqueCells;
636 #endif 635 #endif
637 636
638 for (unsigned r = 0; r < m_grid.size(); r++) { 637 for (unsigned r = 0; r < m_grid.size(); r++) {
639 m_grid[r].baseline = 0; 638 m_grid[r].baseline = 0;
640 LayoutUnit baselineDescent = 0; 639 LayoutUnit baselineDescent = 0;
641 640
642 // Our base size is the biggest logical height from our cells' styles (e xcluding row spanning cells). 641 // Our base size is the biggest logical height from our cells' styles (e xcluding row spanning cells).
643 m_rowPos[r + 1] = max(m_rowPos[r] + minimumValueForLength(m_grid[r].logi calHeight, 0, viewRenderer).round(), 0); 642 m_rowPos[r + 1] = max(m_rowPos[r] + minimumValueForLength(m_grid[r].logi calHeight, 0).round(), 0);
644 643
645 Row& row = m_grid[r].row; 644 Row& row = m_grid[r].row;
646 unsigned totalCols = row.size(); 645 unsigned totalCols = row.size();
647 RenderTableCell* lastRowSpanCell = 0; 646 RenderTableCell* lastRowSpanCell = 0;
648 647
649 for (unsigned c = 0; c < totalCols; c++) { 648 for (unsigned c = 0; c < totalCols; c++) {
650 CellStruct& current = cellAt(r, c); 649 CellStruct& current = cellAt(r, c);
651 for (unsigned i = 0; i < current.cells.size(); i++) { 650 for (unsigned i = 0; i < current.cells.size(); i++) {
652 cell = current.cells[i]; 651 cell = current.cells[i];
653 if (current.inColSpan && cell->rowSpan() == 1) 652 if (current.inColSpan && cell->rowSpan() == 1)
(...skipping 1162 matching lines...) Expand 10 before | Expand all | Expand 10 after
1816 if (!style()->isLeftToRightDirection()) 1815 if (!style()->isLeftToRightDirection())
1817 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1816 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1818 else 1817 else
1819 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1818 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1820 1819
1821 cell->setLogicalLocation(cellLocation); 1820 cell->setLogicalLocation(cellLocation);
1822 view()->addLayoutDelta(oldCellLocation - cell->location()); 1821 view()->addLayoutDelta(oldCellLocation - cell->location());
1823 } 1822 }
1824 1823
1825 } // namespace WebCore 1824 } // namespace WebCore
OLDNEW
« no previous file with comments | « Source/core/rendering/RenderTableCell.h ('k') | Source/core/rendering/RenderText.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698