Closed Bug 376809 Opened 18 years ago Closed 17 years ago

Relative URLs (e.g. to stylesheet) don't work for documents created with document.write

Categories

(Core :: DOM: HTML Parser, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: duncan.loveday, Assigned: mrbkap)

References

Details

Attachments

(4 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-GB; rv:1.8.1.1) Gecko/20061204 Firefox/2.0.0.1 A document created entirely from javascript, for example by executing var w=window.open(""); w.document.writeln("<html>....</html"); and which contains relative URLs, for example a stylesheet, will not succeed in loading the reference file. No warnings are output. Reproducible: Always Steps to Reproduce: 1. Save the attached stylesheet and html file in a directory. 2. Open the HTML file in Firefox 2. 3. Actual Results: The text is displayed in the default style. Expected Results: The text should be displayed in font size 32, bold and red as defined by the stylesheet. Note that this works in the FF3 trunk builds so I guess this bug will just get closed as FIXED. I only raise it to document the situation. The attached test case also contains a workaround (explicitly adding the base path to the relative URL). I don't know if this ever worked in earlier versions.
Attached file test HTML source (obsolete) —
Attached file test CSS source
Attached file test HTML source
Oops - had the workaround uncommented
Attachment #260912 - Attachment is obsolete: true
FWIW Here's another example - FF2 fails to resolve a relative URL in a hyperlink. Again, works in the FF3 trunk.
Summary: Relative URLs (e.g. to stylesheet) don't work for documents created by javascript → Relative URLs (e.g. to stylesheet) don't work for documents created with document.write
FWIW The current version of Opera has the same issue.
Should this be closed as WFM ? Can't remember why I raised this now as it works in the trunk builds.
-> WORKSFORME per comment 8.
Status: UNCONFIRMED → RESOLVED
Closed: 17 years ago
Resolution: --- → WORKSFORME
Version: unspecified → Trunk
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: