Project

Profile

Help

Bug #3704

closed

Issues with ixsl:style()

Added by Debbie Lockett over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
-
Sprint/Milestone:
-
Start date:
2018-02-27
Due date:
% Done:

100%

Estimated time:
Applies to JS Branch:
1.0, Trunk
Fix Committed on JS Branch:
1.0, Trunk
Fixed in JS Release:
SEF Generated with:
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

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