[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

andreas.kling at nokia.com andreas.kling at nokia.com
Wed Dec 22 11:09:11 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 31e11a638c0bb47b1a8677b4dc733da78ac25a17
Author: andreas.kling at nokia.com <andreas.kling at nokia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jul 13 22:49:38 2010 +0000

    2010-07-13  Andreas Kling  <andreas.kling at nokia.com>
    
            Reviewed by Darin Adler.
    
            Canvas: drawImage() with wrong 'image' argument type should always throw TypeError
            https://bugs.webkit.org/show_bug.cgi?id=42160
    
            Updated 2d.drawImage.wrongtype.html from http://dvcs.w3.org/hg/html/
            and unskipped it.
    
            * canvas/philip/tests/2d.drawImage.wrongtype-expected.txt:
            * canvas/philip/tests/2d.drawImage.wrongtype.html:
            * platform/mac/Skipped:
            * platform/qt/Skipped:
    2010-07-13  Andreas Kling  <andreas.kling at nokia.com>
    
            Reviewed by Darin Adler.
    
            Canvas: drawImage() with wrong 'image' argument type should always throw TypeError
            https://bugs.webkit.org/show_bug.cgi?id=42160
    
            Test: canvas/philip/tests/2d.drawImage.wrongtype.html
    
            * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
            (WebCore::JSCanvasRenderingContext2D::drawImage): Throw TypeError instead of
            TYPE_MISMATCH_ERR if 'image' argument is not an image, canvas or video element.
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63252 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 3dc22cd..57b4323 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,18 @@
+2010-07-13  Andreas Kling  <andreas.kling at nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Canvas: drawImage() with wrong 'image' argument type should always throw TypeError
+        https://bugs.webkit.org/show_bug.cgi?id=42160
+
+        Updated 2d.drawImage.wrongtype.html from http://dvcs.w3.org/hg/html/
+        and unskipped it.
+
+        * canvas/philip/tests/2d.drawImage.wrongtype-expected.txt:
+        * canvas/philip/tests/2d.drawImage.wrongtype.html:
+        * platform/mac/Skipped:
+        * platform/qt/Skipped:
+
 2010-07-13  Kenneth Russell  <kbr at google.com>
 
         Reviewed by Darin Fisher.
diff --git a/LayoutTests/canvas/philip/tests/2d.drawImage.wrongtype-expected.txt b/LayoutTests/canvas/philip/tests/2d.drawImage.wrongtype-expected.txt
index c62e65b..c0f58b8 100644
--- a/LayoutTests/canvas/philip/tests/2d.drawImage.wrongtype-expected.txt
+++ b/LayoutTests/canvas/philip/tests/2d.drawImage.wrongtype-expected.txt
@@ -1,7 +1,6 @@
-< [index] >
 2d.drawImage.wrongtype
-References: 2d.drawImage.type
+Incorrect image types in drawImage do not match any defined overloads, so WebIDL throws a TypeError
+Spec references: 2d.drawImage.type
+Defined in "Language Bindings for DOM Specifications" (draft)
 Actual output:
 Passed
-
-
diff --git a/LayoutTests/canvas/philip/tests/2d.drawImage.wrongtype.html b/LayoutTests/canvas/philip/tests/2d.drawImage.wrongtype.html
index 848f18e..de77038 100644
--- a/LayoutTests/canvas/philip/tests/2d.drawImage.wrongtype.html
+++ b/LayoutTests/canvas/philip/tests/2d.drawImage.wrongtype.html
@@ -1,23 +1,19 @@
 <!DOCTYPE html>
 <title>Canvas test: 2d.drawImage.wrongtype</title>
+<meta name="author" content="Philip Taylor">
 <script src="../tests.js"></script>
 <link rel="stylesheet" href="../tests.css">
-<link rel="prev" href="2d.drawImage.null.html" title="2d.drawImage.null">
-<link rel="next" href="2d.drawImage.floatsource.html" title="2d.drawImage.floatsource">
 <body class="show_output">
-<p>
- <a href="2d.drawImage.null.html" accesskey="p" title="[p] 2d.drawImage.null">&lt;</a>
- <a href="index.html">[index]</a>
- <a href="2d.drawImage.floatsource.html" accesskey="n" title="[n] 2d.drawImage.floatsource">&gt;</a>
+
 <h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.wrongtype</h1>
-<p class="desc"></p>
-<div class="refs">References:
-<ul>
-<li><a href="spec.html#testrefs.2d.drawImage.type">2d.drawImage.type</a>
+<p class="desc">Incorrect image types in drawImage do not match any defined overloads, so WebIDL throws a TypeError</p>
 
+<div class="refs">Spec references:
+<ul>
+<li><a href="../annotated-spec/canvas.html#testrefs.2d.drawImage.type">2d.drawImage.type</a>
 </ul>
 </div>
-
+<p class="notes">Defined in "Language Bindings for DOM Specifications" (draft)
 <p class="output">Actual output:</p>
 <canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
 
@@ -27,16 +23,16 @@ _addTest(function(canvas, ctx) {
 
 try { var _thrown = false;
   ctx.drawImage(undefined, 0, 0);
-} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(undefined, 0, 0)"); }
+} catch (e) { if (!(e instanceof TypeError)) _fail("Failed assertion: expected exception of type TypeError, got: "+e); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TypeError: ctx.drawImage(undefined, 0, 0)"); }
 try { var _thrown = false;
   ctx.drawImage(0, 0, 0);
-} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(0, 0, 0)"); }
+} catch (e) { if (!(e instanceof TypeError)) _fail("Failed assertion: expected exception of type TypeError, got: "+e); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TypeError: ctx.drawImage(0, 0, 0)"); }
 try { var _thrown = false;
   ctx.drawImage("", 0, 0);
-} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(\"\", 0, 0)"); }
+} catch (e) { if (!(e instanceof TypeError)) _fail("Failed assertion: expected exception of type TypeError, got: "+e); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TypeError: ctx.drawImage(\"\", 0, 0)"); }
 try { var _thrown = false;
   ctx.drawImage(document.createElement('p'), 0, 0);
-} catch (e) { if (e.code != DOMException.TYPE_MISMATCH_ERR) _fail("Failed assertion: expected exception of type TYPE_MISMATCH_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TYPE_MISMATCH_ERR: ctx.drawImage(document.createElement('p'), 0, 0)"); }
+} catch (e) { if (!(e instanceof TypeError)) _fail("Failed assertion: expected exception of type TypeError, got: "+e); _thrown = true; } finally { _assert(_thrown, "should throw exception of type TypeError: ctx.drawImage(document.createElement('p'), 0, 0)"); }
 
 
 });
