Skip to content

Commit

Permalink
Fixup a css-shapes test broken by web-platform-tests#19577
Browse files Browse the repository at this point in the history
  • Loading branch information
LukeZielinski committed Oct 16, 2019
1 parent f960a2d commit f236bf4
Showing 1 changed file with 12 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@
// font relative units: em, ex, ch, rem
var units = ['em', 'ex', 'ch', 'rem'];
var resolveds = {};
ParsingUtils.setupFonts(function () {
var div = document.createElement('div');
document.body.appendChild(div);
units.forEach(function(unit) {
div.style.width = '10' + unit;
var s = getComputedStyle(div);
resolveds[unit] = parseFloat(s.width);
});
document.body.removeChild(div);
})();
ParsingUtils.setupFonts();

var div = document.createElement('div');
document.body.appendChild(div);
units.forEach(function(unit) {
div.style.width = '10' + unit;
var s = getComputedStyle(div);
resolveds[unit] = parseFloat(s.width);
});
document.body.removeChild(div);

function fillArray(string, length) {
return Array.apply(null, new Array(length)).map(String.prototype.valueOf, string);
Expand All @@ -49,6 +49,8 @@
});

generate_tests(testUnit, tests);

ParsingUtils.restoreFonts();
</script>
</body>
</html>

0 comments on commit f236bf4

Please sign in to comment.