Commit 7d605a21 authored by eseidel's avatar eseidel

Bug #: 5929

Submitted by: eseidel
Reviewed by: darin
        No functionality changes, no test cases possible or necessary.

        Removed dom_misc.* and changed to use Shared instead of DOMShared.
        Also removed FilterNode typedef, now using NodeImpl* directly.
        http://bugzilla.opendarwin.org/show_bug.cgi?id=5929

        * WebCore.xcodeproj/project.pbxproj:
        * khtml/css/css_base.h:
        * khtml/dom/dom2_events.h:
        * khtml/dom/dom2_traversal.cpp:
        (DOM::NodeFilterCondition::acceptNode):
        * khtml/dom/dom2_traversal.h:
        * khtml/dom/dom_exception.h:
        * khtml/dom/dom_misc.cpp: Removed.
        * khtml/dom/dom_misc.h: Removed.
        * khtml/ecma/kjs_traversal.cpp:
        (KJS::JSNodeFilterCondition::acceptNode):
        * khtml/ecma/kjs_traversal.h:
        * kwq/DOM.mm:
        (ObjCNodeFilterCondition::acceptNode):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@11431 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 2928be58
2005-12-04 Eric Seidel <eseidel@apple.com>
Reviewed by darin.
No functionality changes, no test cases possible or necessary.
Removed dom_misc.* and changed to use Shared instead of DOMShared.
Also removed FilterNode typedef, now using NodeImpl* directly.
http://bugzilla.opendarwin.org/show_bug.cgi?id=5929
* WebCore.xcodeproj/project.pbxproj:
* khtml/css/css_base.h:
* khtml/dom/dom2_events.h:
* khtml/dom/dom2_traversal.cpp:
(DOM::NodeFilterCondition::acceptNode):
* khtml/dom/dom2_traversal.h:
* khtml/dom/dom_exception.h:
* khtml/dom/dom_misc.cpp: Removed.
* khtml/dom/dom_misc.h: Removed.
* khtml/ecma/kjs_traversal.cpp:
(KJS::JSNodeFilterCondition::acceptNode):
* khtml/ecma/kjs_traversal.h:
* kwq/DOM.mm:
(ObjCNodeFilterCondition::acceptNode):
2005-12-04 Eric Seidel <eseidel@apple.com>
Reviewed by mjs.
......@@ -87,7 +87,6 @@
93F198B508245E59001E9ABC /* dom2_range.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D19F02DE4322018635CA /* dom2_range.h */; };
93F198B608245E59001E9ABC /* dom2_traversal.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D1A102DE4322018635CA /* dom2_traversal.h */; };
93F198BB08245E59001E9ABC /* dom_exception.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D19002DE4322018635CA /* dom_exception.h */; };
93F198BD08245E59001E9ABC /* dom_misc.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D19302DE4322018635CA /* dom_misc.h */; };
93F198BE08245E59001E9ABC /* dom_node.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D19502DE4322018635CA /* dom_node.h */; };
93F198BF08245E59001E9ABC /* dom_string.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D19702DE4322018635CA /* dom_string.h */; };
93F198CE08245E59001E9ABC /* kjs_binding.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D1F502DE4369018635CA /* kjs_binding.h */; };
......@@ -467,7 +466,6 @@
93F19A6608245E59001E9ABC /* csshelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D16A02DE42E7018635CA /* csshelper.cpp */; };
93F19A6708245E59001E9ABC /* cssparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D16C02DE42E7018635CA /* cssparser.cpp */; };
93F19A6808245E59001E9ABC /* cssstyleselector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D17002DE42E7018635CA /* cssstyleselector.cpp */; };
93F19A6E08245E59001E9ABC /* dom_misc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D19202DE4322018635CA /* dom_misc.cpp */; };
93F19A7008245E59001E9ABC /* dom_string.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D19602DE4322018635CA /* dom_string.cpp */; };
93F19A7308245E59001E9ABC /* dom2_events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D19C02DE4322018635CA /* dom2_events.cpp */; };
93F19A7508245E59001E9ABC /* dom2_traversal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D1A002DE4322018635CA /* dom2_traversal.cpp */; };
......@@ -625,7 +623,6 @@
A8212A9208794A2300677359 /* dom2_range.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D19F02DE4322018635CA /* dom2_range.h */; };
A8212A9308794A2300677359 /* dom2_traversal.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D1A102DE4322018635CA /* dom2_traversal.h */; };
A8212A9408794A2300677359 /* dom_exception.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D19002DE4322018635CA /* dom_exception.h */; };
A8212A9508794A2300677359 /* dom_misc.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D19302DE4322018635CA /* dom_misc.h */; };
A8212A9608794A2300677359 /* dom_node.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D19502DE4322018635CA /* dom_node.h */; };
A8212A9708794A2300677359 /* dom_string.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D19702DE4322018635CA /* dom_string.h */; };
A8212AA408794A2300677359 /* kjs_binding.h in Headers */ = {isa = PBXBuildFile; fileRef = F523D1F502DE4369018635CA /* kjs_binding.h */; };
......@@ -1037,7 +1034,6 @@
A8212C4D08794A2300677359 /* csshelper.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D16A02DE42E7018635CA /* csshelper.cpp */; };
A8212C4E08794A2300677359 /* cssparser.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D16C02DE42E7018635CA /* cssparser.cpp */; };
A8212C4F08794A2300677359 /* cssstyleselector.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D17002DE42E7018635CA /* cssstyleselector.cpp */; };
A8212C5008794A2300677359 /* dom_misc.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D19202DE4322018635CA /* dom_misc.cpp */; };
A8212C5108794A2300677359 /* dom_string.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D19602DE4322018635CA /* dom_string.cpp */; };
A8212C5208794A2300677359 /* dom2_events.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D19C02DE4322018635CA /* dom2_events.cpp */; };
A8212C5308794A2300677359 /* dom2_traversal.cpp in Sources */ = {isa = PBXBuildFile; fileRef = F523D1A002DE4322018635CA /* dom2_traversal.cpp */; };
......@@ -2678,8 +2674,6 @@
F523D18802DE4322018635CA /* css_stylesheet.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = css_stylesheet.h; sourceTree = "<group>"; };
F523D18A02DE4322018635CA /* css_value.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = css_value.h; sourceTree = "<group>"; };
F523D19002DE4322018635CA /* dom_exception.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dom_exception.h; sourceTree = "<group>"; };
F523D19202DE4322018635CA /* dom_misc.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dom_misc.cpp; sourceTree = "<group>"; };
F523D19302DE4322018635CA /* dom_misc.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dom_misc.h; sourceTree = "<group>"; };
F523D19502DE4322018635CA /* dom_node.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dom_node.h; sourceTree = "<group>"; };
F523D19602DE4322018635CA /* dom_string.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = dom_string.cpp; sourceTree = "<group>"; };
F523D19702DE4322018635CA /* dom_string.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = dom_string.h; sourceTree = "<group>"; };
......@@ -4263,8 +4257,6 @@
F523D18802DE4322018635CA /* css_stylesheet.h */,
F523D18A02DE4322018635CA /* css_value.h */,
F523D19002DE4322018635CA /* dom_exception.h */,
F523D19202DE4322018635CA /* dom_misc.cpp */,
F523D19302DE4322018635CA /* dom_misc.h */,
F523D19502DE4322018635CA /* dom_node.h */,
F523D19602DE4322018635CA /* dom_string.cpp */,
F523D19702DE4322018635CA /* dom_string.h */,
......@@ -4832,7 +4824,6 @@
93F198B508245E59001E9ABC /* dom2_range.h in Headers */,
93F198B608245E59001E9ABC /* dom2_traversal.h in Headers */,
93F198BB08245E59001E9ABC /* dom_exception.h in Headers */,
93F198BD08245E59001E9ABC /* dom_misc.h in Headers */,
93F198BE08245E59001E9ABC /* dom_node.h in Headers */,
93F198BF08245E59001E9ABC /* dom_string.h in Headers */,
93F198CE08245E59001E9ABC /* kjs_binding.h in Headers */,
......@@ -5174,7 +5165,6 @@
A8212A9208794A2300677359 /* dom2_range.h in Headers */,
A8212A9308794A2300677359 /* dom2_traversal.h in Headers */,
A8212A9408794A2300677359 /* dom_exception.h in Headers */,
A8212A9508794A2300677359 /* dom_misc.h in Headers */,
A8212A9608794A2300677359 /* dom_node.h in Headers */,
A8212A9708794A2300677359 /* dom_string.h in Headers */,
A8212AA408794A2300677359 /* kjs_binding.h in Headers */,
......@@ -6873,7 +6863,6 @@
93F19A6608245E59001E9ABC /* csshelper.cpp in Sources */,
93F19A6708245E59001E9ABC /* cssparser.cpp in Sources */,
93F19A6808245E59001E9ABC /* cssstyleselector.cpp in Sources */,
93F19A6E08245E59001E9ABC /* dom_misc.cpp in Sources */,
93F19A7008245E59001E9ABC /* dom_string.cpp in Sources */,
93F19A7308245E59001E9ABC /* dom2_events.cpp in Sources */,
93F19A7508245E59001E9ABC /* dom2_traversal.cpp in Sources */,
......@@ -7144,7 +7133,6 @@
A8212C4D08794A2300677359 /* csshelper.cpp in Sources */,
A8212C4E08794A2300677359 /* cssparser.cpp in Sources */,
A8212C4F08794A2300677359 /* cssstyleselector.cpp in Sources */,
A8212C5008794A2300677359 /* dom_misc.cpp in Sources */,
A8212C5108794A2300677359 /* dom_string.cpp in Sources */,
A8212C5208794A2300677359 /* dom2_events.cpp in Sources */,
A8212C5308794A2300677359 /* dom2_traversal.cpp in Sources */,
......
......@@ -25,7 +25,6 @@
#define CSS_BASE_H
#include "dom/dom_string.h"
#include "dom/dom_misc.h"
#include "xml/dom_nodeimpl.h"
#include "dom_qname.h"
#include "misc/shared.h"
......
......@@ -24,7 +24,7 @@
#ifndef _DOM_Events_h_
#define _DOM_Events_h_
#include <dom/dom_misc.h>
#include "misc/shared.h"
#include <dom/dom_string.h>
namespace DOM {
......@@ -49,7 +49,7 @@ typedef EventImpl *EventListenerEvent;
* add them manually.
*
*/
class EventListener : public DomShared {
class EventListener : public khtml::Shared<EventListener> {
public:
EventListener();
virtual ~EventListener();
......
......@@ -27,7 +27,7 @@ namespace DOM {
// --------------------------------------------------------------
short NodeFilterCondition::acceptNode(FilterNode) const
short NodeFilterCondition::acceptNode(NodeImpl*) const
{
return NodeFilter::FILTER_ACCEPT;
}
......
......@@ -27,22 +27,17 @@
#ifndef _dom2_traversal_h_
#define _dom2_traversal_h_
#include <dom/dom_misc.h>
#include "misc/shared.h"
namespace DOM {
class NodeImpl;
class NodeFilterImpl;
class NodeIteratorImpl;
class TreeWalkerImpl;
typedef NodeImpl *FilterNode;
class NodeFilterCondition : public DomShared
class NodeFilterCondition : public khtml::Shared<NodeFilterCondition>
{
public:
virtual short acceptNode(FilterNode) const;
virtual ~NodeFilterCondition() { }
virtual short acceptNode(NodeImpl*) const;
};
/**
......
......@@ -29,8 +29,6 @@
#ifndef _DOM_DOMException_h_
#define _DOM_DOMException_h_
#include <dom/dom_misc.h>
namespace DOM {
/**
......
/**
* This file is part of the DOM implementation for KDE.
*
* (C) 1999 Lars Knoll (knoll@kde.org)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#include "config.h"
#include "dom_misc.h"
namespace DOM {
DomShared::~DomShared()
{
// deliberately left blank
}
}
/*
* This file is part of the DOM implementation for KDE.
*
* (C) 1999 Lars Knoll (knoll@kde.org)
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public License
* along with this library; see the file COPYING.LIB. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*
*/
#ifndef _DOM_RefCountImpl_h_
#define _DOM_RefCountImpl_h_
namespace DOM {
/*
* This implements the reference counting scheme used for all internal
* DOM objects.
*
* Other objects should overload deleteMe() to fit their needs. The default
* implementation deletes the object if the ref count drops to 0.
*/
class DomShared
{
public:
DomShared() : _ref( 0 ) {}
virtual ~DomShared();
bool deleteMe() { return true; }
void ref() { _ref++; }
void deref() { if(_ref) _ref--; if(!_ref && deleteMe()) delete this; }
bool hasOneRef() const { return _ref == 1; }
unsigned int refCount() const { return _ref; }
protected:
// the number of DOMObjects referencing this Node
// An implementation object will delete itself, if it has
// no DOMObject referencing it, and deleteMe() returns true.
unsigned int _ref;
private:
DomShared(const DomShared &);
DomShared &operator=(const DomShared &);
};
} // namespace
#endif
......@@ -29,7 +29,6 @@
#include <kdebug.h>
#include <kjs/protect.h>
using DOM::FilterNode;
using DOM::NodeFilterImpl;
using DOM::NodeImpl;
using DOM::NodeIteratorImpl;
......@@ -314,7 +313,7 @@ JSNodeFilterCondition::JSNodeFilterCondition(ObjectImp * _filter) : filter( _fil
{
}
short JSNodeFilterCondition::acceptNode(FilterNode filterNode) const
short JSNodeFilterCondition::acceptNode(NodeImpl* filterNode) const
{
NodeImpl *node = filterNode;
KHTMLPart *part = node->getDocument()->part();
......
......@@ -28,7 +28,7 @@
namespace DOM {
class NodeFilterImpl;
class NodeIteratorImpl;
class NodeTreeWalkerImpl;
class TreeWalkerImpl;
}
namespace KJS {
......@@ -101,7 +101,7 @@ namespace KJS {
public:
JSNodeFilterCondition(ObjectImp * _filter);
virtual ~JSNodeFilterCondition() {}
virtual short acceptNode(DOM::FilterNode) const;
virtual short acceptNode(DOM::NodeImpl*) const;
protected:
ProtectedPtr<ObjectImp> filter;
};
......
......@@ -76,7 +76,6 @@ using DOM::ElementImpl;
using DOM::EntityImpl;
using DOM::EventImpl;
using DOM::EventListener;
using DOM::FilterNode;
using DOM::HTMLElementImpl;
using DOM::NamedNodeMapImpl;
using DOM::Node;
......@@ -2218,7 +2217,7 @@ class ObjCNodeFilterCondition : public NodeFilterCondition
public:
ObjCNodeFilterCondition(id <DOMNodeFilter>);
virtual ~ObjCNodeFilterCondition();
virtual short acceptNode(FilterNode) const;
virtual short acceptNode(NodeImpl*) const;
private:
ObjCNodeFilterCondition(const ObjCNodeFilterCondition &);
......@@ -2239,7 +2238,7 @@ ObjCNodeFilterCondition::~ObjCNodeFilterCondition()
CFRelease(m_filter);
}
short ObjCNodeFilterCondition::acceptNode(FilterNode n) const
short ObjCNodeFilterCondition::acceptNode(NodeImpl* n) const
{
#if KHTML_NO_CPLUSPLUS_DOM
NodeImpl *node = n;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment