Changeset 275273 in webkit


Ignore:
Timestamp:
Mar 31, 2021 1:30:41 AM (16 months ago)
Author:
graouts@webkit.org
Message:

Computed style for a border-radius corner should never be 0px when the provided width isn't 0px
https://bugs.webkit.org/show_bug.cgi?id=223927

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

Mark 5 tests as PASS results as a result of returning the correct computed style for
"border-top-left-radius: 40px 0px". This is importing a change made to WPT via
https://github.com/web-platform-tests/wpt/pull/28310.

  • web-platform-tests/css/css-backgrounds/animations/border-radius-interpolation-expected.txt:
  • web-platform-tests/css/css-backgrounds/parsing/border-radius-computed-expected.txt:
  • web-platform-tests/css/css-backgrounds/parsing/border-radius-computed.html:

Source/WebCore:

If "border-top-left-radius: 40px 0px" is provided, the computed style would return "0px" since
BuilderConverter::convertRadius() would treat either of the dimensions for the radius being 0
as both being 0.

  • style/StyleBuilderConverter.h:

(WebCore::Style::BuilderConverter::convertRadius):

Location:
trunk
Files:
6 edited

Legend:

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

    r275272 r275273  
     12021-03-30  Antoine Quint  <graouts@webkit.org>
     2
     3        Computed style for a border-radius corner should never be 0px when the provided width isn't 0px
     4        https://bugs.webkit.org/show_bug.cgi?id=223927
     5
     6        Reviewed by Dean Jackson.
     7
     8        Mark 5 tests as PASS results as a result of returning the correct computed style for
     9        "border-top-left-radius: 40px 0px". This is importing a change made to WPT via
     10        https://github.com/web-platform-tests/wpt/pull/28310.
     11
     12        * web-platform-tests/css/css-backgrounds/animations/border-radius-interpolation-expected.txt:
     13        * web-platform-tests/css/css-backgrounds/parsing/border-radius-computed-expected.txt:
     14        * web-platform-tests/css/css-backgrounds/parsing/border-radius-computed.html:
     15
    1162021-03-30  Antoine Quint  <graouts@webkit.org>
    217
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/animations/border-radius-interpolation-expected.txt

    r274353 r275273  
    168168PASS Web Animations: property <border-top-left-radius> from [10px] to [100%] at (1) should be [100%]
    169169FAIL Web Animations: property <border-top-left-radius> from [10px] to [100%] at (1.5) should be [calc(-5px + 150%)] assert_equals: expected "calc ( 150 % - 5px ) " but got "calc ( ( 10px * - 0.5 ) + ( 100 % * 1.5 ) ) "
    170 FAIL CSS Transitions: property <border-top-left-radius> from [20px] to [10px 30px] at (-2) should be [40px 0px] assert_equals: expected "0px " but got "40px 0px "
     170PASS CSS Transitions: property <border-top-left-radius> from [20px] to [10px 30px] at (-2) should be [40px 0px]
    171171PASS CSS Transitions: property <border-top-left-radius> from [20px] to [10px 30px] at (-0.3) should be [23px 17px]
    172172PASS CSS Transitions: property <border-top-left-radius> from [20px] to [10px 30px] at (0) should be [20px]
     
    175175PASS CSS Transitions: property <border-top-left-radius> from [20px] to [10px 30px] at (1) should be [10px 30px]
    176176PASS CSS Transitions: property <border-top-left-radius> from [20px] to [10px 30px] at (1.5) should be [5px 35px]
    177 FAIL CSS Transitions with transition: all: property <border-top-left-radius> from [20px] to [10px 30px] at (-2) should be [40px 0px] assert_equals: expected "0px " but got "40px 0px "
     177PASS CSS Transitions with transition: all: property <border-top-left-radius> from [20px] to [10px 30px] at (-2) should be [40px 0px]
    178178PASS CSS Transitions with transition: all: property <border-top-left-radius> from [20px] to [10px 30px] at (-0.3) should be [23px 17px]
    179179PASS CSS Transitions with transition: all: property <border-top-left-radius> from [20px] to [10px 30px] at (0) should be [20px]
     
    182182PASS CSS Transitions with transition: all: property <border-top-left-radius> from [20px] to [10px 30px] at (1) should be [10px 30px]
    183183PASS CSS Transitions with transition: all: property <border-top-left-radius> from [20px] to [10px 30px] at (1.5) should be [5px 35px]
    184 FAIL CSS Animations: property <border-top-left-radius> from [20px] to [10px 30px] at (-2) should be [40px 0px] assert_equals: expected "0px " but got "40px 0px "
     184PASS CSS Animations: property <border-top-left-radius> from [20px] to [10px 30px] at (-2) should be [40px 0px]
    185185PASS CSS Animations: property <border-top-left-radius> from [20px] to [10px 30px] at (-0.3) should be [23px 17px]
    186186PASS CSS Animations: property <border-top-left-radius> from [20px] to [10px 30px] at (0) should be [20px]
     
    189189PASS CSS Animations: property <border-top-left-radius> from [20px] to [10px 30px] at (1) should be [10px 30px]
    190190PASS CSS Animations: property <border-top-left-radius> from [20px] to [10px 30px] at (1.5) should be [5px 35px]
    191 FAIL Web Animations: property <border-top-left-radius> from [20px] to [10px 30px] at (-2) should be [40px 0px] assert_equals: expected "0px " but got "40px 0px "
     191PASS Web Animations: property <border-top-left-radius> from [20px] to [10px 30px] at (-2) should be [40px 0px]
    192192PASS Web Animations: property <border-top-left-radius> from [20px] to [10px 30px] at (-0.3) should be [23px 17px]
    193193PASS Web Animations: property <border-top-left-radius> from [20px] to [10px 30px] at (0) should be [20px]
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-radius-computed-expected.txt

    r267650 r275273  
    1313PASS Property border-bottom-right-radius value 'calc(0.5em + 10px) 40%'
    1414PASS Property border-bottom-left-radius value '50% 60px'
     15PASS Property border-top-left-radius value '40px 0px'
    1516
  • trunk/LayoutTests/imported/w3c/web-platform-tests/css/css-backgrounds/parsing/border-radius-computed.html

    r255239 r275273  
    3333test_computed_value("border-bottom-right-radius", "calc(0.5em + 10px) 40%", "30px 40%");
    3434test_computed_value("border-bottom-left-radius", "50% 60px");
     35
     36test_computed_value("border-top-left-radius", "40px 0px", "40px 0px");
    3537</script>
    3638</body>
  • trunk/Source/WebCore/ChangeLog

    r275272 r275273  
     12021-03-30  Antoine Quint  <graouts@webkit.org>
     2
     3        Computed style for a border-radius corner should never be 0px when the provided width isn't 0px
     4        https://bugs.webkit.org/show_bug.cgi?id=223927
     5
     6        Reviewed by Dean Jackson.
     7
     8        If "border-top-left-radius: 40px 0px" is provided, the computed style would return "0px" since
     9        BuilderConverter::convertRadius() would treat either of the dimensions for the radius being 0
     10        as both being 0.
     11
     12        * style/StyleBuilderConverter.h:
     13        (WebCore::Style::BuilderConverter::convertRadius):
     14
    1152021-03-30  Antoine Quint  <graouts@webkit.org>
    216
  • trunk/Source/WebCore/style/StyleBuilderConverter.h

    r274329 r275273  
    338338    ASSERT(!radius.width.isNegative());
    339339    ASSERT(!radius.height.isNegative());
    340     if (radius.width.isZero() || radius.height.isZero())
    341         return { { 0, LengthType::Fixed }, { 0, LengthType::Fixed } };
    342 
    343340    return radius;
    344341}
Note: See TracChangeset for help on using the changeset viewer.