Changeset 290568 in webkit


Ignore:
Timestamp:
Feb 27, 2022 12:31:57 PM (5 months ago)
Author:
graouts@webkit.org
Message:

[svg] fill-opacity should be clamped to the [0,1] range
https://bugs.webkit.org/show_bug.cgi?id=237252

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

  • web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt:
  • web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:

Source/WebCore:

  • rendering/style/SVGRenderStyle.h:

(WebCore::SVGRenderStyle::setFillOpacity):

Location:
trunk
Files:
5 edited

Legend:

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

    r290564 r290568  
     12022-02-27  Antoine Quint  <graouts@webkit.org>
     2
     3        [svg] fill-opacity should be clamped to the [0,1] range
     4        https://bugs.webkit.org/show_bug.cgi?id=237252
     5
     6        Reviewed by Dean Jackson.
     7
     8        * web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt:
     9        * web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt:
     10
    1112022-02-27  Tim Nguyen  <ntim@apple.com>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt

    r287909 r290568  
    172172PASS fill-opacity (type: opacity) has testAccumulation function
    173173PASS fill-opacity: [0, 1] number
    174 FAIL fill-opacity: [0, 1] number (clamped) assert_equals: The value should be 1 at 0ms expected "1" but got "1.1"
     174PASS fill-opacity: [0, 1] number (clamped)
    175175PASS filter (type: filterList) has testAccumulation function
    176176FAIL filter: same ordered filter functions assert_equals: The value should be blur(30px) brightness(0) at 0ms expected "blur(30px) brightness(0)" but got "blur(30px) brightness(0.4)"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt

    r287909 r290568  
    172172PASS fill-opacity (type: opacity) has testAddition function
    173173PASS fill-opacity: [0, 1] number
    174 FAIL fill-opacity: [0, 1] number (clamped) assert_equals: The value should be 1 at 0ms expected "1" but got "1.1"
     174PASS fill-opacity: [0, 1] number (clamped)
    175175PASS filter (type: filterList) has testAddition function
    176176FAIL filter: blur on blur assert_equals: The value should be blur(10px) blur(20px) at 0ms expected "blur(10px) blur(20px)" but got "blur(30px)"
  • trunk/Source/WebCore/ChangeLog

    r290566 r290568  
     12022-02-27  Antoine Quint  <graouts@webkit.org>
     2
     3        [svg] fill-opacity should be clamped to the [0,1] range
     4        https://bugs.webkit.org/show_bug.cgi?id=237252
     5
     6        Reviewed by Dean Jackson.
     7
     8        * rendering/style/SVGRenderStyle.h:
     9        (WebCore::SVGRenderStyle::setFillOpacity):
     10
    1112022-02-27  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/Source/WebCore/rendering/style/SVGRenderStyle.h

    r286795 r290568  
    283283inline void SVGRenderStyle::setFillOpacity(float opacity)
    284284{
    285     if (!(m_fillData->opacity == opacity))
    286         m_fillData.access().opacity = opacity;
     285    auto clampedOpacity = clampTo<float>(opacity, 0.f, 1.f);
     286    if (!(m_fillData->opacity == clampedOpacity))
     287        m_fillData.access().opacity = clampedOpacity;
    287288}
    288289
Note: See TracChangeset for help on using the changeset viewer.