Move parseFontFaceDescriptor to CSSPropertyParser.cpp
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / important-js-override.html
blobfde9393da113a80be4a0a1c53c2e31d3ff7f2ed0
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 = '';
10 element.style.setProperty('color', 'red');
11 assert_equals(element.style.getPropertyValue('color'), 'red');
12 assert_equals(element.style.getPropertyPriority('color'), '');
14 element.style.setProperty('color', 'green');
15 assert_equals(element.style.getPropertyValue('color'), 'green');
16 assert_equals(element.style.getPropertyPriority('color'), '');
17 }, "Check that a non-important inline style can be replaced by a non-important one with setProperty()");
19 test(function () {
20 element.style.cssText = '';
22 element.style.color = 'red';
23 assert_equals(element.style.getPropertyValue('color'), 'red');
24 assert_equals(element.style.getPropertyPriority('color'), '');
26 element.style.color = 'green';
27 assert_equals(element.style.getPropertyValue('color'), 'green');
28 assert_equals(element.style.getPropertyPriority('color'), '');
29 }, "Check that a non-important inline style can be replaced by a non-important one without setProperty()");
31 test(function () {
32 element.style.cssText = '';
34 element.style.setProperty('color', 'red');
35 assert_equals(element.style.getPropertyValue('color'), 'red');
36 assert_equals(element.style.getPropertyPriority('color'), '');
38 element.style.setProperty('color', 'green', 'important');
39 assert_equals(element.style.getPropertyValue('color'), 'green');
40 assert_equals(element.style.getPropertyPriority('color'), 'important');
41 }, "Check that a non-important inline style can be replaced by an important one with setProperty()");
43 test(function () {
44 element.style.cssText = '';
46 element.style.setProperty('color', 'red', 'important');
47 assert_equals(element.style.getPropertyValue('color'), 'red');
48 assert_equals(element.style.getPropertyPriority('color'), 'important');
50 element.style.setProperty('color', 'green');
51 assert_equals(element.style.getPropertyValue('color'), 'green');
52 assert_equals(element.style.getPropertyPriority('color'), '');
53 }, "Check that a important inline style can be replaced by a non-important one with setProperty()");
55 test(function () {
56 element.style.cssText = '';
58 element.style.setProperty('color', 'red', 'important');
59 assert_equals(element.style.getPropertyValue('color'), 'red');
60 assert_equals(element.style.getPropertyPriority('color'), 'important');
62 element.style.color = 'green';
63 assert_equals(element.style.getPropertyValue('color'), 'green');
64 assert_equals(element.style.getPropertyPriority('color'), '');
65 }, "Check that a important inline style can be replaced by a non-important one without setProperty()");
67 test(function () {
68 element.style.cssText = '';
70 element.style.setProperty('color', 'red', 'important');
71 assert_equals(element.style.getPropertyValue('color'), 'red');
72 assert_equals(element.style.getPropertyPriority('color'), 'important');
74 element.style.setProperty('color', 'green', 'important');
75 assert_equals(element.style.getPropertyValue('color'), 'green');
76 assert_equals(element.style.getPropertyPriority('color'), 'important');
77 }, "Check that an important inline style can be replaced by an important one with setProperty()");
78 </script>