Closed Bug 532602 Opened 15 years ago Closed 7 years ago

location.href throws error

Categories

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

1.9.2 Branch
x86
Windows 7
defect
Not set
major

Tracking

()

RESOLVED INVALID

People

(Reporter: bugzilla33, Unassigned)

References

()

Details

(Keywords: html5, Whiteboard: [urispec])

Attachments

(1 file)

User-Agent:       Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2; FDM)
Build Identifier: 


location.href throws error when use not registered protocol

Reproducible: Always

Steps to Reproduce:

run attachement

Actual Results:  

throws error


Expected Results:  

no error



other browsers do not throw errors
Component: General → DOM
Product: Firefox → Core
Version: unspecified → 1.9.2 Branch
Attached file testcase
Summary: location.href throw error → location.href throws error
Link in raw HTML do not throw errors.
<a href="custom://link">custom://link</a>

Only JS location.href
<span onclick="location.href='custom://link'">custom://link</span>
QA Contact: general → general
There's no way to throw an exception from the <a href>, since that's not in script.

You presumably want the browser to silently do nothing instead.  It's not clear to me why this would be better than telling the calling script that the load is flatly not possible, but in any case it needs spec work.
Keywords: html5
The spec [1] requires raising a SYNTAX_ERR if resolving the URL is unsuccessful. However, thanks to the URI people, the resolving algorithm is useless ATM.

[1] <http://www.whatwg.org/html/#dom-location-href>
Whiteboard: [urispec]
So setting href invokes http://url.spec.whatwg.org/#dom-url-href which invokes stuff from http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#location which throws an exception. I guess the question is whether that should be caught or not.
This is per the standard.
Status: UNCONFIRMED → RESOLVED
Closed: 7 years ago
Resolution: --- → INVALID
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: