OLD | NEW |
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 5600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5611 RenderTextFragment* remainingText = 0; | 5611 RenderTextFragment* remainingText = 0; |
5612 RenderObject* nextSibling = firstLetter->nextSibling(); | 5612 RenderObject* nextSibling = firstLetter->nextSibling(); |
5613 RenderObject* next = nextSibling; | 5613 RenderObject* next = nextSibling; |
5614 while (next) { | 5614 while (next) { |
5615 if (next->isText() && toRenderText(next)->isTextFragment()) { | 5615 if (next->isText() && toRenderText(next)->isTextFragment()) { |
5616 remainingText = toRenderTextFragment(next); | 5616 remainingText = toRenderTextFragment(next); |
5617 break; | 5617 break; |
5618 } | 5618 } |
5619 next = next->nextSibling(); | 5619 next = next->nextSibling(); |
5620 } | 5620 } |
| 5621 if (!remainingText && firstLetterContainer->isAnonymousBlock()) { |
| 5622 // The remaining text fragment could have been wrapped in a diff
erent anonymous block since creation |
| 5623 RenderObject* nextChild; |
| 5624 next = firstLetterContainer->nextSibling(); |
| 5625 while (next && !remainingText) { |
| 5626 if (next->isAnonymousBlock()) { |
| 5627 nextChild = next->firstChild(); |
| 5628 while (nextChild) { |
| 5629 if (nextChild->isText() && toRenderText(nextChild)->
isTextFragment() |
| 5630 && (toRenderTextFragment(nextChild)->firstLetter
() == firstLetter)) { |
| 5631 remainingText = toRenderTextFragment(nextChild); |
| 5632 break; |
| 5633 } |
| 5634 nextChild = nextChild->nextSibling(); |
| 5635 } |
| 5636 } else |
| 5637 break; |
| 5638 next = next->nextSibling(); |
| 5639 } |
| 5640 } |
5621 if (remainingText) { | 5641 if (remainingText) { |
5622 ASSERT(remainingText->isAnonymous() || remainingText->node()->re
nderer() == remainingText); | 5642 ASSERT(remainingText->isAnonymous() || remainingText->node()->re
nderer() == remainingText); |
5623 // Replace the old renderer with the new one. | 5643 // Replace the old renderer with the new one. |
5624 remainingText->setFirstLetter(newFirstLetter); | 5644 remainingText->setFirstLetter(newFirstLetter); |
5625 } | 5645 } |
5626 firstLetter->destroy(); | 5646 firstLetter->destroy(); |
5627 firstLetter = newFirstLetter; | 5647 firstLetter = newFirstLetter; |
5628 firstLetterContainer->addChild(firstLetter, nextSibling); | 5648 firstLetterContainer->addChild(firstLetter, nextSibling); |
5629 } else | 5649 } else |
5630 firstLetter->setStyle(pseudoStyle); | 5650 firstLetter->setStyle(pseudoStyle); |
(...skipping 1282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6913 } | 6933 } |
6914 | 6934 |
6915 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) | 6935 String ValueToString<RenderBlock::FloatingObject*>::string(const RenderBlock::Fl
oatingObject* floatingObject) |
6916 { | 6936 { |
6917 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x(
), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); | 6937 return String::format("%p (%dx%d %dx%d)", floatingObject, floatingObject->x(
), floatingObject->y(), floatingObject->maxX(), floatingObject->maxY()); |
6918 } | 6938 } |
6919 | 6939 |
6920 #endif | 6940 #endif |
6921 | 6941 |
6922 } // namespace WebCore | 6942 } // namespace WebCore |
OLD | NEW |