framed: | Canvas test: %(name)s


[show output]

Actual output:

%(fallback)s %(expected)s %(images)s standalone: | Canvas test: %(name)s

< [index] >




Actual output:

%(fallback)s %(expected)s %(images)s minimal: | Canvas test: %(name)s



These images should be identical:

%(fallback)s %(expected)s %(images)s mochitest: | Canvas test: %(name)s %(fallback)s %(mochi_images)s mochitest.isPixel: | function isPixel(ctx, x,y, r,g,b,a, pos, colour, d, f) { var pixel = ctx.getImageData(x, y, 1, 1); var pr =[0], pg =[1], pb =[2], pa =[3]; (f || ok)(r-d <= pr && pr <= r+d && g-d <= pg && pg <= g+d && b-d <= pb && pb <= b+d && a-d <= pa && pa <= a+d, "pixel "+pos+" is "+pr+","+pg+","+pb+","+pa+"; expected "+colour+" +/- "+d); } mochitest.todo_isPixel: | function todo_isPixel(ctx, x,y, r,g,b,a, pos, colour, d) { isPixel(ctx, x,y, r,g,b,a, pos, colour, d, todo); } mochitest.deferTest: | function deferTest() { _deferred = true; } mochitest.wrapFunction: | function wrapFunction(f) { return function () { f.apply(null, arguments); SimpleTest.finish(); } } mochitest.Makefile: | # # ***** BEGIN LICENSE BLOCK ***** # Version: MPL 1.1/GPL 2.0/LGPL 2.1 # # The contents of this file are subject to the Mozilla Public License Version # 1.1 (the "License"); you may not use this file except in compliance with # the License. You may obtain a copy of the License at # # # Software distributed under the License is distributed on an "AS IS" basis, # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License # for the specific language governing rights and limitations under the # License. # # The Original Code is code. # # The Initial Developer of the Original Code is # Mozilla Corporation. # Portions created by the Initial Developer are Copyright (C) 2007 # the Initial Developer. All Rights Reserved. # # Contributor(s): # Philip Taylor # # Alternatively, the contents of this file may be used under the terms of # either of the GNU General Public License Version 2 or later (the "GPL"), # or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), # in which case the provisions of the GPL or the LGPL are applicable instead # of those above. If you wish to allow use of your version of this file only # under the terms of either the GPL or the LGPL, and not to allow others to # use your version of this file under the terms of the MPL, indicate your # decision by deleting the provisions above and replace them with the notice # and other provisions required by the GPL or the LGPL. If you do not delete # the provisions above, a recipient may use your version of this file under # the terms of any one of the MPL, the GPL or the LGPL. # # ***** END LICENSE BLOCK ***** DEPTH = ../../.. topsrcdir = @top_srcdir@ srcdir = @srcdir@ VPATH = @srcdir@ relativesrcdir = content/canvas/test include $(DEPTH)/config/ include $(topsrcdir)/config/ _TEST_FILES = \ %(files)s%(tab)s$(NULL) libs:: $(_TEST_FILES) %(tab)s$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/tests/$(relativesrcdir) index.frame: | Canvas tests - %(category)s.*



# FF trunk doesn't do onload in object, so use iframe instead #index.frame.item: |- # (object fallback) index.frame.item: |- index: | Canvas tests - index

<canvas> tests

Last updated: %(updated)s by Philip Taylor.

Annotated specification (based on Web Applications 1.0 Working Draft — 28 August 2007)

Test results for some browsers, created semi-automatically via the report generator.

You may want to download the source code/data (e.g. to create an offline copy of the tests).

Test cases

For each test, a green background indicates success, red indicates failure, blue indicates a need to manually confirm the output is as expected.

The versions in the report generator are the most visually minimalist. The category links below show the actual and expected renderings, and any error messages. The individual test links have links to relevant parts of the specification and extra notes.

Some of the tests only compare single pixels, so "success" means it avoided the obvious failure which was being tested for, rather than meaning it gave the exact expected output. Some tests make perhaps-unreasonable assumptions about exact pixel values and have too-small tolerances, and may incorrectly fail in some valid implementations or on non-32-bit displays. Some make incorrect assumptions that "should" requirements (e.g. painting gradients) are supported. Some reflect old versions of the specification, and some are just wrong. But I try to find and fix any problems, so just be a little careful for now. index.category.item: |

  • %s.*

    %d test%s expand

    reportgen: | Canvas tests - report generator

    This is mainly for my own use. If anyone else wants to use it for some reason, just wait until "tests not yet loaded" and "tests not yet completed" get down to zero, then click the pass/fail button for any test it shows where it cannot work out the answer (or use the y/n keys to choose for the magenta-highlighted case), then use the buttons at the bottom to collect all the results. (WebKit has several problems with this, so it is harder to work out how to use this there.)

    Test name Test case Pass? Fail? Notes

    (Submissions will tend to be ignored unless there is a good reason why they won't be, so don't use this form unless there is such a reason.)
    results: | Canvas tests - results