Last night I found an HTML5 display issue in the Dart of the ICE Code Editor. All of the DOM elements in the ICE Code Editor are absolutely or relatively positioned. For some reason in HTML5 that means that the body element has a zero pixel height.
I fixed the issue by explicitly setting both the
I don't always test display issues, but I appreciate having tests that catch regressions. Mostly I am just curious to see if it is possible to test display issues—HTML5 or otherwise in Dart.
// Both of these height settings are required for ICE to play nicely // with HTML5 documents document.documentElement.style.height = '100%'; document.body.style.height = '100%';
Since this particular issue is an HTML5 one, I need an HTML5 test context. So I create
html5_test.dartfile contains only a single test that checks the height of the editor after load:
FAIL: HTML5 Full Screen ICE the editor is full-screen Expected: a numeric value within <1.0> of <288> But: differed by <288>. Actual: <0>But with my new code, the test passes. Nice
Since this requires separate browser context than my normal tests, I need to run it separately in my
test_runner.sh, but that is not a big deal. That minor bother aside, it is quite nice that it is so easy to test rendering bugs in Dart.