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

Side by Side Diff: Source/WebCore/rendering/RenderBox.cpp

Issue 10809080: Merge 123062 - Crash in RenderTableSection::addCell. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com) 4 * (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com) 5 * (C) 2005, 2006 Samuel Weinig (sam.weinig@gmail.com)
6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed. 6 * Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All rights reserv ed.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 3933 matching lines...) Expand 10 before | Expand all | Expand 10 after
3944 { 3944 {
3945 return style()->logicalHeight().isPercent() 3945 return style()->logicalHeight().isPercent()
3946 || style()->logicalMinHeight().isPercent() 3946 || style()->logicalMinHeight().isPercent()
3947 || style()->logicalMaxHeight().isPercent(); 3947 || style()->logicalMaxHeight().isPercent();
3948 } 3948 }
3949 3949
3950 static void markBoxForRelayoutAfterSplit(RenderBox* box) 3950 static void markBoxForRelayoutAfterSplit(RenderBox* box)
3951 { 3951 {
3952 // FIXME: The table code should handle that automatically. If not, 3952 // FIXME: The table code should handle that automatically. If not,
3953 // we should fix it and remove the table part checks. 3953 // we should fix it and remove the table part checks.
3954 if (box->isTable()) 3954 if (box->isTable()) {
3955 toRenderTable(box)->setNeedsSectionRecalc(); 3955 // Because we may have added some sections with already computed column structures, we need to
3956 else if (box->isTableSection()) 3956 // sync the table structure with them now. This avoids crashes when addi ng new cells to the table.
3957 toRenderTable(box)->forceSectionsRecalc();
3958 } else if (box->isTableSection())
3957 toRenderTableSection(box)->setNeedsCellRecalc(); 3959 toRenderTableSection(box)->setNeedsCellRecalc();
3958 3960
3959 box->setNeedsLayoutAndPrefWidthsRecalc(); 3961 box->setNeedsLayoutAndPrefWidthsRecalc();
3960 } 3962 }
3961 3963
3962 RenderObject* RenderBox::splitAnonymousBoxesAroundChild(RenderObject* beforeChil d) 3964 RenderObject* RenderBox::splitAnonymousBoxesAroundChild(RenderObject* beforeChil d)
3963 { 3965 {
3964 bool didSplitParentAnonymousBoxes = false; 3966 bool didSplitParentAnonymousBoxes = false;
3965 3967
3966 while (beforeChild->parent() != this) { 3968 while (beforeChild->parent() != this) {
(...skipping 18 matching lines...) Expand all
3985 } 3987 }
3986 3988
3987 if (didSplitParentAnonymousBoxes) 3989 if (didSplitParentAnonymousBoxes)
3988 markBoxForRelayoutAfterSplit(this); 3990 markBoxForRelayoutAfterSplit(this);
3989 3991
3990 ASSERT(beforeChild->parent() == this); 3992 ASSERT(beforeChild->parent() == this);
3991 return beforeChild; 3993 return beforeChild;
3992 } 3994 }
3993 3995
3994 } // namespace WebCore 3996 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/table/split-table-no-section-update-crash-expected.txt ('k') | Source/WebCore/rendering/RenderTable.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698