A new update of the css4j library, 0.39, is now available at the Sourceforge download site:
Users are encouraged to download and test it. The following are the main improvements:
The first NSAC API was published in September 2017 and comprised just the required changes to support modern selectors and values, but more improvements were possible. This first update to the API is about parser extensions, and is described in detail in this post to the css4j-devel group:
Basically, it means that the library now supports the asterisk-prefixed properties that are commonplace in current style sheets (as a IE-specific hack). They are not taken into account for style computation, but the style declarations do carry them if the factory was created in LENIENT mode. The extensions also mean that individual rules can now be properly parsed if namespaces are present.
The NSAC implementation now supports parsing the internal structure of nested at-rules like @keyframes (which the normal SAC/NSAC handles as whole rules). Note that those new methods and interfaces are not part of the NSAC specification itself (just extensions to the reference implementation).
Also, the object model has new interfaces and classes related to specific at-rules.
The battery of unit tests was increased, and a few issues were discovered and fixed. Notably, in the NSAC implementation escaped and quoted values that are inside ignorable at-rules are now properly escaped. And some issues in the object model implementation of page rules are now fixed. In general, the object model handling of at-rules should be more robust after the refactors and new tests.
* Core:
- NSAC 1.1 parser configuration extension.
- NSAC implementation: implement NSAC 1.1 parser configuration with STARHACK
support.
- NSAC 1.1 rule parsing extension.
- NSAC: add namespace-related parse exception.
- NSAC implementation: throw CSSNamespaceParseException for namespace-related
errors.
- NSAC implementation: implement NSAC 1.1 rule parsing extension.
- NSAC implementation: add support for parsing the body of nested rules.
- NSAC implementation: return the CSS2 TR from Parser.getParserVersion()
- NSAC implementation: do not skip comments inside ignorable at-rules.
- NSAC impl.: small correction to CSS test file for additional coverage.
- NSAC impl.: process escaped and quoted values properly in ignorable rules
- CSSOM: if the factory is in LENIENT mode and the parser supports NSAC 1.1,
enable STARHACK.
- CSSOM: Refactor introducing the CSSDeclarationRule interface.
- CSSOM: normalize name for CSSSupportsRule constant.
- CSSOM: extract a few W3C interfaces from at-rule implementations.
- CSSOM: refactor, introducing the ExtendedCSSRule interface.
- CSSOM: tests for rule's clone(sheet) method, with fix for OMCSSPageRule
- CSSOM: refactor related to declaration-specific SAC DocumentHandlers.
- CSSOM: add support for several at-rules.
- CSSOM: refactor of @supports rule implementation.
- CSSOM: add numbers for new rules, and small visibility adjustments.
- Add several at-rule factory methods to ExtendedCSSStyleSheet.
- CSSRuleArrayList: supply an 'appendRule' method instead of just 'add'.
- OMCSSNamespaceRule: add a setPrefix() method allowing to change prefix.
- BaseCSSStyleSheet: throw DOMException of NAMESPACE_ERR type when
CSSNamespaceParseException is found.
- OMCSSPageRule: set and get the page selector according to spec methods.
- Revert "Remove implementation of CSSUnknownRule, deprecated by W3C and
unused."
- Instantiate a CSSUnknownRule for unsupported SAC 'ignorable' rules.
- Sheet error handler: add a method to report fatal issues with at-rules.
- SheetErrorHandler: new arguments for non-style at-rule error reporting.
- Do not include semicolon for last longhand in minified declarations.
- Rename package doc.html to doc.dom.
- Improved licensing header for NSAC files, including SPDX identifier.
- New licensing header for W3C files, and relevant LICENSES.txt file.
- Add the 'final' modifier to several fields (and make some 'private').
- Fix a few Java 9 newInstance() warnings
- Remove BOM mark from sample css used in tests
- Add a few tests for DOM wrapper.
- DeclarationParserTest: add a unit test and rearrange some lines.
- CSSIdentifierValueTest: additional test.
- BaseCSSStyleDeclarationTest: additional test.
- BaseCSSStyleSheet: add a comment.
- OMCSSGroupingRule: small Javadoc corrections.
- Update copyright notices to 2018.
* Dom4j module:
- Adapt to refactors in core module.
- Fix a newInstance Java 9 warning.
- Update unit test to account for CSSUnknownRule support.
- Update copyright notices to 2018.
* Agent module:
* Visual module (staging):
- Package doc.html in core renamed to doc.dom.
- LICENSE.txt: Update copyright notice to 2018.
* Java2D module:
- Package doc.html in core, renamed to doc.dom.
- LICENSE.txt: Update copyright notice to 2018.