summaryrefslogtreecommitdiffstats
path: root/layout/reftests/stylesheet-cloning
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 01:47:29 +0000
commit0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch)
treea31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /layout/reftests/stylesheet-cloning
parentInitial commit. (diff)
downloadfirefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz
firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/stylesheet-cloning')
-rw-r--r--layout/reftests/stylesheet-cloning/counter-style-rule-clone.html13
-rw-r--r--layout/reftests/stylesheet-cloning/document-rule-clone.html10
-rw-r--r--layout/reftests/stylesheet-cloning/glyphs-ref.html8
-rw-r--r--layout/reftests/stylesheet-cloning/importrule.css1
-rw-r--r--layout/reftests/stylesheet-cloning/insert-after-clone.html11
-rw-r--r--layout/reftests/stylesheet-cloning/media-rule-clone.html10
-rw-r--r--layout/reftests/stylesheet-cloning/ref-common.css12
-rw-r--r--layout/reftests/stylesheet-cloning/reftest.list7
-rw-r--r--layout/reftests/stylesheet-cloning/shouldbegreen-ref.html7
-rw-r--r--layout/reftests/stylesheet-cloning/style-rule-clone.html10
-rw-r--r--layout/reftests/stylesheet-cloning/supports-rule-clone.html10
-rw-r--r--layout/reftests/stylesheet-cloning/test-common.css18
12 files changed, 117 insertions, 0 deletions
diff --git a/layout/reftests/stylesheet-cloning/counter-style-rule-clone.html b/layout/reftests/stylesheet-cloning/counter-style-rule-clone.html
new file mode 100644
index 0000000000..ed3ec81e74
--- /dev/null
+++ b/layout/reftests/stylesheet-cloning/counter-style-rule-clone.html
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<link rel="stylesheet" href="data:text/css,@counter-style a { system: fixed; symbols: A B C D; suffix: '' }">
+<link rel="stylesheet" href="data:text/css,@counter-style a { system: fixed; symbols: A B C D; suffix: '' }">
+<link rel="stylesheet" href="test-common.css">
+<ol style="list-style-type: a">
+ <li><li><li><li><li>
+</ol>
+<script>
+ onload = function() {
+ var links = document.getElementsByTagName("link");
+ links[0].sheet.cssRules[0].symbols = "\u25F0 \u25F1 \u25F2 \u25F3";
+ }
+</script> \ No newline at end of file
diff --git a/layout/reftests/stylesheet-cloning/document-rule-clone.html b/layout/reftests/stylesheet-cloning/document-rule-clone.html
new file mode 100644
index 0000000000..f6228c52b3
--- /dev/null
+++ b/layout/reftests/stylesheet-cloning/document-rule-clone.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<link rel="stylesheet" href="data:text/css,@-moz-document regexp('.*') {div { color: green; }}">
+<link rel="stylesheet" href="data:text/css,@-moz-document regexp('.*') {div { color: green; }}">
+<div>This should be green</div>
+<script>
+ onload = function() {
+ var links = document.getElementsByTagName("link");
+ links[0].sheet.cssRules[0].cssRules[0].style.color = "red";
+ }
+</script>
diff --git a/layout/reftests/stylesheet-cloning/glyphs-ref.html b/layout/reftests/stylesheet-cloning/glyphs-ref.html
new file mode 100644
index 0000000000..f8acbd27d3
--- /dev/null
+++ b/layout/reftests/stylesheet-cloning/glyphs-ref.html
@@ -0,0 +1,8 @@
+<!DOCTYPE html>
+<link rel="stylesheet" href="ref-common.css">
+<!-- list-style-type: a -->
+<div>A</div>
+<div>B</div>
+<div>C</div>
+<div>D</div>
+<div>5</div>
diff --git a/layout/reftests/stylesheet-cloning/importrule.css b/layout/reftests/stylesheet-cloning/importrule.css
new file mode 100644
index 0000000000..25ccf7a26a
--- /dev/null
+++ b/layout/reftests/stylesheet-cloning/importrule.css
@@ -0,0 +1 @@
+@import url(chrome:///browser/skin/);
diff --git a/layout/reftests/stylesheet-cloning/insert-after-clone.html b/layout/reftests/stylesheet-cloning/insert-after-clone.html
new file mode 100644
index 0000000000..e47a389f7d
--- /dev/null
+++ b/layout/reftests/stylesheet-cloning/insert-after-clone.html
@@ -0,0 +1,11 @@
+<!DOCTYPE HTML>
+<title>Test insert rule after clone</title>
+<link rel=stylesheet href="importrule.css">
+<link id="two" rel=stylesheet href="importrule.css">
+<body onload="run()">
+<script>
+function run() {
+ document.getElementById("two").sheet.insertRule("div { color: green}", 1);
+}
+</script>
+<div>This should be green</div>
diff --git a/layout/reftests/stylesheet-cloning/media-rule-clone.html b/layout/reftests/stylesheet-cloning/media-rule-clone.html
new file mode 100644
index 0000000000..b7a3264083
--- /dev/null
+++ b/layout/reftests/stylesheet-cloning/media-rule-clone.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<link rel="stylesheet" href="data:text/css,@media all {div { color: green; }}">
+<link rel="stylesheet" href="data:text/css,@media all {div { color: green; }}">
+<div>This should be green</div>
+<script>
+ onload = function() {
+ var links = document.getElementsByTagName("link");
+ links[0].sheet.cssRules[0].cssRules[0].style.color = "red";
+ }
+</script>
diff --git a/layout/reftests/stylesheet-cloning/ref-common.css b/layout/reftests/stylesheet-cloning/ref-common.css
new file mode 100644
index 0000000000..92d77de0e5
--- /dev/null
+++ b/layout/reftests/stylesheet-cloning/ref-common.css
@@ -0,0 +1,12 @@
+body {
+ /* to match ua.css, see bug 1020143 */
+ font-variant-numeric: tabular-nums;
+}
+div, p {
+ padding: 0; margin: 0;
+ line-height: 150%;
+ float: left;
+}
+p {
+ padding-right: .5em;
+}
diff --git a/layout/reftests/stylesheet-cloning/reftest.list b/layout/reftests/stylesheet-cloning/reftest.list
new file mode 100644
index 0000000000..6be2f7cebc
--- /dev/null
+++ b/layout/reftests/stylesheet-cloning/reftest.list
@@ -0,0 +1,7 @@
+== counter-style-rule-clone.html glyphs-ref.html # passes trivially
+# because "Dynamic change on @counter-style not yet supported"
+pref(layout.css.moz-document.content.enabled,true) == document-rule-clone.html shouldbegreen-ref.html
+== media-rule-clone.html shouldbegreen-ref.html
+== insert-after-clone.html shouldbegreen-ref.html
+== style-rule-clone.html shouldbegreen-ref.html
+== supports-rule-clone.html shouldbegreen-ref.html
diff --git a/layout/reftests/stylesheet-cloning/shouldbegreen-ref.html b/layout/reftests/stylesheet-cloning/shouldbegreen-ref.html
new file mode 100644
index 0000000000..cd4a755bb7
--- /dev/null
+++ b/layout/reftests/stylesheet-cloning/shouldbegreen-ref.html
@@ -0,0 +1,7 @@
+<!DOCTYPE html>
+<style>
+div {
+ color: green;
+}
+</style>
+<div>This should be green</div>
diff --git a/layout/reftests/stylesheet-cloning/style-rule-clone.html b/layout/reftests/stylesheet-cloning/style-rule-clone.html
new file mode 100644
index 0000000000..898199e5b5
--- /dev/null
+++ b/layout/reftests/stylesheet-cloning/style-rule-clone.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<link rel="stylesheet" href="data:text/css,div { color: green }">
+<link rel="stylesheet" href="data:text/css,div { color: green }">
+<div>This should be green</div>
+<script>
+ onload = function() {
+ var links = document.getElementsByTagName("link");
+ links[0].sheet.cssRules[0].style.color = "red";
+ }
+</script>
diff --git a/layout/reftests/stylesheet-cloning/supports-rule-clone.html b/layout/reftests/stylesheet-cloning/supports-rule-clone.html
new file mode 100644
index 0000000000..6edaee2b6d
--- /dev/null
+++ b/layout/reftests/stylesheet-cloning/supports-rule-clone.html
@@ -0,0 +1,10 @@
+<!DOCTYPE html>
+<link rel="stylesheet" href="data:text/css,@supports (color: green) {div { color: green; }}">
+<link rel="stylesheet" href="data:text/css,@supports (color: green) {div { color: green; }}">
+<div>This should be green</div>
+<script>
+ onload = function() {
+ var links = document.getElementsByTagName("link");
+ links[0].sheet.cssRules[0].cssRules[0].style.color = "red";
+ }
+</script>
diff --git a/layout/reftests/stylesheet-cloning/test-common.css b/layout/reftests/stylesheet-cloning/test-common.css
new file mode 100644
index 0000000000..dcbf4e1e02
--- /dev/null
+++ b/layout/reftests/stylesheet-cloning/test-common.css
@@ -0,0 +1,18 @@
+body {
+ /* to match ua.css, see bug 1020143 */
+ font-variant-numeric: tabular-nums;
+}
+ol, ul, section, p {
+ padding: 0; margin: 0;
+ line-height: 150%;
+}
+ol, ul {
+ list-style-position: inside;
+}
+li, p {
+ float: left;
+ padding: 0;
+}
+p {
+ padding-right: .5em;
+}