Closed Bug 938555 Opened 11 years ago Closed 10 years ago

SVG Elements not being rendered after manipulating transform

Categories

(Core :: SVG, defect)

23 Branch
defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla29
Tracking Status
firefox25 --- wontfix
firefox26 --- wontfix
firefox27 --- wontfix
firefox28 --- verified
firefox29 --- verified
firefox-esr17 --- unaffected
firefox-esr24 --- wontfix

People

(Reporter: jens.podzierski, Assigned: roc)

References

Details

(Keywords: regression)

Attachments

(3 files, 3 obsolete files)

User Agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36

Steps to reproduce:

Create arbitrary SVG element within a <g> element. Change transform of g and inner element in script, so element lies outside previous bounds of <g>.


Actual results:

Inner element is not being rendered. It is there in the HTML view of Firebug, but not visible in browser window.


Expected results:

Inner element should be rendered at new position.
Component: Untriaged → SVG
Product: Firefox → Core
Confirmed FF 28.0a1 (2013-11-13) win 7 x64 using the testcase
Status: UNCONFIRMED → NEW
Ever confirmed: true
I suspect this used to work. Could someone try to get a regression window?
Looks like this is due to one of Jonathan's fixes that landed in the regression window.
Last Good: 7b7eea794c8e
First Bad: c0b7f22692c3

Regressed by:
	c0b7f22692c3	Jonathan Watt — Bug 869611 - Stop reflowing in nsSVGPathGeometryFrame::NotifySVGChanged for ancestor transform changes. r=dholbert
This problem is actually not that contrived as it may seem at first glance. In fact it is currently affecting our customers (devs) and their users on FF and makes us/and/or FF look bad. The only feasible workaround I can see is to artificially increase the bounds of the subtree with invisible or almost invisible elements in order to increase the size of the clipping rectangle, which is not only ugly but very likely hurts performance, too. I can provide details on how to reproduce this problem easily in our online demo apps, but the test-case is perfect already. It's just that it looks so contrived, which is only due to it being a stripped down version of the actual problem.
If I flush the display i.e. change the code so it looks like this...

// change translate of outer g
outerG.transform.baseVal.getItem(0).setTranslate(20, 20);
document.rootElement.forceRedraw();
// move rect0 within the old bounds - this works as expected
//rect0.transform.baseVal.getItem(0).setTranslate(70, 70);

which internally does a doc->FlushPendingNotifications(Flush_Display); everything works.

In fact Flush_Style is enough, Flush_ContentAndNotify is not enough though.

It seems that the subsequent calls to adjust the transform use the wrong bounds somehow and when I look at the overflowAreas of the <g> element without the flush they are all wrong.

Is adding a flush somewhere in content the right thing to do Jonathan? If so where, if not what is the right thing to do. It seems it's only likely necessary for a <g> as other container elements such as <svg> have fixed sizes so I could maybe also check that Element() is a <g>
Flags: needinfo?(jwatt)
WFIW SVGTransform::NotifyElementDidChange seems like it might be the place to flush if a flush is needed.
Attached patch patch (obsolete) — Splinter Review
Attachment #8340745 - Flags: review?(jwatt)
Flags: needinfo?(jwatt)
Attached patch without the tabs (obsolete) — Splinter Review
Attachment #8340745 - Attachment is obsolete: true
Attachment #8340745 - Flags: review?(jwatt)
Attachment #8340746 - Flags: review?(jwatt)
This patch also fixes bug 944886 and all its duplicates.
Depends on: 944886
Attached patch turns out reflow will do (obsolete) — Splinter Review
Attachment #8340746 - Attachment is obsolete: true
Attachment #8340746 - Flags: review?(jwatt)
Attachment #8340775 - Flags: review?(jwatt)
This looks wrong. The nsChangeHint_UpdateOverflow and nsChangeHint_UpdateTransformLayer hints should be sufficient. I'll take a look.
I tracked this down to something being rotten in OverflowChangedTracker::Flush, and Matt pointed me to bug 944291 where as it happens roc has just attached a patch. I built with that patch and it fixes the issue here.
Depends on: 944291
Comment on attachment 8340775 [details] [diff] [review]
turns out reflow will do

It would be good to have your reftest as a separate patch.
Attachment #8340775 - Flags: review?(jwatt) → review-
Check-in for bug 944291 fixes this.
Status: NEW → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
No longer depends on: 944886
Attachment #8340775 - Attachment is obsolete: true
(In reply to Robert Longson from comment #19)
> https://tbpl.mozilla.org/?tree=Try&rev=0994212349f9

One nit on the cset in that Try push:

>+<svg xmlns="http://www.w3.org/2000/svg" class="reftest-wait" onload="startTest()">
>+  <script>
>+    function startTest() {
>+      document.addEventListener("MozReftestInvalidate", doTest, false);
>+    }

Normally in MozReftestInvalidate reftests, I don't think we bother using an onload handler to call addEventListener. (It's a bit simpler to just directly call addEventListener at the top level inside the <script> tag, IMO; it removes one layer of async callback.)

(Doesn't matter much, though.)
Flags: in-testsuite?
Verified fixed using the testcases on 29.0a1 (2014-01-07), win 7 x64.
Status: RESOLVED → VERIFIED
Assignee: nobody → roc
Target Milestone: --- → mozilla29
https://hg.mozilla.org/integration/mozilla-inbound/rev/8287550616ee
Flags: in-testsuite? → in-testsuite+
OS: Windows 8.1 → All
Hardware: x86_64 → All
(In reply to Paul Silaghi, QA [:pauly] from comment #21)
> Verified fixed using the testcases on 29.0a1 (2014-01-07), win 7 x64.

Please also verify this in Aurora.
Keywords: verifyme
(In reply to Paul Silaghi, QA [:pauly] from comment #21)
> Verified fixed using the testcases on 29.0a1 (2014-01-07), win 7 x64.
Verified fixed 28.0a2 (2014-01-16)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: