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);
void setInnerText(const DOMString &text)
Set the text content of this node.
All HTML element interfaces derive from this class.
void setId(const DOMString &)
see id
HTMLCollection all() const
Retrieves a collection of all nodes that descend from this node.
By far the vast majority of objects (apart from text) that authors encounter when traversing a docume...
void setInnerHTML(const DOMString &html)
Set the HTML content of this node.
The Document Object Model (DOM) is divided into two parts, the COREDOM core DOM, specifying some core...
An HTMLCollection is a list of nodes.
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.
DOMString lang() const
Language code defined in RFC 1766.
void setLang(const DOMString &)
see lang
DOMString innerText() const
The text contained in this element.
DOM operations only raise exceptions in "exceptional" circumstances, i.e., when an operation is impos...
DOMString id() const
The element's identifier.
void setClassName(const DOMString &)
see className
DOMString title() const
The element's advisory title.
void setDir(const DOMString &)
see dir
This class implements the basic string we use in the DOM.
void setTitle(const DOMString &)
see title
DOMString className() const
The class attribute of the element.
The Node interface is the primary datatype for the entire Document Object Model.
DOMString dir() const
Specifies the base direction of directionally neutral text and the directionality of tables.