OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org> | 2 * Copyright (C) 2005 Frerich Raabe <raabe@kde.org> |
3 * Copyright (C) 2006, 2009 Apple Inc. | 3 * Copyright (C) 2006, 2009 Apple Inc. |
4 * | 4 * |
5 * Redistribution and use in source and binary forms, with or without | 5 * Redistribution and use in source and binary forms, with or without |
6 * modification, are permitted provided that the following conditions | 6 * modification, are permitted provided that the following conditions |
7 * are met: | 7 * are met: |
8 * | 8 * |
9 * 1. Redistributions of source code must retain the above copyright | 9 * 1. Redistributions of source code must retain the above copyright |
10 * notice, this list of conditions and the following disclaimer. | 10 * notice, this list of conditions and the following disclaimer. |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 | 65 |
66 return String(); | 66 return String(); |
67 } | 67 } |
68 | 68 |
69 bool isValidContextNode(Node* node) | 69 bool isValidContextNode(Node* node) |
70 { | 70 { |
71 if (!node) | 71 if (!node) |
72 return false; | 72 return false; |
73 switch (node->getNodeType()) { | 73 switch (node->getNodeType()) { |
74 case Node::kAttributeNode: | 74 case Node::kAttributeNode: |
| 75 case Node::kTextNode: |
75 case Node::kCdataSectionNode: | 76 case Node::kCdataSectionNode: |
76 case Node::kCommentNode: | 77 case Node::kCommentNode: |
77 case Node::kDocumentNode: | 78 case Node::kDocumentNode: |
78 case Node::kElementNode: | 79 case Node::kElementNode: |
79 case Node::kProcessingInstructionNode: | 80 case Node::kProcessingInstructionNode: |
80 return true; | 81 return true; |
81 case Node::kDocumentFragmentNode: | 82 case Node::kDocumentFragmentNode: |
82 case Node::kDocumentTypeNode: | 83 case Node::kDocumentTypeNode: |
83 return false; | 84 return false; |
84 case Node::kTextNode: | |
85 return !(node->parentNode() && node->parentNode()->isAttributeNode()); | |
86 } | 85 } |
87 NOTREACHED(); | 86 NOTREACHED(); |
88 return false; | 87 return false; |
89 } | 88 } |
90 | 89 |
91 } // namespace XPath | 90 } // namespace XPath |
92 } // namespace blink | 91 } // namespace blink |
OLD | NEW |