Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / setproperty-clears-important-shorthand-properties.html
blob6b2e18b0d38f5977958406853762fe8faec09606
1 <!DOCTYPE html>
2 <div id="element"></div>
4 <script src="../../resources/testharness.js"></script>
5 <script src="../../resources/testharnessreport.js"></script>
6 <script>
7 test(function () {
8 element.style.cssText = 'background-color: red !important;';
9 element.style.background = '';
10 assert_equals(element.style.cssText, '');
12 element.style.cssText = 'background-color: red !important;';
13 element.style.backgroundColor = '';
14 assert_equals(element.style.cssText, '');
16 element.style.cssText = 'background: red !important;';
17 element.style.background = '';
18 assert_equals(element.style.cssText, '');
20 element.style.cssText = 'background: red !important;';
21 element.style.backgroundColor = '';
22 assert_equals(getComputedStyle(element).backgroundColor, 'rgba(0, 0, 0, 0)');
23 }, "setProperty() clears !important shorthand properties for background-color");
25 test(function () {
26 element.style.cssText = 'border-color: red !important;';
27 element.style.border = '';
28 assert_equals(element.style.cssText, '');
30 element.style.cssText = 'border-color: red !important;';
31 element.style.borderColor = '';
32 assert_equals(element.style.cssText, '');
34 element.style.cssText = 'border: 2px solid red !important;';
35 element.style.border = '';
36 assert_equals(element.style.cssText, '');
38 element.style.cssText = 'border: 2px solid red !important;';
39 element.style.borderColor = '';
40 assert_equals(getComputedStyle(element).borderColor, 'rgb(0, 0, 0)');
41 }, "setProperty() clears !important shorthand properties for border-color");
42 </script>