WebKit Bugzilla
New
Browse
Search+
Log In
×
Sign in with GitHub
or
Remember my login
Create Account
·
Forgot Password
Forgotten password account recovery
RESOLVED WONTFIX
87373
Support CSS Transitions/Animations on Nodes without a RenderObject
https://bugs.webkit.org/show_bug.cgi?id=87373
Summary
Support CSS Transitions/Animations on Nodes without a RenderObject
Nikolas Zimmermann
Reported
2012-05-24 04:58:35 PDT
Support CSS Transitions/Animations on Nodes without a RenderObject. My goal is to remove the RenderSVGGradientStop renderer, created for a SVGStopElement. We don't really need the renderer, except to track style updates / support CSS Transitions/Animations on stop-color/stop-opacity. I've prototyped a patch which adds additional support for CSS Transitions/Animations on render-less Nodes. It works just fine -- if that gets landed,
bug 86941
can be easily done.
Attachments
Patch
(71.83 KB, patch)
2012-05-24 05:07 PDT
,
Nikolas Zimmermann
no flags
Details
Formatted Diff
Diff
Patch v2
(71.93 KB, patch)
2012-05-25 03:54 PDT
,
Nikolas Zimmermann
no flags
Details
Formatted Diff
Diff
Patch v3
(71.92 KB, patch)
2012-05-25 05:59 PDT
,
Nikolas Zimmermann
no flags
Details
Formatted Diff
Diff
Show Obsolete
(2)
View All
Add attachment
proposed patch, testcase, etc.
Nikolas Zimmermann
Comment 1
2012-05-24 05:06:31 PDT
If you check out the patch at
bug 86941
- you'll see that removing RenderSVGGradientStop breaks CSS Transitions/Animations. When altering SVGStopElement::setRenderStyle() like this: void SVGStopElement::setRenderStyle(PassRefPtr<RenderStyle> newStyle) { Frame* frame = document()->frame(); if (frame && (newStyle->hasTransitions() || newStyle->hasAnimations())) m_style = frame->animation()->updateAnimations(this, m_style.get(), newStyle.get()); else m_style = newStyle; if (RenderObject* renderer = parentNode() ? parentNode()->renderer() : 0) RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); } CSS Animations/Transitions work again, just without depending on a renderer. I hope the solution is acceptable - this would move us forward in refactoring the RenderSVGResource* handling (gradients/patterns/clipPath should all have no renderer in future).
Nikolas Zimmermann
Comment 2
2012-05-24 05:07:46 PDT
Created
attachment 143790
[details]
Patch
Early Warning System Bot
Comment 3
2012-05-24 05:18:34 PDT
Comment on
attachment 143790
[details]
Patch
Attachment 143790
[details]
did not pass qt-wk2-ews (qt): Output:
http://queues.webkit.org/results/12803131
Early Warning System Bot
Comment 4
2012-05-24 05:21:04 PDT
Comment on
attachment 143790
[details]
Patch
Attachment 143790
[details]
did not pass qt-ews (qt): Output:
http://queues.webkit.org/results/12791183
Build Bot
Comment 5
2012-05-24 05:40:10 PDT
Comment on
attachment 143790
[details]
Patch
Attachment 143790
[details]
did not pass mac-ews (mac): Output:
http://queues.webkit.org/results/12791186
WebKit Review Bot
Comment 6
2012-05-24 06:58:32 PDT
Comment on
attachment 143790
[details]
Patch
Attachment 143790
[details]
did not pass chromium-ews (chromium-xvfb): Output:
http://queues.webkit.org/results/12800177
Gyuyoung Kim
Comment 7
2012-05-24 07:05:52 PDT
Comment on
attachment 143790
[details]
Patch
Attachment 143790
[details]
did not pass efl-ews (efl): Output:
http://queues.webkit.org/results/12798186
Simon Fraser (smfr)
Comment 8
2012-05-24 08:34:51 PDT
Comment on
attachment 143790
[details]
Patch We need a solution for transitions on pseudo elements if we do this.
Nikolas Zimmermann
Comment 9
2012-05-24 09:15:34 PDT
(In reply to
comment #8
)
> (From update of
attachment 143790
[details]
) > We need a solution for transitions on pseudo elements if we do this.
Ah good point - I'll look into that.
Nikolas Zimmermann
Comment 10
2012-05-25 03:44:41 PDT
(In reply to
comment #8
)
> (From update of
attachment 143790
[details]
) > We need a solution for transitions on pseudo elements if we do this.
I thought again about this. For SVG we intend to use this only on non-rendered Nodes, like <stop>, <linearGradient> etc. What kind of pseudo state could be supported there? (The obvious first-letter, first-line, etc. pseudo classes don't apply here). I think we could use this as-is for <stop> & friends, without having to worry about pseudo states. Please correct me if I'm wrong.
Nikolas Zimmermann
Comment 11
2012-05-25 03:54:17 PDT
Created
attachment 144036
[details]
Patch v2
WebKit Review Bot
Comment 12
2012-05-25 05:09:49 PDT
Comment on
attachment 144036
[details]
Patch v2
Attachment 144036
[details]
did not pass chromium-ews (chromium-xvfb): Output:
http://queues.webkit.org/results/12795500
Nikolas Zimmermann
Comment 13
2012-05-25 05:59:04 PDT
Created
attachment 144052
[details]
Patch v3
Simon Fraser (smfr)
Comment 14
2012-05-25 08:17:58 PDT
Right, but what about CSS pseudo-elements like :before, :after etc. A node may have more than one renderer associated with it, and you have to be able to animate those separately.
Nikolas Zimmermann
Comment 15
2012-05-25 08:49:50 PDT
(In reply to
comment #14
)
> Right, but what about CSS pseudo-elements like :before, :after etc. A node may have more than one renderer associated with it, and you have to be able to animate those separately.
I'm not sure, we never tested generated content for SVG. Generated content is explicitly disallowed for the SVG <text> subtree. SVG itself doesn't say a word about this. I'm not sure if it works at all in trunk for SVG?
Simon Fraser (smfr)
Comment 16
2012-05-25 09:04:51 PDT
I'm thinking about HTML. You can't break AnimationController for HTML.
Nikolas Zimmermann
Comment 17
2012-05-25 09:21:32 PDT
(In reply to
comment #16
)
> I'm thinking about HTML. You can't break AnimationController for HTML.
Wait, HTML isn't affected at all by this patch. RenderObject::setStyle style calls updateAnimations() with a RenderObject*. There's no caller yet which passes a Node* to updateAnimations() which is required for the new code-path to be taken. In my local kill-RenderSVGGradientStop branch I'm using this already.
Simon Fraser (smfr)
Comment 18
2012-05-29 10:11:38 PDT
(In reply to
comment #17
)
> (In reply to
comment #16
) > > I'm thinking about HTML. You can't break AnimationController for HTML. > Wait, HTML isn't affected at all by this patch.
Maybe not, but you're changing AnimationBase to be per-node, rather than per-renderer, so it has the potential to affect HTML, and if we animated pseudo-elements, this would break that.
Nikolas Zimmermann
Comment 19
2012-05-29 13:02:27 PDT
(In reply to
comment #18
)
> (In reply to
comment #17
) > > (In reply to
comment #16
) > > > I'm thinking about HTML. You can't break AnimationController for HTML. > > Wait, HTML isn't affected at all by this patch. > > Maybe not, but you're changing AnimationBase to be per-node, rather than per-renderer, so it has the potential to affect HTML, and if we animated pseudo-elements, this would break that.
Currently there's no difference, as we don't support animating generated content (where renderer->node() is null). I could check AnimationBase to take both a RenderObject* and a Node* - but that doesn't make much sense at the moment unless we had support for animating generated content, which we don't have.
Igor Trindade Oliveira
Comment 20
2012-05-29 13:09:40 PDT
first letter(pseudo element) initial work:
https://bugs.webkit.org/show_bug.cgi?id=85253
I am waiting for this bug to finish the patch. In this case render->node is null. (In reply to
comment #19
)
> (In reply to
comment #18
) > > (In reply to
comment #17
) > > > (In reply to
comment #16
) > > > > I'm thinking about HTML. You can't break AnimationController for HTML. > > > Wait, HTML isn't affected at all by this patch. > > > > Maybe not, but you're changing AnimationBase to be per-node, rather than per-renderer, so it has the potential to affect HTML, and if we animated pseudo-elements, this would break that. > > Currently there's no difference, as we don't support animating generated content (where renderer->node() is null). I could check AnimationBase to take both a RenderObject* and a Node* - but that doesn't make much sense at the moment unless we had support for animating generated content, which we don't have.
Nikolas Zimmermann
Comment 21
2012-05-29 13:23:02 PDT
(In reply to
comment #20
)
> first letter(pseudo element) initial work:
https://bugs.webkit.org/show_bug.cgi?id=85253
> > I am waiting for this bug to finish the patch. In this case render->node is null.
Oh okay, bad timing for my patch it seems. I had a quick glance over it, and I think my approach from this bug report can still work together with generated content, if we pass around the generatingNode(). Needs testing of course. So Simon, how do we proceed from here? a) Get this landed as-is. Let Igor do the integration work with it. b) Let Igos patch go in first, then revisit this patch. What would you prefer? Am I fully on the wrong track for this patch? I really only care about being able to animate render-less Nodes for SVG, not more. But I'll be happy to do any work that helps me to get there :-)
Stephen Chenney
Comment 22
2012-06-27 16:04:18 PDT
Could we get some action on this please? It is blocking 86941 which is related to a top chrome crasher. We can workaround it in the short term, but it seems better to avoid such hackish temp patches.
Eric Seidel (no email)
Comment 23
2012-06-28 15:47:01 PDT
Comment on
attachment 144052
[details]
Patch v3 I believe Antti to be your best reviewer here.
Antti Koivisto
Comment 24
2012-06-28 22:26:52 PDT
This is more of Simon's territory.
Nikolas Zimmermann
Comment 25
2012-06-28 23:02:58 PDT
(In reply to
comment #24
)
> This is more of Simon's territory.
I'm not so sure, whether this patch is still good/valid. It'll complicate things a lot, if we ever want to support transitions/animations on generated content (which I heard is sth. on the agenda).
Simon Fraser (smfr)
Comment 26
2012-06-29 09:02:23 PDT
We should also think about future directions for animatinos, fore example using the same animation engine for SVG and CSS, and being able to animate properties/attributes.
Dirk Schulze
Comment 27
2013-02-15 23:31:19 PST
Comment on
attachment 144052
[details]
Patch v3 It sound this bug is not ready for review anymore. removing review flag.
Dirk Schulze
Comment 28
2014-03-04 06:12:27 PST
Time passed by and I am not sure if we still want to follow this approach. Closing the bug now.
Note
You need to
log in
before you can comment on or make changes to this bug.
Top of Page
Format For Printing
XML
Clone This Bug