Bug 135927 - [CSS Shapes] the spec-examples reftests are off by a few pixels
Summary: [CSS Shapes] the spec-examples reftests are off by a few pixels
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Bem Jones-Bey
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-13 19:22 PDT by Rebecca Hauck
Modified: 2014-11-06 15:20 PST (History)
3 users (show)

See Also:


Attachments
Patch (70.37 KB, patch)
2014-11-06 10:32 PST, Bem Jones-Bey
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Rebecca Hauck 2014-08-13 19:22:39 PDT
The following tests imported from the W3C CSS Shapes test suite are failing by 1-2px. More investigation is needed to determine if it's just a test update or an actual bug.

LayoutTests/css3/shapes/spec-examples/shape-outside-010.html
LayoutTests/css3/shapes/spec-examples/shape-outside-011.html
LayoutTests/css3/shapes/spec-examples/shape-outside-012.html
LayoutTests/css3/shapes/spec-examples/shape-outside-013.html
LayoutTests/css3/shapes/spec-examples/shape-outside-014.html
LayoutTests/css3/shapes/spec-examples/shape-outside-015.html
LayoutTests/css3/shapes/spec-examples/shape-outside-016.html
LayoutTests/css3/shapes/spec-examples/shape-outside-017.html
LayoutTests/css3/shapes/spec-examples/shape-outside-018.html
LayoutTests/css3/shapes/spec-examples/shape-outside-019.html

If it turns out the tests need to be updated, it should be done in the W3C repo then they should be re-imported.
Comment 1 Carlos Alberto Lopez Perez 2014-08-19 03:34:03 PDT
The test css3/shapes/spec-examples/shape-outside-014.html pass on platform GTK:

[...]
01:46:53.706 20975   css3/shapes/spec-examples/shape-outside-014.html -> ref test hashes didn't match but diff passed
01:46:53.708 20774 [3063/31564] css3/shapes/spec-examples/shape-outside-014.html passed unexpectedly
01:46:53.706 20975 worker/9 css3/shapes/spec-examples/shape-outside-014.html passed
[...]

Expected to fail, but passed:
  css3/shapes/spec-examples/shape-outside-014.html
Comment 2 Bem Jones-Bey 2014-11-04 13:58:58 PST
These tests are fragile because it is very hard to accurately compute exactly where text is going to be positioned around a circular shape. It would be best to rewrite these as testharness tests so that they can have a tolerance around the computed number and be much more robust.
Comment 3 Bem Jones-Bey 2014-11-06 10:32:23 PST
Created attachment 241114 [details]
Patch
Comment 4 Zoltan Horvath 2014-11-06 14:20:15 PST
Comment on attachment 241114 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=241114&action=review

> LayoutTests/css3/shapes/spec-examples/support/spec-example-utils.js:5
> +        firstLine = document.getElementById(linePrefix + '0');

I saw that the first child of the test div are not always a span. I'm not sure if there is an easier way to select the first span child of the 'test' div. If there was such a way to do that that would be nice though.

> LayoutTests/css3/shapes/spec-examples/support/spec-example-utils.js:10
> +            window.setTimeout(runTest, 5);

Is this timeout sufficient enough?
Comment 5 Bem Jones-Bey 2014-11-06 14:41:26 PST
Comment on attachment 241114 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=241114&action=review

>> LayoutTests/css3/shapes/spec-examples/support/spec-example-utils.js:5
>> +        firstLine = document.getElementById(linePrefix + '0');
> 
> I saw that the first child of the test div are not always a span. I'm not sure if there is an easier way to select the first span child of the 'test' div. If there was such a way to do that that would be nice though.

I don't see how this matters? I'm not selecting the first child of the test div, I'm selecting the element that has the id of "linePrefix + '0'", which is something like 'line-0'. So it doesn't matter what children are before that span.

>> LayoutTests/css3/shapes/spec-examples/support/spec-example-utils.js:10
>> +            window.setTimeout(runTest, 5);
> 
> Is this timeout sufficient enough?

It's arbitrary. I guess I could make it longer, but it really depends on network speed, etc. So unless there's data to say it isn't good enough, might as well leave it as is.
Comment 6 WebKit Commit Bot 2014-11-06 15:20:48 PST
Comment on attachment 241114 [details]
Patch

Clearing flags on attachment: 241114

Committed r175721: <http://trac.webkit.org/changeset/175721>
Comment 7 WebKit Commit Bot 2014-11-06 15:20:51 PST
All reviewed patches have been landed.  Closing bug.