Closed Bug 1395748 Opened 3 years ago Closed 3 years ago

text-layers: shadows with selections are mishandled

Categories

(Core :: Graphics: WebRender, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox56 --- unaffected
firefox57 --- unaffected

People

(Reporter: Gankra, Assigned: Gankra)

References

Details

(Whiteboard: [wr-mvp])

Attachments

(1 file)

Using webrendest layers-free, the following cases are mishandled:

1. If you select some text with a shadow, the shadow will be applied multiple times (once for each "segment" of the selection).

2. If you apply text-shadows with the ::-moz-selection pseudo-selector, the shadow will apply to the entire run (and not just the selected portion).

Both of these are the consequence of us mishandling shadows in the selected case. In particular we slurp up shadows from PaintOneShadow, and we assume they apply to the entire nsTextFrame. However nsTextFrame::PaintTextWithSelectionColors applies shadows segment-by-segment for the selection (for instance, if you selected only part of a textFrame, then there will be 3 selection segments, two of which have no selection).

Fixing this will likely require scoping TextShadows to TextRunFragments, rather than an entire TextDrawTarget?
Priority: P3 → P2
Whiteboard: [wr-mvp]
Assignee: nobody → a.beingessner
Status: NEW → ASSIGNED
Priority: P2 → P1
Target Milestone: --- → mozilla57
Comment on attachment 8907286 [details]
Bug 1395748 - Fix text selection shadow interaction.

https://reviewboard.mozilla.org/r/178964/#review184488
Attachment #8907286 - Flags: review?(jmuizelaar) → review+
Keywords: checkin-needed
Pushed by ryanvm@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/065ea3d56a52
Fix text selection shadow interaction. r=jrmuizel
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/065ea3d56a52
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.