Closed Bug 959190 Opened 6 years ago Closed 6 years ago

URL objects lack proper stringification

Categories

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

28 Branch
x86
macOS
defect
Not set

Tracking

()

VERIFIED FIXED
mozilla29

People

(Reporter: claude.pache, Assigned: baku)

Details

(Whiteboard: [good first verify])

Attachments

(1 file, 1 obsolete file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.9; rv:26.0) Gecko/20100101 Firefox/26.0 (Beta/Release)
Build ID: 20131205075310

Steps to reproduce:

Type in the console:

(new URL('http://example.com')) + ""



Actual results:

"[object URL]"


Expected results:

"http://example.com/"
For reference:

http://url.spec.whatwg.org/#api

URLUtils and URLUtilsReadonly interfaces use the `href` attribute as stringifier.
And our WebIDL has the stringifier on it ... do stringifiers not work?  or do they not carry across implements statements?
Flags: needinfo?(bzbarsky)
Andrea, did you miss this in bug 887364?  Or has the spec changed since then?
Status: UNCONFIRMED → NEW
Ever confirmed: true
Flags: needinfo?(amarchesini)
> do stringifiers not work? 

Stringifier _attributes_ do not work so far in our WebIDL implementation.  See bug 851891 for making it a build-time error to try using one.

We should be using an anonymous stringifier method here.
Flags: needinfo?(bzbarsky)
And add a test!
And see bug 824857 for adding support for stringifier attributes.
Assignee: nobody → amarchesini
Flags: needinfo?(amarchesini)
(In reply to Boris Zbarsky [:bz] from comment #3)
> Andrea, did you miss this in bug 887364?  Or has the spec changed since then?

I think the spec is changed. I don't remember. But it's doesn't really matter. I'm going to fix it asap.
Attached patch url.patch (obsolete) — Splinter Review
I removed 'stringify' in any webidl interface inheriting URLUtils.
Attachment #8359259 - Flags: review?(bzbarsky)
Attached patch url.patchSplinter Review
test for any stringify interface.
Attachment #8359259 - Attachment is obsolete: true
Attachment #8359259 - Flags: review?(bzbarsky)
Attachment #8359261 - Flags: review?(bzbarsky)
Comment on attachment 8359261 [details] [diff] [review]
url.patch

r=me.  Thank you for doing this!
Attachment #8359261 - Flags: review?(bzbarsky) → review+
https://hg.mozilla.org/mozilla-central/rev/e2f3827a2f44
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla29
Whiteboard: [good first verify]
[testday-20140411]
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:29.0) Gecko/20100101 Firefox/29.0

This issue is fixed on Windows 7 SP1 x64, using the latest Beta (20140410150427).
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.