- All Known Implementing Classes:
AbstractCSSStyleSheetFactory
,BaseCSSStyleSheetFactory
,CSSDOMImplementation
,DOMCSSStyleSheetFactory
public interface CSSStyleSheetFactory
CSS style sheet factory.
-
Field Summary
Modifier and TypeFieldDescriptionstatic final byte
static final byte
static final byte
static final byte
-
Method Summary
Modifier and TypeMethodDescriptionCreate a style declaration for an anonymous inline box, associated to a text/cdata node.createImmutableMediaQueryList
(String media, Node owner) Parses and creates an immutable media query list for the given media.Create a new StyleDeclarationErrorHandler for the given style rule.createMediaQueryList
(String mediaQueryString, Node owner) ParsesmediaQueryString
and creates a new media query list.createSheetErrorHandler
(ExtendedCSSStyleSheet<? extends ExtendedCSSRule> sheet) Creates a style sheet error handler.Create a new StyleDeclarationErrorHandler for the given style rule.ExtendedCSSStyleSheet<? extends ExtendedCSSRule>
createStyleSheet
(String title, MediaQueryList media) Creates a stand-alone author style sheet.createUnmodifiableMediaQueryList
(String media, Node owner) Deprecated.Gets the device factory.Get the style formatting factory to be used with this sheet factory.getSystemDefaultValue
(String propertyName) Get a system default value for the given property.Gets the User Agent default CSS style sheet to be used by this factory.void
Sets a default HTML default style sheet as the user agent style sheet.void
setFactoryFlag
(byte flag) Set a configuration flag.void
setLenientSystemValues
(boolean lenient) Set the value of thelenientSystemValues
flag.void
Set a style formatting factory to format style serializations made with sheets created by this sheet factory.void
Sets the CSS style sheet defined by the end-user.
-
Field Details
-
ORIGIN_USER_IMPORTANT
static final byte ORIGIN_USER_IMPORTANT- See Also:
-
ORIGIN_AUTHOR
static final byte ORIGIN_AUTHOR- See Also:
-
ORIGIN_USER
static final byte ORIGIN_USER- See Also:
-
ORIGIN_USER_AGENT
static final byte ORIGIN_USER_AGENT- See Also:
-
-
Method Details
-
createStyleSheet
ExtendedCSSStyleSheet<? extends ExtendedCSSRule> createStyleSheet(String title, MediaQueryList media) Creates a stand-alone author style sheet.- Parameters:
title
- the advisory title.media
- the target media for style.- Returns:
- the style sheet.
-
createAnonymousStyleDeclaration
Create a style declaration for an anonymous inline box, associated to a text/cdata node.- 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.- Parameters:
mode
- the compliance mode.- Returns:
- the default style sheet, or an empty sheet if no User Agent sheet was defined.
-
setDefaultHTMLUserAgentSheet
void setDefaultHTMLUserAgentSheet()Sets a default HTML default style sheet as the user agent style sheet. -
setUserStyleSheet
Sets the CSS style sheet defined by the end-user.The sheet in the supplied reader should contain user preferences, and will be appropriately merged with the other style sheets.
- Parameters:
re
- the reader with the user style sheet.- Throws:
DOMException
- if a problem is found parsing the sheet.IOException
- if there is a problem retrieving the reader.
-
setFactoryFlag
void setFactoryFlag(byte flag) Set a configuration flag. Do not confuse with NSAC flags, which must be set at this object's creation time (see the documentation for implementation's constructors).The flags are implementation-dependent.
- Parameters:
flag
- the flag to set.
-
setLenientSystemValues
void setLenientSystemValues(boolean lenient) Set the value of thelenientSystemValues
flag. Do not confuse this flag with the NSAC flags.The style sheet factories provide system default values, and its behaviour depends on a
lenientSystemValues
flag. The lenient flag allows to compute values by giving reasonable defaults to properties with system-dependent initial values: '#000000' for color and 'serif' for font-family.If you work with style databases you do not need
lenientSystemValues
.Default value is
true
.- Parameters:
lenient
-true
orfalse
to enable/disable thelenientSystemValues
flag.
-
getSystemDefaultValue
Get a system default value for the given property.If the
lenientSystemValues
flag istrue
, returns a reasonable default for the property. Otherwise, it returns a system default meta-value.- Parameters:
propertyName
- the property name.- Returns:
- the system default css primitive value.
-
createStyleDeclarationErrorHandler
Create a new StyleDeclarationErrorHandler for the given style rule.- Parameters:
rule
- the declaration rule the handler is for.- Returns:
- the StyleDeclarationErrorHandler.
-
createInlineStyleErrorHandler
Create a new StyleDeclarationErrorHandler for the given style rule.- Parameters:
owner
- the element owner of the inline style.- Returns:
- the StyleDeclarationErrorHandler.
-
createSheetErrorHandler
Creates a style sheet error handler.- Parameters:
sheet
- the style sheet whose errors are to be handled.- Returns:
- the error handler.
-
createMediaQueryList
ParsesmediaQueryString
and creates a new media query list.- Parameters:
mediaQueryString
- the media query string.owner
- the node that would handle errors, if any.- Returns:
- a new media list for
mediaQueryString
.
-
createImmutableMediaQueryList
Parses and creates an immutable media query list for the given media.- Parameters:
media
- the comma-separated list of media. Ifnull
, the media list will be for all media.owner
- the node that would handle errors, if any.- Returns:
- the immutable media list.
-
createUnmodifiableMediaQueryList
Deprecated.Parses and creates an immutable media query list for the given media.- Parameters:
media
- the comma-separated list of media. Ifnull
, the media list will be for all media.owner
- the node that would handle errors, if any.- Returns:
- the immutable media list.
- See Also:
-
getStyleFormattingFactory
StyleFormattingFactory getStyleFormattingFactory()Get the style formatting factory to be used with this sheet factory.- Returns:
- the style formatting factory.
-
setStyleFormattingFactory
Set a style formatting factory to format style serializations made with sheets created by this sheet factory.- Parameters:
factory
- the style formatting factory.
-
getDeviceFactory
DeviceFactory getDeviceFactory()Gets the device factory.- Returns:
- the device factory.
-