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

Side by Side Diff: Source/core/layout/LayoutTableSection.cpp

Issue 1160463004: Check if length isSpecified before accessing. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 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 | Annotate | Revision Log
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, 2013 Apple Inc. All r ights reserved. 7 * Copyright (C) 2003, 2004, 2005, 2006, 2008, 2009, 2010, 2013 Apple Inc. All r ights 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 705 matching lines...) Expand 10 before | Expand all | Expand 10 after
716 716
717 SpanningLayoutTableCells rowSpanCells; 717 SpanningLayoutTableCells rowSpanCells;
718 #if ENABLE(ASSERT) 718 #if ENABLE(ASSERT)
719 HashSet<const LayoutTableCell*> uniqueCells; 719 HashSet<const LayoutTableCell*> uniqueCells;
720 #endif 720 #endif
721 721
722 for (unsigned r = 0; r < m_grid.size(); r++) { 722 for (unsigned r = 0; r < m_grid.size(); r++) {
723 m_grid[r].baseline = -1; 723 m_grid[r].baseline = -1;
724 LayoutUnit baselineDescent = 0; 724 LayoutUnit baselineDescent = 0;
725 725
726 // Our base size is the biggest logical height from our cells' styles (e xcluding row spanning cells). 726 if (m_grid[r].logicalHeight.isSpecified()) {
727 m_rowPos[r + 1] = std::max(m_rowPos[r] + minimumValueForLength(m_grid[r] .logicalHeight, 0).round(), 0); 727 // Our base size is the biggest logical height from our cells' style s (excluding row spanning cells).
728 m_rowPos[r + 1] = std::max(m_rowPos[r] + minimumValueForLength(m_gri d[r].logicalHeight, 0).round(), 0);
729 } else {
730 m_rowPos[r + 1] = std::max(m_rowPos[r], 0);
Julien - ping for review 2015/05/26 16:06:37 We should probably put a comment about why it's OK
dsinclair 2015/05/27 15:20:06 Done.
731 }
728 732
729 Row& row = m_grid[r].row; 733 Row& row = m_grid[r].row;
730 unsigned totalCols = row.size(); 734 unsigned totalCols = row.size();
731 LayoutTableCell* lastRowSpanCell = 0; 735 LayoutTableCell* lastRowSpanCell = 0;
732 736
733 for (unsigned c = 0; c < totalCols; c++) { 737 for (unsigned c = 0; c < totalCols; c++) {
734 CellStruct& current = cellAt(r, c); 738 CellStruct& current = cellAt(r, c);
735 for (unsigned i = 0; i < current.cells.size(); i++) { 739 for (unsigned i = 0; i < current.cells.size(); i++) {
736 cell = current.cells[i]; 740 cell = current.cells[i];
737 if (current.inColSpan && cell->rowSpan() == 1) 741 if (current.inColSpan && cell->rowSpan() == 1)
(...skipping 884 matching lines...) Expand 10 before | Expand all | Expand 10 after
1622 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691). 1626 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691).
1623 if (!style()->isLeftToRightDirection()) 1627 if (!style()->isLeftToRightDirection())
1624 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing); 1628 cellLocation.setX(table()->columnPositions()[table()->numEffCols()] - ta ble()->columnPositions()[table()->colToEffCol(cell->col() + cell->colSpan())] + horizontalBorderSpacing);
1625 else 1629 else
1626 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing); 1630 cellLocation.setX(table()->columnPositions()[effectiveColumn] + horizont alBorderSpacing);
1627 1631
1628 cell->setLogicalLocation(cellLocation); 1632 cell->setLogicalLocation(cellLocation);
1629 } 1633 }
1630 1634
1631 } // namespace blink 1635 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698