summaryrefslogtreecommitdiffstats
path: root/devtools/client/inspector/markup/test/browser_markup_void_elements_html.js
diff options
context:
space:
mode:
authorMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
committerMatt A. Tobin <mattatobin@localhost.localdomain>2018-02-02 04:16:08 -0500
commit5f8de423f190bbb79a62f804151bc24824fa32d8 (patch)
tree10027f336435511475e392454359edea8e25895d /devtools/client/inspector/markup/test/browser_markup_void_elements_html.js
parent49ee0794b5d912db1f95dce6eb52d781dc210db5 (diff)
downloadUXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.gz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.lz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.tar.xz
UXP-5f8de423f190bbb79a62f804151bc24824fa32d8.zip
Add m-esr52 at 52.6.0
Diffstat (limited to 'devtools/client/inspector/markup/test/browser_markup_void_elements_html.js')
-rw-r--r--devtools/client/inspector/markup/test/browser_markup_void_elements_html.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/devtools/client/inspector/markup/test/browser_markup_void_elements_html.js b/devtools/client/inspector/markup/test/browser_markup_void_elements_html.js
new file mode 100644
index 000000000..60330a144
--- /dev/null
+++ b/devtools/client/inspector/markup/test/browser_markup_void_elements_html.js
@@ -0,0 +1,44 @@
+/* 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.html";
+
+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 hidden in HTML document");
+ let container = yield getContainerForSelector("img", inspector);
+ ok(container.editor.elt.classList.contains("void-element"),
+ "img element has the expected class");
+ let closeElement = container.editor.elt.querySelector(".close");
+ let computedStyle = win.getComputedStyle(closeElement, null);
+ ok(computedStyle.display === "none", "img closing tag is hidden");
+
+ info("check void element with pseudo element");
+ let hrNodeFront = yield getNodeFront("hr.before", inspector);
+ container = getContainerForNodeFront(hrNodeFront, inspector);
+ ok(container.editor.elt.classList.contains("void-element"),
+ "hr element has the expected class");
+ closeElement = container.editor.elt.querySelector(".close");
+ computedStyle = win.getComputedStyle(closeElement, null);
+ ok(computedStyle.display === "none", "hr closing tag is hidden");
+
+ info("check expanded void element closing tag is not hidden");
+ yield inspector.markup.expandNode(hrNodeFront);
+ yield waitForMultipleChildrenUpdates(inspector);
+ ok(container.expanded, "hr container is expanded");
+ computedStyle = win.getComputedStyle(closeElement, null);
+ ok(computedStyle.display === "none", "hr closing tag is not hidden anymore");
+});