Open Bug 950865 Opened 12 years ago Updated 4 years ago

Styles inside <noscript><style> generated via XSLT still apply with JavaScript enabled

Categories

(Core :: XSLT, defect)

defect

Tracking

()

People

(Reporter: antoine.gutzwiller, Unassigned)

Details

(Keywords: testcase)

Attachments

(2 files)

User Agent: Mozilla/5.0 (X11; Linux i686; rv:10.0.12) Gecko/20100101 Firefox/10.0.12 Iceweasel/10.0.12 (Beta/Release) Build ID: 20130119120927 Steps to reproduce: test.xml : ===== <?xml version="1.0"?> <?xml-stylesheet type="text/xsl" href="test.xsl" ?> <root> <e>text</e> </root> ===== test.xsl ===== <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" doctype-system="about:legacy-compat" encoding="UTF-8" indent="yes" /> <xsl:template match="/"> <html> <head> <title>test</title> <noscript><style>._script_{display:none;}</style></noscript> </head> <body> <noscript>a</noscript> <span class="_script_">b</span> </body> </html> </xsl:template> </xsl:stylesheet> ===== Actual results: When Javascript is disabled, nothing appear. Expected results: When Javascript is disabled, "b" should appear. If you save the HTML output, and try to render it, then it works : "b" appear when JS is disabled. So, the HTML is wrongly rendered, only when it follows a XSL transformation.
s/disabled/enabled/g
Thanks! I can reproduce this on OS X nightly, and this was also reported earlier in bug 408126. Since I missed comment 1 when first reading through the report, reiterating: With JS *enabled* the testcase renders empty, while the expected result is "b" getting displayed (since the rule hiding it is inside the <noscript>).
Status: UNCONFIRMED → NEW
Component: Untriaged → XSLT
Ever confirmed: true
Keywords: testcase
OS: Linux → All
Product: Firefox → Core
Hardware: x86 → All
Summary: XSLT output is right, but rendering is wrong → Styles inside <noscript><style> generated via XSLT still apply with JavaScript enabled
Version: 26 Branch → Trunk
The interaction between HTML and XSLT is very poorly defined which is why a lot of edge cases like this ends up doing unintuitive things. I'd recommend simply removing the <noscript> and its contents. There are no browsers that support XSLY but does not support JavaScript anyway.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: