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);