stylo: support context values for SVG stroke-* and fill-*

NEW
Assigned to

Status

()

Core
CSS Parsing and Computation
P2
normal
4 months ago
5 days ago

People

(Reporter: manishearth, Assigned: cjku)

Tracking

(Blocks: 2 bugs)

Firefox Tracking Flags

(Not tracked)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

4 months ago
Many of the stroke-* and fill-* properties affect mContextFlags in nsStyleSVG when they are set to a context value. We should make these properties deal with that.

http://searchfox.org/mozilla-central/rev/d3307f19d5dac31d7d36fc206b00b686de82eee4/layout/style/nsStyleStruct.h#3714 contains a list of properties affected by this.
Priority: -- → P2
Duplicate of this bug: 1339349
Blocks: 1352284
(Assignee)

Updated

2 months ago
Assignee: nobody → cku
(Assignee)

Comment 2

a month ago
Hi Manish
I verify this property by
1. Turn on svg.context-properties.content.enabled in about:config
2. Visit context-fill-03.html on stylo-build.

I can see fill-opacity="context-fill" be represented correctly on stylo build. Could you share me an example that context-xxx not work?
Flags: needinfo?(manishearth)
(Reporter)

Comment 3

a month ago
We parse the context values for fill and stroke, but not for fill-opacity (and the other similar properties).

See the callers of https://dxr.mozilla.org/mozilla-central/rev/c0ea5ed7f91a6be996a4a3c5ab25e2cdf6b4377e/layout/style/nsRuleNode.cpp#9393

We may not have tests for this; I'm not exactly sure what the expected behavior is here. A quick grep doesn't turn up anything relevant.
Flags: needinfo?(manishearth)
Comment hidden (spam)
Comment hidden (spam)
(Assignee)

Updated

a month ago
Flags: needinfo?(jwatt)
Comment hidden (mozreview-request)
(Assignee)

Comment 7

a month ago
Hi jwatt
We allow user to set fill-opacity as "context-fill-opcity', but we actually does not enable it while rendering
http://searchfox.org/mozilla-central/source/layout/svg/SVGContextPaint.h#282

Support context-{fill|stroke}-opacity value in stylo is not that difficult(you may refert to the path in this bug), but I am wondering do we really need to do it? Or, it's a dead code already?
Flags: needinfo?(jwatt)
Comment hidden (mozreview-request)
(In reply to Manish Goregaokar [:manishearth] from comment #3)
> We may not have tests for this; I'm not exactly sure what the expected
> behavior is here. A quick grep doesn't turn up anything relevant.

We have tests in:

https://dxr.mozilla.org/mozilla-central/source/layout/reftests/text-svgglyphs/resources/glyphs-objectopacity.svg
Flags: needinfo?(jwatt)
You need to log in before you can comment on or make changes to this bug.