Project

Profile

Help

Bug #6418

closed

IXSL extensions which are not available on Node.js

Added by Debbie Lockett 8 months ago. Updated 2 months ago.

Status:
Closed
Priority:
Low
Category:
IXSL extensions
Sprint/Milestone:
-
Start date:
2024-05-08
Due date:
% Done:

100%

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

Description

The documentation claims that ixsl:set-style and ixsl:style() are available in Node.js; but I think that these are actually only available in the browser. In the browser, we are dealing with an HTMLElement from the HTML page, which has a style property; but a general Element (as in Node.js) doesn't have a style property.

In fact, attempts to use ixsl:set-style and ixsl:style() in Node.js currently fall over in the code. Using ixsl:set-style results in an error "ReferenceError: Element is not defined" caused by the use of !(elem instanceof Element) in the run time implementation. We should probably replace this with DomUtils.isElement(elem), even if this is only for the browser. Meanwhile, the implementation for ixsl:style() calls window.getComputedStyle(x); which falls over in Node.js because there is no window.

I think we should update the code to produce a run time error if these extensions are used when running in Node.js. Also for other relevant IXSL functions: ixsl:event(), ixsl:location(), ixsl:query-params().

Actions #1

Updated by Debbie Lockett 8 months ago

  • Status changed from New to Resolved
  • Fix Committed on JS Branch 2, Trunk added

Fixes committed on saxonjs2 and main branches:

  • throw run time errors when unavailable IXSL extensions are called running in Node.js
  • update documentation to clarify that ixsl:set-style and ixsl:style() are browser only

I've pushed the fix to the SaxonJS 2 documentation online too.

Actions #2

Updated by Debbie Lockett 2 months ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in JS Release set to SaxonJS 2.7

Bug fix applied in the SaxonJS 2.7 maintenance release.

Please register to edit this issue

Also available in: Atom PDF Tracking page