Closed Bug 1816628 Opened 2 years ago Closed 1 year ago

Issues with text-shadow in SVG text (fill vs stroke)

Categories

(Core :: SVG, defect)

defect

Tracking

()

RESOLVED FIXED
125 Branch
Tracking Status
firefox112 --- wontfix
firefox125 --- fixed

People

(Reporter: longsonr, Assigned: longsonr)

References

Details

Attachments

(5 files)

See testcase: the SVG text renders with colored stroke and fill, as specified in the attributes of the <svg> element, and inherits its font family/weight/size from the body.

  • The shadow is always filled even if the text is not filled.

  • The shadow does not respect stroke at all.

  • What should happen if the text has opacity? What if there is fill-opacity and stroke-opacity, should they be observed in the shadow? What if the fill and stroke opacity are different?

Summary: Issues with text-shadow in SVG text (selected vs non-selected, fill vs stroke vs clipPath) → Issues with text-shadow in SVG text (fill vs stroke)
Attached file testcase

I notice that these issues aren't actually limited to SVG text; similar considerations apply to HTML text with shadows in combination with -webkit-text-stroke. Example: https://codepen.io/jfkthame/pen/LYJYRPd

So this may be a more general nsTextFrame painting issue.

I've filed https://github.com/w3c/csswg-drafts/issues/8449 regarding the spec for text-shadow; this is primarily discussing HTML text, but we probably want to consider both the SVG and HTML behaviors together, as it's pretty weird for authors if text-shadow behaves quite differently in the two contexts.

Also, should the text decoration be shadowed too?

The CSS text-decoration spec for text-shadow says that:

Each layer shadows the element’s text and all its text decorations (composited together).

So yes, decorations get shadowed. (I think we do that already, don't we?)

Marking as S3 for now, we may want to re-evaluate this once the CSSWG takes a look at the spec issue and we have confirmation of the expected results.

Severity: -- → S3
Assignee: nobody → longsonr
Status: NEW → ASSIGNED
Attachment #9377901 - Attachment description: Bug 1816628 Part 1 - backout bug 1781253 as it cuts off right hand edge of the shadow for large fonts r=jfkthame → Bug 1816628 Part 1 - Account for horizontal overflow caused by text-shadow r=jfkthame
Pushed by longsonr@gmail.com: https://hg.mozilla.org/integration/autoland/rev/ddaf27e9243d Part 1 - Account for horizontal overflow caused by text-shadow r=jfkthame https://hg.mozilla.org/integration/autoland/rev/d58d91582a84 Part 2 - Make text-shadow react to stroke properties and fill opacity r=jfkthame
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/44750 for changes under testing/web-platform/tests

Backed out for causing linux related wr failures in SVGTextFrame.cpp.

L.E. there are also some OS X mochitests-plain failures that are related to this.

  • Push with failures
  • Failure Log
  • Failure line: TEST-UNEXPECTED-FAIL | dom/svg/test/test_bug1426594.html | undefined assertion name - got 69.10000610351562, expected 63.100006103515625 epsilon: +/- 5
Flags: needinfo?(longsonr)
Upstream PR was closed without merging
Pushed by longsonr@gmail.com: https://hg.mozilla.org/integration/autoland/rev/3ee753e740b9 Part 1 - Account for horizontal overflow caused by text-shadow r=jfkthame https://hg.mozilla.org/integration/autoland/rev/e32deae0b0b4 Part 2 - Make text-shadow react to stroke properties and fill opacity r=jfkthame

Backed out for causing OS X mochitests-plain failures in test_bug1426594.html.

  • Backout link
  • Push with failures
  • Failure Log
  • Failure line: TEST-UNEXPECTED-FAIL | dom/svg/test/test_bug1426594.html | undefined assertion name - got 69.10000610351562, expected 63.100006103515625 epsilon: +/- 5
Flags: needinfo?(longsonr)
Upstream PR was closed without merging
Pushed by longsonr@gmail.com: https://hg.mozilla.org/integration/autoland/rev/f637c422003f Part 1 - Account for horizontal overflow caused by text-shadow r=jfkthame https://hg.mozilla.org/integration/autoland/rev/27783bb8f6b7 Part 2 - Make text-shadow react to stroke properties and fill opacity r=jfkthame
Flags: needinfo?(longsonr)
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 125 Branch
Upstream PR merged by moz-wptsync-bot
No longer blocks: 1882921
Regressions: 1882921
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: