- All Known Implementing Classes:
CSSStylableElement
,DOMElement
,HTMLElement
,XHTMLElement
Element
interface.-
Field Summary
Fields inherited from interface org.w3c.dom.Node
ATTRIBUTE_NODE, CDATA_SECTION_NODE, COMMENT_NODE, DOCUMENT_FRAGMENT_NODE, DOCUMENT_NODE, DOCUMENT_POSITION_CONTAINED_BY, DOCUMENT_POSITION_CONTAINS, DOCUMENT_POSITION_DISCONNECTED, DOCUMENT_POSITION_FOLLOWING, DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, DOCUMENT_POSITION_PRECEDING, DOCUMENT_TYPE_NODE, ELEMENT_NODE, ENTITY_NODE, ENTITY_REFERENCE_NODE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Export this element's non-CSS presentational hints (if any) to the suppliedCSSStyleDeclaration
.getComputedStyle
(String pseudoElt) Gets the computed style declaration that applies to this element.getId()
Gets theid
attribute of this element.getOverrideStyle
(Condition pseudoElt) Gets this element's override style declaration for a pseudo-element.Gets a selector matcher associated to this element.getStyle()
The inline style.boolean
hasOverrideStyle
(Condition pseudoElt) Check whether this element has an override style declaration for the given pseudo-element.boolean
Check whether this element has non-CSS presentational hints.boolean
matches
(SelectorList selist, Condition pseudoElement) Does this element (with the provided pseudo-element, if any) match the provided selector list ?boolean
Does this element (with the provided pseudo-element, if any) match the provided selector string ?Methods inherited from interface io.sf.carte.doc.style.css.CSSNode
getOwnerDocument
Methods inherited from interface org.w3c.dom.Element
getAttribute, getAttributeNode, getAttributeNodeNS, getAttributeNS, getElementsByTagName, getElementsByTagNameNS, getSchemaTypeInfo, getTagName, hasAttribute, hasAttributeNS, removeAttribute, removeAttributeNode, removeAttributeNS, setAttribute, setAttributeNode, setAttributeNodeNS, setAttributeNS, setIdAttribute, setIdAttributeNode, setIdAttributeNS
Methods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, getBaseURI, getChildNodes, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNodeName, getNodeType, getNodeValue, getParentNode, getPrefix, getPreviousSibling, getTextContent, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, removeChild, replaceChild, setNodeValue, setPrefix, setTextContent, setUserData
-
Method Details
-
getComputedStyle
Gets the computed style declaration that applies to this element.- Parameters:
pseudoElt
- the pseudo-element name (null
if no pseudo-element).- Returns:
- the computed style declaration.
-
getId
String getId()Gets theid
attribute of this element.- Returns:
- the
id
attribute, or the empty string if has no ID.
-
getOverrideStyle
Gets this element's override style declaration for a pseudo-element.The getOverrideStyle method provides a mechanism through which a DOM author could effect immediate change to the style of an element without modifying the explicitly linked style sheets of a document or the inline style of elements.
The override style sheet comes after the author style sheet in the cascade algorithm.
- Parameters:
pseudoElt
- the pseudo-element condition, ornull
if none.- Returns:
- the override style sheet for the given pseudo-element.
-
hasOverrideStyle
Check whether this element has an override style declaration for the given pseudo-element.This method allows checking for override styles without the overhead of producing and retrieving one with
getOverrideStyle(Condition)
and checking its length.- Parameters:
pseudoElt
- the pseudo-element condition, ornull
if none.- Returns:
true
if this element has an override style declaration forpseudoElt
.
-
getStyle
CSSStyleDeclaration getStyle()The inline style.- Returns:
- the inline style specified by the
style
attribute, ornull
if that attribute is not present.
-
matches
Does this element (with the provided pseudo-element, if any) match the provided selector string ?- Parameters:
selectorString
- the selector string.pseudoElement
- the pseudo-element, or null if none.- Returns:
true
if the element would be selected by the specified selector string, false otherwise.- Throws:
DOMException
- SYNTAX_ERR if there was an error parsing the selector string.
-
matches
Does this element (with the provided pseudo-element, if any) match the provided selector list ?- Parameters:
selist
- the selector list.pseudoElement
- the pseudo-element condition, ornull
if none.- Returns:
true
if the element would be selected by at least one selector in the specified list,false
otherwise.
-
getSelectorMatcher
SelectorMatcher getSelectorMatcher()Gets a selector matcher associated to this element.- Returns:
- a selector matcher associated to this element.
-
hasPresentationalHints
boolean hasPresentationalHints()Check whether this element has non-CSS presentational hints.A document may contain non-CSS presentational hints (like the
width
attribute in HTML). This method can returntrue
only if this specific element do contain such hints, which can be exported to a style declaration by using theexportHintsToStyle(CSSStyleDeclaration)
method.- Returns:
true
if this element has presentational hints.
-
exportHintsToStyle
Export this element's non-CSS presentational hints (if any) to the suppliedCSSStyleDeclaration
.- Parameters:
style
- the style declaration to export to.- Throws:
DOMException
-