Closed Bug 96791 Opened 25 years ago Closed 25 years ago

<framset src="javascript:\'<BODY BGCOLOR=red>\'"> should not be rendered

Categories

(Core :: DOM: Core & HTML, defect)

x86
All
defect
Not set
normal

Tracking

()

VERIFIED WORKSFORME

People

(Reporter: caillon, Assigned: jst)

References

()

Details

I am filing this bug because I'm not sure that the behaviour in bug 92683 that the reporter says is 'fixed' is correct. This is actually the inverse of 92683. I'm saying that the behaviour should NOT be rendered. javascript:\'<BODY BGCOLOR=red>\' AFAIK, that is the same as `<script type="text/javascript">'<BODY BGCOLOR=red>'</script> and I don't expect JS to do anything with that except maybe issue a warning that I have a loose string or something. If this behaviour is desired, <frameset src="data:text/html;foo"> should be used. Why is HTML code as a standalone string in javascript: urls supported?
AFAICT this behavior has been documented by Netscape for ages, see e.g. http://developer.netscape.com/docs/manuals/js/client/jsref/location.htm#1193181 . But it is strange that it works with /escaped/ quotes too (only as value of a SRC attribute, not if directly typed into the location bar).
Browser, not engine --> DOM Level 0
Assignee: rogerl → jst
Component: Javascript Engine → DOM Level 0
QA Contact: pschwartau → desale
Loading a javascript: URL results in the expression of the JS in the javascript: URL being loaded. That means if you load "javascript:5", the result of the expression is 5, which is then converted into the string "5" which is then parsed, the result being that the browser window contains the number 5 and nothing else. Likewise the result of loading the javascript: URL "javascript:'<BODY BGCOLOR=red>'" will result in the HTML "<BODY BGCOLOR=red>" being pased. This is how it works in all browsers, this will not be changed in Mozilla. WONTFIX.
Status: NEW → RESOLVED
Closed: 25 years ago
Resolution: --- → WORKSFORME
Ah ok. It didn't make sense at first but that helped clear it up. Verify.
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.