Changeset 287609 in webkit
- Timestamp:
- Jan 5, 2022, 1:52:25 AM (5 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
-
LayoutTests/imported/w3c/ChangeLog (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-radius-valid-expected.txt (modified) (1 diff)
-
LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-radius-valid.html (modified) (2 diffs)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/css/StyleProperties.cpp (modified) (3 diffs)
-
Source/WebCore/css/StyleProperties.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/imported/w3c/ChangeLog
r287606 r287609 1 2022-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 1 15 2022-01-05 Martin Robinson <mrobinson@webkit.org> 2 16 -
trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-radius-valid-expected.txt
r285915 r287609 1 1 2 PASS e.style['border-radius'] = "initial" should set the property value3 PASS e.style['border-radius'] = "inherit" should set the property value4 PASS e.style['border-radius'] = "unset" should set the property value5 PASS e.style['border-radius'] = "revert" should set the property value6 2 PASS e.style['border-radius'] = "1px" should set the property value 7 3 PASS e.style['border-radius'] = "1px 5%" should set the property value 8 4 PASS e.style['border-radius'] = "1px 2% 3px" should set the property value 9 5 PASS 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 6 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" 7 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%" 8 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" 9 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%" 10 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" 11 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" 12 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%" 13 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%" 18 14 PASS e.style['border-radius'] = "1px 1px 2% 2%" should set the property value 19 15 PASS 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 16 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" 21 17 PASS e.style['border-top-left-radius'] = "10px" should set the property value 22 18 PASS 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 5 5 <title>CSS Backgrounds and Borders Module Level 3: parsing border-radius with valid values</title> 6 6 <link rel="help" href="https://drafts.csswg.org/css-backgrounds/#border-radius"> 7 <meta name="assert" content="border-radius supports CSS Wide keywords andthe 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} ]?'."> 8 8 <script src="/resources/testharness.js"></script> 9 9 <script src="/resources/testharnessreport.js"></script> … … 12 12 <body> 13 13 <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 19 14 test_valid_value("border-radius", "1px"); 20 15 test_valid_value("border-radius", "1px 5%"); -
trunk/Source/WebCore/ChangeLog
r287608 r287609 1 2022-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 1 15 2022-01-05 Youenn Fablet <youenn@apple.com> 2 16 -
trunk/Source/WebCore/css/StyleProperties.cpp
r287429 r287609 36 36 #include "Color.h" 37 37 #include "Document.h" 38 #include "Pair.h"39 38 #include "PropertySetCSSStyleDeclaration.h" 40 39 #include "StylePropertyShorthand.h" … … 322 321 return String(); 323 322 case CSSPropertyBorderRadius: 324 return borderRadiusValue(borderRadiusShorthand());323 return get4Values(borderRadiusShorthand()); 325 324 case CSSPropertyGap: 326 325 return get2Values(gapShorthand()); … … 364 363 return value->cssText(); 365 364 return String(); 366 }367 368 String StyleProperties::borderRadiusValue(const StylePropertyShorthand& shorthand) const369 {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 same406 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);421 365 } 422 366 -
trunk/Source/WebCore/css/StyleProperties.h
r285915 r287609 171 171 String get2Values(const StylePropertyShorthand&) const; 172 172 String get4Values(const StylePropertyShorthand&) const; 173 String borderRadiusValue(const StylePropertyShorthand&) const;174 173 String borderSpacingValue(const StylePropertyShorthand&) const; 175 174 String fontValue() const;
Note:
See TracChangeset
for help on using the changeset viewer.