Bug 1420755: Make the MediaList coming from the loader know about its stylesheet. r=heycam

MozReview-Commit-ID: 6W2aWf6jS9c
This commit is contained in:
Emilio Cobos Álvarez 2017-11-26 21:07:14 +01:00
Родитель f0347242dc
Коммит 21f3b5ec72
4 изменённых файлов: 46 добавлений и 1 удалений

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

@ -871,6 +871,9 @@ StyleSheet::List(FILE* out, int32_t aIndent) const
void
StyleSheet::SetMedia(dom::MediaList* aMedia)
{
if (aMedia) {
aMedia->SetStyleSheet(this);
}
mMedia = aMedia;
}

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

@ -155023,6 +155023,18 @@
{}
]
],
"css/cssom/medialist-dynamic-001.html": [
[
"/css/cssom/medialist-dynamic-001.html",
[
[
"/css/cssom/medialist-dynamic-001-ref.html",
"=="
]
],
{}
]
],
"css/cssom/selectorText-modification-restyle-001.html": [
[
"/css/cssom/selectorText-modification-restyle-001.html",
@ -253163,6 +253175,11 @@
{}
]
],
"css/cssom/medialist-dynamic-001-ref.html": [
[
{}
]
],
"css/cssom/selectorText-modification-restyle-001-ref.html": [
[
{}
@ -511065,7 +511082,7 @@
"testharness"
],
"css/cssom-view/overscrollBehavior-manual.html": [
"ca369af991f1e1c34116f2effe0d53a806ed9df5",
"65cb71ca6b606dc8b0b527c58902566539e771b2",
"manual"
],
"css/cssom-view/resources/elementsFromPoint.js": [
@ -511468,6 +511485,14 @@
"c1dfd96239986c9c57d7b07caebbd1fc9654e0b9",
"testharness"
],
"css/cssom/medialist-dynamic-001-ref.html": [
"bdf98c994adcebff3a3434260dfe71e99c8441e1",
"support"
],
"css/cssom/medialist-dynamic-001.html": [
"8c62d1e6b5791b68240551c0c9cd115f4d16a892",
"reftest"
],
"css/cssom/medialist-interfaces-001.html": [
"dfaea262508d72d123006409174e3e21832a305f",
"testharness"

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

@ -0,0 +1,5 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test Reference</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
Should not be red.

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

@ -0,0 +1,12 @@
<!doctype html>
<meta charset="utf-8">
<title>CSS Test: Dynamic changes to the stylesheet media attributes via CSSOM get reflected</title>
<link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io">
<link rel="match" href="medialist-dynamic-001-ref.html">
<link rel="help" href="https://drafts.csswg.org/cssom/#dom-medialist-mediatext">
<style media="all">* { color: red }</style>
Should not be red.
<script>
document.body.offsetTop;
document.styleSheets[0].media.mediaText = "not all";
</script>