<!DOCTYPE html><title>CSS Transitions Test: Name defining @-rules in @starting-style</title><linkrel="help"href="https://drafts.csswg.org/css-transitions-2/#defining-before-change-style-the-starting-style-rule"><scriptsrc="/resources/testharness.js"></script><scriptsrc="/resources/testharnessreport.js"></script><style>@starting-style{@keyframesanim{from{color:green;}to{color:red;}}@font-face{font-family:web-font;src:url('/fonts/Ahem.ttf');}@layerfirst;}@layersecond{#target.not_start{background-color:green;}}@layerfirst{#target.not_start{background-color:red;}}#target.not_start{animation-name:anim;animation-duration:60s;animation-timing-function:step-end;font-family:web-font;font-size:20px;}#target{/* For measuring text width */display:inline-block;}</style><spanid="target">XXXX</span><script>test(()=>{// Force style update to ensure before-change style is defined.target.offsetTop;target.className="not_start";lettarget_style=getComputedStyle(target);assert_equals(target_style.color,"rgb(0, 128, 0)","@keyframes applied");assert_equals(target_style.backgroundColor,"rgb(0, 128, 0)","@layer applied");},"@keyframes and @layer in @starting-style apply");promise_test(async()=>{awaitdocument.fonts.load("20px/1 web-font");assert_equals(getComputedStyle(target).width,"80px");},"Load @font-face from @starting-style rule");</script>