java.lang.Object
io.sf.carte.doc.style.css.om.AbstractCSSStyleSheetFactory
io.sf.carte.doc.style.css.om.BaseCSSStyleSheetFactory
io.sf.carte.doc.dom.CSSDOMImplementation
- All Implemented Interfaces:
CSSStyleSheetFactory
,Serializable
,DOMImplementation
CSS-enabled DOM implementation.
- See Also:
-
Field Summary
Fields inherited from class io.sf.carte.doc.style.css.om.AbstractCSSStyleSheetFactory
STRING_DOUBLE_QUOTE, STRING_SINGLE_QUOTE
Fields inherited from interface io.sf.carte.doc.style.css.CSSStyleSheetFactory
FLAG_STRING_DOUBLE_QUOTE, FLAG_STRING_SINGLE_QUOTE, ORIGIN_AUTHOR, ORIGIN_USER, ORIGIN_USER_AGENT, ORIGIN_USER_IMPORTANT
-
Constructor Summary
ConstructorDescriptionConstructs a CSSDOMImplementation that uses a standard (no flags) CSS parser.CSSDOMImplementation
(EnumSet<Parser.Flag> parserFlags) Constructs a CSSDOMImplementation where the given flags will be applied when parsing CSS. -
Method Summary
Modifier and TypeMethodDescriptionCreate a style declaration for an anonymous inline box, associated to a text/cdata node.createDocument
(String namespaceURI, String qualifiedName, DocumentType doctype) protected BaseDocumentCSSStyleSheet
createDocumentStyleSheet
(byte origin) Creates a Document CSS style sheet for all media.createDocumentType
(String qualifiedName, String publicId, String systemId) protected HTMLDocument
createHTMLDocument
(DocumentType doctype) protected InlineStyle
createInlineStyle
(Node owner) Create an inline style.protected BaseCSSStyleSheet
createLinkedStyleSheet
(Node ownerNode, String title, MediaQueryList mediaList) Creates an author (document-linked) CSS style sheet.protected BaseCSSStyleSheet
createRuleStyleSheet
(AbstractCSSRule ownerRule, String title, MediaQueryList mediaList) Creates a CSS style sheet owned by a CSS rule.protected DOMDocument
createXMLDocument
(DocumentType doctype) protected BaseDocumentCSSStyleSheet
Get the style sheet resulting from the merge of the user agent sheet and the non-important part of the user style sheet.getFeature
(String feature, String version) Deprecated.protected boolean
Gets the User Agent default CSS style sheet to be used by this factory in the given mode.boolean
hasFeature
(String feature, String version) This method is not supported.Creates an empty, plain XML document with no HTML capabilities.Creates an HTML-specific DOM Document with an html element and DOCTYPE.void
Sets a default HTML default style sheet as the user agent style sheet.void
setStrictErrorChecking
(boolean strictErrorChecking) Set thestrictErrorChecking
flag on the documents created by this implementation.Methods inherited from class io.sf.carte.doc.style.css.om.BaseCSSStyleSheetFactory
createDefaultStyleFormattingFactory, createImmutableMediaQueryList, createInlineStyleErrorHandler, createMediaQueryList, createPropertyDefinition, createSACParser, createSheetErrorHandler, createStyleDeclarationErrorHandler, createStyleSheet, getDeviceFactory, getParserFlags, getStyleFormattingFactory, getSystemDefaultValue, getUserImportantStyleSheet, getUserNormalStyleSheet, getValueFactory, hasCompatValueFlags, hasFactoryFlag, htmlDefaultSheet, htmlQuirksDefaultSheet, setClassLoader, setDeviceFactory, setFactoryFlag, setLenientSystemValues, setStyleFormattingFactory, setUserStyleSheet, setUserStyleSheet
-
Constructor Details
-
CSSDOMImplementation
public CSSDOMImplementation()Constructs a CSSDOMImplementation that uses a standard (no flags) CSS parser. -
CSSDOMImplementation
Constructs a CSSDOMImplementation where the given flags will be applied when parsing CSS.The flags are copied, so further changes to the
EnumSet
aren't going to be acknowledged by this implementation.- Parameters:
parserFlags
- the NSAC parser flags.
-
-
Method Details
-
newDocument
Creates an empty, plain XML document with no HTML capabilities.- Returns:
- the XML document.
-
newHTMLDocument
Creates an HTML-specific DOM Document with an html element and DOCTYPE.- Returns:
- the HTML document.
-
createDocument
public DOMDocument createDocument(String namespaceURI, String qualifiedName, DocumentType doctype) throws DOMException - Specified by:
createDocument
in interfaceDOMImplementation
- Throws:
DOMException
-
createXMLDocument
-
createHTMLDocument
-
createDocumentType
public DocumentType createDocumentType(String qualifiedName, String publicId, String systemId) throws DOMException - Specified by:
createDocumentType
in interfaceDOMImplementation
- Throws:
DOMException
-
getFeature
Deprecated.This method is deprecated and not supported.- Specified by:
getFeature
in interfaceDOMImplementation
- Parameters:
feature
- ignored.version
- ignored.- Returns:
null
.
-
hasFeature
This method is not supported.- Specified by:
hasFeature
in interfaceDOMImplementation
- Parameters:
feature
- ignored.version
- ignored.- Returns:
- Always
true
.
-
getStrictErrorChecking
protected boolean getStrictErrorChecking() -
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking) Set thestrictErrorChecking
flag on the documents created by this implementation. Default istrue
.- Parameters:
strictErrorChecking
- the value of thestrictErrorChecking
flag.
-
createDocumentStyleSheet
Description copied from class:BaseCSSStyleSheetFactory
Creates a Document CSS style sheet for all media.- Specified by:
createDocumentStyleSheet
in classBaseCSSStyleSheetFactory
- Parameters:
origin
- the origin of the sheet (likeauthor
,user agent
, etc.)- Returns:
- the style sheet.
-
createRuleStyleSheet
protected BaseCSSStyleSheet createRuleStyleSheet(AbstractCSSRule ownerRule, String title, MediaQueryList mediaList) Description copied from class:BaseCSSStyleSheetFactory
Creates a CSS style sheet owned by a CSS rule.- Specified by:
createRuleStyleSheet
in classBaseCSSStyleSheetFactory
- Parameters:
ownerRule
- the owner rule.title
- the advisory title.mediaList
- the list of target media for style.- Returns:
- the style sheet.
-
createLinkedStyleSheet
protected BaseCSSStyleSheet createLinkedStyleSheet(Node ownerNode, String title, MediaQueryList mediaList) Description copied from class:AbstractCSSStyleSheetFactory
Creates an author (document-linked) CSS style sheet.- Specified by:
createLinkedStyleSheet
in classAbstractCSSStyleSheetFactory
- Parameters:
ownerNode
- the node that associates the style sheet to the document. In HTML it can be alink
orstyle
element. For style sheets that are included by other style sheets, the value of this parameter isnull
.title
- the advisory title.mediaList
- the target media list for style.- Returns:
- the style sheet.
-
createAnonymousStyleDeclaration
Description copied from interface:CSSStyleSheetFactory
Create a style declaration for an anonymous inline box, associated to a text/cdata node.- Specified by:
createAnonymousStyleDeclaration
in interfaceCSSStyleSheetFactory
- Specified by:
createAnonymousStyleDeclaration
in classAbstractCSSStyleSheetFactory
- Parameters:
node
- the node that has the declaration associated to it.- Returns:
- the anonymous style declaration.
-
getUserAgentStyleSheet
Gets the User Agent default CSS style sheet to be used by this factory in the given mode.- Specified by:
getUserAgentStyleSheet
in interfaceCSSStyleSheetFactory
- Parameters:
mode
- the compliance mode.- Returns:
- the default style sheet, or an empty sheet if no User Agent sheet was defined.
-
setDefaultHTMLUserAgentSheet
public void setDefaultHTMLUserAgentSheet()Description copied from class:AbstractCSSStyleSheetFactory
Sets a default HTML default style sheet as the user agent style sheet.The sheet will be appropriately merged with the non-important part of the user-preference style sheet to provide the document's default sheet.
- Specified by:
setDefaultHTMLUserAgentSheet
in interfaceCSSStyleSheetFactory
- Specified by:
setDefaultHTMLUserAgentSheet
in classAbstractCSSStyleSheetFactory
-
getDefaultStyleSheet
Description copied from class:AbstractCSSStyleSheetFactory
Get the style sheet resulting from the merge of the user agent sheet and the non-important part of the user style sheet.- Specified by:
getDefaultStyleSheet
in classAbstractCSSStyleSheetFactory
- Parameters:
mode
- the compliance mode.- Returns:
- the default style sheet at the top of the cascade.
-
createInlineStyle
Description copied from class:AbstractCSSStyleSheetFactory
Create an inline style.- Specified by:
createInlineStyle
in classAbstractCSSStyleSheetFactory
- Parameters:
owner
- the style's owner node (an attribute node).- Returns:
- the inline style.
-