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

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

Issue 8437038: Merge 98010 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/912/
Patch Set: Created 9 years, 1 month 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 * (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 Apple Inc. All r ights reserved. 5 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Apple Inc. All r ights 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 5551 matching lines...) Expand 10 before | Expand all | Expand 10 after
5562 5562
5563 if (!currChild) 5563 if (!currChild)
5564 return; 5564 return;
5565 5565
5566 // If the child already has style, then it has already been created, so we j ust want 5566 // If the child already has style, then it has already been created, so we j ust want
5567 // to update it. 5567 // to update it.
5568 if (currChild->parent()->style()->styleType() == FIRST_LETTER) { 5568 if (currChild->parent()->style()->styleType() == FIRST_LETTER) {
5569 RenderObject* firstLetter = currChild->parent(); 5569 RenderObject* firstLetter = currChild->parent();
5570 RenderObject* firstLetterContainer = firstLetter->parent(); 5570 RenderObject* firstLetterContainer = firstLetter->parent();
5571 RenderStyle* pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLe tterContainer); 5571 RenderStyle* pseudoStyle = styleForFirstLetter(firstLetterBlock, firstLe tterContainer);
5572 ASSERT(firstLetter->isFloating() || firstLetter->isInline());
5572 5573
5573 if (Node::diff(firstLetter->style(), pseudoStyle) == Node::Detach) { 5574 if (Node::diff(firstLetter->style(), pseudoStyle) == Node::Detach) {
5574 // The first-letter renderer needs to be replaced. Create a new rend erer of the right type. 5575 // The first-letter renderer needs to be replaced. Create a new rend erer of the right type.
5575 RenderObject* newFirstLetter; 5576 RenderObject* newFirstLetter;
5576 if (pseudoStyle->display() == INLINE) 5577 if (pseudoStyle->display() == INLINE)
5577 newFirstLetter = new (renderArena()) RenderInline(document()); 5578 newFirstLetter = new (renderArena()) RenderInline(document());
5578 else 5579 else
5579 newFirstLetter = new (renderArena()) RenderBlock(document()); 5580 newFirstLetter = new (renderArena()) RenderBlock(document());
5580 newFirstLetter->setStyle(pseudoStyle); 5581 newFirstLetter->setStyle(pseudoStyle);
5581 5582
(...skipping 10 matching lines...) Expand all
5592 RenderObject* nextSibling = firstLetter->nextSibling(); 5593 RenderObject* nextSibling = firstLetter->nextSibling();
5593 RenderObject* next = nextSibling; 5594 RenderObject* next = nextSibling;
5594 while (next) { 5595 while (next) {
5595 if (next->isText() && toRenderText(next)->isTextFragment()) { 5596 if (next->isText() && toRenderText(next)->isTextFragment()) {
5596 remainingText = toRenderTextFragment(next); 5597 remainingText = toRenderTextFragment(next);
5597 break; 5598 break;
5598 } 5599 }
5599 next = next->nextSibling(); 5600 next = next->nextSibling();
5600 } 5601 }
5601 if (remainingText) { 5602 if (remainingText) {
5602 ASSERT(remainingText->node()->renderer() == remainingText); 5603 ASSERT(remainingText->isAnonymous() || remainingText->node()->re nderer() == remainingText);
5603 // Replace the old renderer with the new one. 5604 // Replace the old renderer with the new one.
5604 remainingText->setFirstLetter(newFirstLetter); 5605 remainingText->setFirstLetter(newFirstLetter);
5605 } 5606 }
5606 firstLetter->destroy(); 5607 firstLetter->destroy();
5607 firstLetter = newFirstLetter; 5608 firstLetter = newFirstLetter;
5608 firstLetterContainer->addChild(firstLetter, nextSibling); 5609 firstLetterContainer->addChild(firstLetter, nextSibling);
5609 } else 5610 } else
5610 firstLetter->setStyle(pseudoStyle); 5611 firstLetter->setStyle(pseudoStyle);
5611 5612
5612 for (RenderObject* genChild = firstLetter->firstChild(); genChild; genCh ild = genChild->nextSibling()) { 5613 for (RenderObject* genChild = firstLetter->firstChild(); genChild; genCh ild = genChild->nextSibling()) {
(...skipping 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
6893 } 6894 }
6894 6895
6895 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject) 6896 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl oatingObject* floatingObject)
6896 { 6897 {
6897 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); 6898 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x( ), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY());
6898 } 6899 }
6899 6900
6900 #endif 6901 #endif
6901 6902
6902 } // namespace WebCore 6903 } // namespace WebCore
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698