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

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

Issue 10928003: Merge 126063 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1229/
Patch Set: Created 8 years, 3 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/block/line-layout/double-line-break-obj-removal-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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 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 * 7 *
8 * 1. Redistributions of source code must retain the above copyright 8 * 1. Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * 2. Redistributions in binary form must reproduce the above copyright 10 * 2. Redistributions in binary form must reproduce the above copyright
(...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after
314 if (!container->parent() || (container->isRenderBlock() && (container->selfN eedsLayout() || !container->isBlockFlow()))) 314 if (!container->parent() || (container->isRenderBlock() && (container->selfN eedsLayout() || !container->isBlockFlow())))
315 return; 315 return;
316 316
317 RenderInline* inlineContainer = container->isRenderInline() ? toRenderInline (container) : 0; 317 RenderInline* inlineContainer = container->isRenderInline() ? toRenderInline (container) : 0;
318 InlineBox* firstBox = inlineContainer ? inlineContainer->firstLineBoxIncludi ngCulling() : firstLineBox(); 318 InlineBox* firstBox = inlineContainer ? inlineContainer->firstLineBoxIncludi ngCulling() : firstLineBox();
319 319
320 // If we have no first line box, then just bail early. 320 // If we have no first line box, then just bail early.
321 if (!firstBox) { 321 if (!firstBox) {
322 // For an empty inline, go ahead and propagate the check up to our paren t, unless the parent 322 // For an empty inline, go ahead and propagate the check up to our paren t, unless the parent
323 // is already dirty. 323 // is already dirty.
324 if (container->isInline() && !container->parent()->ancestorLineBoxDirty( )) { 324 if (container->isInline() && !container->ancestorLineBoxDirty()) {
325 container->parent()->dirtyLinesFromChangedChild(container); 325 container->parent()->dirtyLinesFromChangedChild(container);
326 container->setAncestorLineBoxDirty(); // Mark the container to avoid dirtying the same lines again across multiple destroy() calls of the same subtr ee. 326 container->setAncestorLineBoxDirty(); // Mark the container to avoid dirtying the same lines again across multiple destroy() calls of the same subtr ee.
327 } 327 }
328 return; 328 return;
329 } 329 }
330 330
331 // Try to figure out which line box we belong in. First try to find a previ ous 331 // Try to figure out which line box we belong in. First try to find a previ ous
332 // line box by examining our siblings. If we didn't find a line box, then u se our 332 // line box by examining our siblings. If we didn't find a line box, then u se our
333 // parent's first line box. 333 // parent's first line box.
334 RootInlineBox* box = 0; 334 RootInlineBox* box = 0;
(...skipping 19 matching lines...) Expand all
354 if (box) 354 if (box)
355 break; 355 break;
356 } 356 }
357 if (!box) { 357 if (!box) {
358 if (inlineContainer && !inlineContainer->alwaysCreateLineBoxes()) { 358 if (inlineContainer && !inlineContainer->alwaysCreateLineBoxes()) {
359 // https://bugs.webkit.org/show_bug.cgi?id=60778 359 // https://bugs.webkit.org/show_bug.cgi?id=60778
360 // We may have just removed a <br> with no line box that was our fir st child. In this case 360 // We may have just removed a <br> with no line box that was our fir st child. In this case
361 // we won't find a previous sibling, but firstBox can be pointing to a following sibling. 361 // we won't find a previous sibling, but firstBox can be pointing to a following sibling.
362 // This isn't good enough, since we won't locate the root line box t hat encloses the removed 362 // This isn't good enough, since we won't locate the root line box t hat encloses the removed
363 // <br>. We have to just over-invalidate a bit and go up to our pare nt. 363 // <br>. We have to just over-invalidate a bit and go up to our pare nt.
364 if (!inlineContainer->parent()->ancestorLineBoxDirty()) { 364 if (!inlineContainer->ancestorLineBoxDirty()) {
365 inlineContainer->parent()->dirtyLinesFromChangedChild(inlineCont ainer); 365 inlineContainer->parent()->dirtyLinesFromChangedChild(inlineCont ainer);
366 inlineContainer->setAncestorLineBoxDirty(); // Mark the containe r to avoid dirtying the same lines again across multiple destroy() calls of the same subtree. 366 inlineContainer->setAncestorLineBoxDirty(); // Mark the containe r to avoid dirtying the same lines again across multiple destroy() calls of the same subtree.
367 } 367 }
368 return; 368 return;
369 } 369 }
370 box = firstBox->root(); 370 box = firstBox->root();
371 } 371 }
372 372
373 // If we found a line box, then dirty it. 373 // If we found a line box, then dirty it.
374 if (box) { 374 if (box) {
(...skipping 26 matching lines...) Expand all
401 ASSERT(child->prevLineBox() == prev); 401 ASSERT(child->prevLineBox() == prev);
402 prev = child; 402 prev = child;
403 } 403 }
404 ASSERT(prev == m_lastLineBox); 404 ASSERT(prev == m_lastLineBox);
405 #endif 405 #endif
406 } 406 }
407 407
408 #endif 408 #endif
409 409
410 } 410 }
OLDNEW
« no previous file with comments | « LayoutTests/fast/block/line-layout/double-line-break-obj-removal-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698