[ANNOUNCEMENT] CSS4J 0.39

9 views
Skip to first unread message

admin

unread,
Feb 8, 2018, 1:36:43 PM2/8/18
to css4j
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:


NSAC 1.1 parser extensions
 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.


Improved support for at-rules
 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.


Refactors
 Several refactors have been made to the object model, and the doc.html package was renamed to doc.dom, in case that non-html implementations are added in the future. The amount of refactoring in this release more than justifies the minor version bump to 0.39.

 There are several new interfaces (in the doc.style.css package) and comments about those are welcome.


Bug fixes
 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.


SPDX Headers
 Complex projects like css4j often carry files with several different licenses (for example W3C licenses), and finding which licenses apply to a package can be cumbersome. The SPDX headers are intended to help in automating such processes, see https://spdx.org/using-spdx for more information.


List of changes
 A more complete list of changes follows:

 * 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.
- Add SPDX header. See https://spdx.org/using-spdx
- 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.
- Add SPDX header. See https://spdx.org/using-spdx
- Fix a newInstance Java 9 warning.
- Update unit test to account for CSSUnknownRule support.
- Update copyright notices to 2018.

 * Agent module:
- Add SPDX header. See https://spdx.org/using-spdx

 * Visual module (staging):
- Package doc.html in core renamed to doc.dom.
- Add SPDX header. See https://spdx.org/using-spdx
- LICENSE.txt: Update copyright notice to 2018.

 * Java2D module:
- Package doc.html in core, renamed to doc.dom.
- Add SPDX header. See https://spdx.org/using-spdx
- LICENSE.txt: Update copyright notice to 2018.

Vincent Massol

unread,
Feb 8, 2018, 1:50:20 PM2/8/18
to css4j

admin

unread,
Feb 12, 2018, 4:27:09 PM2/12/18
to css4j
There are a couple of outdated javadoc package descriptions (package-info) in 0.39 (and broken links to W3C's DOM CSS classes), but corrected javadocs are available online since yesterday at the Carte web site:


So if you find a package description that looks like belonging to 0.37, just ignore it or visit the online documentation. It was also corrected on git.
Reply all
Reply to author
Forward
0 new messages