| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2005 Frerich Raabe <raabe@kde.org> | 2 * Copyright 2005 Frerich Raabe <raabe@kde.org> |
| 3 * Copyright (C) 2006 Apple Computer, Inc. | 3 * Copyright (C) 2006 Apple Computer, Inc. |
| 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 19 matching lines...) Expand all Loading... |
| 30 #include "core/xml/XPathExpressionNode.h" | 30 #include "core/xml/XPathExpressionNode.h" |
| 31 #include "core/xml/XPathValue.h" | 31 #include "core/xml/XPathValue.h" |
| 32 | 32 |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 namespace XPath { | 35 namespace XPath { |
| 36 | 36 |
| 37 class Number final : public Expression { | 37 class Number final : public Expression { |
| 38 public: | 38 public: |
| 39 explicit Number(double); | 39 explicit Number(double); |
| 40 virtual void trace(Visitor*) override; | 40 DECLARE_VIRTUAL_TRACE(); |
| 41 | 41 |
| 42 private: | 42 private: |
| 43 virtual Value evaluate(EvaluationContext&) const override; | 43 virtual Value evaluate(EvaluationContext&) const override; |
| 44 virtual Value::Type resultType() const override { return Value::NumberValue;
} | 44 virtual Value::Type resultType() const override { return Value::NumberValue;
} |
| 45 | 45 |
| 46 Value m_value; | 46 Value m_value; |
| 47 }; | 47 }; |
| 48 | 48 |
| 49 class StringExpression final : public Expression { | 49 class StringExpression final : public Expression { |
| 50 public: | 50 public: |
| 51 explicit StringExpression(const String&); | 51 explicit StringExpression(const String&); |
| 52 virtual void trace(Visitor*) override; | 52 DECLARE_VIRTUAL_TRACE(); |
| 53 | 53 |
| 54 private: | 54 private: |
| 55 virtual Value evaluate(EvaluationContext&) const override; | 55 virtual Value evaluate(EvaluationContext&) const override; |
| 56 virtual Value::Type resultType() const override { return Value::StringValue;
} | 56 virtual Value::Type resultType() const override { return Value::StringValue;
} |
| 57 | 57 |
| 58 Value m_value; | 58 Value m_value; |
| 59 }; | 59 }; |
| 60 | 60 |
| 61 class Negative final : public Expression { | 61 class Negative final : public Expression { |
| 62 private: | 62 private: |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 private: | 108 private: |
| 109 virtual Value evaluate(EvaluationContext&) const override; | 109 virtual Value evaluate(EvaluationContext&) const override; |
| 110 virtual Value::Type resultType() const override { return Value::NodeSetValue
; } | 110 virtual Value::Type resultType() const override { return Value::NodeSetValue
; } |
| 111 }; | 111 }; |
| 112 | 112 |
| 113 class Predicate final : public NoBaseWillBeGarbageCollected<Predicate> { | 113 class Predicate final : public NoBaseWillBeGarbageCollected<Predicate> { |
| 114 WTF_MAKE_NONCOPYABLE(Predicate); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; | 114 WTF_MAKE_NONCOPYABLE(Predicate); WTF_MAKE_FAST_ALLOCATED_WILL_BE_REMOVED; |
| 115 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(Predicate); | 115 DECLARE_EMPTY_DESTRUCTOR_WILL_BE_REMOVED(Predicate); |
| 116 public: | 116 public: |
| 117 explicit Predicate(PassOwnPtrWillBeRawPtr<Expression>); | 117 explicit Predicate(PassOwnPtrWillBeRawPtr<Expression>); |
| 118 void trace(Visitor*); | 118 DECLARE_TRACE(); |
| 119 | 119 |
| 120 bool evaluate(EvaluationContext&) const; | 120 bool evaluate(EvaluationContext&) const; |
| 121 bool isContextPositionSensitive() const { return m_expr->isContextPositionSe
nsitive() || m_expr->resultType() == Value::NumberValue; } | 121 bool isContextPositionSensitive() const { return m_expr->isContextPositionSe
nsitive() || m_expr->resultType() == Value::NumberValue; } |
| 122 bool isContextSizeSensitive() const { return m_expr->isContextSizeSensitive(
); } | 122 bool isContextSizeSensitive() const { return m_expr->isContextSizeSensitive(
); } |
| 123 | 123 |
| 124 private: | 124 private: |
| 125 OwnPtrWillBeMember<Expression> m_expr; | 125 OwnPtrWillBeMember<Expression> m_expr; |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 } | 128 } |
| 129 | 129 |
| 130 } | 130 } |
| 131 #endif // XPathPredicate_h | 131 #endif // XPathPredicate_h |
| OLD | NEW |