Re: [whatwg] New URL Standard

2012-10-06 Thread Glenn Maynard
On Tue, Sep 25, 2012 at 10:25 PM, Ian Hickson i...@hixie.ch wrote: You could even make that work, by having a special method for appending a new key/value pair, and just not making it accessible. Right, other access methods, like this or a classList-like array, can always be added later.

Re: [whatwg] New URL Standard

2012-09-25 Thread Robin Berjon
On 25/09/2012 01:07 , Glenn Maynard wrote: On Mon, Sep 24, 2012 at 12:30 PM, Tab Atkins Jr. jackalm...@gmail.comwrote: I suggest just making it a map from String-[String]. You probably want a little bit of magic - if the setter receives an array, replace the current value with it; anything

Re: [whatwg] New URL Standard

2012-09-25 Thread Alexandre Morgaut
On 25 sept. 2012, at 13:48, Robin Berjon wrote: On 25/09/2012 01:07 , Glenn Maynard wrote: And round-tripping using ; as the separator instead of . I mention this because I've seen actual production code (more than once) that relied on this. I have no idea how common it is though. I'm

Re: [whatwg] New URL Standard

2012-09-25 Thread Silvia Pfeiffer
On Tue, Sep 25, 2012 at 9:48 PM, Robin Berjon ro...@w3.org wrote: On 25/09/2012 01:07 , Glenn Maynard wrote: On Mon, Sep 24, 2012 at 12:30 PM, Tab Atkins Jr. jackalm...@gmail.comwrote: I suggest just making it a map from String-[String]. You probably want a little bit of magic - if the

Re: [whatwg] New URL Standard

2012-09-25 Thread Anne van Kesteren
On Tue, Sep 25, 2012 at 6:18 AM, Ian Hickson i...@hixie.ch wrote: Not necessarily, but that's certainly possible. Personally I would recommend that we not change the definition of what is conforming from the current RFC3986/RFC3987 rules, except to the extent that the character encoding

Re: [whatwg] New URL Standard

2012-09-25 Thread David Sheets
), and other parts that are defined in terms of BNF (e.g. constraints on the conetnts of script elements in certain situations). It's up to Anne. HTML is far larger and more compositional than URI. I am confident that, no matter what is specified in the WHATWG New URL Standard, a formal language exists

Re: [whatwg] New URL Standard

2012-09-25 Thread David Sheets
On Tue, Sep 25, 2012 at 8:03 AM, Anne van Kesteren ann...@annevk.nl wrote: On Tue, Sep 25, 2012 at 6:18 AM, Ian Hickson i...@hixie.ch wrote: Not necessarily, but that's certainly possible. Personally I would recommend that we not change the definition of what is conforming from the current

Re: [whatwg] New URL Standard

2012-09-25 Thread Ian Hickson
New URL Standard, a formal language exists which can describe the structure of conforming identifiers. If no such formal language can be described, the syntax specification is likely to be incomplete or unsound. Just because it's possible to use a formal language doesn't mean it's a good

Re: [whatwg] New URL Standard

2012-09-25 Thread Anne van Kesteren
On Tue, Sep 25, 2012 at 8:20 PM, David Sheets kosmo...@gmail.com wrote: On Tue, Sep 25, 2012 at 8:03 AM, Anne van Kesteren ann...@annevk.nl wrote: FWIW, given that browsers happily do requests to servers with characters in the URL that are invalid per the RFC (they are not URL escaped) and

Re: [whatwg] New URL Standard

2012-09-25 Thread Glenn Maynard
On Mon, Sep 24, 2012 at 7:18 PM, David Sheets kosmo...@gmail.com wrote: Always. The appropriate interface is (string * string?) list. Id est, an association list of keys and nullable values (null is key-without-value and empty string is empty-value). If you prefer to not use a nullable value

Re: [whatwg] New URL Standard

