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

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

Issue 488163002: [CSSGridLayout] <embed> elements leaving stale pointers into grid (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 4 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 | « LayoutTests/fast/css-grid-layout/grid-element-embed-crash-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) 2011 Apple Inc. All rights reserved. 2 * Copyright (C) 2011 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 } 199 }
200 200
201 void RenderGrid::addChild(RenderObject* newChild, RenderObject* beforeChild) 201 void RenderGrid::addChild(RenderObject* newChild, RenderObject* beforeChild)
202 { 202 {
203 // If the new requested beforeChild is not one of our children is because it 's wrapped by an anonymous container. If 203 // If the new requested beforeChild is not one of our children is because it 's wrapped by an anonymous container. If
204 // we do not special case this situation we could end up calling addChild() twice for the newChild, one with the 204 // we do not special case this situation we could end up calling addChild() twice for the newChild, one with the
205 // initial beforeChild and another one with its parent. 205 // initial beforeChild and another one with its parent.
206 if (beforeChild && beforeChild->parent() != this) { 206 if (beforeChild && beforeChild->parent() != this) {
207 ASSERT(beforeChild->parent()->isAnonymous()); 207 ASSERT(beforeChild->parent()->isAnonymous());
208 beforeChild = splitAnonymousBoxesAroundChild(beforeChild); 208 beforeChild = splitAnonymousBoxesAroundChild(beforeChild);
209 dirtyGrid();
209 } 210 }
210 211
211 RenderBlock::addChild(newChild, beforeChild); 212 RenderBlock::addChild(newChild, beforeChild);
212 213
213 if (gridIsDirty()) 214 if (gridIsDirty())
214 return; 215 return;
215 216
216 if (!newChild->isBox()) { 217 if (!newChild->isBox()) {
217 dirtyGrid(); 218 dirtyGrid();
218 return; 219 return;
(...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 if (isOutOfFlowPositioned()) 1424 if (isOutOfFlowPositioned())
1424 return "RenderGrid (positioned)"; 1425 return "RenderGrid (positioned)";
1425 if (isAnonymous()) 1426 if (isAnonymous())
1426 return "RenderGrid (generated)"; 1427 return "RenderGrid (generated)";
1427 if (isRelPositioned()) 1428 if (isRelPositioned())
1428 return "RenderGrid (relative positioned)"; 1429 return "RenderGrid (relative positioned)";
1429 return "RenderGrid"; 1430 return "RenderGrid";
1430 } 1431 }
1431 1432
1432 } // namespace blink 1433 } // namespace blink
OLDNEW
« no previous file with comments | « LayoutTests/fast/css-grid-layout/grid-element-embed-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698