summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/markup/test/browser_markup_void_elements_xhtml.js
diff options
context:
space:
mode:
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.js28
1 files changed, 28 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 000000000..0cccf54d4
--- /dev/null
+++ b/devtools/client/inspector/markup/test/browser_markup_void_elements_xhtml.js
@@ -0,0 +1,28 @@
+/* vim: set ts=2 et sw=2 tw=80: */
+/* 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(function* () {
+ let {inspector} = yield openInspectorForURL(TEST_URL);
+ let {win} = inspector.markup;
+
+ info("check non-void element closing tag is displayed");
+ let {editor} = yield getContainerForSelector("h1", inspector);
+ ok(!editor.elt.classList.contains("void-element"),
+ "h1 element does not have void-element class");
+ ok(!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");
+ let container = yield getContainerForSelector("br", inspector);
+ ok(!container.editor.elt.classList.contains("void-element"),
+ "br element does not have void-element class");
+ let closeElement = container.editor.elt.querySelector(".close");
+ let computedStyle = win.getComputedStyle(closeElement, null);
+ ok(computedStyle.display !== "none", "br closing tag is not hidden");
+});