diff --git a/LayoutTests/platform/mac/Skipped b/LayoutTests/platform/mac/Skipped
index dea4282..c3dac81 100644
--- a/LayoutTests/platform/mac/Skipped
+++ b/LayoutTests/platform/mac/Skipped
@@ -200,7 +200,6 @@ canvas/philip/tests/2d.composite.uncovered.pattern.source-out.html
 canvas/philip/tests/2d.drawImage.broken.html
 canvas/philip/tests/2d.drawImage.incomplete.html
 canvas/philip/tests/2d.drawImage.null.html
-canvas/philip/tests/2d.drawImage.wrongtype.html
 canvas/philip/tests/2d.fillStyle.parse.current.basic.html
 canvas/philip/tests/2d.fillStyle.parse.current.changed.html
 canvas/philip/tests/2d.fillStyle.parse.current.removed.html
diff --git a/LayoutTests/platform/qt/Skipped b/LayoutTests/platform/qt/Skipped
index c13d5e5..dcf18c3 100644
--- a/LayoutTests/platform/qt/Skipped
+++ b/LayoutTests/platform/qt/Skipped
@@ -5258,7 +5258,6 @@ canvas/philip/tests/2d.composite.uncovered.pattern.source-out.html
 canvas/philip/tests/2d.drawImage.broken.html
 canvas/philip/tests/2d.drawImage.incomplete.html
 canvas/philip/tests/2d.drawImage.null.html
-canvas/philip/tests/2d.drawImage.wrongtype.html
 canvas/philip/tests/2d.fillStyle.parse.current.basic.html
 canvas/philip/tests/2d.fillStyle.parse.current.changed.html
 canvas/philip/tests/2d.fillStyle.parse.current.removed.html
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ea6dcb8..1a98128 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,16 @@
+2010-07-13  Andreas Kling  <andreas.kling at nokia.com>
+
+        Reviewed by Darin Adler.
+
+        Canvas: drawImage() with wrong 'image' argument type should always throw TypeError
+        https://bugs.webkit.org/show_bug.cgi?id=42160
+
+        Test: canvas/philip/tests/2d.drawImage.wrongtype.html
+
+        * bindings/js/JSCanvasRenderingContext2DCustom.cpp:
+        (WebCore::JSCanvasRenderingContext2D::drawImage): Throw TypeError instead of
+        TYPE_MISMATCH_ERR if 'image' argument is not an image, canvas or video element.
+
 2010-07-13  Aaron Boodman  <aa at chromium.org>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp b/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
index e88afc2..9b3f79f 100644
--- a/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
+++ b/WebCore/bindings/js/JSCanvasRenderingContext2DCustom.cpp
@@ -260,9 +260,8 @@ JSValue JSCanvasRenderingContext2D::drawImage(ExecState* exec)
                     return throwSyntaxError(exec);
         }
 #endif
-    } else {
-        setDOMException(exec, TYPE_MISMATCH_ERR);
-    }
+    } else
+       return throwTypeError(exec);
     
     return jsUndefined();    
 }

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list