| Summary: | [web-animations] commitStyles() fails to commit a relative line-height value | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Antoine Quint <graouts> |
| Component: | Animations | Assignee: | Antoine Quint <graouts> |
| Status: | RESOLVED FIXED | ||
| Severity: | Normal | CC: | dino, graouts, koivisto, mmaxfield, webkit-bug-importer |
| Priority: | P2 | Keywords: | InRadar |
| Version: | Safari Technology Preview | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Bug Depends on: | |||
| Bug Blocks: | 222096 | ||
Pull request: https://github.com/WebKit/WebKit/pull/5685 We'll need mix() support, I filed https://bugs.webkit.org/show_bug.cgi?id=246937. Retitling this bug to correctly identify the issue. Wrong bug about mix(), we have a fix for this. Committed 255912@main (1610fc726837): <https://commits.webkit.org/255912@main> Reviewed commits have been landed. Closing PR #5685 and removing active labels. |
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()`.