Changeset 287638 in webkit
- Timestamp:
- Jan 5, 2022, 11:19:25 AM (5 years ago)
- Location:
- branches/safari-613.1.12.1-branch
- Files:
-
- 5 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)
-
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
-
branches/safari-613.1.12.1-branch/LayoutTests/imported/w3c/ChangeLog
r286940 r287638 1 2022-01-05 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r285827. rdar://problem/85917218 4 5 Revert r285235 6 https://bugs.webkit.org/show_bug.cgi?id=233142 7 8 Unreviewed. 9 10 LayoutTests/imported/w3c: 11 12 * web-platform-tests/css/css-backgrounds/parsing/border-radius-valid-expected.txt: 13 14 Source/WebCore: 15 16 Causes crash with simple repro 17 18 <div id=t style="border-radius: unset"></div> 19 <script> 20 t.style.borderRadius; 21 </script> 22 23 * css/StyleProperties.cpp: 24 (WebCore::StyleProperties::getPropertyValue const): 25 (WebCore::StyleProperties::borderRadiusValue const): Deleted. 26 * css/StyleProperties.h: 27 28 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285827 268f45cc-cd09-0410-ab3c-d52691b4dbfc 29 30 2021-11-15 Antti Koivisto <antti@apple.com> 31 32 Revert r285235 33 https://bugs.webkit.org/show_bug.cgi?id=233142 34 35 Unreviewed. 36 37 * web-platform-tests/css/css-backgrounds/parsing/border-radius-valid-expected.txt: 38 1 39 2021-12-13 Youenn Fablet <youenn@apple.com> 2 40 -
branches/safari-613.1.12.1-branch/LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-radius-valid-expected.txt
r285915 r287638 8 8 PASS e.style['border-radius'] = "1px 2% 3px" should set the property value 9 9 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 10 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" 11 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%" 12 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" 13 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%" 14 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" 15 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" 16 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%" 17 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 18 PASS e.style['border-radius'] = "1px 1px 2% 2%" should set the property value 19 19 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 20 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 21 PASS e.style['border-top-left-radius'] = "10px" should set the property value 22 22 PASS e.style['border-top-right-radius'] = "20%" should set the property value -
branches/safari-613.1.12.1-branch/Source/WebCore/ChangeLog
r287576 r287638 1 2022-01-05 Alan Coon <alancoon@apple.com> 2 3 Cherry-pick r285827. rdar://problem/85917218 4 5 Revert r285235 6 https://bugs.webkit.org/show_bug.cgi?id=233142 7 8 Unreviewed. 9 10 LayoutTests/imported/w3c: 11 12 * web-platform-tests/css/css-backgrounds/parsing/border-radius-valid-expected.txt: 13 14 Source/WebCore: 15 16 Causes crash with simple repro 17 18 <div id=t style="border-radius: unset"></div> 19 <script> 20 t.style.borderRadius; 21 </script> 22 23 * css/StyleProperties.cpp: 24 (WebCore::StyleProperties::getPropertyValue const): 25 (WebCore::StyleProperties::borderRadiusValue const): Deleted. 26 * css/StyleProperties.h: 27 28 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@285827 268f45cc-cd09-0410-ab3c-d52691b4dbfc 29 30 2021-11-15 Antti Koivisto <antti@apple.com> 31 32 Revert r285235 33 https://bugs.webkit.org/show_bug.cgi?id=233142 34 35 Unreviewed. 36 37 Causes crash with simple repro 38 39 <div id=t style="border-radius: unset"></div> 40 <script> 41 t.style.borderRadius; 42 </script> 43 44 * css/StyleProperties.cpp: 45 (WebCore::StyleProperties::getPropertyValue const): 46 (WebCore::StyleProperties::borderRadiusValue const): Deleted. 47 * css/StyleProperties.h: 48 1 49 2022-01-04 Alan Coon <alancoon@apple.com> 2 50 -
branches/safari-613.1.12.1-branch/Source/WebCore/css/StyleProperties.cpp
r286795 r287638 36 36 #include "Color.h" 37 37 #include "Document.h" 38 #include "Pair.h"39 38 #include "PropertySetCSSStyleDeclaration.h" 40 39 #include "StylePropertyShorthand.h" … … 324 323 return String(); 325 324 case CSSPropertyBorderRadius: 326 return borderRadiusValue(borderRadiusShorthand());325 return get4Values(borderRadiusShorthand()); 327 326 case CSSPropertyGap: 328 327 return get2Values(gapShorthand()); … … 366 365 return value->cssText(); 367 366 return String(); 368 }369 370 String StyleProperties::borderRadiusValue(const StylePropertyShorthand& shorthand) const371 {372 auto serialize = [](const CSSValue* topLeft, const CSSValue* topRight, const CSSValue* bottomRight, const CSSValue* bottomLeft) -> String {373 bool showBottomLeft = !(*topRight == *bottomLeft);374 bool showBottomRight = !(*topLeft == *bottomRight) || showBottomLeft;375 bool showTopRight = !(*topLeft == *topRight) || showBottomRight;376 377 return makeString(topLeft->cssText(), showTopRight ? " " : "", showTopRight ? topRight->cssText() : "", showBottomRight ? " " : "", showBottomRight ? bottomRight->cssText() : "", showBottomLeft ? " " : "", showBottomLeft ? bottomLeft->cssText() : "");378 };379 380 int topLeftValueIndex = findPropertyIndex(shorthand.properties()[0]);381 int topRightValueIndex = findPropertyIndex(shorthand.properties()[1]);382 int bottomRightValueIndex = findPropertyIndex(shorthand.properties()[2]);383 int bottomLeftValueIndex = findPropertyIndex(shorthand.properties()[3]);384 385 if (topLeftValueIndex == -1 || topRightValueIndex == -1 || bottomRightValueIndex == -1 || bottomLeftValueIndex == -1)386 return String();387 388 PropertyReference topLeft = propertyAt(topLeftValueIndex);389 PropertyReference topRight = propertyAt(topRightValueIndex);390 PropertyReference bottomRight = propertyAt(bottomRightValueIndex);391 PropertyReference bottomLeft = propertyAt(bottomLeftValueIndex);392 393 auto* topLeftValue = topLeft.value();394 if (!topLeftValue)395 return String();396 if (topLeftValue->isCSSWideKeyword())397 return topLeftValue->cssText();398 399 auto* topRightValue = topRight.value();400 auto* bottomRightValue = bottomRight.value();401 auto* bottomLeftValue = bottomLeft.value();402 403 // All 4 properties must be specified and the remaining ones other than topLeftValue are checked here.404 if (!topRightValue || !bottomRightValue || !bottomLeftValue)405 return String();406 407 // Important flags must be the same408 bool isImportant = topLeft.isImportant();409 if (topRight.isImportant() != isImportant || bottomRight.isImportant() != isImportant || bottomLeft.isImportant() != isImportant)410 return String();411 412 auto& topLeftPair = *downcast<CSSPrimitiveValue>(*topLeftValue).pairValue();413 auto& topRightPair = *downcast<CSSPrimitiveValue>(*topRightValue).pairValue();414 auto& bottomRightPair = *downcast<CSSPrimitiveValue>(*bottomRightValue).pairValue();415 auto& bottomLeftPair = *downcast<CSSPrimitiveValue>(*bottomLeftValue).pairValue();416 417 auto first = serialize(topLeftPair.first(), topRightPair.first(), bottomRightPair.first(), bottomLeftPair.first());418 auto second = serialize(topLeftPair.second(), topRightPair.second(), bottomRightPair.second(), bottomLeftPair.second());419 if (first == second)420 return first;421 422 return makeString(first, " / ", second);423 367 } 424 368 -
branches/safari-613.1.12.1-branch/Source/WebCore/css/StyleProperties.h
r285915 r287638 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.