script code is displayed if the script element is assigned a display:block style value

VERIFIED INVALID

Status

()

--
minor
VERIFIED INVALID
14 years ago
14 years ago

People

(Reporter: simone, Unassigned)

Tracking

Trunk
x86
Windows 2000
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 2 obsolete attachments)

(Reporter)

Description

14 years ago
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.5) Gecko/20041107 Firefox/1.0

If I assigne to a script tag a display:block attribute (<script
style="display:block;">) the content of the script is first displayed on the
page, than it is executed

Reproducible: Always
Steps to Reproduce:
Look at the testcase for an example
Actual Results:  
Script code is displayed

Expected Results:  
Should just execute
(Reporter)

Comment 1

14 years ago
Created attachment 167124 [details]
Testcase
(Reporter)

Comment 2

14 years ago
I used this thing because I wanted the result of the script to be displayed as
block element.
If that's what you want, output something that's display:block.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago
Resolution: --- → INVALID
(Reporter)

Comment 4

14 years ago
OK, but should not display the "code" of the script.
Should display just the results of the scripts.
Status: RESOLVED → UNCONFIRMED
Resolution: INVALID → ---
(Reporter)

Comment 5

14 years ago
Created attachment 167133 [details]
Screenshot of what I see

This what I see, the code is written on the page
(Reporter)

Comment 6

14 years ago
Created attachment 167134 [details]
More Complex script

In this example you see that (maybe in the other it was clear enough) the
source of the script is rendered on the page
Attachment #167124 - Attachment is obsolete: true

Comment 7

14 years ago
As I understand it, the text of a script only doesn't display because the script
has display:none. When you change it to display:block, the text shows up.

You could try doing document.write("<div>This text is written by a
script</div>"), or something equivalent.
Status: UNCONFIRMED → RESOLVED
Last Resolved: 14 years ago14 years ago
Resolution: --- → INVALID
(Reporter)

Comment 8

14 years ago
Created attachment 167135 [details]
Screenshot of what I see

The screenshot of the new page
Attachment #167133 - Attachment is obsolete: true
(Reporter)

Comment 9

14 years ago
So, in response to comment #7, you are telling me that the the fact that a the
code of the script is displayed is just because it has as default display:none?
(Reporter)

Comment 10

14 years ago
Anyway I'll suggest that a script tag cannot have the source displayed on the page

Comment 11

14 years ago
(In reply to comment #9)
> So, in response to comment #7, you are telling me that the the fact that a the
> code of the script is displayed is just because it has as default display:none?

That's my (albiet limited) understanding of it.

You should also note that when you document.write something, the result is _not_
a child of the script, so setting disply:block on the script doesn't affect the
thing being written anyway.
Verified invalid.  There's no reason we should prevent the script being
displayed if the page author wishes to display it.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.