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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
185 ASSERT(axis != Step::NamespaceAxis); | 185 ASSERT(axis != Step::NamespaceAxis); |
186 | 186 |
187 // For other axes, the principal node type is element. | 187 // For other axes, the principal node type is element. |
188 ASSERT(primaryNodeType(axis) == Node::ELEMENT_NODE); | 188 ASSERT(primaryNodeType(axis) == Node::ELEMENT_NODE); |
189 if (node->nodeType() != Node::ELEMENT_NODE) | 189 if (node->nodeType() != Node::ELEMENT_NODE) |
190 return false; | 190 return false; |
191 | 191 |
192 if (name == starAtom) | 192 if (name == starAtom) |
193 return namespaceURI.isEmpty() || namespaceURI == node->namespace
URI(); | 193 return namespaceURI.isEmpty() || namespaceURI == node->namespace
URI(); |
194 | 194 |
195 if (node->document()->isHTMLDocument()) { | 195 if (node->document().isHTMLDocument()) { |
196 if (node->isHTMLElement()) { | 196 if (node->isHTMLElement()) { |
197 // Paths without namespaces should match HTML elements in HT
ML documents despite those having an XHTML namespace. Names are compared case-in
sensitively. | 197 // Paths without namespaces should match HTML elements in HT
ML documents despite those having an XHTML namespace. Names are compared case-in
sensitively. |
198 return equalIgnoringCase(toElement(node)->localName(), name)
&& (namespaceURI.isNull() || namespaceURI == node->namespaceURI()); | 198 return equalIgnoringCase(toElement(node)->localName(), name)
&& (namespaceURI.isNull() || namespaceURI == node->namespaceURI()); |
199 } | 199 } |
200 // An expression without any prefix shouldn't match no-namespace
nodes (because HTML5 says so). | 200 // An expression without any prefix shouldn't match no-namespace
nodes (because HTML5 says so). |
201 return toElement(node)->hasLocalName(name) && namespaceURI == no
de->namespaceURI() && !namespaceURI.isNull(); | 201 return toElement(node)->hasLocalName(name) && namespaceURI == no
de->namespaceURI() && !namespaceURI.isNull(); |
202 } | 202 } |
203 return toElement(node)->hasLocalName(name) && namespaceURI == node->
namespaceURI(); | 203 return toElement(node)->hasLocalName(name) && namespaceURI == node->
namespaceURI(); |
204 } | 204 } |
205 } | 205 } |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
387 nodes.markSorted(false); | 387 nodes.markSorted(false); |
388 return; | 388 return; |
389 } | 389 } |
390 } | 390 } |
391 ASSERT_NOT_REACHED(); | 391 ASSERT_NOT_REACHED(); |
392 } | 392 } |
393 | 393 |
394 | 394 |
395 } | 395 } |
396 } | 396 } |
OLD | NEW |