gecko-dev/layout/reftests/bugs/1374062.html
Emilio Cobos Álvarez f3027e4723 Bug 1374062: Test. r=heycam,manishearth
Before this commit, we assumed that if the element had no parent element, it was
the root of the document, which is plain false, since we can arrive there from,
let's say, getComputedStyle on a detached node.

MozReview-Commit-ID: 65DxdzXgd0J

--HG--
extra : rebase_source : adddedc63687ba05644d04bef1038411d02871c8
2017-06-21 12:16:43 +02:00

17 lines
432 B
HTML

<!doctype html>
<title>
Test for bug 1374062: We don't update the root font-size just because the
element has no parent element.
</title>
<style>
:root { font-size: 5px; }
[restyled] { color: green; font-size: 2rem; }
</style>
<div>
Should be green, and have a 10px font-size.
</div>
<script>
getComputedStyle(document.createElement('div')).color;
document.querySelector('div').setAttribute("restyled", "");
</script>