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
This commit is contained in:
Emilio Cobos Álvarez 2017-06-21 12:16:43 +02:00
Родитель 5fae0f256d
Коммит f3027e4723
3 изменённых файлов: 25 добавлений и 0 удалений

Просмотреть файл

@ -0,0 +1,8 @@
<!doctype html>
<title>CSS Test reference</title>
<style>
div { color: green; font-size: 10px; }
</style>
<div>
Should be green, and have a 10px font-size.
</div>

Просмотреть файл

@ -0,0 +1,16 @@
<!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>

Просмотреть файл

@ -2015,3 +2015,4 @@ fails-if(!stylo||styloVsGecko) == 1365162-1.html 1365162-1-ref.html
== 1369954-1.xhtml 1369954-1-ref.xhtml
== 1369985-1.html 1369985-1-ref.html
== 1371130.xhtml 1371130-ref.xhtml
== 1374062.html 1374062-ref.html