- All Superinterfaces:
CSSNode,Element,ElementCSSInlineStyle,Node
- All Known Implementing Classes:
DOMElement,HTMLElement
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 TypeMethodDescriptionvoidExport 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 theidattribute of this element.getOverrideStyle(String pseudoElt) Gets this element's override style declaration for a pseudo-element.Gets a selector matcher associated to this element.getStyle()The inline style.booleanhasOverrideStyle(String pseudoElt) Check whether this element has an override style declaration for the given pseudo-element.booleanCheck whether this element has non-CSS presentational hints.booleanDoes this element (with the provided pseudo-element, if any) match the provided selector string ?booleanmatches(SelectorList selist, String pseudoElement) Does this element (with the provided pseudo-element, if any) match the provided selector list ?Methods inherited from interface io.sf.carte.doc.style.css.CSSNode
getOwnerDocumentMethods 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, setIdAttributeNSMethods 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 (nullif no pseudo-element).- Returns:
- the computed style declaration.
-
getId
String getId()Gets theidattribute of this element.- Returns:
- the
idattribute, 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, ornullif 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(String)and checking its length.- Parameters:
pseudoElt- the pseudo-element, ornullif none.- Returns:
trueif this element has an override style declaration forpseudoElt.
-
getStyle
ExtendedCSSStyleDeclaration getStyle()The inline style.- Specified by:
getStylein interfaceElementCSSInlineStyle- Returns:
- the inline style specified by the
styleattribute, ornullif 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:
trueif 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, or null if none.- Returns:
trueif the element would be selected by at least one selector in the specified list,falseotherwise.
-
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
widthattribute in HTML). This method can returntrueonly if this specific element do contain such hints, which can be exported to a style declaration by using theexportHintsToStyle(CSSStyleDeclaration)method.- Returns:
trueif 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
-