2012-09-25 Thread David Sheets
On Tue, Sep 25, 2012 at 2:13 PM, Glenn Maynard gl...@zewt.org wrote: On Mon, Sep 24, 2012 at 7:18 PM, David Sheets kosmo...@gmail.com wrote: Always. The appropriate interface is (string * string?) list. Id est, an association list of keys and nullable values (null is key-without-value and

Re: [whatwg] New URL Standard

2012-09-25 Thread Alexandre Morgaut
On 26 sept. 2012, at 00:14, David Sheets wrote: On Tue, Sep 25, 2012 at 2:13 PM, Glenn Maynard gl...@zewt.org wrote: On Mon, Sep 24, 2012 at 7:18 PM, David Sheets kosmo...@gmail.com wrote: The right approach is probably to expose the results in an object-like form, as Tab suggests, but to

Re: [whatwg] New URL Standard

2012-09-25 Thread Glenn Maynard
On Tue, Sep 25, 2012 at 5:14 PM, David Sheets kosmo...@gmail.com wrote: Looking up keys is easy in an association list. Filtering the list retains ordering. Appending to the list is well-defined. Folding into a dictionary is trivial and key merging can be defined according to the author's URL

Re: [whatwg] New URL Standard

2012-09-25 Thread Boris Zbarsky
On 9/25/12 6:53 PM, Glenn Maynard wrote: (Of course, a separate method could exist to get access to the underlying order, if and when real use cases turn up that actually need it, and it's not unlikely that there are use cases--but so far they haven't been raised. The obvious use case is

Re: [whatwg] New URL Standard

2012-09-25 Thread Glenn Maynard
On Tue, Sep 25, 2012 at 8:36 PM, Boris Zbarsky bzbar...@mit.edu wrote: On 9/25/12 6:53 PM, Glenn Maynard wrote: (Of course, a separate method could exist to get access to the underlying order, if and when real use cases turn up that actually need it, and it's not unlikely that there are use

Re: [whatwg] New URL Standard

2012-09-25 Thread Boris Zbarsky
On 9/25/12 10:13 PM, Glenn Maynard wrote: The obvious use case is constructing a URI with a given query by hand, right? If you already have the a=1b=2 string, you can just assign it to .search and not use the prepared-query-parameters interface at all. I was thinking more like you

Re: [whatwg] New URL Standard

2012-09-25 Thread Glenn Maynard
On Tue, Sep 25, 2012 at 9:27 PM, Boris Zbarsky bzbar...@mit.edu wrote: On 9/25/12 10:13 PM, Glenn Maynard wrote: The obvious use case is constructing a URI with a given query by hand, right? If you already have the a=1b=2 string, you can just assign it to .search and not use the

Re: [whatwg] New URL Standard

2012-09-25 Thread Boris Zbarsky
On 9/25/12 10:36 PM, Glenn Maynard wrote: You usually don't care about the resulting order in that case, right? It's not uncommon for servers to depend on a particular order of parameters in the query string and totally fail when the ordering is different. Especially the sort of servers

Re: [whatwg] New URL Standard

2012-09-25 Thread Glenn Maynard
On Tue, Sep 25, 2012 at 9:53 PM, Boris Zbarsky bzbar...@mit.edu wrote: On 9/25/12 10:36 PM, Glenn Maynard wrote: You usually don't care about the resulting order in that case, right? It's not uncommon for servers to depend on a particular order of parameters in the query string and totally

Re: [whatwg] New URL Standard

2012-09-25 Thread Boris Zbarsky
On 9/25/12 11:15 PM, Glenn Maynard wrote: What this doesn't allow is creating things like a=1b=2a=3 Ah. That should be relatively unlikely (though forms with checkboxes in them can in fact lead to query strings like that). -Boris

Re: [whatwg] New URL Standard

2012-09-25 Thread Ian Hickson
On Tue, 25 Sep 2012, Glenn Maynard wrote: What this doesn't allow is creating things like a=1b=2a=3. You can create a=1a=2b=3 (url.query.a = [1,2]; url.query.b = 3), but there's no way to split the keys (a, b, a). This is the limitation we were really talking about. This seems unlikely

Re: [whatwg] New URL Standard

2012-09-24 Thread Tobie Langel
On Mon, Sep 24, 2012 at 10:58 AM, Anne van Kesteren ann...@annevk.nl wrote: The kind of predictability we have for the HTML parser, I want to have for the URL parser as well. Yes, please!! --tobie

Re: [whatwg] New URL Standard

2012-09-24 Thread Anne van Kesteren
On Sat, Sep 22, 2012 at 9:10 AM, Alexandre Morgaut alexandre.morg...@4d.com wrote: Would the URLUtil interface replace the URL decomposition IDL attributes of the Location interface? -

Re: [whatwg] New URL Standard

2012-09-24 Thread Karl Dubost
Le 21 sept. 2012 à 17:16, Anne van Kesteren a écrit : I took a crack at defining URLs: http://url.spec.whatwg.org/ Very cool. On cite attributes, I'm using urn:isbn: blockquote cite=urn:isbn:2-7073-1038-7 pJ'aime la liberté. J'aime être responsable de mes actes. J'aime comprendre

Re: [whatwg] New URL Standard

2012-09-24 Thread Jukka K. Korpela
2012-09-24 12:47, Karl Dubost wrote: On cite attributes, I'm using urn:isbn: blockquote cite=urn:isbn:2-7073-1038-7 pJ'aime la liberté. J'aime être responsable de mes actes. J'aime comprendre ce que je fais… Et, cependant, je donne mon accord à ce marché bizarre./p

Re: [whatwg] New URL Standard

2012-09-24 Thread Alexandre Morgaut
On 24 sept. 2012, at 11:34, Anne van Kesteren wrote: Could the search property have a key/value mapping? ex: http://test.com?param1=value1 - var value1 = url.search.param1 search as window.location could still be usable as a string I have been thinking about introducing a .query attribute

Re: [whatwg] New URL Standard

2012-09-24 Thread Alexandre Morgaut
On 24 sept. 2012, at 14:08, Alexandre Morgaut wrote: sms:+15105550101?body=hello%20there { host: +15105550101, hostname: +15105550101, href: +15105550101?body=hello%20there, parameters: { body: hello there } pathname: ,

Re: [whatwg] New URL Standard

2012-09-24 Thread Karl Dubost
Le 24 sept. 2012 à 12:08, Jukka K. Korpela a écrit : It also means that the only immediately available source information for a quotation will be an ISBN in URL format. So, for example, working offline, you won't see even the title and the author. Would the quotation even satisfy the legal

Re: [whatwg] New URL Standard

2012-09-24 Thread Boris Zbarsky
On 9/24/12 4:58 AM, Anne van Kesteren wrote: Say you have a href=data:test/; the concern is what e.g. a.protocol and a.pathname would return here. For invalid URLs they would return : and respectively. If we treat this as a valid URL you would get data: and test. In Gecko I get http: and . If I

Re: [whatwg] New URL Standard

2012-09-24 Thread Tab Atkins Jr.
On Mon, Sep 24, 2012 at 2:34 AM, Anne van Kesteren ann...@annevk.nl wrote: I have been thinking about introducing a .query attribute that would return a special interface for this purpose, but what the right API should be seems somewhat tricky. Adam and Erik came up with a solution that

Re: [whatwg] New URL Standard

2012-09-24 Thread David Sheets
On Mon, Sep 24, 2012 at 2:34 AM, Anne van Kesteren ann...@annevk.nl wrote: On Sat, Sep 22, 2012 at 9:10 AM, Alexandre Morgaut alexandre.morg...@4d.com wrote: Shouldn't this document have references on some of the URL related RFCs: The plan is to obsolete the RFCs. But yes, I will add some

Re: [whatwg] New URL Standard

2012-09-24 Thread Glenn Maynard
On Mon, Sep 24, 2012 at 12:30 PM, Tab Atkins Jr. jackalm...@gmail.comwrote: I suggest just making it a map from String-[String]. You probably want a little bit of magic - if the setter receives an array, replace the current value with it; anything else, stringify then wrap in an array and

Re: [whatwg] New URL Standard

2012-09-24 Thread David Sheets
On Mon, Sep 24, 2012 at 4:07 PM, Glenn Maynard gl...@zewt.org wrote: On Mon, Sep 24, 2012 at 12:30 PM, Tab Atkins Jr. jackalm...@gmail.comwrote: I suggest just making it a map from String-[String]. You probably want a little bit of magic - if the setter receives an array, replace the current

Re: [whatwg] New URL Standard

2012-09-24 Thread Ian Hickson
On Mon, 24 Sep 2012, David Sheets wrote: Is there an issue with defining WHATWG-URL syntax as a grammar extension to the URI syntax in RFC3986? In general, BNF isn't very useful for defining the parsing rules when you also need to handle non-conforming content in a correct manner. Really it

Re: [whatwg] New URL Standard

2012-09-24 Thread David Sheets
On Mon, Sep 24, 2012 at 5:23 PM, Ian Hickson i...@hixie.ch wrote: On Mon, 24 Sep 2012, David Sheets wrote: Is there an issue with defining WHATWG-URL syntax as a grammar extension to the URI syntax in RFC3986? In general, BNF isn't very useful for defining the parsing rules when you also

Re: [whatwg] New URL Standard

2012-09-24 Thread Ian Hickson
This is Anne's spec, so I'll let him give more canonical answers, but: On Mon, 24 Sep 2012, David Sheets wrote: Your conforming WHATWG-URL syntax will have production rule alphabets which are supersets of the alphabets in RFC3986. Not necessarily, but that's certainly possible. Personally

Re: [whatwg] New URL Standard

2012-09-23 Thread Maciej Stachowiak
Excellent work. Did you use tests while making this and if so did you save them? It might be worthwhile to check all the browsers against the spec. Cheers, Maciej On Sep 21, 2012, at 8:16 AM, Anne van Kesteren ann...@annevk.nl wrote: I took a crack at defining URLs:

Re: [whatwg] New URL Standard

2012-09-22 Thread Alexandre Morgaut
Thanks Anne, I'd appreciate to be able to easily get a URLUtil interface from a string UTL without doing some nasty hacks I have a ew questions Would the URLUtil interface replace the URL decomposition IDL attributes of the Location interface? -

[whatwg] New URL Standard

2012-09-21 Thread Anne van Kesteren
I took a crack at defining URLs: http://url.spec.whatwg.org/ At the moment it defines parsing (minus domain names / IP addresses) and the JavaScript API (minus the query manipulation methods proposed by Adam Barth). It defines things like setting .pathname to hello world (notice the space), it

Re: [whatwg] New URL Standard

2012-09-21 Thread Boris Zbarsky
On 9/21/12 11:16 AM, Anne van Kesteren wrote: It is based on the various URL code paths found in WebKit and Gecko and supports the \ as / in various places because it seemed better for compatibility. Or worse, depending on your use cases... * data URLs; in Gecko these appear to be parsed as

Re: [whatwg] New URL Standard

2012-09-21 Thread Julian Reschke
On 2012-09-21 17:16, Anne van Kesteren wrote: I took a crack at defining URLs: http://url.spec.whatwg.org/ At the moment it defines parsing (minus domain names / IP addresses) and the JavaScript API (minus the query manipulation methods proposed by Adam Barth). It defines things like setting