<!DOCTYPE html>
<meta charset="utf-8">
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<svg id="svg" height="0" font-size="100">
<text id="text">
<!-- invalid non-bmp character followed by a valid character -->
<tspan>򐀒a</tspan>
<!-- many invalid non-bmp characters followed by a valid character -->
<tspan>򐀒򐀒򐀒򐀒a򐀒򐀒򐀒򐀒a</tspan>
<!-- alternating valid and invalid non-bmp characters -->
<tspan>😂򐀒😂򐀒😂򐀒</tspan>
<!-- invalid non-bmp characters in rtl -->
<tspan direction="rtl">نشاط😂نشاط򐀒򐀒ن򐀒شاط😂نش򐀒اط򐀒ا</tspan>
</text>
</svg>
<script>
test(function() {
text.getComputedTextLength();
svg.parentElement.removeChild(svg);
}, 'Text runs with invalid non-bmp characters should not crash.');
</script>