Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Gecko Bug 1673885] Don't expose incomplete sheets in LinkStyle.sheet / Document.styleSheets. #26379

Merged
merged 1 commit into from Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 5 additions & 5 deletions css/cssom/ttwf-cssom-doc-ext-load-count.html
Expand Up @@ -39,21 +39,21 @@
}, "stylesheet.css should be unloaded and styleSheets.length === 0");

// Verify that the styleSheets list length is back to 1 after loading a new sheet
test(function() {
async_test(function(t) {

// create a css file reference
var fileReference = document.createElement("link");
fileReference.setAttribute("rel", "stylesheet");
fileReference.setAttribute("type", "text/css");
fileReference.setAttribute("href", "stylesheet-1.css");
fileReference.onerror = t.step_func_done(function() {
// assert that there is 1 styleSheet in the styleSheets property
assert_equals(styleSheets.length, 1, "styleSheets.length is incorrect:");
});

// load the css file reference into the head section
var head = document.getElementsByTagName("HEAD")[0];
head.appendChild(fileReference);

// assert that there is 1 styleSheet in the styleSheets property
assert_equals(styleSheets.length, 1, "styleSheets.length is incorrect:");

}, "stylesheet-1.css should be loaded and styleSheets.length === 1");

</script>
Expand Down
4 changes: 2 additions & 2 deletions css/cssom/ttwf-cssom-doc-ext-load-tree-order.html
Expand Up @@ -21,7 +21,7 @@
<body>
<div id="log"></div>
<script>

onload = function() {
// Get the Document's styleSheets attribute
var styleSheets = document.styleSheets;

Expand Down Expand Up @@ -50,7 +50,7 @@
test(function() {
assert_equals(styleSheets.item(4).title, "zebra", "title for item 1 is incorrect:");
}, "styleSheets item 0 title must be zebra");

};
</script>
</body>
</html>