Bug 1529992 Comment 8 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #7)

> Maybe removing that (or disabling it for Gecko) would fix the problem.

Tried this; it just made the text shadow appear directly behind the text and ignored the offset entirely. Which I guess is guess not totally surprising since that's the only place the offset seems to be used.

> Alternatively, we can conform to the implied semantics there on the Gecko side, by adjusting the clip/rect of the shadow element to take this into account.

After reading the code a bit more, I don't think that would work either. I suspect the problem is that the `ShadowItem::TextRun` item's clip/rect is what's wrong, but I'm not sure what the correct value would be. It almost seems like the shadow is drawn using the top-left corner of the [translated rect](https://searchfox.org/mozilla-central/rev/8d78f219702286c873860f39f9ed78bad1a6d062/gfx/wr/webrender/src/display_list_flattener.rs#2135) regardless of the blur radius. In which case it might be better to shrink the rects on the Gecko side and let WR do the inflation by setting `should_inflate` to true.
(In reply to Kartikaya Gupta (email:kats@mozilla.com) from comment #7)

> Maybe removing that (or disabling it for Gecko) would fix the problem.

Tried this; it just made the text shadow appear directly behind the text and ignored the offset entirely. Which I guess is not totally surprising since that's the only place the offset seems to be used.

> Alternatively, we can conform to the implied semantics there on the Gecko side, by adjusting the clip/rect of the shadow element to take this into account.

After reading the code a bit more, I don't think that would work either. I suspect the problem is that the `ShadowItem::TextRun` item's clip/rect is what's wrong, but I'm not sure what the correct value would be. It almost seems like the shadow is drawn using the top-left corner of the [translated rect](https://searchfox.org/mozilla-central/rev/8d78f219702286c873860f39f9ed78bad1a6d062/gfx/wr/webrender/src/display_list_flattener.rs#2135) regardless of the blur radius. In which case it might be better to shrink the rects on the Gecko side and let WR do the inflation by setting `should_inflate` to true.

Back to Bug 1529992 Comment 8