[CSS Blending] Remove support for non-separable blend modes from mix-blend-mode
authorcabanier@adobe.com <cabanier@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Apr 2014 20:44:01 +0000 (20:44 +0000)
committercabanier@adobe.com <cabanier@adobe.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 21 Apr 2014 20:44:01 +0000 (20:44 +0000)
https://bugs.webkit.org/show_bug.cgi?id=131824

Reviewed by Dean Jackson.

Source/WebCore:
Removed support for non-separable blend modes from the CSS parser.

Covered by existing tests

* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
* platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
(PlatformCAFilters::setBlendingFiltersOnLayer):

LayoutTests:
Removed or updated tests that used non-separable blend modes in combination
with mix-blend-mode.

* css3/compositing/blend-mode-property-expected.txt:
* css3/compositing/blend-mode-property-parsing-expected.txt:
* css3/compositing/blend-mode-simple-composited.html:
* css3/compositing/blend-mode-simple.html:
* css3/compositing/script-tests/blend-mode-property-parsing.js:
* css3/compositing/script-tests/blend-mode-property.js:
* css3/compositing/svg-blend-color.html: Removed.
* css3/compositing/svg-blend-hue.html: Removed.
* css3/compositing/svg-blend-luminosity.html: Removed.
* css3/compositing/svg-blend-saturation.html: Removed.
* platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt:
* platform/mac/css3/compositing/blend-mode-simple-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@167620 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
LayoutTests/ChangeLog
LayoutTests/css3/compositing/blend-mode-property-expected.txt
LayoutTests/css3/compositing/blend-mode-property-parsing-expected.txt
LayoutTests/css3/compositing/blend-mode-simple-composited.html
LayoutTests/css3/compositing/blend-mode-simple.html
LayoutTests/css3/compositing/script-tests/blend-mode-property-parsing.js
LayoutTests/css3/compositing/script-tests/blend-mode-property.js
LayoutTests/css3/compositing/svg-blend-color.html [deleted file]
LayoutTests/css3/compositing/svg-blend-hue.html [deleted file]
LayoutTests/css3/compositing/svg-blend-luminosity.html [deleted file]
LayoutTests/css3/compositing/svg-blend-saturation.html [deleted file]
LayoutTests/platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt
LayoutTests/platform/mac/css3/compositing/blend-mode-simple-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/css/CSSParser.cpp
Source/WebCore/platform/graphics/ca/mac/PlatformCAFiltersMac.mm

index a6ecb71..1834d7c 100644 (file)
@@ -1,3 +1,26 @@
+2014-04-21  Rik Cabanier  <cabanier@adobe.com>
+
+        [CSS Blending] Remove support for non-separable blend modes from mix-blend-mode
+        https://bugs.webkit.org/show_bug.cgi?id=131824
+
+        Reviewed by Dean Jackson.
+
+        Removed or updated tests that used non-separable blend modes in combination
+        with mix-blend-mode.
+
+        * css3/compositing/blend-mode-property-expected.txt:
+        * css3/compositing/blend-mode-property-parsing-expected.txt:
+        * css3/compositing/blend-mode-simple-composited.html:
+        * css3/compositing/blend-mode-simple.html:
+        * css3/compositing/script-tests/blend-mode-property-parsing.js:
+        * css3/compositing/script-tests/blend-mode-property.js:
+        * css3/compositing/svg-blend-color.html: Removed.
+        * css3/compositing/svg-blend-hue.html: Removed.
+        * css3/compositing/svg-blend-luminosity.html: Removed.
+        * css3/compositing/svg-blend-saturation.html: Removed.
+        * platform/mac/css3/compositing/blend-mode-simple-composited-expected.txt:
+        * platform/mac/css3/compositing/blend-mode-simple-expected.txt:
+
 2014-04-21  David Hyatt  <hyatt@apple.com>
 
         [New Multicolumn] vertical-rl/unsplittable-inline-block misrenders the column rule.
index eae424e..a438736 100644 (file)
@@ -39,18 +39,6 @@ PASS declaration.getPropertyValue('mix-blend-mode') is 'difference'
 PASS cssRule.type is 1
 PASS declaration.length is 1
 PASS declaration.getPropertyValue('mix-blend-mode') is 'exclusion'
