| 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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009 Apple Inc. All rights
reserved. |
| 5 * | 5 * |
| 6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
| 7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
| 8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
| 9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
| 10 * | 10 * |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 287 if (style.preserveNewline()) | 287 if (style.preserveNewline()) |
| 288 return true; | 288 return true; |
| 289 | 289 |
| 290 // childNeedsDistributionRecalc() here is rare, only happens JS calling surr
oundContents() etc. from DOMNodeInsertedIntoDocument etc. | 290 // childNeedsDistributionRecalc() here is rare, only happens JS calling surr
oundContents() etc. from DOMNodeInsertedIntoDocument etc. |
| 291 if (document().childNeedsDistributionRecalc()) | 291 if (document().childNeedsDistributionRecalc()) |
| 292 return true; | 292 return true; |
| 293 | 293 |
| 294 const LayoutObject* prev = LayoutTreeBuilderTraversal::previousSiblingLayout
Object(*this); | 294 const LayoutObject* prev = LayoutTreeBuilderTraversal::previousSiblingLayout
Object(*this); |
| 295 if (prev && prev->isBR()) // <span><br/> <br/></span> | 295 if (prev && prev->isBR()) // <span><br/> <br/></span> |
| 296 return false; | 296 return false; |
| 297 if (prev && prev->isText() && prev->node()->isTextNode() && toText(prev->nod
e())->containsOnlyWhitespace()) | |
| 298 return false; | |
| 299 | 297 |
| 300 if (parent.isLayoutInline()) { | 298 if (parent.isLayoutInline()) { |
| 301 // <span><div/> <div/></span> | 299 // <span><div/> <div/></span> |
| 302 if (prev && !prev->isInline() && !prev->isOutOfFlowPositioned()) | 300 if (prev && !prev->isInline() && !prev->isOutOfFlowPositioned()) |
| 303 return false; | 301 return false; |
| 304 } else { | 302 } else { |
| 305 if (parent.isLayoutBlock() && !parent.childrenInline() && (!prev || !pre
v->isInline())) | 303 if (parent.isLayoutBlock() && !parent.childrenInline() && (!prev || !pre
v->isInline())) |
| 306 return false; | 304 return false; |
| 307 | 305 |
| 308 // Avoiding creation of a layoutObject for the text node is a non-essent
ial memory optimization. | 306 // Avoiding creation of a layoutObject for the text node is a non-essent
ial memory optimization. |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 { | 438 { |
| 441 return create(document(), data); | 439 return create(document(), data); |
| 442 } | 440 } |
| 443 | 441 |
| 444 DEFINE_TRACE(Text) | 442 DEFINE_TRACE(Text) |
| 445 { | 443 { |
| 446 CharacterData::trace(visitor); | 444 CharacterData::trace(visitor); |
| 447 } | 445 } |
| 448 | 446 |
| 449 } // namespace blink | 447 } // namespace blink |
| OLD | NEW |