Closed Bug 196404 Opened 22 years ago Closed 22 years ago

setting document.location.href while showing about:blank broken

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dbaron, Assigned: keeda)

References

()

Details

(Keywords: regression)

Attachments

(1 file)

Setting document.location.href from a bookmarklet is now broken if the current page being shown is about:blank. This is a regression caused by radha's checkin to nsLocation.cpp, revision 1.107, for bug 162128. Steps to reproduce: 1. bookmark the URL (perhaps in the personal toolbar): javascript:void(id=prompt('Show Mozilla bug no.',''));if(id){void(location.href='http://bugzilla.mozilla.org/show_bug.cgi?id='+escape(id)+' ')} 2. load about:blank in a Window (I'm using Phoenix, but I'd guess it doesn't matter whether one uses Phoenix or Mozilla) 3. Click the bookmark. 4. Type a bug number into the alert. Expected results: * load that bug number Actual results: * error on JS console saying that nsIDOMLocation.href setter returned NS_ERROR_FAILURE.
Attached patch fixSplinter Review
Restores old behavior if the attempt to figure out a "more useful" base URI doesnt work. (In this particular case, we have a root docshell with a about:blank uri. FindUsableBaseURI() really cant do anything smart.)
Attachment #116695 - Flags: superreview?(jst)
Attachment #116695 - Flags: review?(radha)
Attachment #116695 - Flags: superreview?(jst) → superreview+
Blocking 1.4a since it's a regression and we hate those.
Flags: blocking1.4a+
Taking bug since I already have a patch.
Assignee: jst → keeda
Attachment #116695 - Flags: review?(radha) → review+
Checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: