If you think a bug might affect users in the 57 release, please set the correct tracking and status flags for Release Management.

XML transformed to HTML with XSLT; Javascript cannot use HTML <template>

ASSIGNED
Assigned to

Status

()

Core
XSLT
ASSIGNED
2 years ago
2 years ago

People

(Reporter: thomas.rebele, Assigned: peterv)

Tracking

47 Branch
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: btpp-followup-2016-03-11)

Attachments

(3 attachments)

(Reporter)

Description

2 years ago
Created attachment 8725345 [details]
out.xml

User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.116 Safari/537.36 OPR/35.0.2066.82

Steps to reproduce:

I use an XML file with texts, where parts of the texts are annotated by <mark>.
I transform this to a HTML document, which contains Javascript and a <template>.
The code adds two new nodes to the DOM, one with document.createTextNode(...) and one with document.importNode(...) for the template.

I run this directly in Firefox, Chrome, Opera and also generated an HTML file with
   xsltproc out.xml > out.html

I tested this with Firefox 44 and Firefox nightly (47.0a1, 2016-03-01)


Actual results:

When I open out.xml file in Chrome or Opera, both display the new nodes as expected.
Firefox however only shows the node created by document.createTextNode(...)
The out.html file works in all three browsers.


Expected results:

All browsers should show the same page for out.xml and out.html
(Reporter)

Comment 1

2 years ago
Created attachment 8725346 [details]
file generated with "xsltproc out.xml > out.html"
(Reporter)

Updated

2 years ago
Component: Untriaged → XSLT
Product: Firefox → Core
Whiteboard: btpp-followup-2016-03-04
Jonas, what do you think?
Flags: needinfo?(jonas)
Whiteboard: btpp-followup-2016-03-04 → btpp-followup-2016-03-11
(Assignee)

Comment 3

2 years ago
Created attachment 8726918 [details] [diff] [review]
WIP

Fixing this for transforms from script for the source document looks pretty hard. We'd have to give XPath treewalker a mode in which it knows about template and use that just for XSLT :-/.
Assignee: nobody → peterv
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
I'm honestly not sure it's worth investing in this bug at all. XSLT is a dying technology and used by very few websites.
Flags: needinfo?(jonas)
(Reporter)

Comment 5

2 years ago
I replaced the HTML template tag with another HTML+js template technology, so that it works in Firefox, Opera and Chrome. I guess that people will rarely encounter this bug.
You need to log in before you can comment on or make changes to this bug.