⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 287609 in webkit


Ignore:
Timestamp:
Jan 5, 2022, 1:52:25 AM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Unreviewed, reverting r285915.
​https://bugs.webkit.org/show_bug.cgi?id=234873

causes crashes

Reverted changeset:

"border-radius inline style should serialize with valid
syntax"
​https://bugs.webkit.org/show_bug.cgi?id=183994
​https://commits.webkit.org/r285915

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r287606 r287609  
     12022-01-05  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, reverting r285915.
     4        https://bugs.webkit.org/show_bug.cgi?id=234873
     5
     6        causes crashes
     7
     8        Reverted changeset:
     9
     10        "border-radius inline style should serialize with valid
     11        syntax"
     12        https://bugs.webkit.org/show_bug.cgi?id=183994
     13        https://commits.webkit.org/r285915
     14
    1152022-01-05  Martin Robinson  <mrobinson@webkit.org>
    216
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-radius-valid-expected.txt

    r285915 r287609  
    11
    2 PASS e.style['border-radius'] = "initial" should set the property value
    3 PASS e.style['border-radius'] = "inherit" should set the property value
    4 PASS e.style['border-radius'] = "unset" should set the property value
    5 PASS e.style['border-radius'] = "revert" should set the property value
    62PASS e.style['border-radius'] = "1px" should set the property value
    73PASS e.style['border-radius'] = "1px 5%" should set the property value
    84PASS e.style['border-radius'] = "1px 2% 3px" should set the property value
    95PASS e.style['border-radius'] = "1px 2% 3px 4%" should set the property value
    10 PASS e.style['border-radius'] = "1px / 2px" should set the property value
    11 PASS e.style['border-radius'] = "5em / 1px 2% 3px 4%" should set the property value
    12 PASS e.style['border-radius'] = "1px 2% / 3px 4px" should set the property value
    13 PASS e.style['border-radius'] = "1px 2px 3em / 1px 2px 3%" should set the property value
    14 PASS e.style['border-radius'] = "1px 2% / 2px 3em 4px 5em" should set the property value
    15 PASS e.style['border-radius'] = "1px 2% 3px 4% / 5em" should set the property value
    16 PASS e.style['border-radius'] = "1px 1px 1px 2% / 1px 2% 1px 2%" should set the property value
    17 PASS e.style['border-radius'] = "1px 1px 1px 1px / 1px 1px 2% 1px" should set the property value
     6FAIL e.style['border-radius'] = "1px / 2px" should set the property value assert_equals: serialization should be canonical expected "1px / 2px" but got "1px 2px"
     7FAIL 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%"
     8FAIL 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"
     9FAIL 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%"
     10FAIL 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"
     11FAIL 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"
     12FAIL 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%"
     13FAIL 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%"
    1814PASS e.style['border-radius'] = "1px 1px 2% 2%" should set the property value
    1915PASS e.style['border-radius'] = "1px 2% 1px 1px" should set the property value
    20 PASS e.style['border-radius'] = "1px 2% 2% 2% / 1px 2% 3px 2%" should set the property value
     16FAIL 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"
    2117PASS e.style['border-top-left-radius'] = "10px" should set the property value
    2218PASS e.style['border-top-right-radius'] = "20%" should set the property value
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-radius-valid.html

    r285915 r287609  
    55<title>CSS Backgrounds and Borders Module Level 3: parsing border-radius with valid values</title>
    66<link rel="help" href="https://drafts.csswg.org/css-backgrounds/#border-radius">
    7 <meta name="assert" content="border-radius supports CSS Wide keywords and the full grammar '<length-percentage>{1,4} [ / <length-percentage>{1,4} ]?'.">
     7<meta name="assert" content="border-radius supports the full grammar '<length-percentage>{1,4} [ / <length-percentage>{1,4} ]?'.">
    88<script src="/resources/testharness.js"></script>
    99<script src="/resources/testharnessreport.js"></script>
    … …  
    1212<body>
    1313<script>
    14 test_valid_value("border-radius", "initial");
    15 test_valid_value("border-radius", "inherit");
    16 test_valid_value("border-radius", "unset");
    17 test_valid_value("border-radius", "revert");
    18 
    1914test_valid_value("border-radius", "1px");
    2015test_valid_value("border-radius", "1px 5%");
  • trunk/Source/WebCore/ChangeLog

    r287608 r287609  
     12022-01-05  Commit Queue  <commit-queue@webkit.org>
     2
     3        Unreviewed, reverting r285915.
     4        https://bugs.webkit.org/show_bug.cgi?id=234873
     5
     6        causes crashes
     7
     8        Reverted changeset:
     9
     10        "border-radius inline style should serialize with valid
     11        syntax"
     12        https://bugs.webkit.org/show_bug.cgi?id=183994
     13        https://commits.webkit.org/r285915
     14
    1152022-01-05  Youenn Fablet  <youenn@apple.com>
    216
  • trunk/Source/WebCore/css/StyleProperties.cpp

    r287429 r287609  
    3636#include "Color.h"
    3737#include "Document.h"
    38 #include "Pair.h"
    3938#include "PropertySetCSSStyleDeclaration.h"
    4039#include "StylePropertyShorthand.h"
    … …  
    322321        return String();
    323322    case CSSPropertyBorderRadius:
    324         return borderRadiusValue(borderRadiusShorthand());
     323        return get4Values(borderRadiusShorthand());
    325324    case CSSPropertyGap:
    326325        return get2Values(gapShorthand());
    … …  
    364363        return value->cssText();
    365364    return String();
    366 }
    367 
    368 String StyleProperties::borderRadiusValue(const StylePropertyShorthand& shorthand) const
    369 {
    370     auto serialize = [](const CSSValue* topLeft, const CSSValue* topRight, const CSSValue* bottomRight, const CSSValue* bottomLeft) -> String {
    371         bool showBottomLeft = !(*topRight == *bottomLeft);
    372         bool showBottomRight = !(*topLeft == *bottomRight) || showBottomLeft;
    373         bool showTopRight = !(*topLeft == *topRight) || showBottomRight;
    374 
    375         return makeString(topLeft->cssText(), showTopRight ? " " : "", showTopRight ? topRight->cssText() : "", showBottomRight ? " " : "", showBottomRight ? bottomRight->cssText() : "", showBottomLeft ? " " : "", showBottomLeft ? bottomLeft->cssText() : "");
    376     };
    377 
    378     int topLeftValueIndex = findPropertyIndex(shorthand.properties()[0]);
    379     int topRightValueIndex = findPropertyIndex(shorthand.properties()[1]);
    380     int bottomRightValueIndex = findPropertyIndex(shorthand.properties()[2]);
    381     int bottomLeftValueIndex = findPropertyIndex(shorthand.properties()[3]);
    382 
    383     if (topLeftValueIndex == -1 || topRightValueIndex == -1 || bottomRightValueIndex == -1 || bottomLeftValueIndex == -1)
    384         return String();
    385 
    386     PropertyReference topLeft = propertyAt(topLeftValueIndex);
    387     PropertyReference topRight = propertyAt(topRightValueIndex);
    388     PropertyReference bottomRight = propertyAt(bottomRightValueIndex);
    389     PropertyReference bottomLeft = propertyAt(bottomLeftValueIndex);
    390 
    391     auto* topLeftValue = topLeft.value();
    392     if (!topLeftValue)
    393         return String();
    394     if (topLeftValue->isCSSWideKeyword())
    395         return topLeftValue->cssText();
    396 
    397     auto* topRightValue = topRight.value();
    398     auto* bottomRightValue = bottomRight.value();
    399     auto* bottomLeftValue = bottomLeft.value();
    400 
    401     // All 4 properties must be specified and the remaining ones other than topLeftValue are checked here.
    402     if (!topRightValue || !bottomRightValue || !bottomLeftValue)
    403         return String();
    404 
    405     // Important flags must be the same
    406     bool isImportant = topLeft.isImportant();
    407     if (topRight.isImportant() != isImportant || bottomRight.isImportant() != isImportant || bottomLeft.isImportant() != isImportant)
    408         return String();
    409 
    410     auto& topLeftPair = *downcast<CSSPrimitiveValue>(*topLeftValue).pairValue();
    411     auto& topRightPair = *downcast<CSSPrimitiveValue>(*topRightValue).pairValue();
    412     auto& bottomRightPair = *downcast<CSSPrimitiveValue>(*bottomRightValue).pairValue();
    413     auto& bottomLeftPair = *downcast<CSSPrimitiveValue>(*bottomLeftValue).pairValue();
    414 
    415     auto first = serialize(topLeftPair.first(), topRightPair.first(), bottomRightPair.first(), bottomLeftPair.first());
    416     auto second = serialize(topLeftPair.second(), topRightPair.second(), bottomRightPair.second(), bottomLeftPair.second());
    417     if (first == second)
    418         return first;
    419 
    420     return makeString(first, " / ", second);
    421365}
    422366
  • trunk/Source/WebCore/css/StyleProperties.h

    r285915 r287609  
    171171    String get2Values(const StylePropertyShorthand&) const;
    172172    String get4Values(const StylePropertyShorthand&) const;
    173     String borderRadiusValue(const StylePropertyShorthand&) const;
    174173    String borderSpacingValue(const StylePropertyShorthand&) const;
    175174    String fontValue() const;
Note: See TracChangeset for help on using the changeset viewer.