Project

Profile

Help

Bug #4116

closed

Cannot load SEF stylesheet under NW.js

Added by Olivier XILLO about 5 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
Internals
Sprint/Milestone:
-
Start date:
2019-01-28
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:
9.8
Platforms:
Company:
-
Contact person:
-
Additional contact persons:
-

Description

Using Saxon-JS 1.2.0, when trying to load a stylesheet in a NW.js app (v0.35.5) using Saxon-JS 1.2.0, the following is returned.

SaxonJS.js:17943 Uncaught XError: stylesheetLocation should be absolute by now

After digging into the code, the problem appears to come from the regex in the isAbsoluteURI function. Indeed, NW.js fetches the files from an 'chrome-extension://' URL.

Changing the regex to

/^(?:[a-z-]+:)?\/\//i

worked for me.

Actions #1

Updated by Debbie Lockett about 5 years ago

Thanks for reporting the bug. And for digging down to find the cause, and provide a patch!

Actions #2

Updated by Debbie Lockett over 4 years ago

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

The Uniform Resource Identifier (URI) spec (https://tools.ietf.org/html/rfc3986#section-3.1) says:

"Scheme names consist of a sequence of characters beginning with a letter and followed by any combination of letters, digits, plus ("+"), period ("."), or hyphen ("-"). Although schemes are case- insensitive, the canonical form is lowercase and documents that specify schemes must do so with lowercase letters. An implementation should accept uppercase letters as equivalent to lowercase in scheme names (e.g., allow "HTTP" as well as "http") for the sake of robustness but should only produce lowercase scheme names for consistency."

So for completeness, it looks like the regex should actually be /^(?:[A-Za-z][A-Za-z0-9+.-]+:)?\/\//i

Change committed on Saxon-JS 1.x and 2.0 branches.

Actions #3

Updated by Debbie Lockett almost 4 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in JS Release set to Saxon-JS 2.0
  • Applies to JS Branch Trunk added
Actions #4

Updated by Debbie Lockett almost 4 years ago

  • Category set to Internals

Please register to edit this issue

Also available in: Atom PDF Tracking page