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().

Please register to edit this issue

Also available in: Atom PDF Tracking page