Changeset 203460 in webkit
- Timestamp:
- Jul 20, 2016 11:01:26 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r203459 r203460 1 2016-07-20 Chris Dumez <cdumez@apple.com> 2 3 CSSStyleDeclaration.setProperty() should be able to unset "important" on a property 4 https://bugs.webkit.org/show_bug.cgi?id=159959 5 6 Reviewed by Alexey Proskuryakov. 7 8 * fast/css/CSSStyleDeclaration-setProperty-unset-important-expected.txt: Added. 9 * fast/css/CSSStyleDeclaration-setProperty-unset-important.html: Added. 10 Add layout test coverage. 11 12 * fast/css/important-js-override.html: 13 The test covered our 'wrong' behavior and was failing in Firefox / Chrome. 14 I updated the test to match the behavior in the specification. The test 15 now passed in Chrome and Firefox. 16 1 17 2016-07-20 Commit Queue <commit-queue@webkit.org> 2 18 -
trunk/LayoutTests/fast/css/important-js-override.html
r120683 r203460 1 <div id="a" style="background-color: green!important">The background of this element should be green. It is </div>1 <div id="a" style="background-color: red !important">The background of this element should be green. It is </div> 2 2 <script> 3 3 if (window.testRunner) 4 4 testRunner.dumpAsText(); 5 5 var a = document.getElementById("a"); 6 a.style.backgroundColor = " red";6 a.style.backgroundColor = "green"; 7 7 a.innerHTML += a.style.backgroundColor; 8 8 </script> -
trunk/Source/WebCore/ChangeLog
r203459 r203460 1 2016-07-20 Chris Dumez <cdumez@apple.com> 2 3 CSSStyleDeclaration.setProperty() should be able to unset "important" on a property 4 https://bugs.webkit.org/show_bug.cgi?id=159959 5 6 Reviewed by Alexey Proskuryakov. 7 8 CSSStyleDeclaration.setProperty() should be able to unsert "important" 9 on a property as per the latest specification: 10 - https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-setproperty 11 - https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-camel-cased-attribute 12 13 Firefox and Chrome match the specification here but WebKit was ignoring calls 14 to setProperty() if there is already an "important" property wit this name 15 and if the new property does not have the "important" flag set. 16 17 This behavior was added a long time ago via Bug 60007. However, it does not 18 match the latest specification or other browsers. 19 20 Test: fast/css/CSSStyleDeclaration-setProperty-unset-important.html 21 22 * css/StyleProperties.cpp: 23 (WebCore::MutableStyleProperties::addParsedProperty): 24 Drop code that was added via Bug 60007 as this behavior no longer matches the 25 specification or other browsers. The layout test added in Bug 60007 fails in 26 other browsers and was updated in this patch to match the specification. 27 1 28 2016-07-20 Commit Queue <commit-queue@webkit.org> 2 29 -
trunk/Source/WebCore/css/StyleProperties.cpp
r203380 r203460 884 884 return false; 885 885 } 886 887 // Only add properties that have no !important counterpart present 888 if (!propertyIsImportant(property.id()) || property.isImportant()) 889 return setProperty(property); 890 891 return false; 886 return setProperty(property); 892 887 } 893 888
Note: See TracChangeset
for help on using the changeset viewer.