Commit 8d286e55 authored by foolip's avatar foolip Committed by Commit bot

Simplify Attr code in XPathUtil

Now that Attr never has childen, a Text node can't have an Attr parent,
and so the condition would always return true.

BUG=305105
R=tkent@chromium.org

Review-Url: https://codereview.chromium.org/2342163004
Cr-Commit-Position: refs/heads/master@{#419490}
parent 34f6f717
......@@ -72,6 +72,7 @@ bool isValidContextNode(Node* node)
return false;
switch (node->getNodeType()) {
case Node::kAttributeNode:
case Node::kTextNode:
case Node::kCdataSectionNode:
case Node::kCommentNode:
case Node::kDocumentNode:
......@@ -81,8 +82,6 @@ bool isValidContextNode(Node* node)
case Node::kDocumentFragmentNode:
case Node::kDocumentTypeNode:
return false;
case Node::kTextNode:
return !(node->parentNode() && node->parentNode()->isAttributeNode());
}
NOTREACHED();
return false;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment