Reftest fail with subpixel rendering

RESOLVED FIXED

Status

()

Core
Layout
RESOLVED FIXED
9 years ago
9 years ago

People

(Reporter: roc, Assigned: roc)

Tracking

Trunk
x86
Mac OS X
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments)

Created attachment 336318 [details] [diff] [review]
fix

Like bug 452747, there are a few more reftests that fail on my Mac due to glyphs being rendered a little outside the (pixel-snapped) font-box and being clipped in the testcase and not the reference, or vice versa. These are all fixable by adding a little padding, or in one case it seems safer to just make the text be invisible via rgba(0,0,0,0).
Attachment #336318 - Flags: superreview?(dbaron)
Attachment #336318 - Flags: review?(dbaron)

Comment 1

9 years ago
Why are these reftest failures considered bugs in the tests rather than a bug in Gecko?  Why does adding padding fix them?
These tests assume that text glyphs never affect any pixels outside the pixel-snapped rectangle derived from the text's advance width, ascent and descent. That assumption is not true on Mac with subpixel rendering (and in general, for weird fonts, it's not true on any platform).

Comment 3

9 years ago
Is it guaranteed to be true if you stick 0.2em of padding in?
In theory? No. In practice? Yes.
Attachment #336318 - Flags: superreview?(dbaron)
Attachment #336318 - Flags: superreview+
Attachment #336318 - Flags: review?(dbaron)
Attachment #336318 - Flags: review+
Comment on attachment 336318 [details] [diff] [review]
fix

r+sr=dbaron if you fix the 430813 tests by making the text transparent rather than introducing padding
Status: UNCONFIRMED → NEW
Ever confirmed: true
(In reply to comment #5)
> r+sr=dbaron if you fix the 430813 tests by making the text transparent rather
> than introducing padding

But if I make the test transparent, then the test isn't testing anything because incorrect positioning of that last DIV won't cause a visual difference.
Can you put the padding on an inline containing the text, then, rather than on the block?  (And use line-height if you need vertical padding.)
Created attachment 343301 [details] [diff] [review]
fix v2

That works.
Attachment #343301 - Flags: review?(dbaron)
Comment on attachment 343301 [details] [diff] [review]
fix v2

r+sr=dbaron
Attachment #343301 - Flags: superreview+
Attachment #343301 - Flags: review?(dbaron)
Attachment #343301 - Flags: review+
Pushed 8735bfaf0b43
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.