Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-18176

Upgrade to CSS4J 3.2.0

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • Major
    • 13.0
    • 12.10.1
    • Dependency Upgrades
    • None
    • Unknown
    • N/A

    Description

      CSS4J CHANGES
      =============
      
      Version 3.2.0
      -------------
      
       * Core:
      - NSAC: add SelectorList.replace(int, Selector) method.
      - NSAC: new AttributeConditionVisitor abstract class.
      - NSAC: attribute condition small refactor.
      - NSAC: prevent calling endOfStream() twice when parsing style sheets.
      - NSAC: remove dead code.
      - DOM: remove support for ID configuration, deprecated by W3C and cause of 
        slowdown.
      - DOM: do not ignore element-content whitespace when building textContent.
      - DOM: in HTML documents, compute styles only from STYLE elements in the HTML 
        namespace.
      - DOM: add elementIterator(String) and elementIteratorNS(String,String) to 
        ParentNode.
      - DOM: add isEmpty() to ExtendedNamedNodeMap interface.
      - DOM: add ExtendedNodeList.isEmpty().
      - DOM: add setXMLReader(XMLReader) to XMLDocumentBuilder.
      - DOM: add doc.geom package with DOM Rect interface and implementation.
      - DOM: refresh style sheets after changing BASE or document URI.
      - DOM: automatically create an xmlns attribute when the qualifiedName in 
        DOMImplementation.createDocument() contains a prefix.
      - DOM: DOMWriter: add namespace prefix declarations if the element is missing 
        the xmlns-prefixed attribute.
      - DOM: prevent NPE when documentURI is malformed.
      - DOM: do not intern element and attribute local names.
      - DOM: lightweight implementation of getElementsByTagName() and 
        getElementsByClassName().
      - DOM: small optimization to DOMNamedNodeMap.setNamedItem().
      - DOM: use a shortcut method to set attributes in XMLDocumentBuilder.
      - DOM: unprefixed attributes are not associated to default namespace (bug).
      - DOM: ClassList for quirks mode was not being case insensitive if its contents 
        were set through setValue() (bug).
      - DOM: fix a bug importing elements and attributes with a ns prefix.
      - DOM: NodeIterator,TreeWalker: do not call the filter if the node is not to be 
        shown.
      - DOM: avoid NPE in NamedNodeMap.getNamedItem() and removeNamedItem() with null 
        argument.
      - DOM: if the 'style' attribute has no CSS properties set, return the DOM node 
        value instead of the declaration serialization.
      - DOM: create a CSS-enabled 'style' attribute also for non-HTML elements inside 
        HTML documents.
      - DOM: a STYLE.type attribute explicitly set to the empty String is valid.
      - DOM: instantiate CSS-enabled STYLE and LINK elements also for non-HTML 
        namespaces.
      - DOM: use CSS-aware STYLE elements in non-HTML documents.
      - DOM: correctly serialize doctypes with publicId or systemId set to the empty 
        string (which the validator.nu parser produces).
      - DOM: a generic attribute is not boolean unless the document is HTML.
      - DOM: XMLDocumentBuilder: make HTML processing optional with 
        setHTMLProcessing().
      - DOM: handle "crossorigin" as a style-event attribute.
      - DOM: several small refactors.
      - DOM wrapper: avoid loophole that could set an unsafe base URI.
      - DOM wrapper: a STYLE.type attribute explicitly set to the empty String is 
        valid.
      - CSSOM: add setSelectorList(SelectorList) to CSSStyleRule.
      - CSSOM: CSSStyleSheet.createStyleRule() now returns a CSSStyleRule.
      - CSSOM: migrate from org.w3c.dom.css.CSSStyleSheet to css4j's CSSStyleSheet in 
        ErrorHandler.
      - CSSOM: add Visitor-based traversal methods to AbstractCSSStyleSheet.
      - CSSOM: add support for ":any-link" pseudo-class and improve ":link" and 
        ":visited".
      - CSSOM: fix class cast issues in getSelectorsForPropertyValue() and 
        getSelectorsForProperty().
      - CSSOM: a final implied 'auto' grid-template-rows track-size could be skipped 
        when decomposing the grid-template property (bug).
      - CSSOM: skip an unnecessary whitespace in the minified serialization of one 
        variant of grid-template (optimization).
      - POM: depend on JCLF 4.0.4 or higher.
      - Tests: DOM: use XMLDocumentBuilder.setXMLReader() to use it with v.nu's 
        HtmlParser, instead of HtmlDocumentBuilder in tests.
      - Tests: remove getSelectorList() from CSSOMBridge.
      - Tests: create InputSource from InputStreamReader in a few DOM wrapper tests.
      - Tests: add several assertions to DOM tests.
      - Javadoc: a few small improvements.
      
       * Dom4j module:
      - Depend on xmlpull-xpp3 1.2 from https://github.com/xmlpull-xpp3/xmlpull-xpp3
      - Refactor XHTMLDocumentFactory to use new createDocument(DOMDocumentType) from 
        createDocument(String, String, DocumentType).
      - Add support for ":any-link" pseudo-class and improve ":link" and ":visited".
      - style attribute: return non-parsed value if style is unprocessed or has 0 
        properties.
      - Refresh linked style sheets after changing BASE or document URI.
      - Prevent NPE when documentURI is malformed.
      - A STYLE.type attribute explicitly set to the empty String is valid.
      - Make sure that normalize() operates correctly on non-CSS STYLE elements.
      - Attribute cleanup, with a fix for upstream behaviour.
      - DOM4JUserAgent: refactor document creation in AgentXHTMLDocumentFactory.
      - Long-needed code formatting.
      - Tests: update XMLDocumentBuilderTest with setHTMLProcessing(true).
      - Tests: do not depend on CSSOMBridge to get the SelectorList of a style rule.
      - Tests: additional test for attribute selector matching.
      - Javadocs: a couple small javadoc improvements.
      
       * Agent module:
      - DefaultUserAgent: use XMLDocumentBuilder with v.nu's HtmlParser instead of 
        HtmlDocumentBuilder.
      - Adapt to change in core's CSSOMDocumentFactory.
      - Tests: add test for DefaultUserAgent.
      
       * XML-DTD module:
      - POM: depend on JCLF 4.0.4 or higher.
      - Tests: add SuppressWarnings("deprecation") in DefaultEntityResolverTest.
      
       * Util module:
      - Add the Visitor<T> interface.
      
                                  CSS4J RELEASE NOTES
                                  ===================
      
      Release 3.2.0 - December 20, 2020
      ---------------------------------
      
      Release Highlights
      ------------------
      - New additions to the API, notably SelectorList.replace(int, Selector), the new
        'geom' package, and Visitor<T> added to carte-util.
      - DOM has quite a few traversal methods, but CSSOM just has the rule lists. New
        (non-standard) style sheet traversal methods have been added, based on the
        Visitor pattern. The parent Carte project uses them to perform SVG-related
        processing.
      - A specialized AttributeConditionVisitor allows modification of attribute
        selectors upon traversal, very useful to integrate SVG inline images in HTML.
      - ":any-link" was overlooked but is now supported. ":link" and ":visited" now
        only apply to the link-related HTML elements and anything with a "xlink:href",
        while previously any element with an "href" attribute was matching.
      - Loads of improvements and fixes to the native DOM implementation. The new
        element-name iterator is a time saver. If you use native DOM, you are invited
        to upgrade.
      - In the native DOM and DOM4J, embedded style sheets are no longer used if they
        belong to a different namespace than the document element, preventing -for
        example- potential clashes with SVG styles and providing less overhead for the
        style computations when many SVG elements are present. Web browsers do not
        make this distinction about STYLE elements though, but IMHO is the right
        behaviour to have.
      - A security loophole was fixed in the DOM wrapper, which could allow setting an
        unsafe base href.
      - DOM4J module now depends on xmlpull-xpp3 1.2 artifact from
        https://github.com/xmlpull-xpp3/xmlpull-xpp3 instead of the old xpp3. The new
        artifact is not available from Maven Central -which is unlikely to make
        downstream users happy- but it is an optional dependency after all.
      - In the DOM4J module, Element.setAttributeNode() and setAttributeNodeNS() were
        not working correctly due to an upstream bug. Now css4j overrides the relevant
        methods.
      

      Attachments

        Activity

          People

            vmassol Vincent Massol
            vmassol Vincent Massol
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: