Class HTMLDocumentImpl
java.lang.Object
org.loboevolution.js.AbstractScriptableDelegate
org.loboevolution.html.dom.nodeimpl.event.EventTargetImpl
org.loboevolution.html.dom.nodeimpl.NodeImpl
org.loboevolution.html.dom.nodeimpl.DocumentImpl
org.loboevolution.html.dom.domimpl.HTMLDocumentImpl
- All Implemented Interfaces:
Cloneable,EventTarget,HTMLDocument,Document,ModelNode,Node,NonElementParentNode,ParentNode,DocumentRange,XPathEvaluator,ScriptableDelegate,DocumentTraversal,DocumentView
Implementation of the W3C HTMLDocument interface.
-
Field Summary
Fields inherited from class org.loboevolution.html.dom.nodeimpl.DocumentImpl
readerFields inherited from class org.loboevolution.html.dom.nodeimpl.NodeImpl
document, nodeList, notificationsSuspended, parentNode, uiNodeFields inherited from interface org.loboevolution.html.node.Document
HTML_NAMESPACE_URI, NAMESPACE_SVG, XML_NAMESPACE_URI, XMLNS_NAMESPACE_URIFields inherited from interface org.loboevolution.html.node.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, NONE, NOTATION_NODE, PROCESSING_INSTRUCTION_NODE, TEXT_NODE -
Constructor Summary
ConstructorsConstructorDescriptionHTMLDocumentImpl(HtmlRendererContext rcontext) Constructor for HTMLDocumentImpl.HTMLDocumentImpl(UserAgentContext ucontext) Constructor for HTMLDocumentImpl.HTMLDocumentImpl(UserAgentContext ucontext, HtmlRendererContext rcontext, HtmlRendererConfig config, WritableLineReader reader, String documentURI) Constructor for HTMLDocumentImpl. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a document notification listener, which is informed about changes to the document.voidInforms listeners that the whole document has been invalidated.voidallInvalidated(boolean forgetRenderStates) allInvalidated.protected RenderStatecreateRenderState(RenderState prevRenderState) createRenderState.voidexternalScriptLoading.Returns node's node document's document base URL.getBody()Specifies the beginning and end of the document body.Returns document's encoding.Gets or sets the character set used to encode the object.Returns the HTTP cookies that apply to the Document.getDocumentURL.final URLgetFullURL(String uri) getFullURL.final URLgetFullURL(String relativeUrl, String baseURI) getFullURL.getHead()Returns the head element.final HtmlRendererContextgetHtmlRendererContext.Returns the character encoding used to create the webpage that is loaded into the document object.final StyleSheetAggregatorGetter for the field styleSheets.getTextContent.getURL()Sets or gets the URL for the current document.getUserAgentContext.voidinvalidated(NodeImpl node) This is called when the node has changed, but it is unclear if it's a size change or a look change.voidload()Loads the document from the reader provided when the current instance of HTMLDocumentImpl was constructed.voidlookInvalidated(NodeImpl node) Called if something such as a color or decoration has changed.namedItem.voidnodeLoaded(NodeImpl node) nodeLoaded.voidnormalizeDocument.voidChanged if the position of the node in a parent has changed.voidremoveDocumentNotificationListener.voidremoveNamedItem(String name) voidsetBody(HTMLElement body) setBody.voidsetCookie.voidsetElementById(String id, Element element) Caller should synchronize on document.voidsetNamedItem(String name, Element element) voidsetTextContent(String textContent) setTextContent.setUserData(String key, Object data, UserDataHandler handler) setUserData.voidsizeInvalidated(NodeImpl node) sizeInvalidated.voidstructureInvalidated(NodeImpl node) This is called when children of the node might have changed.Methods inherited from class org.loboevolution.html.dom.nodeimpl.DocumentImpl
adoptNode, caretRangeFromPoint, clear, close, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createElementNS, createEntityReference, createEvent, createExpression, createExpression, createNodeIterator, createNodeIterator, createNodeIterator, createNodeIterator, createNSResolver, createProcessingInstruction, createRange, createTextNode, createTreeWalker, createTreeWalker, createTreeWalker, createTreeWalker, elementFromPoint, evaluate, execCommand, execCommand, execCommand, getActiveElement, getall, getAnchors, getApplets, getBgColor, getChildElementCount, getCommands, getCompatMode, getContentType, getCurrentScript, getDefaultView, getDesignMode, getDir, getDoctype, getDocumentElement, getDocumentURI, getDomain, getDomConfig, getElementById, getElementsByClassName, getElementsByName, getElementsByTagName, getElementsByTagNameNS, getEmbeds, getFgColor, getFirstElementChild, getForms, getImages, getImplementation, getLastElementChild, getLastModified, getLinks, getLocalName, getLocation, getNodeName, getNodeType, getNodeValue, getOrigin, getPlugins, getReadyState, getScripts, getScrollingElement, getSelection, getStrictErrorChecking, getTitle, getVisibilityState, getXmlEncoding, getXmlStandalone, getXmlVersion, hasAttributes, hasFocus, importNode, isFullscreen, isFullscreenEnabled, isHidden, isXml, open, open, open, open, open, queryCommandEnabled, queryCommandIndeterm, queryCommandState, queryCommandSupported, queryCommandValue, querySelector, querySelectorAll, releaseEvents, removeAllChildrenImpl, renameNode, setBgColor, setDesignMode, setDir, setDoctype, setDocumentURI, setDomain, setFgColor, setLocation, setNodeValue, setStrictErrorChecking, setTitle, setWindow, setXml, setXmlStandalone, setXmlVersion, write, writelnMethods inherited from class org.loboevolution.html.dom.nodeimpl.NodeImpl
appendChild, appendChildrenToCollectionImpl, appendInnerHTMLImpl, appendInnerTextImpl, clone, cloneNode, cloneNode, compareDocumentPosition, contains, extractDescendentsArrayImpl, findUINode, forgetRenderState, getATTRIBUTE_NODE, getAttributes, getCDATA_SECTION_NODE, getChildIndex, getChildNodes, getChildren, getCOMMENT_NODE, getDescendents, getDOCUMENT_FRAGMENT_NODE, getDOCUMENT_NODE, getDOCUMENT_POSITION_CONTAINED_BY, getDOCUMENT_POSITION_CONTAINS, getDOCUMENT_POSITION_DISCONNECTED, getDOCUMENT_POSITION_FOLLOWING, getDOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC, getDOCUMENT_POSITION_PRECEDING, getDOCUMENT_TYPE_NODE, getDocumentItem, getDocumentNode, getELEMENT_NODE, getENTITY_NODE, getENTITY_REFERENCE_NODE, getFeature, getFirstChild, getFirstChildByFilter, getHtmlRendererConfig, getLastChild, getNamespaceURI, getNextElementSibling, getNextSibling, getNextTo, getNodeList, getNONE, getNOTATION_NODE, getOwnerDocument, getParentElement, getParentModelNode, getParentNode, getParentRenderState, getPrefix, getPreviousElementSibling, getPreviousSibling, getPreviousTo, getPROCESSING_INSTRUCTION_NODE, getRenderState, getRootNode, getTEXT_NODE, getUINode, getUserData, hasChildNodes, htmlEncodeChildText, informInvalid, informLayoutInvalid, informLookInvalid, informNodeLoaded, informPositionInvalid, informSizeInvalid, informStructureInvalid, insertAfter, insertAt, insertBefore, isDefaultNamespace, isEqualNode, isEqualOrDescendentOf, isIsConnected, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, prepend, prependChild, removeChild, removeChildAt, removeChildrenImpl, removeTableChildren, replaceAdjacentTextNodes, replaceChild, setDocumentItem, setOwnerDocument, setOwnerDocument, setParentImpl, setPrefix, setUINode, toString, visit, visitImpl, warn, warnMethods inherited from class org.loboevolution.html.dom.nodeimpl.event.EventTargetImpl
addEventListener, addEventListener, dispatchEvent, dispatchEvent, getFunction, removeEventListener, removeEventListenerMethods inherited from class org.loboevolution.js.AbstractScriptableDelegate
getScriptable, setScriptableMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.loboevolution.html.node.Document
adoptNode, caretRangeFromPoint, clear, close, createAttribute, createAttributeNS, createCDATASection, createComment, createDocumentFragment, createElement, createElementNS, createElementNS, createEntityReference, createEvent, createExpression, createNSResolver, createProcessingInstruction, createTextNode, elementFromPoint, evaluate, execCommand, execCommand, execCommand, getActiveElement, getall, getAnchors, getApplets, getBgColor, getCommands, getCompatMode, getContentType, getCurrentScript, getDefaultView, getDesignMode, getDir, getDoctype, getDocumentElement, getDocumentURI, getDomain, getDomConfig, getElementById, getElementsByClassName, getElementsByName, getElementsByTagName, getElementsByTagNameNS, getEmbeds, getFgColor, getForms, getImages, getImplementation, getLastModified, getLinks, getLocation, getOrigin, getPlugins, getReadyState, getReferrer, getScripts, getScrollingElement, getSelection, getStrictErrorChecking, getTitle, getVisibilityState, getXmlEncoding, getXmlStandalone, getXmlVersion, hasFocus, importNode, isFullscreen, isFullscreenEnabled, isHidden, isXml, open, open, open, open, open, queryCommandEnabled, queryCommandIndeterm, queryCommandState, queryCommandSupported, queryCommandValue, releaseEvents, renameNode, setBgColor, setDesignMode, setDir, setDocumentURI, setDomain, setFgColor, setLocation, setStrictErrorChecking, setTitle, setXml, setXmlStandalone, setXmlVersion, write, writelnMethods inherited from interface org.loboevolution.html.node.ranges.DocumentRange
createRangeMethods inherited from interface org.loboevolution.traversal.DocumentTraversal
createNodeIterator, createNodeIterator, createNodeIterator, createNodeIterator, createTreeWalker, createTreeWalker, createTreeWalker, createTreeWalkerMethods inherited from interface org.loboevolution.views.DocumentView
getDefaultViewMethods inherited from interface org.loboevolution.events.EventTarget
addEventListener, addEventListener, dispatchEvent, dispatchEvent, removeEventListener, removeEventListenerMethods inherited from interface org.loboevolution.html.node.ModelNode
getDocumentItem, getParentModelNode, getRenderState, isEqualOrDescendentOf, setDocumentItem, warnMethods inherited from interface org.loboevolution.html.node.Node
appendChild, appendChildrenToCollectionImpl, cloneNode, cloneNode, compareDocumentPosition, contains, extractDescendentsArrayImpl, findUINode, forgetRenderState, getAttributes, getChildNodes, getDocumentNode, getFeature, getFirstChild, getLastChild, getLocalName, getNamespaceURI, getNextSibling, getNextTo, getNodeName, getNodeType, getNodeValue, getOwnerDocument, getParentElement, getParentNode, getPrefix, getPreviousSibling, getPreviousTo, getRootNode, getUserData, hasAttributes, hasChildNodes, insertBefore, isDefaultNamespace, isEqualNode, isIsConnected, isSameNode, isSupported, lookupNamespaceURI, lookupPrefix, normalize, prepend, prependChild, removeChild, replaceChild, setNamespaceURI, setNodeValue, setOwnerDocument, setOwnerDocument, setParentImpl, setPrefix, visitMethods inherited from interface org.loboevolution.html.node.ParentNode
getChildElementCount, getChildren, getFirstElementChild, getLastElementChild, querySelector, querySelectorAll
-
Constructor Details
-
HTMLDocumentImpl
Constructor for HTMLDocumentImpl.
- Parameters:
rcontext- aHtmlRendererContextobject.
-
HTMLDocumentImpl
Constructor for HTMLDocumentImpl.
- Parameters:
ucontext- aUserAgentContextobject.
-
HTMLDocumentImpl
public HTMLDocumentImpl(UserAgentContext ucontext, HtmlRendererContext rcontext, HtmlRendererConfig config, WritableLineReader reader, String documentURI) Constructor for HTMLDocumentImpl.
- Parameters:
ucontext- aUserAgentContextobject.rcontext- aHtmlRendererContextobject.config- aHtmlRendererConfigobject.reader- aWritableLineReaderobject.documentURI- aStringobject.
-
-
Method Details
-
addDocumentNotificationListener
Adds a document notification listener, which is informed about changes to the document.- Parameters:
listener- An instance ofDocumentNotificationListener.
-
allInvalidated
public void allInvalidated()Informs listeners that the whole document has been invalidated. -
allInvalidated
public void allInvalidated(boolean forgetRenderStates) allInvalidated.
- Parameters:
forgetRenderStates- a boolean.
-
createRenderState
createRenderState.
- Overrides:
createRenderStatein classNodeImpl- Parameters:
prevRenderState- aRenderStateobject.- Returns:
- a
RenderStateobject.
-
externalScriptLoading
externalScriptLoading.
- Parameters:
node- aNodeImplobject.
-
getBaseURI
Returns node's node document's document base URL.- Specified by:
getBaseURIin interfaceNode- Overrides:
getBaseURIin classDocumentImpl- Returns:
- a
Stringobject.
-
getCookie
Returns the HTTP cookies that apply to the Document. If there are no cookies or cookies can't be applied to this resource, the empty string will be returned.Can be set, to add a new cookie to the element's set of HTTP cookies.
If the contents are sandboxed into a unique origin (e.g. in an iframe with the sandbox attribute), a "SecurityError" DOMException will be thrown on getting and setting.
- Specified by:
getCookiein interfaceDocument- Overrides:
getCookiein classDocumentImpl- Returns:
- a
Stringobject.
-
getDocumentURL
getDocumentURL.
- Overrides:
getDocumentURLin classNodeImpl- Returns:
- a
URLobject.
-
getFullURL
getFullURL.
- Specified by:
getFullURLin interfaceModelNode- Overrides:
getFullURLin classNodeImpl- Parameters:
uri- aStringobject.- Returns:
- a
URLobject.
-
getFullURL
getFullURL.
-
getHtmlRendererContext
getHtmlRendererContext.
- Overrides:
getHtmlRendererContextin classNodeImpl- Returns:
- a
HtmlRendererContextobject.
-
getInputEncoding
Returns the character encoding used to create the webpage that is loaded into the document object.- Specified by:
getInputEncodingin interfaceDocument- Overrides:
getInputEncodingin classDocumentImpl- Returns:
- a
Stringobject.
-
getCharacterSet
Returns document's encoding.- Specified by:
getCharacterSetin interfaceDocument- Overrides:
getCharacterSetin classDocumentImpl- Returns:
- a
Stringobject.
-
getCharset
Gets or sets the character set used to encode the object.- Specified by:
getCharsetin interfaceDocument- Overrides:
getCharsetin classDocumentImpl- Returns:
- a
Stringobject.
-
getHead
Returns the head element.- Specified by:
getHeadin interfaceDocument- Overrides:
getHeadin classDocumentImpl- Returns:
- a
HTMLHeadElementobject.
-
getBody
Specifies the beginning and end of the document body.- Specified by:
getBodyin interfaceDocument- Overrides:
getBodyin classDocumentImpl- Returns:
- a
HTMLElementobject.
-
getStyleSheetAggregator
-
getStyleSheets
Getter for the field styleSheets.
- Returns:
- a
StyleSheetListobject.
-
getTextContent
getTextContent.
Gets the text content of this node and its descendents.- Specified by:
getTextContentin interfaceNode- Overrides:
getTextContentin classNodeImpl- Returns:
- a
Stringobject.
-
getURL
Sets or gets the URL for the current document.- Specified by:
getURLin interfaceDocument- Overrides:
getURLin classDocumentImpl- Returns:
- a
Stringobject.
-
getUserAgentContext
getUserAgentContext.
- Overrides:
getUserAgentContextin classNodeImpl- Returns:
- a
UserAgentContextobject.
-
invalidated
This is called when the node has changed, but it is unclear if it's a size change or a look change. An attribute change should trigger this.- Parameters:
node- aNodeImplobject.
-
load
Loads the document from the reader provided when the current instance of HTMLDocumentImpl was constructed.- Throws:
IOException- if any.SAXException- if any.UnsupportedEncodingException- if any.
-
lookInvalidated
Called if something such as a color or decoration has changed. This would be something which does not affect the rendered size, and can be revalidated with a simple repaint.- Parameters:
node- aNodeImplobject.
-
namedItem
namedItem.
-
nodeLoaded
nodeLoaded.
- Parameters:
node- aNodeImplobject.
-
normalizeDocument
public void normalizeDocument()normalizeDocument.
- Specified by:
normalizeDocumentin interfaceDocument- Overrides:
normalizeDocumentin classDocumentImpl
-
positionInParentInvalidated
Changed if the position of the node in a parent has changed.- Parameters:
node- aNodeImplobject.
-
removeDocumentNotificationListener
removeDocumentNotificationListener.
- Parameters:
listener- aDocumentNotificationListenerobject.
-
removeNamedItem
-
setBody
setBody.
- Specified by:
setBodyin interfaceDocument- Overrides:
setBodyin classDocumentImpl- Parameters:
body- aHTMLElementobject.
-
setCookie
setCookie.
- Specified by:
setCookiein interfaceDocument- Overrides:
setCookiein classDocumentImpl- Parameters:
cookie- aStringobject.
-
setElementById
Caller should synchronize on document. -
setNamedItem
-
setTextContent
setTextContent.
- Specified by:
setTextContentin interfaceNode- Overrides:
setTextContentin classNodeImpl- Parameters:
textContent- aStringobject.
-
setUserData
setUserData.
- Specified by:
setUserDatain interfaceNode- Overrides:
setUserDatain classNodeImpl- Parameters:
key- aStringobject.data- aObjectobject.handler- aUserDataHandlerobject.- Returns:
- a
Objectobject.
-
sizeInvalidated
sizeInvalidated.
- Parameters:
node- aNodeImplobject.
-
structureInvalidated
This is called when children of the node might have changed.- Parameters:
node- aNodeImplobject.
-