browser/devtools/styleinspector/test/browser_styleinspector_csslogic-inherited-properties.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

michael@0 1 /* vim: set ft=javascript ts=2 et sw=2 tw=80: */
michael@0 2 /* Any copyright is dedicated to the Public Domain.
michael@0 3 http://creativecommons.org/publicdomain/zero/1.0/ */
michael@0 4
michael@0 5 "use strict";
michael@0 6
michael@0 7 // Test that inherited properties are treated correctly.
michael@0 8
michael@0 9 let test = asyncTest(function*() {
michael@0 10 yield addTab("data:text/html,selector text test, bug 692400");
michael@0 11
michael@0 12 content.document.body.innerHTML = '<div style="margin-left:10px; font-size: 5px"><div id="innerdiv">Inner div</div></div>';
michael@0 13 content.document.title = "Style Inspector Inheritance Test";
michael@0 14
michael@0 15 let cssLogic = new CssLogic();
michael@0 16 cssLogic.highlight(content.document.getElementById("innerdiv"));
michael@0 17
michael@0 18 let marginProp = cssLogic.getPropertyInfo("margin-left");
michael@0 19 is(marginProp.matchedRuleCount, 0, "margin-left should not be included in matched selectors.");
michael@0 20
michael@0 21 let fontSizeProp = cssLogic.getPropertyInfo("font-size");
michael@0 22 is(fontSizeProp.matchedRuleCount, 1, "font-size should be included in matched selectors.");
michael@0 23 });

mercurial