| 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, 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 749 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 760 // The removal has knocked us down to containing only a single anonymous | 760 // The removal has knocked us down to containing only a single anonymous |
| 761 // box. We can go ahead and pull the content right back up into our | 761 // box. We can go ahead and pull the content right back up into our |
| 762 // box. | 762 // box. |
| 763 collapseAnonymousBlockChild(this, toLayoutBlock(child)); | 763 collapseAnonymousBlockChild(this, toLayoutBlock(child)); |
| 764 } else if (((prev && prev->isAnonymousBlock()) || (next && next->isAnonymous
Block())) && canCollapseAnonymousBlockChild()) { | 764 } else if (((prev && prev->isAnonymousBlock()) || (next && next->isAnonymous
Block())) && canCollapseAnonymousBlockChild()) { |
| 765 // It's possible that the removal has knocked us down to a single anonym
ous | 765 // It's possible that the removal has knocked us down to a single anonym
ous |
| 766 // block with pseudo-style element siblings (e.g. first-letter). If thes
e | 766 // block with pseudo-style element siblings (e.g. first-letter). If thes
e |
| 767 // are floating, then we need to pull the content up also. | 767 // are floating, then we need to pull the content up also. |
| 768 LayoutBlock* anonymousBlock = toLayoutBlock((prev && prev->isAnonymousBl
ock()) ? prev : next); | 768 LayoutBlock* anonymousBlock = toLayoutBlock((prev && prev->isAnonymousBl
ock()) ? prev : next); |
| 769 if ((anonymousBlock->previousSibling() || anonymousBlock->nextSibling()) | 769 if ((anonymousBlock->previousSibling() || anonymousBlock->nextSibling()) |
| 770 && (!anonymousBlock->previousSibling() || (anonymousBlock->previousS
ibling()->style()->styleType() != NOPSEUDO && anonymousBlock->previousSibling()-
>isFloating() && !anonymousBlock->previousSibling()->previousSibling())) | 770 && (!anonymousBlock->previousSibling() || (anonymousBlock->previousS
ibling()->style()->styleType() != PseudoIdNone && anonymousBlock->previousSiblin
g()->isFloating() && !anonymousBlock->previousSibling()->previousSibling())) |
| 771 && (!anonymousBlock->nextSibling() || (anonymousBlock->nextSibling()
->style()->styleType() != NOPSEUDO && anonymousBlock->nextSibling()->isFloating(
) && !anonymousBlock->nextSibling()->nextSibling()))) { | 771 && (!anonymousBlock->nextSibling() || (anonymousBlock->nextSibling()
->style()->styleType() != PseudoIdNone && anonymousBlock->nextSibling()->isFloat
ing() && !anonymousBlock->nextSibling()->nextSibling()))) { |
| 772 collapseAnonymousBlockChild(this, anonymousBlock); | 772 collapseAnonymousBlockChild(this, anonymousBlock); |
| 773 } | 773 } |
| 774 } | 774 } |
| 775 | 775 |
| 776 if (!firstChild()) { | 776 if (!firstChild()) { |
| 777 // If this was our last child be sure to clear out our line boxes. | 777 // If this was our last child be sure to clear out our line boxes. |
| 778 if (childrenInline()) | 778 if (childrenInline()) |
| 779 deleteLineBoxTree(); | 779 deleteLineBoxTree(); |
| 780 | 780 |
| 781 // If we are an empty anonymous block in the continuation chain, | 781 // If we are an empty anonymous block in the continuation chain, |
| (...skipping 1498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2280 + (lineDirection == HorizontalLine ? borderTop() + paddingTop() : bo
rderRight() + paddingRight()); | 2280 + (lineDirection == HorizontalLine ? borderTop() + paddingTop() : bo
rderRight() + paddingRight()); |
| 2281 } | 2281 } |
| 2282 return -1; | 2282 return -1; |
| 2283 } | 2283 } |
| 2284 | 2284 |
| 2285 LayoutBlock* LayoutBlock::enclosingFirstLineStyleBlock() const | 2285 LayoutBlock* LayoutBlock::enclosingFirstLineStyleBlock() const |
| 2286 { | 2286 { |
| 2287 LayoutBlock* firstLineBlock = const_cast<LayoutBlock*>(this); | 2287 LayoutBlock* firstLineBlock = const_cast<LayoutBlock*>(this); |
| 2288 bool hasPseudo = false; | 2288 bool hasPseudo = false; |
| 2289 while (true) { | 2289 while (true) { |
| 2290 hasPseudo = firstLineBlock->style()->hasPseudoStyle(FIRST_LINE); | 2290 hasPseudo = firstLineBlock->style()->hasPseudoStyle(PseudoIdFirstLine); |
| 2291 if (hasPseudo) | 2291 if (hasPseudo) |
| 2292 break; | 2292 break; |
| 2293 LayoutObject* parentBlock = firstLineBlock->parent(); | 2293 LayoutObject* parentBlock = firstLineBlock->parent(); |
| 2294 if (firstLineBlock->isAtomicInlineLevel() || firstLineBlock->isFloatingO
rOutOfFlowPositioned() | 2294 if (firstLineBlock->isAtomicInlineLevel() || firstLineBlock->isFloatingO
rOutOfFlowPositioned() |
| 2295 || !parentBlock | 2295 || !parentBlock |
| 2296 || !parentBlock->canHaveFirstLineOrFirstLetterStyle()) | 2296 || !parentBlock->canHaveFirstLineOrFirstLetterStyle()) |
| 2297 break; | 2297 break; |
| 2298 ASSERT_WITH_SECURITY_IMPLICATION(parentBlock->isLayoutBlock()); | 2298 ASSERT_WITH_SECURITY_IMPLICATION(parentBlock->isLayoutBlock()); |
| 2299 if (toLayoutBlock(parentBlock)->firstChild() != firstLineBlock) | 2299 if (toLayoutBlock(parentBlock)->firstChild() != firstLineBlock) |
| 2300 break; | 2300 break; |
| (...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2883 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout
Object* obj) const | 2883 void LayoutBlock::showLineTreeAndMark(const InlineBox* markedBox1, const char* m
arkedLabel1, const InlineBox* markedBox2, const char* markedLabel2, const Layout
Object* obj) const |
| 2884 { | 2884 { |
| 2885 showLayoutObject(); | 2885 showLayoutObject(); |
| 2886 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) | 2886 for (const RootInlineBox* root = firstRootBox(); root; root = root->nextRoot
Box()) |
| 2887 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); | 2887 root->showLineTreeAndMark(markedBox1, markedLabel1, markedBox2, markedLa
bel2, obj, 1); |
| 2888 } | 2888 } |
| 2889 | 2889 |
| 2890 #endif | 2890 #endif |
| 2891 | 2891 |
| 2892 } // namespace blink | 2892 } // namespace blink |
| OLD | NEW |