Title: [231995] trunk
- Revision
- 231995
- Author
- [email protected]
- Date
- 2018-05-18 21:05:06 -0700 (Fri, 18 May 2018)
Log Message
Cannot unset transition with important
https://bugs.webkit.org/show_bug.cgi?id=177684
Patch by Rob Buis <[email protected]> on 2018-05-18
Reviewed by Chris Dumez.
LayoutTests/imported/w3c:
Import manually the updated test and result.
* web-platform-tests/cssom/cssom-setProperty-shorthand-expected.txt:
* web-platform-tests/cssom/cssom-setProperty-shorthand.html:
Source/WebCore:
Make removeProperty remove the property regardless
if it was set using !important [1].
The new behavior is consistent with Firefox, Chrome and Edge.
[1] https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-removeproperty
Test: web-platform-tests/cssom/cssom-setProperty-shorthand.html
* css/StyleProperties.cpp:
(WebCore::MutableStyleProperties::removePropertiesInSet):
Modified Paths
Diff
Modified: trunk/LayoutTests/imported/w3c/ChangeLog (231994 => 231995)
--- trunk/LayoutTests/imported/w3c/ChangeLog 2018-05-19 01:08:14 UTC (rev 231994)
+++ trunk/LayoutTests/imported/w3c/ChangeLog 2018-05-19 04:05:06 UTC (rev 231995)
@@ -1,3 +1,15 @@
+2018-05-18 Rob Buis <[email protected]>
+
+ Cannot unset transition with important
+ https://bugs.webkit.org/show_bug.cgi?id=177684
+
+ Reviewed by Chris Dumez.
+
+ Import manually the updated test and result.
+
+ * web-platform-tests/cssom/cssom-setProperty-shorthand-expected.txt:
+ * web-platform-tests/cssom/cssom-setProperty-shorthand.html:
+
2018-05-18 Antoine Quint <[email protected]>
[Web Animations] Turn Web Animations with CSS integration on for test runners
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/cssom-setProperty-shorthand-expected.txt (231994 => 231995)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/cssom-setProperty-shorthand-expected.txt 2018-05-19 01:08:14 UTC (rev 231994)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/cssom-setProperty-shorthand-expected.txt 2018-05-19 04:05:06 UTC (rev 231995)
@@ -1,40 +1,78 @@
PASS shorthand font can be set with setProperty
PASS shorthand font can be removed with removeProperty
+PASS shorthand font can be set with setProperty and priority !important
+PASS shorthand font can be removed with removeProperty even when set with !important
PASS shorthand border-top can be set with setProperty
PASS shorthand border-top can be removed with removeProperty
+PASS shorthand border-top can be set with setProperty and priority !important
+PASS shorthand border-top can be removed with removeProperty even when set with !important
PASS shorthand border-right can be set with setProperty
PASS shorthand border-right can be removed with removeProperty
+PASS shorthand border-right can be set with setProperty and priority !important
+PASS shorthand border-right can be removed with removeProperty even when set with !important
PASS shorthand border-bottom can be set with setProperty
PASS shorthand border-bottom can be removed with removeProperty
+PASS shorthand border-bottom can be set with setProperty and priority !important
+PASS shorthand border-bottom can be removed with removeProperty even when set with !important
PASS shorthand border-left can be set with setProperty
PASS shorthand border-left can be removed with removeProperty
+PASS shorthand border-left can be set with setProperty and priority !important
+PASS shorthand border-left can be removed with removeProperty even when set with !important
PASS shorthand border can be set with setProperty
PASS shorthand border can be removed with removeProperty
+PASS shorthand border can be set with setProperty and priority !important
+PASS shorthand border can be removed with removeProperty even when set with !important
PASS shorthand border-color can be set with setProperty
PASS shorthand border-color can be removed with removeProperty
+PASS shorthand border-color can be set with setProperty and priority !important
+PASS shorthand border-color can be removed with removeProperty even when set with !important
PASS shorthand border-style can be set with setProperty
PASS shorthand border-style can be removed with removeProperty
+PASS shorthand border-style can be set with setProperty and priority !important
+PASS shorthand border-style can be removed with removeProperty even when set with !important
PASS shorthand border-width can be set with setProperty
PASS shorthand border-width can be removed with removeProperty
+PASS shorthand border-width can be set with setProperty and priority !important
+PASS shorthand border-width can be removed with removeProperty even when set with !important
PASS shorthand background-position can be set with setProperty
PASS shorthand background-position can be removed with removeProperty
+PASS shorthand background-position can be set with setProperty and priority !important
+PASS shorthand background-position can be removed with removeProperty even when set with !important
PASS shorthand background-repeat can be set with setProperty
PASS shorthand background-repeat can be removed with removeProperty
+PASS shorthand background-repeat can be set with setProperty and priority !important
+PASS shorthand background-repeat can be removed with removeProperty even when set with !important
PASS shorthand border-spacing can be set with setProperty
PASS shorthand border-spacing can be removed with removeProperty
+PASS shorthand border-spacing can be set with setProperty and priority !important
+PASS shorthand border-spacing can be removed with removeProperty even when set with !important
PASS shorthand list-style can be set with setProperty
PASS shorthand list-style can be removed with removeProperty
+PASS shorthand list-style can be set with setProperty and priority !important
+PASS shorthand list-style can be removed with removeProperty even when set with !important
PASS shorthand margin can be set with setProperty
PASS shorthand margin can be removed with removeProperty
+PASS shorthand margin can be set with setProperty and priority !important
+PASS shorthand margin can be removed with removeProperty even when set with !important
PASS shorthand outline can be set with setProperty
PASS shorthand outline can be removed with removeProperty
+PASS shorthand outline can be set with setProperty and priority !important
+PASS shorthand outline can be removed with removeProperty even when set with !important
PASS shorthand padding can be set with setProperty
PASS shorthand padding can be removed with removeProperty
+PASS shorthand padding can be set with setProperty and priority !important
+PASS shorthand padding can be removed with removeProperty even when set with !important
PASS shorthand background can be set with setProperty
PASS shorthand background can be removed with removeProperty
+PASS shorthand background can be set with setProperty and priority !important
+PASS shorthand background can be removed with removeProperty even when set with !important
PASS shorthand overflow can be set with setProperty
PASS shorthand overflow can be removed with removeProperty
+PASS shorthand overflow can be set with setProperty and priority !important
+PASS shorthand overflow can be removed with removeProperty even when set with !important
PASS shorthand border-radius can be set with setProperty
PASS shorthand border-radius can be removed with removeProperty
+PASS shorthand border-radius can be set with setProperty and priority !important
+PASS shorthand border-radius can be removed with removeProperty even when set with !important
Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/cssom-setProperty-shorthand.html (231994 => 231995)
--- trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/cssom-setProperty-shorthand.html 2018-05-19 01:08:14 UTC (rev 231994)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/cssom/cssom-setProperty-shorthand.html 2018-05-19 04:05:06 UTC (rev 231995)
@@ -42,8 +42,8 @@
element = document.createElement('span');
- function canSetProperty(propertyName) {
- element.style.setProperty(propertyName, 'initial');
+ function canSetProperty(propertyName, priority) {
+ element.style.setProperty(propertyName, 'initial', priority);
return element.style.getPropertyValue(propertyName) == 'initial';
}
@@ -56,7 +56,7 @@
var propertyName = shorthandProperties[i];
test(function(){
- assert_true(canSetProperty(propertyName), 'can setPropertyValue with shorthand');
+ assert_true(canSetProperty(propertyName, ''), 'can setPropertyValue with shorthand');
}, 'shorthand ' + propertyName + ' can be set with setProperty');
test(function(){
@@ -63,6 +63,14 @@
assert_true(canRemoveProperty(propertyName), 'can setPropertyValue with shorthand');
}, 'shorthand ' + propertyName + ' can be removed with removeProperty');
+ test(function(){
+ assert_true(canSetProperty(propertyName, 'important'), 'can setPropertyValue with shorthand');
+ }, 'shorthand ' + propertyName + ' can be set with setProperty and priority !important');
+
+ test(function(){
+ assert_true(canRemoveProperty(propertyName), 'can setPropertyValue with shorthand');
+ }, 'shorthand ' + propertyName + ' can be removed with removeProperty even when set with !important');
+
}
</script>
</body>
Modified: trunk/Source/WebCore/ChangeLog (231994 => 231995)
--- trunk/Source/WebCore/ChangeLog 2018-05-19 01:08:14 UTC (rev 231994)
+++ trunk/Source/WebCore/ChangeLog 2018-05-19 04:05:06 UTC (rev 231995)
@@ -1,3 +1,22 @@
+2018-05-18 Rob Buis <[email protected]>
+
+ Cannot unset transition with important
+ https://bugs.webkit.org/show_bug.cgi?id=177684
+
+ Reviewed by Chris Dumez.
+
+ Make removeProperty remove the property regardless
+ if it was set using !important [1].
+
+ The new behavior is consistent with Firefox, Chrome and Edge.
+
+ [1] https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-removeproperty
+
+ Test: web-platform-tests/cssom/cssom-setProperty-shorthand.html
+
+ * css/StyleProperties.cpp:
+ (WebCore::MutableStyleProperties::removePropertiesInSet):
+
2018-05-18 Commit Queue <[email protected]>
Unreviewed, rolling out r231982.
Modified: trunk/Source/WebCore/css/StyleProperties.cpp (231994 => 231995)
--- trunk/Source/WebCore/css/StyleProperties.cpp 2018-05-19 01:08:14 UTC (rev 231994)
+++ trunk/Source/WebCore/css/StyleProperties.cpp 2018-05-19 04:05:06 UTC (rev 231995)
@@ -1227,8 +1227,7 @@
toRemove.add(set[i]);
return m_propertyVector.removeAllMatching([&toRemove] (const CSSProperty& property) {
- // Not quite sure if the isImportant test is needed but it matches the existing behavior.
- return !property.isImportant() && toRemove.contains(property.id());
+ return toRemove.contains(property.id());
}) > 0;
}
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes