- All Implemented Interfaces:
CSSDocument,CSSNode,DocumentCSS,Document,Node,DocumentStyle
CSS-enabled wrapper for a DOM Document.
-
Nested Class Summary
Nested classes/interfaces inherited from interface io.sf.carte.doc.style.css.CSSDocument
CSSDocument.ComplianceMode -
Field Summary
FieldsFields 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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionappendChild(Node newChild) cloneNode(boolean deep) shortcompareDocumentPosition(Node other) createAttribute(String name) createAttributeNS(String namespaceURI, String qualifiedName) createCDATASection(String data) createComment(String data) createElement(String tagName) Creates an element of the type specified.createElementNS(String namespaceURI, String qualifiedName) createEntityReference(String name) createProcessingInstruction(String target, String data) createTextNode(String data) voidEnables a style sheet set.Gets the base URL of this Document.Gets the document's canvas for the current target medium.Get the compliance mode of this document.protected CSSNodegetCSSNode(Node node) Get the child node which is the document element of this document.getElementById(String elementId) getElementsByTagName(String tagname) getElementsByTagNameNS(String namespaceURI, String localName) Gets the document-level error handler.getFeature(String feature, String version) Gets the style sheet set that was last selected.protected CSSNodegetMappedCSSNode(Node node) shortgetOverrideStyle(Element elt, String pseudoElt) Gets the override style sheet for an element and pseudo-element.Get the referrer policy obtained through the 'Referrer-Policy' header or a meta element.Gets the title of the currently selected style sheet set.booleanGets the style database currently used to apply specific styles to this document.Gets the merged style sheet that applies to this document, resulting from the merge of the document's default style sheet, the document linked or embedded style sheets, and the non-important part of the user style sheet.protected abstract DOMCSSStyleSheetFactoryA list containing all the style sheets explicitly linked into or embedded in a document.Gets the list of available alternate styles.This document's current target medium name.Gets an URL for the given URI, taking into account the Base URL if appropriate.getUserData(String key) booleanbooleanbooleanbooleanHas any of the linked or embedded style sheets any error or warning ?importNode(Node importedNode, boolean deep) insertBefore(Node newChild, Node refChild) booleanisAuthorizedOrigin(URL url) Determine whether the retrieval of the given URL is authorized.booleanisDefaultNamespace(String namespaceURI) booleanisEqualNode(Node arg) booleanisSafeOrigin(URL linkedURL) Is the provided URL a safe origin to load certain external resources?booleanisSameNode(Node other) booleanisSupported(String feature, String version) booleanisVisitedURI(String href) Has this URI been visited by the agent ?lookupNamespaceURI(String prefix) lookupPrefix(String namespaceURI) voidvoidremoveChild(Node oldChild) renameNode(Node n, String namespaceURI, String qualifiedName) replaceChild(Node newChild, Node oldChild) voidsetDocumentURI(String documentURI) abstract voidsetLoadingTime(long time) Set the time at which this document was loaded from origin.voidsetNodeValue(String nodeValue) voidprotected voidsetReferrerPolicyHeader(String policy) voidSelects a style sheet set, disabling the other non-persistent sheet sets.voidsetStrictErrorChecking(boolean strictErrorChecking) voidsetTargetMedium(String medium) Set the medium that will be used to compute the styles of this document.voidsetTextContent(String textContent) setUserData(String key, Object data, UserDataHandler handler) voidsetXmlStandalone(boolean xmlStandalone) voidsetXmlVersion(String xmlVersion) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.sf.carte.doc.style.css.CSSDocument
openConnectionMethods inherited from interface org.w3c.dom.Node
appendChild, cloneNode, compareDocumentPosition, getAttributes, 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
-
Field Details
-
rawnode
-
-
Constructor Details
-
StylableDocumentWrapper
-
-
Method Details
-
getStyleSheetFactory
-
getComplianceMode
Description copied from interface:CSSDocumentGet the compliance mode of this document.The styling in this document operate under a compliance mode. Two modes are supported:
STRICTandQUIRKS.QUIRKSandSTRICTdiffer in the matching of class and ID selectors, and the default user agent sheet is slightly different.- Specified by:
getComplianceModein interfaceCSSDocument- Returns:
- the compliance mode.
-
getOwnerDocument
Description copied from interface:CSSNode- Specified by:
getOwnerDocumentin interfaceCSSNode- Specified by:
getOwnerDocumentin interfaceNode
-
getMappedCSSNode
-
getCSSNode
-
getDoctype
- Specified by:
getDoctypein interfaceDocument
-
getImplementation
- Specified by:
getImplementationin interfaceDocument
-
isVisitedURI
Description copied from interface:CSSDocumentHas this URI been visited by the agent ?- Specified by:
isVisitedURIin interfaceCSSDocument- Parameters:
href- the URI.- Returns:
trueif visited,falseif not visited or the agent does not support history.
-
setLoadingTime
public abstract void setLoadingTime(long time) Set the time at which this document was loaded from origin.- Parameters:
time- the time of loading, in milliseconds.
-
getDocumentElement
Description copied from interface:CSSDocumentGet the child node which is the document element of this document.- Specified by:
getDocumentElementin interfaceCSSDocument- Specified by:
getDocumentElementin interfaceDocument- Returns:
- the document element.
-
createElement
Description copied from interface:CSSDocumentCreates an element of the type specified.The presence of
IMPLIEDattributes is implementation-dependent.- Specified by:
createElementin interfaceCSSDocument- Specified by:
createElementin interfaceDocument- Parameters:
tagName- the tag name of the element to create.- Returns:
- the new
CSSElement. - Throws:
DOMException- INVALID_CHARACTER_ERR if the name is not an XML valid name.
-
createDocumentFragment
- Specified by:
createDocumentFragmentin interfaceDocument
-
createTextNode
- Specified by:
createTextNodein interfaceDocument
-
createComment
- Specified by:
createCommentin interfaceDocument
-
createCDATASection
- Specified by:
createCDATASectionin interfaceDocument- Throws:
DOMException
-
createProcessingInstruction
public ProcessingInstruction createProcessingInstruction(String target, String data) throws DOMException - Specified by:
createProcessingInstructionin interfaceDocument- Throws:
DOMException
-
createAttribute
- Specified by:
createAttributein interfaceDocument- Throws:
DOMException
-
createEntityReference
- Specified by:
createEntityReferencein interfaceDocument- Throws:
DOMException
-
importNode
- Specified by:
importNodein interfaceDocument- Throws:
DOMException
-
createElementNS
Description copied from interface:CSSDocument- Specified by:
createElementNSin interfaceCSSDocument- Specified by:
createElementNSin interfaceDocument- Throws:
DOMException
-
createAttributeNS
- Specified by:
createAttributeNSin interfaceDocument- Throws:
DOMException
-
getElementsByTagName
- Specified by:
getElementsByTagNamein interfaceDocument
-
getElementsByTagNameNS
- Specified by:
getElementsByTagNameNSin interfaceDocument
-
getElementById
Description copied from interface:CSSDocument- Specified by:
getElementByIdin interfaceCSSDocument- Specified by:
getElementByIdin interfaceDocument
-
getInputEncoding
- Specified by:
getInputEncodingin interfaceDocument
-
getXmlEncoding
- Specified by:
getXmlEncodingin interfaceDocument
-
getXmlStandalone
public boolean getXmlStandalone()- Specified by:
getXmlStandalonein interfaceDocument
-
setXmlStandalone
- Specified by:
setXmlStandalonein interfaceDocument- Throws:
DOMException
-
getXmlVersion
- Specified by:
getXmlVersionin interfaceDocument
-
setXmlVersion
- Specified by:
setXmlVersionin interfaceDocument- Throws:
DOMException
-
getStrictErrorChecking
public boolean getStrictErrorChecking()- Specified by:
getStrictErrorCheckingin interfaceDocument
-
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking) - Specified by:
setStrictErrorCheckingin interfaceDocument
-
getDocumentURI
- Specified by:
getDocumentURIin interfaceDocument
-
setDocumentURI
- Specified by:
setDocumentURIin interfaceDocument
-
adoptNode
- Specified by:
adoptNodein interfaceDocument- Throws:
DOMException
-
getDomConfig
- Specified by:
getDomConfigin interfaceDocument
-
normalizeDocument
public void normalizeDocument()- Specified by:
normalizeDocumentin interfaceDocument
-
renameNode
- Specified by:
renameNodein interfaceDocument- Throws:
DOMException
-
getStyleSheets
A list containing all the style sheets explicitly linked into or embedded in a document. For HTML documents, this includes external style sheets, included via the HTML LINK element, and inline STYLE elements. In XML, this includes external style sheets, included via style sheet processing instructions (see [XML StyleSheet]).- Specified by:
getStyleSheetsin interfaceCSSDocument- Specified by:
getStyleSheetsin interfaceDocumentStyle
-
getStyleSheet
Gets the merged style sheet that applies to this document, resulting from the merge of the document's default style sheet, the document linked or embedded style sheets, and the non-important part of the user style sheet. Does not include overriden styles nor the 'important' part of the user-defined style sheet.The style sheet is lazily built.
- Specified by:
getStyleSheetin interfaceCSSDocument- Returns:
- the merged style sheet that applies to this document.
-
getStyleSheetSets
Gets the list of available alternate styles.- Specified by:
getStyleSheetSetsin interfaceCSSDocument- Returns:
- the list of available alternate style titles.
-
getSelectedStyleSheetSet
Gets the title of the currently selected style sheet set.- Specified by:
getSelectedStyleSheetSetin interfaceCSSDocument- Returns:
- the title of the currently selected style sheet, the empty string
if none is selected, or
nullif there are style sheets from different style sheet sets that have their style sheet disabled flag unset.
-
setSelectedStyleSheetSet
Selects a style sheet set, disabling the other non-persistent sheet sets. If the name is the empty string, all non-persistent sheets will be disabled. Otherwise, if the name does not match any of the sets, does nothing.- Specified by:
setSelectedStyleSheetSetin interfaceCSSDocument- Parameters:
name- the case-sensitive name of the set to select.
-
getLastStyleSheetSet
Gets the style sheet set that was last selected.- Specified by:
getLastStyleSheetSetin interfaceCSSDocument- Returns:
- the last selected style sheet set, or
nullif none.
-
enableStyleSheetsForSet
Enables a style sheet set. If the name does not match any of the sets, does nothing.- Specified by:
enableStyleSheetsForSetin interfaceCSSDocument- Parameters:
name- the case-sensitive name of the set to enable.
-
getOverrideStyle
Gets the override style sheet for an element and 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 in the style sheets.
The override style sheet comes after the author style sheet in the cascade algorithm. DOM Level 2.
- Specified by:
getOverrideStylein interfaceCSSDocument- Specified by:
getOverrideStylein interfaceDocumentCSS- Parameters:
elt- the element.pseudoElt- the pseudo-element, or null if none.- Returns:
- the override style sheet for the given element and pseudo-element.
-
getStyleDatabase
Gets the style database currently used to apply specific styles to this document.- Specified by:
getStyleDatabasein interfaceCSSDocument- Returns:
- the style database, or null if no style database has been selected.
-
getTargetMedium
This document's current target medium name.- Specified by:
getTargetMediumin interfaceCSSDocument- Returns:
- the target medium name of this document.
-
setTargetMedium
Set the medium that will be used to compute the styles of this document.- Specified by:
setTargetMediumin interfaceCSSDocument- Parameters:
medium- the name of the target medium, like 'screen' or 'print'.- Throws:
CSSMediaException- if the document is unable to target the given medium.
-
getCanvas
Gets the document's canvas for the current target medium.- Specified by:
getCanvasin interfaceCSSDocument- Returns:
- the canvas, or null if no target medium has been set, or the DeviceFactory does not support canvas for the target medium.
-
getErrorHandler
Description copied from interface:CSSDocumentGets the document-level error handler.- Specified by:
getErrorHandlerin interfaceCSSDocument- Returns:
- the error handler.
-
hasStyleIssues
public boolean hasStyleIssues()Has any of the linked or embedded style sheets any error or warning ?- Specified by:
hasStyleIssuesin interfaceCSSDocument- Returns:
trueif any of the linked or embedded style sheets has any SAC or rule error or warning,falseotherwise.
-
getBaseURL
Gets the base URL of this Document.If the Document's
headelement has abasechild element, the base URI is computed using the value of the href attribute of thebaseelement. Otherwise, it is taken from the value of thegetDocumentURImethod.- Specified by:
getBaseURLin interfaceCSSDocument- Returns:
- the base URL, or null if no base URL could be determined.
-
getBaseURI
- Specified by:
getBaseURIin interfaceNode
-
getURL
Gets an URL for the given URI, taking into account the Base URL if appropriate.- Specified by:
getURLin interfaceCSSDocument- Parameters:
uri- the uri.- Returns:
- the absolute URL.
- Throws:
MalformedURLException- if the uri was wrong.
-
isSafeOrigin
Is the provided URL a safe origin to load certain external resources?- Specified by:
isSafeOriginin interfaceCSSDocument- Parameters:
linkedURL- the URL of the external resource.- Returns:
trueif is a safe origin,falseotherwise.
-
isAuthorizedOrigin
Determine whether the retrieval of the given URL is authorized.If the URL's protocol is not
httpnorhttpsand document's base URL's scheme is neitherfilenorjar, it is denied.- Specified by:
isAuthorizedOriginin interfaceCSSDocument- Parameters:
url- the URL to check.- Returns:
trueif allowed.
-
getReferrerPolicy
Get the referrer policy obtained through the 'Referrer-Policy' header or a meta element.- Specified by:
getReferrerPolicyin interfaceCSSDocument- Returns:
- the referrer policy, or the empty string if none was specified.
-
setReferrerPolicyHeader
-
getNodeName
- Specified by:
getNodeNamein interfaceNode
-
getNodeValue
- Specified by:
getNodeValuein interfaceNode- Throws:
DOMException
-
setNodeValue
- Specified by:
setNodeValuein interfaceNode- Throws:
DOMException
-
getNodeType
public short getNodeType()- Specified by:
getNodeTypein interfaceNode
-
getParentNode
- Specified by:
getParentNodein interfaceNode
-
getChildNodes
- Specified by:
getChildNodesin interfaceNode
-
getFirstChild
- Specified by:
getFirstChildin interfaceNode
-
getLastChild
- Specified by:
getLastChildin interfaceNode
-
getPreviousSibling
- Specified by:
getPreviousSiblingin interfaceNode
-
getNextSibling
- Specified by:
getNextSiblingin interfaceNode
-
getAttributes
- Specified by:
getAttributesin interfaceNode
-
insertBefore
- Specified by:
insertBeforein interfaceNode- Throws:
DOMException
-
replaceChild
- Specified by:
replaceChildin interfaceNode- Throws:
DOMException
-
removeChild
- Specified by:
removeChildin interfaceNode- Throws:
DOMException
-
appendChild
- Specified by:
appendChildin interfaceNode- Throws:
DOMException
-
hasChildNodes
public boolean hasChildNodes()- Specified by:
hasChildNodesin interfaceNode
-
cloneNode
-
normalize
public void normalize() -
isSupported
- Specified by:
isSupportedin interfaceNode
-
getNamespaceURI
- Specified by:
getNamespaceURIin interfaceNode
-
getPrefix
-
setPrefix
- Specified by:
setPrefixin interfaceNode- Throws:
DOMException
-
getLocalName
- Specified by:
getLocalNamein interfaceNode
-
hasAttributes
public boolean hasAttributes()- Specified by:
hasAttributesin interfaceNode
-
compareDocumentPosition
- Specified by:
compareDocumentPositionin interfaceNode- Throws:
DOMException
-
getTextContent
- Specified by:
getTextContentin interfaceNode- Throws:
DOMException
-
setTextContent
- Specified by:
setTextContentin interfaceNode- Throws:
DOMException
-
isSameNode
- Specified by:
isSameNodein interfaceNode
-
lookupPrefix
- Specified by:
lookupPrefixin interfaceNode
-
isDefaultNamespace
- Specified by:
isDefaultNamespacein interfaceNode
-
lookupNamespaceURI
- Specified by:
lookupNamespaceURIin interfaceNode
-
isEqualNode
- Specified by:
isEqualNodein interfaceNode
-
getFeature
- Specified by:
getFeaturein interfaceNode
-
setUserData
- Specified by:
setUserDatain interfaceNode
-
getUserData
- Specified by:
getUserDatain interfaceNode
-