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

Side by Side Diff: Source/core/dom/Node.cpp

Issue 58373002: Whitespace only text nodes need to be reattached when their siblings are reattached (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fixing reattach logic and killing WhitespaceChildList. Will probably need some updated mac expectat… Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/WhitespaceChildList.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) 2001 Dirk Mueller (mueller@kde.org) 4 * (C) 2001 Dirk Mueller (mueller@kde.org)
5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved. 5 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All r ights reserved.
6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) 6 * Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies)
7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/) 7 * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmo bile.com/)
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 985 matching lines...) Expand 10 before | Expand all | Expand 10 after
996 } 996 }
997 } 997 }
998 998
999 clearFlag(IsAttachedFlag); 999 clearFlag(IsAttachedFlag);
1000 1000
1001 #ifndef NDEBUG 1001 #ifndef NDEBUG
1002 detachingNode = 0; 1002 detachingNode = 0;
1003 #endif 1003 #endif
1004 } 1004 }
1005 1005
1006 void Node::reattachWhitespaceSiblings() const
1007 {
1008 for (Node* sibling = nextSibling(); sibling; sibling = sibling->nextSibling( )) {
1009 if (sibling->isTextNode() && toText(sibling)->containsOnlyWhitespace())
1010 sibling->reattach();
leviw_travelin_and_unemployed 2013/11/04 23:43:09 The previous version wouldn't reattach whitespace
1011 else if (sibling->renderer())
1012 return;
1013 }
1014 }
1015
1006 // FIXME: This code is used by editing. Seems like it could move over there and not pollute Node. 1016 // FIXME: This code is used by editing. Seems like it could move over there and not pollute Node.
1007 Node *Node::previousNodeConsideringAtomicNodes() const 1017 Node *Node::previousNodeConsideringAtomicNodes() const
1008 { 1018 {
1009 if (previousSibling()) { 1019 if (previousSibling()) {
1010 Node *n = previousSibling(); 1020 Node *n = previousSibling();
1011 while (!isAtomicNode(n) && n->lastChild()) 1021 while (!isAtomicNode(n) && n->lastChild())
1012 n = n->lastChild(); 1022 n = n->lastChild();
1013 return n; 1023 return n;
1014 } 1024 }
1015 else if (parentNode()) { 1025 else if (parentNode()) {
(...skipping 1614 matching lines...) Expand 10 before | Expand all | Expand 10 after
2630 node->showTreeForThis(); 2640 node->showTreeForThis();
2631 } 2641 }
2632 2642
2633 void showNodePath(const WebCore::Node* node) 2643 void showNodePath(const WebCore::Node* node)
2634 { 2644 {
2635 if (node) 2645 if (node)
2636 node->showNodePathForThis(); 2646 node->showNodePathForThis();
2637 } 2647 }
2638 2648
2639 #endif 2649 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/Node.h ('k') | Source/core/dom/WhitespaceChildList.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698