Bug #3704
closedIssues with ixsl:style()
100%
Description
Following changes for bug #3545, we're getting some unit test failures:
ixsl/style01 "keys() not allowed for JSValue at style01.xsl#26"
ixsl/styleEmpty01 "forEach() not allowed for JSValue at styleEmpty01.xsl#18"
ixsl/SVGstyle01 "keys() not allowed for JSValue at SVGstyle01.xsl#26"
ixsl/SVGstyle03 "keys() not allowed for JSValue at SVGstyle03.xsl#32"
(Note that the fix for bug #3545 is not yet released, so these particular failures are only relevant for Saxon-JS development code.)
The documentation for ixsl:style() says that the function returns an XDM map, but evidently we are currently returning a JSValue wrapped object (which allows map:get() lookup, but not all map functions).
Generally, the fix would be to convert the style object using Expr.convertFromJS(style, false, true) rather than just Expr.convertFromJS(style); so that we get an XDM map. However, actually I think there are problems with this (and so problems with the original implementation) which can lead to differences of behaviour for different browsers - because we have not properly taken into account what the style object is. It is a CSSStyleDeclaration object returned by window.getComputedStyle, which represents a collection of CSS property-value pairs. Instead I think we should explicitly construct the XDM map (internally as a HashTrie) to contain only the CSS property-value pairs.
Please register to edit this issue
Also available in: Atom PDF Tracking page