Diff
Modified: trunk/LayoutTests/ChangeLog (231798 => 231799)
--- trunk/LayoutTests/ChangeLog 2018-05-15 11:01:46 UTC (rev 231798)
+++ trunk/LayoutTests/ChangeLog 2018-05-15 13:49:06 UTC (rev 231799)
@@ -1,3 +1,21 @@
+2018-05-15 Dirk Schulze <k...@webkit.org>
+
+ Add new SVGDOM SVGFEBLEND constants
+ https://bugs.webkit.org/show_bug.cgi?id=185581
+
+ Reviewed by Simon Fraser.
+
+ Provide new SVG DOM constants for the new blend modes added to feBlend.
+
+ https://drafts.fxtf.org/filter-effects-1/#InterfaceSVGFEBlendElement
+
+ * svg/custom/js-svg-constructors-expected.txt:
+ * svg/custom/js-svg-constructors.svg:
+ * svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement-expected.txt:
+ * svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement.html:
+ * svg/dom/SVGAnimatedEnumeration-case-sensitive-expected.txt:
+ * svg/dom/SVGAnimatedEnumeration-case-sensitive.html:
+
2018-05-15 Antoine Quint <grao...@apple.com>
[Web Animations] Expose Web Animations CSS integration as an experimental feature
Modified: trunk/LayoutTests/svg/custom/js-svg-constructors-expected.txt (231798 => 231799)
--- trunk/LayoutTests/svg/custom/js-svg-constructors-expected.txt 2018-05-15 11:01:46 UTC (rev 231798)
+++ trunk/LayoutTests/svg/custom/js-svg-constructors-expected.txt 2018-05-15 13:49:06 UTC (rev 231799)
@@ -16,6 +16,17 @@
SVGFEBlendElement.SVG_FEBLEND_MODE_SCREEN PASSED
SVGFEBlendElement.SVG_FEBLEND_MODE_DARKEN PASSED
SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN PASSED
+SVGFEBlendElement.SVG_FEBLEND_MODE_OVERLAY PASSED
+SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_DODGE PASSED
+SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_BURN PASSED
+SVGFEBlendElement.SVG_FEBLEND_MODE_HARD_LIGHT PASSED
+SVGFEBlendElement.SVG_FEBLEND_MODE_SOFT_LIGHT PASSED
+SVGFEBlendElement.SVG_FEBLEND_MODE_DIFFERENCE PASSED
+SVGFEBlendElement.SVG_FEBLEND_MODE_EXCLUSION PASSED
+SVGFEBlendElement.SVG_FEBLEND_MODE_HUE PASSED
+SVGFEBlendElement.SVG_FEBLEND_MODE_SATURATION PASSED
+SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR PASSED
+SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY PASSED
SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_UNKNOWN PASSED
SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_MATRIX PASSED
SVGFEColorMatrixElement.SVG_FECOLORMATRIX_TYPE_SATURATE PASSED
Modified: trunk/LayoutTests/svg/custom/js-svg-constructors.svg (231798 => 231799)
--- trunk/LayoutTests/svg/custom/js-svg-constructors.svg 2018-05-15 11:01:46 UTC (rev 231798)
+++ trunk/LayoutTests/svg/custom/js-svg-constructors.svg 2018-05-15 13:49:06 UTC (rev 231799)
@@ -48,6 +48,17 @@
expect("SVGFEBlendElement.SVG_FEBLEND_MODE_SCREEN", 3);
expect("SVGFEBlendElement.SVG_FEBLEND_MODE_DARKEN", 4);
expect("SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN", 5);
+ expect("SVGFEBlendElement.SVG_FEBLEND_MODE_OVERLAY", 6);
+ expect("SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_DODGE", 7);
+ expect("SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_BURN", 8);
+ expect("SVGFEBlendElement.SVG_FEBLEND_MODE_HARD_LIGHT", 9);
+ expect("SVGFEBlendElement.SVG_FEBLEND_MODE_SOFT_LIGHT", 10);
+ expect("SVGFEBlendElement.SVG_FEBLEND_MODE_DIFFERENCE", 11);
+ expect("SVGFEBlendElement.SVG_FEBLEND_MODE_EXCLUSION", 12);
+ expect("SVGFEBlendElement.SVG_FEBLEND_MODE_HUE", 13);
+ expect("SVGFEBlendElement.SVG_FEBLEND_MODE_SATURATION", 14);
+ expect("SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR", 15);
+ expect("SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY", 16);
}
if (window.SVGFEColorMatrixElement) {
Modified: trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement-expected.txt (231798 => 231799)
--- trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement-expected.txt 2018-05-15 11:01:46 UTC (rev 231798)
+++ trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement-expected.txt 2018-05-15 13:49:06 UTC (rev 231799)
@@ -29,16 +29,71 @@
PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN
PASS feBlendElement.getAttribute('mode') is "lighten"
+Switch to 'overlay'
+PASS feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_OVERLAY is SVGFEBlendElement.SVG_FEBLEND_MODE_OVERLAY
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_OVERLAY
+PASS feBlendElement.getAttribute('mode') is "overlay"
+
+Switch to 'color-dodge'
+PASS feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_DODGE is SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_DODGE
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_DODGE
+PASS feBlendElement.getAttribute('mode') is "color-dodge"
+
+Switch to 'color-burn'
+PASS feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_BURN is SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_BURN
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_BURN
+PASS feBlendElement.getAttribute('mode') is "color-burn"
+
+Switch to 'hard-light'
+PASS feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_HARD_LIGHT is SVGFEBlendElement.SVG_FEBLEND_MODE_HARD_LIGHT
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_HARD_LIGHT
+PASS feBlendElement.getAttribute('mode') is "hard-light"
+
+Switch to 'soft-light'
+PASS feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_SOFT_LIGHT is SVGFEBlendElement.SVG_FEBLEND_MODE_SOFT_LIGHT
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_SOFT_LIGHT
+PASS feBlendElement.getAttribute('mode') is "soft-light"
+
+Switch to 'difference'
+PASS feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_DIFFERENCE is SVGFEBlendElement.SVG_FEBLEND_MODE_DIFFERENCE
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_DIFFERENCE
+PASS feBlendElement.getAttribute('mode') is "difference"
+
+Switch to 'exclusion'
+PASS feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_EXCLUSION is SVGFEBlendElement.SVG_FEBLEND_MODE_EXCLUSION
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_EXCLUSION
+PASS feBlendElement.getAttribute('mode') is "exclusion"
+
+Switch to 'hue'
+PASS feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_HUE is SVGFEBlendElement.SVG_FEBLEND_MODE_HUE
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_HUE
+PASS feBlendElement.getAttribute('mode') is "hue"
+
+Switch to 'saturation'
+PASS feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_SATURATION is SVGFEBlendElement.SVG_FEBLEND_MODE_SATURATION
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_SATURATION
+PASS feBlendElement.getAttribute('mode') is "saturation"
+
+Switch to 'color'
+PASS feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR is SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR
+PASS feBlendElement.getAttribute('mode') is "color"
+
+Switch to 'luminosity'
+PASS feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY is SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY
+PASS feBlendElement.getAttribute('mode') is "luminosity"
+
Try setting invalid values
-PASS feBlendElement.mode.baseVal = 6 threw exception TypeError: Type error.
-PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN
-PASS feBlendElement.getAttribute('mode') is "lighten"
+PASS feBlendElement.mode.baseVal = 17 threw exception TypeError: Type error.
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY
+PASS feBlendElement.getAttribute('mode') is "luminosity"
PASS feBlendElement.mode.baseVal = -1 threw exception TypeError: Type error.
-PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN
-PASS feBlendElement.getAttribute('mode') is "lighten"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY
+PASS feBlendElement.getAttribute('mode') is "luminosity"
PASS feBlendElement.mode.baseVal = 0 threw exception TypeError: Type error.
-PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN
-PASS feBlendElement.getAttribute('mode') is "lighten"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY
+PASS feBlendElement.getAttribute('mode') is "luminosity"
Switch to 'normal'
PASS feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_NORMAL is SVGFEBlendElement.SVG_FEBLEND_MODE_NORMAL
Modified: trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement.html (231798 => 231799)
--- trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement.html 2018-05-15 11:01:46 UTC (rev 231798)
+++ trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-SVGFEBlendElement.html 2018-05-15 13:49:06 UTC (rev 231799)
@@ -43,18 +43,84 @@
shouldBeEqualToString("feBlendElement.getAttribute('mode')", "lighten");
debug("");
+debug("Switch to 'overlay'");
+shouldBe("feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_OVERLAY", "SVGFEBlendElement.SVG_FEBLEND_MODE_OVERLAY");
+shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_OVERLAY");
+shouldBeEqualToString("feBlendElement.getAttribute('mode')", "overlay");
+
+debug("");
+debug("Switch to 'color-dodge'");
+shouldBe("feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_DODGE", "SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_DODGE");
+shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_DODGE");
+shouldBeEqualToString("feBlendElement.getAttribute('mode')", "color-dodge");
+
+debug("");
+debug("Switch to 'color-burn'");
+shouldBe("feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_BURN", "SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_BURN");
+shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_BURN");
+shouldBeEqualToString("feBlendElement.getAttribute('mode')", "color-burn");
+
+debug("");
+debug("Switch to 'hard-light'");
+shouldBe("feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_HARD_LIGHT", "SVGFEBlendElement.SVG_FEBLEND_MODE_HARD_LIGHT");
+shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_HARD_LIGHT");
+shouldBeEqualToString("feBlendElement.getAttribute('mode')", "hard-light");
+
+debug("");
+debug("Switch to 'soft-light'");
+shouldBe("feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_SOFT_LIGHT", "SVGFEBlendElement.SVG_FEBLEND_MODE_SOFT_LIGHT");
+shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_SOFT_LIGHT");
+shouldBeEqualToString("feBlendElement.getAttribute('mode')", "soft-light");
+
+debug("");
+debug("Switch to 'difference'");
+shouldBe("feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_DIFFERENCE", "SVGFEBlendElement.SVG_FEBLEND_MODE_DIFFERENCE");
+shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_DIFFERENCE");
+shouldBeEqualToString("feBlendElement.getAttribute('mode')", "difference");
+
+debug("");
+debug("Switch to 'exclusion'");
+shouldBe("feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_EXCLUSION", "SVGFEBlendElement.SVG_FEBLEND_MODE_EXCLUSION");
+shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_EXCLUSION");
+shouldBeEqualToString("feBlendElement.getAttribute('mode')", "exclusion");
+
+debug("");
+debug("Switch to 'hue'");
+shouldBe("feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_HUE", "SVGFEBlendElement.SVG_FEBLEND_MODE_HUE");
+shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_HUE");
+shouldBeEqualToString("feBlendElement.getAttribute('mode')", "hue");
+
+debug("");
+debug("Switch to 'saturation'");
+shouldBe("feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_SATURATION", "SVGFEBlendElement.SVG_FEBLEND_MODE_SATURATION");
+shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_SATURATION");
+shouldBeEqualToString("feBlendElement.getAttribute('mode')", "saturation");
+
+debug("");
+debug("Switch to 'color'");
+shouldBe("feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR", "SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR");
+shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR");
+shouldBeEqualToString("feBlendElement.getAttribute('mode')", "color");
+
+debug("");
+debug("Switch to 'luminosity'");
+shouldBe("feBlendElement.mode.baseVal = SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY", "SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY");
+shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY");
+shouldBeEqualToString("feBlendElement.getAttribute('mode')", "luminosity");
+
+debug("");
debug("Try setting invalid values");
-shouldThrow("feBlendElement.mode.baseVal = 6");
-shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN");
-shouldBeEqualToString("feBlendElement.getAttribute('mode')", "lighten");
+shouldThrow("feBlendElement.mode.baseVal = 17");
+shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY");
+shouldBeEqualToString("feBlendElement.getAttribute('mode')", "luminosity");
shouldThrow("feBlendElement.mode.baseVal = -1");
-shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN");
-shouldBeEqualToString("feBlendElement.getAttribute('mode')", "lighten");
+shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY");
+shouldBeEqualToString("feBlendElement.getAttribute('mode')", "luminosity");
shouldThrow("feBlendElement.mode.baseVal = 0");
-shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN");
-shouldBeEqualToString("feBlendElement.getAttribute('mode')", "lighten");
+shouldBe("feBlendElement.mode.baseVal", "SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY");
+shouldBeEqualToString("feBlendElement.getAttribute('mode')", "luminosity");
debug("");
debug("Switch to 'normal'");
Modified: trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-case-sensitive-expected.txt (231798 => 231799)
--- trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-case-sensitive-expected.txt 2018-05-15 11:01:46 UTC (rev 231798)
+++ trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-case-sensitive-expected.txt 2018-05-15 13:49:06 UTC (rev 231799)
@@ -78,6 +78,50 @@
PASS feBlendElement.getAttribute('mode') is "lighten"
PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN
+PASS feBlendElement.setAttribute('mode', 'overlay') is undefined.
+PASS feBlendElement.getAttribute('mode') is "overlay"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_OVERLAY
+
+PASS feBlendElement.setAttribute('mode', 'color-dodge') is undefined.
+PASS feBlendElement.getAttribute('mode') is "color-dodge"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_DODGE
+
+PASS feBlendElement.setAttribute('mode', 'color-burn') is undefined.
+PASS feBlendElement.getAttribute('mode') is "color-burn"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_BURN
+
+PASS feBlendElement.setAttribute('mode', 'hard-light') is undefined.
+PASS feBlendElement.getAttribute('mode') is "hard-light"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_HARD_LIGHT
+
+PASS feBlendElement.setAttribute('mode', 'soft-light') is undefined.
+PASS feBlendElement.getAttribute('mode') is "soft-light"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_SOFT_LIGHT
+
+PASS feBlendElement.setAttribute('mode', 'difference') is undefined.
+PASS feBlendElement.getAttribute('mode') is "difference"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_DIFFERENCE
+
+PASS feBlendElement.setAttribute('mode', 'exclusion') is undefined.
+PASS feBlendElement.getAttribute('mode') is "exclusion"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_EXCLUSION
+
+PASS feBlendElement.setAttribute('mode', 'hue') is undefined.
+PASS feBlendElement.getAttribute('mode') is "hue"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_HUE
+
+PASS feBlendElement.setAttribute('mode', 'saturation') is undefined.
+PASS feBlendElement.getAttribute('mode') is "saturation"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_SATURATION
+
+PASS feBlendElement.setAttribute('mode', 'color') is undefined.
+PASS feBlendElement.getAttribute('mode') is "color"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR
+
+PASS feBlendElement.setAttribute('mode', 'luminosity') is undefined.
+PASS feBlendElement.getAttribute('mode') is "luminosity"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY
+
Check invalid case feBlend 'mode'
feBlendElement.setAttribute('mode', 'multiply')
@@ -100,9 +144,64 @@
PASS feBlendElement.getAttribute('mode') is "DARKEN"
PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_LIGHTEN
-feBlendElement.setAttribute('mode', 'normal')
+feBlendElement.setAttribute('mode', 'overlay')
PASS feBlendElement.setAttribute('mode', 'LIGHTEN') is undefined.
PASS feBlendElement.getAttribute('mode') is "LIGHTEN"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_OVERLAY
+
+feBlendElement.setAttribute('mode', 'color-dodge')
+PASS feBlendElement.setAttribute('mode', 'OVERLAY') is undefined.
+PASS feBlendElement.getAttribute('mode') is "OVERLAY"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_DODGE
+
+feBlendElement.setAttribute('mode', 'color-burn')
+PASS feBlendElement.setAttribute('mode', 'COLOR-DODGE') is undefined.
+PASS feBlendElement.getAttribute('mode') is "COLOR-DODGE"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR_BURN
+
+feBlendElement.setAttribute('mode', 'hard-light')
+PASS feBlendElement.setAttribute('mode', 'COLOR-BURN') is undefined.
+PASS feBlendElement.getAttribute('mode') is "COLOR-BURN"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_HARD_LIGHT
+
+feBlendElement.setAttribute('mode', 'soft-light')
+PASS feBlendElement.setAttribute('mode', 'HARD-LIGHT') is undefined.
+PASS feBlendElement.getAttribute('mode') is "HARD-LIGHT"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_SOFT_LIGHT
+
+feBlendElement.setAttribute('mode', 'difference')
+PASS feBlendElement.setAttribute('mode', 'SOFT-LIGHT') is undefined.
+PASS feBlendElement.getAttribute('mode') is "SOFT-LIGHT"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_DIFFERENCE
+
+feBlendElement.setAttribute('mode', 'exclusion')
+PASS feBlendElement.setAttribute('mode', 'DIFFERENCE') is undefined.
+PASS feBlendElement.getAttribute('mode') is "DIFFERENCE"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_EXCLUSION
+
+feBlendElement.setAttribute('mode', 'hue')
+PASS feBlendElement.setAttribute('mode', 'EXCLUSION') is undefined.
+PASS feBlendElement.getAttribute('mode') is "EXCLUSION"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_HUE
+
+feBlendElement.setAttribute('mode', 'saturation')
+PASS feBlendElement.setAttribute('mode', 'HUE') is undefined.
+PASS feBlendElement.getAttribute('mode') is "HUE"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_SATURATION
+
+feBlendElement.setAttribute('mode', 'color')
+PASS feBlendElement.setAttribute('mode', 'SATURATION') is undefined.
+PASS feBlendElement.getAttribute('mode') is "SATURATION"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_COLOR
+
+feBlendElement.setAttribute('mode', 'luminosity')
+PASS feBlendElement.setAttribute('mode', 'COLOR') is undefined.
+PASS feBlendElement.getAttribute('mode') is "COLOR"
+PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_LUMINOSITY
+
+feBlendElement.setAttribute('mode', 'normal')
+PASS feBlendElement.setAttribute('mode', 'LUMINOSITY') is undefined.
+PASS feBlendElement.getAttribute('mode') is "LUMINOSITY"
PASS feBlendElement.mode.baseVal is SVGFEBlendElement.SVG_FEBLEND_MODE_NORMAL
Check valid feColorMatrix 'type'
Modified: trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-case-sensitive.html (231798 => 231799)
--- trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-case-sensitive.html 2018-05-15 11:01:46 UTC (rev 231798)
+++ trunk/LayoutTests/svg/dom/SVGAnimatedEnumeration-case-sensitive.html 2018-05-15 13:49:06 UTC (rev 231799)
@@ -26,7 +26,18 @@
{"id" : "multiply", "val" : "SVG_FEBLEND_MODE_MULTIPLY"},
{"id" : "screen", "val" : "SVG_FEBLEND_MODE_SCREEN"},
{"id" : "darken", "val" : "SVG_FEBLEND_MODE_DARKEN"},
- {"id" : "lighten", "val" : "SVG_FEBLEND_MODE_LIGHTEN"}
+ {"id" : "lighten", "val" : "SVG_FEBLEND_MODE_LIGHTEN"},
+ {"id" : "overlay", "val" : "SVG_FEBLEND_MODE_OVERLAY"},
+ {"id" : "color-dodge", "val" : "SVG_FEBLEND_MODE_COLOR_DODGE"},
+ {"id" : "color-burn", "val" : "SVG_FEBLEND_MODE_COLOR_BURN"},
+ {"id" : "hard-light", "val" : "SVG_FEBLEND_MODE_HARD_LIGHT"},
+ {"id" : "soft-light", "val" : "SVG_FEBLEND_MODE_SOFT_LIGHT"},
+ {"id" : "difference", "val" : "SVG_FEBLEND_MODE_DIFFERENCE"},
+ {"id" : "exclusion", "val" : "SVG_FEBLEND_MODE_EXCLUSION"},
+ {"id" : "hue", "val" : "SVG_FEBLEND_MODE_HUE"},
+ {"id" : "saturation", "val" : "SVG_FEBLEND_MODE_SATURATION"},
+ {"id" : "color", "val" : "SVG_FEBLEND_MODE_COLOR"},
+ {"id" : "luminosity", "val" : "SVG_FEBLEND_MODE_LUMINOSITY"}
]
},
"SVGFEColorMatrixElement" : {
Modified: trunk/Source/WebCore/ChangeLog (231798 => 231799)
--- trunk/Source/WebCore/ChangeLog 2018-05-15 11:01:46 UTC (rev 231798)
+++ trunk/Source/WebCore/ChangeLog 2018-05-15 13:49:06 UTC (rev 231799)
@@ -1,3 +1,22 @@
+2018-05-15 Dirk Schulze <k...@webkit.org>
+
+ Add new SVGDOM SVGFEBLEND constants
+ https://bugs.webkit.org/show_bug.cgi?id=185581
+
+ Reviewed by Simon Fraser.
+
+ Provide new SVG DOM constants for the new blend modes added to feBlend.
+
+ https://drafts.fxtf.org/filter-effects-1/#InterfaceSVGFEBlendElement
+
+ * platform/graphics/GraphicsTypes.cpp:
+ (WebCore::blendModeName):
+ * platform/graphics/GraphicsTypes.h:
+ * svg/SVGFEBlendElement.h:
+ (WebCore::SVGPropertyTraits<BlendMode>::highestEnumValue):
+ (WebCore::SVGPropertyTraits<BlendMode>::toString):
+ * svg/SVGFEBlendElement.idl:
+
2018-05-15 Antoine Quint <grao...@apple.com>
[Web Animations] Expose Web Animations CSS integration as an experimental feature
Modified: trunk/Source/WebCore/platform/graphics/GraphicsTypes.cpp (231798 => 231799)
--- trunk/Source/WebCore/platform/graphics/GraphicsTypes.cpp 2018-05-15 11:01:46 UTC (rev 231798)
+++ trunk/Source/WebCore/platform/graphics/GraphicsTypes.cpp 2018-05-15 13:49:06 UTC (rev 231799)
@@ -118,7 +118,7 @@
return compositeOperatorNames[op];
}
-static String blendModeName(BlendMode blendOp)
+String blendModeName(BlendMode blendOp)
{
ASSERT(blendOp >= BlendModeNormal);
ASSERT(blendOp <= BlendModePlusLighter);
Modified: trunk/Source/WebCore/platform/graphics/GraphicsTypes.h (231798 => 231799)
--- trunk/Source/WebCore/platform/graphics/GraphicsTypes.h 2018-05-15 11:01:46 UTC (rev 231798)
+++ trunk/Source/WebCore/platform/graphics/GraphicsTypes.h 2018-05-15 13:49:06 UTC (rev 231799)
@@ -108,6 +108,7 @@
};
String compositeOperatorName(CompositeOperator, BlendMode);
+String blendModeName(BlendMode);
bool parseBlendMode(const String&, BlendMode&);
bool parseCompositeAndBlendOperator(const String&, CompositeOperator&, BlendMode&);
Modified: trunk/Source/WebCore/svg/SVGFEBlendElement.h (231798 => 231799)
--- trunk/Source/WebCore/svg/SVGFEBlendElement.h 2018-05-15 11:01:46 UTC (rev 231798)
+++ trunk/Source/WebCore/svg/SVGFEBlendElement.h 2018-05-15 13:49:06 UTC (rev 231799)
@@ -21,6 +21,7 @@
#pragma once
+#include "GraphicsTypes.h"
#include "SVGAnimatedEnumeration.h"
#include "SVGFilterPrimitiveStandardAttributes.h"
@@ -28,24 +29,14 @@
template<>
struct SVGPropertyTraits<BlendMode> {
- static unsigned highestEnumValue() { return BlendModeLighten; }
+ static unsigned highestEnumValue() { return BlendModeLuminosity; }
static String toString(BlendMode type)
{
- switch (type) {
- case BlendModeNormal:
- return ASCIILiteral("normal");
- case BlendModeMultiply:
- return ASCIILiteral("multiply");
- case BlendModeScreen:
- return ASCIILiteral("screen");
- case BlendModeDarken:
- return ASCIILiteral("darken");
- case BlendModeLighten:
- return ASCIILiteral("lighten");
- default:
- return emptyString();
- }
+ if (type < BlendModePlusDarker)
+ return blendModeName(type);
+
+ return emptyString();
}
};
Modified: trunk/Source/WebCore/svg/SVGFEBlendElement.idl (231798 => 231799)
--- trunk/Source/WebCore/svg/SVGFEBlendElement.idl 2018-05-15 11:01:46 UTC (rev 231798)
+++ trunk/Source/WebCore/svg/SVGFEBlendElement.idl 2018-05-15 13:49:06 UTC (rev 231799)
@@ -27,15 +27,26 @@
DoNotCheckConstants
] interface SVGFEBlendElement : SVGElement {
// Blend Mode Types
- const unsigned short SVG_FEBLEND_MODE_UNKNOWN = 0;
- const unsigned short SVG_FEBLEND_MODE_NORMAL = 1;
+ const unsigned short SVG_FEBLEND_MODE_UNKNOWN = 0;
+ const unsigned short SVG_FEBLEND_MODE_NORMAL = 1;
const unsigned short SVG_FEBLEND_MODE_MULTIPLY = 2;
- const unsigned short SVG_FEBLEND_MODE_SCREEN = 3;
- const unsigned short SVG_FEBLEND_MODE_DARKEN = 4;
- const unsigned short SVG_FEBLEND_MODE_LIGHTEN = 5;
+ const unsigned short SVG_FEBLEND_MODE_SCREEN = 3;
+ const unsigned short SVG_FEBLEND_MODE_DARKEN = 4;
+ const unsigned short SVG_FEBLEND_MODE_LIGHTEN = 5;
+ const unsigned short SVG_FEBLEND_MODE_OVERLAY = 6;
+ const unsigned short SVG_FEBLEND_MODE_COLOR_DODGE = 7;
+ const unsigned short SVG_FEBLEND_MODE_COLOR_BURN = 8;
+ const unsigned short SVG_FEBLEND_MODE_HARD_LIGHT = 9;
+ const unsigned short SVG_FEBLEND_MODE_SOFT_LIGHT = 10;
+ const unsigned short SVG_FEBLEND_MODE_DIFFERENCE = 11;
+ const unsigned short SVG_FEBLEND_MODE_EXCLUSION = 12;
+ const unsigned short SVG_FEBLEND_MODE_HUE = 13;
+ const unsigned short SVG_FEBLEND_MODE_SATURATION = 14;
+ const unsigned short SVG_FEBLEND_MODE_COLOR = 15;
+ const unsigned short SVG_FEBLEND_MODE_LUMINOSITY = 16;
- readonly attribute SVGAnimatedString in1;
- readonly attribute SVGAnimatedString in2;
+ readonly attribute SVGAnimatedString in1;
+ readonly attribute SVGAnimatedString in2;
readonly attribute SVGAnimatedEnumeration mode;
};