Bug 63801 - [Chromium] HTML5 Canvas context.createPattern(image, repetition) can throw TYPE_MISMATCH_ERR exception.
Summary: [Chromium] HTML5 Canvas context.createPattern(image, repetition) can throw TY...
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: HTML5
Depends on:
Blocks:
 
Reported: 2011-07-01 05:43 PDT by Dongseong Hwang
Modified: 2012-04-20 18:10 PDT (History)
10 users (show)

See Also:


Attachments
patch (8.75 KB, patch)
2011-07-01 05:49 PDT, Dongseong Hwang
no flags Details | Formatted Diff | Diff
patch (8.76 KB, patch)
2011-07-03 00:25 PDT, Dongseong Hwang
no flags Details | Formatted Diff | Diff
patch (12.55 KB, patch)
2011-07-05 00:38 PDT, Dongseong Hwang
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Archive of layout-test-results from ec2-cr-linux-02 (1.32 MB, application/zip)
2011-07-05 01:06 PDT, WebKit Review Bot
no flags Details
patch (8.76 KB, patch)
2011-07-05 01:24 PDT, Dongseong Hwang
ojan: review-
ojan: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dongseong Hwang 2011-07-01 05:43:57 PDT
Chromium failed this test : http://dev.w3.org/html5/2dcontext/#dom-context-2d-createpattern
Comment 1 Dongseong Hwang 2011-07-01 05:49:06 PDT
Created attachment 99465 [details]
patch

JavaScriptCore treats this by JSCanvasRenderingContext2DCustom.cpp but V8 does not treats this.

From HTML5 canvas spec:
http://dev.w3.org/html5/2dcontext/#dom-context-2d-createpattern

"If the first argument isn't an img, canvas, or video element, throws a TYPE_MISMATCH_ERR exception."

This patch makes Chromium pass canvas/philip/tests/2d.pattern.image.undefined.html
Comment 2 WebKit Review Bot 2011-07-01 05:52:12 PDT
Attachment 99465 [details] did not pass style-queue:

Failed to run "['Tools/Scripts/check-webkit-style', '--diff-files', u'LayoutTests/ChangeLog', u'LayoutTests/plat..." exit_code: 1

Source/WebCore/html/canvas/CanvasRenderingContext2D.idl:150:  Line contains tab character.  [whitespace/tab] [5]
Total errors found: 1 in 4 files


If any of these errors are false positives, please file a bug against check-webkit-style.
Comment 3 Dongseong Hwang 2011-07-03 00:25:05 PDT
Created attachment 99569 [details]
patch
Comment 4 Dongseong Hwang 2011-07-05 00:38:14 PDT
Created attachment 99672 [details]
patch
Comment 5 WebKit Review Bot 2011-07-05 01:06:47 PDT
Comment on attachment 99672 [details]
patch

Attachment 99672 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/8982679

New failing tests:
canvas/philip/tests/2d.path.arc.nonempty.html
Comment 6 WebKit Review Bot 2011-07-05 01:06:52 PDT
Created attachment 99674 [details]
Archive of layout-test-results from ec2-cr-linux-02

The attached test failures were seen while running run-webkit-tests on the chromium-ews.
Bot: ec2-cr-linux-02  Port: Chromium  Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Comment 7 Dongseong Hwang 2011-07-05 01:24:18 PDT
Created attachment 99678 [details]
patch
Comment 8 Eric Seidel (no email) 2011-07-05 18:09:44 PDT
Comment on attachment 99678 [details]
patch

View in context: https://bugs.webkit.org/attachment.cgi?id=99678&action=review

> Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:106
> +    fail:

Really?  We use goto in the v8 bindings?
Comment 9 Andreas Kling 2011-07-05 18:43:58 PDT
I'm not sure this is correct.

http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-createpattern no longer has the part about TYPE_MISMATCH_ERR. IIRC, Web IDL specifies that this shouldn't match any of the overloads, but instead raise TypeError. ( http://www.w3.org/TR/WebIDL/#es-operations )
Comment 10 Dongseong Hwang 2011-07-05 19:47:46 PDT
I copied it from the derived source.
I thought I should make at the lowest changes.
However, I agree. I should remove goto.

(In reply to comment #8)
> (From update of attachment 99678 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=99678&action=review
> 
> > Source/WebCore/bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp:106
> > +    fail:
> 
> Really?  We use goto in the v8 bindings?
Comment 11 Dongseong Hwang 2011-07-05 19:57:48 PDT
(In reply to comment #9)
> I'm not sure this is correct.
> 
> http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-createpattern no longer has the part about TYPE_MISMATCH_ERR. IIRC, Web IDL specifies that this shouldn't match any of the overloads, but instead raise TypeError. ( http://www.w3.org/TR/WebIDL/#es-operations )

I'm not familiar with w3 spec, but above spec is Last Updated 1 July 2011. The spec I had attached is W3C Working Draft 24 May 2011.
Which is correct?
Comment 12 Ojan Vafai 2012-04-20 18:10:23 PDT
(In reply to comment #11)
> (In reply to comment #9)
> > I'm not sure this is correct.
> > 
> > http://www.whatwg.org/specs/web-apps/current-work/multipage/the-canvas-element.html#dom-context-2d-createpattern no longer has the part about TYPE_MISMATCH_ERR. IIRC, Web IDL specifies that this shouldn't match any of the overloads, but instead raise TypeError. ( http://www.w3.org/TR/WebIDL/#es-operations )
> 
> I'm not familiar with w3 spec, but above spec is Last Updated 1 July 2011. The spec I had attached is W3C Working Draft 24 May 2011.
> Which is correct?

For WebKit, we use the whatwg.org copy of the spec as the one that we implement. Although, in this specific case, it looks like both specs have changed to no longer throw an error in this case.
Comment 13 Ojan Vafai 2012-04-20 18:10:48 PDT
Comment on attachment 99678 [details]
patch

Please reopen the bug if you believe I've misread the spec.