-PASS cssRule.type is 1
-PASS declaration.length is 1
-PASS declaration.getPropertyValue('mix-blend-mode') is 'hue'
-PASS cssRule.type is 1
-PASS declaration.length is 1
-PASS declaration.getPropertyValue('mix-blend-mode') is 'saturation'
-PASS cssRule.type is 1
-PASS declaration.length is 1
-PASS declaration.getPropertyValue('mix-blend-mode') is 'color'
-PASS cssRule.type is 1
-PASS declaration.length is 1
-PASS declaration.getPropertyValue('mix-blend-mode') is 'luminosity'
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 7c63547..6d87c11 100644 (file)
@@ -99,38 +99,6 @@ PASS declaration.getPropertyValue('mix-blend-mode') is 'exclusion'
 PASS jsWrapperClass(blendModeRule) is 'CSSPrimitiveValue'
 PASS jsWrapperClass(blendModeRule.__proto__) is 'CSSPrimitiveValuePrototype'
 PASS jsWrapperClass(blendModeRule.constructor) is 'CSSPrimitiveValueConstructor'
-
-Basic reference : hue
-PASS cssRule.type is 1
-PASS declaration.length is 1
-PASS declaration.getPropertyValue('mix-blend-mode') is 'hue'
-PASS jsWrapperClass(blendModeRule) is 'CSSPrimitiveValue'
-PASS jsWrapperClass(blendModeRule.__proto__) is 'CSSPrimitiveValuePrototype'
-PASS jsWrapperClass(blendModeRule.constructor) is 'CSSPrimitiveValueConstructor'
-
-Basic reference : saturation
-PASS cssRule.type is 1
-PASS declaration.length is 1
-PASS declaration.getPropertyValue('mix-blend-mode') is 'saturation'
-PASS jsWrapperClass(blendModeRule) is 'CSSPrimitiveValue'
-PASS jsWrapperClass(blendModeRule.__proto__) is 'CSSPrimitiveValuePrototype'
-PASS jsWrapperClass(blendModeRule.constructor) is 'CSSPrimitiveValueConstructor'
-
-Basic reference : color
-PASS cssRule.type is 1
-PASS declaration.length is 1
-PASS declaration.getPropertyValue('mix-blend-mode') is 'color'
-PASS jsWrapperClass(blendModeRule) is 'CSSPrimitiveValue'
-PASS jsWrapperClass(blendModeRule.__proto__) is 'CSSPrimitiveValuePrototype'
-PASS jsWrapperClass(blendModeRule.constructor) is 'CSSPrimitiveValueConstructor'
-
-Basic reference : luminosity
-PASS cssRule.type is 1
-PASS declaration.length is 1
-PASS declaration.getPropertyValue('mix-blend-mode') is 'luminosity'
-PASS jsWrapperClass(blendModeRule) is 'CSSPrimitiveValue'
-PASS jsWrapperClass(blendModeRule.__proto__) is 'CSSPrimitiveValuePrototype'
-PASS jsWrapperClass(blendModeRule.constructor) is 'CSSPrimitiveValueConstructor'
 PASS successfullyParsed is true
 
 TEST COMPLETE
index ada116c..0984365 100644 (file)
         <li><img style="mix-blend-mode: soft-light" src="resources/ducky.png"></li>
         <li><img style="mix-blend-mode: difference" src="resources/ducky.png"></li>
         <li><img style="mix-blend-mode: exclusion" src="resources/ducky.png"></li>
-        <!-- Non separable blend modes -->
-        <li><img style="mix-blend-mode: hue" src="resources/ducky.png"></li>
-        <li><img style="mix-blend-mode: saturation" src="resources/ducky.png"></li>
-        <li><img style="mix-blend-mode: color" src="resources/ducky.png"></li>
-        <li><img style="mix-blend-mode: luminosity" src="resources/ducky.png"></li>
     </ul>
 </body>
index e33d3d5..0175b91 100644 (file)
         <li><img style="mix-blend-mode: soft-light" src="resources/ducky.png"></li>
         <li><img style="mix-blend-mode: difference" src="resources/ducky.png"></li>
         <li><img style="mix-blend-mode: exclusion" src="resources/ducky.png"></li>
-        <!-- Non separable blend modes -->
-        <li><img style="mix-blend-mode: hue" src="resources/ducky.png"></li>
-        <li><img style="mix-blend-mode: saturation" src="resources/ducky.png"></li>
-        <li><img style="mix-blend-mode: color" src="resources/ducky.png"></li>
-        <li><img style="mix-blend-mode: luminosity" src="resources/ducky.png"></li>
     </ul>
 </body>
index 29a1da4..e716670 100644 (file)
@@ -43,7 +43,7 @@ function testBlendModeRule(description, rule, expectedLength, expectedValue, exp
     shouldBeType("blendModeRule", "CSSPrimitiveValue");
 }
 
-var blendmodes = ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
+var blendmodes = ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion"];
 
 for(x in blendmodes)
    testBlendModeRule("Basic reference", blendmodes[x], 1, blendmodes[x]);
index 5ac0d92..8842fa0 100644 (file)
@@ -20,7 +20,7 @@ shouldBe("declaration.length", "1");
 shouldBe("declaration.getPropertyValue('mix-blend-mode')", "\'" + blendmode + "\'");
 }
 
-var blendmodes = ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion", "hue", "saturation", "color", "luminosity"];
+var blendmodes = ["normal", "multiply", "screen", "overlay", "darken", "lighten", "color-dodge", "color-burn", "hard-light", "soft-light", "difference", "exclusion"];
 
 for(x in blendmodes)
    testblendmode(blendmodes[x]);
diff --git a/LayoutTests/css3/compositing/svg-blend-color.html b/LayoutTests/css3/compositing/svg-blend-color.html
deleted file mode 100644 (file)
index 5ca26f8..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<body>
-<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400px" height="400px" >
-<defs>
-  <g id="patch">
-    <rect x="0" y="0" width="10" height="40" fill="rgb(255,0,0)"/>
-    <rect x="10" y="0" width="10" height="40" fill="rgb(0,255,0)"/>
-    <rect x="20" y="0" width="10" height="40" fill="rgb(0,0,255)"/>
-    <rect x="30" y="0" width="10" height="40" fill="rgb(127,127,0)"/>
-  </g>
-  <rect x="0" y="0" width="10" height="10" fill="rgb(255,0,0)"/>
-</defs>
-<g transform="scale(4 4)">
-  <use xlink:href="#patch" x="0" y="0" width="40" height="10"></use>
-  <use xlink:href="#patch" x="0" y="0" width="40" height="10" transform="rotate(90 20 20)" style="mix-blend-mode: color"></use>
-</g>
-</svg>
-</body>
-</html>
diff --git a/LayoutTests/css3/compositing/svg-blend-hue.html b/LayoutTests/css3/compositing/svg-blend-hue.html
deleted file mode 100644 (file)
index 3c01bc2..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<body>
-<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400px" height="400px" >
-<defs>
-  <g id="patch">
-    <rect x="0" y="0" width="10" height="40" fill="rgb(255,0,0)"/>
-    <rect x="10" y="0" width="10" height="40" fill="rgb(0,255,0)"/>
-    <rect x="20" y="0" width="10" height="40" fill="rgb(0,0,255)"/>
-    <rect x="30" y="0" width="10" height="40" fill="rgb(127,127,0)"/>
-  </g>
-  <rect x="0" y="0" width="10" height="10" fill="rgb(255,0,0)"/>
-</defs>
-<g transform="scale(4 4)">
-  <use xlink:href="#patch" x="0" y="0" width="40" height="10"></use>
-  <use xlink:href="#patch" x="0" y="0" width="40" height="10" transform="rotate(90 20 20)" style="mix-blend-mode: hue"></use>
-</g>
-</svg>
-</body>
-</html>
diff --git a/LayoutTests/css3/compositing/svg-blend-luminosity.html b/LayoutTests/css3/compositing/svg-blend-luminosity.html
deleted file mode 100644 (file)
index 76599a6..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<body>
-<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400px" height="400px" >
-<defs>
-  <g id="patch">
-    <rect x="0" y="0" width="10" height="40" fill="rgb(255,0,0)"/>
-    <rect x="10" y="0" width="10" height="40" fill="rgb(0,255,0)"/>
-    <rect x="20" y="0" width="10" height="40" fill="rgb(0,0,255)"/>
-    <rect x="30" y="0" width="10" height="40" fill="rgb(127,127,0)"/>
-  </g>
-  <rect x="0" y="0" width="10" height="10" fill="rgb(255,0,0)"/>
-</defs>
-<g transform="scale(4 4)">
-  <use xlink:href="#patch" x="0" y="0" width="40" height="10"></use>
-  <use xlink:href="#patch" x="0" y="0" width="40" height="10" transform="rotate(90 20 20)" style="mix-blend-mode: luminosity"></use>
-</g>
-</svg>
-</body>
-</html>
diff --git a/LayoutTests/css3/compositing/svg-blend-saturation.html b/LayoutTests/css3/compositing/svg-blend-saturation.html
deleted file mode 100644 (file)
index 764e32b..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-<!DOCTYPE HTML>
-<html>
-<body>
-<svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="400px" height="400px" >
-<defs>
-  <g id="patch">
-    <rect x="0" y="0" width="10" height="40" fill="rgb(255,0,0)"/>
-    <rect x="10" y="0" width="10" height="40" fill="rgb(0,255,0)"/>
-    <rect x="20" y="0" width="10" height="40" fill="rgb(0,0,255)"/>
-    <rect x="30" y="0" width="10" height="40" fill="rgb(127,127,0)"/>
-  </g>
-  <rect x="0" y="0" width="10" height="10" fill="rgb(255,0,0)"/>
-</defs>
-<g transform="scale(4 4)">
-  <use xlink:href="#patch" x="0" y="0" width="40" height="10"></use>
-  <use xlink:href="#patch" x="0" y="0" width="40" height="10" transform="rotate(90 20 20)" style="mix-blend-mode: saturation"></use>
-</g>
-</svg>
-</body>
-</html>
index 3aab18d..84dd94c 100644 (file)
@@ -1,7 +1,7 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
-layer at (0,0) size 800x576 isolatesBlending
-  RenderBlock {HTML} at (0,0) size 800x576
+layer at (0,0) size 800x436 isolatesBlending
+  RenderBlock {HTML} at (0,0) size 800x436
     RenderBody {BODY} at (8,16) size 784x0
       RenderBlock {UL} at (0,0) size 784x0
         RenderBlock (floating) {LI} at (45,5) size 130x130
