summaryrefslogtreecommitdiff
path: root/toolkit/devtools/markupview/test/browser_markupview_node_not_displayed_01.js
diff options
context:
space:
mode:
authorMatt A. Tobin <email@mattatobin.com>2016-10-16 19:34:53 -0400
committerMatt A. Tobin <email@mattatobin.com>2016-10-16 19:34:53 -0400
commit81805ce3f63e2e4a799bd54f174083c58a9b5640 (patch)
tree6e13374b213ac9b2ae74c25d8aac875faf71fdd0 /toolkit/devtools/markupview/test/browser_markupview_node_not_displayed_01.js
parent28c8da71bf521bb3ee76f27b8a241919e24b7cd5 (diff)
downloadpalemoon-gre-81805ce3f63e2e4a799bd54f174083c58a9b5640.tar.gz
Move Mozilla DevTools to Platform - Part 3: Merge the browser/devtools and toolkit/devtools adjusting for directory collisions
Diffstat (limited to 'toolkit/devtools/markupview/test/browser_markupview_node_not_displayed_01.js')
-rw-r--r--toolkit/devtools/markupview/test/browser_markupview_node_not_displayed_01.js34
1 files changed, 34 insertions, 0 deletions
diff --git a/toolkit/devtools/markupview/test/browser_markupview_node_not_displayed_01.js b/toolkit/devtools/markupview/test/browser_markupview_node_not_displayed_01.js
new file mode 100644
index 000000000..0a0f86755
--- /dev/null
+++ b/toolkit/devtools/markupview/test/browser_markupview_node_not_displayed_01.js
@@ -0,0 +1,34 @@
+/* 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";
+
+// Tests that nodes that are not displayed appear differently in the markup-view
+// when these nodes are imported in the view.
+
+// Note that nodes inside a display:none parent are obviously not displayed too
+// but the markup-view uses css inheritance to mark those as hidden instead of
+// having to visit each and every child of a hidden node. So there's no sense
+// testing children nodes.
+
+const TEST_URL = TEST_URL_ROOT + "doc_markup_not_displayed.html";
+const TEST_DATA = [
+ {selector: "#normal-div", isDisplayed: true},
+ {selector: "head", isDisplayed: false},
+ {selector: "#display-none", isDisplayed: false},
+ {selector: "#hidden-true", isDisplayed: false},
+ {selector: "#visibility-hidden", isDisplayed: true}
+];
+
+add_task(function*() {
+ let {inspector} = yield addTab(TEST_URL).then(openInspector);
+
+ for (let {selector, isDisplayed} of TEST_DATA) {
+ info("Getting node " + selector);
+ let nodeFront = yield getNodeFront(selector, inspector);
+ let container = getContainerForNodeFront(nodeFront, inspector);
+ is(!container.elt.classList.contains("not-displayed"), isDisplayed,
+ "The container for " + selector + " is marked as displayed " + isDisplayed);
+ }
+});