test for color style element, names and numbers and rgb




Layout: Text
11 years ago
11 years ago


(Reporter: Ray Kiddy, Unassigned)


Mac OS X

Firefox Tracking Flags

(Not tracked)



(2 attachments)



11 years ago
An html file has a js script inside it which takes a color parameter.

Where should a test like this go? I see the mozilla/layout/reftests/text-transform directory. Looking at the specm, I would have thought that that would have gone into a mozilla/layout/reftests/text-properties/text-transform directory. I would suggest this can go into a mozilla/layout/reftests/text-properties/.

Comment 1

11 years ago
Created attachment 259479 [details] [diff] [review]
adds the tests for this
Attachment #259479 - Flags: review?(dbaron)

Comment 2

11 years ago
Created attachment 259480 [details]
the driver for the test


11 years ago
Attachment #259479 - Attachment is patch: true
Attachment #259479 - Attachment mime type: application/octet-stream → text/plain
Given that we can determine what the different values of the color property compute to using script (set style on an element, look at its computed style), maybe it's better to use script to do this rather than reftest, which is quite a bit slower?  This could probably all be done in a single mochitest with a lot of assertions.

Comment 4

11 years ago
Yes, I see what you are saying.

But there needs to be some automated test which says: "I intended to display something in red and it is being rendered in a way which will look red to a person's eyeballs." We can automate this.

Perhaps it is enough to create a table of a set size, set its cell backgrounds to certain colors, and verify that against a reference image. I think it makes sense to do this, even if only for the 17 colors defined in section 4.3.6 of the CSS 2.1 spec. Would ensuring that a given table cell is displayed correctly ensure that all uses of the color will display correctly?
Comment on attachment 259479 [details] [diff] [review]
adds the tests for this

We don't need to do this visually for all colors; it can be done using mochitest.
Attachment #259479 - Flags: review?(dbaron) → review+
(It might make sense to have reftests to check that changes in the r, g, and b color components show up, for example, and probably some tests for alpha if you can write any without potential rounding errors.)
Attachment #259479 - Flags: review+ → review-

Comment 7

11 years ago
I actually ran some of a reftest in which I did one page with a color equal to some x, and the other with the color set to (x+1). I had a "!=" in the manifest. It would take, literally, over a day to run all the combinations.

Is there a subset of color values for which it would be useful to ask the question? If the test was as I describe, but even just checking a few hundred colors, that would be doable.

Let me know what colors to check and I can set it up.
You need to log in before you can comment on or make changes to this bug.