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) 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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
704 if (inActiveChain()) | 704 if (inActiveChain()) |
705 doc.activeChainNodeDetached(this); | 705 doc.activeChainNodeDetached(this); |
706 doc.userActionElements().didDetach(this); | 706 doc.userActionElements().didDetach(this); |
707 } | 707 } |
708 } | 708 } |
709 | 709 |
710 setStyleChange(NeedsReattachStyleChange); | 710 setStyleChange(NeedsReattachStyleChange); |
711 setChildNeedsStyleRecalc(); | 711 setChildNeedsStyleRecalc(); |
712 } | 712 } |
713 | 713 |
714 void Node::reattachWhitespaceSiblings(Text* start) | |
715 { | |
716 for (Node* sibling = start; sibling; sibling = sibling->nextSibling()) { | |
717 if (sibling->isTextNode() && toText(sibling)->containsOnlyWhitespace())
{ | |
718 bool hadRenderer = !!sibling->renderer(); | |
719 sibling->reattach(); | |
720 // If the reattach didn't toggle the visibility of the whitespace we
don't | |
721 // need to continue reattaching siblings since they won't toggle vis
ibility | |
722 // either. | |
723 if (hadRenderer == !!sibling->renderer()) | |
724 return; | |
725 } else if (sibling->renderer()) { | |
726 return; | |
727 } | |
728 } | |
729 } | |
730 | |
731 // FIXME: This code is used by editing. Seems like it could move over there and
not pollute Node. | 714 // FIXME: This code is used by editing. Seems like it could move over there and
not pollute Node. |
732 Node *Node::previousNodeConsideringAtomicNodes() const | 715 Node *Node::previousNodeConsideringAtomicNodes() const |
733 { | 716 { |
734 if (previousSibling()) { | 717 if (previousSibling()) { |
735 Node *n = previousSibling(); | 718 Node *n = previousSibling(); |
736 while (!isAtomicNode(n) && n->lastChild()) | 719 while (!isAtomicNode(n) && n->lastChild()) |
737 n = n->lastChild(); | 720 n = n->lastChild(); |
738 return n; | 721 return n; |
739 } | 722 } |
740 else if (parentNode()) { | 723 else if (parentNode()) { |
(...skipping 939 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1680 node->showTreeForThis(); | 1663 node->showTreeForThis(); |
1681 } | 1664 } |
1682 | 1665 |
1683 void showNodePath(const blink::Node* node) | 1666 void showNodePath(const blink::Node* node) |
1684 { | 1667 { |
1685 if (node) | 1668 if (node) |
1686 node->showNodePathForThis(); | 1669 node->showNodePathForThis(); |
1687 } | 1670 } |
1688 | 1671 |
1689 #endif | 1672 #endif |
OLD | NEW |