24 #include "dom/html_head.h" 25 #include "html/html_headimpl.h" 26 #include "misc/htmlhashes.h" 27 #include "xml/dom_docimpl.h" 39 HTMLBaseElement::HTMLBaseElement(HTMLBaseElementImpl *impl) :
HTMLElement(impl)
45 assignOther( other, ID_BASE );
51 HTMLElement::operator = (other);
55 HTMLBaseElement::~HTMLBaseElement()
63 return !href.isNull() ? impl->getDocument()->completeURL(href.string()) : href;
68 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREF, value);
74 return ((ElementImpl *)impl)->getAttribute(ATTR_TARGET);
79 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TARGET, value);
92 HTMLLinkElement::HTMLLinkElement(HTMLLinkElementImpl *impl) :
HTMLElement(impl)
98 assignOther( other, ID_LINK );
104 HTMLElement::operator = (other);
108 HTMLLinkElement::~HTMLLinkElement()
115 return !((ElementImpl *)impl)->getAttribute(ATTR_DISABLED).isNull();
121 ((ElementImpl *)impl)->setAttribute(ATTR_DISABLED, _disabled ?
"" : 0);
127 return ((ElementImpl *)impl)->getAttribute(ATTR_CHARSET);
132 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHARSET, value);
139 return !href.isNull() ? impl->getDocument()->completeURL(href.string()) : href;
144 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREF, value);
150 return ((ElementImpl *)impl)->getAttribute(ATTR_HREFLANG);
155 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HREFLANG, value);
161 return ((ElementImpl *)impl)->getAttribute(ATTR_MEDIA);
166 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_MEDIA, value);
172 return ((ElementImpl *)impl)->getAttribute(ATTR_REL);
177 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_REL, value);
183 return ((ElementImpl *)impl)->getAttribute(ATTR_REV);
188 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_REV, value);
194 return ((ElementImpl *)impl)->getAttribute(ATTR_TARGET);
199 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TARGET, value);
205 return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
210 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
216 return ((HTMLLinkElementImpl *)impl)->sheet();
229 HTMLMetaElement::HTMLMetaElement(HTMLMetaElementImpl *impl) :
HTMLElement(impl)
235 assignOther( other, ID_META );
241 HTMLElement::operator = (other);
245 HTMLMetaElement::~HTMLMetaElement()
252 return ((ElementImpl *)impl)->getAttribute(ATTR_CONTENT);
257 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CONTENT, value);
263 return ((ElementImpl *)impl)->getAttribute(ATTR_HTTP_EQUIV);
268 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_HTTP_EQUIV, value);
274 return ((ElementImpl *)impl)->getAttribute(ATTR_NAME);
279 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_NAME, value);
285 return ((ElementImpl *)impl)->getAttribute(ATTR_SCHEME);
290 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SCHEME, value);
295 HTMLScriptElement::HTMLScriptElement() :
HTMLElement()
303 HTMLScriptElement::HTMLScriptElement(HTMLScriptElementImpl *impl) :
HTMLElement(impl)
309 assignOther( other, ID_SCRIPT );
315 HTMLElement::operator = (other);
319 HTMLScriptElement::~HTMLScriptElement()
326 return ((HTMLScriptElementImpl *)impl)->text();
331 if(impl) ((HTMLScriptElementImpl *)impl)->setText(value);
359 return ((ElementImpl *)impl)->getAttribute(ATTR_CHARSET);
364 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_CHARSET, value);
370 return !((ElementImpl *)impl)->getAttribute(ATTR_DEFER).isNull();
377 ((ElementImpl *)impl)->setAttribute(ATTR_DEFER,_defer ?
"" : 0);
383 DOMString s = ((ElementImpl *)impl)->getAttribute(ATTR_SRC);
384 return !s.isNull() ? impl->getDocument()->completeURL(s.string()) : s;
389 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_SRC, value);
395 return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
400 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
405 HTMLStyleElement::HTMLStyleElement() :
HTMLElement()
413 HTMLStyleElement::HTMLStyleElement(HTMLStyleElementImpl *impl) :
HTMLElement(impl)
419 assignOther( other, ID_STYLE );
425 HTMLElement::operator = (other);
429 HTMLStyleElement::~HTMLStyleElement()
436 return !((HTMLStyleElementImpl *)impl)->getAttribute(ATTR_DISABLED).isNull();
443 ((ElementImpl *)impl)->setAttribute(ATTR_DISABLED,_disabled ?
"" : 0);
449 return ((ElementImpl *)impl)->getAttribute(ATTR_MEDIA);
454 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_MEDIA, value);
460 return ((ElementImpl *)impl)->getAttribute(ATTR_TYPE);
465 if(impl) ((ElementImpl *)impl)->setAttribute(ATTR_TYPE, value);
471 return ((HTMLStyleElementImpl *)impl)->sheet();
477 HTMLTitleElement::HTMLTitleElement() :
HTMLElement()
485 HTMLTitleElement::HTMLTitleElement(HTMLTitleElementImpl *impl) :
HTMLElement(impl)
491 assignOther( other, ID_TITLE );
497 HTMLElement::operator = (other);
501 HTMLTitleElement::~HTMLTitleElement()
508 return ((HTMLTitleElementImpl *)impl)->text();
513 if(impl) ((HTMLTitleElementImpl *)impl)->setText(value);
DOMString rev() const
Reverse link type.
void setType(const DOMString &)
see type
The Node interface is the primary datatype for the entire Document Object Model.
void setTarget(const DOMString &)
see target
StyleSheet sheet() const
Introduced in DOM Level 2 This method is from the LinkStyle interface.
void setSrc(const DOMString &)
see src
bool disabled() const
Enables/disables the style sheet.
void setText(const DOMString &)
see text
DOMString charset() const
The character encoding of the linked resource.
void setHreflang(const DOMString &)
see hreflang
void setDefer(bool)
see defer
void setHtmlFor(const DOMString &)
see htmlFor
DOMString target() const
Frame to render the resource in.
void setCharset(const DOMString &)
see charset
DOMString target() const
The default target frame.
DOMString text() const
The specified title as a string.
DOMString charset() const
The character encoding of the resource being linked to.
void setType(const DOMString &)
see type
void setEvent(const DOMString &)
see event
DOMString media() const
Designed for use with one or more target media.
DOMString src() const
URI designating an external script.
void setType(const DOMString &)
see type
DOMString href() const
The base URI See the href attribute definition in HTML 4.0.
DOMString rel() const
Forward link type.
void setHref(const DOMString &)
see href
StyleSheet sheet() const
Introduced in DOM Level 2 This method is from the LinkStyle interface.
bool defer() const
Indicates that the user agent can defer processing of the script.
bool disabled() const
Enables/disables the link.
This class implements the basic string we use in the DOM.
void setMedia(const DOMString &)
see media
void setRel(const DOMString &)
see rel
void setDisabled(bool)
see disabled
DOMString type() const
Advisory content type.
void setTarget(const DOMString &)
see target
DOMString text() const
The script content of the element.
DOMString hreflang() const
Language code of the linked resource.
The Document Object Model (DOM) is divided into two parts, the COREDOM core DOM, specifying some core...
void setDisabled(bool)
see disabled
DOMString type() const
The style sheet language (Internet media type).
The StyleSheet interface is the abstract base interface for any type of style sheet.
DOMString htmlFor() const
Reserved for future use.
DOMString getAttribute(const DOMString &name)
Retrieves an attribute value by name.
The LINK element specifies a link to an external resource, and defines this document's relationship t...
DOMString media() const
Designed for use with one or more target media.
void setText(const DOMString &)
see text
DOMString event() const
Reserved for future use.
void setCharset(const DOMString &)
see charset
All HTML element interfaces derive from this class.
DOMString href() const
The URI of the linked resource.
DOMString type() const
The content type of the script language.
void setMedia(const DOMString &)
see media
void setHref(const DOMString &)
see href
void setRev(const DOMString &)
see rev