Re: [selectors-api] Test Suite Progress

2009-11-24 Thread Lachlan Hunt

Lachlan Hunt wrote:

I have now split the test suite up into 3 files, similar to how I
prevoiusly described [1]:

1. Baseline Tests: HTML with CSS Level 2.1 Selectors.
2. Additional Tests: HTML with Selectors Level 3.
3. Additional Tests: XHTML+SVG with Selectors Level 3.

http://dev.w3.org/2006/webapi/selectors-api-testsuite/


More progress has now been made, and each of those test files have been 
updated and all bugs I'm aware of have been fixed.



I've also begun to add tests for the namespace selector syntax [2] to
the second set, but they are currently a work in progress and are not
functioning properly. If anyone can figure out what I've done wrong,
please let me know. Once these are written, they will also be
incorporated into the third set.


I managed to find a simple solution to this bug adding HTML elements as 
descendants of the non-namespaced elements, and made those the target of 
the selector instead.  This allows the .style property to be checked by 
the script to make sure the color is green.



The third set is an XHTML version of the tests which incorporates the
tests that Erik had submitted [3]. I haven't verified that all these
tests are functioning properly, I simply applied the patch from Erik
without modification.


I fixed a few bugs in bugs in these tests and it now works properly.

The Firefox trunk, Minefield, now passes 100% of all those tests, making 
it the first browser to do so.



Finally, I still need to merge in the tests from Hixie [4].

[4] http://www.hixie.ch/tests/adhoc/dom/selectors/001.html


I'm not sure whether or not I should incorporate any of those tests.  I 
need to check which are not covered by the existing test suite.  Those 
tests pass in Opera and Firefox, but WebKit has 2 failures relating to 
NodeLists (tests 011 and 082).  The bug is that webkit exposes the IDs 
of elements in the list as properties on the node list, such that 
nodelist.elementid returns an element with that ID, if it exists.


--
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/



[selectors-api] Test Suite Progress

2009-07-24 Thread Lachlan Hunt

Hi,
  I've made some progress with the test suite.

I have now split the test suite up into 3 files, similar to how I 
prevoiusly described [1]:


1. Baseline Tests: HTML with CSS Level 2.1 Selectors.
2. Additional Tests: HTML with Selectors Level 3.
3. Additional Tests: XHTML+SVG with Selectors Level 3.

http://dev.w3.org/2006/webapi/selectors-api-testsuite/

The baseline tests in the first file are a subset of all the tests in 
the second.  To create it, I basically removed any test using a selector 
introduced in Selectors 3 without modifying other tests.


I've also begun to add tests for the namespace selector syntax [2] to 
the second set, but they are currently a work in progress and are not 
functioning properly.  If anyone can figure out what I've done wrong, 
please let me know.  Once these are written, they will also be 
incorporated into the third set.


The third set is an XHTML version of the tests which incorporates the 
tests that Erik had submitted [3].  I haven't verified that all these 
tests are functioning properly, I simply applied the patch from Erik 
without modification.


Finally, I still need to merge in the tests from Hixie [4].

If anyone has the time and motivation and would like to assist with 
incorporating/fixing these tests, please let me know.


[1] http://lists.w3.org/Archives/Public/public-webapps/2009AprJun/1221.html
[2] http://lists.w3.org/Archives/Public/public-webapps/2009JanMar/0713.html
[3] http://lists.w3.org/Archives/Public/public-webapps/2009JanMar/0788.html
[4] http://www.hixie.ch/tests/adhoc/dom/selectors/001.html

--
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/



Re: [selectors-api] Test Suite Progress

2009-07-24 Thread Boris Zbarsky

Lachlan Hunt wrote:
I've also begun to add tests for the namespace selector syntax [2] to 
the second set, but they are currently a work in progress and are not 
functioning properly.  If anyone can figure out what I've done wrong, 
please let me know.


I'm glad to try to figure that out, if you give me some idea of what 
not functioning properly means here...  As far as I can tell, Gecko 
and Webkit are both passing the namespace syntax tests you have here. 
Is the problem that they're passing when they shouldn't be?  Or 
something else?


-Boris



Re: [selectors-api] Test Suite Progress

2009-07-24 Thread Lachlan Hunt

Boris Zbarsky wrote:

Lachlan Hunt wrote:

I've also begun to add tests for the namespace selector syntax [2] to
the second set, but they are currently a work in progress and are not
functioning properly. If anyone can figure out what I've done wrong,
please let me know.


I'm glad to try to figure that out, if you give me some idea of what
not functioning properly means here... As far as I can tell, Gecko and
Webkit are both passing the namespace syntax tests you have here. Is the
problem that they're passing when they shouldn't be? Or something else?


Both Minefield and Webkit trunk are failing those tests for me.  I have 
all but one commented out just so it would make my debugging easier (see 
lines 287 to 292 in 002.html).


But for the one that's still uncommented, it's failing.  In the current 
version, the output is now:


FAIL Element.querySelectorAll: .any-namespace *|div, e.code = TypeError: 
Result of expression 'found[f].style' [null] is not an object.


I just checked in a new copy that outputs the exception message for 
debugging.  So based on that, the problem is that when it tries to check 
the style of the found element, it fails because it's dealing with 
elements in namespaces other than the HTML namespace, so they don't have 
a .style property.  I'm not sure what we can do to workaround that easily.


--
Lachlan Hunt - Opera Software
http://lachy.id.au/
http://www.opera.com/



Re: [selectors-api] Test Suite Progress

2009-07-24 Thread Boris Zbarsky

Lachlan Hunt wrote:
Both Minefield and Webkit trunk are failing those tests for me.  I have 
all but one commented out just so it would make my debugging easier (see 
lines 287 to 292 in 002.html).


Oh, I'd just missed the one failing test.  Showing only failing tests 
helped!


I just checked in a new copy that outputs the exception message for 
debugging.  So based on that, the problem is that when it tries to check 
the style of the found element, it fails because it's dealing with 
elements in namespaces other than the HTML namespace, so they don't have 
a .style property.


Yep.


 I'm not sure what we can do to workaround that easily.


Hmm.  For the any-namespace test you could use a non-HTML node that 
happens to have .style (like SVG, say).


For the no-namespace test, you'd want the harness to be somewhat 
different here...  Maybe ask John Resig if he has any ideas, since he 
presumably knows this code pretty well?


-Boris