Closed Bug 562433 Opened 10 years ago Closed 9 years ago
.host and location .hostname to return "" for host-less URIs instead of throwing
> location.host and location.hostname information of the newly created window The location of the window at the point when you're examining it is "about:blank". What, exactly, do you expect as the host? It looks like webkit reports "" as the host, which doesn't really make any sense either. Opera seems to report the post-load location, which may be true for them; no idea.
Note that the HTML5 spec almost certainly defines how the Location object should behave for thingsl like about:blank.
Without digging deep into the HTML5 spec (so please correct me if I'm wrong), the expected result should either be the host information after load or if location is about:blank the host information of the creator.
Looks like the current HTML5 spec text calls for "" to be returned here. See http://www.whatwg.org/specs/web-apps/current-work/multipage/urls.html#interfaces-for-url-manipulation and the link to that from http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#dom-location-host Of course that depends on the current address bit, but that's unambiguously about:blank in this case. See http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html#dom-open and the steps at http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#navigate and particularly step 12.
w.close in the test doesn't close the new window, does it need special privileges?
Assignee: nobody → wesongathedeveloper
Status: NEW → ASSIGNED
Attachment #450200 - Flags: review?(bzbarsky)
> w.close in the test doesn't close the new window, does it need special > privileges? No. It should work.
Comment on attachment 450200 [details] [diff] [review] Patch This looks fine, though s/is not/should be/ in the test messages, please. And you don't need the wait/finish stuff, do you?
Attachment #450200 - Flags: review?(bzbarsky) → review+
addressed above issues
Attachment #450200 - Attachment is obsolete: true
You need to log in before you can comment on or make changes to this bug.