2 * Copyright (C) 2001 Peter Kelly (pmk@post.com)
3 * Copyright (C) 2007, 2008, 2009 Apple Inc. All rights reserved.
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.
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.
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
20 #ifndef JSNodeFilterCondition_h
21 #define JSNodeFilterCondition_h
23 #include "NodeFilterCondition.h"
24 #include <heap/Weak.h>
25 #include <runtime/JSValue.h>
26 #include <wtf/PassRefPtr.h>
33 class JSNodeFilterCondition : public NodeFilterCondition {
35 static PassRefPtr<JSNodeFilterCondition> create(JSC::JSGlobalData& globalData, NodeFilter* owner, JSC::JSValue filter)
37 return adoptRef(new JSNodeFilterCondition(globalData, owner, filter));
41 JSNodeFilterCondition(JSC::JSGlobalData&, NodeFilter* owner, JSC::JSValue filter);
43 virtual short acceptNode(ScriptState*, Node*) const;
45 class WeakOwner : public JSC::WeakHandleOwner {
46 virtual bool isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void* context, JSC::SlotVisitor&);
48 WeakOwner m_weakOwner;
49 mutable JSC::Weak<JSC::Unknown> m_filter;
52 } // namespace WebCore
54 #endif // JSNodeFilterCondition_h