Bug 46499 - REGRESSION(63307): SVG elements fail to re-render
Summary: REGRESSION(63307): SVG elements fail to re-render
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: SVG (show other bugs)
Version: 528+ (Nightly build)
Hardware: PC OS X 10.5
: P1 Normal
Assignee: Nikolas Zimmermann
URL:
Keywords: Regression
Depends on:
Blocks: 42245
  Show dependency treegraph
 
Reported: 2010-09-24 12:47 PDT by Evan Adams
Modified: 2011-05-22 10:35 PDT (History)
10 users (show)

See Also:


Attachments
Reproduces the bug; has two SVG shapes and a timer to blink one of them. (2.10 KB, text/html)
2010-09-24 12:49 PDT, Evan Adams
no flags Details
smaller reduction (802 bytes, text/html)
2010-09-27 14:54 PDT, James Robinson
no flags Details
Patch (9.23 KB, patch)
2010-09-27 16:31 PDT, James Robinson
no flags Details | Formatted Diff | Diff
Patch (4.89 KB, patch)
2010-10-02 03:23 PDT, Nikolas Zimmermann
krit: review-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Evan Adams 2010-09-24 12:47:10 PDT
This is recent regression.  I'm seeing this in Chrome on both MacOS and Linux.

I have an SVG shape that blinks.  The first time it displays is fine and the first time it is hidden is also fine.  After that it never displays again.

I've attached a simple reproducible test case.  It involves having two shapes in a group.  Removing the non-blinking shape makes things work.  Commenting out the stroke attribute of the non-blinking shape makes things work, although, that appears to be a red-herring.  Changing the size of the non-blinking shape makes it so commenting out the stroke attribute no long fixes things.
Comment 1 Evan Adams 2010-09-24 12:49:16 PDT
Created attachment 68734 [details]
Reproduces the bug; has two SVG shapes and a timer to blink one of them.
Comment 2 Simon Fraser (smfr) 2010-09-27 14:20:34 PDT
What's the regression window?
Comment 3 James Robinson 2010-09-27 14:54:40 PDT
Created attachment 68965 [details]
smaller reduction

Slightly smaller reduction.  Looks like the path isn't generating a repaint invalidation.  Passes in safari 5.0.1
Comment 4 James Robinson 2010-09-27 14:58:29 PDT
Comment on attachment 68734 [details]
Reproduces the bug; has two SVG shapes and a timer to blink one of them.

This testcase is still useful - the one I posted requires the HTML5 tree builder as it uses inline <svg> and doesn't work in older WebKits.
Comment 5 James Robinson 2010-09-27 15:05:29 PDT
Regression range from the nightlies is r63285 - 63355.  I strongly suspect that http://trac.webkit.org/changeset/63307 is the culprit here.
Comment 6 James Robinson 2010-09-27 15:13:05 PDT
Local revert confirms that patch is wrong.  Tsk, tsk.  Will revert and add a new repaint test.
Comment 7 James Robinson 2010-09-27 16:31:50 PDT
Created attachment 68989 [details]
Patch
Comment 8 James Robinson 2010-09-27 16:38:28 PDT
Comment on attachment 68989 [details]
Patch

Clearing flags on attachment: 68989

