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

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

Issue 2040463002: [css] Bandaid fix for crash when tables and containment mix. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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 | « third_party/WebKit/LayoutTests/fast/table/containment-expected.txt ('k') | no next file » | 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, 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 775 matching lines...) Expand 10 before | Expand all | Expand 10 after
786 786
787 ASSERT(!needsLayout()); 787 ASSERT(!needsLayout());
788 788
789 return m_rowPos[m_grid.size()]; 789 return m_rowPos[m_grid.size()];
790 } 790 }
791 791
792 void LayoutTableSection::layout() 792 void LayoutTableSection::layout()
793 { 793 {
794 ASSERT(needsLayout()); 794 ASSERT(needsLayout());
795 LayoutAnalyzer::Scope analyzer(*this); 795 LayoutAnalyzer::Scope analyzer(*this);
796 ASSERT(!needsCellRecalc()); 796 // TODO(dgrogan): Change this to RELEASE_ASSERT(!needsCellRecalc()) once
797 // containment and tables play nicely. https://crbug.com/616643
798 if (needsCellRecalc())
799 return;
797 ASSERT(!table()->needsSectionRecalc()); 800 ASSERT(!table()->needsSectionRecalc());
798 801
799 // addChild may over-grow m_grid but we don't want to throw away the memory too early as addChild 802 // addChild may over-grow m_grid but we don't want to throw away the memory too early as addChild
800 // can be called in a loop (e.g during parsing). Doing it now ensures we hav e a stable-enough structure. 803 // can be called in a loop (e.g during parsing). Doing it now ensures we hav e a stable-enough structure.
801 m_grid.shrinkToFit(); 804 m_grid.shrinkToFit();
802 805
803 LayoutState state(*this, locationOffset()); 806 LayoutState state(*this, locationOffset());
804 807
805 const Vector<int>& columnPos = table()->effectiveColumnPositions(); 808 const Vector<int>& columnPos = table()->effectiveColumnPositions();
806 809
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691). 1662 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691).
1660 if (!style()->isLeftToRightDirection()) 1663 if (!style()->isLeftToRightDirection())
1661 cellLocation.setX(LayoutUnit(table()->effectiveColumnPositions()[table() ->numEffectiveColumns()] - table()->effectiveColumnPositions()[table()->absolute ColumnToEffectiveColumn(cell->absoluteColumnIndex() + cell->colSpan())] + horizo ntalBorderSpacing)); 1664 cellLocation.setX(LayoutUnit(table()->effectiveColumnPositions()[table() ->numEffectiveColumns()] - table()->effectiveColumnPositions()[table()->absolute ColumnToEffectiveColumn(cell->absoluteColumnIndex() + cell->colSpan())] + horizo ntalBorderSpacing));
1662 else 1665 else
1663 cellLocation.setX(LayoutUnit(table()->effectiveColumnPositions()[effecti veColumn] + horizontalBorderSpacing)); 1666 cellLocation.setX(LayoutUnit(table()->effectiveColumnPositions()[effecti veColumn] + horizontalBorderSpacing));
1664 1667
1665 cell->setLogicalLocation(cellLocation); 1668 cell->setLogicalLocation(cellLocation);
1666 } 1669 }
1667 1670
1668 } // namespace blink 1671 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/table/containment-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698