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

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

Issue 10416046: Merge 116325 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 7 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-generated-content/first-letter-next-sibling-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) 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) 2007 David Smith (catfish.man@gmail.com) 4 * (C) 2007 David Smith (catfish.man@gmail.com)
5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserved.
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
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 5947 matching lines...) Expand 10 before | Expand all | Expand 10 after
5958 RenderObject* nextSibling = firstLetter->nextSibling(); 5958 RenderObject* nextSibling = firstLetter->nextSibling();
5959 RenderObject* remainingTextObject = toRenderBoxModelObject(firstLetter)- >firstLetterRemainingText(); 5959 RenderObject* remainingTextObject = toRenderBoxModelObject(firstLetter)- >firstLetterRemainingText();
5960 if (remainingTextObject && remainingTextObject->isText() && toRenderText (remainingTextObject)->isTextFragment()) 5960 if (remainingTextObject && remainingTextObject->isText() && toRenderText (remainingTextObject)->isTextFragment())
5961 remainingText = toRenderTextFragment(remainingTextObject); 5961 remainingText = toRenderTextFragment(remainingTextObject);
5962 if (remainingText) { 5962 if (remainingText) {
5963 ASSERT(remainingText->isAnonymous() || remainingText->node()->render er() == remainingText); 5963 ASSERT(remainingText->isAnonymous() || remainingText->node()->render er() == remainingText);
5964 // Replace the old renderer with the new one. 5964 // Replace the old renderer with the new one.
5965 remainingText->setFirstLetter(newFirstLetter); 5965 remainingText->setFirstLetter(newFirstLetter);
5966 toRenderBoxModelObject(newFirstLetter)->setFirstLetterRemainingText( remainingText); 5966 toRenderBoxModelObject(newFirstLetter)->setFirstLetterRemainingText( remainingText);
5967 } 5967 }
5968 // To prevent removal of single anonymous block in RenderBlock::removeCh ild and causing
5969 // |nextSibling| to go stale, we remove the old first letter using remov eChildNode first.
5970 firstLetterContainer->virtualChildren()->removeChildNode(firstLetterCont ainer, firstLetter);
5968 firstLetter->destroy(); 5971 firstLetter->destroy();
5969 firstLetter = newFirstLetter; 5972 firstLetter = newFirstLetter;
5970 firstLetterContainer->addChild(firstLetter, nextSibling); 5973 firstLetterContainer->addChild(firstLetter, nextSibling);
5971 } else 5974 } else
5972 firstLetter->setStyle(pseudoStyle); 5975 firstLetter->setStyle(pseudoStyle);
5973 5976
5974 for (RenderObject* genChild = firstLetter->firstChild(); genChild; genChild = genChild->nextSibling()) { 5977 for (RenderObject* genChild = firstLetter->firstChild(); genChild; genChild = genChild->nextSibling()) {
5975 if (genChild->isText()) 5978 if (genChild->isText())
5976 genChild->setStyle(pseudoStyle); 5979 genChild->setStyle(pseudoStyle);
5977 } 5980 }
(...skipping 1349 matching lines...) Expand 10 before | Expand all | Expand 10 after
7327 } 7330 }
7328 7331
7329 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject) 7332 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject)
7330 { 7333 {
7331 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); 7334 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY());
7332 } 7335 }
7333 7336
7334 #endif 7337 #endif
7335 7338
7336 } // namespace WebCore 7339 } // namespace WebCore
OLDNEW
« no previous file with comments | « LayoutTests/fast/css-generated-content/first-letter-next-sibling-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698