diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 19:33:14 +0000 |
commit | 36d22d82aa202bb199967e9512281e9a53db42c9 (patch) | |
tree | 105e8c98ddea1c1e4784a60a5a6410fa416be2de /layout/reftests/cssom/computed-style-cross-window.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip |
Adding upstream version 115.7.0esr.upstream/115.7.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/cssom/computed-style-cross-window.html')
-rw-r--r-- | layout/reftests/cssom/computed-style-cross-window.html | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/layout/reftests/cssom/computed-style-cross-window.html b/layout/reftests/cssom/computed-style-cross-window.html new file mode 100644 index 0000000000..547e840cab --- /dev/null +++ b/layout/reftests/cssom/computed-style-cross-window.html @@ -0,0 +1,62 @@ +<!DOCTYPE HTML> +<html class="reftest-wait"> +<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; + + document.documentElement.removeAttribute("class"); +} + +</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 id="res1">This paragraph is the color that +outerWindow.getComputedStyle says the paragraph inside the iframe +is.</div> + +<div id="res2">This paragraph is the color that +iframeWindow.getComputedStyle says the paragraph outside the iframe +is.</div> + +<div id="res3">This paragraph is the color that +outerWindow.getComputedStyle says the display:none paragraph inside the +iframe is.</div> + +<div id="res4">This paragraph is the color that +iframeWindow.getComputedStyle says the display:none paragraph outside +the iframe is.</div> |