Changeset 203437 in webkit
- Timestamp:
- Jul 19, 2016, 6:20:23 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 5 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/fast/css/CSSStyleDeclaration-setProperty-expected.txt (added)
-
LayoutTests/fast/css/CSSStyleDeclaration-setProperty.html (added)
-
LayoutTests/fast/css/shorthand-priority.html (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/CSSStyleDeclaration.idl (modified) (1 diff)
-
Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r203434 r203437 1 2016-07-19 Chris Dumez <cdumez@apple.com> 2 3 Align CSSStyleDeclaration.setProperty() with the specification 4 https://bugs.webkit.org/show_bug.cgi?id=159955 5 6 Reviewed by Benjamin Poulain. 7 8 Add layout test coverage. 9 10 * fast/css/CSSStyleDeclaration-setProperty-expected.txt: Added. 11 * fast/css/CSSStyleDeclaration-setProperty.html: Added. 12 * fast/css/shorthand-priority.html: 13 1 14 2016-07-19 Daniel Bates <dabates@apple.com> 2 15 -
trunk/LayoutTests/fast/css/shorthand-priority.html
r155263 r203437 18 18 19 19 // Sanity check. 20 e.style.setProperty("border-bottom-style", "solid", " !important");20 e.style.setProperty("border-bottom-style", "solid", "important"); 21 21 shouldBe("e.style.getPropertyValue('border-bottom-style')", "'solid'"); 22 22 shouldBe("e.style.getPropertyPriority('border-bottom-style')", "'important'"); … … 28 28 29 29 e.style.border = ""; 30 e.style.setProperty("border", "20px solid green", " !important");30 e.style.setProperty("border", "20px solid green", "important"); 31 31 shouldBe("e.style.getPropertyValue('border')", "'20px solid green'"); 32 32 shouldBe("e.style.getPropertyPriority('border')", "'important'"); -
trunk/Source/WebCore/ChangeLog
r203434 r203437 1 2016-07-19 Chris Dumez <cdumez@apple.com> 2 3 Align CSSStyleDeclaration.setProperty() with the specification 4 https://bugs.webkit.org/show_bug.cgi?id=159955 5 6 Reviewed by Benjamin Poulain. 7 8 Align CSSStyleDeclaration.setProperty() with the specification: 9 - https://drafts.csswg.org/cssom/#the-cssstyledeclaration-interface 10 11 In particular, the following changes were needed: 12 1. The 'value' parameter should not be optional 13 2. The 'priority' parameter should treat null as the empty string 14 rather than the string "null". 15 3. The 'priority' parameter's default value should be the empty string, 16 not the string "undefined". 17 4. CSSStyleDeclaration.setProperty() should return early if 'priority' 18 is not the empty string and is not an ASCII case-insensitive match 19 for the string "important". 20 21 Chrome matches the specification entirely. 22 Firefox matches the specification with the exception that it does a 23 case-sensitive match for "important". 24 25 Test: fast/css/CSSStyleDeclaration-setProperty.html 26 27 * css/CSSStyleDeclaration.idl: 28 * css/PropertySetCSSStyleDeclaration.cpp: 29 (WebCore::PropertySetCSSStyleDeclaration::setProperty): 30 1 31 2016-07-19 Daniel Bates <dabates@apple.com> 2 32 -
trunk/Source/WebCore/css/CSSStyleDeclaration.idl
r199969 r203437 39 39 DOMString? getPropertyPriority(optional DOMString propertyName = "undefined"); 40 40 41 // FIXME: 'priority' should use [TreatNullAs=EmptyString]. 42 // FIXME: Using "undefined" as default parameter value is wrong. 43 [ObjCLegacyUnnamedParameters, RaisesException] void setProperty(optional DOMString propertyName = "undefined", 44 [TreatNullAs=EmptyString] optional DOMString value = "undefined", 45 optional DOMString priority = "undefined"); 41 [ObjCLegacyUnnamedParameters, RaisesException] void setProperty(DOMString propertyName, [TreatNullAs=EmptyString] DOMString value, [TreatNullAs=EmptyString] optional DOMString priority = ""); 46 42 47 43 readonly attribute unsigned long length; -
trunk/Source/WebCore/css/PropertySetCSSStyleDeclaration.cpp
r203380 r203437 227 227 return; 228 228 229 bool important = priority.find("important", 0, false) != notFound; 229 bool important = equalIgnoringASCIICase(priority, "important"); 230 if (!important && !priority.isEmpty()) 231 return; 230 232 231 233 ec = 0;
Note:
See TracChangeset
for help on using the changeset viewer.