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. All rights reserved. | 3 * Copyright (C) 2006, 2009 Apple Inc. All rights reserved. |
4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> | 4 * Copyright (C) 2007 Alexey Proskuryakov <ap@webkit.org> |
5 * | 5 * |
6 * Redistribution and use in source and binary forms, with or without | 6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions | 7 * modification, are permitted provided that the following conditions |
8 * are met: | 8 * are met: |
9 * | 9 * |
10 * 1. Redistributions of source code must retain the above copyright | 10 * 1. Redistributions of source code must retain the above copyright |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 if (!context->isElementNode()) | 380 if (!context->isElementNode()) |
381 return; | 381 return; |
382 | 382 |
383 Element* contextElement = toElement(context); | 383 Element* contextElement = toElement(context); |
384 // Avoid lazily creating attribute nodes for attributes that we do not | 384 // Avoid lazily creating attribute nodes for attributes that we do not |
385 // need anyway. | 385 // need anyway. |
386 if (nodeTest().getKind() == NodeTest::NameTest && | 386 if (nodeTest().getKind() == NodeTest::NameTest && |
387 nodeTest().data() != starAtom) { | 387 nodeTest().data() != starAtom) { |
388 Attr* attr = contextElement->getAttributeNodeNS( | 388 Attr* attr = contextElement->getAttributeNodeNS( |
389 nodeTest().namespaceURI(), nodeTest().data()); | 389 nodeTest().namespaceURI(), nodeTest().data()); |
390 // In XPath land, namespace nodes are not accessible on the attribute ax
is. | 390 // In XPath land, namespace nodes are not accessible on the attribute |
| 391 // axis. |
391 if (attr && attr->namespaceURI() != XMLNSNames::xmlnsNamespaceURI) { | 392 if (attr && attr->namespaceURI() != XMLNSNames::xmlnsNamespaceURI) { |
392 // Still need to check merged predicates. | 393 // Still need to check merged predicates. |
393 if (nodeMatches(evaluationContext, attr, AttributeAxis, nodeTest())) | 394 if (nodeMatches(evaluationContext, attr, AttributeAxis, nodeTest())) |
394 nodes.append(attr); | 395 nodes.append(attr); |
395 } | 396 } |
396 return; | 397 return; |
397 } | 398 } |
398 | 399 |
399 AttributeCollection attributes = contextElement->attributes(); | 400 AttributeCollection attributes = contextElement->attributes(); |
400 for (auto& attribute : attributes) { | 401 for (auto& attribute : attributes) { |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
446 nodes.markSorted(false); | 447 nodes.markSorted(false); |
447 return; | 448 return; |
448 } | 449 } |
449 } | 450 } |
450 NOTREACHED(); | 451 NOTREACHED(); |
451 } | 452 } |
452 | 453 |
453 } // namespace XPath | 454 } // namespace XPath |
454 | 455 |
455 } // namespace blink | 456 } // namespace blink |
OLD | NEW |