<!doctype HTML><htmllang="tr"class="reftest-wait"><metacharset="utf-8"><title>HTML5 Canvas Test: The lang attribute inherits from the canvas in a transferred offscreen</title><linkrel="match"href="canvas.2d.offscreen.lang-ref.html"/><linkrel="author"href="mailto:schenney@chromium.org"/><linkrel="help"href="https://html.spec.whatwg.org/multipage/canvas.html#text-styles"/><metaname="assert"content="An offscreen transferred from a canvas inherits the document language."/><scriptsrc="/common/reftest-wait.js"></script><style>#canvas-tr{position:absolute;top:10px;left:10px;}#canvas-en{position:absolute;top:120px;left:10px;}</style><scripttype="text/javascript">functiondrawText(language){varcanvas=document.getElementById('canvas-'+language);varctx=canvas.transferControlToOffscreen().getContext('2d');// The default for lang is inheritctx.font='25px Lato-Medium';ctx.fillText('fi',5,50);}functionrunTest(){lettest_font=newFontFace(// Lato-Medium is a font with language specific ligatures."Lato-Medium","url(/fonts/Lato-Medium.ttf)");test_font.load().then((font)=>{document.fonts.add(font);drawText('tr');document.documentElement.setAttribute('lang','en');drawText('en');takeScreenshot();});}</script><bodyonload="runTest()"><canvaslang="tr"id="canvas-tr"width="300"height="100"> Browser does not support HTML5 Canvas.</canvas><canvaslang="en"id="canvas-en"width="300"height="100"> Browser does not support HTML5 Canvas.</canvas></body></html>