Title: [203510] trunk
Revision
203510
Author
[email protected]
Date
2016-07-21 10:20:44 -0700 (Thu, 21 Jul 2016)

Log Message

Drop [TreatNullAs=EmptyString] from CanvasRenderingContext2D.globalCompositeOperation
https://bugs.webkit.org/show_bug.cgi?id=160026

Reviewed by Sam Weinig.

Source/WebCore:

Drop [TreatNullAs=EmptyString] from CanvasRenderingContext2D.globalCompositeOperation
attribute as it does not match the specification:
- https://html.spec.whatwg.org/multipage/scripting.html#canvascompositing

It does not change web-exposed behavior because assigning to "" or "null"
gets ignored as those are not valid operations.

Test: fast/canvas/context-globalCompositeOperation-null.html

* html/canvas/CanvasRenderingContext2D.idl:

LayoutTests:

Add test coverage.

* fast/canvas/context-globalCompositeOperation-null-expected.txt: Added.
* fast/canvas/context-globalCompositeOperation-null.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (203509 => 203510)


--- trunk/LayoutTests/ChangeLog	2016-07-21 17:12:41 UTC (rev 203509)
+++ trunk/LayoutTests/ChangeLog	2016-07-21 17:20:44 UTC (rev 203510)
@@ -1,3 +1,15 @@
+2016-07-21  Chris Dumez  <[email protected]>
+
+        Drop [TreatNullAs=EmptyString] from CanvasRenderingContext2D.globalCompositeOperation
+        https://bugs.webkit.org/show_bug.cgi?id=160026
+
+        Reviewed by Sam Weinig.
+
+        Add test coverage.
+
+        * fast/canvas/context-globalCompositeOperation-null-expected.txt: Added.
+        * fast/canvas/context-globalCompositeOperation-null.html: Added.
+
 2016-07-21  Carlos Alberto Lopez Perez  <[email protected]>
 
         [GTK] Gardening: Layout tests expectations updates and test rebaselines.

Added: trunk/LayoutTests/fast/canvas/context-globalCompositeOperation-null-expected.txt (0 => 203510)


--- trunk/LayoutTests/fast/canvas/context-globalCompositeOperation-null-expected.txt	                        (rev 0)
+++ trunk/LayoutTests/fast/canvas/context-globalCompositeOperation-null-expected.txt	2016-07-21 17:20:44 UTC (rev 203510)
@@ -0,0 +1,16 @@
+Test the behavior when assigning null to context.globalCompositeOperation
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS context.globalCompositeOperation is "source-over"
+PASS context.globalCompositeOperation = 'copy' did not throw exception.
+PASS context.globalCompositeOperation is "copy"
+PASS context.globalCompositeOperation = null did not throw exception.
+PASS context.globalCompositeOperation is "copy"
+PASS context.globalCompositeOperation = '' did not throw exception.
+PASS context.globalCompositeOperation is "copy"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+

Added: trunk/LayoutTests/fast/canvas/context-globalCompositeOperation-null.html (0 => 203510)


--- trunk/LayoutTests/fast/canvas/context-globalCompositeOperation-null.html	                        (rev 0)
+++ trunk/LayoutTests/fast/canvas/context-globalCompositeOperation-null.html	2016-07-21 17:20:44 UTC (rev 203510)
@@ -0,0 +1,29 @@
+<!DOCTYPE html>
+<html>
+<body>
+<script src=""
+<script>
+description("Test the behavior when assigning null to context.globalCompositeOperation");
+
+var canvas = document.createElement("canvas");
+canvas.width = 200;
+canvas.height = 200;
+var context = canvas.getContext("2d");
+// Initial operation should be "source-over".
+shouldBeEqualToString("context.globalCompositeOperation", "source-over");
+
+// Setting to 'copy' should work as this is a valid operation.
+shouldNotThrow("context.globalCompositeOperation = 'copy'");
+shouldBeEqualToString("context.globalCompositeOperation", "copy");
+
+// Assignment to null should be ignored because "null" is not a valid operation.
+shouldNotThrow("context.globalCompositeOperation = null");
+shouldBeEqualToString("context.globalCompositeOperation", "copy");
+
+// Assignment to "" should be ignored because "" is not a valid operation.
+shouldNotThrow("context.globalCompositeOperation = ''");
+shouldBeEqualToString("context.globalCompositeOperation", "copy");
+</script>
+<script src=""
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (203509 => 203510)


--- trunk/Source/WebCore/ChangeLog	2016-07-21 17:12:41 UTC (rev 203509)
+++ trunk/Source/WebCore/ChangeLog	2016-07-21 17:20:44 UTC (rev 203510)
@@ -1,3 +1,21 @@
+2016-07-21  Chris Dumez  <[email protected]>
+
+        Drop [TreatNullAs=EmptyString] from CanvasRenderingContext2D.globalCompositeOperation
+        https://bugs.webkit.org/show_bug.cgi?id=160026
+
+        Reviewed by Sam Weinig.
+
+        Drop [TreatNullAs=EmptyString] from CanvasRenderingContext2D.globalCompositeOperation
+        attribute as it does not match the specification:
+        - https://html.spec.whatwg.org/multipage/scripting.html#canvascompositing
+
+        It does not change web-exposed behavior because assigning to "" or "null"
+        gets ignored as those are not valid operations.
+
+        Test: fast/canvas/context-globalCompositeOperation-null.html
+
+        * html/canvas/CanvasRenderingContext2D.idl:
+
 2016-07-21  Carlos Garcia Campos  <[email protected]>
 
         [GTK][Threaded Compositor] Overlay scrollbars shouldn't be a requirement of the threaded compositor

Modified: trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl (203509 => 203510)


--- trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl	2016-07-21 17:12:41 UTC (rev 203509)
+++ trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.idl	2016-07-21 17:20:44 UTC (rev 203510)
@@ -43,8 +43,7 @@
 
     attribute unrestricted float globalAlpha;
 
-    // FIXME: This should not have [TreatNullAs=EmptyString].
-    [TreatNullAs=EmptyString] attribute DOMString globalCompositeOperation;
+    attribute DOMString globalCompositeOperation;
 
     [RaisesException] CanvasGradient createLinearGradient(float x0, float y0, float x1, float y1);
     [RaisesException] CanvasGradient createRadialGradient(float x0, float y0, float r0, float x1, float y1, float r1);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to