Commit bfdd4988 authored by Daniil Sakhapov's avatar Daniil Sakhapov Committed by aborovova@mozilla.com
Browse files

Bug 1967953 [wpt PR 52722] - Add length conversion checkers to CSSScaleInterpolationType,

Automatic update from web-platform-tests
Add length conversion checkers to CSSScaleInterpolationType

So that when the font-size changes during animation, we correctly
update the relative-units dependent value.

Bug: 415572412
Change-Id: I2a73a636332a2c43fe8a790c34c4f38c6661997d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6578189


Reviewed-by: default avatarAnders Hartvoll Ruud <andruud@chromium.org>
Commit-Queue: Daniil Sakhapov <sakhapov@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1463997}

--

wpt-commits: dee11aa747c260ab3966d8e89813ace1fc1df879
wpt-pr: 52722

Differential Revision: https://phabricator.services.mozilla.com/D250998
parent ab481e63
Loading
Loading
Loading
Loading
+35 −0
Original line number Diff line number Diff line
<!DOCTYPE html>
<title>CSS Values Test: sign() in keyframes with relative units and font-size change</title>
<link rel="help" href="https://drafts.csswg.org/css-values/#sign-funcs">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
  @keyframes --a {
    from {
      scale: calc(1.5 + sign(1em - 10px));
    }
    to {
      scale: 1;
    }
  }
  #target {
    animation-name: --a;
    animation-duration: 1000s;
    animation-timing-function: steps(2, start);
    width: 100px;
    height: 100px;
    background: teal;
    font-size: 8px;
  }
</style>
<div id="target"></div>
<script>
  test(() => {
    assert_equals(getComputedStyle(target).scale, "0.75");
  }, "Initially, the font-size is 8px for #target, so the result is 0.75");

  test(() => {
    target.style.fontSize = "16px";
    assert_equals(getComputedStyle(target).scale, "1.75");
  }, "Changing the font-size of #target changes the start point, so the result should be 1.75");
</script>