Closed Bug 331614 Opened 18 years ago Closed 18 years ago

window.open unnecessarily escapes all URLs (can't handle IDN/extended domain-names)

Categories

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

1.8 Branch
defect
Not set
major

Tracking

()

RESOLVED FIXED
mozilla1.8.1beta1

People

(Reporter: verrueckter, Assigned: Gavin)

References

Details

(Keywords: fixed1.8.1, regression)

Attachments

(2 files)

User-Agent:       Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1) Gecko/20060314 Ubuntu/dapper Epiphany/2.14 Firefox/1.5.0.1
Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.0.1) Gecko/20060314 Ubuntu/dapper Epiphany/2.14 Firefox/1.5.0.1

window.open(var) cannot resolve the given url

where var = img.src = "./img/img.jpg"(passed to JS) on a IDN-domain

see: www.etk-füwa.de/?etk=home  // http://xn--etk-fwa-r2a.de/?etk=home
(click on the picture)

happens with FF 1.5+ (1.0.7 works)

Reproducible: Always



Expected Results:  
resolved the IDN correctly
Keywords: regression
Confirmed with a trunk build from within the last week.

Firefox tries to access www.etk-f%fcwa.de and is unable to do that because of bug 309671.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Version: unspecified → Trunk
(In reply to comment #0)
> window.open(var) cannot resolve the given url
> 
> where var = img.src = "./img/img.jpg"(passed to JS) on a IDN-domain
> 
Er, that's not true. It's indeed <img src="./img/img.jpg">, but img.src (actually called document.T1.src) is "http://etk-füwa.de/img/team.jpg". So what actually happens, I think, is window.open("http://etk-füwa.de/img/team.jpg") is called and it escapes the unicode character in 1.5.
I'm not familiar enough with IDN to know what exactly is wrong here apart from the fact that we can't load escaped URLs. I guess it would be interesting to know what has changed since 1.0 here (the return value of img.src?)
Blocks: IDN
> I guess it would be interesting to
> know what has changed since 1.0 here (the return value of img.src?)

just tested... in 1.0.7 "http://www.etk-füwa.de" is transformed to the non-extended domain "http://xn--etk-fwa-r2a.de/" (i guess for security reasons.. there was a phishing-thing with IDN in the past). 
Assignee: nobody → gavin.sharp
Component: General → DOM
Product: Firefox → Core
QA Contact: general → general
Hardware: PC → All
Status: NEW → ASSIGNED
Summary: JavaScript is unable to handle IDN (extended) domain-names on FF 1.5+ → window.open unnecessarily escapes all URLs (can't handle IDN/extended domain-names)
Target Milestone: --- → mozilla1.9alpha
Attached patch don't escapeSplinter Review
Attachment #217983 - Flags: superreview?(darin)
Attachment #217983 - Flags: review?(bzbarsky)
Attached file testcase
Works with the patch, fails without.
Comment on attachment 217983 [details] [diff] [review]
don't escape

r=bzbarsky.  I love it when removing code fixes bugs.  ;)
Attachment #217983 - Flags: review?(bzbarsky) → review+
Comment on attachment 217983 [details] [diff] [review]
don't escape

sr=darin
Attachment #217983 - Flags: superreview?(darin) → superreview+
Whiteboard: [checkin needed]
mozilla/dom/src/base/nsGlobalWindow.cpp 	1.838
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Comment on attachment 217983 [details] [diff] [review]
don't escape

This has been on the trunk for a while with no known regressions, so I'd like to land it on the branch.
Attachment #217983 - Flags: approval-branch-1.8.1?(bzbarsky)
Attachment #217983 - Flags: approval-branch-1.8.1?(bzbarsky) → approval-branch-1.8.1+
Whiteboard: [checkin needed (1.8 branch)]
mozilla/dom/src/base/nsGlobalWindow.cpp 	1.761.2.38
Keywords: fixed1.8.1
Whiteboard: [checkin needed (1.8 branch)]
Target Milestone: mozilla1.9alpha → mozilla1.8.1beta1
Version: Trunk → 1.8 Branch
*** Bug 348054 has been marked as a duplicate of this bug. ***
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: