Changeset 290571 in webkit


Ignore:
Timestamp:
Feb 27, 2022 2:15:50 PM (5 months ago)
Author:
graouts@webkit.org
Message:

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

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

Location:
trunk
Files:
5 edited

Legend:

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

    r290570 r290571  
     12022-02-27  Antoine Quint  <graouts@webkit.org>
     2
     3        [svg] flood-opacity should be clamped to the [0,1] range
     4        https://bugs.webkit.org/show_bug.cgi?id=237253
     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  Antoine Quint  <graouts@webkit.org>
    212
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/accumulation-per-property-001-expected.txt

    r290568 r290571  
    210210PASS flood-opacity (type: opacity) has testAccumulation function
    211211PASS flood-opacity: [0, 1] number
    212 FAIL flood-opacity: [0, 1] number (clamped) assert_equals: The value should be 1 at 0ms expected "1" but got "1.1"
     212PASS flood-opacity: [0, 1] number (clamped)
    213213PASS font-stretch (type: percentage) has testAccumulation function
    214214PASS font-stretch: percentage
  • trunk/LayoutTests/imported/w3c/web-platform-tests/web-animations/animation-model/animation-types/addition-per-property-001-expected.txt

    r290568 r290571  
    210210PASS flood-opacity (type: opacity) has testAddition function
    211211PASS flood-opacity: [0, 1] number
    212 FAIL flood-opacity: [0, 1] number (clamped) assert_equals: The value should be 1 at 0ms expected "1" but got "1.1"
     212PASS flood-opacity: [0, 1] number (clamped)
    213213PASS font-stretch (type: percentage) has testAddition function
    214214PASS font-stretch: percentage
  • trunk/Source/WebCore/ChangeLog

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

    r290570 r290571  
    368368inline void SVGRenderStyle::setFloodOpacity(float opacity)
    369369{
    370     if (!(m_miscData->floodOpacity == opacity))
    371         m_miscData.access().floodOpacity = opacity;
     370    auto clampedOpacity = clampTo<float>(opacity, 0.f, 1.f);
     371    if (!(m_miscData->floodOpacity == clampedOpacity))
     372        m_miscData.access().floodOpacity = clampedOpacity;
    372373}
    373374
Note: See TracChangeset for help on using the changeset viewer.