Closed Bug 1185266 Opened 9 years ago Closed 9 years ago

SVG painting of text element does not refresh when styles change

Categories

(Core :: SVG, defect)

39 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla42
Tracking Status
firefox42 --- fixed

People

(Reporter: amelia.bellamy.royds, Assigned: heycam)

Details

Attachments

(2 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:39.0) Gecko/20100101 Firefox/39.0
Build ID: 20150630154324

Steps to reproduce:

Create SVG text element, fill with a pattern or gradient, then use CSS pseudoclasses to change the fill value.  Or animate the content of the paint server (gradient or pattern).

See http://codepen.io/AmeliaBR/pen/gpjzEP/ or the attached file (which is the same, just as a stand-alone SVG)

(The demo also shows problems with pattern tiling; I'll file a separate bug for that!)


Actual results:

Text does not re-paint.


Expected results:

Text should repaint to match the change in paint on shapes with the same styles.


I'm surprised I have not noticed this before, so it may be a regression but I'm not sure.  I'm using the stable Firefox build (39) on a Win7 system.
Component: Untriaged → SVG
Product: Firefox → Core
I think the issue is that we're looking up the nsSVGEffects::FillProperty off the wrong frame.  In nsSVGEffects::GetPaintServer we look up past a text frame to its parent, but this will result in us looking at the <text>'s anonymous block child.  We need to look up one step further to the SVGTextFrame.  If you modify the test to put a <tspan> around the text content you'll see it works (as we'll be getting the FillProperty off the nsInlineFrame that corresponds to the <tspan> element).

The reason the dynamic updates fail is that the nsSVGEffects::UpdateEffects call, which removes the FillProperty so it can be recreated next paint, only removes it from the SVGTextFrame and not its anonymous block child.
Assignee: nobody → cam
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Attachment #8635850 - Flags: review?(jwatt) → review+
https://hg.mozilla.org/mozilla-central/rev/7982972a0f76
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla42
Depends on: 1402798
No longer depends on: 1402798
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: