Changeset 290570 in webkit


Ignore:
Timestamp:
Feb 27, 2022 1:19:37 PM (5 months ago)
Author:
graouts@webkit.org
Message:

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

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::setStrokeOpacity):

Location:
trunk
Files:
5 edited

Legend:

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

    r290569 r290570  
     12022-02-27  Antoine Quint  <graouts@webkit.org>
     2
     3        [svg] stroke-opacity should be clamped to the [0,1] range
     4        https://bugs.webkit.org/show_bug.cgi?id=237254
     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

    r290569 r290570  
    133133PASS stroke-opacity (type: opacity) has testAccumulation function
    134134PASS stroke-opacity: [0, 1] number
    135 FAIL stroke-opacity: [0, 1] number (clamped) assert_equals: The value should be 1 at 0ms expected "1" but got "1.1"
     135PASS stroke-opacity: [0, 1] number (clamped)
    136136PASS table-layout (type: discrete) has testAccumulation function
    137137PASS table-layout: "fixed" onto "auto"
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-002-expected.txt

    r290569 r290570  
    133133PASS stroke-opacity (type: opacity) has testAddition function
    134134PASS stroke-opacity: [0, 1] number
    135 FAIL stroke-opacity: [0, 1] number (clamped) assert_equals: The value should be 1 at 0ms expected "1" but got "1.1"
     135PASS stroke-opacity: [0, 1] number (clamped)
    136136PASS table-layout (type: discrete) has testAddition function
    137137PASS table-layout: "fixed" onto "auto"
  • trunk/Source/WebCore/ChangeLog

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

    r290569 r290570  
    310310inline void SVGRenderStyle::setStrokeOpacity(float opacity)
    311311{
    312     if (!(m_strokeData->opacity == opacity))
    313         m_strokeData.access().opacity = opacity;
     312    auto clampedOpacity = clampTo<float>(opacity, 0.f, 1.f);
     313    if (!(m_strokeData->opacity == clampedOpacity))
     314        m_strokeData.access().opacity = clampedOpacity;
    314315}
    315316
Note: See TracChangeset for help on using the changeset viewer.