| 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. | 3 * Copyright (C) 2006, 2009 Apple 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 22 matching lines...) Expand all Loading... |
| 33 namespace blink { | 33 namespace blink { |
| 34 | 34 |
| 35 namespace XPath { | 35 namespace XPath { |
| 36 | 36 |
| 37 class Predicate; | 37 class Predicate; |
| 38 class Step; | 38 class Step; |
| 39 | 39 |
| 40 class Filter final : public Expression { | 40 class Filter final : public Expression { |
| 41 public: | 41 public: |
| 42 Filter(Expression*, HeapVector<Member<Predicate>>&); | 42 Filter(Expression*, HeapVector<Member<Predicate>>&); |
| 43 virtual ~Filter(); | 43 ~Filter() override; |
| 44 DECLARE_VIRTUAL_TRACE(); | 44 DECLARE_VIRTUAL_TRACE(); |
| 45 | 45 |
| 46 virtual Value evaluate(EvaluationContext&) const override; | 46 Value evaluate(EvaluationContext&) const override; |
| 47 | 47 |
| 48 private: | 48 private: |
| 49 virtual Value::Type resultType() const override { return Value::NodeSetValue
; } | 49 Value::Type resultType() const override { return Value::NodeSetValue; } |
| 50 | 50 |
| 51 Member<Expression> m_expr; | 51 Member<Expression> m_expr; |
| 52 HeapVector<Member<Predicate>> m_predicates; | 52 HeapVector<Member<Predicate>> m_predicates; |
| 53 }; | 53 }; |
| 54 | 54 |
| 55 class LocationPath final : public Expression { | 55 class LocationPath final : public Expression { |
| 56 public: | 56 public: |
| 57 LocationPath(); | 57 LocationPath(); |
| 58 virtual ~LocationPath(); | 58 ~LocationPath() override; |
| 59 DECLARE_VIRTUAL_TRACE(); | 59 DECLARE_VIRTUAL_TRACE(); |
| 60 | 60 |
| 61 virtual Value evaluate(EvaluationContext&) const override; | 61 Value evaluate(EvaluationContext&) const override; |
| 62 void setAbsolute(bool value) { m_absolute = value; setIsContextNodeSensitive
(!m_absolute); } | 62 void setAbsolute(bool value) { m_absolute = value; setIsContextNodeSensitive
(!m_absolute); } |
| 63 void evaluate(EvaluationContext&, NodeSet&) const; // nodes is an input/outp
ut parameter | 63 void evaluate(EvaluationContext&, NodeSet&) const; // nodes is an input/outp
ut parameter |
| 64 void appendStep(Step*); | 64 void appendStep(Step*); |
| 65 void insertFirstStep(Step*); | 65 void insertFirstStep(Step*); |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 virtual Value::Type resultType() const override { return Value::NodeSetValue
; } | 68 Value::Type resultType() const override { return Value::NodeSetValue; } |
| 69 | 69 |
| 70 HeapVector<Member<Step>> m_steps; | 70 HeapVector<Member<Step>> m_steps; |
| 71 bool m_absolute; | 71 bool m_absolute; |
| 72 }; | 72 }; |
| 73 | 73 |
| 74 class Path final : public Expression { | 74 class Path final : public Expression { |
| 75 public: | 75 public: |
| 76 Path(Expression*, LocationPath*); | 76 Path(Expression*, LocationPath*); |
| 77 virtual ~Path(); | 77 ~Path() override; |
| 78 DECLARE_VIRTUAL_TRACE(); | 78 DECLARE_VIRTUAL_TRACE(); |
| 79 | 79 |
| 80 virtual Value evaluate(EvaluationContext&) const override; | 80 Value evaluate(EvaluationContext&) const override; |
| 81 | 81 |
| 82 private: | 82 private: |
| 83 virtual Value::Type resultType() const override { return Value::NodeSetValue
; } | 83 Value::Type resultType() const override { return Value::NodeSetValue; } |
| 84 | 84 |
| 85 Member<Expression> m_filter; | 85 Member<Expression> m_filter; |
| 86 Member<LocationPath> m_path; | 86 Member<LocationPath> m_path; |
| 87 }; | 87 }; |
| 88 | 88 |
| 89 } | 89 } |
| 90 | 90 |
| 91 } | 91 } |
| 92 #endif // XPathPath_h | 92 #endif // XPathPath_h |
| OLD | NEW |