[FIX] noscript element with display type set is rendered even if javascript is enabled

VERIFIED FIXED

Status

()

VERIFIED FIXED
15 years ago
14 years ago

People

(Reporter: lasse, Assigned: mats)

Tracking

({compat, testcase})

Trunk
x86
All
compat, testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

15 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/20040302 Firefox/0.8
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7b) Gecko/20040302 Firefox/0.8

When a noscript element has a display type set, the content is rendered even if
javascript is enabled. Furthermore, markup contained in the noscript element is
displayed as plain text.

Reproducible: Always
Steps to Reproduce:
1. Open testcase
2. See results
3. Turn of javascript in browser
4. Reload page

Actual Results:  
Contents of noscript element is shown when javascript is enabled

Expected Results:  
Noscript content should not be rendered if javascript is enabled.

Will upload testcase shortly. This code exposes the problem:

<script type="text/javascript">
document.write("<p>Javascript works</p>");
</script>
<noscript style="display:block;">
<p>Javascript <strong>does not </strong>work.</p>
</noscript>

Both Opera 7.x and IE6 hides the noscript content.
(Reporter)

Comment 1

15 years ago
Created attachment 142904 [details]
Testcase - noscript with display type set

Updated

15 years ago
Keywords: testcase
OS: Windows 2000 → All
(Assignee)

Updated

15 years ago
Keywords: compat
Summary: noscript element with display type set is rendered even if javascript is enabled → [FIX] noscript element with display type set is rendered even if javascript is enabled
(Assignee)

Comment 2

15 years ago
Created attachment 143237 [details] [diff] [review]
Patch rev. 1

Make 'display:none' important for <noscript> when script is enabled.
Assignee: nobody → mats.palmgren
Status: NEW → ASSIGNED
(Assignee)

Comment 3

15 years ago
Created attachment 143238 [details] [diff] [review]
Patch rev. 1 (diff -w, for reviewing purposes only)
(Assignee)

Updated

15 years ago
Attachment #143237 - Flags: review?(bzbarsky)
Comment on attachment 143237 [details] [diff] [review]
Patch rev. 1

There's no need for the display:inline thing, is there?  That's the default
value of display, and now that you've removed the ua.css rule there is no need
for the display:inline...

In other words, just flip the sense of the IsScriptEnabled() check and change
the rule to use none!important instead of inline.
Attachment #143237 - Flags: review?(bzbarsky) → review-
(Assignee)

Comment 5

14 years ago
Created attachment 170133 [details] [diff] [review]
Patch rev. 2

Yes, that's better. (sorry for the delay in dealing with this)
Attachment #143237 - Attachment is obsolete: true
Attachment #143238 - Attachment is obsolete: true
Attachment #170133 - Flags: superreview?(bzbarsky)
Attachment #170133 - Flags: review?(bzbarsky)
Comment on attachment 170133 [details] [diff] [review]
Patch rev. 2

r+sr=bzbarsky
Attachment #170133 - Flags: superreview?(bzbarsky)
Attachment #170133 - Flags: superreview+
Attachment #170133 - Flags: review?(bzbarsky)
Attachment #170133 - Flags: review+
(Assignee)

Comment 7

14 years ago
Checked in 2005-01-03 11:37 PDT.

-> FIXED
Status: ASSIGNED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → FIXED
Verified FIXED using the testcase
https://bugzilla.mozilla.org/attachment.cgi?id=142904 on Windows XP, with
Seamonkey build 2005-01-17-07.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.