- renamed NodeBaseImpl to ContainerNodeImpl
* khtml/ecma/kjs_dom.cpp:
(DOMNodeProtoFunc::tryCall): Avoid use of NodeBaseImpl and avoid
use of obsolete checkNoOwner call, use isAncestor instead.
* khtml/html/html_elementimpl.cpp:
(HTMLElementImpl::setOuterText): Avoid gratuitous use of
NodeBaseImpl.
* khtml/xml/dom_nodeimpl.cpp:
(NodeBaseImpl::checkNoOwner): Removed.
Ther rest is all just simple renaming.
* khtml/xml/dom_docimpl.cpp:
(DocumentImpl::DocumentImpl):
(DocumentImpl::attach):
(DocumentImpl::detach):
(DocumentFragmentImpl::DocumentFragmentImpl):
* khtml/xml/dom_docimpl.h:
* khtml/xml/dom_elementimpl.cpp:
(AttrImpl::AttrImpl):
(ElementImpl::ElementImpl):
(ElementImpl::insertedIntoDocument):
(ElementImpl::removedFromDocument):
(ElementImpl::attach):
(ElementImpl::dump):
* khtml/xml/dom_elementimpl.h:
* khtml/xml/dom_nodeimpl.cpp:
(ContainerNodeImpl::ContainerNodeImpl):
(ContainerNodeImpl::~ContainerNodeImpl):
(ContainerNodeImpl::firstChild):
(ContainerNodeImpl::lastChild):
(ContainerNodeImpl::insertBefore):
(ContainerNodeImpl::replaceChild):
(ContainerNodeImpl::removeChild):
(ContainerNodeImpl::removeChildren):
(ContainerNodeImpl::appendChild):
(ContainerNodeImpl::hasChildNodes):
(ContainerNodeImpl::setFirstChild):
(ContainerNodeImpl::setLastChild):
(ContainerNodeImpl::checkSameDocument):
(ContainerNodeImpl::checkIsChild):
(ContainerNodeImpl::addChild):
(ContainerNodeImpl::attach):
(ContainerNodeImpl::detach):
(ContainerNodeImpl::insertedIntoDocument):
(ContainerNodeImpl::removedFromDocument):
(ContainerNodeImpl::cloneChildNodes):
(ContainerNodeImpl::getElementsByTagNameNS):
(ContainerNodeImpl::getUpperLeftCorner):
(ContainerNodeImpl::getLowerRightCorner):
(ContainerNodeImpl::getRect):
(ContainerNodeImpl::setFocus):
(ContainerNodeImpl::setActive):
(ContainerNodeImpl::childNodeCount):
(ContainerNodeImpl::childNode):
(ContainerNodeImpl::dispatchChildInsertedEvents):
(ContainerNodeImpl::dispatchChildRemovalEvents):
* khtml/xml/dom_nodeimpl.h:
* khtml/xml/dom_xmlimpl.cpp:
(DOM::EntityImpl::EntityImpl):
(DOM::EntityReferenceImpl::EntityReferenceImpl):
(DOM::NotationImpl::NotationImpl):
(DOM::ProcessingInstructionImpl::ProcessingInstructionImpl):
* khtml/xml/dom_xmlimpl.h:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@9116
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2005-05-02 Maciej Stachowiak <mjs@apple.com>
+
+ Reviewed by Vicki.
+
+ - renamed NodeBaseImpl to ContainerNodeImpl
+
+ * khtml/ecma/kjs_dom.cpp:
+ (DOMNodeProtoFunc::tryCall): Avoid use of NodeBaseImpl and avoid
+ use of obsolete checkNoOwner call, use isAncestor instead.
+ * khtml/html/html_elementimpl.cpp:
+ (HTMLElementImpl::setOuterText): Avoid gratuitous use of
+ NodeBaseImpl.
+ * khtml/xml/dom_nodeimpl.cpp:
+ (NodeBaseImpl::checkNoOwner): Removed.
+
+ Ther rest is all just simple renaming.
+
+ * khtml/xml/dom_docimpl.cpp:
+ (DocumentImpl::DocumentImpl):
+ (DocumentImpl::attach):
+ (DocumentImpl::detach):
+ (DocumentFragmentImpl::DocumentFragmentImpl):
+ * khtml/xml/dom_docimpl.h:
+ * khtml/xml/dom_elementimpl.cpp:
+ (AttrImpl::AttrImpl):
+ (ElementImpl::ElementImpl):
+ (ElementImpl::insertedIntoDocument):
+ (ElementImpl::removedFromDocument):
+ (ElementImpl::attach):
+ (ElementImpl::dump):
+ * khtml/xml/dom_elementimpl.h:
+ * khtml/xml/dom_nodeimpl.cpp:
+ (ContainerNodeImpl::ContainerNodeImpl):
+ (ContainerNodeImpl::~ContainerNodeImpl):
+ (ContainerNodeImpl::firstChild):
+ (ContainerNodeImpl::lastChild):
+ (ContainerNodeImpl::insertBefore):
+ (ContainerNodeImpl::replaceChild):
+ (ContainerNodeImpl::removeChild):
+ (ContainerNodeImpl::removeChildren):
+ (ContainerNodeImpl::appendChild):
+ (ContainerNodeImpl::hasChildNodes):
+ (ContainerNodeImpl::setFirstChild):
+ (ContainerNodeImpl::setLastChild):
+ (ContainerNodeImpl::checkSameDocument):
+ (ContainerNodeImpl::checkIsChild):
+ (ContainerNodeImpl::addChild):
+ (ContainerNodeImpl::attach):
+ (ContainerNodeImpl::detach):
+ (ContainerNodeImpl::insertedIntoDocument):
+ (ContainerNodeImpl::removedFromDocument):
+ (ContainerNodeImpl::cloneChildNodes):
+ (ContainerNodeImpl::getElementsByTagNameNS):
+ (ContainerNodeImpl::getUpperLeftCorner):
+ (ContainerNodeImpl::getLowerRightCorner):
+ (ContainerNodeImpl::getRect):
+ (ContainerNodeImpl::setFocus):
+ (ContainerNodeImpl::setActive):
+ (ContainerNodeImpl::childNodeCount):
+ (ContainerNodeImpl::childNode):
+ (ContainerNodeImpl::dispatchChildInsertedEvents):
+ (ContainerNodeImpl::dispatchChildRemovalEvents):
+ * khtml/xml/dom_nodeimpl.h:
+ * khtml/xml/dom_xmlimpl.cpp:
+ (DOM::EntityImpl::EntityImpl):
+ (DOM::EntityReferenceImpl::EntityReferenceImpl):
+ (DOM::NotationImpl::NotationImpl):
+ (DOM::ProcessingInstructionImpl::ProcessingInstructionImpl):
+ * khtml/xml/dom_xmlimpl.h:
+
2005-05-04 Vicki Murley <vicki@apple.com>
Reviewed by Darin.
all-am:
- xcodebuild -buildstyle $(BUILDSTYLE)
+ xcodebuild -buildstyle $(BUILDSTYLE) OBJROOT=$(SYMROOTS) SYMROOT=$(SYMROOTS) DSTROOT=$(SYMROOTS)
clean-am:
- xcodebuild clean
+ xcodebuild clean OBJROOT=$(SYMROOTS) SYMROOT=$(SYMROOTS) DSTROOT=$(SYMROOTS)
+ rm -rf $(SYMROOTS)/WebCore.build
+ rm -rf $(SYMROOTS)/WebCore.framework
return getDOMNode(exec,node.replaceChild(toNode(args[0]), toNode(args[1])));
case DOMNode::Contains:
{
- int exceptioncode=0;
DOM::Node other = toNode(args[0]);
if (!other.isNull() && node.nodeType()==DOM::Node::ELEMENT_NODE)
{
- DOM::NodeBaseImpl *impl = static_cast<DOM::NodeBaseImpl *>(node.handle());
- bool retval = !impl->checkNoOwner(other.handle(),exceptioncode);
- return Boolean(retval && exceptioncode == 0);
+ DOM::NodeImpl *impl = node.handle();
+ return Boolean(impl->isAncestor(other.handle()));
}
return Undefined();
}
break;
}
- NodeBaseImpl *parent = static_cast<NodeBaseImpl *>(parentNode());
+ NodeImpl *parent = parentNode();
if (!parent) {
return false;
// KHTMLView might be 0
DocumentImpl::DocumentImpl(DOMImplementationImpl *_implementation, KHTMLView *v)
- : NodeBaseImpl( new DocumentPtr() )
+ : ContainerNodeImpl( new DocumentPtr() )
, m_domtree_version(0)
, m_imageLoadEventTimer(0)
#ifndef KHTML_NO_XBL
RenderObject* render = m_render;
m_render = 0;
- NodeBaseImpl::attach();
+ ContainerNodeImpl::attach();
m_render = render;
}
// FIXME: UNLOAD_EVENT will not dispatch due to deleting event listeners prior to closeURL().
removeAllEventListenersFromAllNodes();
- NodeBaseImpl::detach();
+ ContainerNodeImpl::detach();
if ( render )
render->detach();
// ----------------------------------------------------------------------------
-DocumentFragmentImpl::DocumentFragmentImpl(DocumentPtr *doc) : NodeBaseImpl(doc)
+DocumentFragmentImpl::DocumentFragmentImpl(DocumentPtr *doc) : ContainerNodeImpl(doc)
{
}
/**
* @internal
*/
-class DocumentImpl : public QObject, public NodeBaseImpl
+class DocumentImpl : public QObject, public ContainerNodeImpl
{
Q_OBJECT
public:
#endif
};
-class DocumentFragmentImpl : public NodeBaseImpl
+class DocumentFragmentImpl : public ContainerNodeImpl
{
public:
DocumentFragmentImpl(DocumentPtr *doc);
}
AttrImpl::AttrImpl(ElementImpl* element, DocumentPtr* docPtr, AttributeImpl* a)
- : NodeBaseImpl(docPtr),
+ : ContainerNodeImpl(docPtr),
m_element(element),
m_attribute(a)
{
// -------------------------------------------------------------------------
ElementImpl::ElementImpl(DocumentPtr *doc)
- : NodeBaseImpl(doc)
+ : ContainerNodeImpl(doc)
{
namedAttrMap = 0;
m_prefix = 0;
{
// need to do superclass processing first so inDocument() is true
// by the time we reach updateId
- NodeBaseImpl::insertedIntoDocument();
+ ContainerNodeImpl::insertedIntoDocument();
if (hasID()) {
NamedAttrMapImpl *attrs = attributes(true);
}
}
- NodeBaseImpl::removedFromDocument();
+ ContainerNodeImpl::removedFromDocument();
}
void ElementImpl::attach()
#if SPEED_DEBUG < 1
createRendererIfNeeded();
#endif
- NodeBaseImpl::attach();
+ ContainerNodeImpl::attach();
}
void ElementImpl::recalcStyle( StyleChange change )
}
}
- NodeBaseImpl::dump(stream,ind);
+ ContainerNodeImpl::dump(stream,ind);
}
#endif
// is to dynamically allocate a textchild and store the
// resulting nodevalue in the AttributeImpl upon
// destruction. however, this is not yet implemented.
-class AttrImpl : public NodeBaseImpl
+class AttrImpl : public ContainerNodeImpl
{
friend class ElementImpl;
friend class NamedAttrMapImpl;
};
-class ElementImpl : public NodeBaseImpl
+class ElementImpl : public ContainerNodeImpl
{
friend class DocumentImpl;
friend class NamedAttrMapImpl;
//-------------------------------------------------------------------------
-NodeBaseImpl::NodeBaseImpl(DocumentPtr *doc)
+ContainerNodeImpl::ContainerNodeImpl(DocumentPtr *doc)
: NodeImpl(doc)
{
_first = _last = 0;
}
-NodeBaseImpl::~NodeBaseImpl()
+ContainerNodeImpl::~ContainerNodeImpl()
{
- //kdDebug( 6020 ) << "NodeBaseImpl destructor" << endl;
+ //kdDebug( 6020 ) << "ContainerNodeImpl destructor" << endl;
// Avoid deep recursion when destroying the node tree.
static bool alreadyInsideDestructor;
}
-NodeImpl *NodeBaseImpl::firstChild() const
+NodeImpl *ContainerNodeImpl::firstChild() const
{
return _first;
}
-NodeImpl *NodeBaseImpl::lastChild() const
+NodeImpl *ContainerNodeImpl::lastChild() const
{
return _last;
}
-NodeImpl *NodeBaseImpl::insertBefore ( NodeImpl *newChild, NodeImpl *refChild, int &exceptioncode )
+NodeImpl *ContainerNodeImpl::insertBefore ( NodeImpl *newChild, NodeImpl *refChild, int &exceptioncode )
{
exceptioncode = 0;
return newChild;
}
-NodeImpl *NodeBaseImpl::replaceChild ( NodeImpl *newChild, NodeImpl *oldChild, int &exceptioncode )
+NodeImpl *ContainerNodeImpl::replaceChild ( NodeImpl *newChild, NodeImpl *oldChild, int &exceptioncode )
{
exceptioncode = 0;
return oldChild;
}
-NodeImpl *NodeBaseImpl::removeChild ( NodeImpl *oldChild, int &exceptioncode )
+NodeImpl *ContainerNodeImpl::removeChild ( NodeImpl *oldChild, int &exceptioncode )
{
exceptioncode = 0;
return oldChild;
}
-void NodeBaseImpl::removeChildren()
+void ContainerNodeImpl::removeChildren()
{
int exceptionCode;
while (NodeImpl *n = _first) {
}
-NodeImpl *NodeBaseImpl::appendChild ( NodeImpl *newChild, int &exceptioncode )
+NodeImpl *ContainerNodeImpl::appendChild ( NodeImpl *newChild, int &exceptioncode )
{
exceptioncode = 0;
return newChild;
}
-bool NodeBaseImpl::hasChildNodes ( ) const
+bool ContainerNodeImpl::hasChildNodes ( ) const
{
return _first != 0;
}
// not part of the DOM
-void NodeBaseImpl::setFirstChild(NodeImpl *child)
+void ContainerNodeImpl::setFirstChild(NodeImpl *child)
{
_first = child;
}
-void NodeBaseImpl::setLastChild(NodeImpl *child)
+void ContainerNodeImpl::setLastChild(NodeImpl *child)
{
_last = child;
}
// check for same source document:
-bool NodeBaseImpl::checkSameDocument( NodeImpl *newChild, int &exceptioncode )
+bool ContainerNodeImpl::checkSameDocument( NodeImpl *newChild, int &exceptioncode )
{
exceptioncode = 0;
DocumentImpl *ownerDocThis = getDocument();
return false;
}
-// check for being (grand-..)father:
-// ### remove in favor or isAncestor()
-bool NodeBaseImpl::checkNoOwner( NodeImpl *newChild, int &exceptioncode )
-{
- //check if newChild is parent of this...
- NodeImpl *n;
- for( n = this; (n != getDocument()) && (n!= 0); n = n->parentNode() )
- if(n == newChild) {
- exceptioncode = DOMException::HIERARCHY_REQUEST_ERR;
- return true;
- }
- return false;
-}
-
// check for being child:
-bool NodeBaseImpl::checkIsChild( NodeImpl *oldChild, int &exceptioncode )
+bool ContainerNodeImpl::checkIsChild( NodeImpl *oldChild, int &exceptioncode )
{
if(!oldChild || oldChild->parentNode() != this) {
exceptioncode = DOMException::NOT_FOUND_ERR;
return false;
}
-NodeImpl *NodeBaseImpl::addChild(NodeImpl *newChild)
+NodeImpl *ContainerNodeImpl::addChild(NodeImpl *newChild)
{
// do not add applyChanges here! This function is only used during parsing
return this;
}
-void NodeBaseImpl::attach()
+void ContainerNodeImpl::attach()
{
NodeImpl *child = _first;
while(child != 0)
NodeImpl::attach();
}
-void NodeBaseImpl::detach()
+void ContainerNodeImpl::detach()
{
NodeImpl *child = _first;
while(child != 0)
NodeImpl::detach();
}
-void NodeBaseImpl::insertedIntoDocument()
+void ContainerNodeImpl::insertedIntoDocument()
{
NodeImpl::insertedIntoDocument();
for (NodeImpl *child = _first; child; child = child->nextSibling())
child->insertedIntoDocument();
}
-void NodeBaseImpl::removedFromDocument()
+void ContainerNodeImpl::removedFromDocument()
{
NodeImpl::removedFromDocument();
for (NodeImpl *child = _first; child; child = child->nextSibling())
child->removedFromDocument();
}
-void NodeBaseImpl::cloneChildNodes(NodeImpl *clone)
+void ContainerNodeImpl::cloneChildNodes(NodeImpl *clone)
{
int exceptioncode = 0;
NodeImpl *n;
}
}
-NodeListImpl* NodeBaseImpl::getElementsByTagNameNS ( DOMStringImpl* namespaceURI,
+NodeListImpl* ContainerNodeImpl::getElementsByTagNameNS ( DOMStringImpl* namespaceURI,
DOMStringImpl* localName )
{
if (!localName) return 0;
// I don't like this way of implementing the method, but I didn't find any
// other way. Lars
-bool NodeBaseImpl::getUpperLeftCorner(int &xPos, int &yPos) const
+bool ContainerNodeImpl::getUpperLeftCorner(int &xPos, int &yPos) const
{
if (!m_render)
return false;
return true;
}
-bool NodeBaseImpl::getLowerRightCorner(int &xPos, int &yPos) const
+bool ContainerNodeImpl::getLowerRightCorner(int &xPos, int &yPos) const
{
if (!m_render)
return false;
return true;
}
-QRect NodeBaseImpl::getRect() const
+QRect ContainerNodeImpl::getRect() const
{
int xPos, yPos;
if (!getUpperLeftCorner(xPos,yPos))
return QRect(xPos, yPos, xEnd - xPos, yEnd - yPos);
}
-void NodeBaseImpl::setFocus(bool received)
+void ContainerNodeImpl::setFocus(bool received)
{
if (m_focused == received) return;
setChanged();
}
-void NodeBaseImpl::setActive(bool down)
+void ContainerNodeImpl::setActive(bool down)
{
if (down == active()) return;
setChanged();
}
-unsigned long NodeBaseImpl::childNodeCount() const
+unsigned long ContainerNodeImpl::childNodeCount() const
{
unsigned long count = 0;
NodeImpl *n;
return count;
}
-NodeImpl *NodeBaseImpl::childNode(unsigned long index)
+NodeImpl *ContainerNodeImpl::childNode(unsigned long index)
{
unsigned long i;
NodeImpl *n = firstChild();
return n;
}
-void NodeBaseImpl::dispatchChildInsertedEvents( NodeImpl *child, int &exceptioncode )
+void ContainerNodeImpl::dispatchChildInsertedEvents( NodeImpl *child, int &exceptioncode )
{
NodeImpl *p = this;
while (p->parentNode())
}
}
-void NodeBaseImpl::dispatchChildRemovalEvents( NodeImpl *child, int &exceptioncode )
+// base class for nodes that may have children
+void ContainerNodeImpl::dispatchChildRemovalEvents( NodeImpl *child, int &exceptioncode )
{
// Dispatch pre-removal mutation events
getDocument()->notifyBeforeNodeRemoval(child); // ### use events instead
// 3 bits unused
};
-// this is the full Node Implementation with parents and children.
-class NodeBaseImpl : public NodeImpl
+class ContainerNodeImpl : public NodeImpl
{
public:
- NodeBaseImpl(DocumentPtr *doc);
- virtual ~NodeBaseImpl();
+ ContainerNodeImpl(DocumentPtr *doc);
+ virtual ~ContainerNodeImpl();
// DOM methods overridden from parent classes
virtual NodeImpl *firstChild() const;
virtual void insertedIntoDocument();
virtual void removedFromDocument();
- // check for being (grand-..)father:
- bool checkNoOwner( NodeImpl *other, int &exceptioncode );
-
//protected:
NodeImpl *_first;
NodeImpl *_last;
namespace DOM {
-EntityImpl::EntityImpl(DocumentPtr *doc) : NodeBaseImpl(doc)
+EntityImpl::EntityImpl(DocumentPtr *doc) : ContainerNodeImpl(doc)
{
m_publicId = 0;
m_systemId = 0;
m_name = 0;
}
-EntityImpl::EntityImpl(DocumentPtr *doc, DOMString _name) : NodeBaseImpl(doc)
+EntityImpl::EntityImpl(DocumentPtr *doc, DOMString _name) : ContainerNodeImpl(doc)
{
m_publicId = 0;
m_systemId = 0;
m_name->ref();
}
-EntityImpl::EntityImpl(DocumentPtr *doc, DOMString _publicId, DOMString _systemId, DOMString _notationName) : NodeBaseImpl(doc)
+EntityImpl::EntityImpl(DocumentPtr *doc, DOMString _publicId, DOMString _systemId, DOMString _notationName) : ContainerNodeImpl(doc)
{
m_publicId = _publicId.implementation();
if (m_publicId)
// -------------------------------------------------------------------------
-EntityReferenceImpl::EntityReferenceImpl(DocumentPtr *doc) : NodeBaseImpl(doc)
+EntityReferenceImpl::EntityReferenceImpl(DocumentPtr *doc) : ContainerNodeImpl(doc)
{
m_entityName = 0;
}
-EntityReferenceImpl::EntityReferenceImpl(DocumentPtr *doc, DOMStringImpl *_entityName) : NodeBaseImpl(doc)
+EntityReferenceImpl::EntityReferenceImpl(DocumentPtr *doc, DOMStringImpl *_entityName) : ContainerNodeImpl(doc)
{
m_entityName = _entityName;
if (m_entityName)
// -------------------------------------------------------------------------
-NotationImpl::NotationImpl(DocumentPtr *doc) : NodeBaseImpl(doc)
+NotationImpl::NotationImpl(DocumentPtr *doc) : ContainerNodeImpl(doc)
{
m_publicId = 0;
m_systemId = 0;
m_name = 0;
}
-NotationImpl::NotationImpl(DocumentPtr *doc, DOMString _name, DOMString _publicId, DOMString _systemId) : NodeBaseImpl(doc)
+NotationImpl::NotationImpl(DocumentPtr *doc, DOMString _name, DOMString _publicId, DOMString _systemId) : ContainerNodeImpl(doc)
{
m_name = _name.implementation();
if (m_name)
// ### need a way of updating these properly whenever child nodes of the processing instruction
// change or are added/removed
-ProcessingInstructionImpl::ProcessingInstructionImpl(DocumentPtr *doc) : NodeBaseImpl(doc)
+ProcessingInstructionImpl::ProcessingInstructionImpl(DocumentPtr *doc) : ContainerNodeImpl(doc)
{
m_target = 0;
m_data = 0;
#endif
}
-ProcessingInstructionImpl::ProcessingInstructionImpl(DocumentPtr *doc, DOMString _target, DOMString _data) : NodeBaseImpl(doc)
+ProcessingInstructionImpl::ProcessingInstructionImpl(DocumentPtr *doc, DOMString _target, DOMString _data) : ContainerNodeImpl(doc)
{
m_target = _target.implementation();
if (m_target)
class ProcessingInstruction;
#endif
-class EntityImpl : public NodeBaseImpl
+class EntityImpl : public ContainerNodeImpl
{
public:
EntityImpl(DocumentPtr *doc);
};
-class EntityReferenceImpl : public NodeBaseImpl
+class EntityReferenceImpl : public ContainerNodeImpl
{
public:
EntityReferenceImpl(DocumentPtr *doc);
DOMStringImpl *m_entityName;
};
-class NotationImpl : public NodeBaseImpl
+class NotationImpl : public ContainerNodeImpl
{
public:
NotationImpl(DocumentPtr *doc);
};
-class ProcessingInstructionImpl : public NodeBaseImpl, private khtml::CachedObjectClient
+class ProcessingInstructionImpl : public ContainerNodeImpl, private khtml::CachedObjectClient
{
public:
ProcessingInstructionImpl(DocumentPtr *doc);