[Webkit-unassigned] [Bug 93755] ShadowRoot insertion point change aborts css transition
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Aug 13 03:23:13 PDT 2012
https://bugs.webkit.org/show_bug.cgi?id=93755
Takashi Sakamoto <tasak at google.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |tasak at google.com
--- Comment #1 from Takashi Sakamoto <tasak at google.com> 2012-08-13 03:23:42 PST ---
(In reply to comment #0)
> Created an attachment (id=157837)
--> (https://bugs.webkit.org/attachment.cgi?id=157837&action=review) [details]
> Reduction showing unexpected result and expected result when altering dom not using an insertion point.
>
> If an insertion point select attribute in a shadowRoot is changed synchronously with a css change that should provoke a transition, the transition does not occur.
>
> It is possible to address this problem by using webkitRequestAnimationFrame to provoke the transition.
>
> If this is the intended behavior it should be noted that it is unlike other similar changes to dom (e.g. appending a node to the document and provoking a transition on it can be done synchronously.)
I investigated the bug and I'm now thinking of how to fix this issue. I think, this is caused by reattach in Element::recalcStyle.
(1) Changing insertion point's select causes the shadow host's reattach. (c.f. ElementShadow::invalidateDistribution(). if (needsReattach && host->attached()) { host->detach(); ...)
(2) Element::recalcStyle for the shadow host invokes reattach() because the host was detached.
(3) During the reattach, the shadow host's renderer is re-created, and RenderObject::setAnimatableStyle is invoked. So animation()->updateAnimations() is also invoked. (animation is an instance of class AnimationController).
(4) AnimationController::updateAnimations doesn't create ImplicitAnimation because currentStyle == null. (transitions() requires currentStyle != 0, but as renderer was detached, currentStyle was set to be null. i.e. the condition: (renderer->parent() || newStyle->animations() || (oldStyle && oldStyle->animations())) is false.
(5) All styles are resolved, but no transitions are started.
So,
r.querySelector("content").setAttribute("select", "*:last-child");
// expected to provoke a css transition but does not.
+ document.body.offsetLeft;
ts.classList.add("fade");
adding "document.body.offsetLeft;" before ts.classList.add("fade"), css transition for distributed nodes will work.
Best regards,
Takashi Sakamoto
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
More information about the webkit-unassigned
mailing list