[whatwg] URL interop status and reference implementation demos

2014-11-18 Thread Sam Ruby
Anne has kindly given me access to the directory on the server where the 
url.spec lives.  I've started to move some of my work there.


https://url.spec.whatwg.org/interop/urltest-results/

Note that the expected results come from:

https://github.com/w3c/web-platform-tests/blob/master/url/urltestdata.txt

I'd like to suggest that the following test be added:

https://github.com/rubys/url/blob/peg.js/reference-implementation/test/moretestdata.txt

And that the expected results be changed on the following tests:

https://github.com/rubys/url/blob/peg.js/reference-implementation/test/patchtestdata.txt

Note: I appear to have direct update access to urltestdata.txt, but I 
would appreciate a review before I make any updates.


- - -

I also have a reference implementation I've been working on.  First, a 
basic interface:


https://url.spec.whatwg.org/reference-implementation/liveview.html

A second interface allows you to override the base:

https://url.spec.whatwg.org/reference-implementation/liveview2.html

A third interface allows you to see what happens when you call 
individual setters:


https://url.spec.whatwg.org/reference-implementation/liveview3.html

Note: while all versions are a work in progress, this is more true for 
liveview3 than the others.  In particular, this was created today, and 
only has href, protocol, and username roughed in at the moment.


The setters also have unit tests:

https://github.com/rubys/url/blob/peg.js/reference-implementation/test/urlsettest.js

I'm planning to refactor these tests, separating the test data from the 
code so that other libraries and user agents can test against the same 
data.  Once I do, I'll publish interop test results for these setters too.


As a final note, the reference implementation has a list of known 
differences from the published standard:


intertwingly.net/projects/pegurl/url.html

- Sam Ruby


Re: [whatwg] URL interop status and reference implementation demos

2014-11-18 Thread Domenic Denicola
Really exciting stuff :D. I love specs that have reference implementations and 
strong test suites and am hopeful that as URL gets fixes and updates that these 
stay in sync. E.g. normal software development practices of not changing 
anything without a test, and so on.

From: whatwg [mailto:whatwg-boun...@lists.whatwg.org] On Behalf Of Sam Ruby

 https://url.spec.whatwg.org/interop/urltest-results/

I'd be interested in a view that only contains refimpl, ie, safari, firefox, 
and chrome, so we could compare the URL Standard with living browsers.

 I'd like to suggest that the following test be added:
 
 https://github.com/rubys/url/blob/peg.js/reference-implementation/test/moretestdata.txt

 And that the expected results be changed on the following tests:
 
 https://github.com/rubys/url/blob/peg.js/reference-implementation/test/patchtestdata.txt
 
 Note: I appear to have direct update access to urltestdata.txt, but I would 
 appreciate a review before I make any updates.

A pull request with a nice diff would be easy to review, I think?

 The setters also have unit tests:
 
 https://github.com/rubys/url/blob/peg.js/reference-implementation/test/urlsettest.js

So good!

For streams I am running the unit tests against my reference implementation on 
every commit (via Travis). Might be worth setting up something similar.

 As a final note, the reference implementation has a list of known differences 
 from the published standard:

 intertwingly.net/projects/pegurl/url.html

Hmm, so this isn't really a reference implementation of the published standard 
then? Indeed looking at the code it seems to not follow the algorithms in the 
spec at all :(. That's a bit unfortunate if the goal is to test that the spec 
is accurate.

I guess 
https://github.com/rubys/url/tree/peg.js/reference-implementation#historical-notes
 explains that. Hmm. In that case, I'm unclear in what sense this is a 
reference implementation, instead of an alternate algorithm.



Re: [whatwg] URL interop status and reference implementation demos

2014-11-18 Thread Sam Ruby

On 11/18/2014 06:37 PM, Domenic Denicola wrote:



As a final note, the reference implementation has a list of known
differences from the published standard:

intertwingly.net/projects/pegurl/url.html


Hmm, so this isn't really a reference implementation of the published
standard then? Indeed looking at the code it seems to not follow the
algorithms in the spec at all :(. That's a bit unfortunate if the
goal is to test that the spec is accurate.


Let me help by connecting the dots.

Bug https://www.w3.org/Bugs/Public/show_bug.cgi?id=25946 is open to 
rewrite the URL parser.  Comment 8 and 9 endorse the following work in 
progress:


http://intertwingly.net/projects/pegurl/url.html

Just today, I integrated my Anolis to Bikeshed work, which is a 
prerequisite for completing this.


The reference implementation is a faithful attempt to implement the 
reworked parsing logic.  In fact, parts of the specification and parts 
of the reference implementation are generated from a single file:


https://raw.githubusercontent.com/rubys/url/peg.js/url.pegjs

Hopefully shortly this all will land in the live version of the spec, 
meanwhile it attempts to skate to where the puck will be.  In each 
case of a known difference in published results, I've linked to 
rationale for the change (generally to an indication that Anne agrees).


I hope this helps.

- Sam Ruby





Re: [whatwg] URL interop status and reference implementation demos

2014-11-18 Thread Ian Hickson
On Tue, 18 Nov 2014, Sam Ruby wrote:

 Anne has kindly given me access to the directory on the server where the 
 url.spec lives.  I've started to move some of my work there.
 
 https://url.spec.whatwg.org/interop/urltest-results/

IMHO it's probably best to keep data like that on personal sites (or on 
the wiki) rather than on the spec's site. If it's on the spec's site and 
it starts getting out of date with no-one maintaining it, we'd want to 410 
it to reduce confusion, but then the data would be lost, which would be 
unfortunate. (That's why, for example, I put all my tests and demos on 
hixie.ch or damowmow.com, rather than on html.spec.whatwg.org.) You could 
use the wiki; that's essentially defined as the sandbox for the WHATWG, 
where stuff can easily get stale but isn't supposed to be treated as in 
any way authoritative (the FAQ notwithstanding).


 I also have a reference implementation I've been working on.

By reference implementation do you mean a normative one?

If it's just a regular implementation, then it should definitely not be on 
the WHATWG site, IMHO, since that would mislead other implementors into 
thinking it's special. If it's actually intended to be a true reference 
implementation, then that's interesting; is this intended to replace the 
spec in due course?


Generally I would recommend only putting specs on *.spec.whatwg.org.

-- 
Ian Hickson   U+1047E)\._.,--,'``.fL
http://ln.hixie.ch/   U+263A/,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'