Re: choice of javascript DOM methods suitable for use in tests

On 25/11/10 10:03, David Carlisle wrote:
>
> I have pushed
>
> http://test.w3.org/html/tests/submission/DavidCarlisle/math-render01.html
>
> not to ask for approval yet, but to ask for policy regarding choice of
> javascript methods.
>
> I don't want these mathml tests to be a test of supported javascript but
> I wanted to add some basic tests that didn't just test parsing.
>
> The above just checks that the dimensions of (a span containing) an
> mfrac are the same as the dimensions of the same content with all mathml
> elements replaced by spans. I.e., it just checks that it does
> _something_ with the math.
>
> I used offsetWidth but the specification and implementation of this and
> related methods like scrollWidth etc seems to have had a somewhat
> tortuous history. If the above is acceptable, there are of course
> several other MathML elements that we could test in a similar way, but I
> wanted to test the water first, to see whether this is an acceptable
> testing strategy.

My gut reaction is testing stuff like this is undesirable, and that just 
using a negative reftest would be a better fit for such tests. However, 
in this specific case, I'd go further and ask is there actually anywhere 
in the spec that expects MathML fragments to have any specific 
rendering? I can't quickly looking find one, and if not, it seems like 
such a test is out of scope.

> Note the (current) intention here is to keep the mathml-in-html tests to
> purely automatic javascript tests using the provided test harness.

I'm not sure that's really a good idea for purely visual tests, FWIW. 
When we have a test type for visual tests, it seems better to use that.

-- 
Geoffrey Sneddon — Opera Software
<http://gsnedders.com>
<http://opera.com>

Received on Monday, 29 November 2010 06:47:56 UTC