Closed Bug 1287705 Opened 5 years ago Closed 5 years ago

background-clip:text interacts poorly with opacity (and blur) in text-shadow

Categories

(Core :: Layout: Text and Fonts, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: jfkthame, Assigned: u459114)

References

Details

Attachments

(4 files)

See testcase. The rendering of the text-shadow's blur (wherever its opacity is < 1.0) is spoiled by interaction with the background color, which should have been restricted to appearing within the clip path of the text.
Attachment #8772314 - Attachment mime type: text/plain → text/html
CJ, I guess this is connected to the implementation of background-clip from bug 1269971. Do you have time to look into it?
Blocks: 1269971
Flags: needinfo?(cku)
Version: 44 Branch → Trunk
Assignee: nobody → cku
Flags: needinfo?(cku)
Attachment #8772418 - Flags: review?(jfkthame)
Attachment #8772419 - Flags: review?(jfkthame)
Attachment #8772420 - Flags: review?(jfkthame)
Comment on attachment 8772418 [details]
Bug 1287705 - Part 1. Do not paint text shadow while generating text mask.

https://reviewboard.mozilla.org/r/65236/#review62300
Attachment #8772418 - Flags: review?(jfkthame) → review+
Comment on attachment 8772419 [details]
Bug 1287705 - Part 2. Add more comments and construct PaintState in PaintTextParams.

https://reviewboard.mozilla.org/r/65238/#review62302

::: layout/generic/nsTextFrame.cpp:6014
(Diff revision 1)
>      aParams.textBaselinePt.x - aParams.framePt.x;
>    gfxFloat iOffset, hyphenWidth;
>    Range range; // in transformed string
>    TextRangeStyle rangeStyle;
>    // Draw background colors
> -  if (anyBackgrounds && (!aParams.generateTextMask ||
> +  if (anyBackgrounds && (!aParams.IsGenerateTextMask())) {

You can drop the parens around !aParams.IsGenerateTextMask() here, now that it's not a two-term || expression.
Attachment #8772419 - Flags: review?(jfkthame) → review+
Comment on attachment 8772420 [details]
Bug 1287705 - Part 3. reftest for text shadow.

https://reviewboard.mozilla.org/r/65240/#review62304

LGTM. Thanks for the instant fix here! :)
Attachment #8772420 - Flags: review?(jfkthame) → review+
Comment on attachment 8772418 [details]
Bug 1287705 - Part 1. Do not paint text shadow while generating text mask.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65236/diff/1-2/
Comment on attachment 8772419 [details]
Bug 1287705 - Part 2. Add more comments and construct PaintState in PaintTextParams.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65238/diff/1-2/
Comment on attachment 8772420 [details]
Bug 1287705 - Part 3. reftest for text shadow.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/65240/diff/2-3/
Pushed by cku@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/14bb443d532d
Part 1. Do not paint text shadow while generating text mask. r=jfkthame
https://hg.mozilla.org/integration/autoland/rev/0f248b2827af
Part 2. Add more comments and construct PaintState in PaintTextParams. r=jfkthame
https://hg.mozilla.org/integration/autoland/rev/9be24f375ba6
Part 3. reftest for text shadow. r=jfkthame
You need to log in before you can comment on or make changes to this bug.