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 879 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
890 } | 890 } |
891 | 891 |
892 // FIXME: End of obviously misplaced HTML editing functions. Try to move these
out of Node. | 892 // FIXME: End of obviously misplaced HTML editing functions. Try to move these
out of Node. |
893 | 893 |
894 Document* Node::ownerDocument() const | 894 Document* Node::ownerDocument() const |
895 { | 895 { |
896 Document* doc = &document(); | 896 Document* doc = &document(); |
897 return doc == this ? 0 : doc; | 897 return doc == this ? 0 : doc; |
898 } | 898 } |
899 | 899 |
| 900 ContainerNode* Node::ownerScope() const |
| 901 { |
| 902 if (inDocument()) |
| 903 return &treeScope().rootNode(); |
| 904 if (ShadowRoot* root = containingShadowRoot()) |
| 905 return root; |
| 906 return 0; |
| 907 } |
| 908 |
900 static void appendTextContent(const Node* node, bool convertBRsToNewlines, Strin
gBuilder& content) | 909 static void appendTextContent(const Node* node, bool convertBRsToNewlines, Strin
gBuilder& content) |
901 { | 910 { |
902 if (node->nodeType() == Node::TEXT_NODE) { | 911 if (node->nodeType() == Node::TEXT_NODE) { |
903 content.append(toCharacterData(node)->data()); | 912 content.append(toCharacterData(node)->data()); |
904 return; | 913 return; |
905 } | 914 } |
906 | 915 |
907 for (Node* child = toContainerNode(node)->firstChild(); child; child = child
->nextSibling()) { | 916 for (Node* child = toContainerNode(node)->firstChild(); child; child = child
->nextSibling()) { |
908 appendTextContent(child, convertBRsToNewlines, content); | 917 appendTextContent(child, convertBRsToNewlines, content); |
909 } | 918 } |
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1733 node->showTreeForThis(); | 1742 node->showTreeForThis(); |
1734 } | 1743 } |
1735 | 1744 |
1736 void showNodePath(const blink::Node* node) | 1745 void showNodePath(const blink::Node* node) |
1737 { | 1746 { |
1738 if (node) | 1747 if (node) |
1739 node->showNodePathForThis(); | 1748 node->showNodePathForThis(); |
1740 } | 1749 } |
1741 | 1750 |
1742 #endif | 1751 #endif |
OLD | NEW |