1 /* 2 * Copyright (C) 2001 Peter Kelly (pmk@post.com) 3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved. 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 18 */ 19 20 #ifndef JSNodeFilterCondition_h 21 #define JSNodeFilterCondition_h 22 23 #include "NodeFilterCondition.h" 24 #include <runtime/JSValue.h> 25 #include <wtf/PassRefPtr.h> 26 27 namespace WebCore { 28 29 class Node; 30 31 class JSNodeFilterCondition : public NodeFilterCondition { 32 public: create(JSC::JSValue filter)33 static PassRefPtr<JSNodeFilterCondition> create(JSC::JSValue filter) 34 { 35 return adoptRef(new JSNodeFilterCondition(filter)); 36 } 37 38 private: 39 JSNodeFilterCondition(JSC::JSValue filter); 40 41 virtual short acceptNode(ScriptState*, Node*) const; 42 virtual void markAggregate(JSC::MarkStack&); 43 44 mutable JSC::JSValue m_filter; 45 }; 46 47 } // namespace WebCore 48 49 #endif // JSNodeFilterCondition_h 50