[webkit-changes] cvs commit: WebCore/kwq KWQKConfigBase.h
KWQKHTMLPageCache.h KWQPointArray.h
Eric
eseidel at opensource.apple.com
Sun Dec 4 03:35:11 PST 2005
eseidel 05/12/04 03:35:10
Modified: . ChangeLog
khtml khtml_part.cpp khtml_part.h khtmlview.cpp
khtml/dom css_rule.h css_stylesheet.h css_value.h
dom2_events.cpp dom2_events.h dom2_range.h
dom2_traversal.cpp dom2_traversal.h dom_exception.h
dom_misc.cpp dom_misc.h dom_node.h
khtml/ecma kjs_events.cpp kjs_traversal.cpp
kwq KWQKConfigBase.h KWQKHTMLPageCache.h
KWQPointArray.h
Log:
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:
Revision Changes Path
1.468 +50 -0 WebCore/ChangeLog
Index: ChangeLog
===================================================================
RCS file: /cvs/root/WebCore/ChangeLog,v
retrieving revision 1.467
retrieving revision 1.468
diff -u -r1.467 -r1.468
--- ChangeLog 4 Dec 2005 01:21:03 -0000 1.467
+++ ChangeLog 4 Dec 2005 11:34:55 -0000 1.468
@@ -1,3 +1,53 @@
+2005-12-04 Eric Seidel <eseidel at 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 at apple.com>
Reviewed by Darin.
1.363 +0 -57 WebCore/khtml/khtml_part.cpp
Index: khtml_part.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/khtml_part.cpp,v
retrieving revision 1.362
retrieving revision 1.363
diff -u -r1.362 -r1.363
--- khtml_part.cpp 2 Dec 2005 03:48:03 -0000 1.362
+++ khtml_part.cpp 4 Dec 2005 11:35:02 -0000 1.363
@@ -107,10 +107,6 @@
#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 @@
// 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 @@
//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 @@
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 @@
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 @@
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();
1.141 +0 -67 WebCore/khtml/khtml_part.h
Index: khtml_part.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/khtml_part.h,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -r1.140 -r1.141
--- khtml_part.h 21 Nov 2005 04:01:51 -0000 1.140
+++ khtml_part.h 4 Dec 2005 11:35:02 -0000 1.141
@@ -230,26 +230,6 @@
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 @@
/**
* 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 @@
*/
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 @@
virtual void tokenizerProcessedData() {};
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- /**
- * Returns the @p Node currently under the mouse
- */
- DOM::Node nodeUnderMouse() const;
-
-#endif
-
/**
* @internal
*/
@@ -940,19 +901,6 @@
*/
void selectionChanged();
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- /**
- * This signal is emitted when an element retrieves the
- * keyboard focus. Note that the signal argument can be
- * a null node if no element is active, meaning a node
- * has explicitly been deactivated without a new one
- * becoming active.
- */
- void nodeActivated(const DOM::Node &);
-
-#endif
-
public:
/**
@@ -1009,21 +957,6 @@
public slots:
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- /**
- * Sets the focussed node of the document to the specified node. If the node is a form control, the control will
- * receive focus in the same way that it would if the user had clicked on it or tabbed to it with the keyboard. For
- * most other types of elements, there is no visul indiction of whether or not they are focussed.
- *
- * See @ref activeNode
- *
- * @param node The node to focus
- */
- void setActiveNode(const DOM::Node &node);
-
-#endif
-
/**
* Stops all animated images on the current and child pages
*/
1.156 +0 -7 WebCore/khtml/khtmlview.cpp
Index: khtmlview.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/khtmlview.cpp,v
retrieving revision 1.155
retrieving revision 1.156
diff -u -r1.155 -r1.156
--- khtmlview.cpp 2 Dec 2005 03:48:04 -0000 1.155
+++ khtmlview.cpp 4 Dec 2005 11:35:03 -0000 1.156
@@ -652,9 +652,6 @@
if (KWQ(m_part)->lastEventIsMouseUp()) {
d->mousePressed = false;
}
-#if !KHTML_NO_CPLUSPLUS_DOM
- emit m_part->nodeActivated(mev.innerNode.get());
-#endif
}
}
@@ -1136,10 +1133,6 @@
}
// Set focus node on the document
m_part->xmlDocImpl()->setFocusNode(newFocusNode);
-#if !KHTML_NO_CPLUSPLUS_DOM
- emit m_part->nodeActivated(newFocusNode);
-#endif
-
}
void KHTMLView::setMediaType( const QString &medium )
1.9 +0 -489 WebCore/khtml/dom/css_rule.h
Index: css_rule.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/css_rule.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- css_rule.h 16 Sep 2005 22:42:03 -0000 1.8
+++ css_rule.h 4 Dec 2005 11:35:05 -0000 1.9
@@ -27,22 +27,8 @@
#ifndef _CSS_css_rule_h_
#define _CSS_css_rule_h_
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-#include <dom/dom_string.h>
-#include <dom/css_stylesheet.h>
-#include <dom/css_value.h>
-
-#endif
-
namespace DOM {
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-class CSSRuleImpl;
-
-#endif
-
/**
* The <code> CSSRule </code> interface is the abstract base interface
* for any type of CSS <a
@@ -62,19 +48,6 @@
public:
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- CSSRule();
- CSSRule(const CSSRule &other);
- CSSRule(CSSRuleImpl *impl);
-public:
-
- CSSRule & operator = (const CSSRule &other);
-
- ~CSSRule();
-
-#endif
-
/**
* An integer indicating which type of rule this is.
*
@@ -89,469 +62,7 @@
PAGE_RULE = 6,
QUIRKS_RULE = 100 // Not part of the official DOM
};
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- /**
- * The type of the rule, as defined above. The expectation is that
- * binding-specific casting methods can be used to cast down from
- * an instance of the <code> CSSRule </code> interface to the
- * specific derived interface implied by the <code> type </code> .
- *
- */
- unsigned short type() const;
-
- /**
- * The parsable textual representation of the rule. This reflects
- * the current state of the rule and not its initial value.
- *
- */
- DOMString cssText() const;
-
- /**
- * see @ref cssText
- * @exception DOMException
- *
- * HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted
- * at this point in the style sheet.
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is
- * readonly.
- *
- * @exception CSSException
- * SYNTAX_ERR: Raised if the specified CSS string value has a
- * syntax error and is unparsable.
- *
- * INVALID_MODIFICATION_ERR: Raised if the specified CSS string value
- * represents a different type of rule than the current one.
- */
- void setCssText( const DOMString & );
-
- /**
- * The style sheet that contains this rule.
- *
- */
- CSSStyleSheet parentStyleSheet() const;
-
- /**
- * If this rule is contained inside another rule (e.g. a style
- * rule inside an @media block), this is the containing rule. If
- * this rule is not nested inside any other rules, this returns
- * <code> null </code> .
- *
- */
- CSSRule parentRule() const;
-
- /**
- * @internal
- * not part of the DOM
- */
- CSSRuleImpl *handle() const;
- bool isNull() const;
-
-protected:
- CSSRuleImpl *impl;
-
- void assignOther( const CSSRule &other, RuleType thisType );
-
-#endif
-
-};
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-class CSSCharsetRuleImpl;
-
-/**
- * The <code> CSSCharsetRule </code> interface a <a href=""> @charset
- * rule </a> in a CSS style sheet. A <code> @charset </code> rule can
- * be used to define the encoding of the style sheet.
- *
- */
-class CSSCharsetRule : public CSSRule
-{
-public:
- CSSCharsetRule();
- CSSCharsetRule(const CSSCharsetRule &other);
- CSSCharsetRule(const CSSRule &other);
- CSSCharsetRule(CSSCharsetRuleImpl *impl);
-public:
-
- CSSCharsetRule & operator = (const CSSCharsetRule &other);
- CSSCharsetRule & operator = (const CSSRule &other);
-
- ~CSSCharsetRule();
-
- /**
- * The encoding information used in this <code> @charset </code>
- * rule.
- *
- */
- DOMString encoding() const;
-
- /**
- * see @ref encoding
- * @exception CSSException
- * SYNTAX_ERR: Raised if the specified encoding value has a syntax
- * error and is unparsable.
- *
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this encoding rule is
- * readonly.
- *
- */
- void setEncoding( const DOMString & );
};
-
-
-class CSSFontFaceRuleImpl;
-/**
- * The <code> CSSFontFaceRule </code> interface represents a <a
- * href="http://www.w3.org/TR/REC-CSS2/fonts.html#font-descriptions">
- * @font-face rule </a> in a CSS style sheet. The <code> @font-face
- * </code> rule is used to hold a set of font descriptions.
- *
- */
-class CSSFontFaceRule : public CSSRule
-{
-public:
- CSSFontFaceRule();
- CSSFontFaceRule(const CSSFontFaceRule &other);
- CSSFontFaceRule(const CSSRule &other);
- CSSFontFaceRule(CSSFontFaceRuleImpl *impl);
-public:
-
- CSSFontFaceRule & operator = (const CSSFontFaceRule &other);
- CSSFontFaceRule & operator = (const CSSRule &other);
-
- ~CSSFontFaceRule();
-
- /**
- * The <a href="http://www.w3.org/TR/REC-CSS2/syndata.html#q8">
- * declaration-block </a> of this rule.
- *
- */
- CSSStyleDeclaration style() const;
-};
-
-class CSSImportRuleImpl;
-/**
- * The <code> CSSImportRule </code> interface represents a <a
- * href="http://www.w3.org/TR/REC-CSS2/cascade.html#at-import">
- * @import rule </a> within a CSS style sheet. The <code> @import
- * </code> rule is used to import style rules from other style sheets.
- *
- */
-class CSSImportRule : public CSSRule
-{
-public:
- CSSImportRule();
- CSSImportRule(const CSSImportRule &other);
- CSSImportRule(const CSSRule &other);
- CSSImportRule(CSSImportRuleImpl *impl);
-public:
-
- CSSImportRule & operator = (const CSSImportRule &other);
- CSSImportRule & operator = (const CSSRule &other);
-
- ~CSSImportRule();
-
- /**
- * The location of the style sheet to be imported. The attribute
- * will not contain the <code> "url(...)" </code> specifier around
- * the URI.
- *
- */
- DOMString href() const;
-
- /**
- * A list of media types for which this style sheet may be used.
- *
- */
- MediaList media() const;
-
- /**
- * The style sheet referred to by this rule, if it has been
- * loaded. The value of this attribute is null if the style sheet
- * has not yet been loaded or if it will not be loaded (e.g. if
- * the style sheet is for a media type not supported by the user
- * agent).
- *
- */
- CSSStyleSheet styleSheet() const;
-};
-
-class CSSMediaRuleImpl;
-/**
- * The <code> CSSMediaRule </code> interface represents a <a
- * href="http://www.w3.org/TR/REC-CSS2/media.html#at-media-rule">
- * @media rule </a> in a CSS style sheet. A <code> @media </code> rule
- * can be used to delimit style rules for specific media types.
- *
- */
-class CSSMediaRule : public CSSRule
-{
-public:
- CSSMediaRule();
- CSSMediaRule(const CSSMediaRule &other);
- CSSMediaRule(const CSSRule &other);
- CSSMediaRule(CSSMediaRuleImpl *impl);
-public:
-
- CSSMediaRule & operator = (const CSSMediaRule &other);
- CSSMediaRule & operator = (const CSSRule &other);
-
- ~CSSMediaRule();
-
- /**
- * A list of <a
- * href="http://www.w3.org/TR/REC-CSS2/media.html#media-types">
- * media types </a> for this rule.
- *
- */
- MediaList media() const;
-
- /**
- * A list of all CSS rules contained within the media block.
- *
- */
- CSSRuleList cssRules() const;
-
- /**
- * Used to insert a new rule into the media block.
- *
- * @param rule The parsable text representing the rule. For rule
- * sets this contains both the selector and the style declaration.
- * For at-rules, this specifies both the at-identifier and the
- * rule content.
- *
- * @param index The index within the media block's rule collection
- * of the rule before which to insert the specified rule. If the
- * specified index is equal to the length of the media blocks's
- * rule collection, the rule will be added to the end of the media
- * block.
- *
- * @return The index within the media block's rule collection of
- * the newly inserted rule.
- *
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at
- * the specified index. e.g. if an <code> @import </code> rule is
- * inserted after a standard rule set or other at-rule.
- *
- * INDEX_SIZE_ERR: Raised if the specified index is not a valid
- * insertion point.
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule is
- * readonly.
- *
- * @exception CSSException
- * SYNTAX_ERR: Raised if the specified rule has a syntax error
- * and is unparsable.
- *
- */
- unsigned insertRule ( const DOMString &rule, unsigned index );
-
- /**
- * Used to delete a rule from the media block.
- *
- * @param index The index within the media block's rule collection
- * of the rule to remove.
- *
- * @return
- *
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index does not
- * correspond to a rule in the media rule list.
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this media rule is
- * readonly.
- *
- */
- void deleteRule ( unsigned index );
-};
-
-
-class CSSPageRuleImpl;
-/**
- * The <code> CSSPageRule </code> interface represents a <a
- * href="http://www.w3.org/TR/REC-CSS2/page.html#page-box"> @page rule
- * </a> within a CSS style sheet. The <code> @page </code> rule is
- * used to specify the dimensions, orientation, margins, etc. of a
- * page box for paged media.
- *
- */
-class CSSPageRule : public CSSRule
-{
-public:
- CSSPageRule();
- CSSPageRule(const CSSPageRule &other);
- CSSPageRule(const CSSRule &other);
- CSSPageRule(CSSPageRuleImpl *impl);
-public:
-
- CSSPageRule & operator = (const CSSPageRule &other);
- CSSPageRule & operator = (const CSSRule &other);
-
- ~CSSPageRule();
-
- /**
- * The parsable textual representation of the page selector for
- * the rule.
- *
- */
- DOMString selectorText() const;
-
- /**
- * see @ref selectorText
- * @exception CSSException
- * SYNTAX_ERR: Raised if the specified CSS string value has a
- * syntax error and is unparsable.
- *
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is
- * readonly.
- *
- */
- void setSelectorText( const DOMString & );
-
- /**
- * The <a href="http://www.w3.org/TR/REC-CSS2/syndata.html#q8">
- * declaration-block </a> of this rule.
- *
- */
- CSSStyleDeclaration style() const;
-};
-
-class CSSStyleRuleImpl;
-/**
- * The <code> CSSStyleRule </code> interface represents a single <a
- * href="http://www.w3.org/TR/REC-CSS2/syndata.html#q8"> rule set </a>
- * in a CSS style sheet.
- *
- */
-class CSSStyleRule : public CSSRule
-{
-public:
- CSSStyleRule();
- CSSStyleRule(const CSSStyleRule &other);
- CSSStyleRule(const CSSRule &other);
- CSSStyleRule(CSSStyleRuleImpl *impl);
-public:
-
- CSSStyleRule & operator = (const CSSStyleRule &other);
- CSSStyleRule & operator = (const CSSRule &other);
-
- ~CSSStyleRule();
-
- /**
- * The textual representation of the <a
- * href="http://www.w3.org/TR/REC-CSS2/selector.html"> selector
- * </a> for the rule set. The implementation may have stripped out
- * insignificant whitespace while parsing the selector.
- *
- */
- DOMString selectorText() const;
-
- /**
- * see @ref selectorText
- * @exception CSSException
- * SYNTAX_ERR: Raised if the specified CSS string value has a
- * syntax error and is unparsable.
- *
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is
- * readonly.
- *
- */
- void setSelectorText( const DOMString & );
-
- /**
- * The <a href="http://www.w3.org/TR/REC-CSS2/syndata.html#q8">
- * declaration-block </a> of this rule set.
- *
- */
- CSSStyleDeclaration style() const;
-};
-
-class CSSUnknownRuleImpl;
-/**
- * The <code> CSSUnkownRule </code> interface represents an at-rule
- * not supported by this user agent.
- *
- */
-class CSSUnknownRule : public CSSRule
-{
-public:
- CSSUnknownRule();
- CSSUnknownRule(const CSSUnknownRule &other);
- CSSUnknownRule(const CSSRule &other);
- CSSUnknownRule(CSSUnknownRuleImpl *impl);
-public:
-
- CSSUnknownRule & operator = (const CSSUnknownRule &other);
- CSSUnknownRule & operator = (const CSSRule &other);
-
- ~CSSUnknownRule();
-};
-
-
-class CSSRuleListImpl;
-class StyleListImpl;
-/**
- * The <code> CSSRuleList </code> interface provides the abstraction
- * of an ordered collection of CSS rules.
- *
- */
-class CSSRuleList
-{
-public:
- CSSRuleList();
- CSSRuleList(const CSSRuleList &other);
- CSSRuleList(CSSRuleListImpl *i);
- CSSRuleList(StyleListImpl *i);
-public:
-
- CSSRuleList & operator = (const CSSRuleList &other);
-
- ~CSSRuleList();
-
- /**
- * The number of <code> CSSRule </code> s in the list. The range
- * of valid child rule indices is <code> 0 </code> to <code>
- * length-1 </code> inclusive.
- *
- */
- unsigned length() const;
-
- /**
- * Used to retrieve a CSS rule by ordinal index. The order in this
- * collection represents the order of the rules in the CSS style
- * sheet.
- *
- * @param index Index into the collection
- *
- * @return The style rule at the <code> index </code> position in
- * the <code> CSSRuleList </code> , or <code> null </code> if that
- * is not a valid index.
- *
- */
- CSSRule item ( unsigned index );
-
- /**
- * @internal
- * not part of the DOM
- */
- CSSRuleListImpl *handle() const;
- bool isNull() const;
-
-protected:
- // we just need a pointer to an implementation here.
- CSSRuleListImpl *impl;
-};
-
-#endif
-
} // namespace
#endif
1.11 +0 -464 WebCore/khtml/dom/css_stylesheet.h
Index: css_stylesheet.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/css_stylesheet.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- css_stylesheet.h 16 Sep 2005 22:42:03 -0000 1.10
+++ css_stylesheet.h 4 Dec 2005 11:35:05 -0000 1.11
@@ -29,150 +29,8 @@
#ifndef _CSS_css_stylesheet_h_
#define _CSS_css_stylesheet_h_
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-#include <dom/dom_string.h>
-#include <dom/dom_node.h>
-#include <dom/dom_misc.h>
-
-#endif
-
namespace DOM {
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-class StyleSheetImpl;
-class MediaList;
-class NodeImpl;
-class DocumentImpl;
-
-/**
- * The <code> StyleSheet </code> interface is the abstract base
- * interface for any type of style sheet. It represents a single style
- * sheet associated with a structured document. In HTML, the
- * StyleSheet interface represents either an external style sheet,
- * included via the HTML <a
- * href="http://www.w3.org/TR/REC-html40/struct/links.html#h-12.3">
- * LINK </a> element, or an inline <a
- * href="http://www.w3.org/TR/REC-html40/present/styles.html#h-14.2.3">
- * STYLE </a> element. In XML, this interface represents an external
- * style sheet, included via a <a
- * href="http://www.w3.org/TR/xml-stylesheet"> style sheet processing
- * instruction </a> .
- *
- */
-class StyleSheet
-{
-public:
- StyleSheet();
- StyleSheet(const StyleSheet &other);
- StyleSheet(StyleSheetImpl *impl);
-public:
-
- StyleSheet & operator = (const StyleSheet &other);
-
- ~StyleSheet();
-
- /**
- * This specifies the style sheet language for this style sheet.
- * The style sheet language is specified as a content type (e.g.
- * "text/css"). The content type is often specified in the <code>
- * ownerNode </code> . A list of registered content types can be
- * found at <a
- * href="ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/">
- * ftp://ftp.isi.edu/in-notes/iana/assignments/media-types/ </a> .
- * Also see the <a
- * href="http://www.w3.org/TR/REC-html40/struct/links.html#adef-type-A">
- * type attribute definition </a> for the <code> LINK </code>
- * element in HTML 4.0, and the type pseudo-attribute for the XML
- * <a href="http://www.w3.org/TR/xml-stylesheet"> style sheet
- * processing instruction </a> .
- *
- */
- DOMString type() const;
-
- /**
- * <code> false </code> if the style sheet is applied to the
- * document. <code> true </code> if it is not. Modifying this
- * attribute may cause a reresolution of style for the document.
- *
- */
- bool disabled() const;
-
- /**
- * see @ref disabled
- */
- void setDisabled( bool );
-
- /**
- * The node that associates this style sheet with the document.
- * For HTML, this may be the corresponding <code> LINK </code> or
- * <code> STYLE </code> element. For XML, it may be the linking
- * processing instruction. For style sheets that are included by
- * other style sheets, this attribute has a value of null.
- *
- */
- Node ownerNode() const;
-
- /**
- * For style sheet languages that support the concept of style
- * sheet inclusion, this attribute represents the including style
- * sheet, if one exists. If the style sheet is a top-level style
- * sheet, or the style sheet language does not support inclusion,
- * the value of the attribute is null.
- *
- */
- StyleSheet parentStyleSheet() const;
-
- /**
- * If the style sheet is a linked style sheet, the value of its
- * attribute is its location. For inline style sheets, the value
- * of this attribute is null. See the <a
- * href="http://www.w3.org/TR/REC-html40/struct/links.html#adef-href">
- * href attribute definition </a> for the <code> LINK </code>
- * element in HTML 4.0, and the href pseudo-attribute for the XML
- * <a href="http://www.w3.org/TR/xml-stylesheet"> style sheet
- * processing instruction </a> .
- *
- */
- DOMString href() const;
-
- /**
- * The advisory title. The title is often specified in the <code>
- * ownerNode </code> . See the <a
- * href="http://www.w3.org/TR/REC-html40/struct/global.html#adef-title">
- * title attribute definition </a> for the <code> LINK </code>
- * element in HTML 4.0, and the title pseudo-attribute for the XML
- * <a href="http://www.w3.org/TR/xml-stylesheet"> style sheet
- * processing instruction </a> .
- *
- */
- DOMString title() const;
-
- /**
- * The intended destination media for style information. The media
- * is often specified in the <code> ownerNode </code> . See the <a
- * href="http://www.w3.org/TR/REC-html40/present/styles.html#adef-media">
- * media attribute definition </a> for the <code> LINK </code>
- * element in HTML 4.0, and the media pseudo-attribute for the XML
- * <a href="http://www.w3.org/TR/WD-xml-stylesheet"> style sheet
- * processing instruction </a> .
- *
- */
- MediaList media() const;
-
- /**
- * @internal
- */
- bool isCSSStyleSheet() const;
- StyleSheetImpl *handle() const { return impl; }
- bool isNull() const;
-protected:
- StyleSheetImpl *impl;
-};
-
-#endif
-
/**
* This exception is raised when a specific CSS operation is impossible
* to perform.
@@ -182,23 +40,6 @@
public:
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- CSSException(unsigned short _code) { code = _code; }
- CSSException(const CSSException &other) { code = other.code; }
-
- CSSException & operator = (const CSSException &other)
- { code = other.code; return *this; }
-
- virtual ~CSSException() {}
- /**
- * An integer indicating the type of error generated.
- *
- */
- unsigned short code;
-
-#endif
-
enum ExceptionCode
{
SYNTAX_ERR = 0,
@@ -207,311 +48,6 @@
_EXCEPTION_MAX = 1999
};
};
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-class CSSStyleSheetImpl;
-class CSSRule;
-class CSSRuleList;
-
-/**
- * The <code> CSSStyleSheet </code> interface is a concrete interface
- * used to represent a CSS style sheet i.e. a style sheet whose
- * content type is "text/css".
- *
- */
-class CSSStyleSheet : public StyleSheet
-{
-public:
- CSSStyleSheet();
- CSSStyleSheet(const CSSStyleSheet &other);
- CSSStyleSheet(const StyleSheet &other);
- CSSStyleSheet(CSSStyleSheetImpl *impl);
-public:
-
- CSSStyleSheet & operator = (const CSSStyleSheet &other);
- CSSStyleSheet & operator = (const StyleSheet &other);
-
- ~CSSStyleSheet();
-
- /**
- * If this style sheet comes from an <code> @import </code> rule,
- * the <code> ownerRule </code> attribute will contain the <code>
- * CSSImportRule </code> . In that case, the <code> ownerNode
- * </code> attribute in the <code> StyleSheet </code> interface
- * will be <code> null </code> . If the style sheet comes from an
- * element or a processing instruction, the <code> ownerRule
- * </code> attribute will be <code> null </code> and the <code>
- * ownerNode </code> attribute will contain the <code> Node
- * </code> .
- *
- */
- CSSRule ownerRule() const;
-
- /**
- * The list of all CSS rules contained within the style sheet.
- * This includes both <a
- * href="http://www.w3.org/TR/REC-CSS2/syndata.html#q8"> rule sets
- * </a> and <a
- * href="http://www.w3.org/TR/REC-CSS2/syndata.html#at-rules">
- * at-rules </a> .
- *
- */
- CSSRuleList cssRules() const;
-
- /**
- * Used to insert a new rule into the style sheet. The new rule
- * now becomes part of the cascade.
- *
- * @param rule The parsable text representing the rule. For rule
- * sets this contains both the selector and the style declaration.
- * For at-rules, this specifies both the at-identifier and the
- * rule content.
- *
- * @param index The index within the style sheet's rule list of
- * the rule before which to insert the specified rule. If the
- * specified index is equal to the length of the style sheet's
- * rule collection, the rule will be added to the end of the style
- * sheet.
- *
- * @return The index within the style sheet's rule collection of
- * the newly inserted rule.
- *
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if the rule cannot be inserted at
- * the specified index e.g. if an <code> @import </code> rule is
- * inserted after a standard rule set or other at-rule.
- *
- * INDEX_SIZE_ERR: Raised if the specified index is not a valid
- * insertion point.
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is
- * readonly.
- *
- * @exception CSSException
- * SYNTAX_ERR: Raised if the specified rule has a syntax error
- * and is unparsable.
- *
- */
- unsigned insertRule ( const DOMString &rule, unsigned index );
-
- /**
- * Used to delete a rule from the style sheet.
- *
- * @param index The index within the style sheet's rule list of
- * the rule to remove.
- *
- * @return
- *
- * @exception DOMException
- * INDEX_SIZE_ERR: Raised if the specified index does not
- * correspond to a rule in the style sheet's rule list.
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this style sheet is
- * readonly.
- *
- */
- void deleteRule ( unsigned index );
-
- /* Microsoft extension. */
- void addRule ( const DOMString &selector, const DOMString &style, int index );
-};
-
-
-class StyleSheetListImpl;
-class StyleSheet;
-
-/**
- * The <code> StyleSheetList </code> interface provides the
- * abstraction of an ordered collection of style sheets.
- *
- */
-class StyleSheetList
-{
-public:
- StyleSheetList();
- StyleSheetList(const StyleSheetList &other);
- StyleSheetList(StyleSheetListImpl *impl);
-public:
-
- StyleSheetList & operator = (const StyleSheetList &other);
-
- ~StyleSheetList();
-
- /**
- * The number of <code> StyleSheet </code> in the list. The range
- * of valid child stylesheet indices is <code> 0 </code> to <code>
- * length-1 </code> inclusive.
- *
- */
- unsigned length() const;
-
- /**
- * Used to retrieve a style sheet by ordinal index.
- *
- * @param index Index into the collection
- *
- * @return The style sheet at the <code> index </code> position in
- * the <code> StyleSheetList </code> , or <code> null </code> if
- * that is not a valid index.
- *
- */
- StyleSheet item ( unsigned index );
-
- /**
- * @internal
- */
- StyleSheetListImpl *handle() const;
- bool isNull() const;
-
-protected:
- StyleSheetListImpl *impl;
-};
-
-
-class MediaListImpl;
-class CSSRule;
-class CSSStyleSheet;
-
-/**
- * The <code> MediaList </code> interface provides the abstraction of
- * an ordered collection of media, without defining or constraining
- * how this collection is implemented. All media are lowercase
- * strings.
- *
- */
-class MediaList
-{
-public:
- MediaList();
- MediaList(const MediaList &other);
- MediaList(MediaListImpl *impl);
-public:
-
- MediaList & operator = (const MediaList &other);
-
- ~MediaList();
-
- /**
- * The parsable textual representation of the media list. This is a
- * comma-separated list of media.
- *
- * @exception DOMException
- * SYNTAX_ERR: Raised if the specified string value has a syntax error and
- * is unparsable.
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this media list is readonly.
- */
- DOMString mediaText() const;
-
- /**
- * see @ref mediaText
- */
- void setMediaText(const DOMString &value);
-
- /**
- * The number of media in the list. The range of valid media is 0 to length-1 inclusive.
- */
- unsigned length() const;
-
-
- /**
- * Returns the indexth in the list. If index is greater than or equal to
- * the number of media in the list, this returns null.
- *
- * @param index Index into the collection.
- *
- * @return The medium at the indexth position in the MediaList, or null if
- * that is not a valid index.
- */
- DOMString item(unsigned index) const;
-
- /**
- * Deletes the medium indicated by oldMedium from the list.
- *
- * @param oldMedium The medium to delete in the media list.
- *
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this list is readonly.
- *
- * NOT_FOUND_ERR: Raised if oldMedium is not in the list.
- */
- void deleteMedium(const DOMString &oldMedium);
-
- /**
- * Adds the medium newMedium to the end of the list. If the newMedium is
- * already used, it is first removed.
- *
- * @param newMedium The new medium to add.
- *
- * @exception DOMException
- * INVALID_CHARACTER_ERR: If the medium contains characters that are
- * invalid in the underlying style language.
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this list is readonly.
- */
- void appendMedium(const DOMString &newMedium);
-
- /**
- * @internal
- */
- MediaListImpl *handle() const;
- bool isNull() const;
-
-protected:
- MediaListImpl *impl;
-};
-
-class LinkStyleImpl;
-
-class LinkStyle
-{
-public:
- LinkStyle();
- LinkStyle(const LinkStyle &other);
-
- LinkStyle & operator = (const LinkStyle &other);
- LinkStyle & operator = (const Node &other);
-
- ~LinkStyle();
-
- StyleSheet sheet();
-
- bool isNull() const;
-
-protected:
- NodeImpl *node;
- LinkStyleImpl *impl;
-};
-
-class DocumentStyleImpl;
-
-class DocumentStyle
-{
-public:
- DocumentStyle();
- DocumentStyle(const DocumentStyle &other);
-
- DocumentStyle & operator = (const DocumentStyle &other);
- DocumentStyle & operator = (const Document &other);
-
- ~DocumentStyle();
-
- StyleSheetList styleSheets();
-
- DOMString preferredStylesheetSet();
- DOMString selectedStylesheetSet();
- void setSelectedStylesheetSet(const DOMString& aString);
-
- bool isNull() const;
-
-protected:
- DocumentImpl *doc;
- DocumentStyleImpl *impl;
-};
-
-#endif
-
}; // namespace
#endif
1.11 +0 -643 WebCore/khtml/dom/css_value.h
Index: css_value.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/css_value.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- css_value.h 16 Sep 2005 22:42:03 -0000 1.10
+++ css_value.h 4 Dec 2005 11:35:05 -0000 1.11
@@ -37,203 +37,6 @@
class CSSRule;
class CSSValue;
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-/**
- * The <code> CSSStyleDeclaration </code> interface represents a
- * single <a href="http://www.w3.org/TR/REC-CSS2/syndata.html#block">
- * CSS declaration block </a> . This interface may be used to
- * determine the style properties currently set in a block or to set
- * style properties explicitly within the block.
- *
- * While an implementation may not recognize all CSS properties
- * within a CSS declaration block, it is expected to provide access to
- * all specified properties through the <code> CSSStyleDeclaration
- * </code> interface. Furthermore, implementations that support a
- * specific level of CSS should correctly handle <a
- * href="http://www.w3.org/TR/REC-CSS2/about.html#shorthand"> CSS
- * shorthand </a> properties for that level. For a further discussion
- * of shorthand properties, see the <code> CSS2Properties </code>
- * interface.
- *
- */
-class CSSStyleDeclaration
-{
-public:
- CSSStyleDeclaration();
- CSSStyleDeclaration(const CSSStyleDeclaration &other);
- CSSStyleDeclaration(CSSStyleDeclarationImpl *impl);
-public:
-
- CSSStyleDeclaration & operator = (const CSSStyleDeclaration &other);
-
- ~CSSStyleDeclaration();
-
- /**
- * The parsable textual representation of the declaration block
- * (including the surrounding curly braces). Setting this
- * attribute will result in the parsing of the new value and
- * resetting of the properties in the declaration block.
- *
- */
- DOMString cssText() const;
-
- /**
- * see @ref cssText
- * @exception CSSException
- * SYNTAX_ERR: Raised if the specified CSS string value has a
- * syntax error and is unparsable.
- *
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is
- * readonly.
- *
- */
- void setCssText( const DOMString & );
-
- /**
- * The number of properties that have been explicitly set in this
- * declaration block.
- *
- */
- unsigned length() const;
-
- /**
- * The CSS rule that contains this declaration block.
- *
- */
- CSSRule parentRule() const;
-
- /**
- * Used to retrieve the value of a CSS property if it has been
- * explicitly set within this declaration block.
- *
- * @param propertyName The name of the CSS property. See the <a
- * href="http://www.w3.org/TR/REC-CSS2/propidx.html"> CSS property
- * index </a> .
- *
- * @return Returns the value of the property if it has been
- * explicitly set for this declaration block. Returns the empty
- * string if the property has not been set.
- *
- */
- DOMString getPropertyValue ( const DOMString &propertyName );
-
- /**
- * Used to retrieve the object representation of the value of a
- * CSS property if it has been explicitly set within this
- * declaration block. This method returns null if the property is
- * a <a href="http://www.w3.org/TR/REC-CSS2/about.html#shorthand">
- * shorthand </a> property. Shorthand property values can only be
- * accessed and modified as strings, using the <code>
- * getPropertyValue </code> and <code> setProperty </code>
- * methods.
- *
- * @param propertyName The name of the CSS property. See the <a
- * href="http://www.w3.org/TR/REC-CSS2/propidx.html"> CSS property
- * index </a> .
- *
- * @return Returns the value of the property if it has been
- * explicitly set for this declaration block. Returns the <code>
- * null </code> if the property has not been set.
- *
- */
- CSSValue getPropertyCSSValue ( const DOMString &propertyName );
-
- /**
- * Used to remove a CSS property if it has been explicitly set
- * within this declaration block.
- *
- * @param propertyName The name of the CSS property. See the <a
- * href="http://www.w3.org/TR/REC-CSS2/propidx.html"> CSS property
- * index </a> .
- *
- * @return Returns the value of the property if it has been
- * explicitly set for this declaration block. Returns the empty
- * string if the property has not been set or the property name
- * does not correspond to a valid CSS2 property.
- *
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is
- * readonly.
- *
- */
- DOMString removeProperty ( const DOMString &propertyName );
-
- /**
- * Used to retrieve the priority of a CSS property (e.g. the
- * <code> "important" </code> qualifier) if the property has been
- * explicitly set in this declaration block.
- *
- * @param propertyName The name of the CSS property. See the <a
- * href="http://www.w3.org/TR/REC-CSS2/propidx.html"> CSS property
- * index </a> .
- *
- * @return A string representing the priority (e.g. <code>
- * "important" </code> ) if one exists. The empty string if none
- * exists.
- *
- */
- DOMString getPropertyPriority ( const DOMString &propertyName );
-
- /**
- * Used to set a property value and priority within this
- * declaration block.
- *
- * @param propertyName The name of the CSS property. See the <a
- * href="http://www.w3.org/TR/REC-CSS2/propidx.html"> CSS property
- * index </a> .
- *
- * @param value The new value of the property.
- *
- * @param priority The new priority of the property (e.g. <code>
- * "important" </code> ).
- *
- * @return
- *
- * @exception CSSException
- * SYNTAX_ERR: Raised if the specified value has a syntax error
- * and is unparsable.
- *
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is
- * readonly.
- *
- */
- void setProperty ( const DOMString &propertyName, const DOMString &value, const DOMString &priority );
-
- /**
- * Used to retrieve the properties that have been explicitly set
- * in this declaration block. The order of the properties
- * retrieved using this method does not have to be the order in
- * which they were set. This method can be used to iterate over
- * all properties in this declaration block.
- *
- * @param index Index of the property name to retrieve.
- *
- * @return The name of the property at this ordinal position. The
- * empty string if no property exists at this position.
- *
- */
- DOMString item ( unsigned index );
-
- /**
- * @internal
- * not part of the DOM
- */
- CSSStyleDeclarationImpl *handle() const;
- bool isNull() const;
-
-protected:
- CSSStyleDeclarationImpl *impl;
-};
-
-
-class CSSValueImpl;
-
-#endif
-
-
/**
* The <code> CSSValue </code> interface represents a simple or a
* complexe value.
@@ -244,19 +47,6 @@
public:
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- CSSValue();
- CSSValue(const CSSValue &other);
- CSSValue(CSSValueImpl *impl);
-public:
-
- CSSValue & operator = (const CSSValue &other);
-
- ~CSSValue();
-
-#endif
-
/**
* An integer indicating which type of unit applies to the value.
*
@@ -271,109 +61,8 @@
CSS_CUSTOM = 3,
CSS_INITIAL = 4
};
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- /**
- * A string representation of the current value.
- *
- */
- DOMString cssText() const;
-
- /**
- * see @ref cssText
- * @exception CSSException
- * SYNTAX_ERR: Raised if the specified CSS string value has a
- * syntax error and is unparsable.
- *
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this declaration is
- * readonly.
- *
- */
- void setCssText( const DOMString & );
-
- /**
- * A code defining the type of the value as defined above.
- *
- */
- unsigned short cssValueType() const;
-
- /**
- * @internal
- * not part of the DOM
- */
- bool isCSSValueList() const;
- bool isCSSPrimitiveValue() const;
- CSSValueImpl *handle() const;
- bool isNull() const;
-
-protected:
- CSSValueImpl *impl;
-
-#endif
-
};
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-class CSSValueListImpl;
-class CSSValue;
-
-/**
- * The <code> CSSValueList </code> interface provides the absraction
- * of an ordered collection of CSS values.
- *
- */
-class CSSValueList : public CSSValue
-{
-public:
- CSSValueList();
- CSSValueList(const CSSValueList &other);
- CSSValueList(const CSSValue &other);
- CSSValueList(CSSValueListImpl *impl);
-public:
-
- CSSValueList & operator = (const CSSValueList &other);
- CSSValueList & operator = (const CSSValue &other);
-
- ~CSSValueList();
-
- /**
- * The number of <code> CSSValue </code> s in the list. The range
- * of valid values indices is <code> 0 </code> to <code> length-1
- * </code> inclusive.
- *
- */
- unsigned length() const;
-
- /**
- * Used to retrieve a CSS rule by ordinal index. The order in this
- * collection represents the order of the values in the CSS style
- * property.
- *
- * @param index Index into the collection.
- *
- * @return The style rule at the <code> index </code> position in
- * the <code> CSSValueList </code> , or <code> null </code> if
- * that is not valid index.
- *
- */
- CSSValue item ( unsigned index );
-
-protected:
- CSSValueListImpl *vimpl;
-};
-
-
-class CSSPrimitiveValueImpl;
-class Counter;
-class RGBColor;
-class Rect;
-
-#endif
-
/**
* The <code> CSSPrimitiveValue </code> interface represents a single
* <a href="http://www.w3.org/TR/REC-CSS2/syndata.html#values"> CSS
@@ -390,21 +79,6 @@
public:
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- CSSPrimitiveValue();
- CSSPrimitiveValue(const CSSPrimitiveValue &other);
- CSSPrimitiveValue(const CSSValue &other);
- CSSPrimitiveValue(CSSPrimitiveValueImpl *impl);
-public:
-
- CSSPrimitiveValue & operator = (const CSSPrimitiveValue &other);
- CSSPrimitiveValue & operator = (const CSSValue &other);
-
- ~CSSPrimitiveValue();
-
-#endif
-
/**
* An integer indicating which type of unit applies to the value.
*
@@ -440,324 +114,7 @@
CSS_DASHBOARD_REGION = 27, // FIXME: What on earth is this doing as a primitive value? This is insane.
CSS_HTML_RELATIVE = 255
};
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- /**
- * The type of the value as defined by the constants specified
- * above.
- *
- */
- unsigned short primitiveType() const;
-
- /**
- * A method to set the float value with a specified unit. If the
- * property attached with this value can not accept the specified
- * unit or the float value, the value will be unchanged and a
- * <code> DOMException </code> will be raised.
- *
- * @param unitType A unit code as defined above. The unit code can
- * only be a float unit type (e.g. <code> NUMBER </code> , <code>
- * PERCENTAGE </code> , <code> CSS_EMS </code> , <code> CSS_EXS
- * </code> , <code> CSS_PX </code> , <code> CSS_PX </code> ,
- * <code> CSS_CM </code> , <code> CSS_MM </code> , <code> CSS_IN
- * </code> , <code> CSS_PT </code> , <code> CSS_PC </code> ,
- * <code> CSS_DEG </code> , <code> CSS_RAD </code> , <code>
- * CSS_GRAD </code> , <code> CSS_MS </code> , <code> CSS_S </code>
- * , <code> CSS_HZ </code> , <code> CSS_KHZ </code> , <code>
- * CSS_DIMENSION </code> ).
- *
- * @param floatValue The new float value.
- *
- * @return
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raises if the attached property doesn't
- * support the float value or the unit type.
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- *
- */
- void setFloatValue ( unsigned short unitType, float floatValue );
-
- /**
- * This method is used to get a float value in a specified unit.
- * If this CSS value doesn't contain a float value or can't be
- * converted into the specified unit, a <code> DOMException
- * </code> is raised.
- *
- * @param unitType A unit code to get the float value. The unit
- * code can only be a float unit type (e.g. <code> CSS_NUMBER
- * </code> , <code> CSS_PERCENTAGE </code> , <code> CSS_EMS
- * </code> , <code> CSS_EXS </code> , <code> CSS_PX </code> ,
- * <code> CSS_PX </code> , <code> CSS_CM </code> , <code> CSS_MM
- * </code> , <code> CSS_IN </code> , <code> CSS_PT </code> ,
- * <code> CSS_PC </code> , <code> CSS_DEG </code> , <code> CSS_RAD
- * </code> , <code> CSS_GRAD </code> , <code> CSS_MS </code> ,
- * <code> CSS_S </code> , <code> CSS_HZ </code> , <code> CSS_KHZ
- * </code> , <code> CSS_DIMENSION </code> ).
- *
- * @return The float value in the specified unit.
- *
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raises if the CSS value doesn't contain a
- * float value or if the float value can't be converted into the
- * specified unit.
- *
- */
- float getFloatValue ( unsigned short unitType );
-
- /**
- * A method to set the string value with a specified unit. If the
- * property attached to this value can't accept the specified unit
- * or the string value, the value will be unchanged and a <code>
- * DOMException </code> will be raised.
- *
- * @param stringType A string code as defined above. The string
- * code can only be a string unit type (e.g. <code> CSS_URI
- * </code> , <code> CSS_IDENT </code> , <code> CSS_INHERIT </code>
- * and <code> CSS_ATTR </code> ).
- *
- * @param stringValue The new string value. If the <code>
- * stringType </code> is equal to <code> CSS_INHERIT </code> , the
- * <code> stringValue </code> should be <code> inherit </code> .
- *
- * @return
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raises if the CSS value doesn't contain a
- * string value or if the string value can't be converted into the
- * specified unit.
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this property is
- * readonly.
- *
- */
- void setStringValue ( unsigned short stringType, const DOMString &stringValue );
-
- /**
- * This method is used to get the string value in a specified
- * unit. If the CSS value doesn't contain a string value, a <code>
- * DOMException </code> is raised.
- *
- * @return The string value in the current unit. The current
- * <code> valueType </code> can only be a string unit type (e.g.
- * <code> CSS_URI </code> , <code> CSS_IDENT </code> and <code>
- * CSS_ATTR </code> ).
- *
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raises if the CSS value doesn't contain a
- * string value.
- *
- */
- DOMString getStringValue ( );
-
- /**
- * This method is used to get the Counter value. If this CSS value
- * doesn't contain a counter value, a <code> DOMException </code>
- * is raised. Modification to the corresponding style property can
- * be achieved using the <code> Counter </code> interface.
- *
- * @return The Counter value.
- *
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raises if the CSS value doesn't contain a
- * Counter value.
- *
- */
- Counter getCounterValue ( );
-
- /**
- * This method is used to get the Rect value. If this CSS value
- * doesn't contain a rect value, a <code> DOMException </code> is
- * raised. Modification to the corresponding style property can be
- * achieved using the <code> Rect </code> interface.
- *
- * @return The Rect value.
- *
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raises if the CSS value doesn't contain a
- * Rect value.
- *
- */
- Rect getRectValue ( );
-
- /**
- * This method is used to get the RGB color. If this CSS value
- * doesn't contain a RGB color value, a <code> DOMException
- * </code> is raised. Modification to the corresponding style
- * property can be achieved using the <code> RGBColor </code>
- * interface.
- *
- * @return the RGB color value.
- *
- * @exception DOMException
- * INVALID_ACCESS_ERR: Raises if the attached property can't
- * return a RGB color value.
- *
- */
- RGBColor getRGBColorValue ( );
-
-#endif
-
};
-
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-/**
- * The <code> RGBColor </code> interface is used to represent any <a
- * href="http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-color">
- * RGB color </a> value. This interface reflects the values in the
- * underlying style property. Hence, modifications made through this
- * interface modify the style property.
- *
- */
-class RGBColor
-{
-public:
- RGBColor();
- RGBColor(const RGBColor &other);
- RGBColor(const QColor &color);
-
- RGBColor & operator = (const RGBColor &other);
-
- ~RGBColor();
-
- /**
- * This attribute is used for the red value of the RGB color.
- *
- */
- CSSPrimitiveValue red() const;
-
- /**
- * This attribute is used for the green value of the RGB color.
- *
- */
- CSSPrimitiveValue green() const;
-
- /**
- * This attribute is used for the blue value of the RGB color.
- *
- */
- CSSPrimitiveValue blue() const;
-
- const QColor &color() const { return m_color; }
-
-protected:
- QColor m_color;
-};
-
-class RectImpl;
-
-/**
- * The <code> Rect </code> interface is used to represent any <a
- * href="http://www.w3.org/TR/REC-CSS2/visufx.html#value-def-shape">
- * rect </a> value. This interface reflects the values in the
- * underlying style property. Hence, modifications made through this
- * interface modify the style property.
- *
- */
-class Rect
-{
- friend class CSSPrimitiveValue;
-public:
- Rect();
- Rect(const Rect &other);
-
- Rect & operator = (const Rect &other);
-
- ~Rect();
-
- /**
- * This attribute is used for the top of the rect.
- *
- */
- CSSPrimitiveValue top() const;
-
- /**
- * This attribute is used for the right of the rect.
- *
- */
- CSSPrimitiveValue right() const;
-
- /**
- * This attribute is used for the bottom of the rect.
- *
- */
- CSSPrimitiveValue bottom() const;
-
- /**
- * This attribute is used for the left of the rect.
- *
- */
- CSSPrimitiveValue left() const;
-
- /**
- * @internal
- * not part of the DOM
- */
- RectImpl *handle() const;
- bool isNull() const;
-
-protected:
- RectImpl *impl;
- Rect(RectImpl *i);
-};
-
-class CounterImpl;
-
-/**
- * The <code> Counter </code> interface is used to represent any <a
- * href="http://www.w3.org/TR/REC-CSS2/syndata.html#value-def-counter">
- * counter or counters function </a> value. This interface reflects
- * the values in the underlying style property. Hence, modifications
- * made through this interface modify the style property.
- *
- */
-class Counter
-{
- friend class CSSPrimitiveValue;
-public:
- Counter();
- Counter(const Counter &other);
-public:
-
- Counter & operator = (const Counter &other);
-
- ~Counter();
-
- /**
- * This attribute is used for the identifier of the counter.
- *
- */
- DOMString identifier() const;
-
- /**
- * This attribute is used for the style of the list.
- *
- */
- DOMString listStyle() const;
-
- /**
- * This attribute is used for the separator of nested counters.
- *
- */
- DOMString separator() const;
-
- /**
- * @internal
- * not part of the DOM
- */
- CounterImpl *handle() const;
- bool isNull() const;
-
-protected:
- CounterImpl *impl;
- Counter(CounterImpl *i);
-};
-
-#endif
-
} // namespace
#endif
1.27 +0 -715 WebCore/khtml/dom/dom2_events.cpp
Index: dom2_events.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/dom2_events.cpp,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -r1.26 -r1.27
--- dom2_events.cpp 3 Oct 2005 21:12:11 -0000 1.26
+++ dom2_events.cpp 4 Dec 2005 11:35:05 -0000 1.27
@@ -26,13 +26,6 @@
#include "xml/dom2_eventsimpl.h"
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-#include "dom/dom2_views.h"
-#include "dom/dom_exception.h"
-
-#endif
-
namespace DOM {
const unsigned KeyboardEvent::DOM_KEY_LOCATION_STANDARD;
@@ -53,12 +46,7 @@
void EventListener::handleEventImpl(EventImpl *evt, bool isWindowEvent)
{
-#if KHTML_NO_CPLUSPLUS_DOM
handleEvent(evt, isWindowEvent);
-#else
- Event wrapper(evt);
- handleEvent(wrapper, isWindowEvent);
-#endif
}
void EventListener::handleEvent(EventListenerEvent, bool)
@@ -71,707 +59,4 @@
}
// -----------------------------------------------------------------------------
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-Event::Event()
-{
- impl = 0;
-}
-
-
-Event::Event(const Event &other)
-{
- impl = other.impl;
- if (impl) impl->ref();
-}
-
-Event::Event(EventImpl *i)
-{
- impl = i;
- if (impl) impl->ref();
-}
-
-Event::~Event()
-{
- if (impl) impl->deref();
-}
-
-Event &Event::operator = (const Event &other)
-{
- if ( impl != other.impl ) {
- if(impl) impl->deref();
- impl = other.impl;
- if(impl) impl->ref();
- }
- return *this;
-}
-
-DOMString Event::type() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return impl->type();
-}
-
-Node Event::target() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return impl->target();
-}
-
-Node Event::currentTarget() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return impl->currentTarget();
-}
-
-unsigned short Event::eventPhase() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return impl->eventPhase();
-}
-
-bool Event::bubbles() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return impl->bubbles();
-}
-
-bool Event::cancelable() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return impl->cancelable();
-}
-
-DOMTimeStamp Event::timeStamp() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return impl->timeStamp();
-}
-
-void Event::stopPropagation()
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- impl->stopPropagation();
-}
-
-void Event::preventDefault()
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- impl->preventDefault();
-}
-
-void Event::initEvent(const DOMString &eventTypeArg, bool canBubbleArg, bool cancelableArg)
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- impl->initEvent(eventTypeArg,canBubbleArg,cancelableArg);
-}
-
-EventImpl *Event::handle() const
-{
- return impl;
-}
-
-bool Event::isNull() const
-{
- return (impl == 0);
-}
-
-void Event::setCancelBubble(bool cancel)
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- impl->setCancelBubble(cancel);
-}
-
-void Event::setDefaultPrevented(bool defaultPrevented)
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- impl->setDefaultPrevented(defaultPrevented);
-}
-
-bool Event::getCancelBubble() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return impl->getCancelBubble();
-}
-
-bool Event::defaultPrevented() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return impl->defaultPrevented();
-}
-
-// -----------------------------------------------------------------------------
-
-#ifndef SAVE_SPACE
-
-EventException::EventException(unsigned short _code)
-{
- code = _code;
-}
-
-EventException::EventException(const EventException &other)
-{
- code = other.code;
-}
-
-EventException & EventException::operator = (const EventException &other)
-{
- code = other.code;
- return *this;
-}
-
-#endif
-
-// -----------------------------------------------------------------------------
-
-UIEvent::UIEvent() : Event()
-{
-}
-
-UIEvent::UIEvent(const UIEvent &other) : Event(other)
-{
-}
-
-UIEvent::UIEvent(const Event &other) : Event()
-{
- (*this)=other;
-}
-
-UIEvent::UIEvent(UIEventImpl *impl) : Event(impl)
-{
-}
-
-UIEvent &UIEvent::operator = (const UIEvent &other)
-{
- Event::operator = (other);
- return *this;
-}
-
-UIEvent &UIEvent::operator = (const Event &other)
-{
- Event e;
- e = other;
- if (!e.isNull() && !e.handle()->isUIEvent()) {
- if ( impl ) impl->deref();
- impl = 0;
- } else
- Event::operator = (other);
- return *this;
-}
-
-UIEvent::~UIEvent()
-{
-}
-
-AbstractView UIEvent::view() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<UIEventImpl*>(impl)->view();
-}
-
-int UIEvent::detail() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<UIEventImpl*>(impl)->detail();
-}
-
-int UIEvent::keyCode() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- if (impl->isKeyboardEvent())
- return static_cast<KeyboardEventImpl*>(impl)->keyCode();
- else
- return 0;
-}
-
-int UIEvent::charCode() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- if (impl->isKeyboardEvent())
- return static_cast<KeyboardEventImpl*>(impl)->charCode();
- else
- return 0;
-}
-
-int UIEvent::pageX() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- if (impl->isMouseEvent())
- return static_cast<MouseEventImpl*>(impl)->clientX();
- else
- return 0;
-}
-
-int UIEvent::pageY() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- if (impl->isMouseEvent())
- return static_cast<MouseEventImpl*>(impl)->clientY();
- else
- return 0;
-}
-
-int UIEvent::layerX() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- if (impl->isMouseEvent())
- return static_cast<MouseEventImpl*>(impl)->layerX();
- else
- return 0;
-}
-
-int UIEvent::layerY() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- if (impl->isMouseEvent())
- return static_cast<MouseEventImpl*>(impl)->layerY();
- else
- return 0;
-}
-
-int UIEvent::which() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- // Note: This property supports both key events and mouse events
-
- // Netscape's "which" returns a virtual key code for keydown and keyup, and a character code for keypress.
- // That's exactly what IE's "keyCode" returns.
- if (impl->isKeyboardEvent())
- return static_cast<KeyboardEventImpl*>(impl)->keyCode();
-
- // For khtml, the return values for left, middle and right mouse buttons are 0, 1, 2, respectively.
- // For the Netscape "which" property, the return values for left, middle and right mouse buttons are 1, 2, 3, respectively.
- // So we can just add 1 to the value returned by calling button().
- if (impl->isMouseEvent())
- return static_cast<MouseEventImpl*>(impl)->button() + 1;
-
- return 0;
-}
-
-
-void UIEvent::initUIEvent(const DOMString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- const AbstractView &viewArg,
- int detailArg)
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- static_cast<UIEventImpl*>(impl)->initUIEvent(typeArg,canBubbleArg,cancelableArg,
- viewArg.handle(),detailArg);
-}
-
-// -----------------------------------------------------------------------------
-
-MouseEvent::MouseEvent() : UIEvent()
-{
-}
-
-MouseEvent::MouseEvent(const MouseEvent &other) : UIEvent(other)
-{
-}
-
-MouseEvent::MouseEvent(const Event &other) : UIEvent()
-{
- (*this)=other;
-}
-
-MouseEvent::MouseEvent(MouseEventImpl *impl) : UIEvent(impl)
-{
-}
-
-MouseEvent &MouseEvent::operator = (const MouseEvent &other)
-{
- UIEvent::operator = (other);
- return *this;
-}
-
-MouseEvent &MouseEvent::operator = (const Event &other)
-{
- Event e;
- e = other;
- if (!e.isNull() && !e.handle()->isMouseEvent()) {
- if ( impl ) impl->deref();
- impl = 0;
- } else
- UIEvent::operator = (other);
- return *this;
-}
-
-MouseEvent::~MouseEvent()
-{
-}
-
-int MouseEvent::screenX() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<MouseEventImpl*>(impl)->screenX();
-}
-
-int MouseEvent::screenY() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<MouseEventImpl*>(impl)->screenY();
-}
-
-int MouseEvent::clientX() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<MouseEventImpl*>(impl)->clientX();
-}
-
-int MouseEvent::clientY() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<MouseEventImpl*>(impl)->clientY();
-}
-
-bool MouseEvent::ctrlKey() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<MouseEventImpl*>(impl)->ctrlKey();
-}
-
-bool MouseEvent::shiftKey() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<MouseEventImpl*>(impl)->shiftKey();
-}
-
-bool MouseEvent::altKey() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<MouseEventImpl*>(impl)->altKey();
-}
-
-bool MouseEvent::metaKey() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<MouseEventImpl*>(impl)->metaKey();
-}
-
-unsigned short MouseEvent::button() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<MouseEventImpl*>(impl)->button();
-}
-
-Node MouseEvent::relatedTarget() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<MouseEventImpl*>(impl)->relatedTarget();
-}
-
-void MouseEvent::initMouseEvent(const DOMString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- const AbstractView &viewArg,
- int detailArg,
- int screenXArg,
- int screenYArg,
- int clientXArg,
- int clientYArg,
- bool ctrlKeyArg,
- bool altKeyArg,
- bool shiftKeyArg,
- bool metaKeyArg,
- unsigned short buttonArg,
- const Node &relatedTargetArg)
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- static_cast<MouseEventImpl*>(impl)->initMouseEvent(typeArg,canBubbleArg,
- cancelableArg,viewArg.handle(),detailArg,screenXArg,screenYArg,clientXArg,
- clientYArg,ctrlKeyArg,altKeyArg,shiftKeyArg,metaKeyArg,buttonArg,
- relatedTargetArg.handle());
-}
-
-
-
-// -----------------------------------------------------------------------------
-
-MutationEvent::MutationEvent() : Event()
-{
-}
-
-MutationEvent::MutationEvent(const MutationEvent &other) : Event(other)
-{
-}
-
-MutationEvent::MutationEvent(const Event &other) : Event()
-{
- (*this)=other;
-}
-
-MutationEvent::MutationEvent(MutationEventImpl *impl) : Event(impl)
-{
-}
-
-MutationEvent &MutationEvent::operator = (const MutationEvent &other)
-{
- Event::operator = (other);
- return *this;
-}
-
-MutationEvent &MutationEvent::operator = (const Event &other)
-{
- Event e;
- e = other;
- if (!e.isNull() && !e.handle()->isMutationEvent()) {
- if ( impl ) impl->deref();
- impl = 0;
- } else
- Event::operator = (other);
- return *this;
-}
-
-MutationEvent::~MutationEvent()
-{
-}
-
-Node MutationEvent::relatedNode() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<MutationEventImpl*>(impl)->relatedNode();
-}
-
-DOMString MutationEvent::prevValue() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<MutationEventImpl*>(impl)->prevValue();
-}
-
-DOMString MutationEvent::newValue() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<MutationEventImpl*>(impl)->newValue();
-}
-
-DOMString MutationEvent::attrName() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<MutationEventImpl*>(impl)->attrName();
-}
-
-unsigned short MutationEvent::attrChange() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<MutationEventImpl*>(impl)->attrChange();
-}
-
-void MutationEvent::initMutationEvent(const DOMString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- const Node &relatedNodeArg,
- const DOMString &prevValueArg,
- const DOMString &newValueArg,
- const DOMString &attrNameArg,
- unsigned short attrChangeArg)
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- static_cast<MutationEventImpl*>(impl)->initMutationEvent(typeArg,
- canBubbleArg,cancelableArg,relatedNodeArg.handle(),prevValueArg,
- newValueArg,attrNameArg,attrChangeArg);
-}
-
-// -----------------------------------------------------------------------------
-
-KeyboardEvent::KeyboardEvent()
-{
-}
-
-KeyboardEvent::KeyboardEvent(const KeyboardEvent &other) : UIEvent(other)
-{
-}
-
-KeyboardEvent::KeyboardEvent(const Event &other)
-{
- *this = other;
-}
-
-KeyboardEvent::KeyboardEvent(KeyboardEventImpl *impl) : UIEvent(impl)
-{
-}
-
-KeyboardEvent &KeyboardEvent::operator = (const KeyboardEvent &other)
-{
- UIEvent::operator = (other);
- return *this;
-}
-
-KeyboardEvent &KeyboardEvent::operator = (const Event &other)
-{
- Event e;
- e = other;
- if (!e.isNull() && !e.handle()->isKeyboardEvent()) {
- if ( impl ) impl->deref();
- impl = 0;
- } else
- UIEvent::operator = (other);
- return *this;
-}
-
-KeyboardEvent::~KeyboardEvent()
-{
-}
-
-DOMString KeyboardEvent::keyIdentifier() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<KeyboardEventImpl*>(impl)->keyIdentifier();
-}
-
-unsigned KeyboardEvent::keyLocation() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<KeyboardEventImpl*>(impl)->keyLocation();
-}
-
-bool KeyboardEvent::ctrlKey() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<KeyboardEventImpl*>(impl)->ctrlKey();
-}
-
-bool KeyboardEvent::shiftKey() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<KeyboardEventImpl*>(impl)->shiftKey();
-}
-
-bool KeyboardEvent::altKey() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<KeyboardEventImpl*>(impl)->altKey();
-}
-
-bool KeyboardEvent::metaKey() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<KeyboardEventImpl*>(impl)->metaKey();
-}
-
-bool KeyboardEvent::altGraphKey() const
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- return static_cast<KeyboardEventImpl*>(impl)->altGraphKey();
-}
-
-void KeyboardEvent::initKeyboardEvent(const DOMString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- const AbstractView &viewArg,
- const DOMString &keyIdentifierArg,
- unsigned keyLocationArg,
- bool ctrlKeyArg,
- bool shiftKeyArg,
- bool altKeyArg,
- bool metaKeyArg,
- bool altGraphKeyArg)
-{
- if (!impl)
- throw DOMException(DOMException::INVALID_STATE_ERR);
-
- static_cast<KeyboardEventImpl*>(impl)->initKeyboardEvent(typeArg,canBubbleArg,
- cancelableArg,viewArg.handle(),keyIdentifierArg,keyLocationArg,ctrlKeyArg,altKeyArg,
- shiftKeyArg,metaKeyArg,altGraphKeyArg);
-}
-
-#endif
-
} // namespace
1.21 +0 -632 WebCore/khtml/dom/dom2_events.h
Index: dom2_events.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/dom2_events.h,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -r1.20 -r1.21
--- dom2_events.h 16 Sep 2005 22:42:03 -0000 1.20
+++ dom2_events.h 4 Dec 2005 11:35:05 -0000 1.21
@@ -27,39 +27,12 @@
#include <dom/dom_misc.h>
#include <dom/dom_string.h>
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-#include <dom/dom_node.h>
-
-#endif
-
namespace DOM {
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-class Event;
-class EventException;
-class UIEvent;
-class MouseEvent;
-class MutationEvent;
-class KeyboardEvent;
-class AbstractView;
-
-class UIEventImpl;
-class MouseEventImpl;
-class MutationEventImpl;
-class KeyboardEventImpl;
-
-#endif
-
class EventListenerImpl;
class EventImpl;
-#if KHTML_NO_CPLUSPLUS_DOM
typedef EventImpl *EventListenerEvent;
-#else
-typedef Event &EventListenerEvent;
-#endif
/**
* Introduced in DOM Level 2
@@ -129,26 +102,8 @@
*/
class Event {
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- friend class Document;
- friend class NodeImpl;
- friend class DocumentImpl;
-
-#endif
-
public:
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- Event();
- Event(const Event &other);
- virtual ~Event();
-
- Event & operator = (const Event &other);
-
-#endif
-
/**
* An integer indicating which phase of event flow is being processed.
*
@@ -165,132 +120,6 @@
AT_TARGET = 2,
BUBBLING_PHASE = 3
};
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- /**
- * The name of the event (case-insensitive). The name must be an XML name.
- *
- */
- DOMString type() const;
-
- /**
- * Used to indicate the EventTarget to which the event was originally
- * dispatched.
- *
- */
- Node target() const;
-
- /**
- * Used to indicate the EventTarget whose EventListeners are currently
- * being processed. This is particularly useful during capturing and
- * bubbling.
- *
- */
- Node currentTarget() const;
-
- /**
- * Used to indicate which phase of event flow is currently being evaluated.
- *
- */
- unsigned short eventPhase() const;
-
- /**
- * Used to indicate whether or not an event is a bubbling event. If the
- * event can bubble the value is true, else the value is false.
- *
- */
- bool bubbles() const;
-
- /**
- * Used to indicate whether or not an event can have its default action
- * prevented. If the default action can be prevented the value is true,
- * else the value is false.
- *
- */
- bool cancelable() const;
-
- /**
- * Used to specify the time (in milliseconds relative to the epoch) at
- * which the event was created. Due to the fact that some systems may not
- * provide this information the value of timeStamp may be not available for
- * all events. When not available, a value of 0 will be returned. Examples
- * of epoch time are the time of the system start or 0:0:0 UTC 1st January 1970.
- *
- */
- DOMTimeStamp timeStamp() const;
-
- /**
- * The stopPropagation method is used prevent further propagation of an
- * event during event flow. If this method is called by any EventListener
- * the event will cease propagating through the tree. The event will
- * complete dispatch to all listeners on the current EventTarget before
- * event flow stops. This method may be used during any stage of event flow.
- *
- */
- void stopPropagation();
-
- /**
- * If an event is cancelable, the preventDefault method is used to signify
- * that the event is to be canceled, meaning any default action normally
- * taken by the implementation as a result of the event will not occur. If,
- * during any stage of event flow, the preventDefault method is called the
- * event is canceled. Any default action associated with the event will not
- * occur. Calling this method for a non-cancelable event has no effect.
- * Once preventDefault has been called it will remain in effect throughout
- * the remainder of the event's propagation. This method may be used during
- * any stage of event flow.
- *
- */
- void preventDefault();
-
- /**
- * The initEvent method is used to initialize the value of an Event created
- * through the DocumentEvent interface. This method may only be called
- * before the Event has been dispatched via the dispatchEvent method,
- * though it may be called multiple times during that phase if necessary.
- * If called multiple times the final invocation takes precedence. If
- * called from a subclass of Event interface only the values specified in
- * the initEvent method are modified, all other attributes are left
- * unchanged.
- *
- * @param eventTypeArg Specifies the event type. This type may be any event
- * type currently defined in this specification or a new event type.. The
- * string must be an XML name.
- *
- * Any new event type must not begin with any upper, lower, or mixed case
- * version of the string "DOM". This prefix is reserved for future DOM
- * event sets. It is also strongly recommended that third parties adding
- * their own events use their own prefix to avoid confusion and lessen the
- * probability of conflicts with other new events.
- *
- * @param canBubbleArg Specifies whether or not the event can bubble.
- *
- * @param cancelableArg Specifies whether or not the event's default action can be prevented.
- *
- */
- void initEvent(const DOMString &eventTypeArg, bool canBubbleArg, bool cancelableArg);
-
- /**
- * @internal
- * not part of the DOM
- */
- EventImpl *handle() const;
- bool isNull() const;
-
- /* Nonstandard extensions needed to support widely used JS event properties */
- void setCancelBubble(bool cancel);
- void setDefaultPrevented(bool returnValue);
- bool getCancelBubble() const;
- bool defaultPrevented() const;
-
- Event(EventImpl *i);
-
-protected:
- EventImpl *impl;
-
-#endif
-
};
@@ -305,15 +134,6 @@
{
public:
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- EventException(unsigned short _code);
- EventException(const EventException &other);
- EventException & operator = (const EventException &other);
- virtual ~EventException() {}
-
-#endif
-
/**
* An integer indicating the type of error generated.
*
@@ -328,280 +148,8 @@
_EXCEPTION_OFFSET = 3000,
_EXCEPTION_MAX = 3999
};
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- unsigned short code;
-
-#endif
-
-};
-
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-
-/**
- * Introduced in DOM Level 2
- *
- * The UIEvent interface provides specific contextual information associated
- * with User Interface events.
- *
- */
-class UIEvent : public Event {
-public:
- UIEvent();
- UIEvent(const UIEvent &other);
- UIEvent(const Event &other);
- UIEvent & operator = (const UIEvent &other);
- UIEvent & operator = (const Event &other);
- virtual ~UIEvent();
-
- /**
- * The view attribute identifies the AbstractView from which the event was
- * generated.
- *
- */
- AbstractView view() const;
-
- /**
- * Specifies some detail information about the Event, depending on the type
- * of event.
- *
- */
- int detail() const;
-
- /**
- * Non-standard extension to support IE-style keyCode event property.
- *
- */
- int keyCode() const;
-
- /**
- * Non-standard extension to support IE-style charCode event property.
- *
- */
- int charCode() const;
-
- /**
- * Non-standard extensions to support Netscape-style pageX and pageY event properties.
- *
- */
- int pageX() const;
- int pageY() const;
-
- /**
- * Non-standard extensions to support Netscape-style layerX and layerY event properties.
- *
- */
- int layerX() const;
- int layerY() const;
-
- /**
- * Non-standard extension to support Netscape-style "which" event property.
- *
- */
- int which() const;
-
- /**
- * The initUIEvent method is used to initialize the value of a UIEvent
- * created through the DocumentEvent interface. This method may only be
- * called before the UIEvent has been dispatched via the dispatchEvent
- * method, though it may be called multiple times during that phase if
- * necessary. If called multiple times, the final invocation takes
- * precedence.
- *
- * @param typeArg Specifies the event type.
- *
- * @param canBubbleArg Specifies whether or not the event can bubble.
- *
- * @param cancelableArg Specifies whether or not the event's default action
- * can be prevented.
- *
- * @param viewArg Specifies the Event's AbstractView.
- *
- * @param detailArg Specifies the Event's detail.
- *
- */
- void initUIEvent(const DOMString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- const AbstractView &viewArg,
- int detailArg);
-
- UIEvent(UIEventImpl *impl);
};
-
-
-
-/**
- * Introduced in DOM Level 2
- *
- * The MouseEvent interface provides specific contextual information associated
- * with Mouse events.
- *
- * The detail attribute inherited from UIEvent indicates the number of times a
- * mouse button has been pressed and released over the same screen location
- * during a user action. The attribute value is 1 when the user begins this
- * action and increments by 1 for each full sequence of pressing and releasing.
- * If the user moves the mouse between the mousedown and mouseup the value will
- * be set to 0, indicating that no click is occurring.
- *
- * In the case of nested elements mouse events are always targeted at the most
- * deeply nested element. Ancestors of the targeted element may use bubbling to
- * obtain notification of mouse events which occur within its descendent elements.
- *
- */
-class MouseEvent : public UIEvent {
-public:
- MouseEvent();
- MouseEvent(const MouseEvent &other);
- MouseEvent(const Event &other);
- MouseEvent & operator = (const MouseEvent &other);
- MouseEvent & operator = (const Event &other);
- virtual ~MouseEvent();
-
- /**
- * The horizontal coordinate at which the event occurred relative to the
- * origin of the screen coordinate system.
- *
- */
- int screenX() const;
-
- /**
- * The vertical coordinate at which the event occurred relative to the
- * origin of the screen coordinate system.
- *
- */
- int screenY() const;
-
- /**
- * The horizontal coordinate at which the event occurred relative to the
- * DOM implementation's client area.
- *
- */
- int clientX() const;
-
- /**
- * The vertical coordinate at which the event occurred relative to the DOM
- * implementation's client area.
- *
- */
- int clientY() const;
-
- /**
- * Used to indicate whether the 'ctrl' key was depressed during the firing
- * of the event.
- */
- bool ctrlKey() const;
-
- /**
- * Used to indicate whether the 'shift' key was depressed during the firing
- * of the event.
- *
- */
- bool shiftKey() const;
-
- /**
- * Used to indicate whether the 'alt' key was depressed during the firing
- * of the event. On some platforms this key may map to an alternative key
- * name.
- *
- */
- bool altKey() const;
-
- /**
- * Used to indicate whether the 'meta' key was depressed during the firing
- * of the event. On some platforms this key may map to an alternative key
- * name.
- *
- */
- bool metaKey() const;
-
- /**
- * During mouse events caused by the depression or release of a mouse
- * button, button is used to indicate which mouse button changed state. The
- * values for button range from zero to indicate the left button of the
- * mouse, one to indicate the middle button if present, and two to indicate
- * the right button. For mice configured for left handed use in which the
- * button actions are reversed the values are instead read from right to
- * left.
- *
- */
- unsigned short button() const;
-
- /**
- * Used to identify a secondary EventTarget related to a UI event.
- * Currently this attribute is used with the mouseover event to indicate
- * the EventTarget which the pointing device exited and with the mouseout
- * event to indicate the EventTarget which the pointing device entered.
- *
- */
- Node relatedTarget() const;
-
- /**
- * The initMouseEvent method is used to initialize the value of a
- * MouseEvent created through the DocumentEvent interface. This method may
- * only be called before the MouseEvent has been dispatched via the
- * dispatchEvent method, though it may be called multiple times during that
- * phase if necessary. If called multiple times, the final invocation takes
- * precedence. Parameters
- *
- * @param typeArg Specifies the event type.
- *
- * @param canBubbleArg Specifies whether or not the event can bubble.
- *
- * @param cancelableArg Specifies whether or not the event's default action can be prevented.
- *
- * @param viewArg Specifies the Event's AbstractView.
- *
- * @param detailArg Specifies the Event's mouse click count.
- *
- * @param screenXArg Specifies the Event's screen x coordinate
- *
- * @param screenYArg Specifies the Event's screen y coordinate
- *
- * @param clientXArg Specifies the Event's client x coordinate
- *
- * @param clientYArg Specifies the Event's client y coordinate
- *
- * @param ctrlKeyArg Specifies whether or not control key was depressed during the Event.
- *
- * @param altKeyArg Specifies whether or not alt key was depressed during the Event.
- *
- * @param shiftKeyArg Specifies whether or not shift key was depressed during the Event.
- *
- * @param metaKeyArg Specifies whether or not meta key was depressed during the Event.
- *
- * @param buttonArg Specifies the Event's mouse button.
- *
- * @param relatedTargetArg Specifies the Event's related EventTarget.
- *
- */
- void initMouseEvent(const DOMString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- const AbstractView &viewArg,
- int detailArg,
- int screenXArg,
- int screenYArg,
- int clientXArg,
- int clientYArg,
- bool ctrlKeyArg,
- bool altKeyArg,
- bool shiftKeyArg,
- bool metaKeyArg,
- unsigned short buttonArg,
- const Node &relatedTargetArg);
-protected:
- MouseEvent(MouseEventImpl *impl);
-};
-
-
-#endif
-
-
/**
* Introduced in DOM Level 2
*
@@ -612,17 +160,6 @@
class MutationEvent : public Event {
public:
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- MutationEvent();
- MutationEvent(const MutationEvent &other);
- MutationEvent(const Event &other);
- MutationEvent & operator = (const MutationEvent &other);
- MutationEvent & operator = (const Event &other);
- virtual ~MutationEvent();
-
-#endif
-
/**
* An integer indicating in which way the Attr was changed.
*
@@ -638,89 +175,6 @@
ADDITION = 2,
REMOVAL = 3
};
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- /**
- * relatedNode is used to identify a secondary node related to a mutation
- * event. For example, if a mutation event is dispatched to a node
- * indicating that its parent has changed, the relatedNode is the changed
- * parent. If an event is instead dispatched to a subtree indicating a node
- * was changed within it, the relatedNode is the changed node. In the case
- * of the DOMAttrModified event it indicates the Attr node which was
- * modified, added, or removed.
- *
- */
- Node relatedNode() const;
-
- /**
- * prevValue indicates the previous value of the Attr node in
- * DOMAttrModified events, and of the CharacterData node in
- * DOMCharDataModified events.
- *
- */
- DOMString prevValue() const;
-
- /**
- * newValue indicates the new value of the Attr node in DOMAttrModified
- * events, and of the CharacterData node in DOMCharDataModified events.
- *
- */
- DOMString newValue() const;
-
- /**
- * attrName indicates the name of the changed Attr node in a
- * DOMAttrModified event.
- *
- */
- DOMString attrName() const;
-
- /**
- * attrChange indicates the type of change which triggered the
- * DOMAttrModified event. The values can be MODIFICATION, ADDITION, or
- * REMOVAL.
- *
- */
- unsigned short attrChange() const;
-
- /**
- * The initMutationEvent method is used to initialize the value of a
- * MutationEvent created through the DocumentEvent interface. This method
- * may only be called before the MutationEvent has been dispatched via the
- * dispatchEvent method, though it may be called multiple times during that
- * phase if necessary. If called multiple times, the final invocation takes
- * precedence.
- *
- * @param typeArg Specifies the event type.
- *
- * @param canBubbleArg Specifies whether or not the event can bubble.
- *
- * @param cancelableArg Specifies whether or not the event's default action can be prevented.
- *
- * @param relatedNodeArg Specifies the Event's related Node.
- *
- * @param prevValueArg Specifies the Event's prevValue attribute. This value may be null.
- *
- * @param newValueArg Specifies the Event's newValue attribute. This value may be null.
- *
- * @param attrNameArg Specifies the Event's attrName attribute. This value may be null.
- *
- * @param attrChangeArg Specifies the Event's attrChange attribute
- *
- */
- void initMutationEvent(const DOMString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- const Node &relatedNodeArg,
- const DOMString &prevValueArg,
- const DOMString &newValueArg,
- const DOMString &attrNameArg,
- unsigned short attrChangeArg);
-protected:
- MutationEvent(MutationEventImpl *impl);
-
-#endif
-
};
@@ -733,102 +187,16 @@
*/
class KeyboardEvent
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- : public UIEvent
-
-#endif
-
{
public:
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- KeyboardEvent();
- KeyboardEvent(const KeyboardEvent &other);
- KeyboardEvent(const Event &other);
- KeyboardEvent & operator = (const KeyboardEvent &other);
- KeyboardEvent & operator = (const Event &other);
- virtual ~KeyboardEvent();
-
-#endif
-
// KeyLocationCode
static const unsigned DOM_KEY_LOCATION_STANDARD = 0x00;
static const unsigned DOM_KEY_LOCATION_LEFT = 0x01;
static const unsigned DOM_KEY_LOCATION_RIGHT = 0x02;
static const unsigned DOM_KEY_LOCATION_NUMPAD = 0x03;
static const unsigned DOM_KEY_LOCATION_UNKNOWN = 0x04;
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- /**
- * Holds the identifier of the key.
- *
- */
- DOMString keyIdentifier() const;
-
- /**
- * Contains an indication of the location of they key on the device.
- *
- */
- unsigned keyLocation() const;
-
- /**
- * Used to indicate whether the 'ctrl' key was depressed during the firing
- * of the event.
- */
- bool ctrlKey() const;
-
- /**
- * Used to indicate whether the 'shift' key was depressed during the firing
- * of the event.
- *
- */
- bool shiftKey() const;
-
- /**
- * Used to indicate whether the 'alt' key was depressed during the firing
- * of the event. On some platforms this key may map to an alternative key
- * name.
- *
- */
- bool altKey() const;
-
- /**
- * Used to indicate whether the 'meta' key was depressed during the firing
- * of the event. On some platforms this key may map to an alternative key
- * name.
- *
- */
- bool metaKey() const;
-
- /**
- * Used to indicate whether the 'alt graph' (?) key was depressed during the firing
- * of the event. On some platforms this key may map to an alternative key
- * name.
- *
- */
- bool altGraphKey() const;
-
- void initKeyboardEvent(const DOMString &typeArg,
- bool canBubbleArg,
- bool cancelableArg,
- const AbstractView &viewArg,
- const DOMString &keyIdentifierArg,
- unsigned keyLocationArg,
- bool ctrlKeyArg,
- bool shiftKeyArg,
- bool altKeyArg,
- bool metaKeyArg,
- bool altGraphKeyArg);
-
-protected:
- KeyboardEvent(KeyboardEventImpl *impl);
-
-#endif
-
};
}; //namespace
1.12 +0 -446 WebCore/khtml/dom/dom2_range.h
Index: dom2_range.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/dom2_range.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- dom2_range.h 16 Sep 2005 22:42:03 -0000 1.11
+++ dom2_range.h 4 Dec 2005 11:35:05 -0000 1.12
@@ -33,43 +33,12 @@
#include <dom/dom_node.h>
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-#include <dom/dom_doc.h>
-#include <dom/dom_misc.h>
-
-#endif
-
namespace DOM {
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-class DocumentFragment;
-class Node;
-class DOMString;
-class DocumentImpl;
-class RangeImpl;
-
-class DOMException;
-
-#endif
-
// Introduced in DOM Level 2:
class RangeException {
public:
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- RangeException(unsigned short _code) { code = _code; }
- RangeException(const RangeException &other) { code = other.code; }
-
- RangeException & operator = (const RangeException &other)
- { code = other.code; return *this; }
-
- virtual ~RangeException() {}
-
-#endif
-
/**
* An integer indicating the type of error generated.
*
@@ -80,434 +49,19 @@
_EXCEPTION_OFFSET = 2000,
_EXCEPTION_MAX = 2999
};
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- unsigned short code;
-
-#endif
};
class Range
{
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- friend class DocumentImpl;
- friend class Document;
- friend class RangeImpl;
-
-#endif
-
public:
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- Range();
- Range(const Document rootContainer);
- Range(const Range &other);
- Range(const Node startContainer, const int startOffset, const Node endContainer, const int endOffset);
-
- Range & operator = (const Range &other);
-
- ~Range();
-
- /**
- * Node within which the range begins
- *
- */
- Node startContainer() const;
-
- /**
- * Offset within the starting node of the range.
- *
- */
- int startOffset() const;
-
- /**
- * Node within which the range ends
- *
- */
- Node endContainer() const;
-
- /**
- * Offset within the ending node of the range.
- *
- */
- int endOffset() const;
-
- /**
- * TRUE if the range is collapsed
- *
- */
- bool collapsed() const;
-
- /**
- * Gets the common ancestor container of the range's two end-points.
- * Also sets it.
- *
- */
- // ### BIC make const in the next release
- Node commonAncestorContainer();
-
- /**
- * Sets the attributes describing the start of the range.
- *
- * @param refNode The <code> refNode </code> value. This parameter
- * must be different from <code> null </code> .
- *
- * @param offset The <code> startOffset </code> value.
- *
- * @return
- *
- * @exception RangeException
- * NULL_NODE_ERR: Raised if <code> refNode </code> is <code> null
- * </code> .
- *
- * INVALID_NODE_TYPE_ERR: Raised if <code> refNode </code> or an
- * ancestor of <code> refNode </code> is an Attr, Entity,
- * Notation, or DocumentType node.
- *
- * If an offset is out-of-bounds, should it just be fixed up or
- * should an exception be raised.
- *
- */
- void setStart ( const Node &refNode, int offset );
-
- /**
- * Sets the attributes describing the end of a range.
- *
- * @param refNode The <code> refNode </code> value. This parameter
- * must be different from <code> null </code> .
- *
- * @param offset The <code> endOffset </code> value.
- *
- * @return
- *
- * @exception RangeException
- * NULL_NODE_ERR: Raised if <code> refNode </code> is <code> null
- * </code> .
- *
- * INVALID_NODE_TYPE_ERR: Raised if <code> refNode </code> or an
- * ancestor of <code> refNode </code> is an Attr, Entity,
- * Notation, or DocumentType node.
- *
- */
- void setEnd ( const Node &refNode, int offset );
-
- /**
- * Sets the start position to be before a node
- *
- * @param refNode Range starts before <code> refNode </code>
- *
- * @return
- *
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if an ancestor of <code> refNode
- * </code> is an Attr, Entity, Notation, or DocumentType node or
- * if <code> refNode </code> is a Document, DocumentFragment,
- * Attr, Entity, or Notation node.
- *
- */
- void setStartBefore ( const Node &refNode );
-
- /**
- * Sets the start position to be after a node
- *
- * @param refNode Range starts after <code> refNode </code>
- *
- * @return
- *
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if an ancestor of <code> refNode
- * </code> is an Attr, Entity, Notation, or DocumentType node or
- * if <code> refNode </code> is a Document, DocumentFragment,
- * Attr, Entity, or Notation node.
- *
- */
- void setStartAfter ( const Node &refNode );
-
- /**
- * Sets the end position to be before a node.
- *
- * @param refNode Range ends before <code> refNode </code>
- *
- * @return
- *
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if an ancestor of <code> refNode
- * </code> is an Attr, Entity, Notation, or DocumentType node or
- * if <code> refNode </code> is a Document, DocumentFragment,
- * Attr, Entity, or Notation node.
- *
- */
- void setEndBefore ( const Node &refNode );
-
- /**
- * Sets the end of a range to be after a node
- *
- * @param refNode Range ends after <code> refNode </code> .
- *
- * @return
- *
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if an ancestor of <code> refNode
- * </code> is an Attr, Entity, Notation or DocumentType node or if
- * <code> refNode </code> is a Document, DocumentFragment, Attr,
- * Entity, or Notation node.
- *
- */
- void setEndAfter ( const Node &refNode );
-
- /**
- * Collapse a range onto one of its end-points
- *
- * @param toStart If TRUE, collapses the Range onto its start; if
- * FALSE, collapses it onto its end.
- *
- * @return
- *
- */
- void collapse ( bool toStart );
-
- /**
- * Select a node and its contents
- *
- * @param refNode The node to select.
- *
- * @return
- *
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if an ancestor of <code> refNode
- * </code> is an Attr, Entity, Notation or DocumentType node or if
- * <code> refNode </code> is a Document, DocumentFragment, Attr,
- * Entity, or Notation node.
- *
- */
- void selectNode ( const Node &refNode );
-
- /**
- * Select the contents within a node
- *
- * @param refNode Node to select from
- *
- * @return
- *
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if <code> refNode </code> or an
- * ancestor of <code> refNode </code> is an Attr, Entity, Notation
- * or DocumentType node.
- *
- */
- void selectNodeContents ( const Node &refNode );
-
-#endif
-
enum CompareHow {
START_TO_START = 0,
START_TO_END = 1,
END_TO_END = 2,
END_TO_START = 3
};
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- /**
- * Compare the end-points of two ranges in a document.
- *
- * @param how
- *
- * @param sourceRange
- *
- * @return -1, 0 or 1 depending on whether the corresponding
- * end-point of the Range is before, equal to, or after the
- * corresponding end-point of <code> sourceRange </code> .
- *
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if the two Ranges are not in the
- * same document or document fragment.
- *
- */
- short compareBoundaryPoints ( CompareHow how, const Range &sourceRange );
-
- /**
- * @internal
- * not part of the DOM
- *
- * Compare the boundary-points of a range.
- *
- * Return true if the startContainer is before the endContainer,
- * or if they are equal.
- * Return false if the startContainer is after the endContainer.
- *
- */
- bool boundaryPointsValid ( );
-
- /**
- * Removes the contents of a range from the containing document or
- * document fragment without returning a reference to the removed
- * content.
- *
- * @return
- *
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of the
- * content of the range is read-only or any of the nodes that
- * contain any of the content of the range are read-only.
- *
- */
- void deleteContents ( );
-
- /**
- * Moves the contents of a range from the containing document or
- * document fragment to a new DocumentFragment.
- *
- * @return A DocumentFragment containing the extracted contents.
- *
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if any portion of the
- * content of the range is read-only or any of the nodes which
- * contain any of the content of the range are read-only.
- *
- * HIERARCHY_REQUEST_ERR: Raised if a DocumentType node would be
- * extracted into the new DocumentFragment.
- *
- */
- DocumentFragment extractContents ( );
-
- /**
- * Duplicates the contents of a range
- *
- * @return A DocumentFragment containing contents equivalent to
- * those of this range.
- *
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if a DocumentType node would be
- * extracted into the new DocumentFragment.
- *
- */
- DocumentFragment cloneContents ( );
-
- /**
- * Inserts a node into the document or document fragment at the
- * start of the range.
- *
- * @param newNode The node to insert at the start of the range
- *
- * @return
- *
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of
- * the start of the range is read-only.
- *
- * WRONG_DOCUMENT_ERR: Raised if <code> newNode </code> and the
- * container of the start of the Range were not created from the
- * same document.
- *
- * HIERARCHY_REQUEST_ERR: Raised if the container of the start of
- * the Range is of a type that does not allow children of the type
- * of <code> newNode </code> or if <code> newNode </code> is an
- * ancestor of the container .
- *
- * @exception RangeException
- * INVALID_NODE_TYPE_ERR: Raised if <code> node </code> is an
- * Attr, Entity, Notation, DocumentFragment, or Document node.
- *
- */
- void insertNode ( const Node &newNode );
-
- /**
- * Reparents the contents of the range to the given node and
- * inserts the node at the position of the start of the range.
- *
- * @param newParent The node to surround the contents with.
- *
- * @return
- *
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if an ancestor container of
- * either end-point of the range is read-only.
- *
- * WRONG_DOCUMENT_ERR: Raised if <code> newParent </code> and the
- * container of the start of the Range were not created from the
- * same document.
- *
- * HIERARCHY_REQUEST_ERR: Raised if the container of the start of
- * the Range is of a type that does not allow children of the type
- * of <code> newParent </code> or if <code> newParent </code> is
- * an ancestor of the container or if <code> node </code> would
- * end up with a child node of a type not allowed by the type of
- * <code> node </code> .
- *
- * @exception RangeException
- * BAD_ENDPOINTS_ERR: Raised if the range partially selects a
- * non-text node.
- *
- * INVALID_NODE_TYPE_ERR: Raised if <code> node </code> is an
- * Attr, Entity, DocumentType, Notation, Document, or
- * DocumentFragment node.
- *
- */
- void surroundContents ( const Node &newParent );
-
- /**
- * Produces a new range whose end-points are equal to the
- * end-points of the range.
- *
- * @return The duplicated range.
- *
- */
- Range cloneRange ( );
-
- /**
- * Returns the contents of a range as a string.
- *
- * @return The contents of the range.
- *
- */
- DOMString toString ( );
-
- /**
- * @internal Not part of DOM
- */
- DOMString toHTML ( );
-
- /* Mozilla extension - only works for HTML documents. */
- DocumentFragment createContextualFragment (DOMString &html);
-
- /**
- * Called to indicate that the range is no longer in use and that
- * the implementation may relinquish any resources associated with
- * this range. Subsequent calls to any methods or attribute getters
- * on this range will result in a DOMException being thrown with an
- * error code of INVALID_STATE_ERR.
- *
- */
- void detach ( );
-
- /**
- * not part of the DOM
- * TRUE if the range is detached
- *
- */
- bool isDetached() const;
-
- /**
- * @internal
- * not part of the DOM
- */
- Range(RangeImpl *i);
- RangeImpl *handle() const;
- bool isNull() const;
-
-protected:
- RangeImpl *impl;
-
-private:
- void throwException(int exceptioncode) const;
-
-#endif
-
};
// Used determine how to interpret the offsets used in DOM Ranges.
1.8 +0 -321 WebCore/khtml/dom/dom2_traversal.cpp
Index: dom2_traversal.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/dom2_traversal.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- dom2_traversal.cpp 3 Oct 2005 21:12:11 -0000 1.7
+++ dom2_traversal.cpp 4 Dec 2005 11:35:05 -0000 1.8
@@ -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 @@
}
// --------------------------------------------------------------
-
-#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
1.7 +0 -470 WebCore/khtml/dom/dom2_traversal.h
Index: dom2_traversal.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/dom2_traversal.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- dom2_traversal.h 16 Sep 2005 22:42:03 -0000 1.6
+++ dom2_traversal.h 4 Dec 2005 11:35:05 -0000 1.7
@@ -29,12 +29,6 @@
#include <dom/dom_misc.h>
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-#include <dom/dom_node.h>
-
-#endif
-
namespace DOM {
class NodeImpl;
@@ -42,15 +36,8 @@
class NodeIteratorImpl;
class TreeWalkerImpl;
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-typedef const Node &FilterNode;
-
-#else
-
typedef NodeImpl *FilterNode;
-#endif
class NodeFilterCondition : public DomShared
{
@@ -85,17 +72,6 @@
{
public:
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- NodeFilter();
- NodeFilter(NodeFilterCondition *);
- NodeFilter(NodeFilterImpl *);
- NodeFilter(const NodeFilter &other);
- NodeFilter &operator=(const NodeFilter &other);
- ~NodeFilter();
-
-#endif
-
/**
* The following constants are returned by the acceptNode()
* method:
@@ -129,453 +105,7 @@
SHOW_DOCUMENT_FRAGMENT = 0x00000400,
SHOW_NOTATION = 0x00000800
};
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- /**
- * Test whether a specified node is visible in the logical view of
- * a TreeWalker or NodeIterator. This function will be called by
- * the implementation of TreeWalker and NodeIterator; it is not
- * intended to be called directly from user code.
- *
- * @param n The node to check to see if it passes the filter or
- * not.
- *
- * @return a constant to determine whether the node is accepted,
- * rejected, or skipped, as defined <a
- * href="#Traversal-NodeFilter-acceptNode-constants"> above </a> .
- *
- */
- short acceptNode(const Node &) const;
-
- NodeFilterImpl *handle() const { return impl; }
- bool isNull() const { return impl == 0; }
-
-private:
- NodeFilterImpl *impl;
-
-#endif
-
-};
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-/**
- * NodeIterators are used to step through a set of nodes, e.g. the set
- * of nodes in a NodeList, the document subtree governed by a
- * particular node, the results of a query, or any other set of nodes.
- * The set of nodes to be iterated is determined by the implementation
- * of the NodeIterator. DOM Level 2 specifies a single NodeIterator
- * implementation for document-order traversal of a document subtree.
- * Instances of these iterators are created by calling
- * DocumentTraversal.createNodeIterator().
- *
- * Any Iterator that returns nodes may implement the
- * NodeIterator interface. Users and vendor libraries may also
- * choose to create Iterators that implement the NodeIterator
- * interface.
- *
- */
-class NodeIterator
-{
-public:
- NodeIterator(const NodeIterator &other);
- NodeIterator &operator=(const NodeIterator &other);
-
- ~NodeIterator();
-
- /**
- * The root node of the NodeIterator, as specified when it was created.
- */
- Node root() const;
-
- /**
- * This attribute determines which node types are presented via the
- * iterator. The available set of constants is defined in the NodeFilter
- * interface. Nodes not accepted by whatToShow will be skipped, but their
- * children may still be considered. Note that this skip takes precedence
- * over the filter, if any.
- */
- unsigned whatToShow() const;
-
- /**
- * The NodeFilter used to screen nodes.
- */
- NodeFilter filter() const;
-
- /**
- * The value of this flag determines whether the children of entity
- * reference nodes are visible to the iterator. If false, they and
- * their descendents will be rejected. Note that this rejection takes
- * precedence over whatToShow and the filter. Also note that this is
- * currently the only situation where NodeIterators may reject a complete
- * subtree rather than skipping individual nodes.
- *
- * To produce a view of the document that has entity references expanded
- * and does not expose the entity reference node itself, use the whatToShow
- * flags to hide the entity reference node and set expandEntityReferences to
- * true when creating the iterator. To produce a view of the document that
- * has entity reference nodes but no entity expansion, use the whatToShow
- * flags to show the entity reference node and set expandEntityReferences to
- * false.
- */
- bool expandEntityReferences() const;
-
- /**
- * Returns the next node in the set and advances the position of
- * the Iterator in the set. After a NodeIterator is created, the
- * first call to nextNode() returns the first node in the set.
- *
- * @return The next Node in the set being iterated
- * over, or null if there are no more members in
- * that set.
- *
- * @exception Exceptions from user code
- * Any exceptions raised by a user-written Filter will propagate
- * through.
- *
- */
- Node nextNode();
-
- /**
- * Returns the previous node in the set and moves the position of
- * the Iterator backwards in the set.
- *
- * @return The previous Node in the set being
- * iterated over, or null if there are no more
- * members in that set.
- *
- * @exception Exceptions from user code
- * Any exceptions raised by a user-written Filter will propagate
- * through.
- *
- */
- Node previousNode();
-
- /**
- * Detaches the NodeIterator from the set which it iterated over,
- * releasing any computational resources and placing the iterator in the
- * INVALID state. After detach has been invoked, calls to nextNode or
- * previousNode will raise the exception INVALID_STATE_ERR.
- */
- void detach();
-
- /**
- * @internal
- * not part of the DOM
- */
- Node referenceNode() const;
- bool pointerBeforeReferenceNode() const;
- NodeIteratorImpl *handle() const { return impl; }
- bool isNull() const { return impl == 0; }
-
- friend class NodeIteratorImpl;
- friend class Document;
-
- NodeIterator(NodeIteratorImpl *);
-
-private:
- NodeIterator();
- NodeIteratorImpl *impl;
-};
-
-
-/**
- * TreeWalker objects are used to navigate a document
- * tree or subtree using the view of the document defined by its
- * whatToShow flags and any filters that are defined
- * for the TreeWalker . Any function which performs
- * navigation using a TreeWalker will automatically
- * support any view defined by a TreeWalker .
- *
- * Omitting nodes from the logical view of a subtree can result in a
- * structure that is substantially different from the same subtree in
- * the complete, unfiltered document. Nodes that are siblings in the
- * TreeWalker view may be children of different, widely separated
- * nodes in the original view. For instance, consider a Filter that
- * skips all nodes except for Text nodes and the root node of a
- * document. In the logical view that results, all text nodes will be
- * siblings and appear as direct children of the root node, no matter
- * how deeply nested the structure of the original document.
- *
- */
-class TreeWalker
-{
-public:
- TreeWalker(const TreeWalker &other);
- TreeWalker &operator=(const TreeWalker &other);
- ~TreeWalker();
-
- /**
- * The root node of the TreeWalker, as specified when it was created.
- */
- Node root() const;
-
- /**
- * This attribute determines which node types are presented via the
- * TreeWalker. The available set of constants is defined in the NodeFilter
- * interface. Nodes not accepted by whatToShow will be skipped, but their
- * children may still be considered. Note that this skip takes precedence
- * over the filter, if any.
- */
- unsigned whatToShow() const;
-
- /**
- * The filter used to screen nodes.
- */
- NodeFilter filter() const;
-
- /**
- * The value of this flag determines whether the children of entity
- * reference nodes are visible to the TreeWalker. If false, they and their
- * descendents will be rejected. Note that this rejection takes precedence
- * over whatToShow and the filter, if any.
- *
- * To produce a view of the document that has entity references expanded
- * and does not expose the entity reference node itself, use the whatToShow
- * flags to hide the entity reference node and set expandEntityReferences
- * to true when creating the TreeWalker. To produce a view of the document
- * that has entity reference nodes but no entity expansion, use the
- * whatToShow flags to show the entity reference node and set
- * expandEntityReferences to false.
- */
- bool expandEntityReferences() const;
-
- /**
- * The node at which the TreeWalker is currently positioned.
- * Alterations to the DOM tree may cause the current node to no longer be
- * accepted by the TreeWalker's associated filter. currentNode may also be
- * explicitly set to any node, whether or not it is within the subtree
- * specified by the root node or would be accepted by the filter and
- * whatToShow flags. Further traversal occurs relative to currentNode even
- * if it is not part of the current view, by applying the filters in the
- * requested direction; if no traversal is possible, currentNode is not changed.
- *
- * @exception DOMException
- * NOT_SUPPORTED_ERR: Raised if an attempt is made to set currentNode to null.
- */
- Node currentNode() const;
-
- /**
- * see currentNode
- */
- void setCurrentNode(const Node &_currentNode);
-
- /**
- * Moves to and returns the parent node of the current node. If
- * there is no parent node, or if the current node is the root
- * node from which this TreeWalker was created, retains the
- * current position and returns null.
- *
- * @return The new parent node, or null if the current node has no
- * parent in the TreeWalker's logical view.
- *
- * @exception Exceptions from user code
- * Any exceptions raised by a user-written Filter will propagate
- * through.
- *
- */
- Node parentNode();
-
- /**
- * Moves the TreeWalker to the first child of the
- * current node, and returns the new node. If the current node has
- * no children, returns null , and retains the
- * current node.
- *
- * @return The new node, or null if the current
- * node has no children.
- *
- * @exception Exceptions from user code
- * Any exceptions raised by a user-written Filter will propagate
- * through.
- *
- */
- Node firstChild();
-
- /**
- * Moves the TreeWalker to the last child of the
- * current node, and returns the new node. If the current node has
- * no children, returns null , and retains the
- * current node.
- *
- * @return The new node, or null if the current
- * node has no children.
- *
- * @exception Exceptions from user code
- * Any exceptions raised by a user-written Filter will propagate
- * through.
- *
- */
- Node lastChild();
-
- /**
- * Moves the TreeWalker to the previous sibling of
- * the current node, and returns the new node. If the current node
- * has no previous sibling, returns null , and
- * retains the current node.
- *
- * @return The new node, or null if the current
- * node has no previous sibling.
- *
- * @exception Exceptions from user code
- * Any exceptions raised by a user-written Filter will propagate
- * through.
- *
- */
- Node previousSibling();
-
- /**
- * Moves the TreeWalker to the next sibling of the
- * current node, and returns the new node. If the current node has
- * no next sibling, returns null , and retains the
- * current node.
- *
- * @return The new node, or null if the current
- * node has no next sibling.
- *
- * @exception Exceptions from user code
- * Any exceptions raised by a user-written Filter will propagate
- * through.
- *
- */
- Node nextSibling();
-
- /**
- * Moves the TreeWalker to the previous node in
- * document order relative to the current node, and returns the
- * new node. If the current node has no previous node, returns
- * null , and retains the current node.
- *
- * @return The new node, or null if the current
- * node has no previous node.
- *
- * @exception Exceptions from user code
- * Any exceptions raised by a user-written Filter will propagate
- * through.
- *
- */
- Node previousNode();
-
- /**
- * Moves the TreeWalker to the next node in
- * document order relative to the current node, and returns the
- * new node. If the current node has no next node, returns
- * null , and retains the current node.
- *
- * @return The new node, or null if the current
- * node has no next node.
- *
- * @exception Exceptions from user code
- * Any exceptions raised by a user-written Filter will propagate
- * through.
- *
- */
- Node nextNode();
-
- /**
- * @internal
- * not part of the DOM
- */
- TreeWalkerImpl *handle() const { return impl; }
- bool isNull() const { return impl == 0; }
-
- TreeWalker(TreeWalkerImpl *);
-
- friend class Document;
- friend class TreeWalkerImpl;
-
-private:
- TreeWalker();
- TreeWalkerImpl *impl;
-};
-
-
-// ### not sure if this this class is really needed - both methods are in
-// Document
-
-/**
- * DocumentTraversal contains methods that creates
- * Iterators to traverse a node and its children in document order
- * (depth first, pre-order traversal, which is equivalent to the order
- * in which the start tags occur in the text representation of the
- * document).
- *
- *
-class DocumentTraversal // : public Document ?
-{
-public:
- DocumentTraversal();
- DocumentTraversal(const DocumentTraversal &other);
-
- DocumentTraversal & operator = (const DocumentTraversal &other);
-
- ~DocumentTraversal();
-
- **
- *
- *
- * @param root The node which will be iterated together with its
- * children. The iterator is initially positioned just before this
- * node. The whatToShow flags and the filter, if any, are not
- * considered when setting this position.
- *
- * @param whatToShow This flag specifies which node types may
- * appear in the logical view of the tree presented by the
- * Iterator. See the description of Iterator for the set of
- * possible values. These flags can be combined using OR.
- *
- * These flags can be combined using OR .
- *
- * @param filter The Filter to be used with this TreeWalker, or
- * null to indicate no filter.
- *
- * @param expandEntityReferences The value of this flag
- * determines whether entity reference nodes are expanded.
- *
- * @return The newly created NodeIterator .
- *
- *
- NodeIterator createNodeIterator ( const Node &root, int whatToShow,
- const NodeFilter &filter, bool expandEntityReferences );
-
- **
- * Create a new TreeWalker over the subtree rooted by the
- * specified node.
- *
- * @param root The node which will serve as the root for the
- * TreeWalker . The currentNode of the TreeWalker
- * is set to this node. The whatToShow flags and the NodeFilter
- * are not considered when setting this value; any node type will
- * be accepted as the root. The root must not be null.
- *
- * @param whatToShow This flag specifies which node types may
- * appear in the logical view of the tree presented by the
- * Iterator. See the description of TreeWalker for the set of
- * possible values. These flags can be combined using OR.
- *
- * These flags can be combined using OR .
- *
- * @param filter The Filter to be used with this TreeWalker, or
- * null to indicate no filter.
- *
- * @param expandEntityReferences The value of this flag
- * determines whether entity reference nodes are expanded.
- *
- * @return The newly created TreeWalker .
- *
- * @exception DOMException
- * Raises the exception NOT_SUPPORTED_ERR if the specified root
- * node is null.
- *
- *
- TreeWalker createTreeWalker ( const Node &root, int whatToShow,
- const NodeFilter &filter, bool expandEntityReferences );
};
-*/
-
-#endif
-
} // namespace
#endif
1.6 +0 -19 WebCore/khtml/dom/dom_exception.h
Index: dom_exception.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/dom_exception.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- dom_exception.h 11 May 2005 00:58:28 -0000 1.5
+++ dom_exception.h 4 Dec 2005 11:35:06 -0000 1.6
@@ -57,18 +57,6 @@
{
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 @@
NAMESPACE_ERR = 14,
INVALID_ACCESS_ERR = 15
};
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- unsigned short code;
-
-#endif
-
};
} //namespace
1.9 +0 -10 WebCore/khtml/dom/dom_misc.cpp
Index: dom_misc.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/dom_misc.cpp,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- dom_misc.cpp 3 Oct 2005 21:12:11 -0000 1.8
+++ dom_misc.cpp 4 Dec 2005 11:35:06 -0000 1.9
@@ -29,14 +29,4 @@
{
// deliberately left blank
}
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-bool DomShared::deleteMe()
-{
- return true;
-}
-
-#endif
-
}
1.11 +0 -6 WebCore/khtml/dom/dom_misc.h
Index: dom_misc.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/dom_misc.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -r1.10 -r1.11
--- dom_misc.h 19 Sep 2005 18:52:10 -0000 1.10
+++ dom_misc.h 4 Dec 2005 11:35:06 -0000 1.11
@@ -37,13 +37,7 @@
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; }
1.17 +0 -803 WebCore/khtml/dom/dom_node.h
Index: dom_node.h
===================================================================
RCS file: /cvs/root/WebCore/khtml/dom/dom_node.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- dom_node.h 21 Nov 2005 01:19:54 -0000 1.16
+++ dom_node.h 4 Dec 2005 11:35:06 -0000 1.17
@@ -29,226 +29,8 @@
#ifndef _DOM_Node_h_
#define _DOM_Node_h_
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-#include <qstring.h>
-
-class QRect;
-
-#endif
-
namespace DOM {
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-class Node;
-class DOMString;
-class NodeImpl;
-class NamedNodeMapImpl;
-class EventListener;
-class Event;
-
-/**
- * Objects implementing the <code> NamedNodeMap </code> interface are
- * used to represent collections of nodes that can be accessed by
- * name. Note that <code> NamedNodeMap </code> does not inherit from
- * <code> NodeList </code> ; <code> NamedNodeMap </code> s are not
- * maintained in any particular order. Objects contained in an object
- * implementing <code> NamedNodeMap </code> may also be accessed by an
- * ordinal index, but this is simply to allow convenient enumeration
- * of the contents of a <code> NamedNodeMap </code> , and does not
- * imply that the DOM specifies an order to these Nodes.
- *
- */
-class NamedNodeMap
-{
-public:
- NamedNodeMap();
- NamedNodeMap(const NamedNodeMap &other);
-
- NamedNodeMap & operator = (const NamedNodeMap &other);
-
- ~NamedNodeMap();
-
- /**
- * The number of nodes in the map. The range of valid child node
- * indices is 0 to <code> length-1 </code> inclusive.
- *
- */
- unsigned length() const;
-
- /**
- * Retrieves a node specified by name.
- *
- * @param name Name of a node to retrieve.
- *
- * @return A <code> Node </code> (of any type) with the specified
- * name, or <code> null </code> if the specified name did not
- * identify any node in the map.
- *
- */
- Node getNamedItem ( const DOMString &name ) const;
-
- /**
- * Adds a node using its <code> nodeName </code> attribute.
- *
- * As the <code> nodeName </code> attribute is used to derive the
- * name which the node must be stored under, multiple nodes of
- * certain types (those that have a "special" string value) cannot
- * be stored as the names would clash. This is seen as preferable
- * to allowing nodes to be aliased.
- *
- * @param arg A node to store in a named node map. The node will
- * later be accessible using the value of the <code> nodeName
- * </code> attribute of the node. If a node with that name is
- * already present in the map, it is replaced by the new one.
- *
- * @return If the new <code> Node </code> replaces an existing
- * node with the same name the previously existing <code> Node
- * </code> is returned, otherwise <code> null </code> is returned.
- *
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if <code> arg </code> was created
- * from a different document than the one that created the <code>
- * NamedNodeMap </code> .
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this <code>
- * NamedNodeMap </code> is readonly.
- *
- * INUSE_ATTRIBUTE_ERR: Raised if <code> arg </code> is an <code>
- * Attr </code> that is already an attribute of another <code>
- * Element </code> object. The DOM user must explicitly clone
- * <code> Attr </code> nodes to re-use them in other elements.
- *
- */
- Node setNamedItem ( const Node &arg );
-
- /**
- * Removes a node specified by name. If the removed node is an
- * <code> Attr </code> with a default value it is immediately
- * replaced.
- *
- * @param name The name of a node to remove.
- *
- * @return The node removed from the map or <code> null </code> if
- * no node with such a name exists.
- *
- * @exception DOMException
- * NOT_FOUND_ERR: Raised if there is no node named <code> name
- * </code> in the map.
- *
- */
- Node removeNamedItem ( const DOMString &name );
-
- /**
- * Returns the <code> index </code> th item in the map. If <code>
- * index </code> is greater than or equal to the number of nodes
- * in the map, this returns <code> null </code> .
- *
- * @param index Index into the map.
- *
- * @return The node at the <code> index </code> th position in the
- * <code> NamedNodeMap </code> , or <code> null </code> if that is
- * not a valid index.
- *
- */
- Node item ( unsigned index ) const;
-
- /**
- * Introduced in DOM Level 2
- *
- * Retrieves a node specified by local name and namespace URI. HTML-only
- * DOM implementations do not need to implement this method.
- *
- * @param namespaceURI The namespace URI of the node to retrieve.
- *
- * @param localName The local name of the node to retrieve.
- *
- * @return A Node (of any type) with the specified local name and namespace
- * URI, or null if they do not identify any node in this map.
- */
- Node getNamedItemNS( const DOMString &namespaceURI,
- const DOMString &localName ) const;
-
- /**
- * Introduced in DOM Level 2
- *
- * Adds a node using its namespaceURI and localName. If a node with that
- * namespace URI and that local name is already present in this map, it is
- * replaced by the new one.
- * HTML-only DOM implementations do not need to implement this method.
- *
- * @param arg A node to store in this map. The node will later be
- * accessible using the value of its namespaceURI and localName attributes.
- *
- * @return If the new Node replaces an existing node the replaced Node is
- * returned, otherwise null is returned.
- *
- * @exception DOMException
- * WRONG_DOCUMENT_ERR: Raised if arg was created from a different document
- * than the one that created this map.
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
- *
- * INUSE_ATTRIBUTE_ERR: Raised if arg is an Attr that is already an
- * attribute of another Element object. The DOM user must explicitly clone
- * Attr nodes to re-use them in other elements.
- */
- Node setNamedItemNS( const Node &arg );
-
- /**
- * Introduced in DOM Level 2
- *
- * Removes a node specified by local name and namespace URI. A removed
- * attribute may be known to have a default value when this map contains
- * the attributes attached to an element, as returned by the attributes
- * attribute of the Node interface. If so, an attribute immediately appears
- * containing the default value as well as the corresponding namespace URI,
- * local name, and prefix when applicable.
- * HTML-only DOM implementations do not need to implement this method.
- *
- * @param namespaceURI The namespace URI of the node to remove.
- *
- * @param localName The local name of the node to remove.
- *
- * @return The node removed from this map if a node with such a local name
- * and namespace URI exists.
- *
- * @exception DOMException
- * NOT_FOUND_ERR: Raised if there is no node with the specified
- * namespaceURI and localName in this map.
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this map is readonly.
- */
- Node removeNamedItemNS( const DOMString &namespaceURI,
- const DOMString &localName );
-
- /**
- * @internal
- * not part of the DOM
- */
- NamedNodeMapImpl *handle() const throw();
- bool isNull() const throw();
-
-protected:
- NamedNodeMap( NamedNodeMapImpl *i);
- NamedNodeMapImpl *impl;
-
- friend class Node;
- friend class DocumentType;
- friend class NodeImpl;
-};
-
-class NamedNodeMap;
-class NodeList;
-class Document;
-class DOMString;
-class StyleSheet;
-
-class NodeImpl;
-
-#endif
-
/**
* The <code> Node </code> interface is the primary datatype for the
* entire Document Object Model. It represents a single node in the
@@ -273,37 +55,8 @@
class Node
{
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- friend class NamedNodeMap;
- friend class NodeList;
- friend class HTMLCollection;
- friend class StyleSheet;
-
-#endif
-
public:
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- Node();
- Node(const Node &other);
-
- /**
- * @internal
- */
- Node( NodeImpl *_impl);
-
- Node & operator = (const Node &other);
-
- bool operator == (const Node &other);
-
- bool operator != (const Node &other);
-
- virtual ~Node();
-
-#endif
-
/**
* An integer indicating which type of node this is.
*
@@ -408,564 +161,8 @@
DOCUMENT_FRAGMENT_NODE = 11,
NOTATION_NODE = 12
};
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
- /**
- * The name of this node, depending on its type; see the table
- * above.
- *
- */
- DOMString nodeName() const;
-
- /**
- * The value of this node, depending on its type; see the table
- * above.
- *
- * @exception DOMException
- * DOMSTRING_SIZE_ERR: Raised when it would return more characters
- * than fit in a <code> DOMString </code> variable on the
- * implementation platform.
- *
- */
- DOMString nodeValue() const;
-
- /**
- * see @ref nodeValue
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised when the node is readonly.
- *
- */
- void setNodeValue( const DOMString & );
-
- /**
- * A code representing the type of the underlying object, as
- * defined above.
- *
- */
- unsigned short nodeType() const;
-
- /**
- * The parent of this node. All nodes, except <code> Document
- * </code> , <code> DocumentFragment </code> , and <code> Attr
- * </code> may have a parent. However, if a node has just been
- * created and not yet added to the tree, or if it has been
- * removed from the tree, this is <code> null </code> .
- *
- */
- Node parentNode() const;
-
- /**
- * A <code> NodeList </code> that contains all children of this
- * node. If there are no children, this is a <code> NodeList
- * </code> containing no nodes. The content of the returned <code>
- * NodeList </code> is "live" in the sense that, for
- * instance, changes to the children of the node object that it
- * was created from are immediately reflected in the nodes
- * returned by the <code> NodeList </code> accessors; it is not a
- * static snapshot of the content of the node. This is true for
- * every <code> NodeList </code> , including the ones returned by
- * the <code> getElementsByTagName </code> method.
- *
- */
- NodeList childNodes() const;
-
- /**
- * The first child of this node. If there is no such node, this
- * returns <code> null </code> .
- *
- */
- Node firstChild() const;
-
- /**
- * The last child of this node. If there is no such node, this
- * returns <code> null </code> .
- *
- */
- Node lastChild() const;
-
- /**
- * The node immediately preceding this node. If there is no such
- * node, this returns <code> null </code> .
- *
- */
- Node previousSibling() const;
-
- /**
- * The node immediately following this node. If there is no such
- * node, this returns <code> null </code> .
- *
- */
- Node nextSibling() const;
-
- /**
- * A <code> NamedNodeMap </code> containing the attributes of this
- * node (if it is an <code> Element </code> ) or <code> null
- * </code> otherwise.
- *
- */
- NamedNodeMap attributes() const;
-
- /**
- * The <code> Document </code> object associated with this node.
- * This is also the <code> Document </code> object used to create
- * new nodes. When this node is a <code> Document </code> this is
- * <code> null </code> .
- *
- */
- Document ownerDocument() const;
-
- /**
- * Inserts the node <code> newChild </code> before the existing
- * child node <code> refChild </code> . If <code> refChild </code>
- * is <code> null </code> , insert <code> newChild </code> at the
- * end of the list of children.
- *
- * If <code> newChild </code> is a <code> DocumentFragment
- * </code> object, all of its children are inserted, in the same
- * order, before <code> refChild </code> . If the <code> newChild
- * </code> is already in the tree, it is first removed.
- *
- * @param newChild The node to insert.
- *
- * @param refChild The reference node, i.e., the node before which
- * the new node must be inserted.
- *
- * @return The node being inserted.
- *
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that
- * does not allow children of the type of the <code> newChild
- * </code> node, or if the node to insert is one of this node's
- * ancestors.
- *
- * WRONG_DOCUMENT_ERR: Raised if <code> newChild </code> was
- * created from a different document than the one that created
- * this node.
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- *
- * NOT_FOUND_ERR: Raised if <code> refChild </code> is not a
- * child of this node.
- *
- */
- Node insertBefore ( const Node &newChild, const Node &refChild );
-
- /**
- * Replaces the child node <code> oldChild </code> with <code>
- * newChild </code> in the list of children, and returns the
- * <code> oldChild </code> node. If the <code> newChild </code> is
- * already in the tree, it is first removed.
- *
- * @param newChild The new node to put in the child list.
- *
- * @param oldChild The node being replaced in the list.
- *
- * @return The node replaced.
- *
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that
- * does not allow children of the type of the <code> newChild
- * </code> node, or it the node to put in is one of this node's
- * ancestors.
- *
- * WRONG_DOCUMENT_ERR: Raised if <code> newChild </code> was
- * created from a different document than the one that created
- * this node.
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- *
- * NOT_FOUND_ERR: Raised if <code> oldChild </code> is not a
- * child of this node.
- *
- */
- Node replaceChild ( const Node &newChild, const Node &oldChild );
-
- /**
- * Removes the child node indicated by <code> oldChild </code>
- * from the list of children, and returns it.
- *
- * @param oldChild The node being removed.
- *
- * @return The node removed.
- *
- * @exception DOMException
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- *
- * NOT_FOUND_ERR: Raised if <code> oldChild </code> is not a
- * child of this node.
- *
- */
- Node removeChild ( const Node &oldChild );
-
- /**
- * Adds the node <code> newChild </code> to the end of the list of
- * children of this node. If the <code> newChild </code> is
- * already in the tree, it is first removed.
- *
- * @param newChild The node to add.
- *
- * If it is a <code> DocumentFragment </code> object, the entire
- * contents of the document fragment are moved into the child list
- * of this node
- *
- * @return The node added.
- *
- * @exception DOMException
- * HIERARCHY_REQUEST_ERR: Raised if this node is of a type that
- * does not allow children of the type of the <code> newChild
- * </code> node, or if the node to append is one of this node's
- * ancestors.
- *
- * WRONG_DOCUMENT_ERR: Raised if <code> newChild </code> was
- * created from a different document than the one that created
- * this node.
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- *
- */
- Node appendChild ( const Node &newChild );
-
- /**
- * This is a convenience method to allow easy determination of
- * whether a node has any children.
- *
- * @return <code> true </code> if the node has any children,
- * <code> false </code> if the node has no children.
- *
- */
- bool hasChildNodes ( );
-
- /**
- * Returns a duplicate of this node, i.e., serves as a generic
- * copy constructor for nodes. The duplicate node has no parent (
- * <code> parentNode </code> returns <code> null </code> .).
- *
- * Cloning an <code> Element </code> copies all attributes and
- * their values, including those generated by the XML processor to
- * represent defaulted attributes, but this method does not copy
- * any text it contains unless it is a deep clone, since the text
- * is contained in a child <code> Text </code> node. Cloning any
- * other type of node simply returns a copy of this node.
- *
- * @param deep If <code> true </code> , recursively clone the
- * subtree under the specified node; if <code> false </code> ,
- * clone only the node itself (and its attributes, if it is an
- * <code> Element </code> ).
- *
- * @return The duplicate node.
- *
- */
- Node cloneNode ( bool deep );
-
- /**
- * Modified in DOM Level 2
- *
- * Puts all Text nodes in the full depth of the sub-tree underneath this
- * Node, including attribute nodes, into a "normal" form where only
- * structure (e.g., elements, comments, processing instructions, CDATA
- * sections, and entity references) separates Text nodes, i.e., there are
- * neither adjacent Text nodes nor empty Text nodes. This can be used to
- * ensure that the DOM view of a document is the same as if it were saved
- * and re-loaded, and is useful when operations (such as XPointer
- * [XPointer] lookups) that depend on a particular document tree structure
- * are to be used.
- *
- * Note: In cases where the document contains CDATASections, the normalize
- * operation alone may not be sufficient, since XPointers do not
- * differentiate between Text nodes and CDATASection nodes.
- */
- void normalize ( );
-
- /**
- * Introduced in DOM Level 2
- *
- * Tests whether the DOM implementation implements a specific feature and
- * that feature is supported by this node.
- *
- * @param feature The name of the feature to test. This is the same name
- * which can be passed to the method hasFeature on DOMImplementation.
- *
- * @param version This is the version number of the feature to test. In
- * Level 2, version 1, this is the string "2.0". If the version is not
- * specified, supporting any version of the feature will cause the method
- * to return true.
- *
- * @return Returns true if the specified feature is supported on this node,
- * false otherwise.
- */
- bool isSupported( const DOMString &feature,
- const DOMString &version ) const;
-
- /**
- * Introduced in DOM Level 2
- *
- * The namespace URI of this node, or null if it is unspecified.
- * This is not a computed value that is the result of a namespace lookup
- * based on an examination of the namespace declarations in scope. It is
- * merely the namespace URI given at creation time. For nodes of any type
- * other than ELEMENT_NODE and ATTRIBUTE_NODE and nodes created with a DOM
- * Level 1 method, such as createElement from the Document interface, this
- * is always null.
- *
- * Note: Per the Namespaces in XML Specification [Namespaces] an attribute
- * does not inherit its namespace from the element it is attached to. If an
- * attribute is not explicitly given a namespace, it simply has no
- * namespace.
- */
- DOMString namespaceURI( ) const;
-
- /**
- * Introduced in DOM Level 2
- *
- * The namespace prefix of this node, or null if it is unspecified.
- * Note that setting this attribute, when permitted, changes the nodeName
- * attribute, which holds the qualified name, as well as the tagName and
- * name attributes of the Element and Attr interfaces, when applicable.
- * Note also that changing the prefix of an attribute that is known to have
- * a default value, does not make a new attribute with the default value
- * and the original prefix appear, since the namespaceURI and localName do
- * not change.
- * For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and
- * nodes created with a DOM Level 1 method, such as createElement from the
- * Document interface, this is always null.
- */
- DOMString prefix( ) const;
-
- /**
- * see @ref prefix
- *
- * @exception DOMException
- * INVALID_CHARACTER_ERR: Raised if the specified prefix contains an
- * illegal character.
- *
- * NO_MODIFICATION_ALLOWED_ERR: Raised if this node is readonly.
- *
- * NAMESPACE_ERR: Raised if the specified prefix is malformed, if the
- * namespaceURI of this node is null, if the specified prefix is "xml" and
- * the namespaceURI of this node is different from
- * "http://www.w3.org/XML/1998/namespace", if this node is an attribute and
- * the specified prefix is "xmlns" and the namespaceURI of this node is
- * different from "http://www.w3.org/2000/xmlns/", or if this node is an
- * attribute and the qualifiedName of this node is "xmlns" [Namespaces].
- */
- void setPrefix(const DOMString &prefix );
-
- /**
- * Introduced in DOM Level 2
- *
- * Returns the local part of the qualified name of this node.
- * For nodes of any type other than ELEMENT_NODE and ATTRIBUTE_NODE and
- * nodes created with a DOM Level 1 method, such as createElement from the
- * Document interface, this is always null.
- */
- DOMString localName( ) const;
-
- /**
- * Returns whether this node (if it is an element) has any attributes.
- * @return a boolean. True if this node has any attributes, false otherwise.
- * Introduced in DOM Level 2
- */
- bool hasAttributes ( );
-
- /**
- * Introduced in DOM Level 2
- * This method is from the EventTarget interface
- *
- * This method allows the registration of event listeners on the event
- * target. If an EventListener is added to an EventTarget while it is
- * processing an event, it will not be triggered by the current actions but
- * may be triggered during a later stage of event flow, such as the
- * bubbling phase.
- *
- * If multiple identical EventListeners are registered on the same
- * EventTarget with the same parameters the duplicate instances are
- * discarded. They do not cause the EventListener to be called twice and
- * since they are discarded they do not need to be removed with the
- * removeEventListener method. Parameters
- *
- * @param type The event type for which the user is registering
- *
- * @param listener The listener parameter takes an interface implemented by
- * the user which contains the methods to be called when the event occurs.
- *
- * @param useCapture If true, useCapture indicates that the user wishes to
- * initiate capture. After initiating capture, all events of the specified
- * type will be dispatched to the registered EventListener before being
- * dispatched to any EventTargets beneath them in the tree. Events which
- * are bubbling upward through the tree will not trigger an EventListener
- * designated to use capture.
- */
- void addEventListener(const DOMString &type,
- EventListener *listener,
- bool useCapture);
-
- /**
- * Introduced in DOM Level 2
- * This method is from the EventTarget interface
- *
- * This method allows the removal of event listeners from the event target.
- * If an EventListener is removed from an EventTarget while it is
- * processing an event, it will not be triggered by the current actions.
- *
- * EventListeners can never be invoked after being removed.
- *
- * Calling removeEventListener with arguments which do not identify any
- * currently registered EventListener on the EventTarget has no effect.
- *
- * @param type Specifies the event type of the EventListener being removed.
- *
- * @param listener The EventListener parameter indicates the EventListener
- * to be removed.
- *
- * @param useCapture Specifies whether the EventListener being removed was
- * registered as a capturing listener or not. If a listener was registered
- * twice, one with capture and one without, each must be removed
- * separately. Removal of a capturing listener does not affect a
- * non-capturing version of the same listener, and vice versa.
- */
-
- void removeEventListener(const DOMString &type,
- EventListener *listener,
- bool useCapture);
-
- /**
- * Introduced in DOM Level 2
- * This method is from the EventTarget interface
- *
- * This method allows the dispatch of events into the implementations event
- * model. Events dispatched in this manner will have the same capturing and
- * bubbling behavior as events dispatched directly by the implementation.
- * The target of the event is the EventTarget on which dispatchEvent is
- * called.
- *
- * @param evt Specifies the event type, behavior, and contextual
- * information to be used in processing the event.
- *
- * @return The return value of dispatchEvent indicates whether any of the
- * listeners which handled the event called preventDefault. If
- * preventDefault was called the value is false, else the value is true.
- *
- * @exception EventException
- * UNSPECIFIED_EVENT_TYPE_ERR: Raised if the Event's type was not specified
- * by initializing the event before dispatchEvent was called. Specification
- * of the Event's type as null or an empty string will also trigger this
- * exception.
- */
- bool dispatchEvent(const Event &evt);
-
- /**
- * tests if this Node is 0. Useful especially, if casting to a derived
- * class:
- *
- * <pre>
- * Node n = .....;
- * // try to convert into an Element:
- * Element e = n;
- * if( e.isNull() )
- * kdDebug(300) << "node isn't an element node" << endl;
- * </pre>
- */
- bool isNull() const { return impl == 0; }
-
- /**
- * @internal handle to the implementation object
- */
- NodeImpl *handle() const { return impl; }
-
- /**
- * @internal returns the index of a node
- */
- unsigned index() const;
- QString toHTML();
- void applyChanges();
- /**
- * not part of the DOM.
- * @returns the exact coordinates and size of this element.
- */
- QRect getRect();
-
- /**
- * not part of the DOM.
- * @returns whether this node is contenteditable.
- */
- bool isContentEditable() const;
-
-protected:
- NodeImpl *impl;
-
-#endif
-
-};
-
-
-#if !KHTML_NO_CPLUSPLUS_DOM
-
-class NodeListImpl;
-
-/**
- * The <code> NodeList </code> interface provides the abstraction of
- * an ordered collection of nodes, without defining or constraining
- * how this collection is implemented.
- *
- * The items in the <code> NodeList </code> are accessible via an
- * integral index, starting from 0.
- *
- */
-class NodeList
-{
- friend class Element;
- friend class Node;
- friend class Document;
- friend class HTMLDocument;
- friend class NodeListImpl;
-
-public:
- NodeList();
- NodeList(const NodeList &other);
-
- NodeList & operator = (const NodeList &other);
-
- ~NodeList();
-
- /**
- * The number of nodes in the list. The range of valid child node
- * indices is 0 to <code> length-1 </code> inclusive.
- *
- */
- unsigned length() const;
-
- /**
- * Returns the <code> index </code> th item in the collection. If
- * <code> index </code> is greater than or equal to the number of
- * nodes in the list, this returns <code> null </code> .
- *
- * @param index Index into the collection.
- *
- * @return The node at the <code> index </code> th position in the
- * <code> NodeList </code> , or <code> null </code> if that is not
- * a valid index.
- *
- */
- Node item ( unsigned index ) const;
-
- /**
- * @internal
- * not part of the DOM
- */
- Node itemById (const DOMString& elementId) const;
-
- NodeListImpl *handle() const;
- bool isNull() const;
-
- NodeList(const NodeListImpl *i);
-
-protected:
- NodeListImpl *impl;
};
-#endif
-
/**
* A DOMTimeStamp represents a number of milliseconds.
*
1.74 +0 -4 WebCore/khtml/ecma/kjs_events.cpp
Index: kjs_events.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_events.cpp,v
retrieving revision 1.73
retrieving revision 1.74
diff -u -r1.73 -r1.74
--- kjs_events.cpp 3 Dec 2005 20:26:00 -0000 1.73
+++ kjs_events.cpp 4 Dec 2005 11:35:08 -0000 1.74
@@ -74,11 +74,7 @@
return;
#endif
-#if KHTML_NO_CPLUSPLUS_DOM
EventImpl *evt = ele;
-#else
- EventImpl *evt = ele.handle();
-#endif
ObjectImp *listener = listenerObj();
ObjectImp *win = windowObj();
1.20 +0 -4 WebCore/khtml/ecma/kjs_traversal.cpp
Index: kjs_traversal.cpp
===================================================================
RCS file: /cvs/root/WebCore/khtml/ecma/kjs_traversal.cpp,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- kjs_traversal.cpp 27 Nov 2005 07:54:50 -0000 1.19
+++ kjs_traversal.cpp 4 Dec 2005 11:35:08 -0000 1.20
@@ -316,11 +316,7 @@
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()) {
1.20 +0 -2 WebCore/kwq/KWQKConfigBase.h
Index: KWQKConfigBase.h
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQKConfigBase.h,v
retrieving revision 1.19
retrieving revision 1.20
diff -u -r1.19 -r1.20
--- KWQKConfigBase.h 23 May 2004 22:45:28 -0000 1.19
+++ KWQKConfigBase.h 4 Dec 2005 11:35:09 -0000 1.20
@@ -27,9 +27,7 @@
#define KCONFIG_H_
#include "KWQString.h"
-#if APPLE_CHANGES
#include "KWQKHTMLSettings.h"
-#endif
class QColor;
class QStringList;
1.6 +0 -2 WebCore/kwq/KWQKHTMLPageCache.h
Index: KWQKHTMLPageCache.h
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQKHTMLPageCache.h,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- KWQKHTMLPageCache.h 22 Jan 2003 00:12:35 -0000 1.5
+++ KWQKHTMLPageCache.h 4 Dec 2005 11:35:09 -0000 1.6
@@ -30,12 +30,10 @@
class QObject;
-#ifdef APPLE_CHANGES
/*
This class is not used by WebCore. The WebCore/WebKit page cache is
a cache of a fully constructed DOM and associated render objects.
*/
-#endif
class KHTMLPageCache
{
public:
1.30 +0 -5 WebCore/kwq/KWQPointArray.h
Index: KWQPointArray.h
===================================================================
RCS file: /cvs/root/WebCore/kwq/KWQPointArray.h,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -r1.29 -r1.30
--- KWQPointArray.h 12 Oct 2005 00:44:53 -0000 1.29
+++ KWQPointArray.h 4 Dec 2005 11:35:09 -0000 1.30
@@ -93,12 +93,7 @@
void point(uint, int *, int *);
void setPoint(uint, int, int);
-#if 0
- // FIXME: Workaround for Radar 2921061.
- bool setPoints(int, int, int, ...);
-#else
bool setPoints(int, int, int, int, int, int, int, int, int);
-#endif
bool setPoints( int nPoints, const int *points );
#ifdef _KWQ_IOSTREAM_
More information about the webkit-changes
mailing list