Chromium Code Reviews| Index: Source/core/dom/Node.cpp |
| diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp |
| index 89f80b54a0abb8e03fe2d50d433194f6fae29cd6..7a4f7c6541e0326fbcc40d639fe78bcb5de140f5 100644 |
| --- a/Source/core/dom/Node.cpp |
| +++ b/Source/core/dom/Node.cpp |
| @@ -1003,6 +1003,16 @@ void Node::detach(const AttachContext& context) |
| #endif |
| } |
| +void Node::reattachWhitespaceSiblings() const |
| +{ |
| + for (Node* sibling = nextSibling(); sibling; sibling = sibling->nextSibling()) { |
| + if (sibling->isTextNode() && toText(sibling)->containsOnlyWhitespace()) |
| + sibling->reattach(); |
|
leviw_travelin_and_unemployed
2013/11/04 23:43:09
The previous version wouldn't reattach whitespace
|
| + else if (sibling->renderer()) |
| + return; |
| + } |
| +} |
| + |
| // FIXME: This code is used by editing. Seems like it could move over there and not pollute Node. |
| Node *Node::previousNodeConsideringAtomicNodes() const |
| { |