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

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

Issue 2037443002: [css] Bandaid fix for crash when tables and containment mix. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
795 795
796 ASSERT(!needsLayout()); 796 ASSERT(!needsLayout());
797 797
798 return m_rowPos[m_grid.size()]; 798 return m_rowPos[m_grid.size()];
799 } 799 }
800 800
801 void LayoutTableSection::layout() 801 void LayoutTableSection::layout()
802 { 802 {
803 ASSERT(needsLayout()); 803 ASSERT(needsLayout());
804 LayoutAnalyzer::Scope analyzer(*this); 804 LayoutAnalyzer::Scope analyzer(*this);
805 ASSERT(!needsCellRecalc()); 805 // TODO(dgrogan): Change this to RELEASE_ASSERT(!needsCellRecalc()) once
806 // containment and tables play nicely. https://crbug.com/616643
807 if (needsCellRecalc())
808 return;
806 ASSERT(!table()->needsSectionRecalc()); 809 ASSERT(!table()->needsSectionRecalc());
807 810
808 // addChild may over-grow m_grid but we don't want to throw away the memory too early as addChild 811 // addChild may over-grow m_grid but we don't want to throw away the memory too early as addChild
809 // can be called in a loop (e.g during parsing). Doing it now ensures we hav e a stable-enough structure. 812 // can be called in a loop (e.g during parsing). Doing it now ensures we hav e a stable-enough structure.
810 m_grid.shrinkToFit(); 813 m_grid.shrinkToFit();
811 814
812 LayoutState state(*this, locationOffset()); 815 LayoutState state(*this, locationOffset());
813 816
814 const Vector<int>& columnPos = table()->effectiveColumnPositions(); 817 const Vector<int>& columnPos = table()->effectiveColumnPositions();
815 818
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after
1668 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691). 1671 // FIXME: The table's direction should determine our row's direction, not th e section's (see bug 96691).
1669 if (!style()->isLeftToRightDirection()) 1672 if (!style()->isLeftToRightDirection())
1670 cellLocation.setX(LayoutUnit(table()->effectiveColumnPositions()[table() ->numEffectiveColumns()] - table()->effectiveColumnPositions()[table()->absolute ColumnToEffectiveColumn(cell->absoluteColumnIndex() + cell->colSpan())] + horizo ntalBorderSpacing)); 1673 cellLocation.setX(LayoutUnit(table()->effectiveColumnPositions()[table() ->numEffectiveColumns()] - table()->effectiveColumnPositions()[table()->absolute ColumnToEffectiveColumn(cell->absoluteColumnIndex() + cell->colSpan())] + horizo ntalBorderSpacing));
1671 else 1674 else
1672 cellLocation.setX(LayoutUnit(table()->effectiveColumnPositions()[effecti veColumn] + horizontalBorderSpacing)); 1675 cellLocation.setX(LayoutUnit(table()->effectiveColumnPositions()[effecti veColumn] + horizontalBorderSpacing));
1673 1676
1674 cell->setLogicalLocation(cellLocation); 1677 cell->setLogicalLocation(cellLocation);
1675 } 1678 }
1676 1679
1677 } // namespace blink 1680 } // 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