| 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 * | 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 20 matching lines...) Expand all Loading... |
| 31 #include "core/dom/ExceptionCode.h" | 31 #include "core/dom/ExceptionCode.h" |
| 32 #include "core/xml/XPathExpressionNode.h" | 32 #include "core/xml/XPathExpressionNode.h" |
| 33 #include "core/xml/XPathNSResolver.h" | 33 #include "core/xml/XPathNSResolver.h" |
| 34 #include "core/xml/XPathParser.h" | 34 #include "core/xml/XPathParser.h" |
| 35 #include "core/xml/XPathResult.h" | 35 #include "core/xml/XPathResult.h" |
| 36 #include "core/xml/XPathUtil.h" | 36 #include "core/xml/XPathUtil.h" |
| 37 #include "wtf/text/WTFString.h" | 37 #include "wtf/text/WTFString.h" |
| 38 | 38 |
| 39 namespace WebCore { | 39 namespace WebCore { |
| 40 | 40 |
| 41 DEFINE_GC_INFO(XPathExpression); | |
| 42 | |
| 43 using namespace XPath; | 41 using namespace XPath; |
| 44 | 42 |
| 45 PassRefPtrWillBeRawPtr<XPathExpression> XPathExpression::createExpression(const
String& expression, PassRefPtrWillBeRawPtr<XPathNSResolver> resolver, ExceptionS
tate& exceptionState) | 43 PassRefPtrWillBeRawPtr<XPathExpression> XPathExpression::createExpression(const
String& expression, PassRefPtrWillBeRawPtr<XPathNSResolver> resolver, ExceptionS
tate& exceptionState) |
| 46 { | 44 { |
| 47 RefPtrWillBeRawPtr<XPathExpression> expr = XPathExpression::create(); | 45 RefPtrWillBeRawPtr<XPathExpression> expr = XPathExpression::create(); |
| 48 Parser parser; | 46 Parser parser; |
| 49 | 47 |
| 50 expr->m_topExpression = parser.parseStatement(expression, resolver, exceptio
nState); | 48 expr->m_topExpression = parser.parseStatement(expression, resolver, exceptio
nState); |
| 51 if (!expr->m_topExpression) | 49 if (!expr->m_topExpression) |
| 52 return nullptr; | 50 return nullptr; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 if (type != XPathResult::ANY_TYPE) { | 86 if (type != XPathResult::ANY_TYPE) { |
| 89 result->convertTo(type, exceptionState); | 87 result->convertTo(type, exceptionState); |
| 90 if (exceptionState.hadException()) | 88 if (exceptionState.hadException()) |
| 91 return nullptr; | 89 return nullptr; |
| 92 } | 90 } |
| 93 | 91 |
| 94 return result; | 92 return result; |
| 95 } | 93 } |
| 96 | 94 |
| 97 } | 95 } |
| OLD | NEW |