Bug 245179

Summary: getKeyframes() returns equal "from" and "to" values for a "width" transition
Product: WebKit Reporter: Antoine Quint <graouts>
Component: AnimationsAssignee: Antoine Quint <graouts>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, graouts, koivisto, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
See Also: https://bugs.webkit.org/show_bug.cgi?id=23775
Attachments:
Description Flags
testcase none

Description Antoine Quint 2022-09-14 07:48:35 PDT
Starting a "width" transition for a simple <div> will return the same values for "from" and "to" when getKeyframes() is called. This cannot be correct since a transition cannot have the same from and to values. Digging into this, this is about this code in ComputedStyleExtractor::valueForPropertyInStyle():

        case CSSPropertyWidth:
            if (renderer && !renderer->isRenderOrLegacyRenderSVGModelObject()) {
                // According to http://www.w3.org/TR/CSS2/visudet.html#the-width-property,
                // the "width" property does not apply for non-replaced inline elements.
                if (!isNonReplacedInline(*renderer))
                    return zoomAdjustedPixelValue(sizingBox(*renderer).width(), style);
            }
            return zoomAdjustedPixelValueForLength(style.width(), style);

In this case we end up calling zoomAdjustedPixelValue(sizingBox(*renderer).width(), style) which simply does not use the values provided in the RenderStyle for the keyframe.
Comment 1 Antoine Quint 2022-09-14 07:50:13 PDT
Created attachment 462334 [details]
testcase
Comment 2 Antoine Quint 2022-09-14 09:09:25 PDT
Pull request: https://github.com/WebKit/WebKit/pull/4350
Comment 3 Radar WebKit Bug Importer 2022-09-21 07:49:18 PDT
<rdar://problem/100223910>
Comment 4 Antoine Quint 2022-09-23 03:13:01 PDT
I believe this got fixed along with bug 23924. Will add a new test though.
Comment 5 EWS 2022-09-23 10:10:24 PDT
Committed 254793@main (1ed5a302e8a0): <https://commits.webkit.org/254793@main>

Reviewed commits have been landed. Closing PR #4350 and removing active labels.