mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-27 03:10:01 +00:00
Resolves a FIXME in `CSSRuleList::insert_a_css_rule`. Gets us a bit closer to passing https://wpt.live/css/cssom/at-namespace.html but that requires more work around parsing of selectors with namespaces (namely disallowing use of undeclared selectors), which I have added a FIXME for.
28 lines
No EOL
960 B
HTML
28 lines
No EOL
960 B
HTML
<!DOCTYPE html>
|
|
<style id="a">
|
|
@namespace my_namespace_1 url("http://www.w3.org/1999/xhtml");
|
|
@import url("nonexist.css");
|
|
</style>
|
|
<style id="b">
|
|
div {
|
|
color: green;
|
|
}
|
|
</style>
|
|
<script src="../include.js"></script>
|
|
<script>
|
|
test(() => {
|
|
try {
|
|
a.sheet.insertRule('@namespace my_namespace_3 url("http://www.w3.org/1999/xhtml")', 0);
|
|
println("Can insert namespace rule into sheet with only @namespace and @import rules: PASS");
|
|
} catch {
|
|
println("Can insert namespace rule into sheet with only @namespace and @import rules: FAIL");
|
|
}
|
|
|
|
try {
|
|
s.sheet.insertRule('@namespace my_namespace_3 url("http://www.w3.org/1999/xhtml")', 0);
|
|
println("Cannot insert namespace rule into sheet with existing rules: FAIL");
|
|
} catch {
|
|
println("Cannot insert namespace rule into sheet with existing rules: PASS");
|
|
}
|
|
});
|
|
</script> |