RESOLVED FIXED 246914
[web-animations] commitStyles() fails to commit a relative line-height value
https://bugs.webkit.org/show_bug.cgi?id=246914
Summary [web-animations] commitStyles() fails to commit a relative line-height value
Antoine Quint
Reported 2022-10-23 03:36:36 PDT
We fail this subtest in web-animations/interfaces/Animation/commitStyles.html: test(t => { const div = createDiv(t); div.style.fontSize = '10px'; const animation = div.animate( { lineHeight: '1.5' }, { duration: 1, fill: 'forwards' } ); animation.finish(); animation.commitStyles(); animation.cancel(); assert_numeric_style_equals(getComputedStyle(div).lineHeight, 15); assert_equals(div.style.lineHeight, "1.5", "line-height is committed as a relative value"); div.style.fontSize = '20px'; assert_numeric_style_equals(getComputedStyle(div).lineHeight, 30, "Changes to the font-size should affect the committed line-height"); }, 'Commits relative line-height'); This is because of BuilderConverter::convertLineHeight() where a line-height specified as a percentage is stored as a LengthType::Fixed, while a line-height specified as number is stored as LengthType::Percent. We'll somehow need to account for `specifiedLineHeight()`.
Attachments
Antoine Quint
Comment 1 2022-10-23 04:13:09 PDT
Antoine Quint
Comment 2 2022-10-24 02:18:13 PDT
We'll need mix() support, I filed https://bugs.webkit.org/show_bug.cgi?id=246937. Retitling this bug to correctly identify the issue.
Antoine Quint
Comment 3 2022-10-24 02:22:05 PDT
Wrong bug about mix(), we have a fix for this.
EWS
Comment 4 2022-10-24 06:01:27 PDT
Committed 255912@main (1610fc726837): <https://commits.webkit.org/255912@main> Reviewed commits have been landed. Closing PR #5685 and removing active labels.
Radar WebKit Bug Importer
Comment 5 2022-10-24 06:02:19 PDT
Note You need to log in before you can comment on or make changes to this bug.