Title: [285840] branches/safari-613.1.9-branch
Revision
285840
Author
[email protected]
Date
2021-11-15 16:25:05 -0800 (Mon, 15 Nov 2021)

Log Message

Cherry-pick r285827. rdar://problem/85391118

    Revert r285235
    https://bugs.webkit.org/show_bug.cgi?id=233142

    Unreviewed.

    LayoutTests/imported/w3c:

    * web-platform-tests/css/css-backgrounds/parsing/border-radius-valid-expected.txt:

    Source/WebCore:

    Causes crash with simple repro

    <div id=t style="border-radius: unset"></div>
    <script>
    t.style.borderRadius;
    </script>

    * css/StyleProperties.cpp:
    (WebCore::StyleProperties::getPropertyValue const):
    (WebCore::StyleProperties::borderRadiusValue const): Deleted.
    * css/StyleProperties.h:

    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285827 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Modified Paths

Diff

Modified: branches/safari-613.1.9-branch/LayoutTests/imported/w3c/ChangeLog (285839 => 285840)


--- branches/safari-613.1.9-branch/LayoutTests/imported/w3c/ChangeLog	2021-11-16 00:07:03 UTC (rev 285839)
+++ branches/safari-613.1.9-branch/LayoutTests/imported/w3c/ChangeLog	2021-11-16 00:25:05 UTC (rev 285840)
@@ -1,3 +1,44 @@
+2021-11-15  Russell Epstein  <[email protected]>
+
+        Cherry-pick r285827. rdar://problem/85391118
+
+    Revert r285235
+    https://bugs.webkit.org/show_bug.cgi?id=233142
+    
+    Unreviewed.
+    
+    LayoutTests/imported/w3c:
+    
+    
+    * web-platform-tests/css/css-backgrounds/parsing/border-radius-valid-expected.txt:
+    
+    Source/WebCore:
+    
+    Causes crash with simple repro
+    
+    <div id=t style="border-radius: unset"></div>
+    <script>
+    t.style.borderRadius;
+    </script>
+    
+    
+    * css/StyleProperties.cpp:
+    (WebCore::StyleProperties::getPropertyValue const):
+    (WebCore::StyleProperties::borderRadiusValue const): Deleted.
+    * css/StyleProperties.h:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285827 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-11-15  Antti Koivisto  <[email protected]>
+
+            Revert r285235
+            https://bugs.webkit.org/show_bug.cgi?id=233142
+
+            Unreviewed.
+
+            * web-platform-tests/css/css-backgrounds/parsing/border-radius-valid-expected.txt:
+
 2021-11-12  Ryan Haddad  <[email protected]>
 
         Unreviewed, reverting r285583.

Modified: branches/safari-613.1.9-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-radius-valid-expected.txt (285839 => 285840)


--- branches/safari-613.1.9-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-radius-valid-expected.txt	2021-11-16 00:07:03 UTC (rev 285839)
+++ branches/safari-613.1.9-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-radius-valid-expected.txt	2021-11-16 00:25:05 UTC (rev 285840)
@@ -3,17 +3,17 @@
 PASS e.style['border-radius'] = "1px 5%" should set the property value
 PASS e.style['border-radius'] = "1px 2% 3px" should set the property value
 PASS e.style['border-radius'] = "1px 2% 3px 4%" should set the property value
-PASS e.style['border-radius'] = "1px / 2px" should set the property value
-PASS e.style['border-radius'] = "5em / 1px 2% 3px 4%" should set the property value
-PASS e.style['border-radius'] = "1px 2% / 3px 4px" should set the property value
-PASS e.style['border-radius'] = "1px 2px 3em / 1px 2px 3%" should set the property value
-PASS e.style['border-radius'] = "1px 2% / 2px 3em 4px 5em" should set the property value
-PASS e.style['border-radius'] = "1px 2% 3px 4% / 5em" should set the property value
-PASS e.style['border-radius'] = "1px 1px 1px 2% / 1px 2% 1px 2%" should set the property value
-PASS e.style['border-radius'] = "1px 1px 1px 1px / 1px 1px 2% 1px" should set the property value
+FAIL e.style['border-radius'] = "1px / 2px" should set the property value assert_equals: serialization should be canonical expected "1px / 2px" but got "1px 2px"
+FAIL e.style['border-radius'] = "5em / 1px 2% 3px 4%" should set the property value assert_equals: serialization should be canonical expected "5em / 1px 2% 3px 4%" but got "5em 1px 5em 2% 5em 3px 5em 4%"
+FAIL e.style['border-radius'] = "1px 2% / 3px 4px" should set the property value assert_equals: serialization should be canonical expected "1px 2% / 3px 4px" but got "1px 3px 2% 4px"
+FAIL e.style['border-radius'] = "1px 2px 3em / 1px 2px 3%" should set the property value assert_equals: serialization should be canonical expected "1px 2px 3em / 1px 2px 3%" but got "1px 2px 3em 3%"
+FAIL e.style['border-radius'] = "1px 2% / 2px 3em 4px 5em" should set the property value assert_equals: serialization should be canonical expected "1px 2% / 2px 3em 4px 5em" but got "1px 2px 2% 3em 1px 4px 2% 5em"
+FAIL e.style['border-radius'] = "1px 2% 3px 4% / 5em" should set the property value assert_equals: serialization should be canonical expected "1px 2% 3px 4% / 5em" but got "1px 5em 2% 5em 3px 5em 4% 5em"
+FAIL e.style['border-radius'] = "1px 1px 1px 2% / 1px 2% 1px 2%" should set the property value assert_equals: serialization should be canonical expected "1px 1px 1px 2% / 1px 2%" but got "1px 1px 2% 1px 2%"
+FAIL e.style['border-radius'] = "1px 1px 1px 1px / 1px 1px 2% 1px" should set the property value assert_equals: serialization should be canonical expected "1px / 1px 1px 2%" but got "1px 1px 1px 2%"
 PASS e.style['border-radius'] = "1px 1px 2% 2%" should set the property value
 PASS e.style['border-radius'] = "1px 2% 1px 1px" should set the property value