@@ -16,10 +16,6 @@ layer at (0,0) size 800x576 isolatesBlending
         RenderBlock (floating) {LI} at (605,145) size 130x130
         RenderBlock (floating) {LI} at (45,285) size 130x130
         RenderBlock (floating) {LI} at (185,285) size 130x130
-        RenderBlock (floating) {LI} at (325,285) size 130x130
-        RenderBlock (floating) {LI} at (465,285) size 130x130
-        RenderBlock (floating) {LI} at (605,285) size 130x130
-        RenderBlock (floating) {LI} at (45,425) size 130x130
 layer at (53,21) size 130x130
   RenderImage {IMG} at (0,0) size 130x130
 layer at (193,21) size 130x130 blendMode: overlay
@@ -44,11 +40,3 @@ layer at (53,301) size 130x130 blendMode: difference
   RenderImage {IMG} at (0,0) size 130x130
 layer at (193,301) size 130x130 blendMode: exclusion
   RenderImage {IMG} at (0,0) size 130x130
-layer at (333,301) size 130x130 blendMode: hue
-  RenderImage {IMG} at (0,0) size 130x130
-layer at (473,301) size 130x130 blendMode: saturation
-  RenderImage {IMG} at (0,0) size 130x130
-layer at (613,301) size 130x130 blendMode: color
-  RenderImage {IMG} at (0,0) size 130x130
-layer at (53,441) size 130x130 blendMode: luminosity
-  RenderImage {IMG} at (0,0) size 130x130
index af4b6e6..7f016a9 100644 (file)
@@ -1,7 +1,7 @@
 layer at (0,0) size 800x600
   RenderView at (0,0) size 800x600
