Removing style element's styles when elements is removed from dom

This commit is contained in:
Roman Zaynetdinov 2017-01-09 19:39:13 +02:00
parent b3ce08f1b5
commit f0c72cb7fd
4 changed files with 59 additions and 1 deletions

View file

@ -6474,6 +6474,18 @@
"url": "/_mozilla/mozilla/remove_link_styles.html"
}
],
"mozilla/remove_style_styles.html": [
{
"path": "mozilla/remove_style_styles.html",
"references": [
[
"/_mozilla/mozilla/remove_style_styles_ref.html",
"=="
]
],
"url": "/_mozilla/mozilla/remove_style_styles.html"
}
],
"mozilla/reparse_style_elements.html": [
{
"path": "mozilla/reparse_style_elements.html",
@ -21876,6 +21888,18 @@
"url": "/_mozilla/mozilla/remove_link_styles.html"
}
],
"mozilla/remove_style_styles.html": [
{
"path": "mozilla/remove_style_styles.html",
"references": [
[
"/_mozilla/mozilla/remove_style_styles_ref.html",
"=="
]
],
"url": "/_mozilla/mozilla/remove_style_styles.html"
}
],
"mozilla/reparse_style_elements.html": [
{
"path": "mozilla/reparse_style_elements.html",

View file

@ -0,0 +1,20 @@
<!doctype html>
<meta charset="utf-8">
<title>Removing style element should remove all associated styles</title>
<link rel="match" href="remove_style_styles_ref.html">
<body>
<style>
body {
background-color: red;
}
</style>
This text should be black and the background should not be red.
<script>
// Force restyling
window.getComputedStyle(document.body);
var s = document.querySelector('style');
s.parentNode.removeChild(s);
</script>
</body>

View file

@ -0,0 +1,5 @@
<!doctype html>
<meta charset="utf-8">
<body>
This text should be black and the background should not be red.
</body>