-PASS e.style['border-radius'] = "1px 2% 2% 2% / 1px 2% 3px 2%" should set the property value
+FAIL e.style['border-radius'] = "1px 2% 2% 2% / 1px 2% 3px 2%" should set the property value assert_equals: serialization should be canonical expected "1px 2% 2% / 1px 2% 3px" but got "1px 2% 2% 3px"
 PASS e.style['border-top-left-radius'] = "10px" should set the property value
 PASS e.style['border-top-right-radius'] = "20%" should set the property value
 PASS e.style['border-bottom-right-radius'] = "30px 40%" should set the property value

Modified: branches/safari-613.1.9-branch/Source/WebCore/ChangeLog (285839 => 285840)


--- branches/safari-613.1.9-branch/Source/WebCore/ChangeLog	2021-11-16 00:07:03 UTC (rev 285839)
+++ branches/safari-613.1.9-branch/Source/WebCore/ChangeLog	2021-11-16 00:25:05 UTC (rev 285840)
@@ -1,3 +1,54 @@
+2021-11-15  Russell Epstein  <[email protected]>
+
+        Cherry-pick r285827. rdar://problem/85391118
+
+    Revert r285235
+    https://bugs.webkit.org/show_bug.cgi?id=233142
+    
+    Unreviewed.
+    
+    LayoutTests/imported/w3c:
+    
+    
+    * web-platform-tests/css/css-backgrounds/parsing/border-radius-valid-expected.txt:
+    
+    Source/WebCore:
+    
+    Causes crash with simple repro
+    
+    <div id=t style="border-radius: unset"></div>
+    <script>
+    t.style.borderRadius;
+    </script>
+    
+    
+    * css/StyleProperties.cpp:
+    (WebCore::StyleProperties::getPropertyValue const):
+    (WebCore::StyleProperties::borderRadiusValue const): Deleted.
+    * css/StyleProperties.h:
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285827 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-11-15  Antti Koivisto  <[email protected]>
+
+            Revert r285235
+            https://bugs.webkit.org/show_bug.cgi?id=233142
+
+            Unreviewed.
+
+            Causes crash with simple repro
+
+            <div id=t style="border-radius: unset"></div>
+            <script>
+            t.style.borderRadius;
+            </script>
+
+            * css/StyleProperties.cpp:
+            (WebCore::StyleProperties::getPropertyValue const):
+            (WebCore::StyleProperties::borderRadiusValue const): Deleted.
+            * css/StyleProperties.h:
+
 2021-11-13  Simon Fraser  <[email protected]>
 
         Run a ScrollAnimationMomentum for the momentum phase of a scroll

Modified: branches/safari-613.1.9-branch/Source/WebCore/css/StyleProperties.cpp (285839 => 285840)


--- branches/safari-613.1.9-branch/Source/WebCore/css/StyleProperties.cpp	2021-11-16 00:07:03 UTC (rev 285839)
+++ branches/safari-613.1.9-branch/Source/WebCore/css/StyleProperties.cpp	2021-11-16 00:25:05 UTC (rev 285840)
@@ -35,7 +35,6 @@
 #include "CSSValuePool.h"
 #include "Color.h"
 #include "Document.h"
-#include "Pair.h"
 #include "PropertySetCSSStyleDeclaration.h"
 #include "StylePropertyShorthand.h"
 #include "StylePropertyShorthandFunctions.h"
@@ -320,7 +319,7 @@
             return value->cssText();
         return String();
     case CSSPropertyBorderRadius:
-        return borderRadiusValue(borderRadiusShorthand());
+        return get4Values(borderRadiusShorthand());
     case CSSPropertyGap:
         return get2Values(gapShorthand());
     case CSSPropertyScrollMargin:
