michael@0: /* vim: set ft=javascript ts=2 et sw=2 tw=80: */ michael@0: /* Any copyright is dedicated to the Public Domain. michael@0: http://creativecommons.org/publicdomain/zero/1.0/ */ michael@0: michael@0: "use strict"; michael@0: michael@0: // Tests that the rule-view displays correctly on MathML elements michael@0: michael@0: const TEST_URL = [ michael@0: "data:text/html,", michael@0: "
", michael@0: " ", michael@0: " ", michael@0: " ", michael@0: " a", michael@0: " i", michael@0: " j", michael@0: " ", michael@0: " ", michael@0: " x", michael@0: " 0", michael@0: " ", michael@0: " ", michael@0: " ", michael@0: "
" michael@0: ].join(""); michael@0: michael@0: let test = asyncTest(function*() { michael@0: yield addTab(TEST_URL); michael@0: let {toolbox, inspector, view} = yield openRuleView(); michael@0: michael@0: info("Select the DIV node and verify the rule-view shows rules"); michael@0: yield selectNode("div", inspector); michael@0: ok(view.element.querySelectorAll(".ruleview-rule").length, michael@0: "The rule-view shows rules for the div element"); michael@0: michael@0: info("Select various MathML nodes and verify the rule-view is empty"); michael@0: yield selectNode("math", inspector); michael@0: ok(!view.element.querySelectorAll(".ruleview-rule").length, michael@0: "The rule-view is empty for the math element"); michael@0: michael@0: yield selectNode("msubsup", inspector); michael@0: ok(!view.element.querySelectorAll(".ruleview-rule").length, michael@0: "The rule-view is empty for the msubsup element"); michael@0: michael@0: yield selectNode("mn", inspector); michael@0: ok(!view.element.querySelectorAll(".ruleview-rule").length, michael@0: "The rule-view is empty for the mn element"); michael@0: michael@0: info("Select again the DIV node and verify the rule-view shows rules"); michael@0: yield selectNode("div", inspector); michael@0: ok(view.element.querySelectorAll(".ruleview-rule").length, michael@0: "The rule-view shows rules for the div element"); michael@0: });