gecko-dev/testing/web-platform/tests/css/css-animations/animation-base-response-002.html
Anders Hartvoll Ruud 3fe6a3d038 Bug 1623615 [wpt PR 22331] - Let base style respond to font animations, a=testonly
Automatic update from web-platform-tests
Let base style respond to font animations

Whenever we are animating a property that affects the font, we must
avoid the base computed style optimization. This is because the base
style may contain em, ex (etc) units which needs to resolve against
the font.

Hence, set a flag when a font-affecting animation is applied.

Bug: 437689
Change-Id: I8bd950a1df9c8e100c4ca2b7318b0389a2acfad0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2109694
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752498}

--

wpt-commits: d12a254011ec967f8f72ba5d380b932a2d7912e8
wpt-pr: 22331
2020-03-31 11:30:32 +00:00

25 lines
700 B
HTML

<!DOCTYPE html>
<title>Test that rem units are responsive to animated font-size on root</title>
<link rel="help" href="https://drafts.csswg.org/css-animations/">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@keyframes font_size_animation {
from { font-size: 10px; }
to { font-size: 20px; }
}
:root {
font-size: 1px;
animation: font_size_animation steps(2, end) 1000s -500s;
}
#target1 {
width: 1rem;
}
</style>
<div id="target1"></div>
<script>
test(() => {
assert_equals(getComputedStyle(target1).getPropertyValue('width'), '15px');
}, 'Animated font-size on root affects rem units');
</script>