RESOLVED FIXED 60137
Mismatched multiple box-shadows do not transition as expected
https://bugs.webkit.org/show_bug.cgi?id=60137
Summary Mismatched multiple box-shadows do not transition as expected
Simon Fraser (smfr)
Reported 2011-05-03 20:55:36 PDT
Created attachment 92188 [details] Testcase A transition from one inset box-shadow to two shadows, one inset and one outset, doesn't work as expected. See testcase.
Attachments
Testcase (302 bytes, text/html)
2011-05-03 20:55 PDT, Simon Fraser (smfr)
no flags
Patch (11.52 KB, patch)
2011-05-03 22:33 PDT, Simon Fraser (smfr)
no flags
Patch (11.50 KB, patch)
2011-05-11 22:18 PDT, Simon Fraser (smfr)
mitz: review+
Simon Fraser (smfr)
Comment 1 2011-05-03 20:56:03 PDT
Simon Fraser (smfr)
Comment 2 2011-05-03 20:56:17 PDT
The issue here is that shadows are processed in reverse order, and the last shadows have different types in the testcase.
Simon Fraser (smfr)
Comment 3 2011-05-03 22:33:03 PDT
Early Warning System Bot
Comment 4 2011-05-04 02:38:25 PDT
WebKit Review Bot
Comment 5 2011-05-04 16:33:25 PDT
Simon Fraser (smfr)
Comment 6 2011-05-11 22:18:22 PDT
mitz
Comment 7 2011-05-11 22:37:28 PDT
Comment on attachment 93245 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=93245&action=review r+ but please consider addressing at least some of the comments > Source/WebCore/page/animation/AnimationBase.cpp:330 > +static inline int shadowListLength(const ShadowData* shadow) Why not size_t? > Source/WebCore/page/animation/AnimationBase.cpp:394 > + if (fromLength == toLength || ((!fromLength || fromLength == 1) && (!toLength || toLength == 1))) { If you make shadowListLength return an unsigned type, you will be able to write “(!fromLength || fromLength == 1)” as “fromLength <= 1” > Source/WebCore/page/animation/AnimationBase.cpp:444 > + Vector<const ShadowData*> fromShadows(fromLength); > + Vector<const ShadowData*> toShadows(toLength); > + > + while (shadowA) { > + fromShadows.prepend(shadowA); > + shadowA = shadowA->next(); > + } > + > + while (shadowB) { > + toShadows.prepend(shadowB); > + shadowB = shadowB->next(); > + } This is an expensive way of doing things. You initialize fromShadows with fromLength 0 ShadowData pointers in it, then you prepend another fromLength pointers to that. You should do something like for (size_t i = fromLength; i >= 0; --i) { fromShadows[i - 1] = shadowA; shadowA = shadowA->next(); } And it would be better to give these vectors inline capacity to avoid heap allocation.
Simon Fraser (smfr)
Comment 8 2011-05-12 09:38:57 PDT
WebKit Review Bot
Comment 9 2011-05-12 11:10:22 PDT
http://trac.webkit.org/changeset/86351 might have broken GTK Linux 64-bit Debug The following tests are not passing: svg/custom/fill-opacity-update.svg
Note You need to log in before you can comment on or make changes to this bug.