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

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

Issue 880113002: Fix crash when establishing an inline continuation inside a block continuation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 if (madeNewBeforeBlock) { 496 if (madeNewBeforeBlock) {
497 RenderObject* o = boxFirst; 497 RenderObject* o = boxFirst;
498 while (o) { 498 while (o) {
499 RenderObject* no = o; 499 RenderObject* no = o;
500 o = no->nextSibling(); 500 o = no->nextSibling();
501 pre->children()->appendChildNode(pre, block->children()->removeChild Node(block, no)); 501 pre->children()->appendChildNode(pre, block->children()->removeChild Node(block, no));
502 no->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation(); 502 no->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
503 } 503 }
504 } 504 }
505 505
506 // Always just do a full layout in order to ensure that line boxes (especial ly wrappers for images)
507 // get deleted properly. Because objects moves from the pre block into the post block, we want to
508 // make new line boxes instead of leaving the old line boxes around.
509 pre->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
510 block->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
511 post->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
mstensho (USE GERRIT) 2015/01/28 10:43:16 If we only keep this change but drop the ones in R
dsinclair 2015/01/28 16:35:01 So, this is moved up just to guard against the cas
mstensho (USE GERRIT) 2015/01/28 16:51:19 Correct. But I don't know if would still be possib
dsinclair 2015/01/28 17:08:06 Yea, lets put this back in that case, and file a b
mstensho (USE GERRIT) 2015/01/28 17:19:54 Done. Sounds like something to do while working o
512
506 splitInlines(pre, post, newBlockBox, beforeChild, oldCont); 513 splitInlines(pre, post, newBlockBox, beforeChild, oldCont);
507 514
508 // We already know the newBlockBox isn't going to contain inline kids, so av oid wasting 515 // We already know the newBlockBox isn't going to contain inline kids, so av oid wasting
509 // time in makeChildrenNonInline by just setting this explicitly up front. 516 // time in makeChildrenNonInline by just setting this explicitly up front.
510 newBlockBox->setChildrenInline(false); 517 newBlockBox->setChildrenInline(false);
511 518
512 newBlockBox->addChild(newChild); 519 newBlockBox->addChild(newChild);
513
514 // Always just do a full layout in order to ensure that line boxes (especial ly wrappers for images)
515 // get deleted properly. Because objects moves from the pre block into the post block, we want to
516 // make new line boxes instead of leaving the old line boxes around.
517 pre->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
518 block->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
519 post->setNeedsLayoutAndPrefWidthsRecalcAndFullPaintInvalidation();
520 } 520 }
521 521
522 void RenderInline::addChildToContinuation(RenderObject* newChild, RenderObject* beforeChild) 522 void RenderInline::addChildToContinuation(RenderObject* newChild, RenderObject* beforeChild)
523 { 523 {
524 RenderBoxModelObject* flow = continuationBefore(beforeChild); 524 RenderBoxModelObject* flow = continuationBefore(beforeChild);
525 ASSERT(!beforeChild || beforeChild->parent()->isRenderBlock() || beforeChild ->parent()->isRenderInline()); 525 ASSERT(!beforeChild || beforeChild->parent()->isRenderBlock() || beforeChild ->parent()->isRenderInline());
526 RenderBoxModelObject* beforeChildParent = 0; 526 RenderBoxModelObject* beforeChildParent = 0;
527 if (beforeChild) 527 if (beforeChild)
528 beforeChildParent = toRenderBoxModelObject(beforeChild->parent()); 528 beforeChildParent = toRenderBoxModelObject(beforeChild->parent());
529 else { 529 else {
(...skipping 920 matching lines...) Expand 10 before | Expand all | Expand 10 after
1450 container = this; 1450 container = this;
1451 1451
1452 FloatPoint absPos = container->localToAbsolute(); 1452 FloatPoint absPos = container->localToAbsolute();
1453 region.bounds.setX(absPos.x() + region.bounds.x()); 1453 region.bounds.setX(absPos.x() + region.bounds.x());
1454 region.bounds.setY(absPos.y() + region.bounds.y()); 1454 region.bounds.setY(absPos.y() + region.bounds.y());
1455 1455
1456 regions.append(region); 1456 regions.append(region);
1457 } 1457 }
1458 1458
1459 } // namespace blink 1459 } // namespace blink
OLDNEW
« Source/core/rendering/RenderBlock.cpp ('K') | « Source/core/rendering/RenderBlock.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698