diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 09:22:09 +0000 |
commit | 43a97878ce14b72f0981164f87f2e35e14151312 (patch) | |
tree | 620249daf56c0258faa40cbdcf9cfba06de2a846 /layout/reftests/xul-document-load | |
parent | Initial commit. (diff) | |
download | firefox-43a97878ce14b72f0981164f87f2e35e14151312.tar.xz firefox-43a97878ce14b72f0981164f87f2e35e14151312.zip |
Adding upstream version 110.0.1.upstream/110.0.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'layout/reftests/xul-document-load')
24 files changed, 235 insertions, 0 deletions
diff --git a/layout/reftests/xul-document-load/readme.txt b/layout/reftests/xul-document-load/readme.txt new file mode 100644 index 0000000000..02b6138c8b --- /dev/null +++ b/layout/reftests/xul-document-load/readme.txt @@ -0,0 +1,27 @@ +This directory contains various XUL document (mozilla/dom/xul/document) testcases for reftest. + +test003: Checks that dynamically removing the stylesheet PI from an inline + script has expected effect. + +test004: Same as test003, but removing the stylesheet PI happens from a "load" + event handler. + +test005: Same as test003, but removing the stylesheet PI happens from a top-level + script in an external JS file. + +test006: Simple <?xml-stylesheet ?> instruction in the prolog has an effect and exists + in the DOM. + +test008: Handle stylesheet PIs pointing to nonexistent resources gracefully. + +test010: PIs in the master document, outside the prolog, don't have any effect but get + added to the DOM. + +test012: Tests that sheets references from <?xml-stylesheet ?> PIs are added to the + document in the same order as the PIs themselves are in - the simple case. + +test013: Tests the same thing as #012, but for the case when the first sheet contains + an @import statement, which makes it -finish- loading earlier than the + second sheet. + +test022: (bug 369828) <html:style> works in XUL documents diff --git a/layout/reftests/xul-document-load/reference-green-window.xhtml b/layout/reftests/xul-document-load/reference-green-window.xhtml new file mode 100644 index 0000000000..4c6ca1987d --- /dev/null +++ b/layout/reftests/xul-document-load/reference-green-window.xhtml @@ -0,0 +1,7 @@ +<?xml version="1.0"?> +<!-- +Any copyright is dedicated to the Public Domain. +http://creativecommons.org/licenses/publicdomain/ +--> +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + style="background-color: green"/> diff --git a/layout/reftests/xul-document-load/reftest.list b/layout/reftests/xul-document-load/reftest.list new file mode 100644 index 0000000000..00d58ae45e --- /dev/null +++ b/layout/reftests/xul-document-load/reftest.list @@ -0,0 +1,9 @@ +== chrome://reftest/content/xul-document-load/test003.xhtml chrome://reftest/content/xul-document-load/reference-green-window.xhtml +== chrome://reftest/content/xul-document-load/test004.xhtml chrome://reftest/content/xul-document-load/reference-green-window.xhtml +== chrome://reftest/content/xul-document-load/test005.xhtml chrome://reftest/content/xul-document-load/reference-green-window.xhtml +== chrome://reftest/content/xul-document-load/test006.xhtml chrome://reftest/content/xul-document-load/reference-green-window.xhtml +== chrome://reftest/content/xul-document-load/test008.xhtml chrome://reftest/content/xul-document-load/reference-green-window.xhtml +== chrome://reftest/content/xul-document-load/test010.xhtml chrome://reftest/content/xul-document-load/reference-green-window.xhtml +== chrome://reftest/content/xul-document-load/test012.xhtml chrome://reftest/content/xul-document-load/reference-green-window.xhtml +== chrome://reftest/content/xul-document-load/test013.xhtml chrome://reftest/content/xul-document-load/reference-green-window.xhtml +== chrome://reftest/content/xul-document-load/test022.xhtml chrome://reftest/content/xul-document-load/reference-green-window.xhtml diff --git a/layout/reftests/xul-document-load/test003.css b/layout/reftests/xul-document-load/test003.css new file mode 100644 index 0000000000..3b18aff8b4 --- /dev/null +++ b/layout/reftests/xul-document-load/test003.css @@ -0,0 +1,6 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ */ + +window { + background-color: red !important; +} diff --git a/layout/reftests/xul-document-load/test003.xhtml b/layout/reftests/xul-document-load/test003.xhtml new file mode 100644 index 0000000000..fea3a05654 --- /dev/null +++ b/layout/reftests/xul-document-load/test003.xhtml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +Any copyright is dedicated to the Public Domain. +http://creativecommons.org/licenses/publicdomain/ +--> +<?xml-stylesheet href="test003.css" type="text/css"?> +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + style="background-color: green"> +<script type="text/javascript">document.removeChild(document.firstChild);</script> +</window>
\ No newline at end of file diff --git a/layout/reftests/xul-document-load/test004.css b/layout/reftests/xul-document-load/test004.css new file mode 100644 index 0000000000..3b18aff8b4 --- /dev/null +++ b/layout/reftests/xul-document-load/test004.css @@ -0,0 +1,6 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ */ + +window { + background-color: red !important; +} diff --git a/layout/reftests/xul-document-load/test004.xhtml b/layout/reftests/xul-document-load/test004.xhtml new file mode 100644 index 0000000000..ccb030ba1f --- /dev/null +++ b/layout/reftests/xul-document-load/test004.xhtml @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<!-- +Any copyright is dedicated to the Public Domain. +http://creativecommons.org/licenses/publicdomain/ +--> +<?xml-stylesheet href="test004.css" type="text/css"?> +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + style="background-color: green" onload="handleOnLoad();"> +<script type="text/javascript"> +function handleOnLoad() { + document.removeChild(document.firstChild); +} +</script> +</window>
\ No newline at end of file diff --git a/layout/reftests/xul-document-load/test005.css b/layout/reftests/xul-document-load/test005.css new file mode 100644 index 0000000000..3b18aff8b4 --- /dev/null +++ b/layout/reftests/xul-document-load/test005.css @@ -0,0 +1,6 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ */ + +window { + background-color: red !important; +} diff --git a/layout/reftests/xul-document-load/test005.js b/layout/reftests/xul-document-load/test005.js new file mode 100644 index 0000000000..726acd417b --- /dev/null +++ b/layout/reftests/xul-document-load/test005.js @@ -0,0 +1,4 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ */ + +document.firstChild.remove(); diff --git a/layout/reftests/xul-document-load/test005.xhtml b/layout/reftests/xul-document-load/test005.xhtml new file mode 100644 index 0000000000..76adc60867 --- /dev/null +++ b/layout/reftests/xul-document-load/test005.xhtml @@ -0,0 +1,10 @@ +<?xml version="1.0"?> +<!-- +Any copyright is dedicated to the Public Domain. +http://creativecommons.org/licenses/publicdomain/ +--> +<?xml-stylesheet href="test005.css" type="text/css"?> +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + style="background-color: green"> +<script src="test005.js"/> +</window>
\ No newline at end of file diff --git a/layout/reftests/xul-document-load/test006-007.js b/layout/reftests/xul-document-load/test006-007.js new file mode 100644 index 0000000000..96fd74fe4c --- /dev/null +++ b/layout/reftests/xul-document-load/test006-007.js @@ -0,0 +1,11 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ */ + +function checkDOM(target, data) { + // assuming whitespace and the XML declaration are not in the DOM. + var piNode = document.firstChild; + if (!piNode || piNode.nodeType != Node.PROCESSING_INSTRUCTION_NODE || + piNode.target != target || piNode.data != data) { + document.documentElement.style.backgroundColor = "red"; + } +} diff --git a/layout/reftests/xul-document-load/test006.css b/layout/reftests/xul-document-load/test006.css new file mode 100644 index 0000000000..9cf783629d --- /dev/null +++ b/layout/reftests/xul-document-load/test006.css @@ -0,0 +1,6 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ */ + +window { + background-color: green !important; +} diff --git a/layout/reftests/xul-document-load/test006.xhtml b/layout/reftests/xul-document-load/test006.xhtml new file mode 100644 index 0000000000..82137d20d3 --- /dev/null +++ b/layout/reftests/xul-document-load/test006.xhtml @@ -0,0 +1,12 @@ +<?xml version="1.0"?> +<!-- +Any copyright is dedicated to the Public Domain. +http://creativecommons.org/licenses/publicdomain/ +--> +<?xml-stylesheet href="test006.css" type="text/css"?> +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + id="main" + style="background-color: red" + onload="checkDOM('xml-stylesheet', 'href="test006.css" type="text/css"');"> + <script src="test006-007.js"/> +</window>
\ No newline at end of file diff --git a/layout/reftests/xul-document-load/test008.xhtml b/layout/reftests/xul-document-load/test008.xhtml new file mode 100644 index 0000000000..edb5810fb1 --- /dev/null +++ b/layout/reftests/xul-document-load/test008.xhtml @@ -0,0 +1,9 @@ +<?xml version="1.0"?> +<!-- +Any copyright is dedicated to the Public Domain. +http://creativecommons.org/licenses/publicdomain/ +--> +<?xml-stylesheet href="not-existing.css" type="text/css"?> +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + style="background-color: green"> +</window> diff --git a/layout/reftests/xul-document-load/test010.css b/layout/reftests/xul-document-load/test010.css new file mode 100644 index 0000000000..3b18aff8b4 --- /dev/null +++ b/layout/reftests/xul-document-load/test010.css @@ -0,0 +1,6 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ */ + +window { + background-color: red !important; +} diff --git a/layout/reftests/xul-document-load/test010.xhtml b/layout/reftests/xul-document-load/test010.xhtml new file mode 100644 index 0000000000..37359ab5aa --- /dev/null +++ b/layout/reftests/xul-document-load/test010.xhtml @@ -0,0 +1,28 @@ +<?xml version="1.0"?> +<!-- +Any copyright is dedicated to the Public Domain. +http://creativecommons.org/licenses/publicdomain/ +--> +<window id="main" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + style="background-color: green"> + <?xml-stylesheet href="test010.css" type="text/css"?> + <script> + function assert(x, msg) { + if(!x) { + dump("assertion failed! " + msg + "\n"); + document.getElementById("main").style.backgroundColor = "red"; + } + } + + try { + assert(document.firstChild.id == "main", "nothing in prolog"); + var winEl = document.documentElement; + assert(winEl.childNodes[0].nodeName == "xml-stylesheet", "xml-stylesheet PI is in the correct place"); + } catch(e) { + dump(e); + assert(false, e); + throw e; + } + </script> +</window>
\ No newline at end of file diff --git a/layout/reftests/xul-document-load/test012-1.css b/layout/reftests/xul-document-load/test012-1.css new file mode 100644 index 0000000000..ed5e68c189 --- /dev/null +++ b/layout/reftests/xul-document-load/test012-1.css @@ -0,0 +1,6 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ */ + +window { + background-color: red; +} diff --git a/layout/reftests/xul-document-load/test012-2.css b/layout/reftests/xul-document-load/test012-2.css new file mode 100644 index 0000000000..ff59288db0 --- /dev/null +++ b/layout/reftests/xul-document-load/test012-2.css @@ -0,0 +1,6 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ */ + +window { + background-color: green; +} diff --git a/layout/reftests/xul-document-load/test012.xhtml b/layout/reftests/xul-document-load/test012.xhtml new file mode 100644 index 0000000000..7f9c647916 --- /dev/null +++ b/layout/reftests/xul-document-load/test012.xhtml @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<!-- +Any copyright is dedicated to the Public Domain. +http://creativecommons.org/licenses/publicdomain/ +--> +<?xml-stylesheet href="test012-1.css" type="text/css"?> +<?xml-stylesheet href="test012-2.css" type="text/css"?> +<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/> diff --git a/layout/reftests/xul-document-load/test013-1-import.css b/layout/reftests/xul-document-load/test013-1-import.css new file mode 100644 index 0000000000..b7eafb32da --- /dev/null +++ b/layout/reftests/xul-document-load/test013-1-import.css @@ -0,0 +1,6 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ */ + +window { + background-color: yellow; +} diff --git a/layout/reftests/xul-document-load/test013-1.css b/layout/reftests/xul-document-load/test013-1.css new file mode 100644 index 0000000000..dae0aa589e --- /dev/null +++ b/layout/reftests/xul-document-load/test013-1.css @@ -0,0 +1,7 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ */ + +@import url(test013-1-import.css); +window { + background-color: red; +} diff --git a/layout/reftests/xul-document-load/test013-2.css b/layout/reftests/xul-document-load/test013-2.css new file mode 100644 index 0000000000..ff59288db0 --- /dev/null +++ b/layout/reftests/xul-document-load/test013-2.css @@ -0,0 +1,6 @@ +/* Any copyright is dedicated to the Public Domain. + * http://creativecommons.org/licenses/publicdomain/ */ + +window { + background-color: green; +} diff --git a/layout/reftests/xul-document-load/test013.xhtml b/layout/reftests/xul-document-load/test013.xhtml new file mode 100644 index 0000000000..d04a54fd32 --- /dev/null +++ b/layout/reftests/xul-document-load/test013.xhtml @@ -0,0 +1,8 @@ +<?xml version="1.0"?> +<!-- +Any copyright is dedicated to the Public Domain. +http://creativecommons.org/licenses/publicdomain/ +--> +<?xml-stylesheet href="test013-1.css" type="text/css"?> +<?xml-stylesheet href="test013-2.css" type="text/css"?> +<window id="main" xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"/> diff --git a/layout/reftests/xul-document-load/test022.xhtml b/layout/reftests/xul-document-load/test022.xhtml new file mode 100644 index 0000000000..75dbbdd78e --- /dev/null +++ b/layout/reftests/xul-document-load/test022.xhtml @@ -0,0 +1,17 @@ +<?xml version="1.0"?> +<!-- +Any copyright is dedicated to the Public Domain. +http://creativecommons.org/licenses/publicdomain/ +--> +<window title="Testcase for bug 369828 - html:style doesn't work in XUL documents" + xmlns:html="http://www.w3.org/1999/xhtml" + xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul" + style="background-color: red"> + +<html:style type="text/css"> + window { + background-color: green !important; + } +</html:style> + +</window> |