summaryrefslogtreecommitdiffstats
path: root/WebCore/xml/XPathExpressionNode.h
diff options
context:
space:
mode:
authorFeng Qian <fqian@google.com>2009-06-17 12:12:20 -0700
committerFeng Qian <fqian@google.com>2009-06-17 12:12:20 -0700
commit5f1ab04193ad0130ca8204aadaceae083aca9881 (patch)
tree5a92cd389e2cfe7fb67197ce14b38469462379f8 /WebCore/xml/XPathExpressionNode.h
parent194315e5a908cc8ed67d597010544803eef1ac59 (diff)
downloadexternal_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.zip
external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.gz
external_webkit-5f1ab04193ad0130ca8204aadaceae083aca9881.tar.bz2
Get WebKit r44544.
Diffstat (limited to 'WebCore/xml/XPathExpressionNode.h')
-rw-r--r--WebCore/xml/XPathExpressionNode.h32
1 files changed, 25 insertions, 7 deletions
diff --git a/WebCore/xml/XPathExpressionNode.h b/WebCore/xml/XPathExpressionNode.h
index 9c5f79b..d12b451 100644
--- a/WebCore/xml/XPathExpressionNode.h
+++ b/WebCore/xml/XPathExpressionNode.h
@@ -1,6 +1,6 @@
/*
- * Copyright 2005 Frerich Raabe <raabe@kde.org>
- * Copyright (C) 2006 Apple Computer, Inc.
+ * Copyright (C) 2005 Frerich Raabe <raabe@kde.org>
+ * Copyright (C) 2006, 2009 Apple Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -31,23 +31,21 @@
#include "StringHash.h"
#include "Node.h"
+#include "XPathValue.h"
#include <wtf/HashMap.h>
#include <wtf/Vector.h>
namespace WebCore {
namespace XPath {
-
- class Value;
struct EvaluationContext {
- EvaluationContext() : node(0), size(0), position(0) { }
-
RefPtr<Node> node;
unsigned long size;
unsigned long position;
HashMap<String, String> variableBindings;
+ bool hadTypeConversionError;
};
class ParseNode {
@@ -64,7 +62,22 @@ namespace WebCore {
virtual Value evaluate() const = 0;
- void addSubExpression(Expression* expr) { m_subExpressions.append(expr); }
+ void addSubExpression(Expression* expr)
+ {
+ m_subExpressions.append(expr);
+ m_isContextNodeSensitive |= expr->m_isContextNodeSensitive;
+ m_isContextPositionSensitive |= expr->m_isContextPositionSensitive;
+ m_isContextSizeSensitive |= expr->m_isContextSizeSensitive;
+ }
+
+ bool isContextNodeSensitive() const { return m_isContextNodeSensitive; }
+ bool isContextPositionSensitive() const { return m_isContextPositionSensitive; }
+ bool isContextSizeSensitive() const { return m_isContextSizeSensitive; }
+ void setIsContextNodeSensitive(bool value) { m_isContextNodeSensitive = value; }
+ void setIsContextPositionSensitive(bool value) { m_isContextPositionSensitive = value; }
+ void setIsContextSizeSensitive(bool value) { m_isContextSizeSensitive = value; }
+
+ virtual Value::Type resultType() const = 0;
protected:
unsigned subExprCount() const { return m_subExpressions.size(); }
@@ -73,6 +86,11 @@ namespace WebCore {
private:
Vector<Expression*> m_subExpressions;
+
+ // Evaluation details that can be used for optimization.
+ bool m_isContextNodeSensitive;
+ bool m_isContextPositionSensitive;
+ bool m_isContextSizeSensitive;
};
}