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

Unified Diff: Source/WebCore/rendering/RenderBlock.cpp

Issue 6588060: Merge 78744 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/648/
Patch Set: Created 9 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/fast/css/first-letter-text-fragment-crash-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/rendering/RenderBlock.cpp
===================================================================
--- Source/WebCore/rendering/RenderBlock.cpp (revision 79902)
+++ Source/WebCore/rendering/RenderBlock.cpp (working copy)
@@ -5173,13 +5173,25 @@
firstLetter->removeChild(child);
newFirstLetter->addChild(child, 0);
}
- RenderTextFragment* remainingText = toRenderTextFragment(firstLetter->nextSibling());
- ASSERT(remainingText->node()->renderer() == remainingText);
- // Replace the old renderer with the new one.
- remainingText->setFirstLetter(newFirstLetter);
+
+ RenderTextFragment* remainingText = 0;
+ RenderObject* nextSibling = firstLetter->nextSibling();
+ RenderObject* next = nextSibling;
+ while (next) {
+ if (next->isText() && toRenderText(next)->isTextFragment()) {
+ remainingText = toRenderTextFragment(next);
+ break;
+ }
+ next = next->nextSibling();
+ }
+ if (remainingText) {
+ ASSERT(remainingText->node()->renderer() == remainingText);
+ // Replace the old renderer with the new one.
+ remainingText->setFirstLetter(newFirstLetter);
+ }
firstLetter->destroy();
firstLetter = newFirstLetter;
- firstLetterContainer->addChild(firstLetter, remainingText);
+ firstLetterContainer->addChild(firstLetter, nextSibling);
view()->enableLayoutState();
} else
firstLetter->setStyle(pseudoStyle);
« no previous file with comments | « LayoutTests/fast/css/first-letter-text-fragment-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698