Closed Bug 293841 Opened 20 years ago Closed 20 years ago

weird recursive behavior with document.write in data: URL

Categories

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

x86
Linux
defect
Not set
normal

Tracking

()

VERIFIED INVALID

People

(Reporter: dbaron, Unassigned)

References

()

Details

(Whiteboard: INVALID?)

Attachments

(1 file)

Somebody pointed this out on IRC sometime in the past week, and I couldn't find
a bug on it.

Loading the URL data:text/html,<script>document.write(window.location);</script>
causes weird recursive behavior.

Steps to reproduce:
 1. load data:text/html,<script>document.write(window.location);</script>

Expected results:
 1. "data:text/html,<script>document.write(window.location);</script>"

Actual results:
 1. data:text/html,data:text/html,data:text/html,data:text/html,...
 2. 
Error: too much recursion
Source File: data:text/html,x<script>document.write(window.location);</script>
Line: 1

Stack showing the recursion to be attached.
Note that frame #0 matches frame #29.
I was the one who found this and mentioned it on #content.  Big fun, and the JS
recursion limiter saves the day.  Thanks for filing it.

/be
I disagree with the expected results.

You're document.write()ing a <script> tag. Thus that <script> tag is going to
execute. That <script> tag happens to be what you're currently executing, but
that's not the point.

To me it seems that this is exactly correct behaviour.
Whiteboard: INVALID?
Hixie's right!  Fun.

/be
Status: NEW → RESOLVED
Closed: 20 years ago
Resolution: --- → INVALID
Agreed
Status: RESOLVED → VERIFIED
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: