Open Bug 832483 Opened 7 years ago Updated 3 years ago

Let context-fill, context-stroke values be used as colours


(Core :: SVG, defect)

Not set




(Reporter: eflores, Unassigned)




(3 files)

In the current SVG fonts implementation, context-fill and context-stroke are valid paint values, but not colours. It would be useful to use the fallback colour when either is used in a colour property, e.g. stop-color.
Duplicate of this bug: 801856
Let context-fill and context-stroke be used in stop-color, and context-fill-opacity and context-stroke-opacity be used in stop-opacity.

Not marking r? yet as waiting to hear whether we can unprefix the context-* values.
Comment on attachment 719781 [details] [diff] [review]
Non-style system changes

Review of attachment 719781 [details] [diff] [review]:

::: layout/svg/nsSVGStopFrame.h
@@ +21,5 @@
> +  NS_NewSVGStopFrame(nsIPresShell* aPresShell, nsStyleContext* aContext);
> +
> +  bool mIsResolved;
> +  nscolor mStopColor;
> +  float mStopOpacity;

These should go at the end of the class, by convention.

Is it really worth caching mStopColor/mStopOpacity?
(In reply to Robert O'Callahan (:roc) (Mozilla Corporation) from comment #5)
> Is it really worth caching mStopColor/mStopOpacity?

There are uses where the context fill/stroke won't be visible, so we have to cache these. A (very) contrived example would be if a document D were to use an SVG glyph G, which itself used an SVG glyph H; then G has a gradient which uses context-fill to get the fill colour from D; and then H uses context-fill to use that gradient from G.
Why can't we get the colors on-demand via mFillPattern in that case?
Assignee: edwin → nobody
You need to log in before you can comment on or make changes to this bug.