Bug 245179 - getKeyframes() returns equal "from" and "to" values for a "width" transition
Summary: getKeyframes() returns equal "from" and "to" values for a "width" transition
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-09-14 07:48 PDT by Antoine Quint
Modified: 2022-09-23 10:10 PDT (History)
4 users (show)

See Also:


Attachments
testcase (815 bytes, text/html)
2022-09-14 07:50 PDT, Antoine Quint
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
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.