Title: [283636] trunk/Source/WebCore
- Revision
- 283636
- Author
- [email protected]
- Date
- 2021-10-06 11:08:17 -0700 (Wed, 06 Oct 2021)
Log Message
Reduce use of "using namespace": eliminate all "using namespace XPath"
https://bugs.webkit.org/show_bug.cgi?id=231302
Reviewed by Sam Weinig.
* xml/XPathEvaluator.cpp: Removed "using namespace XPath".
(WebCore::XPathEvaluator::evaluate): Use XPath prefix explicitly.
* xml/XPathExpression.cpp: Removed "using namespace XPath".
(WebCore::XPathExpression::createExpression): Ditto.
(WebCore::XPathExpression::evaluate): Ditto.
* xml/XPathGrammar.y: Removed "using namespace WebCore" and
"using namespace XPath".
* xml/XPathResult.cpp: Removed "using namespace XPath".
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (283635 => 283636)
--- trunk/Source/WebCore/ChangeLog 2021-10-06 18:00:02 UTC (rev 283635)
+++ trunk/Source/WebCore/ChangeLog 2021-10-06 18:08:17 UTC (rev 283636)
@@ -1,3 +1,21 @@
+2021-10-06 Darin Adler <[email protected]>
+
+ Reduce use of "using namespace": eliminate all "using namespace XPath"
+ https://bugs.webkit.org/show_bug.cgi?id=231302
+
+ Reviewed by Sam Weinig.
+
+ * xml/XPathEvaluator.cpp: Removed "using namespace XPath".
+ (WebCore::XPathEvaluator::evaluate): Use XPath prefix explicitly.
+ * xml/XPathExpression.cpp: Removed "using namespace XPath".
+ (WebCore::XPathExpression::createExpression): Ditto.
+ (WebCore::XPathExpression::evaluate): Ditto.
+
+ * xml/XPathGrammar.y: Removed "using namespace WebCore" and
+ "using namespace XPath".
+
+ * xml/XPathResult.cpp: Removed "using namespace XPath".
+
2021-10-06 Alex Christensen <[email protected]>
Don't use namespace WebCore::XPath at global scope
Modified: trunk/Source/WebCore/xml/XPathEvaluator.cpp (283635 => 283636)
--- trunk/Source/WebCore/xml/XPathEvaluator.cpp 2021-10-06 18:00:02 UTC (rev 283635)
+++ trunk/Source/WebCore/xml/XPathEvaluator.cpp 2021-10-06 18:08:17 UTC (rev 283636)
@@ -34,8 +34,6 @@
namespace WebCore {
-using namespace XPath;
-
ExceptionOr<Ref<XPathExpression>> XPathEvaluator::createExpression(const String& _expression_, RefPtr<XPathNSResolver>&& resolver)
{
return XPathExpression::createExpression(_expression_, WTFMove(resolver));
@@ -48,7 +46,7 @@
ExceptionOr<Ref<XPathResult>> XPathEvaluator::evaluate(const String& _expression_, Node& contextNode, RefPtr<XPathNSResolver>&& resolver, unsigned short type, XPathResult* result)
{
- if (!isValidContextNode(contextNode))
+ if (!XPath::isValidContextNode(contextNode))
return Exception { NotSupportedError };
auto createResult = createExpression(_expression_, WTFMove(resolver));
Modified: trunk/Source/WebCore/xml/XPathExpression.cpp (283635 => 283636)
--- trunk/Source/WebCore/xml/XPathExpression.cpp 2021-10-06 18:00:02 UTC (rev 283635)
+++ trunk/Source/WebCore/xml/XPathExpression.cpp 2021-10-06 18:08:17 UTC (rev 283636)
@@ -34,8 +34,6 @@
#include "XPathUtil.h"
namespace WebCore {
-
-using namespace XPath;
inline XPathExpression::XPathExpression(std::unique_ptr<XPath::_expression_> _expression_)
: m_topExpression(WTFMove(_expression_))
@@ -44,7 +42,7 @@
ExceptionOr<Ref<XPathExpression>> XPathExpression::createExpression(const String& _expression_, RefPtr<XPathNSResolver>&& resolver)
{
- auto parseResult = Parser::parseStatement(_expression_, WTFMove(resolver));
+ auto parseResult = XPath::Parser::parseStatement(_expression_, WTFMove(resolver));
if (parseResult.hasException())
return parseResult.releaseException();
@@ -56,10 +54,10 @@
// FIXME: Why does this take an XPathResult that it ignores?
ExceptionOr<Ref<XPathResult>> XPathExpression::evaluate(Node& contextNode, unsigned short type, XPathResult*)
{
- if (!isValidContextNode(contextNode))
+ if (!XPath::isValidContextNode(contextNode))
return Exception { NotSupportedError };
- EvaluationContext& evaluationContext = _expression_::evaluationContext();
+ auto& evaluationContext = XPath::_expression_::evaluationContext();
evaluationContext.node = &contextNode;
evaluationContext.size = 1;
evaluationContext.position = 1;
Modified: trunk/Source/WebCore/xml/XPathGrammar.y (283635 => 283636)
--- trunk/Source/WebCore/xml/XPathGrammar.y 2021-10-06 18:00:02 UTC (rev 283635)
+++ trunk/Source/WebCore/xml/XPathGrammar.y 2021-10-06 18:08:17 UTC (rev 283636)
@@ -48,9 +48,6 @@
#define YYDEBUG 0
#define YYMAXDEPTH 10000
-using namespace WebCore;
-using namespace XPath;
-
%}
%pure-parser
Modified: trunk/Source/WebCore/xml/XPathResult.cpp (283635 => 283636)
--- trunk/Source/WebCore/xml/XPathResult.cpp 2021-10-06 18:00:02 UTC (rev 283635)
+++ trunk/Source/WebCore/xml/XPathResult.cpp 2021-10-06 18:08:17 UTC (rev 283636)
@@ -32,8 +32,6 @@
namespace WebCore {
-using namespace XPath;
-
XPathResult::XPathResult(Document& document, const Value& value)
: m_value(value)
{
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes