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 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
ConstructorsConstructorDescriptionConstructs 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 BaseDocumentCSSStyleSheetcreateDocumentStyleSheet(int origin) Creates a Document CSS style sheet for all media.createDocumentType(String qualifiedName, String publicId, String systemId) protected ErrorHandlerCreate an error handler.protected HTMLDocumentcreateHTMLDocument(DocumentType doctype) protected InlineStylecreateInlineStyle(Node owner) Create an inline style.protected BaseCSSStyleSheetcreateLinkedStyleSheet(Node ownerNode, String title, MediaQueryList mediaList) Creates an author (document-linked) CSS style sheet.protected BaseCSSStyleSheetcreateRuleStyleSheet(AbstractCSSRule ownerRule, String title, MediaQueryList mediaList) Creates a CSS style sheet owned by a CSS rule.protected DOMDocumentcreateXMLDocument(DocumentType doctype) protected BaseDocumentCSSStyleSheetGet 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 booleanGets the User Agent default CSS style sheet to be used by this factory in the given mode.booleanhasFeature(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.voidSets a default HTML default style sheet as the user agent style sheet.voidsetStrictErrorChecking(boolean strictErrorChecking) Set thestrictErrorCheckingflag 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, setFlag, setLenientSystemValues, setStyleFormattingFactory, setUserStyleSheet, setUserStyleSheet, unsetFlag
-
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
EnumSetaren'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:
createDocumentin interfaceDOMImplementation- Throws:
DOMException
-
createXMLDocument
-
createHTMLDocument
-
createDocumentType
public DocumentType createDocumentType(String qualifiedName, String publicId, String systemId) throws DOMException - Specified by:
createDocumentTypein interfaceDOMImplementation- Throws:
DOMException
-
getFeature
Deprecated.This method is deprecated and not supported.- Specified by:
getFeaturein interfaceDOMImplementation- Parameters:
feature- ignored.version- ignored.- Returns:
null.
-
hasFeature
This method is not supported.- Specified by:
hasFeaturein interfaceDOMImplementation- Parameters:
feature- ignored.version- ignored.- Returns:
- Always
true.
-
getStrictErrorChecking
protected boolean getStrictErrorChecking() -
setStrictErrorChecking
public void setStrictErrorChecking(boolean strictErrorChecking) Set thestrictErrorCheckingflag on the documents created by this implementation. Default istrue.- Parameters:
strictErrorChecking- the value of thestrictErrorCheckingflag.
-
createDocumentStyleSheet
Description copied from class:BaseCSSStyleSheetFactoryCreates a Document CSS style sheet for all media.- Specified by:
createDocumentStyleSheetin 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:BaseCSSStyleSheetFactoryCreates a CSS style sheet owned by a CSS rule.- Specified by:
createRuleStyleSheetin 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:AbstractCSSStyleSheetFactoryCreates an author (document-linked) CSS style sheet.- Specified by:
createLinkedStyleSheetin classAbstractCSSStyleSheetFactory- Parameters:
ownerNode- the node that associates the style sheet to the document. In HTML it can be alinkorstyleelement. 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:CSSStyleSheetFactoryCreate a style declaration for an anonymous inline box, associated to a text/cdata node.- Specified by:
createAnonymousStyleDeclarationin interfaceCSSStyleSheetFactory- Specified by:
createAnonymousStyleDeclarationin 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:
getUserAgentStyleSheetin 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:AbstractCSSStyleSheetFactorySets 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:
setDefaultHTMLUserAgentSheetin interfaceCSSStyleSheetFactory- Specified by:
setDefaultHTMLUserAgentSheetin classAbstractCSSStyleSheetFactory
-
getDefaultStyleSheet
Description copied from class:AbstractCSSStyleSheetFactoryGet the style sheet resulting from the merge of the user agent sheet and the non-important part of the user style sheet.- Specified by:
getDefaultStyleSheetin classAbstractCSSStyleSheetFactory- Parameters:
mode- the compliance mode.- Returns:
- the default style sheet at the top of the cascade.
-
createInlineStyle
Description copied from class:AbstractCSSStyleSheetFactoryCreate an inline style.- Specified by:
createInlineStylein classAbstractCSSStyleSheetFactory- Parameters:
owner- the style's owner node (an attribute node).- Returns:
- the inline style.
-
createErrorHandler
Create an error handler.- Returns:
- the error handler.
-