summaryrefslogtreecommitdiffstats
path: root/layout/reftests/cssom/computed-style-cross-window-ref.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /layout/reftests/cssom/computed-style-cross-window-ref.html
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/cssom/computed-style-cross-window-ref.html')
-rw-r--r--layout/reftests/cssom/computed-style-cross-window-ref.html59
1 files changed, 59 insertions, 0 deletions
diff --git a/layout/reftests/cssom/computed-style-cross-window-ref.html b/layout/reftests/cssom/computed-style-cross-window-ref.html
new file mode 100644
index 0000000000..2a9db18bd8
--- /dev/null
+++ b/layout/reftests/cssom/computed-style-cross-window-ref.html
@@ -0,0 +1,59 @@
+<!DOCTYPE HTML>
+<title>getComputedStyle across windows</title>
+<style>
+p { color: blue }
+
+div { margin: 1em 0 }
+</style>
+
+<script>
+
+var gRunCount = 2;
+
+function run() {
+ if (--gRunCount != 0)
+ return;
+
+ var i = document.getElementById("i");
+
+ var pout = document.getElementById("out");
+ var poutnone = document.getElementById("outnone");
+ var pin = i.contentDocument.getElementsByTagName("p")[0];
+ var pinnone = i.contentDocument.getElementsByTagName("p")[1];
+
+ document.getElementById("res1").style.color =
+ window.getComputedStyle(pin).color;
+
+ document.getElementById("res2").style.color =
+ i.contentWindow.getComputedStyle(pout).color;
+
+ document.getElementById("res3").style.color =
+ window.getComputedStyle(pinnone).color;
+
+ document.getElementById("res4").style.color =
+ i.contentWindow.getComputedStyle(poutnone).color;
+}
+
+</script>
+<body onload="run()">
+
+<p id="out">This is a paragraph outside the iframe.</p>
+<div style="display:none"><p id="outnone">This is a paragraph outside the iframe.</p></div>
+
+<iframe id="i" src="computed-style-cross-window-inner.html" onload="run()"></iframe>
+
+<div style="color:fuchsia">This paragraph is the color that
+outerWindow.getComputedStyle says the paragraph inside the iframe
+is.</div>
+
+<div style="color:blue">This paragraph is the color that
+iframeWindow.getComputedStyle says the paragraph outside the iframe
+is.</div>
+
+<div style="color:fuchsia">This paragraph is the color that
+outerWindow.getComputedStyle says the display:none paragraph inside the
+iframe is.</div>
+
+<div style="color:blue">This paragraph is the color that
+iframeWindow.getComputedStyle says the display:none paragraph outside
+the iframe is.</div>