Skip to content

Commit 89a77dc

Browse files
committed
Expose operator lighter in SVGFECompositeElement IDL
https://bugs.webkit.org/show_bug.cgi?id=304105 rdar://problem/166704079 Reviewed by Said Abou-Hallawa. As defined in the Compositing and Blending spec [1], the 'lighter' operator is specified. This PR, as discussed in [2], exposes the 'lighter' value to IDL. [1] https://www.w3.org/TR/compositing-1/#porterduffcompositingoperators_plus [2] w3c/svgwg#424 * LayoutTests/imported/w3c/web-platform-tests/svg/types/scripted/SVGAnimatedEnumeration-SVGFECompositeElement-expected.txt: * LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement-expected.txt: Removed. * LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement.html: Removed. Removed this test because it is duplicated in WPT. * Source/WebCore/svg/SVGFECompositeElement.h: (WebCore::SVGIDLEnumLimits<CompositeOperationType>::highestExposedEnumValue): Deleted. * Source/WebCore/svg/SVGFECompositeElement.idl: * Source/WebCore/svg/properties/SVGDecoratedEnumeration.h: * Source/WebCore/svg/properties/SVGPropertyTraits.h: (WebCore::SVGIDLEnumLimits::highestExposedEnumValue): Deleted. Canonical link: https://commits.webkit.org/304941@main
1 parent 4a83564 commit 89a77dc

File tree

7 files changed

+4
-157
lines changed

7 files changed

+4
-157
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11

2-
FAIL Use of SVGAnimatedEnumeration within SVGFECompositeElement Type error
2+
PASS Use of SVGAnimatedEnumeration within SVGFECompositeElement
33

LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement-expected.txt

Lines changed: 0 additions & 59 deletions
This file was deleted.

LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFECompositeElement.html

Lines changed: 0 additions & 86 deletions
This file was deleted.

Source/WebCore/svg/SVGFECompositeElement.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@
2929

3030
namespace WebCore {
3131

32-
template<>
33-
inline unsigned SVGIDLEnumLimits<CompositeOperationType>::highestExposedEnumValue() { return enumToUnderlyingType(CompositeOperationType::FECOMPOSITE_OPERATOR_ARITHMETIC); }
34-
3532
template<>
3633
struct SVGPropertyTraits<CompositeOperationType> {
3734
static unsigned highestEnumValue() { return enumToUnderlyingType(CompositeOperationType::FECOMPOSITE_OPERATOR_LIGHTER); }

Source/WebCore/svg/SVGFECompositeElement.idl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
const unsigned short SVG_FECOMPOSITE_OPERATOR_ATOP = 4;
3636
const unsigned short SVG_FECOMPOSITE_OPERATOR_XOR = 5;
3737
const unsigned short SVG_FECOMPOSITE_OPERATOR_ARITHMETIC = 6;
38+
const unsigned short SVG_FECOMPOSITE_OPERATOR_LIGHTER = 7;
3839

3940
readonly attribute SVGAnimatedString in1;
4041
readonly attribute SVGAnimatedString in2;

Source/WebCore/svg/properties/SVGDecoratedEnumeration.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,15 @@ class SVGDecoratedEnumeration : public SVGDecoratedPrimitive<DecorationType, Enu
4545
private:
4646
bool setValue(const DecorationType& value) override
4747
{
48-
if (!value || value > SVGIDLEnumLimits<EnumType>::highestExposedEnumValue())
48+
if (!value || value > SVGPropertyTraits<EnumType>::highestEnumValue())
4949
return false;
5050
Base::setValueInternal(value);
5151
return true;
5252
}
5353

5454
DecorationType value() const override
5555
{
56-
if (Base::value() > SVGIDLEnumLimits<EnumType>::highestExposedEnumValue())
56+
if (Base::value() > SVGPropertyTraits<EnumType>::highestEnumValue())
5757
return m_outOfRangeEnumValue;
5858
return Base::value();
5959
}

Source/WebCore/svg/properties/SVGPropertyTraits.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,4 @@ struct SVGPropertyTraits<String> {
152152
static String toString(const String& string) { return string; }
153153
};
154154

155-
template<typename EnumType>
156-
struct SVGIDLEnumLimits {
157-
// Specialize this function for a particular enumeration to limit the values that are exposed through the DOM.
158-
static unsigned highestExposedEnumValue() { return SVGPropertyTraits<EnumType>::highestEnumValue(); }
159-
};
160-
161155
} // namespace WebCore

0 commit comments

Comments
 (0)