Changeset 290569 in webkit


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

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

Reviewed by Dean Jackson.

LayoutTests/imported/w3c:

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

Source/WebCore:

  • rendering/style/SVGRenderStyle.h:

(WebCore::SVGRenderStyle::setStopOpacity):

Location:
trunk
Files:
5 edited

Legend:

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

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

    r289599 r290569  
    123123PASS stop-opacity (type: opacity) has testAccumulation function
    124124PASS stop-opacity: [0, 1] number
    125 FAIL stop-opacity: [0, 1] number (clamped) assert_equals: The value should be 1 at 0ms expected "1" but got "1.1"
     125PASS stop-opacity: [0, 1] number (clamped)
    126126PASS stroke-dasharray (type: dasharray) has testAccumulation function
    127127PASS stroke-dasharray: dasharray
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt

    r287924 r290569  
    123123PASS stop-opacity (type: opacity) has testAddition function
    124124PASS stop-opacity: [0, 1] number
    125 FAIL stop-opacity: [0, 1] number (clamped) assert_equals: The value should be 1 at 0ms expected "1" but got "1.1"
     125PASS stop-opacity: [0, 1] number (clamped)
    126126PASS stroke-dasharray (type: dasharray) has testAddition function
    127127PASS stroke-dasharray: dasharray
  • trunk/Source/WebCore/ChangeLog

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

    r290568 r290569  
    354354inline void SVGRenderStyle::setStopOpacity(float opacity)
    355355{
    356     if (!(m_stopData->opacity == opacity))
    357         m_stopData.access().opacity = opacity;
     356    auto clampedOpacity = clampTo<float>(opacity, 0.f, 1.f);
     357    if (!(m_stopData->opacity == clampedOpacity))
     358        m_stopData.access().opacity = clampedOpacity;
    358359}
    359360
Note: See TracChangeset for help on using the changeset viewer.