Bug 141861

Summary: Print a console warning when HTMLCanvasElement exceeds the maximum size
Product: WebKit Reporter: Dean Jackson <dino>
Component: New BugsAssignee: Dean Jackson <dino>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, commit-queue, esprehn+autocc, gyuyoung.kim, mkwst, rniwa
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Patch
simon.fraser: review+, buildbot: commit-queue-
Archive of layout-test-results from ews105 for mac-mavericks-wk2
none
Archive of layout-test-results from ews100 for mac-mavericks none

Description Dean Jackson 2015-02-20 17:02:08 PST
Print a console warning when HTMLCanvasElement exceeds the maximum size
Comment 1 Dean Jackson 2015-02-20 17:09:04 PST
Created attachment 247014 [details]
Patch
Comment 2 Dean Jackson 2015-02-20 17:09:21 PST
        <rdar://problem/19729145>
Comment 3 Simon Fraser (smfr) 2015-02-20 17:15:25 PST
Comment on attachment 247014 [details]
Patch

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

> Source/WebCore/html/HTMLCanvasElement.cpp:558
> +        document().addConsoleMessage(MessageSource::JS, MessageLevel::Warning, ASCIILiteral("Canvas size exceeds the maximum limit. Draw operations will not produce output."));

I think this should say what the limit is.
Comment 4 Dean Jackson 2015-02-20 17:24:28 PST
Created attachment 247017 [details]
Patch
Comment 5 Simon Fraser (smfr) 2015-02-20 17:26:49 PST
Comment on attachment 247017 [details]
Patch

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

> Source/WebCore/html/HTMLCanvasElement.cpp:559
> +        stringBuilder.append("Canvas size exceeds the maximum limit (width * height > ");

Maybe "canvas area exceeds"

> LayoutTests/fast/canvas/huge-canvas-error-expected.txt:1
> +CONSOLE MESSAGE: line 14: Canvas size exceeds the maximum limit. Draw operations will not produce output.

You'll have to fix this.
Comment 6 Dean Jackson 2015-02-20 17:36:01 PST
Created attachment 247020 [details]
Patch
Comment 7 Simon Fraser (smfr) 2015-02-20 17:37:30 PST
Comment on attachment 247020 [details]
Patch

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

> Source/WebCore/html/HTMLCanvasElement.cpp:559
> +        stringBuilder.append("Canvas size exceeds the maximum limit (width * height > ");

Canvas area ("size" is ambiguous).

> Source/WebCore/html/HTMLCanvasElement.cpp:561
> +        stringBuilder.append("). Draw operations will not produce output.");

Does "Draw operations will not produce output" add anything? Maybe drop it.
Comment 8 Build Bot 2015-02-20 17:58:39 PST
Comment on attachment 247020 [details]
Patch

Attachment 247020 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://webkit-queues.appspot.com/results/4509105733500928

New failing tests:
fast/canvas/pattern-too-large-to-create.html
fast/canvas/canvas-toDataURL-crash.html
Comment 9 Build Bot 2015-02-20 17:58:43 PST
Created attachment 247026 [details]
Archive of layout-test-results from ews105 for mac-mavericks-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews105  Port: mac-mavericks-wk2  Platform: Mac OS X 10.9.5
Comment 10 Build Bot 2015-02-20 18:25:20 PST
Comment on attachment 247020 [details]
Patch

Attachment 247020 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/4909735987904512

New failing tests:
fast/canvas/pattern-too-large-to-create.html
fast/canvas/canvas-toDataURL-crash.html
Comment 11 Build Bot 2015-02-20 18:25:24 PST
Created attachment 247030 [details]
Archive of layout-test-results from ews100 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 12 Dean Jackson 2015-02-22 18:36:24 PST
Committed r180492: <http://trac.webkit.org/changeset/180492>