diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /devtools/client/inspector/markup/test/browser_markup_void_elements_xhtml.js | |
parent | Initial commit. (diff) | |
download | firefox-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 'devtools/client/inspector/markup/test/browser_markup_void_elements_xhtml.js')
-rw-r--r-- | devtools/client/inspector/markup/test/browser_markup_void_elements_xhtml.js | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/devtools/client/inspector/markup/test/browser_markup_void_elements_xhtml.js b/devtools/client/inspector/markup/test/browser_markup_void_elements_xhtml.js new file mode 100644 index 0000000000..9725068b92 --- /dev/null +++ b/devtools/client/inspector/markup/test/browser_markup_void_elements_xhtml.js @@ -0,0 +1,38 @@ +/* Any copyright is dedicated to the Public Domain. + http://creativecommons.org/publicdomain/zero/1.0/ */ + +"use strict"; + +// Test void element display in the markupview. +const TEST_URL = URL_ROOT + "doc_markup_void_elements.xhtml"; + +add_task(async function () { + const { inspector } = await openInspectorForURL(TEST_URL); + const { win } = inspector.markup; + + info("check non-void element closing tag is displayed"); + const { editor } = await getContainerForSelector("h1", inspector); + ok( + !editor.elt.classList.contains("void-element"), + "h1 element does not have void-element class" + ); + Assert.notStrictEqual( + !editor.elt.querySelector(".close").style.display, + "none", + "h1 element tag is not hidden" + ); + + info("check void element closing tag is not hidden in XHTML document"); + const container = await getContainerForSelector("br", inspector); + ok( + !container.editor.elt.classList.contains("void-element"), + "br element does not have void-element class" + ); + const closeElement = container.editor.elt.querySelector(".close"); + const computedStyle = win.getComputedStyle(closeElement); + Assert.notStrictEqual( + computedStyle.display, + "none", + "br closing tag is not hidden" + ); +}); |