W3C home > Mailing lists > Public > public-css-testsuite@w3.org > March 2015

Re: [css3-ui] cursor image format tests

From: Florian Rivoal <florian@rivoal.net>
Date: Mon, 23 Mar 2015 18:10:53 +0100
Cc: "public-css-testsuite@w3.org" <public-css-testsuite@w3.org>
Message-Id: <F7D33FFE-CAAC-4CAA-9A74-52141CF42419@rivoal.net>
To: Chris Lilley <chris@w3.org>

> On 23 Mar 2015, at 17:01, Chris Lilley <chris@w3.org> wrote:
> 
> Hello Public-css-testsuite,

Hello Chris,

> Spurred on by recent discussions around mandated image formats for the
> CSS cursor property, I have submitted some tests.

We're always short on tests, so thanks a lot for stepping up. Really appreciated.

> http://test.csswg.org/shepherd/search/testcase/spec/css-ui-3/section/6.1.1/load/t53/#t16


Comments that apply to all tests:

1) Since you're testing for various image formats, I'll first note we haven't yet added anything to the specification regarding formats. (Rossen should get back to us this Wednesday, and we'll know more then).

2) you're using a UTF-8 BOM. This is valid, but I think it is nicer to use <meta charset="UTF-8">, because it is visible without specialized tools, and less at risk of being mangled when copying or opening and saving the file in various editors.

3) All your tests except 005 007 008 and 009 use an bitmap image. You should include "image" in <meta name="flags" content=

4) the assertion (<meta name="assert") in tests 001 to 009 is the same, but they test slightly different things. The text you have in the last paragraph of each test is a sufficient clarification.

5) Rather than "<p class="test"> </p>", I'd suggest marking this part up as "<div class="test"> </div>". This is not a paragraph.

> A) cursor-image-001.html to cursor-image-009.html are basic tests just to
> have a quick look at image format support for cursors:

> 001   PNG image with css-supplied hotspot, relative URL.
> 002   PNG image with css-supplied hotspot, absolute URL.
> 003   ICO cursor with its own hotspot, relative URL.
> 004   CUR cursor with its own hotspot, relative URL.

No comments other than the generic ones above.

> 005   SVG cursor with CSS-supplied hotspot, relative URL.

You should include "svg" in <meta name="flags" content= 

> 006   ANI cursor with its own hotspot, relative URL.

You should include "animated" in <meta name="flags" content= 

> 007   Compressed (SVGZ) cursor with CSS-supplied hotspot, relative URL.
You should include "svg" in <meta name="flags" content= 

> 008   Non-existent image with CSS-supplied hotspot, relative URL, and help cursor fallback
No comments other than the generic ones above.

> 009   PNG image with css-supplied hotspot, relative URL, no fallback.

This test is incorrect. Per the spec's grammar, a fallback is required. You should change the description of the test to: "The test passes if, when moved inside the pale green rectangle, the cursor does not change", include "invalid" in <meta name="flags" content, and change the assertion to "Test checks that a fallback cursor is required."

> B) One test is exploratory, an SVG cursor where the SVG has a viewBox but
> no hardcoded width and height. CSS3-UI does not say what to expect in
> this case.

Aren't you covered by this (found in http://dev.w3.org/csswg/css-ui/#cursor, under the definition of the <url> value):

"The default object size for cursor images is a UA-defined size that should be based on the size of a typical cursor on the UA’s operating system.

The concrete object size is determined using the default sizing algorithm. If an operating system is incapable of rendering a cursor above a given size, cursors larger than that size must be shrunk to within the OS-supported size bounds, while maintaining the cursor image’s intrinsic ratio, if any."

This definition makes it UA dependent, but it shouldn't be undefined.

> Unlike most other places where images are used in CSS,
> there is no way to say in the CSS what size is wanted.

That's correct. If your cursor image doesn't have an intrinsic size, you end up with "the size of a typical cursor on the UA’s operating system".

> C) A larger set of tests extensively checks PNG cursor support in
> depth (no need to run these if 001 and 002 fail). All possible color
> types (greyscale, RGB, grey+A, RGBA, indexed) are tested with both
> interlaced and non-interlaced images, at various bit depths.
> 
> PNG alpha and transparency (tRNS) are tested, also gamma correction.
> Lastly there are some tests with invalid PNG images, to check the
> fallback is used.
> 
> All images are from the PNG test suite, and the images were verified
> for correctness to the PNG spec using pngcheck -v.
> 
> cursor-image-png-001.html to cursor-image-png-043.html
> 
> D) Similar tests will be needed for other cursor formats, some of which
> (such as .cur) do not have adequate documentation.

Both for C and D, I agree this it is useful to write such tests (when we can). I do not know if this kind of tests should be considered part of the css-ui test suite. If a browser has deficient support for some variants of PNG (or .cur, or whatever), it is useful to know and to get it fixed, but do we want to hold it against them in the context of the css3-ui spec?

> E) I have not yet written tests for hotspot position (apart from
> merely parsing the values in the CSS), but plan to.

That would be very useful, especially with regards to clamping.

Again, thanks.

 - Florian
Received on Monday, 23 March 2015 17:11:18 UTC

This archive was generated by hypermail 2.4.0 : Friday, 20 January 2023 19:58:20 UTC