Bug 971628 - Avoid exceptions when entering invalid property names in the rule-view; r=miker

This commit is contained in:
Patrick Brosset 2014-05-05 14:46:11 +02:00
parent 36b521c0b6
commit 525e1e83dd
2 changed files with 2 additions and 15 deletions

View File

@ -94,15 +94,6 @@ function test() {
is(fragment.textContent, "#F06");
}
},
{
name: "border-top-left-color",
value: "rgba(14, 255, 20, .5)",
test: fragment => {
is(countAll(fragment), 1);
is(countColors(fragment), 1);
is(fragment.textContent, "rgba(14, 255, 20, .5)");
}
},
{
name: "border",
value: "80em dotted pink",

View File

@ -294,16 +294,12 @@ OutputParser.prototype = {
let win = Services.appShell.hiddenDOMWindow;
let doc = win.document;
name = name.replace(/-\w{1}/g, function(match) {
return match.charAt(1).toUpperCase();
});
value = value.replace("!important", "");
let div = doc.createElement("div");
div.style[name] = value;
div.style.setProperty(name, value);
return !!div.style[name];
return !!div.style.getPropertyValue(name);
},
/**