-layer at (0,0) size 800x576 isolatesBlending
-  RenderBlock {HTML} at (0,0) size 800x576
+layer at (0,0) size 800x436 isolatesBlending
+  RenderBlock {HTML} at (0,0) size 800x436
     RenderBody {BODY} at (8,16) size 784x0
       RenderBlock {UL} at (0,0) size 784x0
         RenderBlock (floating) {LI} at (45,5) size 130x130
@@ -17,10 +17,6 @@ layer at (0,0) size 800x576 isolatesBlending
         RenderBlock (floating) {LI} at (605,145) size 130x130
         RenderBlock (floating) {LI} at (45,285) size 130x130
         RenderBlock (floating) {LI} at (185,285) size 130x130
-        RenderBlock (floating) {LI} at (325,285) size 130x130
-        RenderBlock (floating) {LI} at (465,285) size 130x130
-        RenderBlock (floating) {LI} at (605,285) size 130x130
-        RenderBlock (floating) {LI} at (45,425) size 130x130
 layer at (193,21) size 130x130 blendMode: overlay
   RenderImage {IMG} at (0,0) size 130x130
 layer at (333,21) size 130x130 blendMode: screen
@@ -43,11 +39,3 @@ layer at (53,301) size 130x130 blendMode: difference
   RenderImage {IMG} at (0,0) size 130x130
 layer at (193,301) size 130x130 blendMode: exclusion
   RenderImage {IMG} at (0,0) size 130x130
-layer at (333,301) size 130x130 blendMode: hue
-  RenderImage {IMG} at (0,0) size 130x130
-layer at (473,301) size 130x130 blendMode: saturation
-  RenderImage {IMG} at (0,0) size 130x130
-layer at (613,301) size 130x130 blendMode: color
-  RenderImage {IMG} at (0,0) size 130x130
-layer at (53,441) size 130x130 blendMode: luminosity
-  RenderImage {IMG} at (0,0) size 130x130
index 1304e21..79f6999 100644 (file)
@@ -1,3 +1,19 @@
+2014-04-21  Rik Cabanier  <cabanier@adobe.com>
+
+        [CSS Blending] Remove support for non-separable blend modes from mix-blend-mode
+        https://bugs.webkit.org/show_bug.cgi?id=131824
+
+        Reviewed by Dean Jackson.
+
+        Removed support for non-separable blend modes from the CSS parser.
+
+        Covered by existing tests
+
+        * css/CSSParser.cpp:
+        (WebCore::isValidKeywordPropertyAndValue):
+        * platform/graphics/ca/mac/PlatformCAFiltersMac.mm:
+        (PlatformCAFilters::setBlendingFiltersOnLayer):
+
 2014-04-21  David Hyatt  <hyatt@apple.com>
 
         [New Multicolumn] Column set drawing under horizontal scrollbar.
index 6f56bfb..e20493b 100644 (file)
@@ -816,8 +816,7 @@ static inline bool isValidKeywordPropertyAndValue(CSSPropertyID propertyId, int
         if (parserContext.isCSSCompositingEnabled && (valueID == CSSValueNormal || valueID == CSSValueMultiply || valueID == CSSValueScreen
             || valueID == CSSValueOverlay || valueID == CSSValueDarken || valueID == CSSValueLighten ||  valueID == CSSValueColorDodge
             || valueID == CSSValueColorBurn || valueID == CSSValueHardLight || valueID == CSSValueSoftLight || valueID == CSSValueDifference
-            || valueID == CSSValueExclusion || valueID == CSSValueHue || valueID == CSSValueSaturation || valueID == CSSValueColor
-            || valueID == CSSValueLuminosity))
+            || valueID == CSSValueExclusion))
             return true;
         break;
     case CSSPropertyIsolation:
index 72da50a..61a9230 100644 (file)
@@ -581,12 +581,8 @@ void PlatformCAFilters::setBlendingFiltersOnLayer(PlatformLayer* layer, const Bl
         case BlendModeScreen:
             filter = [CAFilter filterWithType:kCAFilterScreenBlendMode];
             break;
-        case BlendModeHue:
-        case BlendModeSaturation:
-        case BlendModeColor:
-        case BlendModeLuminosity:
-            // Non-separable blend modes are not supported.
-            break;
+        default:
+            ASSERT_NOT_REACHED();
     }
 
     [layer setCompositingFilter:filter];