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

Side by Side Diff: Source/core/xml/XPathStep.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/xml/XPathNodeSet.cpp ('k') | Source/core/xml/XSLStyleSheetLibxslt.cpp » ('j') | 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. 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
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
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 }
OLDNEW
« no previous file with comments | « Source/core/xml/XPathNodeSet.cpp ('k') | Source/core/xml/XSLStyleSheetLibxslt.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698