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

Side by Side Diff: third_party/WebKit/Source/core/xml/XPathUtil.cpp

Issue 2342163004: Simplify Attr code in XPathUtil (Closed)
Patch Set: rebase Created 4 years, 3 months 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
« no previous file with comments | « no previous file | no next file » | 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) 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
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
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698