QUnit test for overriding important css declarations, references #4427
This commit is contained in:
parent
31b3c44db3
commit
1299e89dcd
|
@ -109,3 +109,7 @@ div#show-tests * { display: none; }
|
||||||
#nothiddendiv { font-size: 16px; }
|
#nothiddendiv { font-size: 16px; }
|
||||||
#nothiddendivchild.em { font-size: 2em; }
|
#nothiddendivchild.em { font-size: 2em; }
|
||||||
#nothiddendivchild.prct { font-size: 150%; }
|
#nothiddendivchild.prct { font-size: 150%; }
|
||||||
|
|
||||||
|
div.isimportant {
|
||||||
|
background-color: rgb(255, 255, 255) !important;
|
||||||
|
}
|
||||||
|
|
|
@ -377,3 +377,18 @@ test("marginRight computed style (bug #3333)", function() {
|
||||||
|
|
||||||
equals($div.css("marginRight"), "0px", "marginRight correctly calculated with a width and display block");
|
equals($div.css("marginRight"), "0px", "marginRight correctly calculated with a width and display block");
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("$().css override !important css declarations (bug #4427)", function(){
|
||||||
|
expect(4);
|
||||||
|
var div = jQuery("<div/>", {
|
||||||
|
"class": "isimportant" // background-color: #fff !important
|
||||||
|
});
|
||||||
|
div.css("backgroundColor", "rgb(0, 255, 0)");
|
||||||
|
equals( div.css("backgroundColor"), "rgb(0, 255, 0)", "Background color is overrided to rgb(0, 255, 0)" );
|
||||||
|
equals( div.css("background-color"), "rgb(0, 255, 0)", "Background color is overrided to rgb(0, 255, 0)" );
|
||||||
|
|
||||||
|
div.css("background-color", "rgb(0, 255, 0)");
|
||||||
|
equals( div.css("backgroundColor"), "rgb(0, 255, 0)", "Background color is overrided to rgb(0, 255, 0)" );
|
||||||
|
equals( div.css("background-color"), "rgb(0, 255, 0)", "Background color is overrided to rgb(0, 255, 0)" );
|
||||||
|
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in a new issue