22 #include "dom/dom_exception.h"
23 #include "dom/html_misc.h"
24 #include "css/css_base.h"
25 #include "html/html_miscimpl.h"
27 #include "misc/htmlhashes.h"
31 HTMLElement::HTMLElement() :
Element()
39 HTMLElement::HTMLElement(HTMLElementImpl *impl) :
Element(impl)
45 Element::operator = (other);
51 NodeImpl* ohandle = other.handle();
52 if (!ohandle || !ohandle->isHTMLElement()) {
53 if (impl) impl->deref();
57 Node::operator = (other);
61 HTMLElement::~HTMLElement()
68 return ((ElementImpl *)impl)->getAttribute(ATTR_ID);
73 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_ID, value);
79 return ((ElementImpl *)impl)->getAttribute(ATTR_TITLE);
84 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TITLE, value);
90 return ((ElementImpl *)impl)->getAttribute(ATTR_LANG);
95 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_LANG, value);
101 return ((ElementImpl *)impl)->getAttribute(ATTR_DIR);
106 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_DIR, value);
112 return ((ElementImpl *)impl)->getAttribute(ATTR_CLASS);
117 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CLASS, value);
120 void HTMLElement::removeCSSProperty(
const DOMString &property )
122 int id = getPropertyID(property.string().lower().ascii(), property.length());
124 static_cast<HTMLElementImpl*
>(impl)->removeCSSProperty(
id);
129 int id = getPropertyID(property.string().lower().ascii(), property.length());
131 static_cast<HTMLElementImpl*
>(impl)->addCSSProperty(
id, value);
137 return ((HTMLElementImpl *)impl)->innerHTML();
144 int exceptioncode = 0;
145 ((HTMLElementImpl *)impl)->setInnerHTML( html, exceptioncode );
153 return ((HTMLElementImpl *)impl)->innerText();
160 int exceptioncode = 0;
161 ((HTMLElementImpl *)impl)->setInnerText( text, exceptioncode );
178 void HTMLElement::assignOther(
const Node &other,
int elementId )
180 if (other.elementId() !=
static_cast<TQ_UINT32
>(elementId)) {
181 if ( impl ) impl->deref();
184 Node::operator = (other);
DOM operations only raise exceptions in "exceptional" circumstances, i.e., when an operation is impos...
This class implements the basic string we use in the DOM.
By far the vast majority of objects (apart from text) that authors encounter when traversing a docume...
An HTMLCollection is a list of nodes.
All HTML element interfaces derive from this class.
void setLang(const DOMString &)
see lang
DOMString id() const
The element's identifier.
DOMString innerText() const
The text contained in this element.
void setId(const DOMString &)
see id
void setInnerHTML(const DOMString &html)
Set the HTML content of this node.
DOMString className() const
The class attribute of the element.
void setClassName(const DOMString &)
see className
DOMString dir() const
Specifies the base direction of directionally neutral text and the directionality of tables.
DOMString lang() const
Language code defined in RFC 1766.
HTMLCollection all() const
Retrieves a collection of all nodes that descend from this node.
void setInnerText(const DOMString &text)
Set the text content of this node.
DOMString title() const
The element's advisory title.
void setTitle(const DOMString &)
see title
void setDir(const DOMString &)
see dir
HTMLCollection children() const
Retrieves a collection of nodes that are direct descendants of this node.
DOMString innerHTML() const
The HTML code contained in this element.
The Node interface is the primary datatype for the entire Document Object Model.
The Document Object Model (DOM) is divided into two parts, the COREDOM core DOM, specifying some core...