This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 22096 - no one set URLQuery's url object
Summary: no one set URLQuery's url object
Status: RESOLVED WORKSFORME
Alias: None
Product: WHATWG
Classification: Unclassified
Component: URL (show other bugs)
Version: unspecified
Hardware: PC All
: P2 normal
Target Milestone: Unsorted
Assignee: Anne
QA Contact: sideshowbarker+urlspec
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-05-20 07:41 UTC by NARUSE, Yui
Modified: 2014-01-14 11:14 UTC (History)
1 user (show)

See Also:


Attachments

Description NARUSE, Yui 2013-05-20 07:41:12 UTC
Maybe this is intentional, on current spec no one set URLQuery's url object though it is not a public API.
set the input, Setting the search, and Setting the query looks need to set url object.
Comment 1 Anne 2013-05-20 07:45:29 UTC
If you mean something other than http://url.spec.whatwg.org/#concept-uq-update could you please clarify.
Comment 2 NARUSE, Yui 2013-05-20 08:01:02 UTC
(In reply to comment #1)
> If you mean something other than
> http://url.spec.whatwg.org/#concept-uq-update could you please clarify.

As far as I understand, current spec causes following situation:

    url = URL.new("http://example.com/?foo=bar")
    q = url.query
    q.get("foo") #=> "bar"
    q.set("foo", "blah")
    q.get("foo") #=> "blah"
    q.url_object #=> null
    url.href #=> http://example.com/?foo=bar

I changed the URLQuery object, but original URL object is unchanged.
I felt this is odd.
Comment 3 Anne 2013-05-20 08:04:05 UTC
When you do set() the update steps are run and those update the associated url object.
Comment 4 NARUSE, Yui 2013-05-20 08:28:25 UTC
(In reply to comment #3)
> When you do set() the update steps are run and those update the associated
> url object.

It can get "the associated url object" from URL Query's url object.
But when URL Query's associated url object property is set?
Comment 5 Anne 2013-05-20 08:59:56 UTC
So url object of x is just defined as whatever object that has its query object set to x. It's mostly a convenience. I guess I could add a note to that effect once I think of what it should say.
Comment 6 NARUSE, Yui 2013-05-20 09:29:34 UTC
(In reply to comment #5)
> So url object of x is just defined as whatever object that has its query
> object set to x. It's mostly a convenience. I guess I could add a note to
> that effect once I think of what it should say.

You mean URLUtils and URL doesn't specify to set url object, but a browser may implement another object which sets the object x's url object?
Comment 7 Anne 2013-06-20 06:04:39 UTC
Your questions are hard to follow for me, but from what you say in comment 4 "But when URL Query's associated url object property is set?"

What the standard does is it defines this in English as follows: "A URLQuery object has an associated /url object/ which is an object implementing URLUtils whose /query object/ is the URLQuery object, and null if there is no such object." So basically it does not have to be set, it will always be something. When you implement this you'll have to do this manually and there's a number of ways you can do that.