Committed r68444: <http://trac.webkit.org/changeset/68444>
Comment 9 James Robinson 2010-09-27 16:38:33 PDT
All reviewed patches have been landed.  Closing bug.
Comment 11 Csaba Osztrogonác 2010-09-27 23:06:30 PDT
(In reply to comment #10)
> http://trac.webkit.org/changeset/68444 might have broken Leopard Intel Release (Tests)
> The following changes are on the blame list:
> http://trac.webkit.org/changeset/68441
> http://trac.webkit.org/changeset/68442
> http://trac.webkit.org/changeset/68443
> http://trac.webkit.org/changeset/68444
> http://trac.webkit.org/changeset/68445

And Qt bot of course... 
Qt specific expected file updated in http://trac.webkit.org/changeset/68489
Comment 12 Nikolas Zimmermann 2010-09-27 23:27:24 PDT
(In reply to comment #6)
> Local revert confirms that patch is wrong.  Tsk, tsk.  Will revert and add a new repaint test.

I'd strongly prefer if you could give the orignal patch author a chance to answer, before reverting.
The patch is still correct, it just means that display changes aren't causing relayouts anymore.
It should be investigated, rather than reverting the patch.

:(
Comment 13 Eric Seidel (no email) 2010-09-27 23:33:15 PDT
In defense of James's actions (which I was not involved with): it's pretty standard policy to revert regressions.  It was unfortunate he hadn't updated the original bug, but it's also possible he was about to and I just beat him to it.

I think it was pretty awesome that he landed a layout test at the same time to prevent any possible future regression.

You should feel free to roll back in your patch as soon as it doesn't regress.  Not repainting SVGs is a pretty major regression and I'm glad this was resolved promptly, rollout or otherwise.

Looking forward to seeing your original patch land again!
Comment 14 Dirk Schulze 2010-09-27 23:44:38 PDT
(In reply to comment #13)
> In defense of James's actions (which I was not involved with): it's pretty standard policy to revert regressions.  It was unfortunate he hadn't updated the original bug, but it's also possible he was about to and I just beat him to it.

I know this policy, but sometime it can be better to fix it with a second patch instead of rolling out everything. Sure, this patch caused a repaint regression, but now we have a performance regression. And it was also the policy to inform the original author before rolling out anything, to give the author the time to fix it. There was no chance for Niko to answer to James comment because of the time shift.
Comment 15 Nikolas Zimmermann 2010-09-27 23:50:09 PDT
(In reply to comment #13)
> In defense of James's actions (which I was not involved with): it's pretty standard policy to revert regressions.  It was unfortunate he hadn't updated the original bug, but it's also possible he was about to and I just beat him to it.
Sure, but when planning to revert a patch, the author should be given a chance to comment first.
It's not that we're releasing a new Safari/Chrome tomorrow, then it would have been fine IMHO.

> 
> I think it was pretty awesome that he landed a layout test at the same time to prevent any possible future regression.
The layout test is flawed. It's timing dependant: a test with two 50ms timeouts, always cries for a better solution. It's also in the wrong directory: svg/in-html would be the place to put new HTML5+SVG regression tests.
 
> You should feel free to roll back in your patch as soon as it doesn't regress.  Not repainting SVGs is a pretty major regression and I'm glad this was resolved promptly, rollout or otherwise.
It's only not repainting display changes, there's not a general repaint problem (of course, not repainting display changes is a pretty major bug).

> 
> Looking forward to seeing your original patch land again!

Definately.
Comment 16 James Robinson 2010-09-28 00:18:45 PDT
Hi folks,

Naturally, I always prefer to ping a patch author before reverting if possible, but in this case it wasn't.  Given that the original patch was an incorrect perf optimization that caused a serious correctness regression reverting was an easy choice.

As for the test the setTimeouts are less than ideal and you are welcome to improve the test.  It does test what it sets out to and I think fast/repaint is a fine place to put a repaint test.
Comment 17 Nikolas Zimmermann 2010-09-28 01:20:04 PDT
(In reply to comment #16)
> Hi folks,
> 
> Naturally, I always prefer to ping a patch author before reverting if possible, but in this case it wasn't.  Given that the original patch was an incorrect perf optimization that caused a serious correctness regression reverting was an easy choice.

It was not incorrect. Your revert hides the fact, that we're not dealing display attribute changes correct for SVG renderers.
 
> As for the test the setTimeouts are less than ideal and you are welcome to improve the test.  It does test what it sets out to and I think fast/repaint is a fine place to put a repaint test.

I prefer to give that kind of feedback as review feedback, and you could improve your test, before landing.

To summarize: I don't like the attitude that's being shown here.
Comment 18 Eric Seidel (no email) 2010-09-28 11:21:05 PDT
I think WildFox and jamesr need to go hug in #webkit.  krit can join the love-fest if he so choses. :)
Comment 19 James Robinson 2010-09-28 14:52:28 PDT
I'm sorry you feel that way.  The revision this patch reverted added no regression test, which usually means that no change in behavior is intended.  The layout test portion was reviewed by Simon who I think is more than qualified to review repaint tests.  I think the best overall way to reduce issues like this is to increase test coverage so that regressions are noticed sooner (preferably during development and before landing).
Comment 20 Nikolas Zimmermann 2010-10-02 03:23:32 PDT
Created attachment 69571 [details]
Patch

The real problem with RenderStyle::diff() is fixed in trunk, revert james workaround.
His patch remains, and works with this patch as well.
Comment 21 Dirk Schulze 2010-10-02 03:43:19 PDT
Comment on attachment 69571 [details]
Patch

Found another regression in http://dev.w3.org/SVG/profiles/1.1F2/test/harness/htmlObject/animate-elem-31-t.html with this patch. Niko investigates...
Comment 22 Alexey Proskuryakov 2011-01-19 17:50:39 PST
What's the status of this bug? When opening "smaller reduction", I see a green square in ToT, but a blank page in Safari 5 and in Firefox. What's right?
Comment 23 Dirk Schulze 2011-05-22 10:35:05 PDT
(In reply to comment #22)
> What's the status of this bug? When opening "smaller reduction", I see a green square in ToT, but a blank page in Safari 5 and in Firefox. What's right?

The original regression is fixed. The result on Safari 5 and Opera is blank, because both do not support HTML5. And Firefox has the same behavior like WebKit trunk, a green rect at the end of the animation.