@@ -364,66 +363,6 @@
     return String();
 }
 
-String StyleProperties::borderRadiusValue(const StylePropertyShorthand& shorthand) const
-{
-    auto serialize = [](const CSSValue* topLeft, const CSSValue* topRight, const CSSValue* bottomRight, const CSSValue* bottomLeft) -> String {
-        bool showBottomLeft = !(*topRight == *bottomLeft);
-        bool showBottomRight = !(*topLeft == *bottomRight) || showBottomLeft;
-        bool showTopRight = !(*topLeft == *topRight) || showBottomRight;
-
-        return makeString(topLeft->cssText(), showTopRight ? " " : "", showTopRight ? topRight->cssText() : "", showBottomRight ? " " : "", showBottomRight ? bottomRight->cssText() : "", showBottomLeft ? " " : "", showBottomLeft ? bottomLeft->cssText() : "");
-    };
-
-    int topLeftValueIndex = findPropertyIndex(shorthand.properties()[0]);
-    int topRightValueIndex = findPropertyIndex(shorthand.properties()[1]);
-    int bottomRightValueIndex = findPropertyIndex(shorthand.properties()[2]);
-    int bottomLeftValueIndex = findPropertyIndex(shorthand.properties()[3]);
-
-    if (topLeftValueIndex == -1 || topRightValueIndex == -1 || bottomRightValueIndex == -1 || bottomLeftValueIndex == -1)
-        return String();
-
-    PropertyReference topLeft = propertyAt(topLeftValueIndex);
-    PropertyReference topRight = propertyAt(topRightValueIndex);
-    PropertyReference bottomRight = propertyAt(bottomRightValueIndex);
-    PropertyReference bottomLeft = propertyAt(bottomLeftValueIndex);
-
-    auto* topLeftValue = topLeft.value();
-    auto* topRightValue = topRight.value();
-    auto* bottomRightValue = bottomRight.value();
-    auto* bottomLeftValue = bottomLeft.value();
-
-    // All 4 properties must be specified.
-    if (!topLeftValue || !topRightValue || !bottomRightValue || !bottomLeftValue)
-        return String();
-
-    // Important flags must be the same
-    if (topLeft.isImportant() != topRight.isImportant() || topRight.isImportant() != bottomRight.isImportant() || bottomRight.isImportant() != bottomLeft.isImportant())
-        return String();
-
-    if (topLeftValue->isInheritValue() && topRightValue->isInheritValue() && bottomRightValue->isInheritValue() && bottomLeftValue->isInheritValue())
-        return getValueName(CSSValueInherit);
-
-    if (topLeftValue->isInitialValue() || topRightValue->isInitialValue() || bottomRightValue->isInitialValue() || bottomLeftValue->isInitialValue()) {
-        if (topLeftValue->isInitialValue() && topRightValue->isInitialValue() && bottomRightValue->isInitialValue() && bottomLeftValue->isInitialValue() && !topLeft.isImplicit()) {
-            // All components are "initial" and "topLeft" is not implicit.
-            return getValueName(CSSValueInitial);
-        }
-        return String();
-    }
-
-    auto& topLeftPair = *downcast<CSSPrimitiveValue>(*topLeftValue).pairValue();
-    auto& topRightPair = *downcast<CSSPrimitiveValue>(*topRightValue).pairValue();
-    auto& bottomRightPair = *downcast<CSSPrimitiveValue>(*bottomRightValue).pairValue();
-    auto& bottomLeftPair = *downcast<CSSPrimitiveValue>(*bottomLeftValue).pairValue();
-
-    auto first = serialize(topLeftPair.first(), topRightPair.first(), bottomRightPair.first(), bottomLeftPair.first());
-    auto second = serialize(topLeftPair.second(), topRightPair.second(), bottomRightPair.second(), bottomLeftPair.second());
-    if (first == second)
-        return first;
-
-    return makeString(first, " / ", second);
-}
-
 String StyleProperties::borderSpacingValue(const StylePropertyShorthand& shorthand) const
 {
     auto horizontalValue = getPropertyCSSValue(shorthand.properties()[0]);

Modified: branches/safari-613.1.9-branch/Source/WebCore/css/StyleProperties.h (285839 => 285840)


--- branches/safari-613.1.9-branch/Source/WebCore/css/StyleProperties.h	2021-11-16 00:07:03 UTC (rev 285839)
+++ branches/safari-613.1.9-branch/Source/WebCore/css/StyleProperties.h	2021-11-16 00:25:05 UTC (rev 285840)
@@ -170,7 +170,6 @@
     String getLayeredShorthandValue(const StylePropertyShorthand&) const;
     String get2Values(const StylePropertyShorthand&) const;
     String get4Values(const StylePropertyShorthand&) const;
-    String borderRadiusValue(const StylePropertyShorthand&) const;
     String borderSpacingValue(const StylePropertyShorthand&) const;
     String fontValue() const;
     String fontVariantValue() const;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to