Commit 2928be58 authored by eseidel's avatar eseidel

Bug #: 5877

Submitted by: eseidel
Reviewed by: mjs
        No test cases needed/possible, only removing dead code.

        Remove rotten #ifdef'd code from the source:
        APPLE_CHANGES & KHTML_NO_CPLUSPLUS_DOM
        http://bugzilla.opendarwin.org/show_bug.cgi?id=5877

        * khtml/dom/css_rule.h:
        (DOM::CSSRule::):
        * khtml/dom/css_stylesheet.h:
        * khtml/dom/css_value.h:
        (DOM::CSSValue::):
        (DOM::CSSPrimitiveValue::):
        * khtml/dom/dom2_events.cpp:
        (DOM::EventListener::handleEventImpl):
        * khtml/dom/dom2_events.h:
        (DOM::Event::):
        (DOM::EventException::):
        (DOM::MutationEvent::):
        * khtml/dom/dom2_range.h:
        (DOM::RangeException::):
        (DOM::Range::):
        * khtml/dom/dom2_traversal.cpp:
        * khtml/dom/dom2_traversal.h:
        (DOM::NodeFilter::):
        * khtml/dom/dom_exception.h:
        (DOM::DOMException::):
        * khtml/dom/dom_misc.cpp:
        (DOM::DomShared::~DomShared):
        * khtml/dom/dom_misc.h:
        (DOM::DomShared::deleteMe):
        * khtml/dom/dom_node.h:
        (DOM::Node::):
        * khtml/ecma/kjs_events.cpp:
        (KJS::JSAbstractEventListener::handleEvent):
        * khtml/ecma/kjs_traversal.cpp:
        (KJS::JSNodeFilterCondition::acceptNode):
        * khtml/khtml_part.cpp:
        (KHTMLPart::stopLoading):
        * khtml/khtml_part.h:
        * khtml/khtmlview.cpp:
        (KHTMLView::viewportMousePressEvent):
        (KHTMLView::focusNextPrevNode):
        * kwq/KWQKConfigBase.h:
        * kwq/KWQKHTMLPageCache.h:
        * kwq/KWQPointArray.h:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@11430 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent ac4dd7c1
2005-12-04 Eric Seidel <eseidel@apple.com>
Reviewed by mjs.
No test cases possible, no function changes.
Remove rotten #ifdef'd code from the source:
APPLE_CHANGES & KHTML_NO_CPLUSPLUS_DOM
http://bugzilla.opendarwin.org/show_bug.cgi?id=5877
* khtml/dom/css_rule.h:
(DOM::CSSRule::):
* khtml/dom/css_stylesheet.h:
* khtml/dom/css_value.h:
(DOM::CSSValue::):
(DOM::CSSPrimitiveValue::):
* khtml/dom/dom2_events.cpp:
(DOM::EventListener::handleEventImpl):
* khtml/dom/dom2_events.h:
(DOM::Event::):
(DOM::EventException::):
(DOM::MutationEvent::):
* khtml/dom/dom2_range.h:
(DOM::RangeException::):
(DOM::Range::):
* khtml/dom/dom2_traversal.cpp:
* khtml/dom/dom2_traversal.h:
(DOM::NodeFilter::):
* khtml/dom/dom_exception.h:
(DOM::DOMException::):
* khtml/dom/dom_misc.cpp:
(DOM::DomShared::~DomShared):
* khtml/dom/dom_misc.h:
(DOM::DomShared::deleteMe):
* khtml/dom/dom_node.h:
(DOM::Node::):
* khtml/ecma/kjs_events.cpp:
(KJS::JSAbstractEventListener::handleEvent):
* khtml/ecma/kjs_traversal.cpp:
(KJS::JSNodeFilterCondition::acceptNode):
* khtml/khtml_part.cpp:
(KHTMLPart::stopLoading):
* khtml/khtml_part.h:
* khtml/khtmlview.cpp:
(KHTMLView::viewportMousePressEvent):
(KHTMLView::focusNextPrevNode):
* kwq/KWQKConfigBase.h:
* kwq/KWQKHTMLPageCache.h:
* kwq/KWQPointArray.h:
2005-12-03 Geoffrey Garen <ggaren@apple.com>
Reviewed by Darin.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -23,14 +23,6 @@
#include "config.h"
#include "dom/dom2_traversal.h"
#if !KHTML_NO_CPLUSPLUS_DOM
#include "dom/dom_exception.h"
#include "dom/dom_string.h"
#include "xml/dom2_traversalimpl.h"
#endif
namespace DOM {
// --------------------------------------------------------------
......@@ -41,317 +33,4 @@ short NodeFilterCondition::acceptNode(FilterNode) const
}
// --------------------------------------------------------------
#if !KHTML_NO_CPLUSPLUS_DOM
NodeFilter::NodeFilter() : impl(0)
{
}
NodeFilter::NodeFilter(NodeFilterCondition *condition)
{
impl = new NodeFilterImpl(condition);
impl->ref();
}
NodeFilter::NodeFilter(const NodeFilter &other)
{
impl = other.impl;
if (impl)
impl->ref();
}
NodeFilter::NodeFilter(NodeFilterImpl *i)
{
impl = i;
if (impl)
impl->ref();
}
NodeFilter &NodeFilter::operator=(const NodeFilter &other)
{
if (impl == other.impl)
return *this;
NodeFilterImpl *old = impl;
impl = other.impl;
if (impl)
impl->ref();
if (old)
old->deref();
return *this;
}
NodeFilter::~NodeFilter()
{
if (impl)
impl->deref();
}
short NodeFilter::acceptNode(const Node &node) const
{
if (impl)
return impl->acceptNode(node.handle());
return FILTER_ACCEPT;
}
// --------------------------------------------------------------
NodeIterator::NodeIterator()
{
impl = 0;
}
NodeIterator::NodeIterator(const NodeIterator &other)
{
impl = other.impl;
if (impl)
impl->ref();
}
NodeIterator::NodeIterator(NodeIteratorImpl *i)
{
impl = i;
if (impl)
impl->ref();
}
NodeIterator &NodeIterator::operator=(const NodeIterator &other)
{
if (impl == other.impl)
return *this;
NodeIteratorImpl *old = impl;
impl = other.impl;
if (impl)
impl->ref();
if (old)
old->deref();
return *this;
}
NodeIterator::~NodeIterator()
{
if (impl)
impl->deref();
}
Node NodeIterator::root() const
{
if (impl)
return impl->root();
return 0;
}
unsigned NodeIterator::whatToShow() const
{
if (impl)
return impl->whatToShow();
return 0;
}
NodeFilter NodeIterator::filter() const
{
if (impl)
return impl->filter();
return NodeFilter();
}
bool NodeIterator::expandEntityReferences() const
{
if (impl)
return impl->expandEntityReferences();
return 0;
}
Node NodeIterator::nextNode()
{
if (!impl)
throw DOMException(DOMException::INVALID_STATE_ERR);
int exceptioncode = 0;
NodeImpl *result = impl->nextNode(exceptioncode);
if (exceptioncode)
throw DOMException(exceptioncode);
return result;
}
Node NodeIterator::previousNode()
{
if (!impl)
throw DOMException(DOMException::INVALID_STATE_ERR);
int exceptioncode = 0;
NodeImpl *result = impl->previousNode(exceptioncode);
if (exceptioncode)
throw DOMException(exceptioncode);
return result;
}
void NodeIterator::detach()
{
if (!impl)
throw DOMException(DOMException::INVALID_STATE_ERR);
int exceptioncode = 0;
impl->detach(exceptioncode);
if (exceptioncode)
throw DOMException(exceptioncode);
}
Node NodeIterator::referenceNode() const
{
if (!impl)
throw DOMException(DOMException::INVALID_STATE_ERR);
return impl->referenceNode();
}
bool NodeIterator::pointerBeforeReferenceNode() const
{
if (!impl)
throw DOMException(DOMException::INVALID_STATE_ERR);
return impl->pointerBeforeReferenceNode();
}
// --------------------------------------------------------------
TreeWalker::TreeWalker()
{
impl = 0;
}
TreeWalker::TreeWalker(const TreeWalker &other)
{
impl = other.impl;
if (impl)
impl->ref();
}
TreeWalker::TreeWalker(TreeWalkerImpl *i)
{
impl = i;
if (impl)
impl->ref();
}
TreeWalker &TreeWalker::operator=(const TreeWalker &other)
{
if (impl == other.impl)
return *this;
TreeWalkerImpl *old = impl;
impl = other.impl;
if (impl)
impl->ref();
if (old)
old->deref();
return *this;
}
TreeWalker::~TreeWalker()
{
if (impl)
impl->deref();
}
Node TreeWalker::root() const
{
if (impl)
return impl->root();
return 0;
}
unsigned TreeWalker::whatToShow() const
{
if (impl)
return impl->whatToShow();
return 0;
}
NodeFilter TreeWalker::filter() const
{
if (impl)
return impl->filter();
return NodeFilter();
}
bool TreeWalker::expandEntityReferences() const
{
if (impl) return impl->expandEntityReferences();
return false;
}
Node TreeWalker::currentNode() const
{
if (impl)
return impl->currentNode();
return 0;
}
void TreeWalker::setCurrentNode(const Node &node)
{
if (impl) {
int exceptioncode = 0;
impl->setCurrentNode(node.handle(), exceptioncode);
if (exceptioncode)
throw DOMException(exceptioncode);
}
}
Node TreeWalker::parentNode()
{
if (impl)
return impl->parentNode();
return 0;
}
Node TreeWalker::firstChild()
{
if (impl)
return impl->firstChild();
return 0;
}
Node TreeWalker::lastChild()
{
if (impl)
return impl->lastChild();
return 0;
}
Node TreeWalker::previousSibling()
{
if (impl)
return impl->previousSibling();
return 0;
}
Node TreeWalker::nextSibling()
{
if (impl)
return impl->nextSibling();
return 0;
}
Node TreeWalker::previousNode()
{
if (impl)
return impl->previousNode();
return 0;
}
Node TreeWalker::nextNode()
{
if (impl)
return impl->nextNode();
return 0;
}
#endif
} // namespace DOM
This diff is collapsed.
......@@ -57,18 +57,6 @@ class DOMException
{
public:
#if !KHTML_NO_CPLUSPLUS_DOM
DOMException(unsigned short _code) { code = _code; }
DOMException(const DOMException &other) { code = other.code; }
DOMException & operator = (const DOMException &other)
{ code = other.code; return *this; }
virtual ~DOMException() {}
#endif
/**
* An integer indicating the type of error generated.
*
......@@ -90,13 +78,6 @@ public:
NAMESPACE_ERR = 14,
INVALID_ACCESS_ERR = 15
};
#if !KHTML_NO_CPLUSPLUS_DOM
unsigned short code;
#endif
};
} //namespace
......
......@@ -29,14 +29,4 @@ DomShared::~DomShared()
{
// deliberately left blank
}
#if !KHTML_NO_CPLUSPLUS_DOM
bool DomShared::deleteMe()
{
return true;
}
#endif
}
......@@ -37,13 +37,7 @@ public:
DomShared() : _ref( 0 ) {}
virtual ~DomShared();
#if KHTML_NO_CPLUSPLUS_DOM
bool deleteMe() { return true; }
#else
/* Overload this function if you want a different deletion behaviour
*/
virtual bool deleteMe();
#endif
void ref() { _ref++; }
void deref() { if(_ref) _ref--; if(!_ref && deleteMe()) delete this; }
......
This diff is collapsed.
......@@ -74,11 +74,7 @@ void JSAbstractEventListener::handleEvent(EventListenerEvent ele, bool isWindowE
return;
#endif
#if KHTML_NO_CPLUSPLUS_DOM
EventImpl *evt = ele;
#else
EventImpl *evt = ele.handle();
#endif
ObjectImp *listener = listenerObj();
ObjectImp *win = windowObj();
......
......@@ -316,11 +316,7 @@ JSNodeFilterCondition::JSNodeFilterCondition(ObjectImp * _filter) : filter( _fil
short JSNodeFilterCondition::acceptNode(FilterNode filterNode) const
{
#if !KHTML_NO_CPLUSPLUS_DOM
NodeImpl *node = filterNode.handle();
#else
NodeImpl *node = filterNode;
#endif
KHTMLPart *part = node->getDocument()->part();
KJSProxy *proxy = KJSProxy::proxy(part);
if (proxy && filter->implementsCall()) {
......
......@@ -107,10 +107,6 @@ using namespace HTMLNames;
#include "khtmlpart_p.h"
#if !KHTML_NO_CPLUSPLUS_DOM
#include "dom/html_document.h"
#endif
#include <CoreServices/CoreServices.h>
using namespace DOM::EventNames;
......@@ -490,11 +486,6 @@ void KHTMLPart::stopLoading(bool sendUnload)
// Stop any started redirections as well!! (DA)
cancelRedirection();
#if !KHTML_NO_CPLUSPLUS_DOM
// null node activated.
emit nodeActivated(Node());
#endif
}
bool KHTMLPart::closeURL()
......@@ -606,15 +597,6 @@ QVariant KHTMLPart::executeScript( const QString &script, bool forceUserGesture
//Enable this to see all JS scripts being executed
//#define KJS_VERBOSE
#if !KHTML_NO_CPLUSPLUS_DOM
QVariant KHTMLPart::executeScript( const DOM::Node &n, const QString &script, bool forceUserGesture )
{
return executeScript(n.handle(), script, forceUserGesture);
}
#endif
QVariant KHTMLPart::executeScript( DOM::NodeImpl *n, const QString &script, bool forceUserGesture )
{
#ifdef KJS_VERBOSE
......@@ -1593,16 +1575,6 @@ void KHTMLPart::setOnlyLocalReferences(bool enable)
d->m_onlyLocalReferences = enable;
}
#if !KHTML_NO_CPLUSPLUS_DOM
QString KHTMLPart::text(const DOM::Range &r) const
{
return plainText(r.handle());
}
#endif
QString KHTMLPart::selectedText() const
{
return plainText(selection().toRange().get());
......@@ -2278,16 +2250,6 @@ KHTMLPart *KHTMLPart::parentPart() const
return (KHTMLPart *)parent();
}
#if !KHTML_NO_CPLUSPLUS_DOM
DOM::Node KHTMLPart::nodeUnderMouse() const
{
return d->m_view->nodeUnderMouse();
}
#endif
void KHTMLPart::emitSelectionChanged()
{
}
......@@ -2981,25 +2943,6 @@ void KHTMLPart::slotPartRemoved( KParts::Part *part )
d->m_activeFrame = 0L;
}
#if !KHTML_NO_CPLUSPLUS_DOM
void KHTMLPart::setActiveNode(const DOM::Node &node)
{
if (!d->m_doc || !d->m_view)
return;
// Set the document's active node
d->m_doc->setFocusNode(node.handle());
}
DOM::Node KHTMLPart::activeNode() const
{
return DOM::Node(d->m_doc?d->m_doc->focusNode():0);
}
#endif
DOM::EventListener *KHTMLPart::createHTMLEventListener( QString code, NodeImpl *node )
{
KJSProxy *proxy = jScript();
......
......@@ -230,26 +230,6 @@ public:
void stopLoading(bool sendUnload = false);
virtual bool closeURL();
#if !KHTML_NO_CPLUSPLUS_DOM
/**
* Returns a reference to the DOM HTML document (for non-HTML documents, returns null)
*/
DOM::HTMLDocument htmlDocument() const;
/**
* Returns a reference to the DOM document.
*/
DOM::Document document() const;
/**
* Returns the node that has the keyboard focus.
*/
DOM::Node activeNode() const;
#endif
/**
* Returns a pointer to the @ref KParts::BrowserExtension.
*/
......@@ -296,9 +276,6 @@ public:
/**
* Same as above except the Node parameter specifying the 'this' value.
*/
#if !KHTML_NO_CPLUSPLUS_DOM
QVariant executeScript( const DOM::Node &n, const QString &script, bool forceUserGesture = false );
#endif
QVariant executeScript( DOM::NodeImpl *n, const QString &script, bool forceUserGesture = false );
/**
......@@ -681,13 +658,6 @@ public:
*/
int xPosForVerticalArrowNavigation() const;
#if !KHTML_NO_CPLUSPLUS_DOM
/**
* Returns the text for a part of the document.
*/
QString text(const DOM::Range &) const;
#endif
/**
* Has the user selected anything?
*
......@@ -776,15 +746,6 @@ public:
virtual void tokenizerProcessedData() {};
#if !KHTML_NO_CPLUSPLUS_DOM
/**
* Returns the @p Node currently under the mouse
*/
DOM::Node nodeUnderMouse() const;
#endif
/**
* @internal