2010-05-14 Chang Shu <chang.shu@nokia.com>
Reviewed by Eric Seidel.
Import Philip Taylor's HTML5 <canavs> test suite from
http://philip.html5.org/tests/canvas/suite/tests. These
test cases are skipped for now.
https://bugs.webkit.org/show_bug.cgi?id=20553
* fast/canvas/philip: Added.
* fast/canvas/philip/fonts: Added.
* fast/canvas/philip/fonts/CanvasTest.sfd: Added.
* fast/canvas/philip/fonts/CanvasTest.ttf: Added.
* fast/canvas/philip/images: Added.
* fast/canvas/philip/images/anim-gr.gif: Added.
* fast/canvas/philip/images/anim-gr.png: Added.
* fast/canvas/philip/images/anim-poster-gr.png: Added.
* fast/canvas/philip/images/background.png: Added.
* fast/canvas/philip/images/broken.png: Added.
* fast/canvas/philip/images/ggrr-256x256.png: Added.
* fast/canvas/philip/images/green-16x16.png: Added.
* fast/canvas/philip/images/green-1x1.png: Added.
* fast/canvas/philip/images/green-256x256.png: Added.
* fast/canvas/philip/images/green-2x2.png: Added.
* fast/canvas/philip/images/green.png: Added.
* fast/canvas/philip/images/grgr-256x256.png: Added.
* fast/canvas/philip/images/red-16x16.png: Added.
* fast/canvas/philip/images/red.png: Added.
* fast/canvas/philip/images/redtransparent.png: Added.
* fast/canvas/philip/images/rgrg-256x256.png: Added.
* fast/canvas/philip/images/rrgg-256x256.png: Added.
* fast/canvas/philip/images/transparent.png: Added.
* fast/canvas/philip/images/transparent50.png: Added.
* fast/canvas/philip/images/yellow.png: Added.
* fast/canvas/philip/images/yellow75.png: Added.
* fast/canvas/philip/tests: Added.
* fast/canvas/philip/tests.css: Added.
* fast/canvas/philip/tests/.reportgen.html.swp: Added.
* fast/canvas/philip/tests/.reportgen.js.swp: Added.
* fast/canvas/philip/tests/2d.canvas.readonly.html: Added.
* fast/canvas/philip/tests/2d.canvas.reference.html: Added.
* fast/canvas/philip/tests/2d.clearRect.basic.html: Added.
* fast/canvas/philip/tests/2d.clearRect.clip.html: Added.
* fast/canvas/philip/tests/2d.clearRect.globalalpha.html: Added.
* fast/canvas/philip/tests/2d.clearRect.globalcomposite.html: Added.
* fast/canvas/philip/tests/2d.clearRect.negative.html: Added.
* fast/canvas/philip/tests/2d.clearRect.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.clearRect.path.html: Added.
* fast/canvas/philip/tests/2d.clearRect.shadow.html: Added.
* fast/canvas/philip/tests/2d.clearRect.transform.html: Added.
* fast/canvas/philip/tests/2d.clearRect.zero.html: Added.
* fast/canvas/philip/tests/2d.composite.canvas.copy.html: Added.
* fast/canvas/philip/tests/2d.composite.canvas.copy.png: Added.
* fast/canvas/philip/tests/2d.composite.canvas.destination-atop.html: Added.
* fast/canvas/philip/tests/2d.composite.canvas.destination-atop.png: Added.
* fast/canvas/philip/tests/2d.composite.canvas.destination-in.html: Added.
* fast/canvas/philip/tests/2d.composite.canvas.destination-in.png: Added.
* fast/canvas/philip/tests/2d.composite.canvas.destination-out.html: Added.
* fast/canvas/philip/tests/2d.composite.canvas.destination-out.png: Added.
* fast/canvas/philip/tests/2d.composite.canvas.destination-over.html: Added.
* fast/canvas/philip/tests/2d.composite.canvas.destination-over.png: Added.
* fast/canvas/philip/tests/2d.composite.canvas.lighter.html: Added.
* fast/canvas/philip/tests/2d.composite.canvas.lighter.png: Added.
* fast/canvas/philip/tests/2d.composite.canvas.source-atop.html: Added.
* fast/canvas/philip/tests/2d.composite.canvas.source-atop.png: Added.
* fast/canvas/philip/tests/2d.composite.canvas.source-in.html: Added.
* fast/canvas/philip/tests/2d.composite.canvas.source-in.png: Added.
* fast/canvas/philip/tests/2d.composite.canvas.source-out.html: Added.
* fast/canvas/philip/tests/2d.composite.canvas.source-out.png: Added.
* fast/canvas/philip/tests/2d.composite.canvas.source-over.html: Added.
* fast/canvas/philip/tests/2d.composite.canvas.source-over.png: Added.
* fast/canvas/philip/tests/2d.composite.canvas.xor.html: Added.
* fast/canvas/philip/tests/2d.composite.canvas.xor.png: Added.
* fast/canvas/philip/tests/2d.composite.clip.copy.html: Added.
* fast/canvas/philip/tests/2d.composite.clip.destination-atop.html: Added.
* fast/canvas/philip/tests/2d.composite.clip.destination-in.html: Added.
* fast/canvas/philip/tests/2d.composite.clip.destination-out.html: Added.
* fast/canvas/philip/tests/2d.composite.clip.destination-over.html: Added.
* fast/canvas/philip/tests/2d.composite.clip.lighter.html: Added.
* fast/canvas/philip/tests/2d.composite.clip.source-atop.html: Added.
* fast/canvas/philip/tests/2d.composite.clip.source-in.html: Added.
* fast/canvas/philip/tests/2d.composite.clip.source-out.html: Added.
* fast/canvas/philip/tests/2d.composite.clip.source-over.html: Added.
* fast/canvas/philip/tests/2d.composite.clip.xor.html: Added.
* fast/canvas/philip/tests/2d.composite.globalAlpha.canvas.html: Added.
* fast/canvas/philip/tests/2d.composite.globalAlpha.canvaspattern.html: Added.
* fast/canvas/philip/tests/2d.composite.globalAlpha.default.html: Added.
* fast/canvas/philip/tests/2d.composite.globalAlpha.fill.html: Added.
* fast/canvas/philip/tests/2d.composite.globalAlpha.image.html: Added.
* fast/canvas/philip/tests/2d.composite.globalAlpha.imagepattern.html: Added.
* fast/canvas/philip/tests/2d.composite.globalAlpha.invalid.html: Added.
* fast/canvas/philip/tests/2d.composite.globalAlpha.range.html: Added.
* fast/canvas/philip/tests/2d.composite.image.copy.html: Added.
* fast/canvas/philip/tests/2d.composite.image.copy.png: Added.
* fast/canvas/philip/tests/2d.composite.image.destination-atop.html: Added.
* fast/canvas/philip/tests/2d.composite.image.destination-atop.png: Added.
* fast/canvas/philip/tests/2d.composite.image.destination-in.html: Added.
* fast/canvas/philip/tests/2d.composite.image.destination-in.png: Added.
* fast/canvas/philip/tests/2d.composite.image.destination-out.html: Added.
* fast/canvas/philip/tests/2d.composite.image.destination-out.png: Added.
* fast/canvas/philip/tests/2d.composite.image.destination-over.html: Added.
* fast/canvas/philip/tests/2d.composite.image.destination-over.png: Added.
* fast/canvas/philip/tests/2d.composite.image.lighter.html: Added.
* fast/canvas/philip/tests/2d.composite.image.lighter.png: Added.
* fast/canvas/philip/tests/2d.composite.image.source-atop.html: Added.
* fast/canvas/philip/tests/2d.composite.image.source-atop.png: Added.
* fast/canvas/philip/tests/2d.composite.image.source-in.html: Added.
* fast/canvas/philip/tests/2d.composite.image.source-in.png: Added.
* fast/canvas/philip/tests/2d.composite.image.source-out.html: Added.
* fast/canvas/philip/tests/2d.composite.image.source-out.png: Added.
* fast/canvas/philip/tests/2d.composite.image.source-over.html: Added.
* fast/canvas/philip/tests/2d.composite.image.source-over.png: Added.
* fast/canvas/philip/tests/2d.composite.image.xor.html: Added.
* fast/canvas/philip/tests/2d.composite.image.xor.png: Added.
* fast/canvas/philip/tests/2d.composite.operation.casesensitive.html: Added.
* fast/canvas/philip/tests/2d.composite.operation.clear.html: Added.
* fast/canvas/philip/tests/2d.composite.operation.darker.html: Added.
* fast/canvas/philip/tests/2d.composite.operation.default.html: Added.
* fast/canvas/philip/tests/2d.composite.operation.get.html: Added.
* fast/canvas/philip/tests/2d.composite.operation.highlight.html: Added.
* fast/canvas/philip/tests/2d.composite.operation.nullsuffix.html: Added.
* fast/canvas/philip/tests/2d.composite.operation.over.html: Added.
* fast/canvas/philip/tests/2d.composite.operation.unrecognised.html: Added.
* fast/canvas/philip/tests/2d.composite.solid.copy.html: Added.
* fast/canvas/philip/tests/2d.composite.solid.copy.png: Added.
* fast/canvas/philip/tests/2d.composite.solid.destination-atop.html: Added.
* fast/canvas/philip/tests/2d.composite.solid.destination-atop.png: Added.
* fast/canvas/philip/tests/2d.composite.solid.destination-in.html: Added.
* fast/canvas/philip/tests/2d.composite.solid.destination-in.png: Added.
* fast/canvas/philip/tests/2d.composite.solid.destination-out.html: Added.
* fast/canvas/philip/tests/2d.composite.solid.destination-out.png: Added.
* fast/canvas/philip/tests/2d.composite.solid.destination-over.html: Added.
* fast/canvas/philip/tests/2d.composite.solid.destination-over.png: Added.
* fast/canvas/philip/tests/2d.composite.solid.lighter.html: Added.
* fast/canvas/philip/tests/2d.composite.solid.lighter.png: Added.
* fast/canvas/philip/tests/2d.composite.solid.source-atop.html: Added.
* fast/canvas/philip/tests/2d.composite.solid.source-atop.png: Added.
* fast/canvas/philip/tests/2d.composite.solid.source-in.html: Added.
* fast/canvas/philip/tests/2d.composite.solid.source-in.png: Added.
* fast/canvas/philip/tests/2d.composite.solid.source-out.html: Added.
* fast/canvas/philip/tests/2d.composite.solid.source-out.png: Added.
* fast/canvas/philip/tests/2d.composite.solid.source-over.html: Added.
* fast/canvas/philip/tests/2d.composite.solid.source-over.png: Added.
* fast/canvas/philip/tests/2d.composite.solid.xor.html: Added.
* fast/canvas/philip/tests/2d.composite.solid.xor.png: Added.
* fast/canvas/philip/tests/2d.composite.transparent.copy.html: Added.
* fast/canvas/philip/tests/2d.composite.transparent.copy.png: Added.
* fast/canvas/philip/tests/2d.composite.transparent.destination-atop.html: Added.
* fast/canvas/philip/tests/2d.composite.transparent.destination-atop.png: Added.
* fast/canvas/philip/tests/2d.composite.transparent.destination-in.html: Added.
* fast/canvas/philip/tests/2d.composite.transparent.destination-in.png: Added.
* fast/canvas/philip/tests/2d.composite.transparent.destination-out.html: Added.
* fast/canvas/philip/tests/2d.composite.transparent.destination-out.png: Added.
* fast/canvas/philip/tests/2d.composite.transparent.destination-over.html: Added.
* fast/canvas/philip/tests/2d.composite.transparent.destination-over.png: Added.
* fast/canvas/philip/tests/2d.composite.transparent.lighter.html: Added.
* fast/canvas/philip/tests/2d.composite.transparent.lighter.png: Added.
* fast/canvas/philip/tests/2d.composite.transparent.source-atop.html: Added.
* fast/canvas/philip/tests/2d.composite.transparent.source-atop.png: Added.
* fast/canvas/philip/tests/2d.composite.transparent.source-in.html: Added.
* fast/canvas/philip/tests/2d.composite.transparent.source-in.png: Added.
* fast/canvas/philip/tests/2d.composite.transparent.source-out.html: Added.
* fast/canvas/philip/tests/2d.composite.transparent.source-out.png: Added.
* fast/canvas/philip/tests/2d.composite.transparent.source-over.html: Added.
* fast/canvas/philip/tests/2d.composite.transparent.source-over.png: Added.
* fast/canvas/philip/tests/2d.composite.transparent.xor.html: Added.
* fast/canvas/philip/tests/2d.composite.transparent.xor.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.fill.copy.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.fill.copy.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-atop.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-atop.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-in.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-in.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.fill.source-in.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.fill.source-in.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.fill.source-out.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.fill.source-out.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.image.copy.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.image.copy.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.image.destination-atop.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.image.destination-atop.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.image.destination-in.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.image.destination-in.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.image.source-in.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.image.source-in.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.image.source-out.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.image.source-out.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.nocontext.copy.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.nocontext.copy.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-atop.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-atop.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-in.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-in.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-in.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-in.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-out.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-out.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.pattern.copy.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.pattern.copy.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-atop.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-atop.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-in.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-in.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-in.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-in.png: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-out.html: Added.
* fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-out.png: Added.
* fast/canvas/philip/tests/2d.coordinatespace.html: Added.
* fast/canvas/philip/tests/2d.coordinatespace.png: Added.
* fast/canvas/philip/tests/2d.drawImage.3arg.html: Added.
* fast/canvas/philip/tests/2d.drawImage.5arg.html: Added.
* fast/canvas/philip/tests/2d.drawImage.9arg.basic.html: Added.
* fast/canvas/philip/tests/2d.drawImage.9arg.destpos.html: Added.
* fast/canvas/philip/tests/2d.drawImage.9arg.destsize.html: Added.
* fast/canvas/philip/tests/2d.drawImage.9arg.sourcepos.html: Added.
* fast/canvas/philip/tests/2d.drawImage.9arg.sourcesize.html: Added.
* fast/canvas/philip/tests/2d.drawImage.alpha.html: Added.
* fast/canvas/philip/tests/2d.drawImage.animated.apng.html: Added.
* fast/canvas/philip/tests/2d.drawImage.animated.gif.html: Added.
* fast/canvas/philip/tests/2d.drawImage.animated.poster.html: Added.
* fast/canvas/philip/tests/2d.drawImage.broken.html: Added.
* fast/canvas/philip/tests/2d.drawImage.canvas.html: Added.
* fast/canvas/philip/tests/2d.drawImage.clip.html: Added.
* fast/canvas/philip/tests/2d.drawImage.composite.html: Added.
* fast/canvas/philip/tests/2d.drawImage.floatsource.html: Added.
* fast/canvas/philip/tests/2d.drawImage.incomplete.html: Added.
* fast/canvas/philip/tests/2d.drawImage.negativedest.html: Added.
* fast/canvas/philip/tests/2d.drawImage.negativedir.html: Added.
* fast/canvas/philip/tests/2d.drawImage.negativesource.html: Added.
* fast/canvas/philip/tests/2d.drawImage.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.drawImage.nowrap.html: Added.
* fast/canvas/philip/tests/2d.drawImage.null.html: Added.
* fast/canvas/philip/tests/2d.drawImage.outsidesource.html: Added.
* fast/canvas/philip/tests/2d.drawImage.path.html: Added.
* fast/canvas/philip/tests/2d.drawImage.self.1.html: Added.
* fast/canvas/philip/tests/2d.drawImage.self.2.html: Added.
* fast/canvas/philip/tests/2d.drawImage.transform.html: Added.
* fast/canvas/philip/tests/2d.drawImage.wrongtype.html: Added.
* fast/canvas/philip/tests/2d.drawImage.zerocanvas.html: Added.
* fast/canvas/philip/tests/2d.drawImage.zerosource.html: Added.
* fast/canvas/philip/tests/2d.fillRect.basic.html: Added.
* fast/canvas/philip/tests/2d.fillRect.clip.html: Added.
* fast/canvas/philip/tests/2d.fillRect.negative.html: Added.
* fast/canvas/philip/tests/2d.fillRect.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.fillRect.path.html: Added.
* fast/canvas/philip/tests/2d.fillRect.shadow.html: Added.
* fast/canvas/philip/tests/2d.fillRect.transform.html: Added.
* fast/canvas/philip/tests/2d.fillRect.zero.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.default.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.get.semitransparent.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.get.solid.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.get.transparent.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.invalidstring.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.invalidtype.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.current.basic.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.current.changed.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.current.removed.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.current.removed.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hex3.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hex3.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hex6.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hex6.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-1.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-2.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-3.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-3.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-4.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-4.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-5.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-5.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-1.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-2.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-3.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-3.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-4.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-4.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-1.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-2.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-1.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-2.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-3.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-3.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-4.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-4.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-5.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-5.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-6.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-6.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.html4.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.html4.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex3.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex5.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex6.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex7.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-3.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-4.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-5.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsla-1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsla-2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.name-1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.name-2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.name-3.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-3.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-4.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-5.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-6.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-7.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-3.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-4.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-5.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-1.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-2.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-3.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-3.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-4.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-4.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-5.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-5.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgb-num.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgb-num.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgb-percent.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgb-percent.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-1.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-2.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-1.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-2.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgba-percent.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgba-percent.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-1.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-2.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.svg-1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.svg-1.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.svg-2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.svg-2.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.system.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.transparent-1.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.transparent-1.png: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.transparent-2.html: Added.
* fast/canvas/philip/tests/2d.fillStyle.parse.transparent-2.png: Added.
* fast/canvas/philip/tests/2d.getcontext.exists.html: Added.
* fast/canvas/philip/tests/2d.getcontext.shared.html: Added.
* fast/canvas/philip/tests/2d.getcontext.unique.html: Added.
* fast/canvas/philip/tests/2d.gradient.empty.html: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.alpha.html: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.alpha.png: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.colour.html: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.colour.png: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.colouralpha.html: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.colouralpha.png: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.multiple.html: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.multiple.png: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.outside.html: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.overlap.html: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.overlap.png: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.overlap2.html: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.solid.html: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.vertical.html: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.vertical.png: Added.
* fast/canvas/philip/tests/2d.gradient.interpolate.zerosize.html: Added.
* fast/canvas/philip/tests/2d.gradient.linear.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.gradient.linear.transform.1.html: Added.
* fast/canvas/philip/tests/2d.gradient.linear.transform.2.html: Added.
* fast/canvas/philip/tests/2d.gradient.linear.transform.3.html: Added.
* fast/canvas/philip/tests/2d.gradient.object.compare.html: Added.
* fast/canvas/philip/tests/2d.gradient.object.crosscanvas.html: Added.
* fast/canvas/philip/tests/2d.gradient.object.invalidcolour.html: Added.
* fast/canvas/philip/tests/2d.gradient.object.invalidoffset.html: Added.
* fast/canvas/philip/tests/2d.gradient.object.return.html: Added.
* fast/canvas/philip/tests/2d.gradient.object.update.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.cone.behind.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.cone.beside.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.cone.bottom.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.cone.cylinder.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.cone.front.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.cone.shape1.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.cone.shape2.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.cone.top.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.equal.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.inside1.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.inside2.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.inside3.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.negative.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.outside1.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.outside2.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.outside3.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.touch1.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.touch2.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.touch3.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.transform.1.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.transform.2.html: Added.
* fast/canvas/philip/tests/2d.gradient.radial.transform.3.html: Added.
* fast/canvas/philip/tests/2d.imageData.create1.basic.html: Added.
* fast/canvas/philip/tests/2d.imageData.create1.initial.html: Added.
* fast/canvas/philip/tests/2d.imageData.create1.type.html: Added.
* fast/canvas/philip/tests/2d.imageData.create1.zero.html: Added.
* fast/canvas/philip/tests/2d.imageData.create2.basic.html: Added.
* fast/canvas/philip/tests/2d.imageData.create2.initial.html: Added.
* fast/canvas/philip/tests/2d.imageData.create2.large.html: Added.
* fast/canvas/philip/tests/2d.imageData.create2.negative.html: Added.
* fast/canvas/philip/tests/2d.imageData.create2.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.imageData.create2.round.html: Added.
* fast/canvas/philip/tests/2d.imageData.create2.tiny.html: Added.
* fast/canvas/philip/tests/2d.imageData.create2.type.html: Added.
* fast/canvas/philip/tests/2d.imageData.create2.zero.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.basic.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.clamp.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.length.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.nonpremul.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.order.alpha.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.order.cols.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.order.rgb.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.order.rows.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.range.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.source.negative.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.source.outside.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.source.size.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.tiny.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.type.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.unaffected.html: Added.
* fast/canvas/philip/tests/2d.imageData.get.zero.html: Added.
* fast/canvas/philip/tests/2d.imageData.object.ctor.html: Added.
* fast/canvas/philip/tests/2d.imageData.object.nan.html: Added.
* fast/canvas/philip/tests/2d.imageData.object.properties.html: Added.
* fast/canvas/philip/tests/2d.imageData.object.readonly.html: Added.
* fast/canvas/philip/tests/2d.imageData.object.round.html: Added.
* fast/canvas/philip/tests/2d.imageData.object.set.html: Added.
* fast/canvas/philip/tests/2d.imageData.object.string.html: Added.
* fast/canvas/philip/tests/2d.imageData.object.undefined.html: Added.
* fast/canvas/philip/tests/2d.imageData.object.wrap.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.alpha.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.alpha.png: Added.
* fast/canvas/philip/tests/2d.imageData.put.basic.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.clip.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.created.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.cross.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.dirty.negative.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.dirty.outside.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.dirty.rect1.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.dirty.rect2.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.dirty.zero.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.modified.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.null.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.path.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.unaffected.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.unchanged.html: Added.
* fast/canvas/philip/tests/2d.imageData.put.wrongtype.html: Added.
* fast/canvas/philip/tests/2d.line.cap.butt.html: Added.
* fast/canvas/philip/tests/2d.line.cap.closed.html: Added.
* fast/canvas/philip/tests/2d.line.cap.invalid.html: Added.
* fast/canvas/philip/tests/2d.line.cap.open.html: Added.
* fast/canvas/philip/tests/2d.line.cap.round.html: Added.
* fast/canvas/philip/tests/2d.line.cap.square.html: Added.
* fast/canvas/philip/tests/2d.line.cap.valid.html: Added.
* fast/canvas/philip/tests/2d.line.cross.html: Added.
* fast/canvas/philip/tests/2d.line.defaults.html: Added.
* fast/canvas/philip/tests/2d.line.join.bevel.html: Added.
* fast/canvas/philip/tests/2d.line.join.closed.html: Added.
* fast/canvas/philip/tests/2d.line.join.invalid.html: Added.
* fast/canvas/philip/tests/2d.line.join.miter.html: Added.
* fast/canvas/philip/tests/2d.line.join.open.html: Added.
* fast/canvas/philip/tests/2d.line.join.parallel.html: Added.
* fast/canvas/philip/tests/2d.line.join.round.html: Added.
* fast/canvas/philip/tests/2d.line.join.valid.html: Added.
* fast/canvas/philip/tests/2d.line.miter.acute.html: Added.
* fast/canvas/philip/tests/2d.line.miter.exceeded.html: Added.
* fast/canvas/philip/tests/2d.line.miter.invalid.html: Added.
* fast/canvas/philip/tests/2d.line.miter.lineedge.html: Added.
* fast/canvas/philip/tests/2d.line.miter.obtuse.html: Added.
* fast/canvas/philip/tests/2d.line.miter.rightangle.html: Added.
* fast/canvas/philip/tests/2d.line.miter.valid.html: Added.
* fast/canvas/philip/tests/2d.line.miter.within.html: Added.
* fast/canvas/philip/tests/2d.line.union.html: Added.
* fast/canvas/philip/tests/2d.line.width.basic.html: Added.
* fast/canvas/philip/tests/2d.line.width.invalid.html: Added.
* fast/canvas/philip/tests/2d.line.width.scaledefault.html: Added.
* fast/canvas/philip/tests/2d.line.width.transformed.html: Added.
* fast/canvas/philip/tests/2d.line.width.valid.html: Added.
* fast/canvas/philip/tests/2d.missingargs.html: Added.
* fast/canvas/philip/tests/2d.path.arc.angle.1.html: Added.
* fast/canvas/philip/tests/2d.path.arc.angle.2.html: Added.
* fast/canvas/philip/tests/2d.path.arc.angle.3.html: Added.
* fast/canvas/philip/tests/2d.path.arc.angle.4.html: Added.
* fast/canvas/philip/tests/2d.path.arc.angle.5.html: Added.
* fast/canvas/philip/tests/2d.path.arc.angle.6.html: Added.
* fast/canvas/philip/tests/2d.path.arc.empty.html: Added.
* fast/canvas/philip/tests/2d.path.arc.end.html: Added.
* fast/canvas/philip/tests/2d.path.arc.negative.html: Added.
* fast/canvas/philip/tests/2d.path.arc.nonempty.html: Added.
* fast/canvas/philip/tests/2d.path.arc.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.path.arc.scale.1.html: Added.
* fast/canvas/philip/tests/2d.path.arc.scale.2.html: Added.
* fast/canvas/philip/tests/2d.path.arc.selfintersect.1.html: Added.
* fast/canvas/philip/tests/2d.path.arc.selfintersect.2.html: Added.
* fast/canvas/philip/tests/2d.path.arc.shape.1.html: Added.
* fast/canvas/philip/tests/2d.path.arc.shape.2.html: Added.
* fast/canvas/philip/tests/2d.path.arc.shape.3.html: Added.
* fast/canvas/philip/tests/2d.path.arc.shape.4.html: Added.
* fast/canvas/philip/tests/2d.path.arc.shape.5.html: Added.
* fast/canvas/philip/tests/2d.path.arc.twopie.1.html: Added.
* fast/canvas/philip/tests/2d.path.arc.twopie.2.html: Added.
* fast/canvas/philip/tests/2d.path.arc.twopie.3.html: Added.
* fast/canvas/philip/tests/2d.path.arc.twopie.4.html: Added.
* fast/canvas/philip/tests/2d.path.arc.zero.1.html: Added.
* fast/canvas/philip/tests/2d.path.arc.zero.2.html: Added.
* fast/canvas/philip/tests/2d.path.arc.zeroradius.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.coincide.1.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.coincide.2.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.collinear.1.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.collinear.2.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.collinear.3.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.ensuresubpath.1.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.ensuresubpath.2.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.negative.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.scale.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.shape.curve1.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.shape.curve2.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.shape.end.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.shape.start.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.transformation.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.zero.1.html: Added.
* fast/canvas/philip/tests/2d.path.arcTo.zero.2.html: Added.
* fast/canvas/philip/tests/2d.path.beginPath.html: Added.
* fast/canvas/philip/tests/2d.path.bezierCurveTo.basic.html: Added.
* fast/canvas/philip/tests/2d.path.bezierCurveTo.ensuresubpath.1.html: Added.
* fast/canvas/philip/tests/2d.path.bezierCurveTo.ensuresubpath.2.html: Added.
* fast/canvas/philip/tests/2d.path.bezierCurveTo.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.path.bezierCurveTo.scaled.html: Added.
* fast/canvas/philip/tests/2d.path.bezierCurveTo.shape.html: Added.
* fast/canvas/philip/tests/2d.path.clip.basic.1.html: Added.
* fast/canvas/philip/tests/2d.path.clip.basic.2.html: Added.
* fast/canvas/philip/tests/2d.path.clip.empty.html: Added.
* fast/canvas/philip/tests/2d.path.clip.intersect.html: Added.
* fast/canvas/philip/tests/2d.path.clip.unaffected.html: Added.
* fast/canvas/philip/tests/2d.path.clip.winding.1.html: Added.
* fast/canvas/philip/tests/2d.path.clip.winding.2.html: Added.
* fast/canvas/philip/tests/2d.path.closePath.empty.html: Added.
* fast/canvas/philip/tests/2d.path.closePath.newline.html: Added.
* fast/canvas/philip/tests/2d.path.closePath.nextpoint.html: Added.
* fast/canvas/philip/tests/2d.path.fill.closed.basic.html: Added.
* fast/canvas/philip/tests/2d.path.fill.closed.unaffected.html: Added.
* fast/canvas/philip/tests/2d.path.fill.overlap.html: Added.
* fast/canvas/philip/tests/2d.path.fill.overlap.png: Added.
* fast/canvas/philip/tests/2d.path.fill.winding.add.html: Added.
* fast/canvas/philip/tests/2d.path.fill.winding.subtract.1.html: Added.
* fast/canvas/philip/tests/2d.path.fill.winding.subtract.2.html: Added.
* fast/canvas/philip/tests/2d.path.fill.winding.subtract.3.html: Added.
* fast/canvas/philip/tests/2d.path.initial.html: Added.
* fast/canvas/philip/tests/2d.path.isPointInPath.arc.html: Added.
* fast/canvas/philip/tests/2d.path.isPointInPath.basic.1.html: Added.
* fast/canvas/philip/tests/2d.path.isPointInPath.basic.2.html: Added.
* fast/canvas/philip/tests/2d.path.isPointInPath.bezier.html: Added.
* fast/canvas/philip/tests/2d.path.isPointInPath.bigarc.html: Added.
* fast/canvas/philip/tests/2d.path.isPointInPath.edge.html: Added.
* fast/canvas/philip/tests/2d.path.isPointInPath.empty.html: Added.
* fast/canvas/philip/tests/2d.path.isPointInPath.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.path.isPointInPath.outside.html: Added.
* fast/canvas/philip/tests/2d.path.isPointInPath.subpath.html: Added.
* fast/canvas/philip/tests/2d.path.isPointInPath.transform.1.html: Added.
* fast/canvas/philip/tests/2d.path.isPointInPath.transform.2.html: Added.
* fast/canvas/philip/tests/2d.path.isPointInPath.transform.3.html: Added.
* fast/canvas/philip/tests/2d.path.isPointInPath.unclosed.html: Added.
* fast/canvas/philip/tests/2d.path.isPointInPath.winding.html: Added.
* fast/canvas/philip/tests/2d.path.lineTo.basic.html: Added.
* fast/canvas/philip/tests/2d.path.lineTo.ensuresubpath.1.html: Added.
* fast/canvas/philip/tests/2d.path.lineTo.ensuresubpath.2.html: Added.
* fast/canvas/philip/tests/2d.path.lineTo.nextpoint.html: Added.
* fast/canvas/philip/tests/2d.path.lineTo.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.path.moveTo.basic.html: Added.
* fast/canvas/philip/tests/2d.path.moveTo.multiple.html: Added.
* fast/canvas/philip/tests/2d.path.moveTo.newsubpath.html: Added.
* fast/canvas/philip/tests/2d.path.moveTo.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.path.quadraticCurveTo.basic.html: Added.
* fast/canvas/philip/tests/2d.path.quadraticCurveTo.ensuresubpath.1.html: Added.
* fast/canvas/philip/tests/2d.path.quadraticCurveTo.ensuresubpath.2.html: Added.
* fast/canvas/philip/tests/2d.path.quadraticCurveTo.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.path.quadraticCurveTo.scaled.html: Added.
* fast/canvas/philip/tests/2d.path.quadraticCurveTo.shape.html: Added.
* fast/canvas/philip/tests/2d.path.rect.basic.html: Added.
* fast/canvas/philip/tests/2d.path.rect.closed.html: Added.
* fast/canvas/philip/tests/2d.path.rect.end.1.html: Added.
* fast/canvas/philip/tests/2d.path.rect.end.2.html: Added.
* fast/canvas/philip/tests/2d.path.rect.negative.html: Added.
* fast/canvas/philip/tests/2d.path.rect.newsubpath.html: Added.
* fast/canvas/philip/tests/2d.path.rect.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.path.rect.selfintersect.html: Added.
* fast/canvas/philip/tests/2d.path.rect.winding.html: Added.
* fast/canvas/philip/tests/2d.path.rect.zero.1.html: Added.
* fast/canvas/philip/tests/2d.path.rect.zero.2.html: Added.
* fast/canvas/philip/tests/2d.path.rect.zero.3.html: Added.
* fast/canvas/philip/tests/2d.path.rect.zero.4.html: Added.
* fast/canvas/philip/tests/2d.path.rect.zero.5.html: Added.
* fast/canvas/philip/tests/2d.path.rect.zero.6.html: Added.
* fast/canvas/philip/tests/2d.path.stroke.empty.html: Added.
* fast/canvas/philip/tests/2d.path.stroke.overlap.html: Added.
* fast/canvas/philip/tests/2d.path.stroke.overlap.png: Added.
* fast/canvas/philip/tests/2d.path.stroke.prune.arc.html: Added.
* fast/canvas/philip/tests/2d.path.stroke.prune.closed.html: Added.
* fast/canvas/philip/tests/2d.path.stroke.prune.corner.html: Added.
* fast/canvas/philip/tests/2d.path.stroke.prune.curve.html: Added.
* fast/canvas/philip/tests/2d.path.stroke.prune.line.html: Added.
* fast/canvas/philip/tests/2d.path.stroke.prune.rect.html: Added.
* fast/canvas/philip/tests/2d.path.stroke.scale1.html: Added.
* fast/canvas/philip/tests/2d.path.stroke.scale2.html: Added.
* fast/canvas/philip/tests/2d.path.stroke.skew.html: Added.
* fast/canvas/philip/tests/2d.path.stroke.unaffected.html: Added.
* fast/canvas/philip/tests/2d.path.stroke.union.html: Added.
* fast/canvas/philip/tests/2d.path.transformation.basic.html: Added.
* fast/canvas/philip/tests/2d.path.transformation.changing.html: Added.
* fast/canvas/philip/tests/2d.path.transformation.multiple.html: Added.
* fast/canvas/philip/tests/2d.pattern.animated.gif.html: Added.
* fast/canvas/philip/tests/2d.pattern.basic.canvas.html: Added.
* fast/canvas/philip/tests/2d.pattern.basic.image.html: Added.
* fast/canvas/philip/tests/2d.pattern.basic.nocontext.html: Added.
* fast/canvas/philip/tests/2d.pattern.basic.type.html: Added.
* fast/canvas/philip/tests/2d.pattern.basic.zerocanvas.html: Added.
* fast/canvas/philip/tests/2d.pattern.crosscanvas.html: Added.
* fast/canvas/philip/tests/2d.pattern.image.broken.html: Added.
* fast/canvas/philip/tests/2d.pattern.image.incomplete.html: Added.
* fast/canvas/philip/tests/2d.pattern.image.null.html: Added.
* fast/canvas/philip/tests/2d.pattern.image.string.html: Added.
* fast/canvas/philip/tests/2d.pattern.image.undefined.html: Added.
* fast/canvas/philip/tests/2d.pattern.modify.canvas1.html: Added.
* fast/canvas/philip/tests/2d.pattern.modify.canvas2.html: Added.
* fast/canvas/philip/tests/2d.pattern.modify.image1.html: Added.
* fast/canvas/philip/tests/2d.pattern.modify.image2.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.norepeat.basic.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.norepeat.coord1.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.norepeat.coord2.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.norepeat.coord3.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.norepeat.outside.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.orientation.canvas.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.orientation.image.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.repeat.basic.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.repeat.coord1.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.repeat.coord2.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.repeat.coord3.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.repeat.outside.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.repeatx.basic.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.repeatx.coord1.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.repeatx.outside.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.repeaty.basic.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.repeaty.coord1.html: Added.
* fast/canvas/philip/tests/2d.pattern.paint.repeaty.outside.html: Added.
* fast/canvas/philip/tests/2d.pattern.repeat.case.html: Added.
* fast/canvas/philip/tests/2d.pattern.repeat.empty.html: Added.
* fast/canvas/philip/tests/2d.pattern.repeat.null.html: Added.
* fast/canvas/philip/tests/2d.pattern.repeat.nullsuffix.html: Added.
* fast/canvas/philip/tests/2d.pattern.repeat.undefined.html: Added.
* fast/canvas/philip/tests/2d.pattern.repeat.unrecognised.html: Added.
* fast/canvas/philip/tests/2d.scaled.html: Added.
* fast/canvas/philip/tests/2d.scaled.png: Added.
* fast/canvas/philip/tests/2d.shadow.alpha.1.html: Added.
* fast/canvas/philip/tests/2d.shadow.alpha.2.html: Added.
* fast/canvas/philip/tests/2d.shadow.alpha.2.png: Added.
* fast/canvas/philip/tests/2d.shadow.alpha.3.html: Added.
* fast/canvas/philip/tests/2d.shadow.alpha.3.png: Added.
* fast/canvas/philip/tests/2d.shadow.alpha.4.html: Added.
* fast/canvas/philip/tests/2d.shadow.alpha.4.png: Added.
* fast/canvas/philip/tests/2d.shadow.alpha.5.html: Added.
* fast/canvas/philip/tests/2d.shadow.alpha.5.png: Added.
* fast/canvas/philip/tests/2d.shadow.attributes.shadowBlur.initial.html: Added.
* fast/canvas/philip/tests/2d.shadow.attributes.shadowBlur.invalid.html: Added.
* fast/canvas/philip/tests/2d.shadow.attributes.shadowBlur.valid.html: Added.
* fast/canvas/philip/tests/2d.shadow.attributes.shadowColor.initial.html: Added.
* fast/canvas/philip/tests/2d.shadow.attributes.shadowColor.invalid.html: Added.
* fast/canvas/philip/tests/2d.shadow.attributes.shadowColor.valid.html: Added.
* fast/canvas/philip/tests/2d.shadow.attributes.shadowOffset.initial.html: Added.
* fast/canvas/philip/tests/2d.shadow.attributes.shadowOffset.invalid.html: Added.
* fast/canvas/philip/tests/2d.shadow.attributes.shadowOffset.valid.html: Added.
* fast/canvas/philip/tests/2d.shadow.blur.high.html: Added.
* fast/canvas/philip/tests/2d.shadow.blur.high.png: Added.
* fast/canvas/philip/tests/2d.shadow.blur.low.html: Added.
* fast/canvas/philip/tests/2d.shadow.blur.low.png: Added.
* fast/canvas/philip/tests/2d.shadow.canvas.alpha.html: Added.
* fast/canvas/philip/tests/2d.shadow.canvas.alpha.png: Added.
* fast/canvas/philip/tests/2d.shadow.canvas.basic.html: Added.
* fast/canvas/philip/tests/2d.shadow.canvas.transparent.1.html: Added.
* fast/canvas/philip/tests/2d.shadow.canvas.transparent.2.html: Added.
* fast/canvas/philip/tests/2d.shadow.clip.1.html: Added.
* fast/canvas/philip/tests/2d.shadow.clip.2.html: Added.
* fast/canvas/philip/tests/2d.shadow.clip.3.html: Added.
* fast/canvas/philip/tests/2d.shadow.composite.1.html: Added.
* fast/canvas/philip/tests/2d.shadow.composite.2.html: Added.
* fast/canvas/philip/tests/2d.shadow.composite.3.html: Added.
* fast/canvas/philip/tests/2d.shadow.enable.blur.html: Added.
* fast/canvas/philip/tests/2d.shadow.enable.off.1.html: Added.
* fast/canvas/philip/tests/2d.shadow.enable.off.2.html: Added.
* fast/canvas/philip/tests/2d.shadow.enable.x.html: Added.
* fast/canvas/philip/tests/2d.shadow.enable.y.html: Added.
* fast/canvas/philip/tests/2d.shadow.gradient.alpha.html: Added.
* fast/canvas/philip/tests/2d.shadow.gradient.alpha.png: Added.
* fast/canvas/philip/tests/2d.shadow.gradient.basic.html: Added.
* fast/canvas/philip/tests/2d.shadow.gradient.transparent.1.html: Added.
* fast/canvas/philip/tests/2d.shadow.gradient.transparent.2.html: Added.
* fast/canvas/philip/tests/2d.shadow.image.alpha.html: Added.
* fast/canvas/philip/tests/2d.shadow.image.alpha.png: Added.
* fast/canvas/philip/tests/2d.shadow.image.basic.html: Added.
* fast/canvas/philip/tests/2d.shadow.image.scale.html: Added.
* fast/canvas/philip/tests/2d.shadow.image.section.html: Added.
* fast/canvas/philip/tests/2d.shadow.image.transparent.1.html: Added.
* fast/canvas/philip/tests/2d.shadow.image.transparent.2.html: Added.
* fast/canvas/philip/tests/2d.shadow.offset.negativeX.html: Added.
* fast/canvas/philip/tests/2d.shadow.offset.negativeY.html: Added.
* fast/canvas/philip/tests/2d.shadow.offset.positiveX.html: Added.
* fast/canvas/philip/tests/2d.shadow.offset.positiveY.html: Added.
* fast/canvas/philip/tests/2d.shadow.outside.html: Added.
* fast/canvas/philip/tests/2d.shadow.pattern.alpha.html: Added.
* fast/canvas/philip/tests/2d.shadow.pattern.alpha.png: Added.
* fast/canvas/philip/tests/2d.shadow.pattern.basic.html: Added.
* fast/canvas/philip/tests/2d.shadow.pattern.transparent.1.html: Added.
* fast/canvas/philip/tests/2d.shadow.pattern.transparent.2.html: Added.
* fast/canvas/philip/tests/2d.shadow.stroke.basic.html: Added.
* fast/canvas/philip/tests/2d.shadow.stroke.cap.1.html: Added.
* fast/canvas/philip/tests/2d.shadow.stroke.cap.2.html: Added.
* fast/canvas/philip/tests/2d.shadow.stroke.join.1.html: Added.
* fast/canvas/philip/tests/2d.shadow.stroke.join.2.html: Added.
* fast/canvas/philip/tests/2d.shadow.stroke.join.3.html: Added.
* fast/canvas/philip/tests/2d.shadow.transform.1.html: Added.
* fast/canvas/philip/tests/2d.shadow.transform.2.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.bitmap.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.clip.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.fillStyle.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.font.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.globalAlpha.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.globalCompositeOperation.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.lineCap.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.lineJoin.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.lineWidth.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.miterLimit.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.path.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.shadowBlur.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.shadowColor.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.shadowOffsetX.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.shadowOffsetY.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.stack.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.stackdepth.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.strokeStyle.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.textAlign.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.textBaseline.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.transformation.html: Added.
* fast/canvas/philip/tests/2d.state.saverestore.underflow.html: Added.
* fast/canvas/philip/tests/2d.strokeRect.basic.html: Added.
* fast/canvas/philip/tests/2d.strokeRect.clip.html: Added.
* fast/canvas/philip/tests/2d.strokeRect.globalalpha.html: Added.
* fast/canvas/philip/tests/2d.strokeRect.globalcomposite.html: Added.
* fast/canvas/philip/tests/2d.strokeRect.negative.html: Added.
* fast/canvas/philip/tests/2d.strokeRect.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.strokeRect.path.html: Added.
* fast/canvas/philip/tests/2d.strokeRect.shadow.html: Added.
* fast/canvas/philip/tests/2d.strokeRect.transform.html: Added.
* fast/canvas/philip/tests/2d.strokeRect.zero.1.html: Added.
* fast/canvas/philip/tests/2d.strokeRect.zero.2.html: Added.
* fast/canvas/philip/tests/2d.strokeRect.zero.3.html: Added.
* fast/canvas/philip/tests/2d.strokeRect.zero.4.html: Added.
* fast/canvas/philip/tests/2d.strokeRect.zero.5.html: Added.
* fast/canvas/philip/tests/2d.strokeStyle.default.html: Added.
* fast/canvas/philip/tests/2d.text.align.default.html: Added.
* fast/canvas/philip/tests/2d.text.align.invalid.html: Added.
* fast/canvas/philip/tests/2d.text.align.valid.html: Added.
* fast/canvas/philip/tests/2d.text.baseline.default.html: Added.
* fast/canvas/philip/tests/2d.text.baseline.invalid.html: Added.
* fast/canvas/philip/tests/2d.text.baseline.valid.html: Added.
* fast/canvas/philip/tests/2d.text.draw.align.center.html: Added.
* fast/canvas/philip/tests/2d.text.draw.align.end.ltr.html: Added.
* fast/canvas/philip/tests/2d.text.draw.align.end.rtl.html: Added.
* fast/canvas/philip/tests/2d.text.draw.align.left.html: Added.
* fast/canvas/philip/tests/2d.text.draw.align.right.html: Added.
* fast/canvas/philip/tests/2d.text.draw.align.start.ltr.html: Added.
* fast/canvas/philip/tests/2d.text.draw.align.start.rtl.html: Added.
* fast/canvas/philip/tests/2d.text.draw.baseline.alphabetic.html: Added.
* fast/canvas/philip/tests/2d.text.draw.baseline.bottom.html: Added.
* fast/canvas/philip/tests/2d.text.draw.baseline.hanging.html: Added.
* fast/canvas/philip/tests/2d.text.draw.baseline.ideographic.html: Added.
* fast/canvas/philip/tests/2d.text.draw.baseline.middle.html: Added.
* fast/canvas/philip/tests/2d.text.draw.baseline.top.html: Added.
* fast/canvas/philip/tests/2d.text.draw.fill.basic.html: Added.
* fast/canvas/philip/tests/2d.text.draw.fill.basic.png: Added.
* fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.bound.html: Added.
* fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.fontface.html: Added.
* fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.large.html: Added.
* fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.large.png: Added.
* fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.small.html: Added.
* fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.zero.html: Added.
* fast/canvas/philip/tests/2d.text.draw.fill.rtl.html: Added.
* fast/canvas/philip/tests/2d.text.draw.fill.rtl.png: Added.
* fast/canvas/philip/tests/2d.text.draw.fill.unaffected.html: Added.
* fast/canvas/philip/tests/2d.text.draw.fontface.html: Added.
* fast/canvas/philip/tests/2d.text.draw.fontface.notinpage.html: Added.
* fast/canvas/philip/tests/2d.text.draw.fontface.repeat.html: Added.
* fast/canvas/philip/tests/2d.text.draw.kern.consistent.html: Added.
* fast/canvas/philip/tests/2d.text.draw.space.basic.html: Added.
* fast/canvas/philip/tests/2d.text.draw.space.collapse.end.html: Added.
* fast/canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html: Added.
* fast/canvas/philip/tests/2d.text.draw.space.collapse.other.html: Added.
* fast/canvas/philip/tests/2d.text.draw.space.collapse.space.html: Added.
* fast/canvas/philip/tests/2d.text.draw.space.collapse.start.html: Added.
* fast/canvas/philip/tests/2d.text.draw.stroke.basic.html: Added.
* fast/canvas/philip/tests/2d.text.draw.stroke.basic.png: Added.
* fast/canvas/philip/tests/2d.text.draw.stroke.unaffected.html: Added.
* fast/canvas/philip/tests/2d.text.font.default.html: Added.
* fast/canvas/philip/tests/2d.text.font.parse.basic.html: Added.
* fast/canvas/philip/tests/2d.text.font.parse.complex.html: Added.
* fast/canvas/philip/tests/2d.text.font.parse.invalid.html: Added.
* fast/canvas/philip/tests/2d.text.font.parse.size.percentage.default.html: Added.
* fast/canvas/philip/tests/2d.text.font.parse.size.percentage.html: Added.
* fast/canvas/philip/tests/2d.text.font.parse.system.html: Added.
* fast/canvas/philip/tests/2d.text.measure.width.basic.html: Added.
* fast/canvas/philip/tests/2d.text.measure.width.empty.html: Added.
* fast/canvas/philip/tests/2d.text.measure.width.space.html: Added.
* fast/canvas/philip/tests/2d.transformation.order.html: Added.
* fast/canvas/philip/tests/2d.transformation.rotate.direction.html: Added.
* fast/canvas/philip/tests/2d.transformation.rotate.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.transformation.rotate.radians.html: Added.
* fast/canvas/philip/tests/2d.transformation.rotate.wrap.html: Added.
* fast/canvas/philip/tests/2d.transformation.rotate.wrapnegative.html: Added.
* fast/canvas/philip/tests/2d.transformation.rotate.zero.html: Added.
* fast/canvas/philip/tests/2d.transformation.scale.basic.html: Added.
* fast/canvas/philip/tests/2d.transformation.scale.large.html: Added.
* fast/canvas/philip/tests/2d.transformation.scale.multiple.html: Added.
* fast/canvas/philip/tests/2d.transformation.scale.negative.html: Added.
* fast/canvas/philip/tests/2d.transformation.scale.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.transformation.scale.zero.html: Added.
* fast/canvas/philip/tests/2d.transformation.setTransform.multiple.html: Added.
* fast/canvas/philip/tests/2d.transformation.setTransform.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.transformation.setTransform.skewed.html: Added.
* fast/canvas/philip/tests/2d.transformation.transform.identity.html: Added.
* fast/canvas/philip/tests/2d.transformation.transform.multiply.html: Added.
* fast/canvas/philip/tests/2d.transformation.transform.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.transformation.transform.skewed.html: Added.
* fast/canvas/philip/tests/2d.transformation.translate.basic.html: Added.
* fast/canvas/philip/tests/2d.transformation.translate.nonfinite.html: Added.
* fast/canvas/philip/tests/2d.voidreturn.html: Added.
* fast/canvas/philip/tests/clear-100x50.png: Added.
* fast/canvas/philip/tests/context.casesensitive.html: Added.
* fast/canvas/philip/tests/context.emptystring.html: Added.
* fast/canvas/philip/tests/context.unrecognised.badname.html: Added.
* fast/canvas/philip/tests/context.unrecognised.badsuffix.html: Added.
* fast/canvas/philip/tests/context.unrecognised.nullsuffix.html: Added.
* fast/canvas/philip/tests/context.unrecognised.unicode.html: Added.
* fast/canvas/philip/tests/fallback.basic.html: Added.
* fast/canvas/philip/tests/fallback.multiple.html: Added.
* fast/canvas/philip/tests/fallback.nested.html: Added.
* fast/canvas/philip/tests/green-100x50.png: Added.
* fast/canvas/philip/tests/initial.colour.html: Added.
* fast/canvas/philip/tests/initial.colour.png: Added.
* fast/canvas/philip/tests/initial.reset.2dstate.html: Added.
* fast/canvas/philip/tests/initial.reset.clip.html: Added.
* fast/canvas/philip/tests/initial.reset.different.html: Added.
* fast/canvas/philip/tests/initial.reset.different.png: Added.
* fast/canvas/philip/tests/initial.reset.gradient.html: Added.
* fast/canvas/philip/tests/initial.reset.path.html: Added.
* fast/canvas/philip/tests/initial.reset.path.png: Added.
* fast/canvas/philip/tests/initial.reset.pattern.html: Added.
* fast/canvas/philip/tests/initial.reset.same.html: Added.
* fast/canvas/philip/tests/initial.reset.same.png: Added.
* fast/canvas/philip/tests/initial.reset.transform.html: Added.
* fast/canvas/philip/tests/security.dataURI.html: Added.
* fast/canvas/philip/tests/security.drawImage.canvas.html: Added.
* fast/canvas/philip/tests/security.drawImage.image.html: Added.
* fast/canvas/philip/tests/security.pattern.canvas.fillStyle.html: Added.
* fast/canvas/philip/tests/security.pattern.canvas.strokeStyle.html: Added.
* fast/canvas/philip/tests/security.pattern.canvas.timing.html: Added.
* fast/canvas/philip/tests/security.pattern.create.html: Added.
* fast/canvas/philip/tests/security.pattern.cross.html: Added.
* fast/canvas/philip/tests/security.pattern.image.fillStyle.html: Added.
* fast/canvas/philip/tests/security.pattern.image.strokeStyle.html: Added.
* fast/canvas/philip/tests/security.reset.html: Added.
* fast/canvas/philip/tests/size.attributes.default.html: Added.
* fast/canvas/philip/tests/size.attributes.default.png: Added.
* fast/canvas/philip/tests/size.attributes.get.html: Added.
* fast/canvas/philip/tests/size.attributes.get.png: Added.
* fast/canvas/philip/tests/size.attributes.idl.html: Added.
* fast/canvas/philip/tests/size.attributes.idl.set.zero.html: Added.
* fast/canvas/philip/tests/size.attributes.parse.decimal.html: Added.
* fast/canvas/philip/tests/size.attributes.parse.decimal.png: Added.
* fast/canvas/philip/tests/size.attributes.parse.em.html: Added.
* fast/canvas/philip/tests/size.attributes.parse.em.png: Added.
* fast/canvas/philip/tests/size.attributes.parse.empty.html: Added.
* fast/canvas/philip/tests/size.attributes.parse.empty.png: Added.
* fast/canvas/philip/tests/size.attributes.parse.exp.html: Added.
* fast/canvas/philip/tests/size.attributes.parse.exp.png: Added.
* fast/canvas/philip/tests/size.attributes.parse.hex.html: Added.
* fast/canvas/philip/tests/size.attributes.parse.junk.html: Added.
* fast/canvas/philip/tests/size.attributes.parse.junk.png: Added.
* fast/canvas/philip/tests/size.attributes.parse.minus.html: Added.
* fast/canvas/philip/tests/size.attributes.parse.minus.png: Added.
* fast/canvas/philip/tests/size.attributes.parse.octal.html: Added.
* fast/canvas/philip/tests/size.attributes.parse.octal.png: Added.
* fast/canvas/philip/tests/size.attributes.parse.onlyspace.html: Added.
* fast/canvas/philip/tests/size.attributes.parse.onlyspace.png: Added.
* fast/canvas/philip/tests/size.attributes.parse.percent.html: Added.
* fast/canvas/philip/tests/size.attributes.parse.percent.png: Added.
* fast/canvas/philip/tests/size.attributes.parse.plus.html: Added.
* fast/canvas/philip/tests/size.attributes.parse.plus.png: Added.
* fast/canvas/philip/tests/size.attributes.parse.space.html: Added.
* fast/canvas/philip/tests/size.attributes.parse.space.png: Added.
* fast/canvas/philip/tests/size.attributes.parse.trailingjunk.html: Added.
* fast/canvas/philip/tests/size.attributes.parse.trailingjunk.png: Added.
* fast/canvas/philip/tests/size.attributes.parse.whitespace.html: Added.
* fast/canvas/philip/tests/size.attributes.parse.whitespace.png: Added.
* fast/canvas/philip/tests/size.attributes.parse.zero.html: Added.
* fast/canvas/philip/tests/size.attributes.reflect.setcontent.html: Added.
* fast/canvas/philip/tests/size.attributes.reflect.setcontent.png: Added.
* fast/canvas/philip/tests/size.attributes.reflect.setidl.html: Added.
* fast/canvas/philip/tests/size.attributes.reflect.setidl.png: Added.
* fast/canvas/philip/tests/size.attributes.reflect.setidlzero.html: Added.
* fast/canvas/philip/tests/size.attributes.removed.html: Added.
* fast/canvas/philip/tests/size.attributes.removed.png: Added.
* fast/canvas/philip/tests/size.attributes.set.html: Added.
* fast/canvas/philip/tests/size.attributes.set.png: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.decimal.html: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.decimal.png: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.em.html: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.em.png: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.empty.html: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.empty.png: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.exp.html: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.exp.png: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.hex.html: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.junk.html: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.junk.png: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.minus.html: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.minus.png: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.octal.html: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.octal.png: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.onlyspace.html: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.onlyspace.png: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.percent.html: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.percent.png: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.plus.html: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.plus.png: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.space.html: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.space.png: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.trailingjunk.html: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.trailingjunk.png: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.whitespace.html: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.whitespace.png: Added.
* fast/canvas/philip/tests/size.attributes.setAttribute.zero.html: Added.
* fast/canvas/philip/tests/size.attributes.style.html: Added.
* fast/canvas/philip/tests/size.attributes.style.png: Added.
* fast/canvas/philip/tests/toDataURL.arguments.1.html: Added.
* fast/canvas/philip/tests/toDataURL.arguments.2.html: Added.
* fast/canvas/philip/tests/toDataURL.arguments.3.html: Added.
* fast/canvas/philip/tests/toDataURL.bogustype.html: Added.
* fast/canvas/philip/tests/toDataURL.default.html: Added.
* fast/canvas/philip/tests/toDataURL.jpeg.alpha.html: Added.
* fast/canvas/philip/tests/toDataURL.jpeg.alpha.png: Added.
* fast/canvas/philip/tests/toDataURL.jpeg.primarycolours.html: Added.
* fast/canvas/philip/tests/toDataURL.jpeg.primarycolours.png: Added.
* fast/canvas/philip/tests/toDataURL.jpeg.quality.basic.html: Added.
* fast/canvas/philip/tests/toDataURL.jpeg.quality.basic.png: Added.
* fast/canvas/philip/tests/toDataURL.jpeg.quality.notnumber.html: Added.
* fast/canvas/philip/tests/toDataURL.jpeg.quality.outsiderange.html: Added.
* fast/canvas/philip/tests/toDataURL.lowercase.ascii.html: Added.
* fast/canvas/philip/tests/toDataURL.lowercase.unicode.html: Added.
* fast/canvas/philip/tests/toDataURL.nocontext.html: Added.
* fast/canvas/philip/tests/toDataURL.png.complexcolours.html: Added.
* fast/canvas/philip/tests/toDataURL.png.complexcolours.png: Added.
* fast/canvas/philip/tests/toDataURL.png.html: Added.
* fast/canvas/philip/tests/toDataURL.png.primarycolours.html: Added.
* fast/canvas/philip/tests/toDataURL.png.primarycolours.png: Added.
* fast/canvas/philip/tests/toDataURL.unrecognised.html: Added.
* fast/canvas/philip/tests/toDataURL.zerosize.html: Added.
* fast/canvas/philip/tests/type.delete.html: Added.
* fast/canvas/philip/tests/type.exists.html: Added.
* fast/canvas/philip/tests/type.extend.html: Added.
* fast/canvas/philip/tests/type.name.html: Added.
* fast/canvas/philip/tests/type.prototype.html: Added.
* fast/canvas/philip/tests/type.replace.html: Added.
* platform/chromium/test_expectations.txt:
* platform/gtk/Skipped:
* platform/mac/Skipped:
* platform/qt/Skipped:
* platform/win/Skipped:
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@59954 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/fast/canvas/philip/tests/.reportgen.html.swp b/LayoutTests/fast/canvas/philip/tests/.reportgen.html.swp
new file mode 100644
index 0000000..65bc918
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/.reportgen.html.swp
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/.reportgen.js.swp b/LayoutTests/fast/canvas/philip/tests/.reportgen.js.swp
new file mode 100644
index 0000000..1d7c04f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/.reportgen.js.swp
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.canvas.readonly.html b/LayoutTests/fast/canvas/philip/tests/2d.canvas.readonly.html
new file mode 100644
index 0000000..2b12551
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.canvas.readonly.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.canvas.readonly</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.canvas.reference.html" title="2d.canvas.reference">
+<link rel="next" href="2d.state.saverestore.strokeStyle.html" title="2d.state.saverestore.strokeStyle">
+<body class="show_output">
+<p>
+ <a href="2d.canvas.reference.html" accesskey="p" title="[p] 2d.canvas.reference"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.strokeStyle.html" accesskey="n" title="[n] 2d.state.saverestore.strokeStyle">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.canvas.html">canvas</a>.readonly</h1>
+<p class="desc">CanvasRenderingContext2D.canvas is readonly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.canvas.attribute">2d.canvas.attribute</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var c = document.createElement('canvas');
+var d = ctx.canvas;
+_assertDifferent(c, d, "c", "d");
+try { ctx.canvas = c; } catch (e) {} // TODO: not sure whether this should throw or not...
+_assertSame(ctx.canvas, d, "ctx.canvas", "d");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.canvas.reference.html b/LayoutTests/fast/canvas/philip/tests/2d.canvas.reference.html
new file mode 100644
index 0000000..b85b482
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.canvas.reference.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.canvas.reference</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.scaled.html" title="2d.scaled">
+<link rel="next" href="2d.canvas.readonly.html" title="2d.canvas.readonly">
+<body class="show_output">
+<p>
+ <a href="2d.scaled.html" accesskey="p" title="[p] 2d.scaled"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.canvas.readonly.html" accesskey="n" title="[n] 2d.canvas.readonly">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.canvas.html">canvas</a>.reference</h1>
+<p class="desc">CanvasRenderingContext2D.canvas refers back to its canvas</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.canvas">2d.canvas</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(ctx.canvas, canvas, "ctx.canvas", "canvas");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.clearRect.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.basic.html
new file mode 100644
index 0000000..763c9f6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.basic.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.clearRect.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.composite.3.html" title="2d.shadow.composite.3">
+<link rel="next" href="2d.clearRect.path.html" title="2d.clearRect.path">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.composite.3.html" accesskey="p" title="[p] 2d.shadow.composite.3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.clearRect.path.html" accesskey="n" title="[n] 2d.clearRect.path">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.clearRect.html">clearRect</a>.basic</h1>
+<p class="desc">clearRect clears to transparent black</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.clearRect">2d.clearRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="clear-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.clearRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.clearRect.clip.html b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.clip.html
new file mode 100644
index 0000000..789b802a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.clip.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.clearRect.clip</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.clearRect.globalcomposite.html" title="2d.clearRect.globalcomposite">
+<link rel="next" href="2d.clearRect.shadow.html" title="2d.clearRect.shadow">
+<body class="show_output">
+<p>
+ <a href="2d.clearRect.globalcomposite.html" accesskey="p" title="[p] 2d.clearRect.globalcomposite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.clearRect.shadow.html" accesskey="n" title="[n] 2d.clearRect.shadow">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.clearRect.html">clearRect</a>.clip</h1>
+<p class="desc">clearRect is affected by clipping regions</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.clearRect">2d.clearRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.beginPath();
+ctx.rect(0, 0, 16, 16);
+ctx.clip();
+
+ctx.clearRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 16, 16);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.clearRect.globalalpha.html b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.globalalpha.html
new file mode 100644
index 0000000..2c9c369
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.globalalpha.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.clearRect.globalalpha</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.clearRect.transform.html" title="2d.clearRect.transform">
+<link rel="next" href="2d.clearRect.globalcomposite.html" title="2d.clearRect.globalcomposite">
+<body class="show_output">
+<p>
+ <a href="2d.clearRect.transform.html" accesskey="p" title="[p] 2d.clearRect.transform"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.clearRect.globalcomposite.html" accesskey="n" title="[n] 2d.clearRect.globalcomposite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.clearRect.html">clearRect</a>.globalalpha</h1>
+<p class="desc">clearRect is not affected by globalAlpha</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.clearRect">2d.clearRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="clear-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalAlpha = 0.1;
+ctx.clearRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.clearRect.globalcomposite.html b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.globalcomposite.html
new file mode 100644
index 0000000..8a14e2a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.globalcomposite.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.clearRect.globalcomposite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.clearRect.globalalpha.html" title="2d.clearRect.globalalpha">
+<link rel="next" href="2d.clearRect.clip.html" title="2d.clearRect.clip">
+<body class="show_output">
+<p>
+ <a href="2d.clearRect.globalalpha.html" accesskey="p" title="[p] 2d.clearRect.globalalpha"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.clearRect.clip.html" accesskey="n" title="[n] 2d.clearRect.clip">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.clearRect.html">clearRect</a>.globalcomposite</h1>
+<p class="desc">clearRect is not affected by globalCompositeOperation</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.clearRect">2d.clearRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="clear-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.clearRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.clearRect.negative.html b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.negative.html
new file mode 100644
index 0000000..c936967
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.negative.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.clearRect.negative</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.clearRect.zero.html" title="2d.clearRect.zero">
+<link rel="next" href="2d.clearRect.transform.html" title="2d.clearRect.transform">
+<body class="show_output">
+<p>
+ <a href="2d.clearRect.zero.html" accesskey="p" title="[p] 2d.clearRect.zero"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.clearRect.transform.html" accesskey="n" title="[n] 2d.clearRect.transform">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.clearRect.html">clearRect</a>.negative</h1>
+<p class="desc">clearRect of negative sizes works</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.clearRect">2d.clearRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="clear-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.clearRect(0, 0, 50, 25);
+ctx.clearRect(100, 0, -50, 25);
+ctx.clearRect(0, 50, 50, -25);
+ctx.clearRect(100, 50, -50, -25);
+_assertPixel(canvas, 25,12, 0,0,0,0, "25,12", "0,0,0,0");
+_assertPixel(canvas, 75,12, 0,0,0,0, "75,12", "0,0,0,0");
+_assertPixel(canvas, 25,37, 0,0,0,0, "25,37", "0,0,0,0");
+_assertPixel(canvas, 75,37, 0,0,0,0, "75,37", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.clearRect.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.nonfinite.html
new file mode 100644
index 0000000..149fd96
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.nonfinite.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.clearRect.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.clearRect.shadow.html" title="2d.clearRect.shadow">
+<link rel="next" href="2d.fillRect.basic.html" title="2d.fillRect.basic">
+<body class="show_output">
+<p>
+ <a href="2d.clearRect.shadow.html" accesskey="p" title="[p] 2d.clearRect.shadow"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillRect.basic.html" accesskey="n" title="[n] 2d.fillRect.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.clearRect.html">clearRect</a>.nonfinite</h1>
+<p class="desc">clearRect() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.clearRect(Infinity, 0, 100, 50);
+ctx.clearRect(-Infinity, 0, 100, 50);
+ctx.clearRect(NaN, 0, 100, 50);
+ctx.clearRect(0, Infinity, 100, 50);
+ctx.clearRect(0, -Infinity, 100, 50);
+ctx.clearRect(0, NaN, 100, 50);
+ctx.clearRect(0, 0, Infinity, 50);
+ctx.clearRect(0, 0, -Infinity, 50);
+ctx.clearRect(0, 0, NaN, 50);
+ctx.clearRect(0, 0, 100, Infinity);
+ctx.clearRect(0, 0, 100, -Infinity);
+ctx.clearRect(0, 0, 100, NaN);
+ctx.clearRect(Infinity, Infinity, 100, 50);
+ctx.clearRect(Infinity, Infinity, Infinity, 50);
+ctx.clearRect(Infinity, Infinity, Infinity, Infinity);
+ctx.clearRect(Infinity, Infinity, 100, Infinity);
+ctx.clearRect(Infinity, 0, Infinity, 50);
+ctx.clearRect(Infinity, 0, Infinity, Infinity);
+ctx.clearRect(Infinity, 0, 100, Infinity);
+ctx.clearRect(0, Infinity, Infinity, 50);
+ctx.clearRect(0, Infinity, Infinity, Infinity);
+ctx.clearRect(0, Infinity, 100, Infinity);
+ctx.clearRect(0, 0, Infinity, Infinity);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.clearRect.path.html b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.path.html
new file mode 100644
index 0000000..1c2e715
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.path.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.clearRect.path</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.clearRect.basic.html" title="2d.clearRect.basic">
+<link rel="next" href="2d.clearRect.zero.html" title="2d.clearRect.zero">
+<body class="show_output">
+<p>
+ <a href="2d.clearRect.basic.html" accesskey="p" title="[p] 2d.clearRect.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.clearRect.zero.html" accesskey="n" title="[n] 2d.clearRect.zero">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.clearRect.html">clearRect</a>.path</h1>
+<p class="desc">clearRect does not affect the current path</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.clearRect">2d.clearRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.beginPath();
+ctx.rect(0, 0, 100, 50);
+ctx.clearRect(0, 0, 16, 16);
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.clearRect.shadow.html b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.shadow.html
new file mode 100644
index 0000000..e5c482e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.shadow.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.clearRect.shadow</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.clearRect.clip.html" title="2d.clearRect.clip">
+<link rel="next" href="2d.clearRect.nonfinite.html" title="2d.clearRect.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.clearRect.clip.html" accesskey="p" title="[p] 2d.clearRect.clip"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.clearRect.nonfinite.html" accesskey="n" title="[n] 2d.clearRect.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.clearRect.html">clearRect</a>.shadow</h1>
+<p class="desc">clearRect does not draw shadows</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.clearRect">2d.clearRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowColor = '#f00';
+ctx.shadowBlur = 0;
+ctx.shadowOffsetX = 0;
+ctx.shadowOffsetY = 50;
+ctx.clearRect(0, -50, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.clearRect.transform.html b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.transform.html
new file mode 100644
index 0000000..6b84b8d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.transform.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.clearRect.transform</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.clearRect.negative.html" title="2d.clearRect.negative">
+<link rel="next" href="2d.clearRect.globalalpha.html" title="2d.clearRect.globalalpha">
+<body class="show_output">
+<p>
+ <a href="2d.clearRect.negative.html" accesskey="p" title="[p] 2d.clearRect.negative"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.clearRect.globalalpha.html" accesskey="n" title="[n] 2d.clearRect.globalalpha">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.clearRect.html">clearRect</a>.transform</h1>
+<p class="desc">clearRect is affected by transforms</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.clearRect">2d.clearRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="clear-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.scale(10, 10);
+ctx.translate(0, 5);
+ctx.clearRect(0, -5, 10, 5);
+_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.clearRect.zero.html b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.zero.html
new file mode 100644
index 0000000..ccc5287
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.clearRect.zero.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.clearRect.zero</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.clearRect.path.html" title="2d.clearRect.path">
+<link rel="next" href="2d.clearRect.negative.html" title="2d.clearRect.negative">
+<body class="show_output">
+<p>
+ <a href="2d.clearRect.path.html" accesskey="p" title="[p] 2d.clearRect.path"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.clearRect.negative.html" accesskey="n" title="[n] 2d.clearRect.negative">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.clearRect.html">clearRect</a>.zero</h1>
+<p class="desc">clearRect of zero pixels has no effect</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.clearRect">2d.clearRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.clearRect(0, 0, 100, 0);
+ctx.clearRect(0, 0, 0, 50);
+ctx.clearRect(0, 0, 0, 0);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.copy.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.copy.html
new file mode 100644
index 0000000..7d10dcd
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.copy.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.canvas.copy</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.canvas.xor.html" title="2d.composite.canvas.xor">
+<link rel="next" href="2d.composite.canvas.lighter.html" title="2d.composite.canvas.lighter">
+<body class="show_output">
+<p>
+ <a href="2d.composite.canvas.xor.html" accesskey="p" title="[p] 2d.composite.canvas.xor"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.canvas.lighter.html" accesskey="n" title="[n] 2d.composite.canvas.lighter">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.canvas.html">canvas</a>.copy</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.copy">2d.composite.copy</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = canvas.width;
+canvas2.height = canvas.height;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'copy';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 255,255,0,191, "50,25", "255,255,0,191", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.copy.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.copy.png
new file mode 100644
index 0000000..8e0668e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.copy.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-atop.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-atop.html
new file mode 100644
index 0000000..c74e6af
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-atop.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.canvas.destination-atop</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.canvas.source-atop.html" title="2d.composite.canvas.source-atop">
+<link rel="next" href="2d.composite.canvas.xor.html" title="2d.composite.canvas.xor">
+<body class="show_output">
+<p>
+ <a href="2d.composite.canvas.source-atop.html" accesskey="p" title="[p] 2d.composite.canvas.source-atop"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.canvas.xor.html" accesskey="n" title="[n] 2d.composite.canvas.xor">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.canvas.html">canvas</a>.destination-atop</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-atop">2d.composite.destination-atop</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = canvas.width;
+canvas2.height = canvas.height;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 127,255,127,191, "50,25", "127,255,127,191", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-atop.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-atop.png
new file mode 100644
index 0000000..59bdc91
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-atop.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-in.html
new file mode 100644
index 0000000..19b0a74
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-in.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.canvas.destination-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.canvas.source-in.html" title="2d.composite.canvas.source-in">
+<link rel="next" href="2d.composite.canvas.source-out.html" title="2d.composite.canvas.source-out">
+<body class="show_output">
+<p>
+ <a href="2d.composite.canvas.source-in.html" accesskey="p" title="[p] 2d.composite.canvas.source-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.canvas.source-out.html" accesskey="n" title="[n] 2d.composite.canvas.source-out">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.canvas.html">canvas</a>.destination-in</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-in">2d.composite.destination-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = canvas.width;
+canvas2.height = canvas.height;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-in';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,255,95, "50,25", "0,255,255,95", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-in.png
new file mode 100644
index 0000000..790e418
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-out.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-out.html
new file mode 100644
index 0000000..7a2989dc
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-out.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.canvas.destination-out</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.canvas.source-out.html" title="2d.composite.canvas.source-out">
+<link rel="next" href="2d.composite.canvas.source-atop.html" title="2d.composite.canvas.source-atop">
+<body class="show_output">
+<p>
+ <a href="2d.composite.canvas.source-out.html" accesskey="p" title="[p] 2d.composite.canvas.source-out"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.canvas.source-atop.html" accesskey="n" title="[n] 2d.composite.canvas.source-atop">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.canvas.html">canvas</a>.destination-out</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-out">2d.composite.destination-out</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.destination-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = canvas.width;
+canvas2.height = canvas.height;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-out';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,255,31, "50,25", "0,255,255,31", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-out.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-out.png
new file mode 100644
index 0000000..7f5ed1a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-out.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-over.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-over.html
new file mode 100644
index 0000000..2e29d4b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-over.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.canvas.destination-over</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.canvas.source-over.html" title="2d.composite.canvas.source-over">
+<link rel="next" href="2d.composite.canvas.source-in.html" title="2d.composite.canvas.source-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.canvas.source-over.html" accesskey="p" title="[p] 2d.composite.canvas.source-over"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.canvas.source-in.html" accesskey="n" title="[n] 2d.composite.canvas.source-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.canvas.html">canvas</a>.destination-over</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-over">2d.composite.destination-over</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.destination-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = canvas.width;
+canvas2.height = canvas.height;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-over';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 109,255,145,223, "50,25", "109,255,145,223", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-over.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-over.png
new file mode 100644
index 0000000..ac86892
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.destination-over.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.lighter.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.lighter.html
new file mode 100644
index 0000000..b5151a4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.lighter.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.canvas.lighter</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.canvas.copy.html" title="2d.composite.canvas.copy">
+<link rel="next" href="2d.composite.uncovered.fill.source-in.html" title="2d.composite.uncovered.fill.source-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.canvas.copy.html" accesskey="p" title="[p] 2d.composite.canvas.copy"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.fill.source-in.html" accesskey="n" title="[n] 2d.composite.uncovered.fill.source-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.canvas.html">canvas</a>.lighter</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.lighter">2d.composite.lighter</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.lighter.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = canvas.width;
+canvas2.height = canvas.height;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'lighter';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 191,255,127,255, "50,25", "191,255,127,255", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.lighter.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.lighter.png
new file mode 100644
index 0000000..6a7c1df
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.lighter.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-atop.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-atop.html
new file mode 100644
index 0000000..70054fa
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-atop.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.canvas.source-atop</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.canvas.destination-out.html" title="2d.composite.canvas.destination-out">
+<link rel="next" href="2d.composite.canvas.destination-atop.html" title="2d.composite.canvas.destination-atop">
+<body class="show_output">
+<p>
+ <a href="2d.composite.canvas.destination-out.html" accesskey="p" title="[p] 2d.composite.canvas.destination-out"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.canvas.destination-atop.html" accesskey="n" title="[n] 2d.composite.canvas.destination-atop">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.canvas.html">canvas</a>.source-atop</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-atop">2d.composite.source-atop</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.source-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = canvas.width;
+canvas2.height = canvas.height;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-atop';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-atop.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-atop.png
new file mode 100644
index 0000000..1ef9630
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-atop.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-in.html
new file mode 100644
index 0000000..74de39a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-in.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.canvas.source-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.canvas.destination-over.html" title="2d.composite.canvas.destination-over">
+<link rel="next" href="2d.composite.canvas.destination-in.html" title="2d.composite.canvas.destination-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.canvas.destination-over.html" accesskey="p" title="[p] 2d.composite.canvas.destination-over"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.canvas.destination-in.html" accesskey="n" title="[n] 2d.composite.canvas.destination-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.canvas.html">canvas</a>.source-in</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-in">2d.composite.source-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = canvas.width;
+canvas2.height = canvas.height;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-in';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-in.png
new file mode 100644
index 0000000..c26cdcc
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-out.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-out.html
new file mode 100644
index 0000000..d8bfc73
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-out.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.canvas.source-out</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.canvas.destination-in.html" title="2d.composite.canvas.destination-in">
+<link rel="next" href="2d.composite.canvas.destination-out.html" title="2d.composite.canvas.destination-out">
+<body class="show_output">
+<p>
+ <a href="2d.composite.canvas.destination-in.html" accesskey="p" title="[p] 2d.composite.canvas.destination-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.canvas.destination-out.html" accesskey="n" title="[n] 2d.composite.canvas.destination-out">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.canvas.html">canvas</a>.source-out</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-out">2d.composite.source-out</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = canvas.width;
+canvas2.height = canvas.height;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-out';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-out.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-out.png
new file mode 100644
index 0000000..c26cdcc
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-out.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-over.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-over.html
new file mode 100644
index 0000000..83a33b7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-over.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.canvas.source-over</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.image.lighter.html" title="2d.composite.image.lighter">
+<link rel="next" href="2d.composite.canvas.destination-over.html" title="2d.composite.canvas.destination-over">
+<body class="show_output">
+<p>
+ <a href="2d.composite.image.lighter.html" accesskey="p" title="[p] 2d.composite.image.lighter"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.canvas.destination-over.html" accesskey="n" title="[n] 2d.composite.canvas.destination-over">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.canvas.html">canvas</a>.source-over</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-over">2d.composite.source-over</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.source-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = canvas.width;
+canvas2.height = canvas.height;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-over';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 218,255,36,223, "50,25", "218,255,36,223", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-over.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-over.png
new file mode 100644
index 0000000..5437608
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.source-over.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.xor.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.xor.html
new file mode 100644
index 0000000..47ab7a5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.xor.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.canvas.xor</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.canvas.destination-atop.html" title="2d.composite.canvas.destination-atop">
+<link rel="next" href="2d.composite.canvas.copy.html" title="2d.composite.canvas.copy">
+<body class="show_output">
+<p>
+ <a href="2d.composite.canvas.destination-atop.html" accesskey="p" title="[p] 2d.composite.canvas.destination-atop"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.canvas.copy.html" accesskey="n" title="[n] 2d.composite.canvas.copy">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.canvas.html">canvas</a>.xor</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.xor">2d.composite.xor</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.canvas.xor.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = canvas.width;
+canvas2.height = canvas.height;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow75.png'), 0, 0);
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'xor';
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.xor.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.xor.png
new file mode 100644
index 0000000..1ef9630
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.canvas.xor.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.copy.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.copy.html
new file mode 100644
index 0000000..f94bb3a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.copy.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.clip.copy</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.clip.xor.html" title="2d.composite.clip.xor">
+<link rel="next" href="2d.composite.clip.lighter.html" title="2d.composite.clip.lighter">
+<body class="show_output">
+<p>
+ <a href="2d.composite.clip.xor.html" accesskey="p" title="[p] 2d.composite.clip.xor"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.clip.lighter.html" accesskey="n" title="[n] 2d.composite.clip.lighter">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.clip.html">clip</a>.copy</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.copy">2d.composite.copy</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'copy';
+ctx.rect(-20, -20, 10, 10);
+ctx.clip();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.destination-atop.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.destination-atop.html
new file mode 100644
index 0000000..2b4e23c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.destination-atop.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.clip.destination-atop</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.clip.source-atop.html" title="2d.composite.clip.source-atop">
+<link rel="next" href="2d.composite.clip.xor.html" title="2d.composite.clip.xor">
+<body class="show_output">
+<p>
+ <a href="2d.composite.clip.source-atop.html" accesskey="p" title="[p] 2d.composite.clip.source-atop"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.clip.xor.html" accesskey="n" title="[n] 2d.composite.clip.xor">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.clip.html">clip</a>.destination-atop</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-atop">2d.composite.destination-atop</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.rect(-20, -20, 10, 10);
+ctx.clip();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.destination-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.destination-in.html
new file mode 100644
index 0000000..9f453f6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.destination-in.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.clip.destination-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.clip.source-in.html" title="2d.composite.clip.source-in">
+<link rel="next" href="2d.composite.clip.source-out.html" title="2d.composite.clip.source-out">
+<body class="show_output">
+<p>
+ <a href="2d.composite.clip.source-in.html" accesskey="p" title="[p] 2d.composite.clip.source-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.clip.source-out.html" accesskey="n" title="[n] 2d.composite.clip.source-out">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.clip.html">clip</a>.destination-in</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-in">2d.composite.destination-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-in';
+ctx.rect(-20, -20, 10, 10);
+ctx.clip();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.destination-out.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.destination-out.html
new file mode 100644
index 0000000..f0c18da
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.destination-out.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.clip.destination-out</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.clip.source-out.html" title="2d.composite.clip.source-out">
+<link rel="next" href="2d.composite.clip.source-atop.html" title="2d.composite.clip.source-atop">
+<body class="show_output">
+<p>
+ <a href="2d.composite.clip.source-out.html" accesskey="p" title="[p] 2d.composite.clip.source-out"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.clip.source-atop.html" accesskey="n" title="[n] 2d.composite.clip.source-atop">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.clip.html">clip</a>.destination-out</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-out">2d.composite.destination-out</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-out';
+ctx.rect(-20, -20, 10, 10);
+ctx.clip();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.destination-over.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.destination-over.html
new file mode 100644
index 0000000..1a96411
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.destination-over.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.clip.destination-over</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.clip.source-over.html" title="2d.composite.clip.source-over">
+<link rel="next" href="2d.composite.clip.source-in.html" title="2d.composite.clip.source-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.clip.source-over.html" accesskey="p" title="[p] 2d.composite.clip.source-over"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.clip.source-in.html" accesskey="n" title="[n] 2d.composite.clip.source-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.clip.html">clip</a>.destination-over</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-over">2d.composite.destination-over</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-over';
+ctx.rect(-20, -20, 10, 10);
+ctx.clip();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.lighter.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.lighter.html
new file mode 100644
index 0000000..68f61bf
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.lighter.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.clip.lighter</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.clip.copy.html" title="2d.composite.clip.copy">
+<link rel="next" href="2d.composite.operation.get.html" title="2d.composite.operation.get">
+<body class="show_output">
+<p>
+ <a href="2d.composite.clip.copy.html" accesskey="p" title="[p] 2d.composite.clip.copy"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.operation.get.html" accesskey="n" title="[n] 2d.composite.operation.get">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.clip.html">clip</a>.lighter</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.lighter">2d.composite.lighter</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'lighter';
+ctx.rect(-20, -20, 10, 10);
+ctx.clip();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.source-atop.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.source-atop.html
new file mode 100644
index 0000000..686949c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.source-atop.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.clip.source-atop</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.clip.destination-out.html" title="2d.composite.clip.destination-out">
+<link rel="next" href="2d.composite.clip.destination-atop.html" title="2d.composite.clip.destination-atop">
+<body class="show_output">
+<p>
+ <a href="2d.composite.clip.destination-out.html" accesskey="p" title="[p] 2d.composite.clip.destination-out"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.clip.destination-atop.html" accesskey="n" title="[n] 2d.composite.clip.destination-atop">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.clip.html">clip</a>.source-atop</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-atop">2d.composite.source-atop</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-atop';
+ctx.rect(-20, -20, 10, 10);
+ctx.clip();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.source-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.source-in.html
new file mode 100644
index 0000000..515fc5e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.source-in.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.clip.source-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.clip.destination-over.html" title="2d.composite.clip.destination-over">
+<link rel="next" href="2d.composite.clip.destination-in.html" title="2d.composite.clip.destination-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.clip.destination-over.html" accesskey="p" title="[p] 2d.composite.clip.destination-over"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.clip.destination-in.html" accesskey="n" title="[n] 2d.composite.clip.destination-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.clip.html">clip</a>.source-in</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-in">2d.composite.source-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-in';
+ctx.rect(-20, -20, 10, 10);
+ctx.clip();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.source-out.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.source-out.html
new file mode 100644
index 0000000..a9fd240
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.source-out.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.clip.source-out</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.clip.destination-in.html" title="2d.composite.clip.destination-in">
+<link rel="next" href="2d.composite.clip.destination-out.html" title="2d.composite.clip.destination-out">
+<body class="show_output">
+<p>
+ <a href="2d.composite.clip.destination-in.html" accesskey="p" title="[p] 2d.composite.clip.destination-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.clip.destination-out.html" accesskey="n" title="[n] 2d.composite.clip.destination-out">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.clip.html">clip</a>.source-out</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-out">2d.composite.source-out</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-out';
+ctx.rect(-20, -20, 10, 10);
+ctx.clip();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.source-over.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.source-over.html
new file mode 100644
index 0000000..662bda3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.source-over.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.clip.source-over</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.pattern.copy.html" title="2d.composite.uncovered.pattern.copy">
+<link rel="next" href="2d.composite.clip.destination-over.html" title="2d.composite.clip.destination-over">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.pattern.copy.html" accesskey="p" title="[p] 2d.composite.uncovered.pattern.copy"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.clip.destination-over.html" accesskey="n" title="[n] 2d.composite.clip.destination-over">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.clip.html">clip</a>.source-over</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-over">2d.composite.source-over</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-over';
+ctx.rect(-20, -20, 10, 10);
+ctx.clip();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.xor.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.xor.html
new file mode 100644
index 0000000..85a5928
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.clip.xor.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.clip.xor</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.clip.destination-atop.html" title="2d.composite.clip.destination-atop">
+<link rel="next" href="2d.composite.clip.copy.html" title="2d.composite.clip.copy">
+<body class="show_output">
+<p>
+ <a href="2d.composite.clip.destination-atop.html" accesskey="p" title="[p] 2d.composite.clip.destination-atop"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.clip.copy.html" accesskey="n" title="[n] 2d.composite.clip.copy">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.clip.html">clip</a>.xor</h1>
+<p class="desc">fill() does not affect pixels outside the clip region.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.xor">2d.composite.xor</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'xor';
+ctx.rect(-20, -20, 10, 10);
+ctx.clip();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.canvas.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.canvas.html
new file mode 100644
index 0000000..4dcb104
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.canvas.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.globalAlpha.canvas</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.globalAlpha.image.html" title="2d.composite.globalAlpha.image">
+<link rel="next" href="2d.composite.globalAlpha.imagepattern.html" title="2d.composite.globalAlpha.imagepattern">
+<body class="show_output">
+<p>
+ <a href="2d.composite.globalAlpha.image.html" accesskey="p" title="[p] 2d.composite.globalAlpha.image"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.globalAlpha.imagepattern.html" accesskey="n" title="[n] 2d.composite.globalAlpha.imagepattern">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.globalAlpha.html">globalAlpha</a>.canvas</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.globalAlpha.image">2d.composite.globalAlpha.image</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.fillStyle = '#f00';
+ctx2.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.canvaspattern.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.canvaspattern.html
new file mode 100644
index 0000000..6ba5ba9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.canvaspattern.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.globalAlpha.canvaspattern</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.globalAlpha.imagepattern.html" title="2d.composite.globalAlpha.imagepattern">
+<link rel="next" href="2d.composite.solid.source-over.html" title="2d.composite.solid.source-over">
+<body class="show_output">
+<p>
+ <a href="2d.composite.globalAlpha.imagepattern.html" accesskey="p" title="[p] 2d.composite.globalAlpha.imagepattern"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.solid.source-over.html" accesskey="n" title="[n] 2d.composite.solid.source-over">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.globalAlpha.html">globalAlpha</a>.canvaspattern</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.globalAlpha.image">2d.composite.globalAlpha.image</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401790">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.fillStyle = '#f00';
+ctx2.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = ctx.createPattern(canvas2, 'no-repeat');
+ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.default.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.default.html
new file mode 100644
index 0000000..9aaea87
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.default.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.globalAlpha.default</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.globalAlpha.invalid.html" title="2d.composite.globalAlpha.invalid">
+<link rel="next" href="2d.composite.globalAlpha.fill.html" title="2d.composite.globalAlpha.fill">
+<body class="show_output">
+<p>
+ <a href="2d.composite.globalAlpha.invalid.html" accesskey="p" title="[p] 2d.composite.globalAlpha.invalid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.globalAlpha.fill.html" accesskey="n" title="[n] 2d.composite.globalAlpha.fill">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.globalAlpha.html">globalAlpha</a>.default</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.globalAlpha.default">2d.composite.globalAlpha.default</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(ctx.globalAlpha, 1.0, "ctx.globalAlpha", "1.0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.fill.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.fill.html
new file mode 100644
index 0000000..46c254d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.fill.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.globalAlpha.fill</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.globalAlpha.default.html" title="2d.composite.globalAlpha.default">
+<link rel="next" href="2d.composite.globalAlpha.image.html" title="2d.composite.globalAlpha.image">
+<body class="show_output">
+<p>
+ <a href="2d.composite.globalAlpha.default.html" accesskey="p" title="[p] 2d.composite.globalAlpha.default"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.globalAlpha.image.html" accesskey="n" title="[n] 2d.composite.globalAlpha.image">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.globalAlpha.html">globalAlpha</a>.fill</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.globalAlpha.shape">2d.composite.globalAlpha.shape</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.image.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.image.html
new file mode 100644
index 0000000..8258fd0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.image.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.globalAlpha.image</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.globalAlpha.fill.html" title="2d.composite.globalAlpha.fill">
+<link rel="next" href="2d.composite.globalAlpha.canvas.html" title="2d.composite.globalAlpha.canvas">
+<body class="show_output">
+<p>
+ <a href="2d.composite.globalAlpha.fill.html" accesskey="p" title="[p] 2d.composite.globalAlpha.fill"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.globalAlpha.canvas.html" accesskey="n" title="[n] 2d.composite.globalAlpha.canvas">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.globalAlpha.html">globalAlpha</a>.image</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.globalAlpha.image">2d.composite.globalAlpha.image</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations
+ctx.drawImage(document.getElementById('red.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2);
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.imagepattern.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.imagepattern.html
new file mode 100644
index 0000000..c70f721
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.imagepattern.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.globalAlpha.imagepattern</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.globalAlpha.canvas.html" title="2d.composite.globalAlpha.canvas">
+<link rel="next" href="2d.composite.globalAlpha.canvaspattern.html" title="2d.composite.globalAlpha.canvaspattern">
+<body class="show_output">
+<p>
+ <a href="2d.composite.globalAlpha.canvas.html" accesskey="p" title="[p] 2d.composite.globalAlpha.canvas"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.globalAlpha.canvaspattern.html" accesskey="n" title="[n] 2d.composite.globalAlpha.canvaspattern">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.globalAlpha.html">globalAlpha</a>.imagepattern</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.globalAlpha.image">2d.composite.globalAlpha.image</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401790">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = ctx.createPattern(document.getElementById('red.png'), 'no-repeat');
+ctx.globalAlpha = 0.01; // avoid any potential alpha=0 optimisations
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 2,253,0,255, "50,25", "2,253,0,255", 2);
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.invalid.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.invalid.html
new file mode 100644
index 0000000..dcd8fc0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.invalid.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.globalAlpha.invalid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.globalAlpha.range.html" title="2d.composite.globalAlpha.range">
+<link rel="next" href="2d.composite.globalAlpha.default.html" title="2d.composite.globalAlpha.default">
+<body class="show_output">
+<p>
+ <a href="2d.composite.globalAlpha.range.html" accesskey="p" title="[p] 2d.composite.globalAlpha.range"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.globalAlpha.default.html" accesskey="n" title="[n] 2d.composite.globalAlpha.default">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.globalAlpha.html">globalAlpha</a>.invalid</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.globalAlpha.range">2d.composite.globalAlpha.range</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.globalAlpha = 0.5;
+var a = ctx.globalAlpha; // might not be exactly 0.5, if it is rounded/quantised, so remember for future comparisons
+ctx.globalAlpha = Infinity;
+_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a");
+ctx.globalAlpha = -Infinity;
+_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a");
+ctx.globalAlpha = NaN;
+_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.range.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.range.html
new file mode 100644
index 0000000..e469b52
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.globalAlpha.range.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.globalAlpha.range</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.setTransform.nonfinite.html" title="2d.transformation.setTransform.nonfinite">
+<link rel="next" href="2d.composite.globalAlpha.invalid.html" title="2d.composite.globalAlpha.invalid">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.setTransform.nonfinite.html" accesskey="p" title="[p] 2d.transformation.setTransform.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.globalAlpha.invalid.html" accesskey="n" title="[n] 2d.composite.globalAlpha.invalid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.globalAlpha.html">globalAlpha</a>.range</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.globalAlpha.range">2d.composite.globalAlpha.range</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.globalAlpha = 0.5;
+var a = ctx.globalAlpha; // might not be exactly 0.5, if it is rounded/quantised, so remember for future comparisons
+ctx.globalAlpha = 1.1;
+_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a");
+ctx.globalAlpha = -0.1;
+_assertEqual(ctx.globalAlpha, a, "ctx.globalAlpha", "a");
+ctx.globalAlpha = 0;
+_assertEqual(ctx.globalAlpha, 0, "ctx.globalAlpha", "0");
+ctx.globalAlpha = 1;
+_assertEqual(ctx.globalAlpha, 1, "ctx.globalAlpha", "1");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.copy.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.copy.html
new file mode 100644
index 0000000..28fb85b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.copy.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.image.copy</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.image.xor.html" title="2d.composite.image.xor">
+<link rel="next" href="2d.composite.image.lighter.html" title="2d.composite.image.lighter">
+<body class="show_output">
+<p>
+ <a href="2d.composite.image.xor.html" accesskey="p" title="[p] 2d.composite.image.xor"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.image.lighter.html" accesskey="n" title="[n] 2d.composite.image.lighter">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.image.html">image</a>.copy</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.copy">2d.composite.copy</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'copy';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 255,255,0,191, "50,25", "255,255,0,191", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.copy.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.copy.png
new file mode 100644
index 0000000..8e0668e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.copy.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-atop.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-atop.html
new file mode 100644
index 0000000..7540fa4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-atop.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.image.destination-atop</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.image.source-atop.html" title="2d.composite.image.source-atop">
+<link rel="next" href="2d.composite.image.xor.html" title="2d.composite.image.xor">
+<body class="show_output">
+<p>
+ <a href="2d.composite.image.source-atop.html" accesskey="p" title="[p] 2d.composite.image.source-atop"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.image.xor.html" accesskey="n" title="[n] 2d.composite.image.xor">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.image.html">image</a>.destination-atop</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-atop">2d.composite.destination-atop</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 127,255,127,191, "50,25", "127,255,127,191", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-atop.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-atop.png
new file mode 100644
index 0000000..59bdc91
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-atop.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-in.html
new file mode 100644
index 0000000..b0456da
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-in.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.image.destination-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.image.source-in.html" title="2d.composite.image.source-in">
+<link rel="next" href="2d.composite.image.source-out.html" title="2d.composite.image.source-out">
+<body class="show_output">
+<p>
+ <a href="2d.composite.image.source-in.html" accesskey="p" title="[p] 2d.composite.image.source-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.image.source-out.html" accesskey="n" title="[n] 2d.composite.image.source-out">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.image.html">image</a>.destination-in</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-in">2d.composite.destination-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-in';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,255,95, "50,25", "0,255,255,95", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-in.png
new file mode 100644
index 0000000..790e418
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-out.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-out.html
new file mode 100644
index 0000000..edd1953
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-out.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.image.destination-out</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.image.source-out.html" title="2d.composite.image.source-out">
+<link rel="next" href="2d.composite.image.source-atop.html" title="2d.composite.image.source-atop">
+<body class="show_output">
+<p>
+ <a href="2d.composite.image.source-out.html" accesskey="p" title="[p] 2d.composite.image.source-out"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.image.source-atop.html" accesskey="n" title="[n] 2d.composite.image.source-atop">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.image.html">image</a>.destination-out</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-out">2d.composite.destination-out</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.destination-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-out';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,255,31, "50,25", "0,255,255,31", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-out.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-out.png
new file mode 100644
index 0000000..7f5ed1a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-out.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-over.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-over.html
new file mode 100644
index 0000000..0bdaee3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-over.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.image.destination-over</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.image.source-over.html" title="2d.composite.image.source-over">
+<link rel="next" href="2d.composite.image.source-in.html" title="2d.composite.image.source-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.image.source-over.html" accesskey="p" title="[p] 2d.composite.image.source-over"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.image.source-in.html" accesskey="n" title="[n] 2d.composite.image.source-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.image.html">image</a>.destination-over</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-over">2d.composite.destination-over</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.destination-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-over';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 109,255,145,223, "50,25", "109,255,145,223", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-over.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-over.png
new file mode 100644
index 0000000..ac86892
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.destination-over.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.lighter.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.lighter.html
new file mode 100644
index 0000000..b835e3bb
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.lighter.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.image.lighter</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.image.copy.html" title="2d.composite.image.copy">
+<link rel="next" href="2d.composite.canvas.source-over.html" title="2d.composite.canvas.source-over">
+<body class="show_output">
+<p>
+ <a href="2d.composite.image.copy.html" accesskey="p" title="[p] 2d.composite.image.copy"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.canvas.source-over.html" accesskey="n" title="[n] 2d.composite.canvas.source-over">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.image.html">image</a>.lighter</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.lighter">2d.composite.lighter</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.lighter.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'lighter';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 191,255,127,255, "50,25", "191,255,127,255", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.lighter.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.lighter.png
new file mode 100644
index 0000000..6a7c1df
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.lighter.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-atop.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-atop.html
new file mode 100644
index 0000000..c464c23
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-atop.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.image.source-atop</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.image.destination-out.html" title="2d.composite.image.destination-out">
+<link rel="next" href="2d.composite.image.destination-atop.html" title="2d.composite.image.destination-atop">
+<body class="show_output">
+<p>
+ <a href="2d.composite.image.destination-out.html" accesskey="p" title="[p] 2d.composite.image.destination-out"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.image.destination-atop.html" accesskey="n" title="[n] 2d.composite.image.destination-atop">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.image.html">image</a>.source-atop</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-atop">2d.composite.source-atop</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.source-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-atop';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-atop.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-atop.png
new file mode 100644
index 0000000..1ef9630
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-atop.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-in.html
new file mode 100644
index 0000000..e340580
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-in.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.image.source-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.image.destination-over.html" title="2d.composite.image.destination-over">
+<link rel="next" href="2d.composite.image.destination-in.html" title="2d.composite.image.destination-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.image.destination-over.html" accesskey="p" title="[p] 2d.composite.image.destination-over"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.image.destination-in.html" accesskey="n" title="[n] 2d.composite.image.destination-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.image.html">image</a>.source-in</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-in">2d.composite.source-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-in';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-in.png
new file mode 100644
index 0000000..c26cdcc
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-out.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-out.html
new file mode 100644
index 0000000..cfb4aba
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-out.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.image.source-out</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.image.destination-in.html" title="2d.composite.image.destination-in">
+<link rel="next" href="2d.composite.image.destination-out.html" title="2d.composite.image.destination-out">
+<body class="show_output">
+<p>
+ <a href="2d.composite.image.destination-in.html" accesskey="p" title="[p] 2d.composite.image.destination-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.image.destination-out.html" accesskey="n" title="[n] 2d.composite.image.destination-out">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.image.html">image</a>.source-out</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-out">2d.composite.source-out</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-out';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 255,255,0,95, "50,25", "255,255,0,95", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-out.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-out.png
new file mode 100644
index 0000000..c26cdcc
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-out.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-over.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-over.html
new file mode 100644
index 0000000..fd80d98
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-over.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.image.source-over</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.transparent.lighter.html" title="2d.composite.transparent.lighter">
+<link rel="next" href="2d.composite.image.destination-over.html" title="2d.composite.image.destination-over">
+<body class="show_output">
+<p>
+ <a href="2d.composite.transparent.lighter.html" accesskey="p" title="[p] 2d.composite.transparent.lighter"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.image.destination-over.html" accesskey="n" title="[n] 2d.composite.image.destination-over">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.image.html">image</a>.source-over</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-over">2d.composite.source-over</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.source-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-over';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 218,255,36,223, "50,25", "218,255,36,223", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-over.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-over.png
new file mode 100644
index 0000000..5437608
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.source-over.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.xor.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.xor.html
new file mode 100644
index 0000000..a57229a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.xor.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.image.xor</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.image.destination-atop.html" title="2d.composite.image.destination-atop">
+<link rel="next" href="2d.composite.image.copy.html" title="2d.composite.image.copy">
+<body class="show_output">
+<p>
+ <a href="2d.composite.image.destination-atop.html" accesskey="p" title="[p] 2d.composite.image.destination-atop"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.image.copy.html" accesskey="n" title="[n] 2d.composite.image.copy">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.image.html">image</a>.xor</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.xor">2d.composite.xor</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.image.xor.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'xor';
+ctx.drawImage(document.getElementById('yellow75.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 191,255,63,127, "50,25", "191,255,63,127", 5);
+
+
+});
+</script>
+<img src="../images/yellow75.png" id="yellow75.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.image.xor.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.xor.png
new file mode 100644
index 0000000..1ef9630
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.image.xor.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.casesensitive.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.casesensitive.html
new file mode 100644
index 0000000..6100999
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.casesensitive.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.operation.casesensitive</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.operation.nullsuffix.html" title="2d.composite.operation.nullsuffix">
+<link rel="next" href="2d.composite.operation.default.html" title="2d.composite.operation.default">
+<body class="show_output">
+<p>
+ <a href="2d.composite.operation.nullsuffix.html" accesskey="p" title="[p] 2d.composite.operation.nullsuffix"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.operation.default.html" accesskey="n" title="[n] 2d.composite.operation.default">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.operation.html">operation</a>.casesensitive</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.operation.casesensitive">2d.composite.operation.casesensitive</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401788">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'xor';
+ctx.globalCompositeOperation = 'Source-over';
+_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.clear.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.clear.html
new file mode 100644
index 0000000..0fbd228
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.clear.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.operation.clear</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.operation.over.html" title="2d.composite.operation.over">
+<link rel="next" href="2d.composite.operation.highlight.html" title="2d.composite.operation.highlight">
+<body class="show_output">
+<p>
+ <a href="2d.composite.operation.over.html" accesskey="p" title="[p] 2d.composite.operation.over"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.operation.highlight.html" accesskey="n" title="[n] 2d.composite.operation.highlight">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.operation.html">operation</a>.clear</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.operation.unrecognised">2d.composite.operation.unrecognised</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'xor';
+ctx.globalCompositeOperation = 'clear';
+_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.darker.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.darker.html
new file mode 100644
index 0000000..1fb85c7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.darker.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.operation.darker</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.operation.unrecognised.html" title="2d.composite.operation.unrecognised">
+<link rel="next" href="2d.composite.operation.over.html" title="2d.composite.operation.over">
+<body class="show_output">
+<p>
+ <a href="2d.composite.operation.unrecognised.html" accesskey="p" title="[p] 2d.composite.operation.unrecognised"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.operation.over.html" accesskey="n" title="[n] 2d.composite.operation.over">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.operation.html">operation</a>.darker</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.operation.unrecognised">2d.composite.operation.unrecognised</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'xor';
+ctx.globalCompositeOperation = 'darker';
+_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.default.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.default.html
new file mode 100644
index 0000000..715821e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.default.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.operation.default</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.operation.casesensitive.html" title="2d.composite.operation.casesensitive">
+<link rel="next" href="2d.fillStyle.parse.html4.html" title="2d.fillStyle.parse.html4">
+<body class="show_output">
+<p>
+ <a href="2d.composite.operation.casesensitive.html" accesskey="p" title="[p] 2d.composite.operation.casesensitive"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.html4.html" accesskey="n" title="[n] 2d.fillStyle.parse.html4">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.operation.html">operation</a>.default</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.operation.default">2d.composite.operation.default</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertEqual(ctx.globalCompositeOperation, 'source-over', "ctx.globalCompositeOperation", "'source-over'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.get.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.get.html
new file mode 100644
index 0000000..9e8274c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.get.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.operation.get</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.clip.lighter.html" title="2d.composite.clip.lighter">
+<link rel="next" href="2d.composite.operation.unrecognised.html" title="2d.composite.operation.unrecognised">
+<body class="show_output">
+<p>
+ <a href="2d.composite.clip.lighter.html" accesskey="p" title="[p] 2d.composite.clip.lighter"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.operation.unrecognised.html" accesskey="n" title="[n] 2d.composite.operation.unrecognised">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.operation.html">operation</a>.get</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.operation">2d.composite.operation</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var modes = ['source-atop', 'source-in', 'source-out', 'source-over',
+ 'destination-atop', 'destination-in', 'destination-out', 'destination-over',
+ 'lighter', 'copy', 'xor'];
+for (var i = 0; i < modes.length; ++i)
+{
+ ctx.globalCompositeOperation = modes[i];
+ _assertEqual(ctx.globalCompositeOperation, modes[i], "ctx.globalCompositeOperation", "modes[\""+(i)+"\"]");
+}
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.highlight.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.highlight.html
new file mode 100644
index 0000000..fa9069b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.highlight.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.operation.highlight</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.operation.clear.html" title="2d.composite.operation.clear">
+<link rel="next" href="2d.composite.operation.nullsuffix.html" title="2d.composite.operation.nullsuffix">
+<body class="show_output">
+<p>
+ <a href="2d.composite.operation.clear.html" accesskey="p" title="[p] 2d.composite.operation.clear"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.operation.nullsuffix.html" accesskey="n" title="[n] 2d.composite.operation.nullsuffix">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.operation.html">operation</a>.highlight</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.operation.unrecognised">2d.composite.operation.unrecognised</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401788">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'xor';
+ctx.globalCompositeOperation = 'highlight';
+_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.nullsuffix.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.nullsuffix.html
new file mode 100644
index 0000000..5978a15
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.nullsuffix.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.operation.nullsuffix</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.operation.highlight.html" title="2d.composite.operation.highlight">
+<link rel="next" href="2d.composite.operation.casesensitive.html" title="2d.composite.operation.casesensitive">
+<body class="show_output">
+<p>
+ <a href="2d.composite.operation.highlight.html" accesskey="p" title="[p] 2d.composite.operation.highlight"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.operation.casesensitive.html" accesskey="n" title="[n] 2d.composite.operation.casesensitive">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.operation.html">operation</a>.nullsuffix</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.operation.exact">2d.composite.operation.exact</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401788">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'xor';
+ctx.globalCompositeOperation = 'source-over\0';
+_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.over.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.over.html
new file mode 100644
index 0000000..2182812
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.over.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.operation.over</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.operation.darker.html" title="2d.composite.operation.darker">
+<link rel="next" href="2d.composite.operation.clear.html" title="2d.composite.operation.clear">
+<body class="show_output">
+<p>
+ <a href="2d.composite.operation.darker.html" accesskey="p" title="[p] 2d.composite.operation.darker"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.operation.clear.html" accesskey="n" title="[n] 2d.composite.operation.clear">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.operation.html">operation</a>.over</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.operation.unrecognised">2d.composite.operation.unrecognised</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'xor';
+ctx.globalCompositeOperation = 'over';
+_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.unrecognised.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.unrecognised.html
new file mode 100644
index 0000000..35cba37
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.operation.unrecognised.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.operation.unrecognised</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.operation.get.html" title="2d.composite.operation.get">
+<link rel="next" href="2d.composite.operation.darker.html" title="2d.composite.operation.darker">
+<body class="show_output">
+<p>
+ <a href="2d.composite.operation.get.html" accesskey="p" title="[p] 2d.composite.operation.get"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.operation.darker.html" accesskey="n" title="[n] 2d.composite.operation.darker">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.operation.html">operation</a>.unrecognised</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.operation.unrecognised">2d.composite.operation.unrecognised</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401788">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'xor';
+ctx.globalCompositeOperation = 'nonexistent';
+_assertEqual(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.copy.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.copy.html
new file mode 100644
index 0000000..2128b42
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.copy.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.solid.copy</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.solid.xor.html" title="2d.composite.solid.xor">
+<link rel="next" href="2d.composite.solid.lighter.html" title="2d.composite.solid.lighter">
+<body class="show_output">
+<p>
+ <a href="2d.composite.solid.xor.html" accesskey="p" title="[p] 2d.composite.solid.xor"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.solid.lighter.html" accesskey="n" title="[n] 2d.composite.solid.lighter">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.solid.html">solid</a>.copy</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.copy">2d.composite.copy</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'copy';
+ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.copy.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.copy.png
new file mode 100644
index 0000000..8373e62
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.copy.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-atop.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-atop.html
new file mode 100644
index 0000000..639880e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-atop.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.solid.destination-atop</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.solid.source-atop.html" title="2d.composite.solid.source-atop">
+<link rel="next" href="2d.composite.solid.xor.html" title="2d.composite.solid.xor">
+<body class="show_output">
+<p>
+ <a href="2d.composite.solid.source-atop.html" accesskey="p" title="[p] 2d.composite.solid.source-atop"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.solid.xor.html" accesskey="n" title="[n] 2d.composite.solid.xor">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.solid.html">solid</a>.destination-atop</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-atop">2d.composite.destination-atop</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-atop.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-atop.png
new file mode 100644
index 0000000..9b811df
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-atop.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-in.html
new file mode 100644
index 0000000..fe84817
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-in.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.solid.destination-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.solid.source-in.html" title="2d.composite.solid.source-in">
+<link rel="next" href="2d.composite.solid.source-out.html" title="2d.composite.solid.source-out">
+<body class="show_output">
+<p>
+ <a href="2d.composite.solid.source-in.html" accesskey="p" title="[p] 2d.composite.solid.source-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.solid.source-out.html" accesskey="n" title="[n] 2d.composite.solid.source-out">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.solid.html">solid</a>.destination-in</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-in">2d.composite.destination-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-in';
+ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-in.png
new file mode 100644
index 0000000..9b811df
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-out.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-out.html
new file mode 100644
index 0000000..62b8fe8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-out.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.solid.destination-out</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.solid.source-out.html" title="2d.composite.solid.source-out">
+<link rel="next" href="2d.composite.solid.source-atop.html" title="2d.composite.solid.source-atop">
+<body class="show_output">
+<p>
+ <a href="2d.composite.solid.source-out.html" accesskey="p" title="[p] 2d.composite.solid.source-out"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.solid.source-atop.html" accesskey="n" title="[n] 2d.composite.solid.source-atop">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.solid.html">solid</a>.destination-out</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-out">2d.composite.destination-out</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.destination-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-out';
+ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-out.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-out.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-out.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-over.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-over.html
new file mode 100644
index 0000000..86f12cb
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-over.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.solid.destination-over</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.solid.source-over.html" title="2d.composite.solid.source-over">
+<link rel="next" href="2d.composite.solid.source-in.html" title="2d.composite.solid.source-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.solid.source-over.html" accesskey="p" title="[p] 2d.composite.solid.source-over"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.solid.source-in.html" accesskey="n" title="[n] 2d.composite.solid.source-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.solid.html">solid</a>.destination-over</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-over">2d.composite.destination-over</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.destination-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-over';
+ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,255,255,255, "50,25", "0,255,255,255", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-over.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-over.png
new file mode 100644
index 0000000..9b811df
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.destination-over.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.lighter.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.lighter.html
new file mode 100644
index 0000000..41a0ca3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.lighter.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.solid.lighter</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.solid.copy.html" title="2d.composite.solid.copy">
+<link rel="next" href="2d.composite.transparent.source-over.html" title="2d.composite.transparent.source-over">
+<body class="show_output">
+<p>
+ <a href="2d.composite.solid.copy.html" accesskey="p" title="[p] 2d.composite.solid.copy"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.transparent.source-over.html" accesskey="n" title="[n] 2d.composite.transparent.source-over">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.solid.html">solid</a>.lighter</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.lighter">2d.composite.lighter</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.lighter.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'lighter';
+ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 255,255,255,255, "50,25", "255,255,255,255", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.lighter.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.lighter.png
new file mode 100644
index 0000000..f69a743
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.lighter.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-atop.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-atop.html
new file mode 100644
index 0000000..7316be2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-atop.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.solid.source-atop</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.solid.destination-out.html" title="2d.composite.solid.destination-out">
+<link rel="next" href="2d.composite.solid.destination-atop.html" title="2d.composite.solid.destination-atop">
+<body class="show_output">
+<p>
+ <a href="2d.composite.solid.destination-out.html" accesskey="p" title="[p] 2d.composite.solid.destination-out"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.solid.destination-atop.html" accesskey="n" title="[n] 2d.composite.solid.destination-atop">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.solid.html">solid</a>.source-atop</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-atop">2d.composite.source-atop</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.source-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-atop';
+ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-atop.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-atop.png
new file mode 100644
index 0000000..8373e62
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-atop.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-in.html
new file mode 100644
index 0000000..efc014e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-in.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.solid.source-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.solid.destination-over.html" title="2d.composite.solid.destination-over">
+<link rel="next" href="2d.composite.solid.destination-in.html" title="2d.composite.solid.destination-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.solid.destination-over.html" accesskey="p" title="[p] 2d.composite.solid.destination-over"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.solid.destination-in.html" accesskey="n" title="[n] 2d.composite.solid.destination-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.solid.html">solid</a>.source-in</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-in">2d.composite.source-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-in';
+ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-in.png
new file mode 100644
index 0000000..8373e62
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-out.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-out.html
new file mode 100644
index 0000000..5524003
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-out.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.solid.source-out</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.solid.destination-in.html" title="2d.composite.solid.destination-in">
+<link rel="next" href="2d.composite.solid.destination-out.html" title="2d.composite.solid.destination-out">
+<body class="show_output">
+<p>
+ <a href="2d.composite.solid.destination-in.html" accesskey="p" title="[p] 2d.composite.solid.destination-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.solid.destination-out.html" accesskey="n" title="[n] 2d.composite.solid.destination-out">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.solid.html">solid</a>.source-out</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-out">2d.composite.source-out</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-out';
+ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-out.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-out.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-out.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-over.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-over.html
new file mode 100644
index 0000000..aab7647
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-over.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.solid.source-over</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.globalAlpha.canvaspattern.html" title="2d.composite.globalAlpha.canvaspattern">
+<link rel="next" href="2d.composite.solid.destination-over.html" title="2d.composite.solid.destination-over">
+<body class="show_output">
+<p>
+ <a href="2d.composite.globalAlpha.canvaspattern.html" accesskey="p" title="[p] 2d.composite.globalAlpha.canvaspattern"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.solid.destination-over.html" accesskey="n" title="[n] 2d.composite.solid.destination-over">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.solid.html">solid</a>.source-over</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-over">2d.composite.source-over</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.source-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-over';
+ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 255,255,0,255, "50,25", "255,255,0,255", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-over.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-over.png
new file mode 100644
index 0000000..8373e62
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.source-over.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.xor.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.xor.html
new file mode 100644
index 0000000..368d772
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.xor.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.solid.xor</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.solid.destination-atop.html" title="2d.composite.solid.destination-atop">
+<link rel="next" href="2d.composite.solid.copy.html" title="2d.composite.solid.copy">
+<body class="show_output">
+<p>
+ <a href="2d.composite.solid.destination-atop.html" accesskey="p" title="[p] 2d.composite.solid.destination-atop"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.solid.copy.html" accesskey="n" title="[n] 2d.composite.solid.copy">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.solid.html">solid</a>.xor</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.xor">2d.composite.xor</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.solid.xor.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'xor';
+ctx.fillStyle = 'rgba(255, 255, 0, 1.0)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.xor.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.xor.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.solid.xor.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.copy.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.copy.html
new file mode 100644
index 0000000..0fc2de3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.copy.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.transparent.copy</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.transparent.xor.html" title="2d.composite.transparent.xor">
+<link rel="next" href="2d.composite.transparent.lighter.html" title="2d.composite.transparent.lighter">
+<body class="show_output">
+<p>
+ <a href="2d.composite.transparent.xor.html" accesskey="p" title="[p] 2d.composite.transparent.xor"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.transparent.lighter.html" accesskey="n" title="[n] 2d.composite.transparent.lighter">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.transparent.html">transparent</a>.copy</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.copy">2d.composite.copy</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'copy';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,255,191, "50,25", "0,0,255,191", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.copy.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.copy.png
new file mode 100644
index 0000000..170e881
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.copy.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-atop.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-atop.html
new file mode 100644
index 0000000..58722d2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-atop.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.transparent.destination-atop</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.transparent.source-atop.html" title="2d.composite.transparent.source-atop">
+<link rel="next" href="2d.composite.transparent.xor.html" title="2d.composite.transparent.xor">
+<body class="show_output">
+<p>
+ <a href="2d.composite.transparent.source-atop.html" accesskey="p" title="[p] 2d.composite.transparent.source-atop"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.transparent.xor.html" accesskey="n" title="[n] 2d.composite.transparent.xor">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.transparent.html">transparent</a>.destination-atop</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-atop">2d.composite.destination-atop</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,127,127,191, "50,25", "0,127,127,191", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-atop.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-atop.png
new file mode 100644
index 0000000..57bbf64
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-atop.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-in.html
new file mode 100644
index 0000000..cdd490b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-in.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.transparent.destination-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.transparent.source-in.html" title="2d.composite.transparent.source-in">
+<link rel="next" href="2d.composite.transparent.source-out.html" title="2d.composite.transparent.source-out">
+<body class="show_output">
+<p>
+ <a href="2d.composite.transparent.source-in.html" accesskey="p" title="[p] 2d.composite.transparent.source-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.transparent.source-out.html" accesskey="n" title="[n] 2d.composite.transparent.source-out">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.transparent.html">transparent</a>.destination-in</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-in">2d.composite.destination-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-in';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,255,0,95, "50,25", "0,255,0,95", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-in.png
new file mode 100644
index 0000000..c6895de
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-out.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-out.html
new file mode 100644
index 0000000..815f78f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-out.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.transparent.destination-out</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.transparent.source-out.html" title="2d.composite.transparent.source-out">
+<link rel="next" href="2d.composite.transparent.source-atop.html" title="2d.composite.transparent.source-atop">
+<body class="show_output">
+<p>
+ <a href="2d.composite.transparent.source-out.html" accesskey="p" title="[p] 2d.composite.transparent.source-out"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.transparent.source-atop.html" accesskey="n" title="[n] 2d.composite.transparent.source-atop">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.transparent.html">transparent</a>.destination-out</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-out">2d.composite.destination-out</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.destination-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-out';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,255,0,31, "50,25", "0,255,0,31", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-out.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-out.png
new file mode 100644
index 0000000..873a9c4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-out.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-over.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-over.html
new file mode 100644
index 0000000..d2d1ab7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-over.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.transparent.destination-over</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.transparent.source-over.html" title="2d.composite.transparent.source-over">
+<link rel="next" href="2d.composite.transparent.source-in.html" title="2d.composite.transparent.source-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.transparent.source-over.html" accesskey="p" title="[p] 2d.composite.transparent.source-over"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.transparent.source-in.html" accesskey="n" title="[n] 2d.composite.transparent.source-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.transparent.html">transparent</a>.destination-over</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-over">2d.composite.destination-over</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.destination-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-over';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,145,109,223, "50,25", "0,145,109,223", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-over.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-over.png
new file mode 100644
index 0000000..c0f0326
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.destination-over.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.lighter.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.lighter.html
new file mode 100644
index 0000000..841982f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.lighter.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.transparent.lighter</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.transparent.copy.html" title="2d.composite.transparent.copy">
+<link rel="next" href="2d.composite.image.source-over.html" title="2d.composite.image.source-over">
+<body class="show_output">
+<p>
+ <a href="2d.composite.transparent.copy.html" accesskey="p" title="[p] 2d.composite.transparent.copy"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.image.source-over.html" accesskey="n" title="[n] 2d.composite.image.source-over">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.transparent.html">transparent</a>.lighter</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.lighter">2d.composite.lighter</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.lighter.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'lighter';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,127,191,255, "50,25", "0,127,191,255", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.lighter.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.lighter.png
new file mode 100644
index 0000000..e7a9ea6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.lighter.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-atop.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-atop.html
new file mode 100644
index 0000000..74361c9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-atop.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.transparent.source-atop</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.transparent.destination-out.html" title="2d.composite.transparent.destination-out">
+<link rel="next" href="2d.composite.transparent.destination-atop.html" title="2d.composite.transparent.destination-atop">
+<body class="show_output">
+<p>
+ <a href="2d.composite.transparent.destination-out.html" accesskey="p" title="[p] 2d.composite.transparent.destination-out"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.transparent.destination-atop.html" accesskey="n" title="[n] 2d.composite.transparent.destination-atop">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.transparent.html">transparent</a>.source-atop</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-atop">2d.composite.source-atop</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.source-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-atop';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,63,191,127, "50,25", "0,63,191,127", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-atop.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-atop.png
new file mode 100644
index 0000000..e0afff6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-atop.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-in.html
new file mode 100644
index 0000000..0acb151
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-in.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.transparent.source-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.transparent.destination-over.html" title="2d.composite.transparent.destination-over">
+<link rel="next" href="2d.composite.transparent.destination-in.html" title="2d.composite.transparent.destination-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.transparent.destination-over.html" accesskey="p" title="[p] 2d.composite.transparent.destination-over"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.transparent.destination-in.html" accesskey="n" title="[n] 2d.composite.transparent.destination-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.transparent.html">transparent</a>.source-in</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-in">2d.composite.source-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-in';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,255,95, "50,25", "0,0,255,95", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-in.png
new file mode 100644
index 0000000..1459b5e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-out.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-out.html
new file mode 100644
index 0000000..7dfadf2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-out.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.transparent.source-out</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.transparent.destination-in.html" title="2d.composite.transparent.destination-in">
+<link rel="next" href="2d.composite.transparent.destination-out.html" title="2d.composite.transparent.destination-out">
+<body class="show_output">
+<p>
+ <a href="2d.composite.transparent.destination-in.html" accesskey="p" title="[p] 2d.composite.transparent.destination-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.transparent.destination-out.html" accesskey="n" title="[n] 2d.composite.transparent.destination-out">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.transparent.html">transparent</a>.source-out</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-out">2d.composite.source-out</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-out';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,255,95, "50,25", "0,0,255,95", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-out.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-out.png
new file mode 100644
index 0000000..1459b5e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-out.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-over.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-over.html
new file mode 100644
index 0000000..1a123d9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-over.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.transparent.source-over</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.solid.lighter.html" title="2d.composite.solid.lighter">
+<link rel="next" href="2d.composite.transparent.destination-over.html" title="2d.composite.transparent.destination-over">
+<body class="show_output">
+<p>
+ <a href="2d.composite.solid.lighter.html" accesskey="p" title="[p] 2d.composite.solid.lighter"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.transparent.destination-over.html" accesskey="n" title="[n] 2d.composite.transparent.destination-over">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.transparent.html">transparent</a>.source-over</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-over">2d.composite.source-over</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.source-over.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-over';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,36,218,223, "50,25", "0,36,218,223", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-over.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-over.png
new file mode 100644
index 0000000..c92cd95
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.source-over.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.xor.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.xor.html
new file mode 100644
index 0000000..19b48df
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.xor.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.transparent.xor</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.transparent.destination-atop.html" title="2d.composite.transparent.destination-atop">
+<link rel="next" href="2d.composite.transparent.copy.html" title="2d.composite.transparent.copy">
+<body class="show_output">
+<p>
+ <a href="2d.composite.transparent.destination-atop.html" accesskey="p" title="[p] 2d.composite.transparent.destination-atop"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.transparent.copy.html" accesskey="n" title="[n] 2d.composite.transparent.copy">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.transparent.html">transparent</a>.xor</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.xor">2d.composite.xor</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.transparent.xor.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'xor';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,63,191,127, "50,25", "0,63,191,127", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.xor.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.xor.png
new file mode 100644
index 0000000..e0afff6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.transparent.xor.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.copy.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.copy.html
new file mode 100644
index 0000000..15a7d99
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.copy.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.fill.copy</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.fill.destination-atop.html" title="2d.composite.uncovered.fill.destination-atop">
+<link rel="next" href="2d.composite.uncovered.image.source-in.html" title="2d.composite.uncovered.image.source-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.fill.destination-atop.html" accesskey="p" title="[p] 2d.composite.uncovered.fill.destination-atop"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.image.source-in.html" accesskey="n" title="[n] 2d.composite.uncovered.image.source-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.fill.html">fill</a>.copy</h1>
+<p class="desc">fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.copy">2d.composite.copy</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.fill.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'copy';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.translate(0, 25);
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.copy.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.copy.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.copy.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-atop.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-atop.html
new file mode 100644
index 0000000..ab2d19c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-atop.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.fill.destination-atop</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.fill.source-out.html" title="2d.composite.uncovered.fill.source-out">
+<link rel="next" href="2d.composite.uncovered.fill.copy.html" title="2d.composite.uncovered.fill.copy">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.fill.source-out.html" accesskey="p" title="[p] 2d.composite.uncovered.fill.source-out"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.fill.copy.html" accesskey="n" title="[n] 2d.composite.uncovered.fill.copy">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.fill.html">fill</a>.destination-atop</h1>
+<p class="desc">fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-atop">2d.composite.destination-atop</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.fill.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.translate(0, 25);
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-atop.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-atop.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-atop.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-in.html
new file mode 100644
index 0000000..328c143
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-in.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.fill.destination-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.fill.source-in.html" title="2d.composite.uncovered.fill.source-in">
+<link rel="next" href="2d.composite.uncovered.fill.source-out.html" title="2d.composite.uncovered.fill.source-out">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.fill.source-in.html" accesskey="p" title="[p] 2d.composite.uncovered.fill.source-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.fill.source-out.html" accesskey="n" title="[n] 2d.composite.uncovered.fill.source-out">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.fill.html">fill</a>.destination-in</h1>
+<p class="desc">fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-in">2d.composite.destination-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.fill.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-in';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.translate(0, 25);
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-in.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.destination-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.source-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.source-in.html
new file mode 100644
index 0000000..d719a4d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.source-in.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.fill.source-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.canvas.lighter.html" title="2d.composite.canvas.lighter">
+<link rel="next" href="2d.composite.uncovered.fill.destination-in.html" title="2d.composite.uncovered.fill.destination-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.canvas.lighter.html" accesskey="p" title="[p] 2d.composite.canvas.lighter"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.fill.destination-in.html" accesskey="n" title="[n] 2d.composite.uncovered.fill.destination-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.fill.html">fill</a>.source-in</h1>
+<p class="desc">fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-in">2d.composite.source-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.fill.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-in';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.translate(0, 25);
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.source-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.source-in.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.source-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.source-out.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.source-out.html
new file mode 100644
index 0000000..ec346d7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.source-out.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.fill.source-out</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.fill.destination-in.html" title="2d.composite.uncovered.fill.destination-in">
+<link rel="next" href="2d.composite.uncovered.fill.destination-atop.html" title="2d.composite.uncovered.fill.destination-atop">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.fill.destination-in.html" accesskey="p" title="[p] 2d.composite.uncovered.fill.destination-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.fill.destination-atop.html" accesskey="n" title="[n] 2d.composite.uncovered.fill.destination-atop">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.fill.html">fill</a>.source-out</h1>
+<p class="desc">fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-out">2d.composite.source-out</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.fill.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-out';
+ctx.fillStyle = 'rgba(0, 0, 255, 0.75)';
+ctx.translate(0, 25);
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.source-out.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.source-out.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.fill.source-out.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.copy.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.copy.html
new file mode 100644
index 0000000..58b752a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.copy.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.image.copy</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.image.destination-atop.html" title="2d.composite.uncovered.image.destination-atop">
+<link rel="next" href="2d.composite.uncovered.nocontext.source-in.html" title="2d.composite.uncovered.nocontext.source-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.image.destination-atop.html" accesskey="p" title="[p] 2d.composite.uncovered.image.destination-atop"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.nocontext.source-in.html" accesskey="n" title="[n] 2d.composite.uncovered.nocontext.source-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.image.html">image</a>.copy</h1>
+<p class="desc">drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.copy">2d.composite.copy</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.image.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'copy';
+ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10);
+_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="../images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.copy.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.copy.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.copy.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.destination-atop.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.destination-atop.html
new file mode 100644
index 0000000..676b2cf
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.destination-atop.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.image.destination-atop</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.image.source-out.html" title="2d.composite.uncovered.image.source-out">
+<link rel="next" href="2d.composite.uncovered.image.copy.html" title="2d.composite.uncovered.image.copy">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.image.source-out.html" accesskey="p" title="[p] 2d.composite.uncovered.image.source-out"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.image.copy.html" accesskey="n" title="[n] 2d.composite.uncovered.image.copy">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.image.html">image</a>.destination-atop</h1>
+<p class="desc">drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-atop">2d.composite.destination-atop</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.image.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10);
+_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="../images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.destination-atop.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.destination-atop.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.destination-atop.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.destination-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.destination-in.html
new file mode 100644
index 0000000..bd36722
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.destination-in.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.image.destination-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.image.source-in.html" title="2d.composite.uncovered.image.source-in">
+<link rel="next" href="2d.composite.uncovered.image.source-out.html" title="2d.composite.uncovered.image.source-out">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.image.source-in.html" accesskey="p" title="[p] 2d.composite.uncovered.image.source-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.image.source-out.html" accesskey="n" title="[n] 2d.composite.uncovered.image.source-out">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.image.html">image</a>.destination-in</h1>
+<p class="desc">drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-in">2d.composite.destination-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.image.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-in';
+ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10);
+_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="../images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.destination-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.destination-in.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.destination-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.source-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.source-in.html
new file mode 100644
index 0000000..882ea0a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.source-in.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.image.source-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.fill.copy.html" title="2d.composite.uncovered.fill.copy">
+<link rel="next" href="2d.composite.uncovered.image.destination-in.html" title="2d.composite.uncovered.image.destination-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.fill.copy.html" accesskey="p" title="[p] 2d.composite.uncovered.fill.copy"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.image.destination-in.html" accesskey="n" title="[n] 2d.composite.uncovered.image.destination-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.image.html">image</a>.source-in</h1>
+<p class="desc">drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-in">2d.composite.source-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.image.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-in';
+ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10);
+_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="../images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.source-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.source-in.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.source-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.source-out.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.source-out.html
new file mode 100644
index 0000000..a63c4b5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.source-out.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.image.source-out</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.image.destination-in.html" title="2d.composite.uncovered.image.destination-in">
+<link rel="next" href="2d.composite.uncovered.image.destination-atop.html" title="2d.composite.uncovered.image.destination-atop">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.image.destination-in.html" accesskey="p" title="[p] 2d.composite.uncovered.image.destination-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.image.destination-atop.html" accesskey="n" title="[n] 2d.composite.uncovered.image.destination-atop">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.image.html">image</a>.source-out</h1>
+<p class="desc">drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-out">2d.composite.source-out</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.image.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-out';
+ctx.drawImage(document.getElementById('yellow.png'), 40, 40, 10, 10, 40, 50, 10, 10);
+_assertPixelApprox(canvas, 15,15, 0,0,0,0, "15,15", "0,0,0,0", 5);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="../images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.source-out.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.source-out.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.image.source-out.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.copy.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.copy.html
new file mode 100644
index 0000000..61f7fd7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.copy.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.nocontext.copy</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.nocontext.destination-atop.html" title="2d.composite.uncovered.nocontext.destination-atop">
+<link rel="next" href="2d.composite.uncovered.pattern.source-in.html" title="2d.composite.uncovered.pattern.source-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.nocontext.destination-atop.html" accesskey="p" title="[p] 2d.composite.uncovered.nocontext.destination-atop"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.pattern.source-in.html" accesskey="n" title="[n] 2d.composite.uncovered.pattern.source-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.nocontext.html">nocontext</a>.copy</h1>
+<p class="desc">drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.copy">2d.composite.copy</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.nocontext.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'copy';
+var canvas2 = document.createElement('canvas');
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.copy.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.copy.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.copy.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-atop.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-atop.html
new file mode 100644
index 0000000..c3b3836
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-atop.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.nocontext.destination-atop</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.nocontext.source-out.html" title="2d.composite.uncovered.nocontext.source-out">
+<link rel="next" href="2d.composite.uncovered.nocontext.copy.html" title="2d.composite.uncovered.nocontext.copy">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.nocontext.source-out.html" accesskey="p" title="[p] 2d.composite.uncovered.nocontext.source-out"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.nocontext.copy.html" accesskey="n" title="[n] 2d.composite.uncovered.nocontext.copy">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.nocontext.html">nocontext</a>.destination-atop</h1>
+<p class="desc">drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-atop">2d.composite.destination-atop</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.nocontext.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-atop';
+var canvas2 = document.createElement('canvas');
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-atop.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-atop.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-atop.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-in.html
new file mode 100644
index 0000000..89de59a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-in.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.nocontext.destination-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.nocontext.source-in.html" title="2d.composite.uncovered.nocontext.source-in">
+<link rel="next" href="2d.composite.uncovered.nocontext.source-out.html" title="2d.composite.uncovered.nocontext.source-out">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.nocontext.source-in.html" accesskey="p" title="[p] 2d.composite.uncovered.nocontext.source-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.nocontext.source-out.html" accesskey="n" title="[n] 2d.composite.uncovered.nocontext.source-out">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.nocontext.html">nocontext</a>.destination-in</h1>
+<p class="desc">drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-in">2d.composite.destination-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.nocontext.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-in';
+var canvas2 = document.createElement('canvas');
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-in.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.destination-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-in.html
new file mode 100644
index 0000000..330fffc
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-in.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.nocontext.source-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.image.copy.html" title="2d.composite.uncovered.image.copy">
+<link rel="next" href="2d.composite.uncovered.nocontext.destination-in.html" title="2d.composite.uncovered.nocontext.destination-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.image.copy.html" accesskey="p" title="[p] 2d.composite.uncovered.image.copy"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.nocontext.destination-in.html" accesskey="n" title="[n] 2d.composite.uncovered.nocontext.destination-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.nocontext.html">nocontext</a>.source-in</h1>
+<p class="desc">drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-in">2d.composite.source-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.nocontext.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-in';
+var canvas2 = document.createElement('canvas');
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-in.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-out.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-out.html
new file mode 100644
index 0000000..ae3c994
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-out.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.nocontext.source-out</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.nocontext.destination-in.html" title="2d.composite.uncovered.nocontext.destination-in">
+<link rel="next" href="2d.composite.uncovered.nocontext.destination-atop.html" title="2d.composite.uncovered.nocontext.destination-atop">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.nocontext.destination-in.html" accesskey="p" title="[p] 2d.composite.uncovered.nocontext.destination-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.nocontext.destination-atop.html" accesskey="n" title="[n] 2d.composite.uncovered.nocontext.destination-atop">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.nocontext.html">nocontext</a>.source-out</h1>
+<p class="desc">drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-out">2d.composite.source-out</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.nocontext.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-out';
+var canvas2 = document.createElement('canvas');
+ctx.drawImage(canvas2, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-out.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-out.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.nocontext.source-out.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.copy.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.copy.html
new file mode 100644
index 0000000..d59e519
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.copy.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.pattern.copy</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.pattern.destination-atop.html" title="2d.composite.uncovered.pattern.destination-atop">
+<link rel="next" href="2d.composite.clip.source-over.html" title="2d.composite.clip.source-over">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.pattern.destination-atop.html" accesskey="p" title="[p] 2d.composite.uncovered.pattern.destination-atop"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.clip.source-over.html" accesskey="n" title="[n] 2d.composite.clip.source-over">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.pattern.html">pattern</a>.copy</h1>
+<p class="desc">Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.copy">2d.composite.copy</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.pattern.copy.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'copy';
+ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat');
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="../images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.copy.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.copy.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.copy.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-atop.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-atop.html
new file mode 100644
index 0000000..df0af44
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-atop.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.pattern.destination-atop</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.pattern.source-out.html" title="2d.composite.uncovered.pattern.source-out">
+<link rel="next" href="2d.composite.uncovered.pattern.copy.html" title="2d.composite.uncovered.pattern.copy">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.pattern.source-out.html" accesskey="p" title="[p] 2d.composite.uncovered.pattern.source-out"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.pattern.copy.html" accesskey="n" title="[n] 2d.composite.uncovered.pattern.copy">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.pattern.html">pattern</a>.destination-atop</h1>
+<p class="desc">Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-atop">2d.composite.destination-atop</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.pattern.destination-atop.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat');
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="../images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-atop.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-atop.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-atop.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-in.html
new file mode 100644
index 0000000..54f9ae3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-in.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.pattern.destination-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.pattern.source-in.html" title="2d.composite.uncovered.pattern.source-in">
+<link rel="next" href="2d.composite.uncovered.pattern.source-out.html" title="2d.composite.uncovered.pattern.source-out">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.pattern.source-in.html" accesskey="p" title="[p] 2d.composite.uncovered.pattern.source-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.pattern.source-out.html" accesskey="n" title="[n] 2d.composite.uncovered.pattern.source-out">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.pattern.html">pattern</a>.destination-in</h1>
+<p class="desc">Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.destination-in">2d.composite.destination-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.pattern.destination-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-in';
+ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat');
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="../images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-in.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.destination-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-in.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-in.html
new file mode 100644
index 0000000..3f4c410
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-in.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.pattern.source-in</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.nocontext.copy.html" title="2d.composite.uncovered.nocontext.copy">
+<link rel="next" href="2d.composite.uncovered.pattern.destination-in.html" title="2d.composite.uncovered.pattern.destination-in">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.nocontext.copy.html" accesskey="p" title="[p] 2d.composite.uncovered.nocontext.copy"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.pattern.destination-in.html" accesskey="n" title="[n] 2d.composite.uncovered.pattern.destination-in">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.pattern.html">pattern</a>.source-in</h1>
+<p class="desc">Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-in">2d.composite.source-in</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.pattern.source-in.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-in';
+ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat');
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="../images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-in.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-in.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-in.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-out.html b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-out.html
new file mode 100644
index 0000000..2015b99
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-out.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.composite.uncovered.pattern.source-out</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.uncovered.pattern.destination-in.html" title="2d.composite.uncovered.pattern.destination-in">
+<link rel="next" href="2d.composite.uncovered.pattern.destination-atop.html" title="2d.composite.uncovered.pattern.destination-atop">
+<body class="show_output">
+<p>
+ <a href="2d.composite.uncovered.pattern.destination-in.html" accesskey="p" title="[p] 2d.composite.uncovered.pattern.destination-in"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.uncovered.pattern.destination-atop.html" accesskey="n" title="[n] 2d.composite.uncovered.pattern.destination-atop">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.composite.html">composite</a>.<a href="index.2d.composite.uncovered.html">uncovered</a>.<a href="index.2d.composite.uncovered.pattern.html">pattern</a>.source-out</h1>
+<p class="desc">Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.composite.source-out">2d.composite.source-out</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.composite.uncovered.pattern.source-out.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = 'rgba(0, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'source-out';
+ctx.fillStyle = ctx.createPattern(document.getElementById('yellow.png'), 'no-repeat');
+ctx.fillRect(0, 50, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0", 5);
+
+
+});
+</script>
+<img src="../images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-out.png b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-out.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.composite.uncovered.pattern.source-out.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.coordinatespace.html b/LayoutTests/fast/canvas/philip/tests/2d.coordinatespace.html
new file mode 100644
index 0000000..81622b3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.coordinatespace.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.coordinatespace</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.missingargs.html" title="2d.missingargs">
+<link rel="next" href="2d.scaled.html" title="2d.scaled">
+<body class="show_output">
+<p>
+ <a href="2d.missingargs.html" accesskey="p" title="[p] 2d.missingargs"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.scaled.html" accesskey="n" title="[n] 2d.scaled">></a>
+<h1><a href="index.2d.html">2d</a>.coordinatespace</h1>
+<p class="desc">Coordinate space goes from top-left to bottom-right</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.coordinatespace">2d.coordinatespace</a>
+
+</ul>
+</div>
+<p class="notes">This should not be upside down.
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.coordinatespace.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#00f';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0ff';
+ctx.fillRect(0, 0, 50, 25);
+_assertPixel(canvas, 25,12, 0,255,255,255, "25,12", "0,255,255,255");
+_assertPixel(canvas, 75,12, 0,0,255,255, "75,12", "0,0,255,255");
+_assertPixel(canvas, 25,37, 0,0,255,255, "25,37", "0,0,255,255");
+_assertPixel(canvas, 75,37, 0,0,255,255, "75,37", "0,0,255,255");
+_requireManualCheck(); // because we can't tell that getPixelData isn't using the wrong coordinate space too
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.coordinatespace.png b/LayoutTests/fast/canvas/philip/tests/2d.coordinatespace.png
new file mode 100644
index 0000000..242be92
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.coordinatespace.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.3arg.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.3arg.html
new file mode 100644
index 0000000..5c33f6b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.3arg.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.3arg</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.isPointInPath.nonfinite.html" title="2d.path.isPointInPath.nonfinite">
+<link rel="next" href="2d.drawImage.5arg.html" title="2d.drawImage.5arg">
+<body class="show_output">
+<p>
+ <a href="2d.path.isPointInPath.nonfinite.html" accesskey="p" title="[p] 2d.path.isPointInPath.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.5arg.html" accesskey="n" title="[n] 2d.drawImage.5arg">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.3arg</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.defaultsource">2d.drawImage.defaultsource</a>
+<li><a href="spec.html#testrefs.2d.drawImage.defaultdest">2d.drawImage.defaultdest</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.drawImage(document.getElementById('green.png'), 0, 0);
+ctx.drawImage(document.getElementById('red.png'), -100, 0);
+ctx.drawImage(document.getElementById('red.png'), 100, 0);
+ctx.drawImage(document.getElementById('red.png'), 0, -50);
+ctx.drawImage(document.getElementById('red.png'), 0, 50);
+
+_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+<img src="../images/green.png" id="green.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.5arg.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.5arg.html
new file mode 100644
index 0000000..44cdb2c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.5arg.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.5arg</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.3arg.html" title="2d.drawImage.3arg">
+<link rel="next" href="2d.drawImage.9arg.basic.html" title="2d.drawImage.9arg.basic">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.3arg.html" accesskey="p" title="[p] 2d.drawImage.3arg"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.9arg.basic.html" accesskey="n" title="[n] 2d.drawImage.9arg.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.5arg</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.defaultsource">2d.drawImage.defaultsource</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.drawImage(document.getElementById('green.png'), 50, 0, 50, 50);
+ctx.drawImage(document.getElementById('red.png'), 0, 0, 50, 50);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 50, 50);
+
+_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+<img src="../images/green.png" id="green.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.9arg.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.9arg.basic.html
new file mode 100644
index 0000000..30b9ea5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.9arg.basic.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.9arg.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.5arg.html" title="2d.drawImage.5arg">
+<link rel="next" href="2d.drawImage.9arg.sourcepos.html" title="2d.drawImage.9arg.sourcepos">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.5arg.html" accesskey="p" title="[p] 2d.drawImage.5arg"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.9arg.sourcepos.html" accesskey="n" title="[n] 2d.drawImage.9arg.sourcepos">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.<a href="index.2d.drawImage.9arg.html">9arg</a>.basic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.paint">2d.drawImage.paint</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.drawImage(document.getElementById('green.png'), 0, 0, 100, 50, 0, 0, 100, 50);
+_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/green.png" id="green.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.9arg.destpos.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.9arg.destpos.html
new file mode 100644
index 0000000..17f7d03
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.9arg.destpos.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.9arg.destpos</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.9arg.sourcesize.html" title="2d.drawImage.9arg.sourcesize">
+<link rel="next" href="2d.drawImage.9arg.destsize.html" title="2d.drawImage.9arg.destsize">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.9arg.sourcesize.html" accesskey="p" title="[p] 2d.drawImage.9arg.sourcesize"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.9arg.destsize.html" accesskey="n" title="[n] 2d.drawImage.9arg.destsize">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.<a href="index.2d.drawImage.9arg.html">9arg</a>.destpos</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.paint">2d.drawImage.paint</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.drawImage(document.getElementById('green.png'), 0, 0, 100, 50, 0, 0, 100, 50);
+ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, -100, 0, 100, 50);
+ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 100, 0, 100, 50);
+ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, -50, 100, 50);
+ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, 50, 100, 50);
+_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+<img src="../images/green.png" id="green.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.9arg.destsize.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.9arg.destsize.html
new file mode 100644
index 0000000..d841317
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.9arg.destsize.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.9arg.destsize</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.9arg.destpos.html" title="2d.drawImage.9arg.destpos">
+<link rel="next" href="2d.drawImage.canvas.html" title="2d.drawImage.canvas">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.9arg.destpos.html" accesskey="p" title="[p] 2d.drawImage.9arg.destpos"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.canvas.html" accesskey="n" title="[n] 2d.drawImage.canvas">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.<a href="index.2d.drawImage.9arg.html">9arg</a>.destsize</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.paint">2d.drawImage.paint</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.drawImage(document.getElementById('green.png'), 1, 1, 1, 1, 0, 0, 100, 50);
+ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, -50, 0, 50, 50);
+ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 100, 0, 50, 50);
+ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, -25, 100, 25);
+ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50, 0, 50, 100, 25);
+_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+<img src="../images/green.png" id="green.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.9arg.sourcepos.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.9arg.sourcepos.html
new file mode 100644
index 0000000..2319fd6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.9arg.sourcepos.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.9arg.sourcepos</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.9arg.basic.html" title="2d.drawImage.9arg.basic">
+<link rel="next" href="2d.drawImage.9arg.sourcesize.html" title="2d.drawImage.9arg.sourcesize">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.9arg.basic.html" accesskey="p" title="[p] 2d.drawImage.9arg.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.9arg.sourcesize.html" accesskey="n" title="[n] 2d.drawImage.9arg.sourcesize">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.<a href="index.2d.drawImage.9arg.html">9arg</a>.sourcepos</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.paint">2d.drawImage.paint</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.drawImage(document.getElementById('rgrg-256x256.png'), 140, 20, 100, 50, 0, 0, 100, 50);
+_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/rgrg-256x256.png" id="rgrg-256x256.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.9arg.sourcesize.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.9arg.sourcesize.html
new file mode 100644
index 0000000..c218d66
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.9arg.sourcesize.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.9arg.sourcesize</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.9arg.sourcepos.html" title="2d.drawImage.9arg.sourcepos">
+<link rel="next" href="2d.drawImage.9arg.destpos.html" title="2d.drawImage.9arg.destpos">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.9arg.sourcepos.html" accesskey="p" title="[p] 2d.drawImage.9arg.sourcepos"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.9arg.destpos.html" accesskey="n" title="[n] 2d.drawImage.9arg.destpos">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.<a href="index.2d.drawImage.9arg.html">9arg</a>.sourcesize</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.paint">2d.drawImage.paint</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.drawImage(document.getElementById('rgrg-256x256.png'), 0, 0, 256, 256, 0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 51, 26);
+ctx.fillRect(49, 24, 51, 26);
+_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 20,20, 0,255,0,255, "20,20", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 80,20, 0,255,0,255, "80,20", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 20,30, 0,255,0,255, "20,30", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 80,30, 0,255,0,255, "80,30", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/rgrg-256x256.png" id="rgrg-256x256.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.alpha.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.alpha.html
new file mode 100644
index 0000000..fc6757d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.alpha.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.alpha</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.transform.html" title="2d.drawImage.transform">
+<link rel="next" href="2d.drawImage.clip.html" title="2d.drawImage.clip">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.transform.html" accesskey="p" title="[p] 2d.drawImage.transform"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.clip.html" accesskey="n" title="[n] 2d.drawImage.clip">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.alpha</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.subject">2d.drawImage.subject</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalAlpha = 0;
+ctx.drawImage(document.getElementById('red.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.animated.apng.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.animated.apng.html
new file mode 100644
index 0000000..d67beaf
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.animated.apng.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.animated.apng</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.animated.gif.html" title="2d.drawImage.animated.gif">
+<link rel="next" href="2d.drawImage.animated.poster.html" title="2d.drawImage.animated.poster">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.animated.gif.html" accesskey="p" title="[p] 2d.drawImage.animated.gif"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.animated.poster.html" accesskey="n" title="[n] 2d.drawImage.animated.poster">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.<a href="index.2d.drawImage.animated.html">animated</a>.apng</h1>
+<p class="desc">drawImage() of an APNG with no poster frame draws the first frame</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.animated.image">2d.drawImage.animated.image</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.drawImage(document.getElementById('anim-gr.png'), 0, 0);
+ _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+<img src="../images/anim-gr.png" id="anim-gr.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.animated.gif.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.animated.gif.html
new file mode 100644
index 0000000..a686758
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.animated.gif.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.animated.gif</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.zerocanvas.html" title="2d.drawImage.zerocanvas">
+<link rel="next" href="2d.drawImage.animated.apng.html" title="2d.drawImage.animated.apng">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.zerocanvas.html" accesskey="p" title="[p] 2d.drawImage.zerocanvas"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.animated.apng.html" accesskey="n" title="[n] 2d.drawImage.animated.apng">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.<a href="index.2d.drawImage.animated.html">animated</a>.gif</h1>
+<p class="desc">drawImage() of an animated GIF draws the first frame</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.animated.image">2d.drawImage.animated.image</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.drawImage(document.getElementById('anim-gr.gif'), 0, 0);
+ _assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+<img src="../images/anim-gr.gif" id="anim-gr.gif" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.animated.poster.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.animated.poster.html
new file mode 100644
index 0000000..bc64cf9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.animated.poster.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.animated.poster</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.animated.apng.html" title="2d.drawImage.animated.apng">
+<link rel="next" href="2d.drawImage.path.html" title="2d.drawImage.path">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.animated.apng.html" accesskey="p" title="[p] 2d.drawImage.animated.apng"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.path.html" accesskey="n" title="[n] 2d.drawImage.path">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.<a href="index.2d.drawImage.animated.html">animated</a>.poster</h1>
+<p class="desc">drawImage() of an APNG draws the poster frame</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.animated.image">2d.drawImage.animated.image</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.drawImage(document.getElementById('anim-poster-gr.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/anim-poster-gr.png" id="anim-poster-gr.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.broken.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.broken.html
new file mode 100644
index 0000000..4ae5e07
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.broken.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.broken</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.incomplete.html" title="2d.drawImage.incomplete">
+<link rel="next" href="2d.drawImage.zerocanvas.html" title="2d.drawImage.zerocanvas">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.incomplete.html" accesskey="p" title="[p] 2d.drawImage.incomplete"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.zerocanvas.html" accesskey="n" title="[n] 2d.drawImage.zerocanvas">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.broken</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.incomplete.image">2d.drawImage.incomplete.image</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+var img = document.getElementById('broken.png');
+_assertSame(img.complete, false, "img.complete", "false");
+ctx.drawImage(img, 0, 0);
+
+
+});
+</script>
+<img src="../images/broken.png" id="broken.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.canvas.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.canvas.html
new file mode 100644
index 0000000..cf66d24
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.canvas.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.canvas</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.9arg.destsize.html" title="2d.drawImage.9arg.destsize">
+<link rel="next" href="2d.drawImage.self.1.html" title="2d.drawImage.self.1">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.9arg.destsize.html" accesskey="p" title="[p] 2d.drawImage.9arg.destsize"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.self.1.html" accesskey="n" title="[n] 2d.drawImage.self.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.canvas</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.paint">2d.drawImage.paint</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.fillStyle = '#0f0';
+ctx2.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#f00';
+ctx.drawImage(canvas2, 0, 0);
+
+_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.clip.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.clip.html
new file mode 100644
index 0000000..d62317a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.clip.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.clip</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.alpha.html" title="2d.drawImage.alpha">
+<link rel="next" href="2d.drawImage.composite.html" title="2d.drawImage.composite">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.alpha.html" accesskey="p" title="[p] 2d.drawImage.alpha"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.composite.html" accesskey="n" title="[n] 2d.drawImage.composite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.clip</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.subject">2d.drawImage.subject</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.rect(-10, -10, 1, 1);
+ctx.clip();
+ctx.drawImage(document.getElementById('red.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.composite.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.composite.html
new file mode 100644
index 0000000..e7d9e11
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.composite.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.composite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.clip.html" title="2d.drawImage.clip">
+<link rel="next" href="2d.drawImage.nowrap.html" title="2d.drawImage.nowrap">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.clip.html" accesskey="p" title="[p] 2d.drawImage.clip"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.nowrap.html" accesskey="n" title="[n] 2d.drawImage.nowrap">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.composite</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.subject">2d.drawImage.subject</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-over';
+ctx.drawImage(document.getElementById('red.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.floatsource.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.floatsource.html
new file mode 100644
index 0000000..39c38d9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.floatsource.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.floatsource</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.wrongtype.html" title="2d.drawImage.wrongtype">
+<link rel="next" href="2d.drawImage.zerosource.html" title="2d.drawImage.zerosource">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.wrongtype.html" accesskey="p" title="[p] 2d.drawImage.wrongtype"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.zerosource.html" accesskey="n" title="[n] 2d.drawImage.zerosource">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.floatsource</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.paint">2d.drawImage.paint</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.drawImage(document.getElementById('green.png'), 10.1, 10.1, 0.1, 0.1, 0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/green.png" id="green.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.incomplete.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.incomplete.html
new file mode 100644
index 0000000..ac00260
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.incomplete.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.incomplete</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.outsidesource.html" title="2d.drawImage.outsidesource">
+<link rel="next" href="2d.drawImage.broken.html" title="2d.drawImage.broken">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.outsidesource.html" accesskey="p" title="[p] 2d.drawImage.outsidesource"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.broken.html" accesskey="n" title="[n] 2d.drawImage.broken">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.incomplete</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.incomplete.image">2d.drawImage.incomplete.image</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+var img = new Image();
+_assertSame(img.complete, false, "img.complete", "false");
+ctx.drawImage(img, 0, 0);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.negativedest.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.negativedest.html
new file mode 100644
index 0000000..37dd063
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.negativedest.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.negativedest</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.negativesource.html" title="2d.drawImage.negativesource">
+<link rel="next" href="2d.drawImage.negativedir.html" title="2d.drawImage.negativedir">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.negativesource.html" accesskey="p" title="[p] 2d.drawImage.negativesource"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.negativedir.html" accesskey="n" title="[n] 2d.drawImage.negativedir">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.negativedest</h1>
+<p class="desc">Negative destination width/height represents the correct rectangle</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.direction">2d.drawImage.direction</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 78, 50, 50, 0, 50, 50, -50);
+ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 128, 50, -50, 100, 50, -50, -50);
+_assertPixelApprox(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 51,1, 0,255,0,255, "51,1", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 51,48, 0,255,0,255, "51,48", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/ggrr-256x256.png" id="ggrr-256x256.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.negativedir.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.negativedir.html
new file mode 100644
index 0000000..d674692
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.negativedir.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.negativedir</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.negativedest.html" title="2d.drawImage.negativedest">
+<link rel="next" href="2d.drawImage.outsidesource.html" title="2d.drawImage.outsidesource">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.negativedest.html" accesskey="p" title="[p] 2d.drawImage.negativedest"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.outsidesource.html" accesskey="n" title="[n] 2d.drawImage.outsidesource">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.negativedir</h1>
+<p class="desc">Negative dimensions do not affect the direction of the image</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.direction">2d.drawImage.direction</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.drawImage(document.getElementById('ggrr-256x256.png'), 0, 178, 50, -100, 0, 0, 50, 100);
+ctx.drawImage(document.getElementById('ggrr-256x256.png'), 0, 78, 50, 100, 50, 100, 50, -100);
+_assertPixelApprox(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 51,1, 0,255,0,255, "51,1", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 51,48, 0,255,0,255, "51,48", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/ggrr-256x256.png" id="ggrr-256x256.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.negativesource.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.negativesource.html
new file mode 100644
index 0000000..311c779
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.negativesource.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.negativesource</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.zerosource.html" title="2d.drawImage.zerosource">
+<link rel="next" href="2d.drawImage.negativedest.html" title="2d.drawImage.negativedest">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.zerosource.html" accesskey="p" title="[p] 2d.drawImage.zerosource"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.negativedest.html" accesskey="n" title="[n] 2d.drawImage.negativedest">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.negativesource</h1>
+<p class="desc">Negative source width/height represents the correct rectangle</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.direction">2d.drawImage.direction</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 78, -100, 50, 0, 0, 50, 50);
+ctx.drawImage(document.getElementById('ggrr-256x256.png'), 100, 128, -100, -50, 50, 0, 50, 50);
+_assertPixelApprox(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 51,1, 0,255,0,255, "51,1", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 51,48, 0,255,0,255, "51,48", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/ggrr-256x256.png" id="ggrr-256x256.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.nonfinite.html
new file mode 100644
index 0000000..17c981b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.nonfinite.html
@@ -0,0 +1,338 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.nowrap.html" title="2d.drawImage.nowrap">
+<link rel="next" href="2d.imageData.create2.basic.html" title="2d.imageData.create2.basic">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.nowrap.html" accesskey="p" title="[p] 2d.drawImage.nowrap"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.create2.basic.html" accesskey="n" title="[n] 2d.imageData.create2.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.nonfinite</h1>
+<p class="desc">drawImage() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+var red = document.getElementById('red.png');
+ctx.drawImage(red, Infinity, 0);
+ctx.drawImage(red, -Infinity, 0);
+ctx.drawImage(red, NaN, 0);
+ctx.drawImage(red, 0, Infinity);
+ctx.drawImage(red, 0, -Infinity);
+ctx.drawImage(red, 0, NaN);
+ctx.drawImage(red, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, 50);
+ctx.drawImage(red, -Infinity, 0, 100, 50);
+ctx.drawImage(red, NaN, 0, 100, 50);
+ctx.drawImage(red, 0, Infinity, 100, 50);
+ctx.drawImage(red, 0, -Infinity, 100, 50);
+ctx.drawImage(red, 0, NaN, 100, 50);
+ctx.drawImage(red, 0, 0, Infinity, 50);
+ctx.drawImage(red, 0, 0, -Infinity, 50);
+ctx.drawImage(red, 0, 0, NaN, 50);
+ctx.drawImage(red, 0, 0, 100, Infinity);
+ctx.drawImage(red, 0, 0, 100, -Infinity);
+ctx.drawImage(red, 0, 0, 100, NaN);
+ctx.drawImage(red, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, 100, 50);
+ctx.drawImage(red, -Infinity, 0, 100, 50, 0, 0, 100, 50);
+ctx.drawImage(red, NaN, 0, 100, 50, 0, 0, 100, 50);
+ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, 100, 50);
+ctx.drawImage(red, 0, -Infinity, 100, 50, 0, 0, 100, 50);
+ctx.drawImage(red, 0, NaN, 100, 50, 0, 0, 100, 50);
+ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, 100, 50);
+ctx.drawImage(red, 0, 0, -Infinity, 50, 0, 0, 100, 50);
+ctx.drawImage(red, 0, 0, NaN, 50, 0, 0, 100, 50);
+ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, 100, 50);
+ctx.drawImage(red, 0, 0, 100, -Infinity, 0, 0, 100, 50);
+ctx.drawImage(red, 0, 0, 100, NaN, 0, 0, 100, 50);
+ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, 100, 50);
+ctx.drawImage(red, 0, 0, 100, 50, -Infinity, 0, 100, 50);
+ctx.drawImage(red, 0, 0, 100, 50, NaN, 0, 100, 50);
+ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, 100, 50);
+ctx.drawImage(red, 0, 0, 100, 50, 0, -Infinity, 100, 50);
+ctx.drawImage(red, 0, 0, 100, 50, 0, NaN, 100, 50);
+ctx.drawImage(red, 0, 0, 100, 50, 0, 0, Infinity, 50);
+ctx.drawImage(red, 0, 0, 100, 50, 0, 0, -Infinity, 50);
+ctx.drawImage(red, 0, 0, 100, 50, 0, 0, NaN, 50);
+ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, Infinity);
+ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, -Infinity);
+ctx.drawImage(red, 0, 0, 100, 50, 0, 0, 100, NaN);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, Infinity, Infinity, 0, 0, 100, Infinity);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, Infinity, 50, 0, 0, 100, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, Infinity, 0, 0, 100, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, Infinity, 100, 50, 0, 0, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, 100, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, 100, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, 100, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, Infinity, 0, 0, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, 100, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, Infinity, 50, 0, 0, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, 100, 50);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, 100, 50);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, Infinity, 0, 0, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, 100, 50);
+ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, 50, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, 100, 50);
+ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, 50, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, Infinity, 50);
+ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, Infinity, 0, 100, 50, 0, 0, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, 100, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, 100, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, 100, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, 100, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, Infinity, 0, 0, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, 100, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, 100, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, Infinity, 50, 0, 0, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, 100, 50);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, 100, 50);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, 100, 50);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, Infinity, 0, 0, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, 100, 50);
+ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, 50, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, 100, 50);
+ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, 50, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, Infinity, 50);
+ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, 0, Infinity, 100, 50, 0, 0, 100, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, 100, 50);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, 100, 50);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, 100, 50);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, Infinity, 50);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, Infinity, 0, 0, 100, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, 100, 50);
+ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, 50, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, 100, 50);
+ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, 50, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, Infinity, 50);
+ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, 0, 0, Infinity, 50, 0, 0, 100, Infinity);
+ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, 100, 50);
+ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, 0, 0, 100, Infinity, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, 100, 50);
+ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, 0, 100, Infinity, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, Infinity, 50);
+ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, Infinity, Infinity);
+ctx.drawImage(red, 0, 0, 100, Infinity, 0, 0, 100, Infinity);
+ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, 100, 50);
+ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, 0, 100, 50, Infinity, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, Infinity, 50);
+ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, Infinity, Infinity);
+ctx.drawImage(red, 0, 0, 100, 50, Infinity, 0, 100, Infinity);
+ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, Infinity, 50);
+ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, Infinity, Infinity);
+ctx.drawImage(red, 0, 0, 100, 50, 0, Infinity, 100, Infinity);
+ctx.drawImage(red, 0, 0, 100, 50, 0, 0, Infinity, Infinity);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.nowrap.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.nowrap.html
new file mode 100644
index 0000000..68c0cb3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.nowrap.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.nowrap</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.composite.html" title="2d.drawImage.composite">
+<link rel="next" href="2d.drawImage.nonfinite.html" title="2d.drawImage.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.composite.html" accesskey="p" title="[p] 2d.drawImage.composite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.nonfinite.html" accesskey="n" title="[n] 2d.drawImage.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.nowrap</h1>
+<p class="desc">Stretched images do not get pixels wrapping around the edges</p>
+<div class="refs">References:
+<ul>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.drawImage(document.getElementById('redtransparent.png'), -1950, 0, 2000, 50);
+_assertPixelApprox(canvas, 45,25, 0,255,0,255, "45,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 55,25, 0,255,0,255, "55,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/redtransparent.png" id="redtransparent.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.null.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.null.html
new file mode 100644
index 0000000..daa141e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.null.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.null</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.self.2.html" title="2d.drawImage.self.2">
+<link rel="next" href="2d.drawImage.wrongtype.html" title="2d.drawImage.wrongtype">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.self.2.html" accesskey="p" title="[p] 2d.drawImage.self.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.wrongtype.html" accesskey="n" title="[n] 2d.drawImage.wrongtype">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.null</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.type">2d.drawImage.type</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.drawImage(null, 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(null, 0, 0)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.outsidesource.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.outsidesource.html
new file mode 100644
index 0000000..c0ebcbb
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.outsidesource.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.outsidesource</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.negativedir.html" title="2d.drawImage.negativedir">
+<link rel="next" href="2d.drawImage.incomplete.html" title="2d.drawImage.incomplete">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.negativedir.html" accesskey="p" title="[p] 2d.drawImage.negativedir"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.incomplete.html" accesskey="n" title="[n] 2d.drawImage.incomplete">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.outsidesource</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.outsidesource">2d.drawImage.outsidesource</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.drawImage(document.getElementById('green.png'), 10.5, 10.5, 89.5, 39.5, 0, 0, 100, 50);
+ctx.drawImage(document.getElementById('green.png'), 5.5, 5.5, -5.5, -5.5, 0, 0, 100, 50);
+ctx.drawImage(document.getElementById('green.png'), 100, 50, -5, -5, 0, 0, 100, 50);
+try { var _thrown = false;
+ ctx.drawImage(document.getElementById('red.png'), -0.001, 0, 100, 50, 0, 0, 100, 50);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), -0.001, 0, 100, 50, 0, 0, 100, 50)"); }
+try { var _thrown = false;
+ ctx.drawImage(document.getElementById('red.png'), 0, -0.001, 100, 50, 0, 0, 100, 50);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, -0.001, 100, 50, 0, 0, 100, 50)"); }
+try { var _thrown = false;
+ ctx.drawImage(document.getElementById('red.png'), 0, 0, 100.001, 50, 0, 0, 100, 50);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, 100.001, 50, 0, 0, 100, 50)"); }
+try { var _thrown = false;
+ ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50.001, 0, 0, 100, 50);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, 100, 50.001, 0, 0, 100, 50)"); }
+try { var _thrown = false;
+ ctx.drawImage(document.getElementById('red.png'), 50, 0, 50.001, 50, 0, 0, 100, 50);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 50, 0, 50.001, 50, 0, 0, 100, 50)"); }
+try { var _thrown = false;
+ ctx.drawImage(document.getElementById('red.png'), 0, 0, -5, 5, 0, 0, 100, 50);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, -5, 5, 0, 0, 100, 50)"); }
+try { var _thrown = false;
+ ctx.drawImage(document.getElementById('red.png'), 0, 0, 5, -5, 0, 0, 100, 50);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 0, 0, 5, -5, 0, 0, 100, 50)"); }
+try { var _thrown = false;
+ ctx.drawImage(document.getElementById('red.png'), 110, 60, -20, -20, 0, 0, 100, 50);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 110, 60, -20, -20, 0, 0, 100, 50)"); }
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/green.png" id="green.png" class="resource">
+<img src="../images/red.png" id="red.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.path.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.path.html
new file mode 100644
index 0000000..3f23e41
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.path.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.path</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.animated.poster.html" title="2d.drawImage.animated.poster">
+<link rel="next" href="2d.drawImage.transform.html" title="2d.drawImage.transform">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.animated.poster.html" accesskey="p" title="[p] 2d.drawImage.animated.poster"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.transform.html" accesskey="n" title="[n] 2d.drawImage.transform">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.path</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.unaffect">2d.drawImage.unaffect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.rect(0, 0, 100, 50);
+ctx.drawImage(document.getElementById('red.png'), 0, 0);
+ctx.fill();
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.self.1.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.self.1.html
new file mode 100644
index 0000000..f18d14c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.self.1.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.self.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.canvas.html" title="2d.drawImage.canvas">
+<link rel="next" href="2d.drawImage.self.2.html" title="2d.drawImage.self.2">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.canvas.html" accesskey="p" title="[p] 2d.drawImage.canvas"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.self.2.html" accesskey="n" title="[n] 2d.drawImage.self.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.<a href="index.2d.drawImage.self.html">self</a>.1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.self">2d.drawImage.self</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433235">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 50, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(50, 0, 50, 50);
+ctx.drawImage(canvas, 50, 0);
+
+_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.self.2.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.self.2.html
new file mode 100644
index 0000000..5953c07
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.self.2.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.self.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.self.1.html" title="2d.drawImage.self.1">
+<link rel="next" href="2d.drawImage.null.html" title="2d.drawImage.null">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.self.1.html" accesskey="p" title="[p] 2d.drawImage.self.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.null.html" accesskey="n" title="[n] 2d.drawImage.null">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.<a href="index.2d.drawImage.self.html">self</a>.2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.self">2d.drawImage.self</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433235">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 1, 100, 49);
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 1);
+ctx.drawImage(canvas, 0, 1);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 2);
+
+_assertPixelApprox(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.transform.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.transform.html
new file mode 100644
index 0000000..339ab4a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.transform.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.transform</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.path.html" title="2d.drawImage.path">
+<link rel="next" href="2d.drawImage.alpha.html" title="2d.drawImage.alpha">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.path.html" accesskey="p" title="[p] 2d.drawImage.path"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.alpha.html" accesskey="n" title="[n] 2d.drawImage.alpha">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.transform</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.subject">2d.drawImage.subject</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.translate(100, 0);
+ctx.drawImage(document.getElementById('red.png'), 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.wrongtype.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.wrongtype.html
new file mode 100644
index 0000000..848f18e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.wrongtype.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.wrongtype</title>
+<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"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.floatsource.html" accesskey="n" title="[n] 2d.drawImage.floatsource">></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>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_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)"); }
+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)"); }
+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)"); }
+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)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.zerocanvas.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.zerocanvas.html
new file mode 100644
index 0000000..69db5d3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.zerocanvas.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.zerocanvas</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.broken.html" title="2d.drawImage.broken">
+<link rel="next" href="2d.drawImage.animated.gif.html" title="2d.drawImage.animated.gif">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.broken.html" accesskey="p" title="[p] 2d.drawImage.broken"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.animated.gif.html" accesskey="n" title="[n] 2d.drawImage.animated.gif">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.zerocanvas</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.zerocanvas">2d.drawImage.zerocanvas</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 0;
+canvas2.height = 10;
+try { var _thrown = false;
+ ctx.drawImage(canvas2, 0, 0);
+} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)"); }
+
+canvas2.width = 10;
+canvas2.height = 0;
+try { var _thrown = false;
+ ctx.drawImage(canvas2, 0, 0);
+} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)"); }
+
+canvas2.width = 0;
+canvas2.height = 0;
+try { var _thrown = false;
+ ctx.drawImage(canvas2, 0, 0);
+} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.drawImage(canvas2, 0, 0)"); }
+
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.drawImage.zerosource.html b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.zerosource.html
new file mode 100644
index 0000000..58dcb30
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.drawImage.zerosource.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.drawImage.zerosource</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.floatsource.html" title="2d.drawImage.floatsource">
+<link rel="next" href="2d.drawImage.negativesource.html" title="2d.drawImage.negativesource">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.floatsource.html" accesskey="p" title="[p] 2d.drawImage.floatsource"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.negativesource.html" accesskey="n" title="[n] 2d.drawImage.negativesource">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.drawImage.html">drawImage</a>.zerosource</h1>
+<p class="desc">drawImage with zero-sized source rectangle throws INDEX_SIZE_ERR</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.drawImage.zerosource">2d.drawImage.zerosource</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+try { var _thrown = false;
+ ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 1, 0, 0, 100, 50);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 1, 0, 0, 100, 50)"); }
+try { var _thrown = false;
+ ctx.drawImage(document.getElementById('red.png'), 10, 10, 1, 0, 0, 0, 100, 50);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 1, 0, 0, 0, 100, 50)"); }
+try { var _thrown = false;
+ ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 0, 0, 0, 100, 50);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.drawImage(document.getElementById('red.png'), 10, 10, 0, 0, 0, 0, 100, 50)"); }
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillRect.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.basic.html
new file mode 100644
index 0000000..4be77a0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.basic.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillRect.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.clearRect.nonfinite.html" title="2d.clearRect.nonfinite">
+<link rel="next" href="2d.fillRect.path.html" title="2d.fillRect.path">
+<body class="show_output">
+<p>
+ <a href="2d.clearRect.nonfinite.html" accesskey="p" title="[p] 2d.clearRect.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillRect.path.html" accesskey="n" title="[n] 2d.fillRect.path">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillRect.html">fillRect</a>.basic</h1>
+<p class="desc">fillRect works</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.fillRect">2d.fillRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillRect.clip.html b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.clip.html
new file mode 100644
index 0000000..6a7ac03
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.clip.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillRect.clip</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillRect.transform.html" title="2d.fillRect.transform">
+<link rel="next" href="2d.fillRect.shadow.html" title="2d.fillRect.shadow">
+<body class="show_output">
+<p>
+ <a href="2d.fillRect.transform.html" accesskey="p" title="[p] 2d.fillRect.transform"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillRect.shadow.html" accesskey="n" title="[n] 2d.fillRect.shadow">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillRect.html">fillRect</a>.clip</h1>
+<p class="desc">fillRect is affected by clipping regions</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.fillRect">2d.fillRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.beginPath();
+ctx.rect(0, 0, 16, 16);
+ctx.clip();
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 16, 16);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillRect.negative.html b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.negative.html
new file mode 100644
index 0000000..041fc9b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.negative.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillRect.negative</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillRect.zero.html" title="2d.fillRect.zero">
+<link rel="next" href="2d.fillRect.transform.html" title="2d.fillRect.transform">
+<body class="show_output">
+<p>
+ <a href="2d.fillRect.zero.html" accesskey="p" title="[p] 2d.fillRect.zero"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillRect.transform.html" accesskey="n" title="[n] 2d.fillRect.transform">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillRect.html">fillRect</a>.negative</h1>
+<p class="desc">fillRect of negative sizes works</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.fillRect">2d.fillRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 50, 25);
+ctx.fillRect(100, 0, -50, 25);
+ctx.fillRect(0, 50, 50, -25);
+ctx.fillRect(100, 50, -50, -25);
+_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255");
+_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255");
+_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255");
+_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillRect.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.nonfinite.html
new file mode 100644
index 0000000..3ba38e4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.nonfinite.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillRect.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillRect.shadow.html" title="2d.fillRect.shadow">
+<link rel="next" href="2d.strokeRect.basic.html" title="2d.strokeRect.basic">
+<body class="show_output">
+<p>
+ <a href="2d.fillRect.shadow.html" accesskey="p" title="[p] 2d.fillRect.shadow"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.strokeRect.basic.html" accesskey="n" title="[n] 2d.strokeRect.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillRect.html">fillRect</a>.nonfinite</h1>
+<p class="desc">fillRect() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(Infinity, 0, 100, 50);
+ctx.fillRect(-Infinity, 0, 100, 50);
+ctx.fillRect(NaN, 0, 100, 50);
+ctx.fillRect(0, Infinity, 100, 50);
+ctx.fillRect(0, -Infinity, 100, 50);
+ctx.fillRect(0, NaN, 100, 50);
+ctx.fillRect(0, 0, Infinity, 50);
+ctx.fillRect(0, 0, -Infinity, 50);
+ctx.fillRect(0, 0, NaN, 50);
+ctx.fillRect(0, 0, 100, Infinity);
+ctx.fillRect(0, 0, 100, -Infinity);
+ctx.fillRect(0, 0, 100, NaN);
+ctx.fillRect(Infinity, Infinity, 100, 50);
+ctx.fillRect(Infinity, Infinity, Infinity, 50);
+ctx.fillRect(Infinity, Infinity, Infinity, Infinity);
+ctx.fillRect(Infinity, Infinity, 100, Infinity);
+ctx.fillRect(Infinity, 0, Infinity, 50);
+ctx.fillRect(Infinity, 0, Infinity, Infinity);
+ctx.fillRect(Infinity, 0, 100, Infinity);
+ctx.fillRect(0, Infinity, Infinity, 50);
+ctx.fillRect(0, Infinity, Infinity, Infinity);
+ctx.fillRect(0, Infinity, 100, Infinity);
+ctx.fillRect(0, 0, Infinity, Infinity);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillRect.path.html b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.path.html
new file mode 100644
index 0000000..c1aaa95
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.path.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillRect.path</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillRect.basic.html" title="2d.fillRect.basic">
+<link rel="next" href="2d.fillRect.zero.html" title="2d.fillRect.zero">
+<body class="show_output">
+<p>
+ <a href="2d.fillRect.basic.html" accesskey="p" title="[p] 2d.fillRect.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillRect.zero.html" accesskey="n" title="[n] 2d.fillRect.zero">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillRect.html">fillRect</a>.path</h1>
+<p class="desc">fillRect does not affect the current path</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.fillRect">2d.fillRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.beginPath();
+ctx.rect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 16, 16);
+ctx.fillStyle = '#0f0';
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillRect.shadow.html b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.shadow.html
new file mode 100644
index 0000000..e821edf
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.shadow.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillRect.shadow</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillRect.clip.html" title="2d.fillRect.clip">
+<link rel="next" href="2d.fillRect.nonfinite.html" title="2d.fillRect.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.fillRect.clip.html" accesskey="p" title="[p] 2d.fillRect.clip"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillRect.nonfinite.html" accesskey="n" title="[n] 2d.fillRect.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillRect.html">fillRect</a>.shadow</h1>
+<p class="desc">fillRect draws shadows</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.fillRect">2d.fillRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowColor = '#0f0';
+ctx.shadowBlur = 0;
+ctx.shadowOffsetX = 0;
+ctx.shadowOffsetY = 50;
+ctx.fillRect(0, -50, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillRect.transform.html b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.transform.html
new file mode 100644
index 0000000..c62740c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.transform.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillRect.transform</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillRect.negative.html" title="2d.fillRect.negative">
+<link rel="next" href="2d.fillRect.clip.html" title="2d.fillRect.clip">
+<body class="show_output">
+<p>
+ <a href="2d.fillRect.negative.html" accesskey="p" title="[p] 2d.fillRect.negative"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillRect.clip.html" accesskey="n" title="[n] 2d.fillRect.clip">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillRect.html">fillRect</a>.transform</h1>
+<p class="desc">fillRect is affected by transforms</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.fillRect">2d.fillRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.scale(10, 10);
+ctx.translate(0, 5);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, -5, 10, 5);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillRect.zero.html b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.zero.html
new file mode 100644
index 0000000..354e1f7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillRect.zero.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillRect.zero</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillRect.path.html" title="2d.fillRect.path">
+<link rel="next" href="2d.fillRect.negative.html" title="2d.fillRect.negative">
+<body class="show_output">
+<p>
+ <a href="2d.fillRect.path.html" accesskey="p" title="[p] 2d.fillRect.path"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillRect.negative.html" accesskey="n" title="[n] 2d.fillRect.negative">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillRect.html">fillRect</a>.zero</h1>
+<p class="desc">fillRect of zero pixels has no effect</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.fillRect">2d.fillRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 0);
+ctx.fillRect(0, 0, 0, 50);
+ctx.fillRect(0, 0, 0, 0);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.default.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.default.html
new file mode 100644
index 0000000..217269b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.default.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.default</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.get.transparent.html" title="2d.fillStyle.get.transparent">
+<link rel="next" href="2d.strokeStyle.default.html" title="2d.strokeStyle.default">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.get.transparent.html" accesskey="p" title="[p] 2d.fillStyle.get.transparent"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.strokeStyle.default.html" accesskey="n" title="[n] 2d.strokeStyle.default">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.default</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.default">2d.colours.default</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertEqual(ctx.fillStyle, '#000000', "ctx.fillStyle", "'#000000'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.get.semitransparent.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.get.semitransparent.html
new file mode 100644
index 0000000..3a40516
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.get.semitransparent.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.get.semitransparent</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.get.solid.html" title="2d.fillStyle.get.solid">
+<link rel="next" href="2d.fillStyle.get.transparent.html" title="2d.fillStyle.get.transparent">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.get.solid.html" accesskey="p" title="[p] 2d.fillStyle.get.solid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.get.transparent.html" accesskey="n" title="[n] 2d.fillStyle.get.transparent">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.get.html">get</a>.semitransparent</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.getcolour">2d.colours.getcolour</a>
+<li><a href="spec.html#testrefs.2d.serializecolour.transparent">2d.serializecolour.transparent</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = 'rgba(255,255,255,0.45)';
+_assertMatch(ctx.fillStyle, /^rgba\(255, 255, 255, 0\.4\d+\)$/, "ctx.fillStyle", "/^rgba\\(255, 255, 255, 0\\.4\\d+\\)$/");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.get.solid.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.get.solid.html
new file mode 100644
index 0000000..ce28268
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.get.solid.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.get.solid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.invalidtype.html" title="2d.fillStyle.invalidtype">
+<link rel="next" href="2d.fillStyle.get.semitransparent.html" title="2d.fillStyle.get.semitransparent">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.invalidtype.html" accesskey="p" title="[p] 2d.fillStyle.invalidtype"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.get.semitransparent.html" accesskey="n" title="[n] 2d.fillStyle.get.semitransparent">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.get.html">get</a>.solid</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.getcolour">2d.colours.getcolour</a>
+<li><a href="spec.html#testrefs.2d.serializecolour.solid">2d.serializecolour.solid</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#fa0';
+_assertSame(ctx.fillStyle, '#ffaa00', "ctx.fillStyle", "'#ffaa00'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.get.transparent.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.get.transparent.html
new file mode 100644
index 0000000..07dc361
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.get.transparent.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.get.transparent</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.get.semitransparent.html" title="2d.fillStyle.get.semitransparent">
+<link rel="next" href="2d.fillStyle.default.html" title="2d.fillStyle.default">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.get.semitransparent.html" accesskey="p" title="[p] 2d.fillStyle.get.semitransparent"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.default.html" accesskey="n" title="[n] 2d.fillStyle.default">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.get.html">get</a>.transparent</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.getcolour">2d.colours.getcolour</a>
+<li><a href="spec.html#testrefs.2d.serializecolour.transparent">2d.serializecolour.transparent</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = 'rgba(0,0,0,0)';
+_assertEqual(ctx.fillStyle, 'rgba(0, 0, 0, 0.0)', "ctx.fillStyle", "'rgba(0, 0, 0, 0.0)'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.invalidstring.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.invalidstring.html
new file mode 100644
index 0000000..4f11ee2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.invalidstring.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.invalidstring</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.current.removed.html" title="2d.fillStyle.parse.current.removed">
+<link rel="next" href="2d.fillStyle.invalidtype.html" title="2d.fillStyle.invalidtype">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.current.removed.html" accesskey="p" title="[p] 2d.fillStyle.parse.current.removed"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.invalidtype.html" accesskey="n" title="[n] 2d.fillStyle.invalidtype">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.invalidstring</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.invalidstring">2d.colours.invalidstring</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.fillStyle = 'invalid';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.invalidtype.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.invalidtype.html
new file mode 100644
index 0000000..9abed38
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.invalidtype.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.invalidtype</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.invalidstring.html" title="2d.fillStyle.invalidstring">
+<link rel="next" href="2d.fillStyle.get.solid.html" title="2d.fillStyle.get.solid">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.invalidstring.html" accesskey="p" title="[p] 2d.fillStyle.invalidstring"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.get.solid.html" accesskey="n" title="[n] 2d.fillStyle.get.solid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.invalidtype</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.invalidtype">2d.colours.invalidtype</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.fillStyle = null;
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.current.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.current.basic.html
new file mode 100644
index 0000000..0aa408f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.current.basic.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.current.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.system.html" title="2d.fillStyle.parse.system">
+<link rel="next" href="2d.fillStyle.parse.current.changed.html" title="2d.fillStyle.parse.current.changed">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.system.html" accesskey="p" title="[p] 2d.fillStyle.parse.system"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.current.changed.html" accesskey="n" title="[n] 2d.fillStyle.parse.current.changed">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.current.html">current</a>.basic</h1>
+<p class="desc">currentColor is computed from the canvas element</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+<li><a href="spec.html#testrefs.2d.currentColor.onset">2d.currentColor.onset</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('style', 'color: #0f0');
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'currentColor';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.current.changed.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.current.changed.html
new file mode 100644
index 0000000..77627a5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.current.changed.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.current.changed</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.current.basic.html" title="2d.fillStyle.parse.current.basic">
+<link rel="next" href="2d.fillStyle.parse.current.removed.html" title="2d.fillStyle.parse.current.removed">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.current.basic.html" accesskey="p" title="[p] 2d.fillStyle.parse.current.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.current.removed.html" accesskey="n" title="[n] 2d.fillStyle.parse.current.removed">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.current.html">current</a>.changed</h1>
+<p class="desc">currentColor is computed when the attribute is set, not when it is painted</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+<li><a href="spec.html#testrefs.2d.currentColor.onset">2d.currentColor.onset</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('style', 'color: #0f0');
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'currentColor';
+canvas.setAttribute('style', 'color: #f00');
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.current.removed.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.current.removed.html
new file mode 100644
index 0000000..60ea130
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.current.removed.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.current.removed</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.current.changed.html" title="2d.fillStyle.parse.current.changed">
+<link rel="next" href="2d.fillStyle.invalidstring.html" title="2d.fillStyle.invalidstring">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.current.changed.html" accesskey="p" title="[p] 2d.fillStyle.parse.current.changed"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.invalidstring.html" accesskey="n" title="[n] 2d.fillStyle.invalidstring">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.current.html">current</a>.removed</h1>
+<p class="desc">currentColor is solid black when the canvas element is not in a document</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+<li><a href="spec.html#testrefs.2d.currentColor.outofdoc">2d.currentColor.outofdoc</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.current.removed.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Try not to let it undetectably incorrectly pick up opaque-black
+// from other parts of the document:
+document.body.parentNode.setAttribute('style', 'color: #f00');
+document.body.setAttribute('style', 'color: #f00');
+canvas.setAttribute('style', 'color: #f00');
+
+var canvas2 = document.createElement('canvas');
+var ctx2 = canvas2.getContext('2d');
+ctx2.fillStyle = '#f00';
+ctx2.fillStyle = 'currentColor';
+ctx2.fillRect(0, 0, 100, 50);
+ctx.drawImage(canvas2, 0, 0);
+
+document.body.parentNode.removeAttribute('style');
+document.body.removeAttribute('style');
+
+_assertPixel(canvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.current.removed.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.current.removed.png
new file mode 100644
index 0000000..13a5157
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.current.removed.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hex3.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hex3.html
new file mode 100644
index 0000000..1c58d10
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hex3.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hex3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.html4.html" title="2d.fillStyle.parse.html4">
+<link rel="next" href="2d.fillStyle.parse.hex6.html" title="2d.fillStyle.parse.hex6">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.html4.html" accesskey="p" title="[p] 2d.fillStyle.parse.html4"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hex6.html" accesskey="n" title="[n] 2d.fillStyle.parse.hex6">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hex3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hex3.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hex3.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hex3.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hex3.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hex6.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hex6.html
new file mode 100644
index 0000000..c39e55e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hex6.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hex6</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hex3.html" title="2d.fillStyle.parse.hex3">
+<link rel="next" href="2d.fillStyle.parse.rgb-num.html" title="2d.fillStyle.parse.rgb-num">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hex3.html" accesskey="p" title="[p] 2d.fillStyle.parse.hex3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.rgb-num.html" accesskey="n" title="[n] 2d.fillStyle.parse.rgb-num">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hex6</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hex6.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = '#00fF00';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hex6.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hex6.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hex6.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-1.html
new file mode 100644
index 0000000..9538d56
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsl-1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.transparent-2.html" title="2d.fillStyle.parse.transparent-2">
+<link rel="next" href="2d.fillStyle.parse.hsl-2.html" title="2d.fillStyle.parse.hsl-2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.transparent-2.html" accesskey="p" title="[p] 2d.fillStyle.parse.transparent-2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsl-2.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsl-2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsl-1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-1.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsl(120, 100%, 50%)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-1.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-1.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-1.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-2.html
new file mode 100644
index 0000000..84fc528
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsl-2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsl-1.html" title="2d.fillStyle.parse.hsl-1">
+<link rel="next" href="2d.fillStyle.parse.hsl-3.html" title="2d.fillStyle.parse.hsl-3">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsl-1.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsl-1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsl-3.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsl-3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsl-2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-2.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsl( -240 , 100% , 50% )';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-2.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-2.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-2.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-3.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-3.html
new file mode 100644
index 0000000..601f2e6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-3.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsl-3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsl-2.html" title="2d.fillStyle.parse.hsl-2">
+<link rel="next" href="2d.fillStyle.parse.hsl-4.html" title="2d.fillStyle.parse.hsl-4">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsl-2.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsl-2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsl-4.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsl-4">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsl-3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-3.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsl(360120, 100%, 50%)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-3.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-3.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-3.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-4.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-4.html
new file mode 100644
index 0000000..d3041ef
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-4.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsl-4</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsl-3.html" title="2d.fillStyle.parse.hsl-3">
+<link rel="next" href="2d.fillStyle.parse.hsl-5.html" title="2d.fillStyle.parse.hsl-5">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsl-3.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsl-3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsl-5.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsl-5">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsl-4</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-4.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsl(-360240, 100%, 50%)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-4.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-4.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-4.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-5.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-5.html
new file mode 100644
index 0000000..b6018a9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-5.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsl-5</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsl-4.html" title="2d.fillStyle.parse.hsl-4">
+<link rel="next" href="2d.fillStyle.parse.hsl-clamp-1.html" title="2d.fillStyle.parse.hsl-clamp-1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsl-4.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsl-4"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsl-clamp-1.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsl-clamp-1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsl-5</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-5.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsl(120.0, 100.0%, 50.0%)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-5.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-5.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-5.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-1.html
new file mode 100644
index 0000000..e014b34
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsl-clamp-1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsl-5.html" title="2d.fillStyle.parse.hsl-5">
+<link rel="next" href="2d.fillStyle.parse.hsl-clamp-2.html" title="2d.fillStyle.parse.hsl-clamp-2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsl-5.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsl-5"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsl-clamp-2.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsl-clamp-2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsl-clamp-1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-clamp-1.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsl(120, 200%, 50%)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-1.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-1.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-1.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-2.html
new file mode 100644
index 0000000..375e229
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsl-clamp-2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsl-clamp-1.html" title="2d.fillStyle.parse.hsl-clamp-1">
+<link rel="next" href="2d.fillStyle.parse.hsl-clamp-3.html" title="2d.fillStyle.parse.hsl-clamp-3">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsl-clamp-1.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsl-clamp-1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsl-clamp-3.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsl-clamp-3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsl-clamp-2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-clamp-2.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsl(120, -200%, 49.9%)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-2.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-2.png
new file mode 100644
index 0000000..acf6171
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-2.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-3.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-3.html
new file mode 100644
index 0000000..ebbf4e7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-3.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsl-clamp-3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsl-clamp-2.html" title="2d.fillStyle.parse.hsl-clamp-2">
+<link rel="next" href="2d.fillStyle.parse.hsl-clamp-4.html" title="2d.fillStyle.parse.hsl-clamp-4">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsl-clamp-2.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsl-clamp-2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsl-clamp-4.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsl-clamp-4">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsl-clamp-3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-clamp-3.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsl(120, 100%, 200%)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 255,255,255,255, "50,25", "255,255,255,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-3.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-3.png
new file mode 100644
index 0000000..f69a743
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-3.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-4.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-4.html
new file mode 100644
index 0000000..36e85d3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-4.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsl-clamp-4</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsl-clamp-3.html" title="2d.fillStyle.parse.hsl-clamp-3">
+<link rel="next" href="2d.fillStyle.parse.hsla-1.html" title="2d.fillStyle.parse.hsla-1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsl-clamp-3.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsl-clamp-3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsla-1.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsla-1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsl-clamp-4</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsl-clamp-4.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsl(120, 100%, -200%)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-4.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-4.png
new file mode 100644
index 0000000..13a5157
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsl-clamp-4.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-1.html
new file mode 100644
index 0000000..86525b1
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsla-1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsl-clamp-4.html" title="2d.fillStyle.parse.hsl-clamp-4">
+<link rel="next" href="2d.fillStyle.parse.hsla-2.html" title="2d.fillStyle.parse.hsla-2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsl-clamp-4.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsl-clamp-4"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsla-2.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsla-2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsla-1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-1.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsla(120, 100%, 50%, 0.499)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-1.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-1.png
new file mode 100644
index 0000000..2aa6265
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-1.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-2.html
new file mode 100644
index 0000000..8821544
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsla-2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsla-1.html" title="2d.fillStyle.parse.hsla-1">
+<link rel="next" href="2d.fillStyle.parse.hsla-clamp-1.html" title="2d.fillStyle.parse.hsla-clamp-1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsla-1.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsla-1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsla-clamp-1.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsla-clamp-1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsla-2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-2.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsla( 120.0 , 100.0% , 50.0% , 1 )';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-2.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-2.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-2.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-1.html
new file mode 100644
index 0000000..00d632b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsla-clamp-1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsla-2.html" title="2d.fillStyle.parse.hsla-2">
+<link rel="next" href="2d.fillStyle.parse.hsla-clamp-2.html" title="2d.fillStyle.parse.hsla-clamp-2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsla-2.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsla-2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsla-clamp-2.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsla-clamp-2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsla-clamp-1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-clamp-1.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsla(120, 200%, 50%, 1)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-1.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-1.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-1.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-2.html
new file mode 100644
index 0000000..49b66c6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsla-clamp-2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsla-clamp-1.html" title="2d.fillStyle.parse.hsla-clamp-1">
+<link rel="next" href="2d.fillStyle.parse.hsla-clamp-3.html" title="2d.fillStyle.parse.hsla-clamp-3">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsla-clamp-1.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsla-clamp-1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsla-clamp-3.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsla-clamp-3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsla-clamp-2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-clamp-2.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsla(120, -200%, 49.9%, 1)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-2.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-2.png
new file mode 100644
index 0000000..acf6171
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-2.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-3.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-3.html
new file mode 100644
index 0000000..1950d77
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-3.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsla-clamp-3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsla-clamp-2.html" title="2d.fillStyle.parse.hsla-clamp-2">
+<link rel="next" href="2d.fillStyle.parse.hsla-clamp-4.html" title="2d.fillStyle.parse.hsla-clamp-4">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsla-clamp-2.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsla-clamp-2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsla-clamp-4.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsla-clamp-4">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsla-clamp-3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-clamp-3.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsla(120, 100%, 200%, 1)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 255,255,255,255, "50,25", "255,255,255,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-3.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-3.png
new file mode 100644
index 0000000..f69a743
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-3.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-4.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-4.html
new file mode 100644
index 0000000..a24d779
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-4.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsla-clamp-4</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsla-clamp-3.html" title="2d.fillStyle.parse.hsla-clamp-3">
+<link rel="next" href="2d.fillStyle.parse.hsla-clamp-5.html" title="2d.fillStyle.parse.hsla-clamp-5">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsla-clamp-3.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsla-clamp-3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsla-clamp-5.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsla-clamp-5">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsla-clamp-4</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-clamp-4.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsla(120, 100%, -200%, 1)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,0,0,255, "50,25", "0,0,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-4.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-4.png
new file mode 100644
index 0000000..13a5157
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-4.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-5.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-5.html
new file mode 100644
index 0000000..0117088
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-5.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsla-clamp-5</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsla-clamp-4.html" title="2d.fillStyle.parse.hsla-clamp-4">
+<link rel="next" href="2d.fillStyle.parse.hsla-clamp-6.html" title="2d.fillStyle.parse.hsla-clamp-6">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsla-clamp-4.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsla-clamp-4"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsla-clamp-6.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsla-clamp-6">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsla-clamp-5</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-clamp-5.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsla(120, 100%, 50%, 2)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-5.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-5.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-5.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-6.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-6.html
new file mode 100644
index 0000000..0524561
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-6.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.hsla-clamp-6</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsla-clamp-5.html" title="2d.fillStyle.parse.hsla-clamp-5">
+<link rel="next" href="2d.fillStyle.parse.svg-1.html" title="2d.fillStyle.parse.svg-1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsla-clamp-5.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsla-clamp-5"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.svg-1.html" accesskey="n" title="[n] 2d.fillStyle.parse.svg-1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.hsla-clamp-6</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.hsla-clamp-6.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'hsla(120, 100%, 0%, -2)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-6.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-6.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.hsla-clamp-6.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.html4.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.html4.html
new file mode 100644
index 0000000..1ec1eb0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.html4.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.html4</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.composite.operation.default.html" title="2d.composite.operation.default">
+<link rel="next" href="2d.fillStyle.parse.hex3.html" title="2d.fillStyle.parse.hex3">
+<body class="show_output">
+<p>
+ <a href="2d.composite.operation.default.html" accesskey="p" title="[p] 2d.composite.operation.default"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hex3.html" accesskey="n" title="[n] 2d.fillStyle.parse.hex3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.html4</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.html4.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'limE';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.html4.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.html4.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.html4.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex1.html
new file mode 100644
index 0000000..714ba63
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.hex1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.svg-2.html" title="2d.fillStyle.parse.svg-2">
+<link rel="next" href="2d.fillStyle.parse.invalid.hex2.html" title="2d.fillStyle.parse.invalid.hex2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.svg-2.html" accesskey="p" title="[p] 2d.fillStyle.parse.svg-2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.hex2.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.hex2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.hex1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = '#f'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex2.html
new file mode 100644
index 0000000..f764870
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.hex2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.hex1.html" title="2d.fillStyle.parse.invalid.hex1">
+<link rel="next" href="2d.fillStyle.parse.invalid.hex3.html" title="2d.fillStyle.parse.invalid.hex3">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.hex1.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.hex1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.hex3.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.hex3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.hex2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = '#f0'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex3.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex3.html
new file mode 100644
index 0000000..3bd07e7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex3.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.hex3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.hex2.html" title="2d.fillStyle.parse.invalid.hex2">
+<link rel="next" href="2d.fillStyle.parse.invalid.hex4.html" title="2d.fillStyle.parse.invalid.hex4">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.hex2.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.hex2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.hex4.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.hex4">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.hex3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = '#g00'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4.html
new file mode 100644
index 0000000..d38e5b2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex4.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.hex4</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.hex3.html" title="2d.fillStyle.parse.invalid.hex3">
+<link rel="next" href="2d.fillStyle.parse.invalid.hex5.html" title="2d.fillStyle.parse.invalid.hex5">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.hex3.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.hex3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.hex5.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.hex5">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.hex4</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = '#ff00'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex5.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex5.html
new file mode 100644
index 0000000..3243443
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex5.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.hex5</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.hex4.html" title="2d.fillStyle.parse.invalid.hex4">
+<link rel="next" href="2d.fillStyle.parse.invalid.hex6.html" title="2d.fillStyle.parse.invalid.hex6">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.hex4.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.hex4"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.hex6.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.hex6">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.hex5</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = '#ff000'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex6.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex6.html
new file mode 100644
index 0000000..3865b36
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex6.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.hex6</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.hex5.html" title="2d.fillStyle.parse.invalid.hex5">
+<link rel="next" href="2d.fillStyle.parse.invalid.hex7.html" title="2d.fillStyle.parse.invalid.hex7">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.hex5.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.hex5"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.hex7.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.hex7">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.hex6</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = '#fg0000'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex7.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex7.html
new file mode 100644
index 0000000..0b0aecd
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex7.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.hex7</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.hex6.html" title="2d.fillStyle.parse.invalid.hex6">
+<link rel="next" href="2d.fillStyle.parse.invalid.hex8.html" title="2d.fillStyle.parse.invalid.hex8">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.hex6.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.hex6"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.hex8.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.hex8">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.hex7</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = '#ff0000f'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8.html
new file mode 100644
index 0000000..25f1ee5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hex8.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.hex8</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.hex7.html" title="2d.fillStyle.parse.invalid.hex7">
+<link rel="next" href="2d.fillStyle.parse.invalid.rgb-1.html" title="2d.fillStyle.parse.invalid.rgb-1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.hex7.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.hex7"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.rgb-1.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.rgb-1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.hex8</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = '#ff0000ff'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-1.html
new file mode 100644
index 0000000..7eeee34
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.hsl-1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.rgba-5.html" title="2d.fillStyle.parse.invalid.rgba-5">
+<link rel="next" href="2d.fillStyle.parse.invalid.hsl-2.html" title="2d.fillStyle.parse.invalid.hsl-2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.rgba-5.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.rgba-5"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.hsl-2.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.hsl-2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.hsl-1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'hsl(0%, 100%, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-2.html
new file mode 100644
index 0000000..cec5424
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.hsl-2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.hsl-1.html" title="2d.fillStyle.parse.invalid.hsl-1">
+<link rel="next" href="2d.fillStyle.parse.invalid.hsl-3.html" title="2d.fillStyle.parse.invalid.hsl-3">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.hsl-1.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.hsl-1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.hsl-3.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.hsl-3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.hsl-2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'hsl(z, 100%, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-3.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-3.html
new file mode 100644
index 0000000..fde28ea
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-3.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.hsl-3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.hsl-2.html" title="2d.fillStyle.parse.invalid.hsl-2">
+<link rel="next" href="2d.fillStyle.parse.invalid.hsl-4.html" title="2d.fillStyle.parse.invalid.hsl-4">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.hsl-2.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.hsl-2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.hsl-4.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.hsl-4">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.hsl-3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'hsl(0, 0, 50%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-4.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-4.html
new file mode 100644
index 0000000..a4866c4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-4.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.hsl-4</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.hsl-3.html" title="2d.fillStyle.parse.invalid.hsl-3">
+<link rel="next" href="2d.fillStyle.parse.invalid.hsl-5.html" title="2d.fillStyle.parse.invalid.hsl-5">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.hsl-3.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.hsl-3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.hsl-5.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.hsl-5">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.hsl-4</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'hsl(0, 100%, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-5.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-5.html
new file mode 100644
index 0000000..d97a6e1
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsl-5.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.hsl-5</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.hsl-4.html" title="2d.fillStyle.parse.invalid.hsl-4">
+<link rel="next" href="2d.fillStyle.parse.invalid.hsla-1.html" title="2d.fillStyle.parse.invalid.hsla-1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.hsl-4.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.hsl-4"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.hsla-1.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.hsla-1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.hsl-5</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'hsl(0, 100%, 100%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsla-1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsla-1.html
new file mode 100644
index 0000000..a41dc17
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsla-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.hsla-1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.hsl-5.html" title="2d.fillStyle.parse.invalid.hsl-5">
+<link rel="next" href="2d.fillStyle.parse.invalid.hsla-2.html" title="2d.fillStyle.parse.invalid.hsla-2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.hsl-5.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.hsl-5"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.hsla-2.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.hsla-2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.hsla-1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'hsla(0%, 100%, 50%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsla-2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsla-2.html
new file mode 100644
index 0000000..9e73fb3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.hsla-2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.hsla-2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.hsla-1.html" title="2d.fillStyle.parse.invalid.hsla-1">
+<link rel="next" href="2d.fillStyle.parse.invalid.name-1.html" title="2d.fillStyle.parse.invalid.name-1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.hsla-1.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.hsla-1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.name-1.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.name-1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.hsla-2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'hsla(0, 0, 50%, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.name-1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.name-1.html
new file mode 100644
index 0000000..ba98cc6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.name-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.name-1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.hsla-2.html" title="2d.fillStyle.parse.invalid.hsla-2">
+<link rel="next" href="2d.fillStyle.parse.invalid.name-2.html" title="2d.fillStyle.parse.invalid.name-2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.hsla-2.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.hsla-2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.name-2.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.name-2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.name-1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'darkbrown'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.name-2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.name-2.html
new file mode 100644
index 0000000..d98d7cd
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.name-2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.name-2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.name-1.html" title="2d.fillStyle.parse.invalid.name-1">
+<link rel="next" href="2d.fillStyle.parse.invalid.name-3.html" title="2d.fillStyle.parse.invalid.name-3">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.name-1.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.name-1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.name-3.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.name-3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.name-2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'firebrick1'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.name-3.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.name-3.html
new file mode 100644
index 0000000..0cc147e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.name-3.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.name-3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.name-2.html" title="2d.fillStyle.parse.invalid.name-2">
+<link rel="next" href="2d.fillStyle.parse.system.html" title="2d.fillStyle.parse.system">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.name-2.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.name-2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.system.html" accesskey="n" title="[n] 2d.fillStyle.parse.system">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.name-3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'red blue'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-1.html
new file mode 100644
index 0000000..364c389
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.rgb-1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.hex8.html" title="2d.fillStyle.parse.invalid.hex8">
+<link rel="next" href="2d.fillStyle.parse.invalid.rgb-2.html" title="2d.fillStyle.parse.invalid.rgb-2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.hex8.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.hex8"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.rgb-2.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.rgb-2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.rgb-1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'rgb(255.0, 0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-2.html
new file mode 100644
index 0000000..0e4dd37
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.rgb-2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.rgb-1.html" title="2d.fillStyle.parse.invalid.rgb-1">
+<link rel="next" href="2d.fillStyle.parse.invalid.rgb-3.html" title="2d.fillStyle.parse.invalid.rgb-3">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.rgb-1.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.rgb-1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.rgb-3.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.rgb-3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.rgb-2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'rgb(255, 0.0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-3.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-3.html
new file mode 100644
index 0000000..de5c8d3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-3.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.rgb-3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.rgb-2.html" title="2d.fillStyle.parse.invalid.rgb-2">
+<link rel="next" href="2d.fillStyle.parse.invalid.rgb-4.html" title="2d.fillStyle.parse.invalid.rgb-4">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.rgb-2.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.rgb-2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.rgb-4.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.rgb-4">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.rgb-3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'rgb(255.0, 0, 0,)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-4.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-4.html
new file mode 100644
index 0000000..45b63d8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-4.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.rgb-4</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.rgb-3.html" title="2d.fillStyle.parse.invalid.rgb-3">
+<link rel="next" href="2d.fillStyle.parse.invalid.rgb-5.html" title="2d.fillStyle.parse.invalid.rgb-5">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.rgb-3.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.rgb-3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.rgb-5.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.rgb-5">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.rgb-4</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'rgb(100%, 0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-5.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-5.html
new file mode 100644
index 0000000..9d16706
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-5.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.rgb-5</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.rgb-4.html" title="2d.fillStyle.parse.invalid.rgb-4">
+<link rel="next" href="2d.fillStyle.parse.invalid.rgb-6.html" title="2d.fillStyle.parse.invalid.rgb-6">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.rgb-4.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.rgb-4"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.rgb-6.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.rgb-6">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.rgb-5</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'rgb(255 0 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-6.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-6.html
new file mode 100644
index 0000000..19334be
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-6.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.rgb-6</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.rgb-5.html" title="2d.fillStyle.parse.invalid.rgb-5">
+<link rel="next" href="2d.fillStyle.parse.invalid.rgb-7.html" title="2d.fillStyle.parse.invalid.rgb-7">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.rgb-5.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.rgb-5"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.rgb-7.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.rgb-7">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.rgb-6</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'rgb(255, - 1, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-7.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-7.html
new file mode 100644
index 0000000..329b0ab
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgb-7.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.rgb-7</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.rgb-6.html" title="2d.fillStyle.parse.invalid.rgb-6">
+<link rel="next" href="2d.fillStyle.parse.invalid.rgba-1.html" title="2d.fillStyle.parse.invalid.rgba-1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.rgb-6.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.rgb-6"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.rgba-1.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.rgba-1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.rgb-7</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'rgb(255, 0, 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-1.html
new file mode 100644
index 0000000..9cdb764
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.rgba-1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.rgb-7.html" title="2d.fillStyle.parse.invalid.rgb-7">
+<link rel="next" href="2d.fillStyle.parse.invalid.rgba-2.html" title="2d.fillStyle.parse.invalid.rgba-2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.rgb-7.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.rgb-7"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.rgba-2.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.rgba-2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.rgba-1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'rgba(255, 0, 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-2.html
new file mode 100644
index 0000000..3ca0a23
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.rgba-2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.rgba-1.html" title="2d.fillStyle.parse.invalid.rgba-1">
+<link rel="next" href="2d.fillStyle.parse.invalid.rgba-3.html" title="2d.fillStyle.parse.invalid.rgba-3">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.rgba-1.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.rgba-1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.rgba-3.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.rgba-3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.rgba-2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'rgba(255.0, 0, 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-3.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-3.html
new file mode 100644
index 0000000..7ace215
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-3.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.rgba-3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.rgba-2.html" title="2d.fillStyle.parse.invalid.rgba-2">
+<link rel="next" href="2d.fillStyle.parse.invalid.rgba-4.html" title="2d.fillStyle.parse.invalid.rgba-4">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.rgba-2.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.rgba-2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.rgba-4.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.rgba-4">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.rgba-3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'rgba(100%, 0, 0, 1)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-4.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-4.html
new file mode 100644
index 0000000..373d198
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-4.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.rgba-4</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.rgba-3.html" title="2d.fillStyle.parse.invalid.rgba-3">
+<link rel="next" href="2d.fillStyle.parse.invalid.rgba-5.html" title="2d.fillStyle.parse.invalid.rgba-5">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.rgba-3.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.rgba-3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.rgba-5.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.rgba-5">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.rgba-4</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'rgba(255, 0, 0, 100%)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-5.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-5.html
new file mode 100644
index 0000000..4e3faa9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.invalid.rgba-5.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.invalid.rgba-5</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.rgba-4.html" title="2d.fillStyle.parse.invalid.rgba-4">
+<link rel="next" href="2d.fillStyle.parse.invalid.hsl-1.html" title="2d.fillStyle.parse.invalid.hsl-1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.rgba-4.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.rgba-4"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.hsl-1.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.hsl-1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.<a href="index.2d.fillStyle.parse.invalid.html">invalid</a>.rgba-5</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#0f0';
+try { ctx.fillStyle = 'rgba(255, 0, 0, 1. 0)'; } catch (e) { } // this shouldn't throw, but it shouldn't matter here if it does
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-1.html
new file mode 100644
index 0000000..0270b87
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.rgb-clamp-1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.rgb-num.html" title="2d.fillStyle.parse.rgb-num">
+<link rel="next" href="2d.fillStyle.parse.rgb-clamp-2.html" title="2d.fillStyle.parse.rgb-clamp-2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.rgb-num.html" accesskey="p" title="[p] 2d.fillStyle.parse.rgb-num"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.rgb-clamp-2.html" accesskey="n" title="[n] 2d.fillStyle.parse.rgb-clamp-2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.rgb-clamp-1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">Assumes colours are clamped to [0,255].
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgb-clamp-1.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'rgb(-1000, 1000, -1000)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-1.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-1.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-1.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-2.html
new file mode 100644
index 0000000..079f170
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.rgb-clamp-2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.rgb-clamp-1.html" title="2d.fillStyle.parse.rgb-clamp-1">
+<link rel="next" href="2d.fillStyle.parse.rgb-clamp-3.html" title="2d.fillStyle.parse.rgb-clamp-3">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.rgb-clamp-1.html" accesskey="p" title="[p] 2d.fillStyle.parse.rgb-clamp-1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.rgb-clamp-3.html" accesskey="n" title="[n] 2d.fillStyle.parse.rgb-clamp-3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.rgb-clamp-2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">Assumes colours are clamped to [0,255].
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgb-clamp-2.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'rgb(-200%, 200%, -200%)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-2.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-2.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-2.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-3.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-3.html
new file mode 100644
index 0000000..5e33bd8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-3.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.rgb-clamp-3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.rgb-clamp-2.html" title="2d.fillStyle.parse.rgb-clamp-2">
+<link rel="next" href="2d.fillStyle.parse.rgb-clamp-4.html" title="2d.fillStyle.parse.rgb-clamp-4">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.rgb-clamp-2.html" accesskey="p" title="[p] 2d.fillStyle.parse.rgb-clamp-2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.rgb-clamp-4.html" accesskey="n" title="[n] 2d.fillStyle.parse.rgb-clamp-4">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.rgb-clamp-3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">Assumes colours are clamped to [0,255].
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgb-clamp-3.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'rgb(-2147483649, 4294967298, -18446744073709551619)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-3.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-3.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-3.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-4.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-4.html
new file mode 100644
index 0000000..ff45136
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-4.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.rgb-clamp-4</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.rgb-clamp-3.html" title="2d.fillStyle.parse.rgb-clamp-3">
+<link rel="next" href="2d.fillStyle.parse.rgb-clamp-5.html" title="2d.fillStyle.parse.rgb-clamp-5">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.rgb-clamp-3.html" accesskey="p" title="[p] 2d.fillStyle.parse.rgb-clamp-3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.rgb-clamp-5.html" accesskey="n" title="[n] 2d.fillStyle.parse.rgb-clamp-5">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.rgb-clamp-4</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">Assumes colours are clamped to [0,255].
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgb-clamp-4.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'rgb(-1000000000000000000000000000000000000000, 1000000000000000000000000000000000000000, -1000000000000000000000000000000000000000)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-4.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-4.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-4.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-5.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-5.html
new file mode 100644
index 0000000..b19d53f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-5.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.rgb-clamp-5</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.rgb-clamp-4.html" title="2d.fillStyle.parse.rgb-clamp-4">
+<link rel="next" href="2d.fillStyle.parse.rgb-percent.html" title="2d.fillStyle.parse.rgb-percent">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.rgb-clamp-4.html" accesskey="p" title="[p] 2d.fillStyle.parse.rgb-clamp-4"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.rgb-percent.html" accesskey="n" title="[n] 2d.fillStyle.parse.rgb-percent">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.rgb-clamp-5</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">Assumes colours are clamped to [0,255].
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgb-clamp-5.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'rgb(-10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, -10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-5.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-5.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-clamp-5.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-num.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-num.html
new file mode 100644
index 0000000..d0e1546
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-num.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.rgb-num</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hex6.html" title="2d.fillStyle.parse.hex6">
+<link rel="next" href="2d.fillStyle.parse.rgb-clamp-1.html" title="2d.fillStyle.parse.rgb-clamp-1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hex6.html" accesskey="p" title="[p] 2d.fillStyle.parse.hex6"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.rgb-clamp-1.html" accesskey="n" title="[n] 2d.fillStyle.parse.rgb-clamp-1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.rgb-num</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgb-num.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'rgb(0,255,0)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-num.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-num.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-num.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-percent.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-percent.html
new file mode 100644
index 0000000..f189552
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-percent.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.rgb-percent</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.rgb-clamp-5.html" title="2d.fillStyle.parse.rgb-clamp-5">
+<link rel="next" href="2d.fillStyle.parse.rgba-solid-1.html" title="2d.fillStyle.parse.rgba-solid-1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.rgb-clamp-5.html" accesskey="p" title="[p] 2d.fillStyle.parse.rgb-clamp-5"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.rgba-solid-1.html" accesskey="n" title="[n] 2d.fillStyle.parse.rgba-solid-1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.rgb-percent</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">CSS3 Color says "The integer value 255 corresponds to 100%". (In particular, it is not 254...)
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgb-percent.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'rgb(0% ,100% ,0%)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-percent.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-percent.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgb-percent.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-1.html
new file mode 100644
index 0000000..a8d9d32
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.rgba-clamp-1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.rgba-percent.html" title="2d.fillStyle.parse.rgba-percent">
+<link rel="next" href="2d.fillStyle.parse.rgba-clamp-2.html" title="2d.fillStyle.parse.rgba-clamp-2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.rgba-percent.html" accesskey="p" title="[p] 2d.fillStyle.parse.rgba-percent"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.rgba-clamp-2.html" accesskey="n" title="[n] 2d.fillStyle.parse.rgba-clamp-2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.rgba-clamp-1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-clamp-1.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'rgba(0, 255, 0, -2)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-1.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-1.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-1.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-2.html
new file mode 100644
index 0000000..2fa4e7a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.rgba-clamp-2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.rgba-clamp-1.html" title="2d.fillStyle.parse.rgba-clamp-1">
+<link rel="next" href="2d.fillStyle.parse.transparent-1.html" title="2d.fillStyle.parse.transparent-1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.rgba-clamp-1.html" accesskey="p" title="[p] 2d.fillStyle.parse.rgba-clamp-1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.transparent-1.html" accesskey="n" title="[n] 2d.fillStyle.parse.transparent-1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.rgba-clamp-2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-clamp-2.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'rgba(0, 255, 0, 2)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-2.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-2.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-clamp-2.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-1.html
new file mode 100644
index 0000000..6981daa
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.rgba-num-1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.rgba-solid-2.html" title="2d.fillStyle.parse.rgba-solid-2">
+<link rel="next" href="2d.fillStyle.parse.rgba-num-2.html" title="2d.fillStyle.parse.rgba-num-2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.rgba-solid-2.html" accesskey="p" title="[p] 2d.fillStyle.parse.rgba-solid-2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.rgba-num-2.html" accesskey="n" title="[n] 2d.fillStyle.parse.rgba-num-2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.rgba-num-1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-num-1.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'rgba( 0 , 255 , 0 , .499 )';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-1.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-1.png
new file mode 100644
index 0000000..2aa6265
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-1.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-2.html
new file mode 100644
index 0000000..3d23c7b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.rgba-num-2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.rgba-num-1.html" title="2d.fillStyle.parse.rgba-num-1">
+<link rel="next" href="2d.fillStyle.parse.rgba-percent.html" title="2d.fillStyle.parse.rgba-percent">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.rgba-num-1.html" accesskey="p" title="[p] 2d.fillStyle.parse.rgba-num-1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.rgba-percent.html" accesskey="n" title="[n] 2d.fillStyle.parse.rgba-percent">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.rgba-num-2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-num-2.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'rgba( 0 , 255 , 0 , 0.499 )';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-2.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-2.png
new file mode 100644
index 0000000..2aa6265
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-num-2.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-percent.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-percent.html
new file mode 100644
index 0000000..c1c1f05
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-percent.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.rgba-percent</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.rgba-num-2.html" title="2d.fillStyle.parse.rgba-num-2">
+<link rel="next" href="2d.fillStyle.parse.rgba-clamp-1.html" title="2d.fillStyle.parse.rgba-clamp-1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.rgba-num-2.html" accesskey="p" title="[p] 2d.fillStyle.parse.rgba-num-2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.rgba-clamp-1.html" accesskey="n" title="[n] 2d.fillStyle.parse.rgba-clamp-1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.rgba-percent</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-percent.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'rgba(0%,100%,0%,0.499)';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,127, "50,25", "0,255,0,127");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-percent.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-percent.png
new file mode 100644
index 0000000..2aa6265
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-percent.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-1.html
new file mode 100644
index 0000000..07a9481
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.rgba-solid-1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.rgb-percent.html" title="2d.fillStyle.parse.rgb-percent">
+<link rel="next" href="2d.fillStyle.parse.rgba-solid-2.html" title="2d.fillStyle.parse.rgba-solid-2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.rgb-percent.html" accesskey="p" title="[p] 2d.fillStyle.parse.rgb-percent"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.rgba-solid-2.html" accesskey="n" title="[n] 2d.fillStyle.parse.rgba-solid-2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.rgba-solid-1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-solid-1.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'rgba( 0 , 255 , 0 , 1 )';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-1.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-1.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-1.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-2.html
new file mode 100644
index 0000000..fd05986
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.rgba-solid-2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.rgba-solid-1.html" title="2d.fillStyle.parse.rgba-solid-1">
+<link rel="next" href="2d.fillStyle.parse.rgba-num-1.html" title="2d.fillStyle.parse.rgba-num-1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.rgba-solid-1.html" accesskey="p" title="[p] 2d.fillStyle.parse.rgba-solid-1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.rgba-num-1.html" accesskey="n" title="[n] 2d.fillStyle.parse.rgba-num-1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.rgba-solid-2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.rgba-solid-2.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'rgba( 0 , 255 , 0 , 1.0 )';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-2.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-2.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.rgba-solid-2.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.svg-1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.svg-1.html
new file mode 100644
index 0000000..da22ab1
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.svg-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.svg-1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.hsla-clamp-6.html" title="2d.fillStyle.parse.hsla-clamp-6">
+<link rel="next" href="2d.fillStyle.parse.svg-2.html" title="2d.fillStyle.parse.svg-2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.hsla-clamp-6.html" accesskey="p" title="[p] 2d.fillStyle.parse.hsla-clamp-6"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.svg-2.html" accesskey="n" title="[n] 2d.fillStyle.parse.svg-2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.svg-1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.svg-1.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'gray';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 128,128,128,255, "50,25", "128,128,128,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.svg-1.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.svg-1.png
new file mode 100644
index 0000000..f067f39
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.svg-1.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.svg-2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.svg-2.html
new file mode 100644
index 0000000..2009f4e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.svg-2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.svg-2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.svg-1.html" title="2d.fillStyle.parse.svg-1">
+<link rel="next" href="2d.fillStyle.parse.invalid.hex1.html" title="2d.fillStyle.parse.invalid.hex1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.svg-1.html" accesskey="p" title="[p] 2d.fillStyle.parse.svg-1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.invalid.hex1.html" accesskey="n" title="[n] 2d.fillStyle.parse.invalid.hex1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.svg-2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.svg-2.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'grey';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 128,128,128,255, "50,25", "128,128,128,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.svg-2.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.svg-2.png
new file mode 100644
index 0000000..f067f39
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.svg-2.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.system.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.system.html
new file mode 100644
index 0000000..8146928
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.system.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.system</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.invalid.name-3.html" title="2d.fillStyle.parse.invalid.name-3">
+<link rel="next" href="2d.fillStyle.parse.current.basic.html" title="2d.fillStyle.parse.current.basic">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.invalid.name-3.html" accesskey="p" title="[p] 2d.fillStyle.parse.invalid.name-3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.current.basic.html" accesskey="n" title="[n] 2d.fillStyle.parse.current.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.system</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'ThreeDDarkShadow';
+_assertMatch(ctx.fillStyle, /^#(?!(FF0000|ff0000|f00)$)/, "ctx.fillStyle", "/^#(?!(FF0000|ff0000|f00)$)/"); // test that it's not red
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.transparent-1.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.transparent-1.html
new file mode 100644
index 0000000..ffeb299
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.transparent-1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.transparent-1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.rgba-clamp-2.html" title="2d.fillStyle.parse.rgba-clamp-2">
+<link rel="next" href="2d.fillStyle.parse.transparent-2.html" title="2d.fillStyle.parse.transparent-2">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.rgba-clamp-2.html" accesskey="p" title="[p] 2d.fillStyle.parse.rgba-clamp-2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.transparent-2.html" accesskey="n" title="[n] 2d.fillStyle.parse.transparent-2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.transparent-1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.transparent-1.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'transparent';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.transparent-1.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.transparent-1.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.transparent-1.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.transparent-2.html b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.transparent-2.html
new file mode 100644
index 0000000..fc59a70
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.transparent-2.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.fillStyle.parse.transparent-2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.parse.transparent-1.html" title="2d.fillStyle.parse.transparent-1">
+<link rel="next" href="2d.fillStyle.parse.hsl-1.html" title="2d.fillStyle.parse.hsl-1">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.parse.transparent-1.html" accesskey="p" title="[p] 2d.fillStyle.parse.transparent-1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.fillStyle.parse.hsl-1.html" accesskey="n" title="[n] 2d.fillStyle.parse.hsl-1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.fillStyle.html">fillStyle</a>.<a href="index.2d.fillStyle.parse.html">parse</a>.transparent-2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.parse">2d.colours.parse</a>
+
+</ul>
+</div>
+<p class="notes">
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.fillStyle.parse.transparent-2.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+
+ctx.fillStyle = '#f00';
+ctx.fillStyle = 'TrAnSpArEnT';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.transparent-2.png b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.transparent-2.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.fillStyle.parse.transparent-2.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.getcontext.exists.html b/LayoutTests/fast/canvas/philip/tests/2d.getcontext.exists.html
new file mode 100644
index 0000000..5c5c3a99
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.getcontext.exists.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.getcontext.exists</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="security.reset.html" title="security.reset">
+<link rel="next" href="2d.getcontext.unique.html" title="2d.getcontext.unique">
+<body class="show_output">
+<p>
+ <a href="security.reset.html" accesskey="p" title="[p] security.reset"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.getcontext.unique.html" accesskey="n" title="[n] 2d.getcontext.unique">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.getcontext.html">getcontext</a>.exists</h1>
+<p class="desc">The 2D context is implemented</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.context.2d">context.2d</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertDifferent(canvas.getContext('2d'), null, "canvas.getContext('2d')", "null");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.getcontext.shared.html b/LayoutTests/fast/canvas/philip/tests/2d.getcontext.shared.html
new file mode 100644
index 0000000..e680fef
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.getcontext.shared.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.getcontext.shared</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.getcontext.unique.html" title="2d.getcontext.unique">
+<link rel="next" href="2d.voidreturn.html" title="2d.voidreturn">
+<body class="show_output">
+<p>
+ <a href="2d.getcontext.unique.html" accesskey="p" title="[p] 2d.getcontext.unique"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.voidreturn.html" accesskey="n" title="[n] 2d.voidreturn">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.getcontext.html">getcontext</a>.shared</h1>
+<p class="desc">getContext('2d') returns objects which share canvas state</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.context.2d.unique">context.2d.unique</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var ctx2 = canvas.getContext('2d');
+ctx.fillStyle = '#f00';
+ctx2.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.getcontext.unique.html b/LayoutTests/fast/canvas/philip/tests/2d.getcontext.unique.html
new file mode 100644
index 0000000..dd20b7f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.getcontext.unique.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.getcontext.unique</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.getcontext.exists.html" title="2d.getcontext.exists">
+<link rel="next" href="2d.getcontext.shared.html" title="2d.getcontext.shared">
+<body class="show_output">
+<p>
+ <a href="2d.getcontext.exists.html" accesskey="p" title="[p] 2d.getcontext.exists"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.getcontext.shared.html" accesskey="n" title="[n] 2d.getcontext.shared">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.getcontext.html">getcontext</a>.unique</h1>
+<p class="desc">getContext('2d') returns the same object</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.context.2d.unique">context.2d.unique</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.getContext('2d'), canvas.getContext('2d'), "canvas.getContext('2d')", "canvas.getContext('2d')");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.empty.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.empty.html
new file mode 100644
index 0000000..69e21c3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.empty.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.empty</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.interpolate.overlap2.html" title="2d.gradient.interpolate.overlap2">
+<link rel="next" href="2d.gradient.object.update.html" title="2d.gradient.object.update">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.interpolate.overlap2.html" accesskey="p" title="[p] 2d.gradient.interpolate.overlap2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.object.update.html" accesskey="n" title="[n] 2d.gradient.object.update">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.empty</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.empty">2d.gradient.empty</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+var g = ctx.createLinearGradient(0, 0, 0, 50);
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.alpha.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.alpha.html
new file mode 100644
index 0000000..bbb4bca
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.alpha.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.interpolate.alpha</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.interpolate.colour.html" title="2d.gradient.interpolate.colour">
+<link rel="next" href="2d.gradient.interpolate.colouralpha.html" title="2d.gradient.interpolate.colouralpha">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.interpolate.colour.html" accesskey="p" title="[p] 2d.gradient.interpolate.colour"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.interpolate.colouralpha.html" accesskey="n" title="[n] 2d.gradient.interpolate.colouralpha">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.interpolate.html">interpolate</a>.alpha</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.interpolate.linear">2d.gradient.interpolate.linear</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.gradient.interpolate.alpha.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#ff0';
+ctx.fillRect(0, 0, 100, 50);
+var g = ctx.createLinearGradient(0, 0, 100, 0);
+g.addColorStop(0, 'rgba(0,0,255, 0)');
+g.addColorStop(1, 'rgba(0,0,255, 1)');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 25,25, 191,191,63,255, "25,25", "191,191,63,255", 3);
+_assertPixelApprox(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255", 3);
+_assertPixelApprox(canvas, 75,25, 63,63,191,255, "75,25", "63,63,191,255", 3);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.alpha.png b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.alpha.png
new file mode 100644
index 0000000..90c4ec5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.alpha.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.colour.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.colour.html
new file mode 100644
index 0000000..cee93e8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.colour.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.interpolate.colour</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.interpolate.solid.html" title="2d.gradient.interpolate.solid">
+<link rel="next" href="2d.gradient.interpolate.alpha.html" title="2d.gradient.interpolate.alpha">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.interpolate.solid.html" accesskey="p" title="[p] 2d.gradient.interpolate.solid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.interpolate.alpha.html" accesskey="n" title="[n] 2d.gradient.interpolate.alpha">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.interpolate.html">interpolate</a>.colour</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.interpolate.linear">2d.gradient.interpolate.linear</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.gradient.interpolate.colour.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var g = ctx.createLinearGradient(0, 0, 100, 0);
+g.addColorStop(0, '#ff0');
+g.addColorStop(1, '#00f');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 25,25, 191,191,63,255, "25,25", "191,191,63,255", 3);
+_assertPixelApprox(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255", 3);
+_assertPixelApprox(canvas, 75,25, 63,63,191,255, "75,25", "63,63,191,255", 3);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.colour.png b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.colour.png
new file mode 100644
index 0000000..90c4ec5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.colour.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.colouralpha.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.colouralpha.html
new file mode 100644
index 0000000..12228da
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.colouralpha.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.interpolate.colouralpha</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.interpolate.alpha.html" title="2d.gradient.interpolate.alpha">
+<link rel="next" href="2d.gradient.interpolate.outside.html" title="2d.gradient.interpolate.outside">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.interpolate.alpha.html" accesskey="p" title="[p] 2d.gradient.interpolate.alpha"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.interpolate.outside.html" accesskey="n" title="[n] 2d.gradient.interpolate.outside">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.interpolate.html">interpolate</a>.colouralpha</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.interpolate.alpha">2d.gradient.interpolate.alpha</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.gradient.interpolate.colouralpha.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var g = ctx.createLinearGradient(0, 0, 100, 0);
+g.addColorStop(0, 'rgba(255,255,0, 0)');
+g.addColorStop(1, 'rgba(0,0,255, 1)');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 25,25, 191,191,63,63, "25,25", "191,191,63,63", 3);
+_assertPixelApprox(canvas, 50,25, 127,127,127,127, "50,25", "127,127,127,127", 3);
+_assertPixelApprox(canvas, 75,25, 63,63,191,191, "75,25", "63,63,191,191", 3);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.colouralpha.png b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.colouralpha.png
new file mode 100644
index 0000000..dc9f3bc
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.colouralpha.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.multiple.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.multiple.html
new file mode 100644
index 0000000..f1e2162
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.multiple.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.interpolate.multiple</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.interpolate.vertical.html" title="2d.gradient.interpolate.vertical">
+<link rel="next" href="2d.gradient.interpolate.overlap.html" title="2d.gradient.interpolate.overlap">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.interpolate.vertical.html" accesskey="p" title="[p] 2d.gradient.interpolate.vertical"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.interpolate.overlap.html" accesskey="n" title="[n] 2d.gradient.interpolate.overlap">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.interpolate.html">interpolate</a>.multiple</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.interpolate.linear">2d.gradient.interpolate.linear</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.gradient.interpolate.multiple.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = 200;
+var g = ctx.createLinearGradient(0, 0, 200, 0);
+g.addColorStop(0, '#ff0');
+g.addColorStop(0.5, '#0ff');
+g.addColorStop(1, '#f0f');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 200, 50);
+_assertPixelApprox(canvas, 50,25, 127,255,127,255, "50,25", "127,255,127,255", 3);
+_assertPixelApprox(canvas, 100,25, 0,255,255,255, "100,25", "0,255,255,255", 3);
+_assertPixelApprox(canvas, 150,25, 127,127,255,255, "150,25", "127,127,255,255", 3);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.multiple.png b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.multiple.png
new file mode 100644
index 0000000..7af7994
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.multiple.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.outside.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.outside.html
new file mode 100644
index 0000000..c39cc1b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.outside.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.interpolate.outside</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.interpolate.colouralpha.html" title="2d.gradient.interpolate.colouralpha">
+<link rel="next" href="2d.gradient.interpolate.zerosize.html" title="2d.gradient.interpolate.zerosize">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.interpolate.colouralpha.html" accesskey="p" title="[p] 2d.gradient.interpolate.colouralpha"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.interpolate.zerosize.html" accesskey="n" title="[n] 2d.gradient.interpolate.zerosize">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.interpolate.html">interpolate</a>.outside</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.outside.first">2d.gradient.outside.first</a>
+<li><a href="spec.html#testrefs.2d.gradient.outside.last">2d.gradient.outside.last</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createLinearGradient(25, 0, 75, 0);
+g.addColorStop(0.4, '#0f0');
+g.addColorStop(0.6, '#0f0');
+
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 20,25, 0,255,0,255, "20,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 80,25, 0,255,0,255, "80,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.overlap.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.overlap.html
new file mode 100644
index 0000000..d8c6fca
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.overlap.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.interpolate.overlap</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.interpolate.multiple.html" title="2d.gradient.interpolate.multiple">
+<link rel="next" href="2d.gradient.interpolate.overlap2.html" title="2d.gradient.interpolate.overlap2">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.interpolate.multiple.html" accesskey="p" title="[p] 2d.gradient.interpolate.multiple"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.interpolate.overlap2.html" accesskey="n" title="[n] 2d.gradient.interpolate.overlap2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.interpolate.html">interpolate</a>.overlap</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.interpolate.overlap">2d.gradient.interpolate.overlap</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.gradient.interpolate.overlap.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = 200;
+var g = ctx.createLinearGradient(0, 0, 200, 0);
+g.addColorStop(0, '#f00');
+g.addColorStop(0, '#ff0');
+g.addColorStop(0.25, '#00f');
+g.addColorStop(0.25, '#0f0');
+g.addColorStop(0.25, '#0f0');
+g.addColorStop(0.25, '#0f0');
+g.addColorStop(0.25, '#ff0');
+g.addColorStop(0.5, '#00f');
+g.addColorStop(0.5, '#0f0');
+g.addColorStop(0.75, '#00f');
+g.addColorStop(0.75, '#f00');
+g.addColorStop(0.75, '#ff0');
+g.addColorStop(0.5, '#0f0');
+g.addColorStop(0.5, '#0f0');
+g.addColorStop(0.5, '#ff0');
+g.addColorStop(1, '#00f');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 200, 50);
+_assertPixelApprox(canvas, 49,25, 0,0,255,255, "49,25", "0,0,255,255", 16);
+_assertPixelApprox(canvas, 51,25, 255,255,0,255, "51,25", "255,255,0,255", 16);
+_assertPixelApprox(canvas, 99,25, 0,0,255,255, "99,25", "0,0,255,255", 16);
+_assertPixelApprox(canvas, 101,25, 255,255,0,255, "101,25", "255,255,0,255", 16);
+_assertPixelApprox(canvas, 149,25, 0,0,255,255, "149,25", "0,0,255,255", 16);
+_assertPixelApprox(canvas, 151,25, 255,255,0,255, "151,25", "255,255,0,255", 16);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.overlap.png b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.overlap.png
new file mode 100644
index 0000000..a15edde
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.overlap.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.overlap2.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.overlap2.html
new file mode 100644
index 0000000..6bf15a5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.overlap2.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.interpolate.overlap2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.interpolate.overlap.html" title="2d.gradient.interpolate.overlap">
+<link rel="next" href="2d.gradient.empty.html" title="2d.gradient.empty">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.interpolate.overlap.html" accesskey="p" title="[p] 2d.gradient.interpolate.overlap"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.empty.html" accesskey="n" title="[n] 2d.gradient.empty">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.interpolate.html">interpolate</a>.overlap2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.interpolate.overlap">2d.gradient.interpolate.overlap</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var g = ctx.createLinearGradient(0, 0, 100, 0);
+var ps = [ 0, 1/10, 1/4, 1/3, 1/2, 3/4, 1 ];
+for (var p = 0; p < ps.length; ++p)
+{
+ g.addColorStop(ps[p], '#0f0');
+ for (var i = 0; i < 15; ++i)
+ g.addColorStop(ps[p], '#f00');
+ g.addColorStop(ps[p], '#0f0');
+}
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 30,25, 0,255,0,255, "30,25", "0,255,0,255");
+_assertPixel(canvas, 40,25, 0,255,0,255, "40,25", "0,255,0,255");
+_assertPixel(canvas, 60,25, 0,255,0,255, "60,25", "0,255,0,255");
+_assertPixel(canvas, 80,25, 0,255,0,255, "80,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.solid.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.solid.html
new file mode 100644
index 0000000..b20bb50
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.solid.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.interpolate.solid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.object.return.html" title="2d.gradient.object.return">
+<link rel="next" href="2d.gradient.interpolate.colour.html" title="2d.gradient.interpolate.colour">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.object.return.html" accesskey="p" title="[p] 2d.gradient.object.return"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.interpolate.colour.html" accesskey="n" title="[n] 2d.gradient.interpolate.colour">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.interpolate.html">interpolate</a>.solid</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.interpolate.linear">2d.gradient.interpolate.linear</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var g = ctx.createLinearGradient(0, 0, 100, 0);
+g.addColorStop(0, '#0f0');
+g.addColorStop(1, '#0f0');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.vertical.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.vertical.html
new file mode 100644
index 0000000..c0e5fca
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.vertical.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.interpolate.vertical</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.interpolate.zerosize.html" title="2d.gradient.interpolate.zerosize">
+<link rel="next" href="2d.gradient.interpolate.multiple.html" title="2d.gradient.interpolate.multiple">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.interpolate.zerosize.html" accesskey="p" title="[p] 2d.gradient.interpolate.zerosize"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.interpolate.multiple.html" accesskey="n" title="[n] 2d.gradient.interpolate.multiple">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.interpolate.html">interpolate</a>.vertical</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.interpolate.linear">2d.gradient.interpolate.linear</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.gradient.interpolate.vertical.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var g = ctx.createLinearGradient(0, 0, 0, 50);
+g.addColorStop(0, '#ff0');
+g.addColorStop(1, '#00f');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,12, 191,191,63,255, "50,12", "191,191,63,255", 10);
+_assertPixelApprox(canvas, 50,25, 127,127,127,255, "50,25", "127,127,127,255", 5);
+_assertPixelApprox(canvas, 50,37, 63,63,191,255, "50,37", "63,63,191,255", 10);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.vertical.png b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.vertical.png
new file mode 100644
index 0000000..06bc35f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.vertical.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.zerosize.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.zerosize.html
new file mode 100644
index 0000000..8f36109
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.interpolate.zerosize.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.interpolate.zerosize</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.interpolate.outside.html" title="2d.gradient.interpolate.outside">
+<link rel="next" href="2d.gradient.interpolate.vertical.html" title="2d.gradient.interpolate.vertical">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.interpolate.outside.html" accesskey="p" title="[p] 2d.gradient.interpolate.outside"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.interpolate.vertical.html" accesskey="n" title="[n] 2d.gradient.interpolate.vertical">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.interpolate.html">interpolate</a>.zerosize</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.linear.zerosize">2d.gradient.linear.zerosize</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createLinearGradient(50, 25, 50, 25); // zero-length line (undefined direction)
+g.addColorStop(0, '#f00');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 40,20, 0,255,0,255, "40,20", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.linear.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.linear.nonfinite.html
new file mode 100644
index 0000000..ad7b159
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.linear.nonfinite.html
@@ -0,0 +1,101 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.linear.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.object.invalidcolour.html" title="2d.gradient.object.invalidcolour">
+<link rel="next" href="2d.gradient.linear.transform.1.html" title="2d.gradient.linear.transform.1">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.object.invalidcolour.html" accesskey="p" title="[p] 2d.gradient.object.invalidcolour"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.linear.transform.1.html" accesskey="n" title="[n] 2d.gradient.linear.transform.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.linear.html">linear</a>.nonfinite</h1>
+<p class="desc">createLinearGradient() throws NOT_SUPPORTED_ERR if arguments are not finite</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.linear.nonfinite">2d.gradient.linear.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.createLinearGradient(Infinity, 0, 1, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, 0)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(-Infinity, 0, 1, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(-Infinity, 0, 1, 0)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(NaN, 0, 1, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(NaN, 0, 1, 0)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0, Infinity, 1, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, 0)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0, -Infinity, 1, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, -Infinity, 1, 0)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0, NaN, 1, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, NaN, 1, 0)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0, 0, Infinity, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, 0)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0, 0, -Infinity, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, -Infinity, 0)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0, 0, NaN, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, NaN, 0)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0, 0, 1, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, Infinity)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0, 0, 1, -Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, -Infinity)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0, 0, 1, NaN);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1, NaN)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(Infinity, Infinity, 1, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, 0)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(Infinity, Infinity, Infinity, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, 0)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(Infinity, Infinity, 1, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, Infinity, 1, Infinity)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(Infinity, 0, Infinity, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, 0)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(Infinity, 0, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(Infinity, 0, 1, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(Infinity, 0, 1, Infinity)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0, Infinity, Infinity, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, 0)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0, Infinity, 1, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, Infinity, 1, Infinity)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0, 0, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, Infinity, Infinity)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.linear.transform.1.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.linear.transform.1.html
new file mode 100644
index 0000000..4a52078
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.linear.transform.1.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.linear.transform.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.linear.nonfinite.html" title="2d.gradient.linear.nonfinite">
+<link rel="next" href="2d.gradient.linear.transform.2.html" title="2d.gradient.linear.transform.2">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.linear.nonfinite.html" accesskey="p" title="[p] 2d.gradient.linear.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.linear.transform.2.html" accesskey="n" title="[n] 2d.gradient.linear.transform.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.linear.html">linear</a>.<a href="index.2d.gradient.linear.transform.html">transform</a>.1</h1>
+<p class="desc">Linear gradient coordinates are relative to the coordinate space at the time of filling</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.linear.transform">2d.gradient.linear.transform</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var g = ctx.createLinearGradient(0, 0, 200, 0);
+g.addColorStop(0, '#f00');
+g.addColorStop(0.25, '#0f0');
+g.addColorStop(0.75, '#0f0');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.translate(-50, 0);
+ctx.fillRect(50, 0, 100, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.linear.transform.2.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.linear.transform.2.html
new file mode 100644
index 0000000..17176a4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.linear.transform.2.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.linear.transform.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.linear.transform.1.html" title="2d.gradient.linear.transform.1">
+<link rel="next" href="2d.gradient.linear.transform.3.html" title="2d.gradient.linear.transform.3">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.linear.transform.1.html" accesskey="p" title="[p] 2d.gradient.linear.transform.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.linear.transform.3.html" accesskey="n" title="[n] 2d.gradient.linear.transform.3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.linear.html">linear</a>.<a href="index.2d.gradient.linear.transform.html">transform</a>.2</h1>
+<p class="desc">Linear gradient coordinates are relative to the coordinate space at the time of filling</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.linear.transform">2d.gradient.linear.transform</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.translate(100, 0);
+var g = ctx.createLinearGradient(0, 0, 200, 0);
+g.addColorStop(0, '#f00');
+g.addColorStop(0.25, '#0f0');
+g.addColorStop(0.75, '#0f0');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.translate(-150, 0);
+ctx.fillRect(50, 0, 100, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.linear.transform.3.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.linear.transform.3.html
new file mode 100644
index 0000000..3466794
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.linear.transform.3.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.linear.transform.3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.linear.transform.2.html" title="2d.gradient.linear.transform.2">
+<link rel="next" href="2d.gradient.radial.negative.html" title="2d.gradient.radial.negative">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.linear.transform.2.html" accesskey="p" title="[p] 2d.gradient.linear.transform.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.negative.html" accesskey="n" title="[n] 2d.gradient.radial.negative">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.linear.html">linear</a>.<a href="index.2d.gradient.linear.transform.html">transform</a>.3</h1>
+<p class="desc">Linear gradient transforms do not experience broken caching effects</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.linear.transform">2d.gradient.linear.transform</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var g = ctx.createLinearGradient(0, 0, 200, 0);
+g.addColorStop(0, '#f00');
+g.addColorStop(0.25, '#0f0');
+g.addColorStop(0.75, '#0f0');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+ctx.translate(-50, 0);
+ctx.fillRect(50, 0, 100, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.compare.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.compare.html
new file mode 100644
index 0000000..41dc702
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.compare.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.object.compare</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.object.update.html" title="2d.gradient.object.update">
+<link rel="next" href="2d.gradient.object.crosscanvas.html" title="2d.gradient.object.crosscanvas">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.object.update.html" accesskey="p" title="[p] 2d.gradient.object.update"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.object.crosscanvas.html" accesskey="n" title="[n] 2d.gradient.object.crosscanvas">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.object.html">object</a>.compare</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.object">2d.gradient.object</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var g1 = ctx.createLinearGradient(0, 0, 100, 0);
+var g2 = ctx.createLinearGradient(0, 0, 100, 0);
+_assertDifferent(g1, g2, "g1", "g2");
+ctx.fillStyle = g1;
+_assertSame(ctx.fillStyle, g1, "ctx.fillStyle", "g1");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.crosscanvas.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.crosscanvas.html
new file mode 100644
index 0000000..9e146da
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.crosscanvas.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.object.crosscanvas</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.object.compare.html" title="2d.gradient.object.compare">
+<link rel="next" href="2d.gradient.object.invalidoffset.html" title="2d.gradient.object.invalidoffset">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.object.compare.html" accesskey="p" title="[p] 2d.gradient.object.compare"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.object.invalidoffset.html" accesskey="n" title="[n] 2d.gradient.object.invalidoffset">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.object.html">object</a>.crosscanvas</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+var g = document.createElement('canvas').getContext('2d').createLinearGradient(0, 0, 100, 0);
+g.addColorStop(0, '#0f0');
+g.addColorStop(1, '#0f0');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.invalidcolour.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.invalidcolour.html
new file mode 100644
index 0000000..fabec5e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.invalidcolour.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.object.invalidcolour</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.object.invalidoffset.html" title="2d.gradient.object.invalidoffset">
+<link rel="next" href="2d.gradient.linear.nonfinite.html" title="2d.gradient.linear.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.object.invalidoffset.html" accesskey="p" title="[p] 2d.gradient.object.invalidoffset"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.linear.nonfinite.html" accesskey="n" title="[n] 2d.gradient.linear.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.object.html">object</a>.invalidcolour</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.invalidcolour">2d.gradient.invalidcolour</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var g = ctx.createLinearGradient(0, 0, 100, 0);
+try { var _thrown = false;
+ g.addColorStop(0, "");
+} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, \"\")"); }
+try { var _thrown = false;
+ g.addColorStop(0, 'undefined');
+} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: g.addColorStop(0, 'undefined')"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.invalidoffset.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.invalidoffset.html
new file mode 100644
index 0000000..996dde6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.invalidoffset.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.object.invalidoffset</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.object.crosscanvas.html" title="2d.gradient.object.crosscanvas">
+<link rel="next" href="2d.gradient.object.invalidcolour.html" title="2d.gradient.object.invalidcolour">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.object.crosscanvas.html" accesskey="p" title="[p] 2d.gradient.object.crosscanvas"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.object.invalidcolour.html" accesskey="n" title="[n] 2d.gradient.object.invalidcolour">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.object.html">object</a>.invalidoffset</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.invalidoffset">2d.gradient.invalidoffset</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var g = ctx.createLinearGradient(0, 0, 100, 0);
+try { var _thrown = false;
+ g.addColorStop(-1, '#000');
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-1, '#000')"); }
+try { var _thrown = false;
+ g.addColorStop(2, '#000');
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(2, '#000')"); }
+try { var _thrown = false;
+ g.addColorStop(Infinity, '#000');
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(Infinity, '#000')"); }
+try { var _thrown = false;
+ g.addColorStop(-Infinity, '#000');
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(-Infinity, '#000')"); }
+try { var _thrown = false;
+ g.addColorStop(NaN, '#000');
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: g.addColorStop(NaN, '#000')"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.return.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.return.html
new file mode 100644
index 0000000..0f622da
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.return.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.object.return</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.strokeStyle.default.html" title="2d.strokeStyle.default">
+<link rel="next" href="2d.gradient.interpolate.solid.html" title="2d.gradient.interpolate.solid">
+<body class="show_output">
+<p>
+ <a href="2d.strokeStyle.default.html" accesskey="p" title="[p] 2d.strokeStyle.default"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.interpolate.solid.html" accesskey="n" title="[n] 2d.gradient.interpolate.solid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.object.html">object</a>.return</h1>
+<p class="desc">createLinearGradient() and createRadialGradient() returns objects implementing CanvasGradient</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.linear.return">2d.gradient.linear.return</a>
+<li><a href="spec.html#testrefs.2d.gradient.radial.return">2d.gradient.radial.return</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+window.CanvasGradient.prototype.thisImplementsCanvasGradient = true;
+
+var g1 = ctx.createLinearGradient(0, 0, 100, 0);
+_assertDifferent(g1.addColorStop, undefined, "g1.addColorStop", "undefined");
+_assertSame(g1.thisImplementsCanvasGradient, true, "g1.thisImplementsCanvasGradient", "true");
+
+var g2 = ctx.createRadialGradient(0, 0, 10, 0, 0, 20);
+_assertDifferent(g2.addColorStop, undefined, "g2.addColorStop", "undefined");
+_assertSame(g2.thisImplementsCanvasGradient, true, "g2.thisImplementsCanvasGradient", "true");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.update.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.update.html
new file mode 100644
index 0000000..449304e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.object.update.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.object.update</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.empty.html" title="2d.gradient.empty">
+<link rel="next" href="2d.gradient.object.compare.html" title="2d.gradient.object.compare">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.empty.html" accesskey="p" title="[p] 2d.gradient.empty"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.object.compare.html" accesskey="n" title="[n] 2d.gradient.object.compare">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.object.html">object</a>.update</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.update">2d.gradient.update</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var g = ctx.createLinearGradient(-100, 0, 200, 0);
+g.addColorStop(0, '#f00');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+g.addColorStop(0.1, '#0f0');
+g.addColorStop(0.9, '#0f0');
+ctx.fillRect(0, 0, 100, 50);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.behind.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.behind.html
new file mode 100644
index 0000000..f1a6b15
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.behind.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.cone.behind</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.equal.html" title="2d.gradient.radial.equal">
+<link rel="next" href="2d.gradient.radial.cone.front.html" title="2d.gradient.radial.cone.front">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.equal.html" accesskey="p" title="[p] 2d.gradient.radial.equal"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.cone.front.html" accesskey="n" title="[n] 2d.gradient.radial.cone.front">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.<a href="index.2d.gradient.radial.cone.html">cone</a>.behind</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(120, 25, 10, 211, 25, 100);
+g.addColorStop(0, '#f00');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.beside.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.beside.html
new file mode 100644
index 0000000..043d3df
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.beside.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.cone.beside</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.cone.top.html" title="2d.gradient.radial.cone.top">
+<link rel="next" href="2d.gradient.radial.cone.cylinder.html" title="2d.gradient.radial.cone.cylinder">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.cone.top.html" accesskey="p" title="[p] 2d.gradient.radial.cone.top"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.cone.cylinder.html" accesskey="n" title="[n] 2d.gradient.radial.cone.cylinder">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.<a href="index.2d.gradient.radial.cone.html">cone</a>.beside</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(0, 100, 40, 100, 100, 50);
+g.addColorStop(0, '#f00');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.bottom.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.bottom.html
new file mode 100644
index 0000000..3972bd8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.bottom.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.cone.bottom</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.cone.front.html" title="2d.gradient.radial.cone.front">
+<link rel="next" href="2d.gradient.radial.cone.top.html" title="2d.gradient.radial.cone.top">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.cone.front.html" accesskey="p" title="[p] 2d.gradient.radial.cone.front"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.cone.top.html" accesskey="n" title="[n] 2d.gradient.radial.cone.top">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.<a href="index.2d.gradient.radial.cone.html">cone</a>.bottom</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(210, 25, 100, 230, 25, 101);
+g.addColorStop(0, '#0f0');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.cylinder.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.cylinder.html
new file mode 100644
index 0000000..39dc25b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.cylinder.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.cone.cylinder</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.cone.beside.html" title="2d.gradient.radial.cone.beside">
+<link rel="next" href="2d.gradient.radial.cone.shape1.html" title="2d.gradient.radial.cone.shape1">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.cone.beside.html" accesskey="p" title="[p] 2d.gradient.radial.cone.beside"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.cone.shape1.html" accesskey="n" title="[n] 2d.gradient.radial.cone.shape1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.<a href="index.2d.gradient.radial.cone.html">cone</a>.cylinder</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(210, 25, 100, 230, 25, 100);
+g.addColorStop(0, '#0f0');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.front.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.front.html
new file mode 100644
index 0000000..ef329ba
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.front.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.cone.front</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.cone.behind.html" title="2d.gradient.radial.cone.behind">
+<link rel="next" href="2d.gradient.radial.cone.bottom.html" title="2d.gradient.radial.cone.bottom">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.cone.behind.html" accesskey="p" title="[p] 2d.gradient.radial.cone.behind"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.cone.bottom.html" accesskey="n" title="[n] 2d.gradient.radial.cone.bottom">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.<a href="index.2d.gradient.radial.cone.html">cone</a>.front</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(311, 25, 10, 210, 25, 100);
+g.addColorStop(0, '#f00');
+g.addColorStop(1, '#0f0');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.shape1.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.shape1.html
new file mode 100644
index 0000000..856b36e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.shape1.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.cone.shape1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.cone.cylinder.html" title="2d.gradient.radial.cone.cylinder">
+<link rel="next" href="2d.gradient.radial.cone.shape2.html" title="2d.gradient.radial.cone.shape2">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.cone.cylinder.html" accesskey="p" title="[p] 2d.gradient.radial.cone.cylinder"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.cone.shape2.html" accesskey="n" title="[n] 2d.gradient.radial.cone.shape2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.<a href="index.2d.gradient.radial.cone.html">cone</a>.shape1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var tol = 1; // tolerance to avoid antialiasing artifacts
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(30+tol, 40);
+ctx.lineTo(110, -20+tol);
+ctx.lineTo(110, 100-tol);
+ctx.fill();
+
+var g = ctx.createRadialGradient(30+10*5/2, 40, 10*3/2, 30+10*15/4, 40, 10*9/4);
+g.addColorStop(0, '#0f0');
+g.addColorStop(1, '#0f0');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.shape2.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.shape2.html
new file mode 100644
index 0000000..8a20c71
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.shape2.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.cone.shape2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.cone.shape1.html" title="2d.gradient.radial.cone.shape1">
+<link rel="next" href="2d.gradient.radial.transform.1.html" title="2d.gradient.radial.transform.1">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.cone.shape1.html" accesskey="p" title="[p] 2d.gradient.radial.cone.shape1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.transform.1.html" accesskey="n" title="[n] 2d.gradient.radial.transform.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.<a href="index.2d.gradient.radial.cone.html">cone</a>.shape2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var tol = 1; // tolerance to avoid antialiasing artifacts
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(30+10*5/2, 40, 10*3/2, 30+10*15/4, 40, 10*9/4);
+g.addColorStop(0, '#f00');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(30-tol, 40);
+ctx.lineTo(110, -20-tol);
+ctx.lineTo(110, 100+tol);
+ctx.fill();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.top.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.top.html
new file mode 100644
index 0000000..2c9f5a2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.cone.top.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.cone.top</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.cone.bottom.html" title="2d.gradient.radial.cone.bottom">
+<link rel="next" href="2d.gradient.radial.cone.beside.html" title="2d.gradient.radial.cone.beside">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.cone.bottom.html" accesskey="p" title="[p] 2d.gradient.radial.cone.bottom"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.cone.beside.html" accesskey="n" title="[n] 2d.gradient.radial.cone.beside">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.<a href="index.2d.gradient.radial.cone.html">cone</a>.top</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(230, 25, 100, 100, 25, 101);
+g.addColorStop(0, '#f00');
+g.addColorStop(1, '#0f0');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.equal.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.equal.html
new file mode 100644
index 0000000..d90575d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.equal.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.equal</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.touch3.html" title="2d.gradient.radial.touch3">
+<link rel="next" href="2d.gradient.radial.cone.behind.html" title="2d.gradient.radial.cone.behind">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.touch3.html" accesskey="p" title="[p] 2d.gradient.radial.touch3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.cone.behind.html" accesskey="n" title="[n] 2d.gradient.radial.cone.behind">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.equal</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.equal">2d.gradient.radial.equal</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(50, 25, 20, 50, 25, 20);
+g.addColorStop(0, '#f00');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.inside1.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.inside1.html
new file mode 100644
index 0000000..43ca8d7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.inside1.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.inside1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.nonfinite.html" title="2d.gradient.radial.nonfinite">
+<link rel="next" href="2d.gradient.radial.inside2.html" title="2d.gradient.radial.inside2">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.nonfinite.html" accesskey="p" title="[p] 2d.gradient.radial.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.inside2.html" accesskey="n" title="[n] 2d.gradient.radial.inside2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.inside1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(50, 25, 100, 50, 25, 200);
+g.addColorStop(0, '#0f0');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.inside2.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.inside2.html
new file mode 100644
index 0000000..1d64a6b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.inside2.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.inside2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.inside1.html" title="2d.gradient.radial.inside1">
+<link rel="next" href="2d.gradient.radial.inside3.html" title="2d.gradient.radial.inside3">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.inside1.html" accesskey="p" title="[p] 2d.gradient.radial.inside1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.inside3.html" accesskey="n" title="[n] 2d.gradient.radial.inside3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.inside2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(50, 25, 200, 50, 25, 100);
+g.addColorStop(0, '#f00');
+g.addColorStop(1, '#0f0');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.inside3.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.inside3.html
new file mode 100644
index 0000000..354c2ed
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.inside3.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.inside3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.inside2.html" title="2d.gradient.radial.inside2">
+<link rel="next" href="2d.gradient.radial.outside1.html" title="2d.gradient.radial.outside1">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.inside2.html" accesskey="p" title="[p] 2d.gradient.radial.inside2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.outside1.html" accesskey="n" title="[n] 2d.gradient.radial.outside1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.inside3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(50, 25, 200, 50, 25, 100);
+g.addColorStop(0, '#f00');
+g.addColorStop(0.993, '#f00');
+g.addColorStop(1, '#0f0');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.negative.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.negative.html
new file mode 100644
index 0000000..e38d013
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.negative.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.negative</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.linear.transform.3.html" title="2d.gradient.linear.transform.3">
+<link rel="next" href="2d.gradient.radial.nonfinite.html" title="2d.gradient.radial.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.linear.transform.3.html" accesskey="p" title="[p] 2d.gradient.linear.transform.3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.nonfinite.html" accesskey="n" title="[n] 2d.gradient.radial.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.negative</h1>
+<p class="desc">createRadialGradient() throws INDEX_SIZE_ERR if either radius is negative</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.negative">2d.gradient.radial.negative</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.nonfinite.html
new file mode 100644
index 0000000..4d58b7a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.nonfinite.html
@@ -0,0 +1,257 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.negative.html" title="2d.gradient.radial.negative">
+<link rel="next" href="2d.gradient.radial.inside1.html" title="2d.gradient.radial.inside1">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.negative.html" accesskey="p" title="[p] 2d.gradient.radial.negative"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.inside1.html" accesskey="n" title="[n] 2d.gradient.radial.inside1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.nonfinite</h1>
+<p class="desc">createRadialGradient() throws NOT_SUPPORTED_ERR if arguments are not finite</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.nonfinite">2d.gradient.radial.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, NaN, 1, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, NaN, 1, 0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, NaN, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, NaN, 0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, NaN, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, NaN, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, 0, NaN, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, NaN, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, 0, 0, NaN);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0, NaN)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.outside1.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.outside1.html
new file mode 100644
index 0000000..2dbe55a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.outside1.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.outside1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.inside3.html" title="2d.gradient.radial.inside3">
+<link rel="next" href="2d.gradient.radial.outside2.html" title="2d.gradient.radial.outside2">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.inside3.html" accesskey="p" title="[p] 2d.gradient.radial.inside3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.outside2.html" accesskey="n" title="[n] 2d.gradient.radial.outside2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.outside1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(200, 25, 10, 200, 25, 20);
+g.addColorStop(0, '#f00');
+g.addColorStop(1, '#0f0');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.outside2.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.outside2.html
new file mode 100644
index 0000000..0f26584
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.outside2.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.outside2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.outside1.html" title="2d.gradient.radial.outside1">
+<link rel="next" href="2d.gradient.radial.outside3.html" title="2d.gradient.radial.outside3">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.outside1.html" accesskey="p" title="[p] 2d.gradient.radial.outside1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.outside3.html" accesskey="n" title="[n] 2d.gradient.radial.outside3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.outside2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(200, 25, 20, 200, 25, 10);
+g.addColorStop(0, '#0f0');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.outside3.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.outside3.html
new file mode 100644
index 0000000..59b2ae4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.outside3.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.outside3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.outside2.html" title="2d.gradient.radial.outside2">
+<link rel="next" href="2d.gradient.radial.touch1.html" title="2d.gradient.radial.touch1">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.outside2.html" accesskey="p" title="[p] 2d.gradient.radial.outside2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.touch1.html" accesskey="n" title="[n] 2d.gradient.radial.touch1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.outside3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(200, 25, 20, 200, 25, 10);
+g.addColorStop(0, '#0f0');
+g.addColorStop(0.001, '#f00');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.touch1.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.touch1.html
new file mode 100644
index 0000000..4788f4d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.touch1.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.touch1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.outside3.html" title="2d.gradient.radial.outside3">
+<link rel="next" href="2d.gradient.radial.touch2.html" title="2d.gradient.radial.touch2">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.outside3.html" accesskey="p" title="[p] 2d.gradient.radial.outside3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.touch2.html" accesskey="n" title="[n] 2d.gradient.radial.touch2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.touch1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(150, 25, 50, 200, 25, 100);
+g.addColorStop(0, '#f00');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.touch2.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.touch2.html
new file mode 100644
index 0000000..fddeb96
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.touch2.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.touch2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.touch1.html" title="2d.gradient.radial.touch1">
+<link rel="next" href="2d.gradient.radial.touch3.html" title="2d.gradient.radial.touch3">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.touch1.html" accesskey="p" title="[p] 2d.gradient.radial.touch1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.touch3.html" accesskey="n" title="[n] 2d.gradient.radial.touch3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.touch2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(-80, 25, 70, 0, 25, 150);
+g.addColorStop(0, '#f00');
+g.addColorStop(0.01, '#0f0');
+g.addColorStop(0.99, '#0f0');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.touch3.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.touch3.html
new file mode 100644
index 0000000..50413c3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.touch3.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.touch3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.touch2.html" title="2d.gradient.radial.touch2">
+<link rel="next" href="2d.gradient.radial.equal.html" title="2d.gradient.radial.equal">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.touch2.html" accesskey="p" title="[p] 2d.gradient.radial.touch2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.equal.html" accesskey="n" title="[n] 2d.gradient.radial.equal">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.touch3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.rendering">2d.gradient.radial.rendering</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var g = ctx.createRadialGradient(120, -15, 25, 140, -30, 50);
+g.addColorStop(0, '#f00');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.transform.1.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.transform.1.html
new file mode 100644
index 0000000..908d251
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.transform.1.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.transform.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.cone.shape2.html" title="2d.gradient.radial.cone.shape2">
+<link rel="next" href="2d.gradient.radial.transform.2.html" title="2d.gradient.radial.transform.2">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.cone.shape2.html" accesskey="p" title="[p] 2d.gradient.radial.cone.shape2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.transform.2.html" accesskey="n" title="[n] 2d.gradient.radial.transform.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.<a href="index.2d.gradient.radial.transform.html">transform</a>.1</h1>
+<p class="desc">Radial gradient coordinates are relative to the coordinate space at the time of filling</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.transform">2d.gradient.radial.transform</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2);
+g.addColorStop(0, '#0f0');
+g.addColorStop(0.5, '#0f0');
+g.addColorStop(0.51, '#f00');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.translate(50, 25);
+ctx.scale(10, 10);
+ctx.fillRect(-5, -2.5, 10, 5);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.transform.2.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.transform.2.html
new file mode 100644
index 0000000..30dec81
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.transform.2.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.transform.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.transform.1.html" title="2d.gradient.radial.transform.1">
+<link rel="next" href="2d.gradient.radial.transform.3.html" title="2d.gradient.radial.transform.3">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.transform.1.html" accesskey="p" title="[p] 2d.gradient.radial.transform.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.radial.transform.3.html" accesskey="n" title="[n] 2d.gradient.radial.transform.3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.<a href="index.2d.gradient.radial.transform.html">transform</a>.2</h1>
+<p class="desc">Radial gradient coordinates are relative to the coordinate space at the time of filling</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.transform">2d.gradient.radial.transform</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.translate(100, 0);
+var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2);
+g.addColorStop(0, '#0f0');
+g.addColorStop(0.5, '#0f0');
+g.addColorStop(0.51, '#f00');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.translate(-50, 25);
+ctx.scale(10, 10);
+ctx.fillRect(-5, -2.5, 10, 5);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.transform.3.html b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.transform.3.html
new file mode 100644
index 0000000..993aca3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.gradient.radial.transform.3.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.gradient.radial.transform.3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.transform.2.html" title="2d.gradient.radial.transform.2">
+<link rel="next" href="2d.pattern.basic.type.html" title="2d.pattern.basic.type">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.transform.2.html" accesskey="p" title="[p] 2d.gradient.radial.transform.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.basic.type.html" accesskey="n" title="[n] 2d.pattern.basic.type">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.gradient.html">gradient</a>.<a href="index.2d.gradient.radial.html">radial</a>.<a href="index.2d.gradient.radial.transform.html">transform</a>.3</h1>
+<p class="desc">Radial gradient transforms do not experience broken caching effects</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.gradient.radial.transform">2d.gradient.radial.transform</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var g = ctx.createRadialGradient(0, 0, 0, 0, 0, 11.2);
+g.addColorStop(0, '#0f0');
+g.addColorStop(0.5, '#0f0');
+g.addColorStop(0.51, '#f00');
+g.addColorStop(1, '#f00');
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+ctx.translate(50, 25);
+ctx.scale(10, 10);
+ctx.fillRect(-5, -2.5, 10, 5);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.create1.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create1.basic.html
new file mode 100644
index 0000000..e6f4e9a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create1.basic.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.create1.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.create2.basic.html" title="2d.imageData.create2.basic">
+<link rel="next" href="2d.imageData.create2.type.html" title="2d.imageData.create2.type">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.create2.basic.html" accesskey="p" title="[p] 2d.imageData.create2.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.create2.type.html" accesskey="n" title="[n] 2d.imageData.create2.type">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.create1.html">create1</a>.basic</h1>
+<p class="desc">createImageData(imgdata) exists and returns something</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.create1.object">2d.imageData.create1.object</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433004">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertDifferent(ctx.createImageData(ctx.createImageData(1, 1)), null, "ctx.createImageData(ctx.createImageData(1, 1))", "null");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.create1.initial.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create1.initial.html
new file mode 100644
index 0000000..320ed40
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create1.initial.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.create1.initial</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.create2.initial.html" title="2d.imageData.create2.initial">
+<link rel="next" href="2d.imageData.create2.large.html" title="2d.imageData.create2.large">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.create2.initial.html" accesskey="p" title="[p] 2d.imageData.create2.initial"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.create2.large.html" accesskey="n" title="[n] 2d.imageData.create2.large">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.create1.html">create1</a>.initial</h1>
+<p class="desc">createImageData(imgdata) returns transparent black data of the right size</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.create1.size">2d.imageData.create1.size</a>
+<li><a href="spec.html#testrefs.2d.imageData.create.initial">2d.imageData.create.initial</a>
+<li><a href="spec.html#testrefs.2d.imageData.initial">2d.imageData.initial</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433004">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+var imgdata1 = ctx.getImageData(0, 0, 10, 20);
+var imgdata2 = ctx.createImageData(imgdata1);
+_assertEqual(imgdata2.data.length, imgdata1.data.length, "imgdata2.data.length", "imgdata1.data.length");
+_assertEqual(imgdata2.width, imgdata1.width, "imgdata2.width", "imgdata1.width");
+_assertEqual(imgdata2.height, imgdata1.height, "imgdata2.height", "imgdata1.height");
+var isTransparentBlack = true;
+for (var i = 0; i < imgdata2.data.length; ++i)
+ if (imgdata2.data[i] !== 0)
+ isTransparentBlack = false;
+_assert(isTransparentBlack, "isTransparentBlack");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.create1.type.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create1.type.html
new file mode 100644
index 0000000..fd56964
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create1.type.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.create1.type</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.create2.type.html" title="2d.imageData.create2.type">
+<link rel="next" href="2d.imageData.create2.initial.html" title="2d.imageData.create2.initial">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.create2.type.html" accesskey="p" title="[p] 2d.imageData.create2.type"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.create2.initial.html" accesskey="n" title="[n] 2d.imageData.create2.initial">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.create1.html">create1</a>.type</h1>
+<p class="desc">createImageData(imgdata) returns an ImageData object containing a CanvasPixelArray object</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.create1.object">2d.imageData.create1.object</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433004">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined");
+_assertDifferent(window.CanvasPixelArray, undefined, "window.CanvasPixelArray", "undefined");
+window.ImageData.prototype.thisImplementsImageData = true;
+window.CanvasPixelArray.prototype.thisImplementsCanvasPixelArray = true;
+var imgdata = ctx.createImageData(ctx.createImageData(1, 1));
+_assert(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData");
+_assert(imgdata.data.thisImplementsCanvasPixelArray, "imgdata.data.thisImplementsCanvasPixelArray");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.create1.zero.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create1.zero.html
new file mode 100644
index 0000000..06bd755a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create1.zero.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.create1.zero</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.create2.nonfinite.html" title="2d.imageData.create2.nonfinite">
+<link rel="next" href="2d.imageData.create2.round.html" title="2d.imageData.create2.round">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.create2.nonfinite.html" accesskey="p" title="[p] 2d.imageData.create2.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.create2.round.html" accesskey="n" title="[n] 2d.imageData.create2.round">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.create1.html">create1</a>.zero</h1>
+<p class="desc">createImageData(null) throws INDEX_SIZE_ERR</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.create.null">2d.imageData.create.null</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.createImageData(null);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(null)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.basic.html
new file mode 100644
index 0000000..549d235
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.basic.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.create2.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.drawImage.nonfinite.html" title="2d.drawImage.nonfinite">
+<link rel="next" href="2d.imageData.create1.basic.html" title="2d.imageData.create1.basic">
+<body class="show_output">
+<p>
+ <a href="2d.drawImage.nonfinite.html" accesskey="p" title="[p] 2d.drawImage.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.create1.basic.html" accesskey="n" title="[n] 2d.imageData.create1.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.create2.html">create2</a>.basic</h1>
+<p class="desc">createImageData(sw, sh) exists and returns something</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.create2.object">2d.imageData.create2.object</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433004">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertDifferent(ctx.createImageData(1, 1), null, "ctx.createImageData(1, 1)", "null");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.initial.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.initial.html
new file mode 100644
index 0000000..ebf403a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.initial.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.create2.initial</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.create1.type.html" title="2d.imageData.create1.type">
+<link rel="next" href="2d.imageData.create1.initial.html" title="2d.imageData.create1.initial">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.create1.type.html" accesskey="p" title="[p] 2d.imageData.create1.type"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.create1.initial.html" accesskey="n" title="[n] 2d.imageData.create1.initial">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.create2.html">create2</a>.initial</h1>
+<p class="desc">createImageData(sw, sh) returns transparent black data of the right size</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.create2.size">2d.imageData.create2.size</a>
+<li><a href="spec.html#testrefs.2d.imageData.create.initial">2d.imageData.create.initial</a>
+<li><a href="spec.html#testrefs.2d.imageData.initial">2d.imageData.initial</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433004">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = ctx.createImageData(10, 20);
+_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4");
+_assert(imgdata.width < imgdata.height, "imgdata.width < imgdata.height");
+_assert(imgdata.width > 0, "imgdata.width > 0");
+var isTransparentBlack = true;
+for (var i = 0; i < imgdata.data.length; ++i)
+ if (imgdata.data[i] !== 0)
+ isTransparentBlack = false;
+_assert(isTransparentBlack, "isTransparentBlack");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.large.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.large.html
new file mode 100644
index 0000000..0eceed8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.large.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.create2.large</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.create1.initial.html" title="2d.imageData.create1.initial">
+<link rel="next" href="2d.imageData.create2.tiny.html" title="2d.imageData.create2.tiny">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.create1.initial.html" accesskey="p" title="[p] 2d.imageData.create1.initial"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.create2.tiny.html" accesskey="n" title="[n] 2d.imageData.create2.tiny">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.create2.html">create2</a>.large</h1>
+<p class="desc">createImageData(sw, sh) works for sizes much larger than the canvas</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.create2.size">2d.imageData.create2.size</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433004">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = ctx.createImageData(1000, 2000);
+_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4");
+_assert(imgdata.width < imgdata.height, "imgdata.width < imgdata.height");
+_assert(imgdata.width > 0, "imgdata.width > 0");
+var isTransparentBlack = true;
+for (var i = 0; i < imgdata.data.length; i += 7813) // check ~1024 points (assuming normal scaling)
+ if (imgdata.data[i] !== 0)
+ isTransparentBlack = false;
+_assert(isTransparentBlack, "isTransparentBlack");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.negative.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.negative.html
new file mode 100644
index 0000000..0b0257a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.negative.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.create2.negative</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.create2.tiny.html" title="2d.imageData.create2.tiny">
+<link rel="next" href="2d.imageData.create2.zero.html" title="2d.imageData.create2.zero">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.create2.tiny.html" accesskey="p" title="[p] 2d.imageData.create2.tiny"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.create2.zero.html" accesskey="n" title="[n] 2d.imageData.create2.zero">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.create2.html">create2</a>.negative</h1>
+<p class="desc">createImageData(sw, sh) takes the absolute magnitude of the size arguments</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.create2.size">2d.imageData.create2.size</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433004">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata1 = ctx.createImageData(10, 20);
+var imgdata2 = ctx.createImageData(-10, 20);
+var imgdata3 = ctx.createImageData(10, -20);
+var imgdata4 = ctx.createImageData(-10, -20);
+_assertEqual(imgdata1.data.length, imgdata2.data.length, "imgdata1.data.length", "imgdata2.data.length");
+_assertEqual(imgdata2.data.length, imgdata3.data.length, "imgdata2.data.length", "imgdata3.data.length");
+_assertEqual(imgdata3.data.length, imgdata4.data.length, "imgdata3.data.length", "imgdata4.data.length");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.nonfinite.html
new file mode 100644
index 0000000..a92ec13
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.nonfinite.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.create2.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.create2.zero.html" title="2d.imageData.create2.zero">
+<link rel="next" href="2d.imageData.create1.zero.html" title="2d.imageData.create1.zero">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.create2.zero.html" accesskey="p" title="[p] 2d.imageData.create2.zero"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.create1.zero.html" accesskey="n" title="[n] 2d.imageData.create1.zero">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.create2.html">create2</a>.nonfinite</h1>
+<p class="desc">createImageData() throws NOT_SUPPORTED_ERR if arguments are not finite</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.getcreate.nonfinite">2d.imageData.getcreate.nonfinite</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433004">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.createImageData(Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.createImageData(-Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(-Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.createImageData(NaN, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(NaN, 10)"); }
+try { var _thrown = false;
+ ctx.createImageData(10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(10, Infinity)"); }
+try { var _thrown = false;
+ ctx.createImageData(10, -Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(10, -Infinity)"); }
+try { var _thrown = false;
+ ctx.createImageData(10, NaN);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(10, NaN)"); }
+try { var _thrown = false;
+ ctx.createImageData(Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(Infinity, Infinity)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.round.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.round.html
new file mode 100644
index 0000000..80b2e0e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.round.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.create2.round</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.create1.zero.html" title="2d.imageData.create1.zero">
+<link rel="next" href="2d.imageData.get.basic.html" title="2d.imageData.get.basic">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.create1.zero.html" accesskey="p" title="[p] 2d.imageData.create1.zero"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.basic.html" accesskey="n" title="[n] 2d.imageData.get.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.create2.html">create2</a>.round</h1>
+<p class="desc">createImageData(w, h) is rounded the same as getImageData(0, 0, w, h)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.createround">2d.imageData.createround</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433004">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata1 = ctx.createImageData(10.01, 10.99);
+var imgdata2 = ctx.getImageData(0, 0, 10.01, 10.99);
+_assertEqual(imgdata1.width, imgdata2.width, "imgdata1.width", "imgdata2.width");
+_assertEqual(imgdata1.height, imgdata2.height, "imgdata1.height", "imgdata2.height");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.tiny.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.tiny.html
new file mode 100644
index 0000000..7bce02f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.tiny.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.create2.tiny</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.create2.large.html" title="2d.imageData.create2.large">
+<link rel="next" href="2d.imageData.create2.negative.html" title="2d.imageData.create2.negative">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.create2.large.html" accesskey="p" title="[p] 2d.imageData.create2.large"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.create2.negative.html" accesskey="n" title="[n] 2d.imageData.create2.negative">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.create2.html">create2</a>.tiny</h1>
+<p class="desc">createImageData(sw, sh) works for sizes smaller than one pixel</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.create2.size">2d.imageData.create2.size</a>
+<li><a href="spec.html#testrefs.2d.imageData.one">2d.imageData.one</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433004">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = ctx.createImageData(0.0001, 0.0001);
+_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4");
+_assertEqual(imgdata.width, 1, "imgdata.width", "1");
+_assertEqual(imgdata.height, 1, "imgdata.height", "1");
+var isTransparentBlack = true;
+for (var i = 0; i < imgdata.data.length; ++i)
+ if (imgdata.data[i] !== 0)
+ isTransparentBlack = false;
+_assert(isTransparentBlack, "isTransparentBlack");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.type.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.type.html
new file mode 100644
index 0000000..b6d2fa2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.type.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.create2.type</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.create1.basic.html" title="2d.imageData.create1.basic">
+<link rel="next" href="2d.imageData.create1.type.html" title="2d.imageData.create1.type">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.create1.basic.html" accesskey="p" title="[p] 2d.imageData.create1.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.create1.type.html" accesskey="n" title="[n] 2d.imageData.create1.type">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.create2.html">create2</a>.type</h1>
+<p class="desc">createImageData(sw, sh) returns an ImageData object containing a CanvasPixelArray object</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.create2.object">2d.imageData.create2.object</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433004">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined");
+_assertDifferent(window.CanvasPixelArray, undefined, "window.CanvasPixelArray", "undefined");
+window.ImageData.prototype.thisImplementsImageData = true;
+window.CanvasPixelArray.prototype.thisImplementsCanvasPixelArray = true;
+var imgdata = ctx.createImageData(1, 1);
+_assert(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData");
+_assert(imgdata.data.thisImplementsCanvasPixelArray, "imgdata.data.thisImplementsCanvasPixelArray");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.zero.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.zero.html
new file mode 100644
index 0000000..3a6810f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.create2.zero.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.create2.zero</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.create2.negative.html" title="2d.imageData.create2.negative">
+<link rel="next" href="2d.imageData.create2.nonfinite.html" title="2d.imageData.create2.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.create2.negative.html" accesskey="p" title="[p] 2d.imageData.create2.negative"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.create2.nonfinite.html" accesskey="n" title="[n] 2d.imageData.create2.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.create2.html">create2</a>.zero</h1>
+<p class="desc">createImageData(sw, sh) throws INDEX_SIZE_ERR if size is zero</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.getcreate.zero">2d.imageData.getcreate.zero</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433004">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.createImageData(10, 0);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(10, 0)"); }
+try { var _thrown = false;
+ ctx.createImageData(0, 10);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(0, 10)"); }
+try { var _thrown = false;
+ ctx.createImageData(0, 0);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.createImageData(0, 0)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.basic.html
new file mode 100644
index 0000000..af9b82d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.basic.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.create2.round.html" title="2d.imageData.create2.round">
+<link rel="next" href="2d.imageData.get.type.html" title="2d.imageData.get.type">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.create2.round.html" accesskey="p" title="[p] 2d.imageData.create2.round"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.type.html" accesskey="n" title="[n] 2d.imageData.get.type">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.basic</h1>
+<p class="desc">getImageData() exists and returns something</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.get.basic">2d.imageData.get.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertDifferent(ctx.getImageData(0, 0, 100, 50), null, "ctx.getImageData(0, 0, 100, 50)", "null");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.clamp.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.clamp.html
new file mode 100644
index 0000000..229c0d5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.clamp.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.clamp</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.range.html" title="2d.imageData.get.range">
+<link rel="next" href="2d.imageData.get.length.html" title="2d.imageData.get.length">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.range.html" accesskey="p" title="[p] 2d.imageData.get.range"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.length.html" accesskey="n" title="[n] 2d.imageData.get.length">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.clamp</h1>
+<p class="desc">getImageData() clamps colours to the range [0, 255]</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pixelarray.range">2d.pixelarray.range</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = 'rgb(-100, -200, -300)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = 'rgb(256, 300, 400)';
+ctx.fillRect(20, 10, 60, 10);
+var imgdata1 = ctx.getImageData(10, 5, 1, 1);
+_assertSame(imgdata1.data[0], 0, "imgdata1.data[\""+(0)+"\"]", "0");
+_assertSame(imgdata1.data[1], 0, "imgdata1.data[\""+(1)+"\"]", "0");
+_assertSame(imgdata1.data[2], 0, "imgdata1.data[\""+(2)+"\"]", "0");
+var imgdata2 = ctx.getImageData(30, 15, 1, 1);
+_assertSame(imgdata2.data[0], 255, "imgdata2.data[\""+(0)+"\"]", "255");
+_assertSame(imgdata2.data[1], 255, "imgdata2.data[\""+(1)+"\"]", "255");
+_assertSame(imgdata2.data[2], 255, "imgdata2.data[\""+(2)+"\"]", "255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.length.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.length.html
new file mode 100644
index 0000000..3f3ef7d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.length.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.length</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.clamp.html" title="2d.imageData.get.clamp">
+<link rel="next" href="2d.imageData.get.order.cols.html" title="2d.imageData.get.order.cols">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.clamp.html" accesskey="p" title="[p] 2d.imageData.get.clamp"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.order.cols.html" accesskey="n" title="[n] 2d.imageData.get.order.cols">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.length</h1>
+<p class="desc">getImageData() returns a correctly-sized CanvasPixelArray</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pixelarray.length">2d.pixelarray.length</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = ctx.getImageData(0, 0, 10, 10);
+_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.nonfinite.html
new file mode 100644
index 0000000..6baca97
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.nonfinite.html
@@ -0,0 +1,101 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.zero.html" title="2d.imageData.get.zero">
+<link rel="next" href="2d.imageData.get.source.outside.html" title="2d.imageData.get.source.outside">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.zero.html" accesskey="p" title="[p] 2d.imageData.get.zero"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.source.outside.html" accesskey="n" title="[n] 2d.imageData.get.source.outside">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.nonfinite</h1>
+<p class="desc">getImageData() throws NOT_SUPPORTED_ERR if arguments are not finite</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.getcreate.nonfinite">2d.imageData.getcreate.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.getImageData(Infinity, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.getImageData(-Infinity, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(-Infinity, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.getImageData(NaN, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(NaN, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.getImageData(10, Infinity, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, 10, 10)"); }
+try { var _thrown = false;
+ ctx.getImageData(10, -Infinity, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, -Infinity, 10, 10)"); }
+try { var _thrown = false;
+ ctx.getImageData(10, NaN, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, NaN, 10, 10)"); }
+try { var _thrown = false;
+ ctx.getImageData(10, 10, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.getImageData(10, 10, -Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, -Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.getImageData(10, 10, NaN, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, NaN, 10)"); }
+try { var _thrown = false;
+ ctx.getImageData(10, 10, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.getImageData(10, 10, 10, -Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, 10, -Infinity)"); }
+try { var _thrown = false;
+ ctx.getImageData(10, 10, 10, NaN);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, 10, NaN)"); }
+try { var _thrown = false;
+ ctx.getImageData(Infinity, Infinity, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, 10, 10)"); }
+try { var _thrown = false;
+ ctx.getImageData(Infinity, Infinity, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.getImageData(Infinity, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.getImageData(Infinity, Infinity, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, Infinity, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.getImageData(Infinity, 10, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.getImageData(Infinity, 10, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.getImageData(Infinity, 10, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(Infinity, 10, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.getImageData(10, Infinity, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.getImageData(10, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.getImageData(10, Infinity, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, Infinity, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.getImageData(10, 10, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(10, 10, Infinity, Infinity)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.nonpremul.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.nonpremul.html
new file mode 100644
index 0000000..f2f5a11
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.nonpremul.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.nonpremul</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.tiny.html" title="2d.imageData.get.tiny">
+<link rel="next" href="2d.imageData.get.range.html" title="2d.imageData.get.range">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.tiny.html" accesskey="p" title="[p] 2d.imageData.get.tiny"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.range.html" accesskey="n" title="[n] 2d.imageData.get.range">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.nonpremul</h1>
+<p class="desc">getImageData() returns non-premultiplied colours</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.get.premul">2d.imageData.get.premul</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = 'rgba(255, 255, 255, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+var imgdata = ctx.getImageData(10, 10, 10, 10);
+_assert(imgdata.data[0] > 200, "imgdata.data[\""+(0)+"\"] > 200");
+_assert(imgdata.data[1] > 200, "imgdata.data[\""+(1)+"\"] > 200");
+_assert(imgdata.data[2] > 200, "imgdata.data[\""+(2)+"\"] > 200");
+_assert(imgdata.data[3] > 100, "imgdata.data[\""+(3)+"\"] > 100");
+_assert(imgdata.data[3] < 200, "imgdata.data[\""+(3)+"\"] < 200");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.order.alpha.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.order.alpha.html
new file mode 100644
index 0000000..3c09dd8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.order.alpha.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.order.alpha</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.order.rgb.html" title="2d.imageData.get.order.rgb">
+<link rel="next" href="2d.imageData.get.unaffected.html" title="2d.imageData.get.unaffected">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.order.rgb.html" accesskey="p" title="[p] 2d.imageData.get.order.rgb"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.unaffected.html" accesskey="n" title="[n] 2d.imageData.get.unaffected">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.<a href="index.2d.imageData.get.order.html">order</a>.alpha</h1>
+<p class="desc">getImageData() returns A in the fourth component</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pixelarray.order">2d.pixelarray.order</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = 'rgba(0, 0, 0, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+var imgdata = ctx.getImageData(0, 0, 10, 10);
+_assert(imgdata.data[3] < 200, "imgdata.data[\""+(3)+"\"] < 200");
+_assert(imgdata.data[3] > 100, "imgdata.data[\""+(3)+"\"] > 100");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.order.cols.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.order.cols.html
new file mode 100644
index 0000000..87ab6a6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.order.cols.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.order.cols</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.length.html" title="2d.imageData.get.length">
+<link rel="next" href="2d.imageData.get.order.rows.html" title="2d.imageData.get.order.rows">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.length.html" accesskey="p" title="[p] 2d.imageData.get.length"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.order.rows.html" accesskey="n" title="[n] 2d.imageData.get.order.rows">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.<a href="index.2d.imageData.get.order.html">order</a>.cols</h1>
+<p class="desc">getImageData() returns leftmost columns first</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pixelarray.order">2d.pixelarray.order</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#fff';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#000';
+ctx.fillRect(0, 0, 2, 50);
+var imgdata = ctx.getImageData(0, 0, 10, 10);
+_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0");
+_assertSame(imgdata.data[Math.round(imgdata.width/2*4)], 255, "imgdata.data[Math.round(imgdata.width/2*4)]", "255");
+_assertSame(imgdata.data[Math.round((imgdata.height/2)*imgdata.width*4)], 0, "imgdata.data[Math.round((imgdata.height/2)*imgdata.width*4)]", "0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.order.rgb.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.order.rgb.html
new file mode 100644
index 0000000..caf6b67
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.order.rgb.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.order.rgb</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.order.rows.html" title="2d.imageData.get.order.rows">
+<link rel="next" href="2d.imageData.get.order.alpha.html" title="2d.imageData.get.order.alpha">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.order.rows.html" accesskey="p" title="[p] 2d.imageData.get.order.rows"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.order.alpha.html" accesskey="n" title="[n] 2d.imageData.get.order.alpha">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.<a href="index.2d.imageData.get.order.html">order</a>.rgb</h1>
+<p class="desc">getImageData() returns R then G then B</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pixelarray.order">2d.pixelarray.order</a>
+<li><a href="spec.html#testrefs.2d.pixelarray.indexes">2d.pixelarray.indexes</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#48c';
+ctx.fillRect(0, 0, 100, 50);
+var imgdata = ctx.getImageData(0, 0, 10, 10);
+_assertSame(imgdata.data[0], 0x44, "imgdata.data[\""+(0)+"\"]", "0x44");
+_assertSame(imgdata.data[1], 0x88, "imgdata.data[\""+(1)+"\"]", "0x88");
+_assertSame(imgdata.data[2], 0xCC, "imgdata.data[\""+(2)+"\"]", "0xCC");
+_assertSame(imgdata.data[3], 255, "imgdata.data[\""+(3)+"\"]", "255");
+_assertSame(imgdata.data[4], 0x44, "imgdata.data[\""+(4)+"\"]", "0x44");
+_assertSame(imgdata.data[5], 0x88, "imgdata.data[\""+(5)+"\"]", "0x88");
+_assertSame(imgdata.data[6], 0xCC, "imgdata.data[\""+(6)+"\"]", "0xCC");
+_assertSame(imgdata.data[7], 255, "imgdata.data[\""+(7)+"\"]", "255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.order.rows.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.order.rows.html
new file mode 100644
index 0000000..53e8e7b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.order.rows.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.order.rows</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.order.cols.html" title="2d.imageData.get.order.cols">
+<link rel="next" href="2d.imageData.get.order.rgb.html" title="2d.imageData.get.order.rgb">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.order.cols.html" accesskey="p" title="[p] 2d.imageData.get.order.cols"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.order.rgb.html" accesskey="n" title="[n] 2d.imageData.get.order.rgb">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.<a href="index.2d.imageData.get.order.html">order</a>.rows</h1>
+<p class="desc">getImageData() returns topmost rows first</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pixelarray.order">2d.pixelarray.order</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#fff';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#000';
+ctx.fillRect(0, 0, 100, 2);
+var imgdata = ctx.getImageData(0, 0, 10, 10);
+_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0");
+_assertSame(imgdata.data[Math.floor(imgdata.width/2*4)], 0, "imgdata.data[Math.floor(imgdata.width/2*4)]", "0");
+_assertSame(imgdata.data[(imgdata.height/2)*imgdata.width*4], 255, "imgdata.data[(imgdata.height/2)*imgdata.width*4]", "255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.range.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.range.html
new file mode 100644
index 0000000..c9cc64d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.range.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.range</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.nonpremul.html" title="2d.imageData.get.nonpremul">
+<link rel="next" href="2d.imageData.get.clamp.html" title="2d.imageData.get.clamp">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.nonpremul.html" accesskey="p" title="[p] 2d.imageData.get.nonpremul"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.clamp.html" accesskey="n" title="[n] 2d.imageData.get.clamp">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.range</h1>
+<p class="desc">getImageData() returns values in the range [0, 255]</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pixelarray.range">2d.pixelarray.range</a>
+<li><a href="spec.html#testrefs.2d.pixelarray.retrieve">2d.pixelarray.retrieve</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#000';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#fff';
+ctx.fillRect(20, 10, 60, 10);
+var imgdata1 = ctx.getImageData(10, 5, 1, 1);
+_assertSame(imgdata1.data[0], 0, "imgdata1.data[\""+(0)+"\"]", "0");
+var imgdata2 = ctx.getImageData(30, 15, 1, 1);
+_assertSame(imgdata2.data[0], 255, "imgdata2.data[\""+(0)+"\"]", "255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.source.negative.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.source.negative.html
new file mode 100644
index 0000000..bc9a969
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.source.negative.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.source.negative</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.source.outside.html" title="2d.imageData.get.source.outside">
+<link rel="next" href="2d.imageData.get.source.size.html" title="2d.imageData.get.source.size">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.source.outside.html" accesskey="p" title="[p] 2d.imageData.get.source.outside"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.source.size.html" accesskey="n" title="[n] 2d.imageData.get.source.size">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.<a href="index.2d.imageData.get.source.html">source</a>.negative</h1>
+<p class="desc">getImageData() works with negative width and height, and returns top-to-bottom left-to-right</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.get.basic">2d.imageData.get.basic</a>
+<li><a href="spec.html#testrefs.2d.pixelarray.order">2d.pixelarray.order</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#000';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#fff';
+ctx.fillRect(20, 10, 60, 10);
+
+var imgdata1 = ctx.getImageData(85, 25, -10, -10);
+_assertSame(imgdata1.data[0], 255, "imgdata1.data[\""+(0)+"\"]", "255");
+_assertSame(imgdata1.data[1], 255, "imgdata1.data[\""+(1)+"\"]", "255");
+_assertSame(imgdata1.data[2], 255, "imgdata1.data[\""+(2)+"\"]", "255");
+_assertSame(imgdata1.data[3], 255, "imgdata1.data[\""+(3)+"\"]", "255");
+_assertSame(imgdata1.data[imgdata1.data.length-4+0], 0, "imgdata1.data[imgdata1.data.length-4+0]", "0");
+_assertSame(imgdata1.data[imgdata1.data.length-4+1], 0, "imgdata1.data[imgdata1.data.length-4+1]", "0");
+_assertSame(imgdata1.data[imgdata1.data.length-4+2], 0, "imgdata1.data[imgdata1.data.length-4+2]", "0");
+_assertSame(imgdata1.data[imgdata1.data.length-4+3], 255, "imgdata1.data[imgdata1.data.length-4+3]", "255");
+
+var imgdata2 = ctx.getImageData(0, 0, -1, -1);
+_assertSame(imgdata2.data[0], 0, "imgdata2.data[\""+(0)+"\"]", "0");
+_assertSame(imgdata2.data[1], 0, "imgdata2.data[\""+(1)+"\"]", "0");
+_assertSame(imgdata2.data[2], 0, "imgdata2.data[\""+(2)+"\"]", "0");
+_assertSame(imgdata2.data[3], 0, "imgdata2.data[\""+(3)+"\"]", "0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.source.outside.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.source.outside.html
new file mode 100644
index 0000000..0202bf0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.source.outside.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.source.outside</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.nonfinite.html" title="2d.imageData.get.nonfinite">
+<link rel="next" href="2d.imageData.get.source.negative.html" title="2d.imageData.get.source.negative">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.nonfinite.html" accesskey="p" title="[p] 2d.imageData.get.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.source.negative.html" accesskey="n" title="[n] 2d.imageData.get.source.negative">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.<a href="index.2d.imageData.get.source.html">source</a>.outside</h1>
+<p class="desc">getImageData() returns transparent black outside the canvas</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.get.basic">2d.imageData.get.basic</a>
+<li><a href="spec.html#testrefs.2d.imageData.get.outside">2d.imageData.get.outside</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#08f';
+ctx.fillRect(0, 0, 100, 50);
+
+var imgdata1 = ctx.getImageData(-10, 5, 1, 1);
+_assertSame(imgdata1.data[0], 0, "imgdata1.data[\""+(0)+"\"]", "0");
+_assertSame(imgdata1.data[1], 0, "imgdata1.data[\""+(1)+"\"]", "0");
+_assertSame(imgdata1.data[2], 0, "imgdata1.data[\""+(2)+"\"]", "0");
+_assertSame(imgdata1.data[3], 0, "imgdata1.data[\""+(3)+"\"]", "0");
+
+var imgdata2 = ctx.getImageData(10, -5, 1, 1);
+_assertSame(imgdata2.data[0], 0, "imgdata2.data[\""+(0)+"\"]", "0");
+_assertSame(imgdata2.data[1], 0, "imgdata2.data[\""+(1)+"\"]", "0");
+_assertSame(imgdata2.data[2], 0, "imgdata2.data[\""+(2)+"\"]", "0");
+_assertSame(imgdata2.data[3], 0, "imgdata2.data[\""+(3)+"\"]", "0");
+
+var imgdata3 = ctx.getImageData(200, 5, 1, 1);
+_assertSame(imgdata3.data[0], 0, "imgdata3.data[\""+(0)+"\"]", "0");
+_assertSame(imgdata3.data[1], 0, "imgdata3.data[\""+(1)+"\"]", "0");
+_assertSame(imgdata3.data[2], 0, "imgdata3.data[\""+(2)+"\"]", "0");
+_assertSame(imgdata3.data[3], 0, "imgdata3.data[\""+(3)+"\"]", "0");
+
+var imgdata4 = ctx.getImageData(10, 60, 1, 1);
+_assertSame(imgdata4.data[0], 0, "imgdata4.data[\""+(0)+"\"]", "0");
+_assertSame(imgdata4.data[1], 0, "imgdata4.data[\""+(1)+"\"]", "0");
+_assertSame(imgdata4.data[2], 0, "imgdata4.data[\""+(2)+"\"]", "0");
+_assertSame(imgdata4.data[3], 0, "imgdata4.data[\""+(3)+"\"]", "0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.source.size.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.source.size.html
new file mode 100644
index 0000000..dbcaf71
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.source.size.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.source.size</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.source.negative.html" title="2d.imageData.get.source.negative">
+<link rel="next" href="2d.imageData.get.tiny.html" title="2d.imageData.get.tiny">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.source.negative.html" accesskey="p" title="[p] 2d.imageData.get.source.negative"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.tiny.html" accesskey="n" title="[n] 2d.imageData.get.tiny">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.<a href="index.2d.imageData.get.source.html">source</a>.size</h1>
+<p class="desc">getImageData() returns bigger ImageData for bigger source rectangle</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.get.basic">2d.imageData.get.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata1 = ctx.getImageData(0, 0, 10, 10);
+var imgdata2 = ctx.getImageData(0, 0, 20, 20);
+_assert(imgdata2.width > imgdata1.width, "imgdata2.width > imgdata1.width");
+_assert(imgdata2.height > imgdata1.height, "imgdata2.height > imgdata1.height");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.tiny.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.tiny.html
new file mode 100644
index 0000000..0c3450a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.tiny.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.tiny</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.source.size.html" title="2d.imageData.get.source.size">
+<link rel="next" href="2d.imageData.get.nonpremul.html" title="2d.imageData.get.nonpremul">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.source.size.html" accesskey="p" title="[p] 2d.imageData.get.source.size"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.nonpremul.html" accesskey="n" title="[n] 2d.imageData.get.nonpremul">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.tiny</h1>
+<p class="desc">getImageData() works for sizes smaller than one pixel</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.one">2d.imageData.one</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = ctx.getImageData(0, 0, 0.0001, 0.0001);
+_assertEqual(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4");
+_assertEqual(imgdata.width, 1, "imgdata.width", "1");
+_assertEqual(imgdata.height, 1, "imgdata.height", "1");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.type.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.type.html
new file mode 100644
index 0000000..34af99f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.type.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.type</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.basic.html" title="2d.imageData.get.basic">
+<link rel="next" href="2d.imageData.get.zero.html" title="2d.imageData.get.zero">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.basic.html" accesskey="p" title="[p] 2d.imageData.get.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.zero.html" accesskey="n" title="[n] 2d.imageData.get.zero">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.type</h1>
+<p class="desc">getImageData() returns an ImageData object containing a CanvasPixelArray object</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.get.object">2d.imageData.get.object</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined");
+_assertDifferent(window.CanvasPixelArray, undefined, "window.CanvasPixelArray", "undefined");
+window.ImageData.prototype.thisImplementsImageData = true;
+window.CanvasPixelArray.prototype.thisImplementsCanvasPixelArray = true;
+var imgdata = ctx.getImageData(0, 0, 1, 1);
+_assert(imgdata.thisImplementsImageData, "imgdata.thisImplementsImageData");
+_assert(imgdata.data.thisImplementsCanvasPixelArray, "imgdata.data.thisImplementsCanvasPixelArray");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.unaffected.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.unaffected.html
new file mode 100644
index 0000000..cc9726a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.unaffected.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.unaffected</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.order.alpha.html" title="2d.imageData.get.order.alpha">
+<link rel="next" href="2d.imageData.object.properties.html" title="2d.imageData.object.properties">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.order.alpha.html" accesskey="p" title="[p] 2d.imageData.get.order.alpha"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.object.properties.html" accesskey="n" title="[n] 2d.imageData.object.properties">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.unaffected</h1>
+<p class="desc">getImageData() is not affected by context state</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.unaffected">2d.imageData.unaffected</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 50, 50)
+ctx.fillStyle = '#f00';
+ctx.fillRect(50, 0, 50, 50)
+ctx.save();
+ctx.translate(50, 0);
+ctx.globalAlpha = 0.1;
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.shadowColor = '#f00';
+ctx.rect(0, 0, 5, 5);
+ctx.clip();
+var imgdata = ctx.getImageData(0, 0, 50, 50);
+ctx.restore();
+ctx.putImageData(imgdata, 50, 0);
+_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.zero.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.zero.html
new file mode 100644
index 0000000..a04f04e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.get.zero.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.get.zero</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.type.html" title="2d.imageData.get.type">
+<link rel="next" href="2d.imageData.get.nonfinite.html" title="2d.imageData.get.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.type.html" accesskey="p" title="[p] 2d.imageData.get.type"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.get.nonfinite.html" accesskey="n" title="[n] 2d.imageData.get.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.get.html">get</a>.zero</h1>
+<p class="desc">getImageData() throws INDEX_SIZE_ERR if size is zero</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.getcreate.zero">2d.imageData.getcreate.zero</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.getImageData(1, 1, 10, 0);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 10, 0)"); }
+try { var _thrown = false;
+ ctx.getImageData(1, 1, 0, 10);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 0, 10)"); }
+try { var _thrown = false;
+ ctx.getImageData(1, 1, 0, 0);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.getImageData(1, 1, 0, 0)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.ctor.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.ctor.html
new file mode 100644
index 0000000..193e3a6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.ctor.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.object.ctor</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.object.readonly.html" title="2d.imageData.object.readonly">
+<link rel="next" href="2d.imageData.object.set.html" title="2d.imageData.object.set">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.object.readonly.html" accesskey="p" title="[p] 2d.imageData.object.readonly"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.object.set.html" accesskey="n" title="[n] 2d.imageData.object.set">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.object.html">object</a>.ctor</h1>
+<p class="desc">ImageData does not have a usable constructor</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.type">2d.imageData.type</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertDifferent(window.ImageData, undefined, "window.ImageData", "undefined");
+try { var _thrown = false; new window.ImageData(1,1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: new window.ImageData(1,1)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.nan.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.nan.html
new file mode 100644
index 0000000..1223764
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.nan.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.object.nan</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.object.undefined.html" title="2d.imageData.object.undefined">
+<link rel="next" href="2d.imageData.object.string.html" title="2d.imageData.object.string">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.object.undefined.html" accesskey="p" title="[p] 2d.imageData.object.undefined"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.object.string.html" accesskey="n" title="[n] 2d.imageData.object.string">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.object.html">object</a>.nan</h1>
+<p class="desc">ImageData.data converts NaN to 0</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pixelarray.modify">2d.pixelarray.modify</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = ctx.getImageData(0, 0, 10, 10);
+imgdata.data[0] = 100;
+imgdata.data[0] = NaN;
+_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0");
+imgdata.data[0] = 100;
+imgdata.data[0] = "cheese";
+_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.properties.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.properties.html
new file mode 100644
index 0000000..eaaeafd
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.properties.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.object.properties</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.get.unaffected.html" title="2d.imageData.get.unaffected">
+<link rel="next" href="2d.imageData.object.readonly.html" title="2d.imageData.object.readonly">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.get.unaffected.html" accesskey="p" title="[p] 2d.imageData.get.unaffected"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.object.readonly.html" accesskey="n" title="[n] 2d.imageData.object.readonly">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.object.html">object</a>.properties</h1>
+<p class="desc">ImageData objects have the right properties</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.type">2d.imageData.type</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = ctx.getImageData(0, 0, 10, 10);
+_assertEqual(typeof(imgdata.width), 'number', "typeof(imgdata.width)", "'number'");
+_assertEqual(typeof(imgdata.height), 'number', "typeof(imgdata.height)", "'number'");
+_assertEqual(typeof(imgdata.data), 'object', "typeof(imgdata.data)", "'object'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.readonly.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.readonly.html
new file mode 100644
index 0000000..b2da096
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.readonly.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.object.readonly</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.object.properties.html" title="2d.imageData.object.properties">
+<link rel="next" href="2d.imageData.object.ctor.html" title="2d.imageData.object.ctor">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.object.properties.html" accesskey="p" title="[p] 2d.imageData.object.properties"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.object.ctor.html" accesskey="n" title="[n] 2d.imageData.object.ctor">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.object.html">object</a>.readonly</h1>
+<p class="desc">ImageData objects properties are read-only</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.type">2d.imageData.type</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = ctx.getImageData(0, 0, 10, 10);
+var w = imgdata.width;
+var h = imgdata.height;
+var d = imgdata.data;
+imgdata.width = 123;
+imgdata.height = 123;
+imgdata.data = [100,100,100,100];
+_assertSame(imgdata.width, w, "imgdata.width", "w");
+_assertSame(imgdata.height, h, "imgdata.height", "h");
+_assertSame(imgdata.data, d, "imgdata.data", "d");
+_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0");
+_assertSame(imgdata.data[1], 0, "imgdata.data[\""+(1)+"\"]", "0");
+_assertSame(imgdata.data[2], 0, "imgdata.data[\""+(2)+"\"]", "0");
+_assertSame(imgdata.data[3], 0, "imgdata.data[\""+(3)+"\"]", "0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.round.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.round.html
new file mode 100644
index 0000000..5317574
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.round.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.object.round</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.object.wrap.html" title="2d.imageData.object.wrap">
+<link rel="next" href="2d.imageData.put.null.html" title="2d.imageData.put.null">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.object.wrap.html" accesskey="p" title="[p] 2d.imageData.object.wrap"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.null.html" accesskey="n" title="[n] 2d.imageData.put.null">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.object.html">object</a>.round</h1>
+<p class="desc">ImageData.data rounds numbers with round-to-zero</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pixelarray.modify">2d.pixelarray.modify</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = ctx.getImageData(0, 0, 10, 10);
+imgdata.data[0] = 0.499;
+_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0");
+imgdata.data[0] = 0.5;
+_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0");
+imgdata.data[0] = 0.501;
+_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0");
+imgdata.data[0] = 1.499;
+_assertSame(imgdata.data[0], 1, "imgdata.data[\""+(0)+"\"]", "1");
+imgdata.data[0] = 1.5;
+_assertSame(imgdata.data[0], 2, "imgdata.data[\""+(0)+"\"]", "2");
+imgdata.data[0] = 1.501;
+_assertSame(imgdata.data[0], 2, "imgdata.data[\""+(0)+"\"]", "2");
+imgdata.data[0] = 2.5;
+_assertSame(imgdata.data[0], 2, "imgdata.data[\""+(0)+"\"]", "2");
+imgdata.data[0] = 3.5;
+_assertSame(imgdata.data[0], 4, "imgdata.data[\""+(0)+"\"]", "4");
+imgdata.data[0] = 252.5;
+_assertSame(imgdata.data[0], 252, "imgdata.data[\""+(0)+"\"]", "252");
+imgdata.data[0] = 253.5;
+_assertSame(imgdata.data[0], 253, "imgdata.data[\""+(0)+"\"]", "253");
+imgdata.data[0] = 254.5;
+_assertSame(imgdata.data[0], 254, "imgdata.data[\""+(0)+"\"]", "254");
+imgdata.data[0] = 256.5;
+_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0");
+imgdata.data[0] = -0.5;
+_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0");
+imgdata.data[0] = -1.5;
+_assertSame(imgdata.data[0], 255, "imgdata.data[\""+(0)+"\"]", "255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.set.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.set.html
new file mode 100644
index 0000000..ec12183
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.set.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.object.set</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.object.ctor.html" title="2d.imageData.object.ctor">
+<link rel="next" href="2d.imageData.object.undefined.html" title="2d.imageData.object.undefined">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.object.ctor.html" accesskey="p" title="[p] 2d.imageData.object.ctor"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.object.undefined.html" accesskey="n" title="[n] 2d.imageData.object.undefined">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.object.html">object</a>.set</h1>
+<p class="desc">ImageData.data can be modified</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pixelarray.modify">2d.pixelarray.modify</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = ctx.getImageData(0, 0, 10, 10);
+imgdata.data[0] = 100;
+_assertSame(imgdata.data[0], 100, "imgdata.data[\""+(0)+"\"]", "100");
+imgdata.data[0] = 200;
+_assertSame(imgdata.data[0], 200, "imgdata.data[\""+(0)+"\"]", "200");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.string.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.string.html
new file mode 100644
index 0000000..2fbcac0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.string.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.object.string</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.object.nan.html" title="2d.imageData.object.nan">
+<link rel="next" href="2d.imageData.object.wrap.html" title="2d.imageData.object.wrap">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.object.nan.html" accesskey="p" title="[p] 2d.imageData.object.nan"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.object.wrap.html" accesskey="n" title="[n] 2d.imageData.object.wrap">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.object.html">object</a>.string</h1>
+<p class="desc">ImageData.data converts strings to numbers with ToNumber</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pixelarray.modify">2d.pixelarray.modify</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = ctx.getImageData(0, 0, 10, 10);
+imgdata.data[0] = 100;
+imgdata.data[0] = "110";
+_assertSame(imgdata.data[0], 110, "imgdata.data[\""+(0)+"\"]", "110");
+imgdata.data[0] = 100;
+imgdata.data[0] = "0x78";
+_assertSame(imgdata.data[0], 120, "imgdata.data[\""+(0)+"\"]", "120");
+imgdata.data[0] = 100;
+imgdata.data[0] = " +130e0 ";
+_assertSame(imgdata.data[0], 130, "imgdata.data[\""+(0)+"\"]", "130");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.undefined.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.undefined.html
new file mode 100644
index 0000000..c859c64
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.undefined.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.object.undefined</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.object.set.html" title="2d.imageData.object.set">
+<link rel="next" href="2d.imageData.object.nan.html" title="2d.imageData.object.nan">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.object.set.html" accesskey="p" title="[p] 2d.imageData.object.set"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.object.nan.html" accesskey="n" title="[n] 2d.imageData.object.nan">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.object.html">object</a>.undefined</h1>
+<p class="desc">ImageData.data converts undefined to 0</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pixelarray.modify">2d.pixelarray.modify</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = ctx.getImageData(0, 0, 10, 10);
+imgdata.data[0] = 100;
+imgdata.data[0] = undefined;
+_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.wrap.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.wrap.html
new file mode 100644
index 0000000..d9542e2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.object.wrap.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.object.wrap</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.object.string.html" title="2d.imageData.object.string">
+<link rel="next" href="2d.imageData.object.round.html" title="2d.imageData.object.round">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.object.string.html" accesskey="p" title="[p] 2d.imageData.object.string"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.object.round.html" accesskey="n" title="[n] 2d.imageData.object.round">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.object.html">object</a>.wrap</h1>
+<p class="desc">ImageData.data wraps numbers modulo 256</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pixelarray.modify">2d.pixelarray.modify</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = ctx.getImageData(0, 0, 10, 10);
+
+imgdata.data[0] = 0;
+_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0");
+imgdata.data[0] = 300;
+_assertSame(imgdata.data[0], 44, "imgdata.data[\""+(0)+"\"]", "44");
+imgdata.data[0] = -100;
+_assertSame(imgdata.data[0], 156, "imgdata.data[\""+(0)+"\"]", "156");
+
+imgdata.data[0] = 200+Math.pow(2, 32);
+_assertSame(imgdata.data[0], 200, "imgdata.data[\""+(0)+"\"]", "200");
+imgdata.data[0] = -200-Math.pow(2, 32);
+_assertSame(imgdata.data[0], 56, "imgdata.data[\""+(0)+"\"]", "56");
+
+imgdata.data[0] = -Infinity;
+_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0");
+imgdata.data[0] = Infinity;
+_assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.alpha.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.alpha.html
new file mode 100644
index 0000000..436505f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.alpha.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.alpha</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.cross.html" title="2d.imageData.put.cross">
+<link rel="next" href="2d.imageData.put.modified.html" title="2d.imageData.put.modified">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.cross.html" accesskey="p" title="[p] 2d.imageData.put.cross"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.modified.html" accesskey="n" title="[n] 2d.imageData.put.modified">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.alpha</h1>
+<p class="desc">putImageData() puts non-solid image data correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.put.normal">2d.imageData.put.normal</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.imageData.put.alpha.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.25)';
+ctx.fillRect(0, 0, 100, 50)
+var imgdata = ctx.getImageData(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50)
+ctx.putImageData(imgdata, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,0,64, "50,25", "0,255,0,64", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.alpha.png b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.alpha.png
new file mode 100644
index 0000000..5428c65
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.alpha.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.basic.html
new file mode 100644
index 0000000..3b8b4bf
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.basic.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.nonfinite.html" title="2d.imageData.put.nonfinite">
+<link rel="next" href="2d.imageData.put.created.html" title="2d.imageData.put.created">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.nonfinite.html" accesskey="p" title="[p] 2d.imageData.put.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.created.html" accesskey="n" title="[n] 2d.imageData.put.created">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.basic</h1>
+<p class="desc">putImageData() puts image data from getImageData() onto the canvas</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.put.normal">2d.imageData.put.normal</a>
+<li><a href="spec.html#testrefs.2d.imageData.put.3arg">2d.imageData.put.3arg</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50)
+var imgdata = ctx.getImageData(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50)
+ctx.putImageData(imgdata, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.clip.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.clip.html
new file mode 100644
index 0000000..0fefaa3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.clip.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.clip</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.unaffected.html" title="2d.imageData.put.unaffected">
+<link rel="next" href="2d.imageData.put.path.html" title="2d.imageData.put.path">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.unaffected.html" accesskey="p" title="[p] 2d.imageData.put.unaffected"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.path.html" accesskey="n" title="[n] 2d.imageData.put.path">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.clip</h1>
+<p class="desc">putImageData() is not affected by clipping regions</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.unaffected">2d.imageData.unaffected</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433397">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50)
+var imgdata = ctx.getImageData(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50)
+ctx.beginPath();
+ctx.rect(0, 0, 50, 50);
+ctx.clip();
+ctx.putImageData(imgdata, 0, 0);
+_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.created.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.created.html
new file mode 100644
index 0000000..9b4a118
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.created.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.created</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.basic.html" title="2d.imageData.put.basic">
+<link rel="next" href="2d.imageData.put.wrongtype.html" title="2d.imageData.put.wrongtype">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.basic.html" accesskey="p" title="[p] 2d.imageData.put.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.wrongtype.html" accesskey="n" title="[n] 2d.imageData.put.wrongtype">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.created</h1>
+<p class="desc">putImageData() puts image data from createImageData() onto the canvas</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.put.normal">2d.imageData.put.normal</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=433004">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = ctx.createImageData(100, 50);
+for (var i = 0; i < imgdata.data.length; i += 4) {
+ imgdata.data[i] = 0;
+ imgdata.data[i+1] = 255;
+ imgdata.data[i+2] = 0;
+ imgdata.data[i+3] = 255;
+}
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50)
+ctx.putImageData(imgdata, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.cross.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.cross.html
new file mode 100644
index 0000000..4d5e67c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.cross.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.cross</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.wrongtype.html" title="2d.imageData.put.wrongtype">
+<link rel="next" href="2d.imageData.put.alpha.html" title="2d.imageData.put.alpha">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.wrongtype.html" accesskey="p" title="[p] 2d.imageData.put.wrongtype"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.alpha.html" accesskey="n" title="[n] 2d.imageData.put.alpha">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.cross</h1>
+<p class="desc">putImageData() accepts image data got from a different canvas</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.put.normal">2d.imageData.put.normal</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+var ctx2 = canvas2.getContext('2d');
+ctx2.fillStyle = '#0f0';
+ctx2.fillRect(0, 0, 100, 50)
+var imgdata = ctx2.getImageData(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50)
+ctx.putImageData(imgdata, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.dirty.negative.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.dirty.negative.html
new file mode 100644
index 0000000..1ff40ef
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.dirty.negative.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.dirty.negative</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.dirty.rect2.html" title="2d.imageData.put.dirty.rect2">
+<link rel="next" href="2d.imageData.put.dirty.outside.html" title="2d.imageData.put.dirty.outside">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.dirty.rect2.html" accesskey="p" title="[p] 2d.imageData.put.dirty.rect2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.dirty.outside.html" accesskey="n" title="[n] 2d.imageData.put.dirty.outside">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.<a href="index.2d.imageData.put.dirty.html">dirty</a>.negative</h1>
+<p class="desc">putImageData() handles negative-sized dirty rectangles correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.put.normal">2d.imageData.put.normal</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50)
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 20, 20)
+
+var imgdata = ctx.getImageData(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50)
+ctx.fillStyle = '#f00';
+ctx.fillRect(40, 20, 20, 20)
+ctx.putImageData(imgdata, 40, 20, 20, 20, -20, -20);
+
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 50,15, 0,255,0,255, "50,15", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.dirty.outside.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.dirty.outside.html
new file mode 100644
index 0000000..41c92fe
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.dirty.outside.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.dirty.outside</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.dirty.negative.html" title="2d.imageData.put.dirty.negative">
+<link rel="next" href="2d.imageData.put.unchanged.html" title="2d.imageData.put.unchanged">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.dirty.negative.html" accesskey="p" title="[p] 2d.imageData.put.dirty.negative"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.unchanged.html" accesskey="n" title="[n] 2d.imageData.put.unchanged">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.<a href="index.2d.imageData.put.dirty.html">dirty</a>.outside</h1>
+<p class="desc">putImageData() handles dirty rectangles outside the canvas correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.put.normal">2d.imageData.put.normal</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50)
+
+var imgdata = ctx.getImageData(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50)
+
+ctx.putImageData(imgdata, 100, 20, 20, 20, -20, -20);
+ctx.putImageData(imgdata, 200, 200, 0, 0, 100, 50);
+ctx.putImageData(imgdata, 40, 20, -30, -20, 30, 20);
+ctx.putImageData(imgdata, -30, 20, 0, 0, 30, 20);
+
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 98,15, 0,255,0,255, "98,15", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 98,45, 0,255,0,255, "98,45", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 1,5, 0,255,0,255, "1,5", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 1,45, 0,255,0,255, "1,45", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.dirty.rect1.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.dirty.rect1.html
new file mode 100644
index 0000000..de71b53
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.dirty.rect1.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.dirty.rect1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.dirty.zero.html" title="2d.imageData.put.dirty.zero">
+<link rel="next" href="2d.imageData.put.dirty.rect2.html" title="2d.imageData.put.dirty.rect2">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.dirty.zero.html" accesskey="p" title="[p] 2d.imageData.put.dirty.zero"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.dirty.rect2.html" accesskey="n" title="[n] 2d.imageData.put.dirty.rect2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.<a href="index.2d.imageData.put.dirty.html">dirty</a>.rect1</h1>
+<p class="desc">putImageData() only modifies areas inside the dirty rectangle, using width and height</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.put.normal">2d.imageData.put.normal</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50)
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 20, 20)
+
+var imgdata = ctx.getImageData(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50)
+ctx.fillStyle = '#f00';
+ctx.fillRect(40, 20, 20, 20)
+ctx.putImageData(imgdata, 40, 20, 0, 0, 20, 20);
+
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 50,15, 0,255,0,255, "50,15", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.dirty.rect2.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.dirty.rect2.html
new file mode 100644
index 0000000..1b5e045
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.dirty.rect2.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.dirty.rect2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.dirty.rect1.html" title="2d.imageData.put.dirty.rect1">
+<link rel="next" href="2d.imageData.put.dirty.negative.html" title="2d.imageData.put.dirty.negative">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.dirty.rect1.html" accesskey="p" title="[p] 2d.imageData.put.dirty.rect1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.dirty.negative.html" accesskey="n" title="[n] 2d.imageData.put.dirty.negative">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.<a href="index.2d.imageData.put.dirty.html">dirty</a>.rect2</h1>
+<p class="desc">putImageData() only modifies areas inside the dirty rectangle, using x and y</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.put.normal">2d.imageData.put.normal</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50)
+ctx.fillStyle = '#0f0';
+ctx.fillRect(60, 30, 20, 20)
+
+var imgdata = ctx.getImageData(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50)
+ctx.fillStyle = '#f00';
+ctx.fillRect(40, 20, 20, 20)
+ctx.putImageData(imgdata, -20, -10, 60, 30, 20, 20);
+
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 50,15, 0,255,0,255, "50,15", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.dirty.zero.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.dirty.zero.html
new file mode 100644
index 0000000..9cf5b58
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.dirty.zero.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.dirty.zero</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.modified.html" title="2d.imageData.put.modified">
+<link rel="next" href="2d.imageData.put.dirty.rect1.html" title="2d.imageData.put.dirty.rect1">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.modified.html" accesskey="p" title="[p] 2d.imageData.put.modified"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.dirty.rect1.html" accesskey="n" title="[n] 2d.imageData.put.dirty.rect1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.<a href="index.2d.imageData.put.dirty.html">dirty</a>.zero</h1>
+<p class="desc">putImageData() with zero-sized dirty rectangle puts nothing</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.put.normal">2d.imageData.put.normal</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50)
+var imgdata = ctx.getImageData(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50)
+ctx.putImageData(imgdata, 0, 0, 0, 0, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.modified.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.modified.html
new file mode 100644
index 0000000..bb1bf5a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.modified.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.modified</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.alpha.html" title="2d.imageData.put.alpha">
+<link rel="next" href="2d.imageData.put.dirty.zero.html" title="2d.imageData.put.dirty.zero">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.alpha.html" accesskey="p" title="[p] 2d.imageData.put.alpha"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.dirty.zero.html" accesskey="n" title="[n] 2d.imageData.put.dirty.zero">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.modified</h1>
+<p class="desc">putImageData() puts modified image data correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.put.normal">2d.imageData.put.normal</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50)
+ctx.fillStyle = '#f00';
+ctx.fillRect(45, 20, 10, 10)
+var imgdata = ctx.getImageData(45, 20, 10, 10);
+for (var i = 0, len = imgdata.width*imgdata.height*4; i < len; i += 4)
+{
+ imgdata.data[i] = 0;
+ imgdata.data[i+1] = 255;
+}
+ctx.putImageData(imgdata, 45, 20);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.nonfinite.html
new file mode 100644
index 0000000..8fd0594
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.nonfinite.html
@@ -0,0 +1,279 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.null.html" title="2d.imageData.put.null">
+<link rel="next" href="2d.imageData.put.basic.html" title="2d.imageData.put.basic">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.null.html" accesskey="p" title="[p] 2d.imageData.put.null"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.basic.html" accesskey="n" title="[n] 2d.imageData.put.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.nonfinite</h1>
+<p class="desc">putImageData() throws NOT_SUPPORTED_ERR if arguments are not finite</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.put.nonfinite">2d.imageData.put.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = ctx.getImageData(0, 0, 10, 10);
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, -Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, -Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, NaN, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, NaN, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, -Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, -Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, NaN);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, NaN)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, -Infinity, 10, 10, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, -Infinity, 10, 10, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, NaN, 10, 10, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, NaN, 10, 10, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, -Infinity, 10, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, -Infinity, 10, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, NaN, 10, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, NaN, 10, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, -Infinity, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, -Infinity, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, NaN, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, NaN, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, 10, -Infinity, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, -Infinity, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, 10, NaN, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, NaN, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, 10, 10, -Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, -Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, 10, 10, NaN, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, NaN, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, 10, 10, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, 10, 10, 10, -Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, -Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, 10, 10, 10, NaN);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, 10, NaN)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, 10);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, 10)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, Infinity)"); }
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, Infinity);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, Infinity)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.null.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.null.html
new file mode 100644
index 0000000..a0425b9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.null.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.null</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.object.round.html" title="2d.imageData.object.round">
+<link rel="next" href="2d.imageData.put.nonfinite.html" title="2d.imageData.put.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.object.round.html" accesskey="p" title="[p] 2d.imageData.object.round"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.nonfinite.html" accesskey="n" title="[n] 2d.imageData.put.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.null</h1>
+<p class="desc">putImageData() with null imagedata throws TYPE_MISMATCH_ERR</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.put.null">2d.imageData.put.null</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=421715">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.putImageData(null, 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.putImageData(null, 0, 0)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.path.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.path.html
new file mode 100644
index 0000000..529bb44
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.path.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.path</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.clip.html" title="2d.imageData.put.clip">
+<link rel="next" href="2d.text.font.parse.basic.html" title="2d.text.font.parse.basic">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.clip.html" accesskey="p" title="[p] 2d.imageData.put.clip"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.font.parse.basic.html" accesskey="n" title="[n] 2d.text.font.parse.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.path</h1>
+<p class="desc">putImageData() does not affect the current path</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.put.normal">2d.imageData.put.normal</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50)
+ctx.rect(0, 0, 100, 50);
+var imgdata = ctx.getImageData(0, 0, 100, 50);
+ctx.putImageData(imgdata, 0, 0);
+ctx.fillStyle = '#0f0';
+ctx.fill();
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.unaffected.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.unaffected.html
new file mode 100644
index 0000000..eecd977
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.unaffected.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.unaffected</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.unchanged.html" title="2d.imageData.put.unchanged">
+<link rel="next" href="2d.imageData.put.clip.html" title="2d.imageData.put.clip">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.unchanged.html" accesskey="p" title="[p] 2d.imageData.put.unchanged"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.clip.html" accesskey="n" title="[n] 2d.imageData.put.clip">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.unaffected</h1>
+<p class="desc">putImageData() is not affected by context state</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.unaffected">2d.imageData.unaffected</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50)
+var imgdata = ctx.getImageData(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50)
+ctx.globalAlpha = 0.1;
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.shadowColor = '#f00';
+ctx.shadowBlur = 1;
+ctx.translate(100, 50);
+ctx.scale(0.1, 0.1);
+ctx.putImageData(imgdata, 0, 0);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.unchanged.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.unchanged.html
new file mode 100644
index 0000000..217c065
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.unchanged.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.unchanged</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.dirty.outside.html" title="2d.imageData.put.dirty.outside">
+<link rel="next" href="2d.imageData.put.unaffected.html" title="2d.imageData.put.unaffected">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.dirty.outside.html" accesskey="p" title="[p] 2d.imageData.put.dirty.outside"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.unaffected.html" accesskey="n" title="[n] 2d.imageData.put.unaffected">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.unchanged</h1>
+<p class="desc">putImageData(getImageData(...), ...) has no effect</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.unchanged">2d.imageData.unchanged</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var i = 0;
+for (var y = 0; y < 16; ++y) {
+ for (var x = 0; x < 16; ++x, ++i) {
+ ctx.fillStyle = 'rgba(' + i + ',' + (Math.floor(i*1.5) % 256) + ',' + (Math.floor(i*23.3) % 256) + ',' + (i/256) + ')';
+ ctx.fillRect(x, y, 1, 1);
+ }
+}
+var imgdata1 = ctx.getImageData(0.1, 0.2, 15.8, 15.9);
+var olddata = [];
+for (var i = 0; i < imgdata1.data.length; ++i)
+ olddata[i] = imgdata1.data[i];
+
+ctx.putImageData(imgdata1, 0.1, 0.2);
+
+var imgdata2 = ctx.getImageData(0.1, 0.2, 15.8, 15.9);
+for (var i = 0; i < imgdata2.data.length; ++i) {
+ _assertSame(olddata[i], imgdata2.data[i], "olddata[\""+(i)+"\"]", "imgdata2.data[\""+(i)+"\"]");
+}
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.wrongtype.html b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.wrongtype.html
new file mode 100644
index 0000000..ceb58a2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.imageData.put.wrongtype.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.imageData.put.wrongtype</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.created.html" title="2d.imageData.put.created">
+<link rel="next" href="2d.imageData.put.cross.html" title="2d.imageData.put.cross">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.created.html" accesskey="p" title="[p] 2d.imageData.put.created"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.imageData.put.cross.html" accesskey="n" title="[n] 2d.imageData.put.cross">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.imageData.html">imageData</a>.<a href="index.2d.imageData.put.html">put</a>.wrongtype</h1>
+<p class="desc">putImageData() does not accept non-ImageData objects</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.imageData.put.wrongtype">2d.imageData.put.wrongtype</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var imgdata = { width: 1, height: 1, data: [255, 0, 0, 255] };
+try { var _thrown = false;
+ ctx.putImageData(imgdata, 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.putImageData(imgdata, 0, 0)"); }
+try { var _thrown = false;
+ ctx.putImageData("cheese", 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.putImageData(\"cheese\", 0, 0)"); }
+try { var _thrown = false;
+ ctx.putImageData(42, 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.putImageData(42, 0, 0)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.cap.butt.html b/LayoutTests/fast/canvas/philip/tests/2d.line.cap.butt.html
new file mode 100644
index 0000000..83f7a33
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.cap.butt.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.cap.butt</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.width.invalid.html" title="2d.line.width.invalid">
+<link rel="next" href="2d.line.cap.round.html" title="2d.line.cap.round">
+<body class="show_output">
+<p>
+ <a href="2d.line.width.invalid.html" accesskey="p" title="[p] 2d.line.width.invalid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.cap.round.html" accesskey="n" title="[n] 2d.line.cap.round">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.cap.html">cap</a>.butt</h1>
+<p class="desc">lineCap 'butt' is rendered correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineCap.butt">2d.lineCap.butt</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineCap = 'butt';
+ctx.lineWidth = 20;
+
+ctx.fillStyle = '#f00';
+ctx.strokeStyle = '#0f0';
+ctx.fillRect(15, 15, 20, 20);
+ctx.beginPath();
+ctx.moveTo(25, 15);
+ctx.lineTo(25, 35);
+ctx.stroke();
+
+ctx.fillStyle = '#0f0';
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(75, 15);
+ctx.lineTo(75, 35);
+ctx.stroke();
+ctx.fillRect(65, 15, 20, 20);
+
+_assertPixel(canvas, 25,14, 0,255,0,255, "25,14", "0,255,0,255");
+_assertPixel(canvas, 25,15, 0,255,0,255, "25,15", "0,255,0,255");
+_assertPixel(canvas, 25,16, 0,255,0,255, "25,16", "0,255,0,255");
+_assertPixel(canvas, 25,34, 0,255,0,255, "25,34", "0,255,0,255");
+_assertPixel(canvas, 25,35, 0,255,0,255, "25,35", "0,255,0,255");
+_assertPixel(canvas, 25,36, 0,255,0,255, "25,36", "0,255,0,255");
+
+_assertPixel(canvas, 75,14, 0,255,0,255, "75,14", "0,255,0,255");
+_assertPixel(canvas, 75,15, 0,255,0,255, "75,15", "0,255,0,255");
+_assertPixel(canvas, 75,16, 0,255,0,255, "75,16", "0,255,0,255");
+_assertPixel(canvas, 75,34, 0,255,0,255, "75,34", "0,255,0,255");
+_assertPixel(canvas, 75,35, 0,255,0,255, "75,35", "0,255,0,255");
+_assertPixel(canvas, 75,36, 0,255,0,255, "75,36", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.cap.closed.html b/LayoutTests/fast/canvas/philip/tests/2d.line.cap.closed.html
new file mode 100644
index 0000000..1a4365a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.cap.closed.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.cap.closed</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.cap.open.html" title="2d.line.cap.open">
+<link rel="next" href="2d.line.cap.valid.html" title="2d.line.cap.valid">
+<body class="show_output">
+<p>
+ <a href="2d.line.cap.open.html" accesskey="p" title="[p] 2d.line.cap.open"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.cap.valid.html" accesskey="n" title="[n] 2d.line.cap.valid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.cap.html">cap</a>.closed</h1>
+<p class="desc">Line caps are not drawn at the corners of an unclosed rectangle</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineCap.end">2d.lineCap.end</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.strokeStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineJoin = 'bevel';
+ctx.lineCap = 'square';
+ctx.lineWidth = 400;
+
+ctx.beginPath();
+ctx.moveTo(200, 200);
+ctx.lineTo(200, 1000);
+ctx.lineTo(1000, 1000);
+ctx.lineTo(1000, 200);
+ctx.closePath();
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.cap.invalid.html b/LayoutTests/fast/canvas/philip/tests/2d.line.cap.invalid.html
new file mode 100644
index 0000000..e76bbd5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.cap.invalid.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.cap.invalid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.cap.valid.html" title="2d.line.cap.valid">
+<link rel="next" href="2d.line.join.bevel.html" title="2d.line.join.bevel">
+<body class="show_output">
+<p>
+ <a href="2d.line.cap.valid.html" accesskey="p" title="[p] 2d.line.cap.valid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.join.bevel.html" accesskey="n" title="[n] 2d.line.join.bevel">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.cap.html">cap</a>.invalid</h1>
+<p class="desc">Setting lineCap to invalid values is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineCap.invalid">2d.lineCap.invalid</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401788">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.lineCap = 'butt'
+_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'");
+
+ctx.lineCap = 'butt';
+ctx.lineCap = 'invalid';
+_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'");
+
+ctx.lineCap = 'butt';
+ctx.lineCap = 'ROUND';
+_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'");
+
+ctx.lineCap = 'butt';
+ctx.lineCap = 'round\0';
+_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'");
+
+ctx.lineCap = 'butt';
+ctx.lineCap = 'round ';
+_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'");
+
+ctx.lineCap = 'butt';
+ctx.lineCap = "";
+_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'");
+
+ctx.lineCap = 'butt';
+ctx.lineCap = 'bevel';
+_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.cap.open.html b/LayoutTests/fast/canvas/philip/tests/2d.line.cap.open.html
new file mode 100644
index 0000000..fd3fceb
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.cap.open.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.cap.open</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.cap.square.html" title="2d.line.cap.square">
+<link rel="next" href="2d.line.cap.closed.html" title="2d.line.cap.closed">
+<body class="show_output">
+<p>
+ <a href="2d.line.cap.square.html" accesskey="p" title="[p] 2d.line.cap.square"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.cap.closed.html" accesskey="n" title="[n] 2d.line.cap.closed">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.cap.html">cap</a>.open</h1>
+<p class="desc">Line caps are drawn at the corners of an unclosed rectangle</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineCap.end">2d.lineCap.end</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.strokeStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineJoin = 'bevel';
+ctx.lineCap = 'square';
+ctx.lineWidth = 400;
+
+ctx.beginPath();
+ctx.moveTo(200, 200);
+ctx.lineTo(200, 1000);
+ctx.lineTo(1000, 1000);
+ctx.lineTo(1000, 200);
+ctx.lineTo(200, 200);
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.cap.round.html b/LayoutTests/fast/canvas/philip/tests/2d.line.cap.round.html
new file mode 100644
index 0000000..c48e874
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.cap.round.html
@@ -0,0 +1,83 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.cap.round</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.cap.butt.html" title="2d.line.cap.butt">
+<link rel="next" href="2d.line.cap.square.html" title="2d.line.cap.square">
+<body class="show_output">
+<p>
+ <a href="2d.line.cap.butt.html" accesskey="p" title="[p] 2d.line.cap.butt"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.cap.square.html" accesskey="n" title="[n] 2d.line.cap.square">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.cap.html">cap</a>.round</h1>
+<p class="desc">lineCap 'round' is rendered correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineCap.round">2d.lineCap.round</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var tol = 1; // tolerance to avoid antialiasing artifacts
+
+ctx.lineCap = 'round';
+ctx.lineWidth = 20;
+
+
+ctx.fillStyle = '#f00';
+ctx.strokeStyle = '#0f0';
+
+ctx.beginPath();
+ctx.moveTo(35-tol, 15);
+ctx.arc(25, 15, 10-tol, 0, Math.PI, true);
+ctx.arc(25, 35, 10-tol, Math.PI, 0, true);
+ctx.fill();
+
+ctx.beginPath();
+ctx.moveTo(25, 15);
+ctx.lineTo(25, 35);
+ctx.stroke();
+
+
+ctx.fillStyle = '#0f0';
+ctx.strokeStyle = '#f00';
+
+ctx.beginPath();
+ctx.moveTo(75, 15);
+ctx.lineTo(75, 35);
+ctx.stroke();
+
+ctx.beginPath();
+ctx.moveTo(85+tol, 15);
+ctx.arc(75, 15, 10+tol, 0, Math.PI, true);
+ctx.arc(75, 35, 10+tol, Math.PI, 0, true);
+ctx.fill();
+
+_assertPixel(canvas, 17,6, 0,255,0,255, "17,6", "0,255,0,255");
+_assertPixel(canvas, 25,6, 0,255,0,255, "25,6", "0,255,0,255");
+_assertPixel(canvas, 32,6, 0,255,0,255, "32,6", "0,255,0,255");
+_assertPixel(canvas, 17,43, 0,255,0,255, "17,43", "0,255,0,255");
+_assertPixel(canvas, 25,43, 0,255,0,255, "25,43", "0,255,0,255");
+_assertPixel(canvas, 32,43, 0,255,0,255, "32,43", "0,255,0,255");
+
+_assertPixel(canvas, 67,6, 0,255,0,255, "67,6", "0,255,0,255");
+_assertPixel(canvas, 75,6, 0,255,0,255, "75,6", "0,255,0,255");
+_assertPixel(canvas, 82,6, 0,255,0,255, "82,6", "0,255,0,255");
+_assertPixel(canvas, 67,43, 0,255,0,255, "67,43", "0,255,0,255");
+_assertPixel(canvas, 75,43, 0,255,0,255, "75,43", "0,255,0,255");
+_assertPixel(canvas, 82,43, 0,255,0,255, "82,43", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.cap.square.html b/LayoutTests/fast/canvas/philip/tests/2d.line.cap.square.html
new file mode 100644
index 0000000..8d7f071
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.cap.square.html
@@ -0,0 +1,67 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.cap.square</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.cap.round.html" title="2d.line.cap.round">
+<link rel="next" href="2d.line.cap.open.html" title="2d.line.cap.open">
+<body class="show_output">
+<p>
+ <a href="2d.line.cap.round.html" accesskey="p" title="[p] 2d.line.cap.round"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.cap.open.html" accesskey="n" title="[n] 2d.line.cap.open">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.cap.html">cap</a>.square</h1>
+<p class="desc">lineCap 'square' is rendered correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineCap.square">2d.lineCap.square</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineCap = 'square';
+ctx.lineWidth = 20;
+
+ctx.fillStyle = '#f00';
+ctx.strokeStyle = '#0f0';
+ctx.fillRect(15, 5, 20, 40);
+ctx.beginPath();
+ctx.moveTo(25, 15);
+ctx.lineTo(25, 35);
+ctx.stroke();
+
+ctx.fillStyle = '#0f0';
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(75, 15);
+ctx.lineTo(75, 35);
+ctx.stroke();
+ctx.fillRect(65, 5, 20, 40);
+
+_assertPixel(canvas, 25,4, 0,255,0,255, "25,4", "0,255,0,255");
+_assertPixel(canvas, 25,5, 0,255,0,255, "25,5", "0,255,0,255");
+_assertPixel(canvas, 25,6, 0,255,0,255, "25,6", "0,255,0,255");
+_assertPixel(canvas, 25,44, 0,255,0,255, "25,44", "0,255,0,255");
+_assertPixel(canvas, 25,45, 0,255,0,255, "25,45", "0,255,0,255");
+_assertPixel(canvas, 25,46, 0,255,0,255, "25,46", "0,255,0,255");
+
+_assertPixel(canvas, 75,4, 0,255,0,255, "75,4", "0,255,0,255");
+_assertPixel(canvas, 75,5, 0,255,0,255, "75,5", "0,255,0,255");
+_assertPixel(canvas, 75,6, 0,255,0,255, "75,6", "0,255,0,255");
+_assertPixel(canvas, 75,44, 0,255,0,255, "75,44", "0,255,0,255");
+_assertPixel(canvas, 75,45, 0,255,0,255, "75,45", "0,255,0,255");
+_assertPixel(canvas, 75,46, 0,255,0,255, "75,46", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.cap.valid.html b/LayoutTests/fast/canvas/philip/tests/2d.line.cap.valid.html
new file mode 100644
index 0000000..c4c26f0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.cap.valid.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.cap.valid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.cap.closed.html" title="2d.line.cap.closed">
+<link rel="next" href="2d.line.cap.invalid.html" title="2d.line.cap.invalid">
+<body class="show_output">
+<p>
+ <a href="2d.line.cap.closed.html" accesskey="p" title="[p] 2d.line.cap.closed"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.cap.invalid.html" accesskey="n" title="[n] 2d.line.cap.invalid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.cap.html">cap</a>.valid</h1>
+<p class="desc">Setting lineCap to valid values works</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineCap.set">2d.lineCap.set</a>
+<li><a href="spec.html#testrefs.2d.lineCap.get">2d.lineCap.get</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.lineCap = 'butt'
+_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'");
+
+ctx.lineCap = 'round';
+_assertSame(ctx.lineCap, 'round', "ctx.lineCap", "'round'");
+
+ctx.lineCap = 'square';
+_assertSame(ctx.lineCap, 'square', "ctx.lineCap", "'square'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.cross.html b/LayoutTests/fast/canvas/philip/tests/2d.line.cross.html
new file mode 100644
index 0000000..2fda608
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.cross.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.cross</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.miter.invalid.html" title="2d.line.miter.invalid">
+<link rel="next" href="2d.line.union.html" title="2d.line.union">
+<body class="show_output">
+<p>
+ <a href="2d.line.miter.invalid.html" accesskey="p" title="[p] 2d.line.miter.invalid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.union.html" accesskey="n" title="[n] 2d.line.union">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.cross</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineWidth = 200;
+ctx.lineJoin = 'bevel';
+
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(110, 50);
+ctx.lineTo(110, 60);
+ctx.lineTo(100, 60);
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.defaults.html b/LayoutTests/fast/canvas/philip/tests/2d.line.defaults.html
new file mode 100644
index 0000000..dbf7efa
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.defaults.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.defaults</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.animated.gif.html" title="2d.pattern.animated.gif">
+<link rel="next" href="2d.line.width.basic.html" title="2d.line.width.basic">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.animated.gif.html" accesskey="p" title="[p] 2d.pattern.animated.gif"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.width.basic.html" accesskey="n" title="[n] 2d.line.width.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.defaults</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineWidth.default">2d.lineWidth.default</a>
+<li><a href="spec.html#testrefs.2d.lineCap.default">2d.lineCap.default</a>
+<li><a href="spec.html#testrefs.2d.lineJoin.default">2d.lineJoin.default</a>
+<li><a href="spec.html#testrefs.2d.miterLimit.default">2d.miterLimit.default</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(ctx.lineWidth, 1, "ctx.lineWidth", "1");
+_assertSame(ctx.lineCap, 'butt', "ctx.lineCap", "'butt'");
+_assertSame(ctx.lineJoin, 'miter', "ctx.lineJoin", "'miter'");
+_assertSame(ctx.miterLimit, 10, "ctx.miterLimit", "10");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.join.bevel.html b/LayoutTests/fast/canvas/philip/tests/2d.line.join.bevel.html
new file mode 100644
index 0000000..70daa75
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.join.bevel.html
@@ -0,0 +1,87 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.join.bevel</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.cap.invalid.html" title="2d.line.cap.invalid">
+<link rel="next" href="2d.line.join.round.html" title="2d.line.join.round">
+<body class="show_output">
+<p>
+ <a href="2d.line.cap.invalid.html" accesskey="p" title="[p] 2d.line.cap.invalid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.join.round.html" accesskey="n" title="[n] 2d.line.join.round">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.join.html">join</a>.bevel</h1>
+<p class="desc">lineJoin 'bevel' is rendered correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineJoin.common">2d.lineJoin.common</a>
+<li><a href="spec.html#testrefs.2d.lineJoin.bevel">2d.lineJoin.bevel</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var tol = 1; // tolerance to avoid antialiasing artifacts
+
+ctx.lineJoin = 'bevel';
+ctx.lineWidth = 20;
+
+ctx.fillStyle = '#f00';
+ctx.strokeStyle = '#0f0';
+
+ctx.fillRect(10, 10, 20, 20);
+ctx.fillRect(20, 20, 20, 20);
+ctx.beginPath();
+ctx.moveTo(30, 20);
+ctx.lineTo(40-tol, 20);
+ctx.lineTo(30, 10+tol);
+ctx.fill();
+
+ctx.beginPath();
+ctx.moveTo(10, 20);
+ctx.lineTo(30, 20);
+ctx.lineTo(30, 40);
+ctx.stroke();
+
+
+ctx.fillStyle = '#0f0';
+ctx.strokeStyle = '#f00';
+
+ctx.beginPath();
+ctx.moveTo(60, 20);
+ctx.lineTo(80, 20);
+ctx.lineTo(80, 40);
+ctx.stroke();
+
+ctx.fillRect(60, 10, 20, 20);
+ctx.fillRect(70, 20, 20, 20);
+ctx.beginPath();
+ctx.moveTo(80, 20);
+ctx.lineTo(90+tol, 20);
+ctx.lineTo(80, 10-tol);
+ctx.fill();
+
+_assertPixel(canvas, 34,16, 0,255,0,255, "34,16", "0,255,0,255");
+_assertPixel(canvas, 34,15, 0,255,0,255, "34,15", "0,255,0,255");
+_assertPixel(canvas, 35,15, 0,255,0,255, "35,15", "0,255,0,255");
+_assertPixel(canvas, 36,15, 0,255,0,255, "36,15", "0,255,0,255");
+_assertPixel(canvas, 36,14, 0,255,0,255, "36,14", "0,255,0,255");
+
+_assertPixel(canvas, 84,16, 0,255,0,255, "84,16", "0,255,0,255");
+_assertPixel(canvas, 84,15, 0,255,0,255, "84,15", "0,255,0,255");
+_assertPixel(canvas, 85,15, 0,255,0,255, "85,15", "0,255,0,255");
+_assertPixel(canvas, 86,15, 0,255,0,255, "86,15", "0,255,0,255");
+_assertPixel(canvas, 86,14, 0,255,0,255, "86,14", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.join.closed.html b/LayoutTests/fast/canvas/philip/tests/2d.line.join.closed.html
new file mode 100644
index 0000000..4911956
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.join.closed.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.join.closed</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.join.open.html" title="2d.line.join.open">
+<link rel="next" href="2d.line.join.parallel.html" title="2d.line.join.parallel">
+<body class="show_output">
+<p>
+ <a href="2d.line.join.open.html" accesskey="p" title="[p] 2d.line.join.open"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.join.parallel.html" accesskey="n" title="[n] 2d.line.join.parallel">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.join.html">join</a>.closed</h1>
+<p class="desc">Line joins are drawn at the corner of a closed rectangle</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineJoin.joinclosed">2d.lineJoin.joinclosed</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.strokeStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineJoin = 'miter';
+ctx.lineWidth = 200;
+
+ctx.beginPath();
+ctx.moveTo(100, 50);
+ctx.lineTo(100, 1000);
+ctx.lineTo(1000, 1000);
+ctx.lineTo(1000, 50);
+ctx.closePath();
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.join.invalid.html b/LayoutTests/fast/canvas/philip/tests/2d.line.join.invalid.html
new file mode 100644
index 0000000..4ad9cc3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.join.invalid.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.join.invalid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.join.valid.html" title="2d.line.join.valid">
+<link rel="next" href="2d.line.miter.exceeded.html" title="2d.line.miter.exceeded">
+<body class="show_output">
+<p>
+ <a href="2d.line.join.valid.html" accesskey="p" title="[p] 2d.line.join.valid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.miter.exceeded.html" accesskey="n" title="[n] 2d.line.miter.exceeded">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.join.html">join</a>.invalid</h1>
+<p class="desc">Setting lineJoin to invalid values is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineJoin.invalid">2d.lineJoin.invalid</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401788">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.lineJoin = 'bevel'
+_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'");
+
+ctx.lineJoin = 'bevel';
+ctx.lineJoin = 'invalid';
+_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'");
+
+ctx.lineJoin = 'bevel';
+ctx.lineJoin = 'ROUND';
+_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'");
+
+ctx.lineJoin = 'bevel';
+ctx.lineJoin = 'round\0';
+_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'");
+
+ctx.lineJoin = 'bevel';
+ctx.lineJoin = 'round ';
+_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'");
+
+ctx.lineJoin = 'bevel';
+ctx.lineJoin = "";
+_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'");
+
+ctx.lineJoin = 'bevel';
+ctx.lineJoin = 'butt';
+_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.join.miter.html b/LayoutTests/fast/canvas/philip/tests/2d.line.join.miter.html
new file mode 100644
index 0000000..a946768
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.join.miter.html
@@ -0,0 +1,77 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.join.miter</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.join.round.html" title="2d.line.join.round">
+<link rel="next" href="2d.line.join.open.html" title="2d.line.join.open">
+<body class="show_output">
+<p>
+ <a href="2d.line.join.round.html" accesskey="p" title="[p] 2d.line.join.round"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.join.open.html" accesskey="n" title="[n] 2d.line.join.open">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.join.html">join</a>.miter</h1>
+<p class="desc">lineJoin 'miter' is rendered correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineJoin.miter">2d.lineJoin.miter</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineJoin = 'miter';
+ctx.lineWidth = 20;
+
+ctx.fillStyle = '#f00';
+ctx.strokeStyle = '#0f0';
+
+ctx.fillStyle = '#f00';
+ctx.strokeStyle = '#0f0';
+
+ctx.fillRect(10, 10, 30, 20);
+ctx.fillRect(20, 10, 20, 30);
+
+ctx.beginPath();
+ctx.moveTo(10, 20);
+ctx.lineTo(30, 20);
+ctx.lineTo(30, 40);
+ctx.stroke();
+
+
+ctx.fillStyle = '#0f0';
+ctx.strokeStyle = '#f00';
+
+ctx.beginPath();
+ctx.moveTo(60, 20);
+ctx.lineTo(80, 20);
+ctx.lineTo(80, 40);
+ctx.stroke();
+
+ctx.fillRect(60, 10, 30, 20);
+ctx.fillRect(70, 10, 20, 30);
+
+_assertPixel(canvas, 38,12, 0,255,0,255, "38,12", "0,255,0,255");
+_assertPixel(canvas, 39,11, 0,255,0,255, "39,11", "0,255,0,255");
+_assertPixel(canvas, 40,10, 0,255,0,255, "40,10", "0,255,0,255");
+_assertPixel(canvas, 41,9, 0,255,0,255, "41,9", "0,255,0,255");
+_assertPixel(canvas, 42,8, 0,255,0,255, "42,8", "0,255,0,255");
+
+_assertPixel(canvas, 88,12, 0,255,0,255, "88,12", "0,255,0,255");
+_assertPixel(canvas, 89,11, 0,255,0,255, "89,11", "0,255,0,255");
+_assertPixel(canvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255");
+_assertPixel(canvas, 91,9, 0,255,0,255, "91,9", "0,255,0,255");
+_assertPixel(canvas, 92,8, 0,255,0,255, "92,8", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.join.open.html b/LayoutTests/fast/canvas/philip/tests/2d.line.join.open.html
new file mode 100644
index 0000000..c08bc28
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.join.open.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.join.open</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.join.miter.html" title="2d.line.join.miter">
+<link rel="next" href="2d.line.join.closed.html" title="2d.line.join.closed">
+<body class="show_output">
+<p>
+ <a href="2d.line.join.miter.html" accesskey="p" title="[p] 2d.line.join.miter"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.join.closed.html" accesskey="n" title="[n] 2d.line.join.closed">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.join.html">join</a>.open</h1>
+<p class="desc">Line joins are not drawn at the corner of an unclosed rectangle</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineJoin.joins">2d.lineJoin.joins</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.strokeStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineJoin = 'miter';
+ctx.lineWidth = 200;
+
+ctx.beginPath();
+ctx.moveTo(100, 50);
+ctx.lineTo(100, 1000);
+ctx.lineTo(1000, 1000);
+ctx.lineTo(1000, 50);
+ctx.lineTo(100, 50);
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.join.parallel.html b/LayoutTests/fast/canvas/philip/tests/2d.line.join.parallel.html
new file mode 100644
index 0000000..ccb93e9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.join.parallel.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.join.parallel</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.join.closed.html" title="2d.line.join.closed">
+<link rel="next" href="2d.line.join.valid.html" title="2d.line.join.valid">
+<body class="show_output">
+<p>
+ <a href="2d.line.join.closed.html" accesskey="p" title="[p] 2d.line.join.closed"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.join.valid.html" accesskey="n" title="[n] 2d.line.join.valid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.join.html">join</a>.parallel</h1>
+<p class="desc">Line joins are drawn at 180-degree joins</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineJoin.joins">2d.lineJoin.joins</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 300;
+ctx.lineJoin = 'round';
+ctx.beginPath();
+ctx.moveTo(-100, 25);
+ctx.lineTo(0, 25);
+ctx.lineTo(-100, 25);
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.join.round.html b/LayoutTests/fast/canvas/philip/tests/2d.line.join.round.html
new file mode 100644
index 0000000..9844ab9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.join.round.html
@@ -0,0 +1,84 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.join.round</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.join.bevel.html" title="2d.line.join.bevel">
+<link rel="next" href="2d.line.join.miter.html" title="2d.line.join.miter">
+<body class="show_output">
+<p>
+ <a href="2d.line.join.bevel.html" accesskey="p" title="[p] 2d.line.join.bevel"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.join.miter.html" accesskey="n" title="[n] 2d.line.join.miter">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.join.html">join</a>.round</h1>
+<p class="desc">lineJoin 'round' is rendered correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineJoin.round">2d.lineJoin.round</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var tol = 1; // tolerance to avoid antialiasing artifacts
+
+ctx.lineJoin = 'round';
+ctx.lineWidth = 20;
+
+ctx.fillStyle = '#f00';
+ctx.strokeStyle = '#0f0';
+
+ctx.fillRect(10, 10, 20, 20);
+ctx.fillRect(20, 20, 20, 20);
+ctx.beginPath();
+ctx.moveTo(30, 20);
+ctx.arc(30, 20, 10-tol, 0, 2*Math.PI, true);
+ctx.fill();
+
+ctx.beginPath();
+ctx.moveTo(10, 20);
+ctx.lineTo(30, 20);
+ctx.lineTo(30, 40);
+ctx.stroke();
+
+
+ctx.fillStyle = '#0f0';
+ctx.strokeStyle = '#f00';
+
+ctx.beginPath();
+ctx.moveTo(60, 20);
+ctx.lineTo(80, 20);
+ctx.lineTo(80, 40);
+ctx.stroke();
+
+ctx.fillRect(60, 10, 20, 20);
+ctx.fillRect(70, 20, 20, 20);
+ctx.beginPath();
+ctx.moveTo(80, 20);
+ctx.arc(80, 20, 10+tol, 0, 2*Math.PI, true);
+ctx.fill();
+
+_assertPixel(canvas, 36,14, 0,255,0,255, "36,14", "0,255,0,255");
+_assertPixel(canvas, 36,13, 0,255,0,255, "36,13", "0,255,0,255");
+_assertPixel(canvas, 37,13, 0,255,0,255, "37,13", "0,255,0,255");
+_assertPixel(canvas, 38,13, 0,255,0,255, "38,13", "0,255,0,255");
+_assertPixel(canvas, 38,12, 0,255,0,255, "38,12", "0,255,0,255");
+
+_assertPixel(canvas, 86,14, 0,255,0,255, "86,14", "0,255,0,255");
+_assertPixel(canvas, 86,13, 0,255,0,255, "86,13", "0,255,0,255");
+_assertPixel(canvas, 87,13, 0,255,0,255, "87,13", "0,255,0,255");
+_assertPixel(canvas, 88,13, 0,255,0,255, "88,13", "0,255,0,255");
+_assertPixel(canvas, 88,12, 0,255,0,255, "88,12", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.join.valid.html b/LayoutTests/fast/canvas/philip/tests/2d.line.join.valid.html
new file mode 100644
index 0000000..a731881
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.join.valid.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.join.valid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.join.parallel.html" title="2d.line.join.parallel">
+<link rel="next" href="2d.line.join.invalid.html" title="2d.line.join.invalid">
+<body class="show_output">
+<p>
+ <a href="2d.line.join.parallel.html" accesskey="p" title="[p] 2d.line.join.parallel"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.join.invalid.html" accesskey="n" title="[n] 2d.line.join.invalid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.join.html">join</a>.valid</h1>
+<p class="desc">Setting lineJoin to valid values works</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineJoin.set">2d.lineJoin.set</a>
+<li><a href="spec.html#testrefs.2d.lineJoin.get">2d.lineJoin.get</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.lineJoin = 'bevel'
+_assertSame(ctx.lineJoin, 'bevel', "ctx.lineJoin", "'bevel'");
+
+ctx.lineJoin = 'round';
+_assertSame(ctx.lineJoin, 'round', "ctx.lineJoin", "'round'");
+
+ctx.lineJoin = 'miter';
+_assertSame(ctx.lineJoin, 'miter', "ctx.lineJoin", "'miter'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.miter.acute.html b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.acute.html
new file mode 100644
index 0000000..7f8269f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.acute.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.miter.acute</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.miter.exceeded.html" title="2d.line.miter.exceeded">
+<link rel="next" href="2d.line.miter.obtuse.html" title="2d.line.miter.obtuse">
+<body class="show_output">
+<p>
+ <a href="2d.line.miter.exceeded.html" accesskey="p" title="[p] 2d.line.miter.exceeded"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.miter.obtuse.html" accesskey="n" title="[n] 2d.line.miter.obtuse">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.miter.html">miter</a>.acute</h1>
+<p class="desc">Miter joins are drawn correctly with acute angles</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineJoin.miterLimit">2d.lineJoin.miterLimit</a>
+<li><a href="spec.html#testrefs.2d.lineJoin.miter">2d.lineJoin.miter</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineWidth = 200;
+ctx.lineJoin = 'miter';
+
+ctx.strokeStyle = '#0f0';
+ctx.miterLimit = 2.614;
+ctx.beginPath();
+ctx.moveTo(100, 1000);
+ctx.lineTo(100, 100);
+ctx.lineTo(1000, 1000);
+ctx.stroke();
+
+ctx.strokeStyle = '#f00';
+ctx.miterLimit = 2.613;
+ctx.beginPath();
+ctx.moveTo(100, 1000);
+ctx.lineTo(100, 100);
+ctx.lineTo(1000, 1000);
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.miter.exceeded.html b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.exceeded.html
new file mode 100644
index 0000000..330a28e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.exceeded.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.miter.exceeded</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.join.invalid.html" title="2d.line.join.invalid">
+<link rel="next" href="2d.line.miter.acute.html" title="2d.line.miter.acute">
+<body class="show_output">
+<p>
+ <a href="2d.line.join.invalid.html" accesskey="p" title="[p] 2d.line.join.invalid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.miter.acute.html" accesskey="n" title="[n] 2d.line.miter.acute">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.miter.html">miter</a>.exceeded</h1>
+<p class="desc">Miter joins are not drawn when the miter limit is exceeded</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineJoin.miterLimit">2d.lineJoin.miterLimit</a>
+<li><a href="spec.html#testrefs.2d.lineJoin.miter">2d.lineJoin.miter</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineWidth = 400;
+ctx.lineJoin = 'miter';
+
+ctx.strokeStyle = '#f00';
+ctx.miterLimit = 1.414;
+ctx.beginPath();
+ctx.moveTo(200, 1000);
+ctx.lineTo(200, 200);
+ctx.lineTo(1000, 201); // slightly non-right-angle to avoid being a special case
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.miter.invalid.html b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.invalid.html
new file mode 100644
index 0000000..7387111
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.invalid.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.miter.invalid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.miter.valid.html" title="2d.line.miter.valid">
+<link rel="next" href="2d.line.cross.html" title="2d.line.cross">
+<body class="show_output">
+<p>
+ <a href="2d.line.miter.valid.html" accesskey="p" title="[p] 2d.line.miter.valid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.cross.html" accesskey="n" title="[n] 2d.line.cross">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.miter.html">miter</a>.invalid</h1>
+<p class="desc">Setting miterLimit to invalid values is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.miterLimit.invalid">2d.miterLimit.invalid</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.miterLimit = 1.5;
+_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5");
+
+ctx.miterLimit = 1.5;
+ctx.miterLimit = 0;
+_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5");
+
+ctx.miterLimit = 1.5;
+ctx.miterLimit = -1;
+_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5");
+
+ctx.miterLimit = 1.5;
+ctx.miterLimit = Infinity;
+_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5");
+
+ctx.miterLimit = 1.5;
+ctx.miterLimit = -Infinity;
+_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5");
+
+ctx.miterLimit = 1.5;
+ctx.miterLimit = NaN;
+_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.miter.lineedge.html b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.lineedge.html
new file mode 100644
index 0000000..c178db9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.lineedge.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.miter.lineedge</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.miter.rightangle.html" title="2d.line.miter.rightangle">
+<link rel="next" href="2d.line.miter.within.html" title="2d.line.miter.within">
+<body class="show_output">
+<p>
+ <a href="2d.line.miter.rightangle.html" accesskey="p" title="[p] 2d.line.miter.rightangle"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.miter.within.html" accesskey="n" title="[n] 2d.line.miter.within">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.miter.html">miter</a>.lineedge</h1>
+<p class="desc">Miter joins are not drawn when the miter limit is exceeded at the corners of a zero-height rectangle</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineJoin.miter">2d.lineJoin.miter</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401791">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineWidth = 200;
+ctx.lineJoin = 'miter';
+
+ctx.strokeStyle = '#f00';
+ctx.miterLimit = 1.414;
+ctx.beginPath();
+ctx.strokeRect(100, 25, 200, 0);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.miter.obtuse.html b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.obtuse.html
new file mode 100644
index 0000000..523c68c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.obtuse.html
@@ -0,0 +1,59 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.miter.obtuse</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.miter.acute.html" title="2d.line.miter.acute">
+<link rel="next" href="2d.line.miter.rightangle.html" title="2d.line.miter.rightangle">
+<body class="show_output">
+<p>
+ <a href="2d.line.miter.acute.html" accesskey="p" title="[p] 2d.line.miter.acute"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.miter.rightangle.html" accesskey="n" title="[n] 2d.line.miter.rightangle">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.miter.html">miter</a>.obtuse</h1>
+<p class="desc">Miter joins are drawn correctly with obtuse angles</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineJoin.miterLimit">2d.lineJoin.miterLimit</a>
+<li><a href="spec.html#testrefs.2d.lineJoin.miter">2d.lineJoin.miter</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineWidth = 1600;
+ctx.lineJoin = 'miter';
+
+ctx.strokeStyle = '#0f0';
+ctx.miterLimit = 1.083;
+ctx.beginPath();
+ctx.moveTo(800, 10000);
+ctx.lineTo(800, 300);
+ctx.lineTo(10000, -8900);
+ctx.stroke();
+
+ctx.strokeStyle = '#f00';
+ctx.miterLimit = 1.082;
+ctx.beginPath();
+ctx.moveTo(800, 10000);
+ctx.lineTo(800, 300);
+ctx.lineTo(10000, -8900);
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.miter.rightangle.html b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.rightangle.html
new file mode 100644
index 0000000..d4748ab
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.rightangle.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.miter.rightangle</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.miter.obtuse.html" title="2d.line.miter.obtuse">
+<link rel="next" href="2d.line.miter.lineedge.html" title="2d.line.miter.lineedge">
+<body class="show_output">
+<p>
+ <a href="2d.line.miter.obtuse.html" accesskey="p" title="[p] 2d.line.miter.obtuse"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.miter.lineedge.html" accesskey="n" title="[n] 2d.line.miter.lineedge">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.miter.html">miter</a>.rightangle</h1>
+<p class="desc">Miter joins are not drawn when the miter limit is exceeded, on exact right angles</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineJoin.miter">2d.lineJoin.miter</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401791">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineWidth = 400;
+ctx.lineJoin = 'miter';
+
+ctx.strokeStyle = '#f00';
+ctx.miterLimit = 1.414;
+ctx.beginPath();
+ctx.moveTo(200, 1000);
+ctx.lineTo(200, 200);
+ctx.lineTo(1000, 200);
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.miter.valid.html b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.valid.html
new file mode 100644
index 0000000..cee1171
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.valid.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.miter.valid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.miter.within.html" title="2d.line.miter.within">
+<link rel="next" href="2d.line.miter.invalid.html" title="2d.line.miter.invalid">
+<body class="show_output">
+<p>
+ <a href="2d.line.miter.within.html" accesskey="p" title="[p] 2d.line.miter.within"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.miter.invalid.html" accesskey="n" title="[n] 2d.line.miter.invalid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.miter.html">miter</a>.valid</h1>
+<p class="desc">Setting miterLimit to valid values works</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.miterLimit.set">2d.miterLimit.set</a>
+<li><a href="spec.html#testrefs.2d.miterLimit.get">2d.miterLimit.get</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.miterLimit = 1.5;
+_assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5");
+
+ctx.miterLimit = "1e1";
+_assertSame(ctx.miterLimit, 10, "ctx.miterLimit", "10");
+
+ctx.miterLimit = 1/1024;
+_assertSame(ctx.miterLimit, 1/1024, "ctx.miterLimit", "1/1024");
+
+ctx.miterLimit = 1000;
+_assertSame(ctx.miterLimit, 1000, "ctx.miterLimit", "1000");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.miter.within.html b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.within.html
new file mode 100644
index 0000000..b4fb942
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.miter.within.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.miter.within</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.miter.lineedge.html" title="2d.line.miter.lineedge">
+<link rel="next" href="2d.line.miter.valid.html" title="2d.line.miter.valid">
+<body class="show_output">
+<p>
+ <a href="2d.line.miter.lineedge.html" accesskey="p" title="[p] 2d.line.miter.lineedge"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.miter.valid.html" accesskey="n" title="[n] 2d.line.miter.valid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.miter.html">miter</a>.within</h1>
+<p class="desc">Miter joins are drawn when the miter limit is not quite exceeded</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineJoin.miter">2d.lineJoin.miter</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineWidth = 400;
+ctx.lineJoin = 'miter';
+
+ctx.strokeStyle = '#0f0';
+ctx.miterLimit = 1.416;
+ctx.beginPath();
+ctx.moveTo(200, 1000);
+ctx.lineTo(200, 200);
+ctx.lineTo(1000, 201);
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.union.html b/LayoutTests/fast/canvas/philip/tests/2d.line.union.html
new file mode 100644
index 0000000..64ccf23
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.union.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.union</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.cross.html" title="2d.line.cross">
+<link rel="next" href="2d.shadow.attributes.shadowBlur.initial.html" title="2d.shadow.attributes.shadowBlur.initial">
+<body class="show_output">
+<p>
+ <a href="2d.line.cross.html" accesskey="p" title="[p] 2d.line.cross"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.attributes.shadowBlur.initial.html" accesskey="n" title="[n] 2d.shadow.attributes.shadowBlur.initial">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.union</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineWidth = 100;
+ctx.lineCap = 'round';
+
+ctx.strokeStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(0, 24);
+ctx.lineTo(100, 25);
+ctx.lineTo(0, 26);
+ctx.closePath();
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 25,1, 0,255,0,255, "25,1", "0,255,0,255");
+_assertPixel(canvas, 48,1, 0,255,0,255, "48,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 25,1, 0,255,0,255, "25,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.width.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.line.width.basic.html
new file mode 100644
index 0000000..2de9b27
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.width.basic.html
@@ -0,0 +1,69 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.width.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.defaults.html" title="2d.line.defaults">
+<link rel="next" href="2d.line.width.transformed.html" title="2d.line.width.transformed">
+<body class="show_output">
+<p>
+ <a href="2d.line.defaults.html" accesskey="p" title="[p] 2d.line.defaults"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.width.transformed.html" accesskey="n" title="[n] 2d.line.width.transformed">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.width.html">width</a>.basic</h1>
+<p class="desc">lineWidth determines the width of line strokes</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineWidth">2d.lineWidth</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineWidth = 20;
+// Draw a green line over a red box, to check the line is not too small
+ctx.fillStyle = '#f00';
+ctx.strokeStyle = '#0f0';
+ctx.fillRect(15, 15, 20, 20);
+ctx.beginPath();
+ctx.moveTo(25, 15);
+ctx.lineTo(25, 35);
+ctx.stroke();
+
+// Draw a green box over a red line, to check the line is not too large
+ctx.fillStyle = '#0f0';
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(75, 15);
+ctx.lineTo(75, 35);
+ctx.stroke();
+ctx.fillRect(65, 15, 20, 20);
+
+_assertPixel(canvas, 14,25, 0,255,0,255, "14,25", "0,255,0,255");
+_assertPixel(canvas, 15,25, 0,255,0,255, "15,25", "0,255,0,255");
+_assertPixel(canvas, 16,25, 0,255,0,255, "16,25", "0,255,0,255");
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 34,25, 0,255,0,255, "34,25", "0,255,0,255");
+_assertPixel(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255");
+_assertPixel(canvas, 36,25, 0,255,0,255, "36,25", "0,255,0,255");
+
+_assertPixel(canvas, 64,25, 0,255,0,255, "64,25", "0,255,0,255");
+_assertPixel(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255");
+_assertPixel(canvas, 66,25, 0,255,0,255, "66,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+_assertPixel(canvas, 84,25, 0,255,0,255, "84,25", "0,255,0,255");
+_assertPixel(canvas, 85,25, 0,255,0,255, "85,25", "0,255,0,255");
+_assertPixel(canvas, 86,25, 0,255,0,255, "86,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.width.invalid.html b/LayoutTests/fast/canvas/philip/tests/2d.line.width.invalid.html
new file mode 100644
index 0000000..7d5d848
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.width.invalid.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.width.invalid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.width.valid.html" title="2d.line.width.valid">
+<link rel="next" href="2d.line.cap.butt.html" title="2d.line.cap.butt">
+<body class="show_output">
+<p>
+ <a href="2d.line.width.valid.html" accesskey="p" title="[p] 2d.line.width.valid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.cap.butt.html" accesskey="n" title="[n] 2d.line.cap.butt">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.width.html">width</a>.invalid</h1>
+<p class="desc">Setting lineWidth to invalid values is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineWidth.invalid">2d.lineWidth.invalid</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.lineWidth = 1.5;
+_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5");
+
+ctx.lineWidth = 1.5;
+ctx.lineWidth = 0;
+_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5");
+
+ctx.lineWidth = 1.5;
+ctx.lineWidth = -1;
+_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5");
+
+ctx.lineWidth = 1.5;
+ctx.lineWidth = Infinity;
+_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5");
+
+ctx.lineWidth = 1.5;
+ctx.lineWidth = -Infinity;
+_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5");
+
+ctx.lineWidth = 1.5;
+ctx.lineWidth = NaN;
+_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.width.scaledefault.html b/LayoutTests/fast/canvas/philip/tests/2d.line.width.scaledefault.html
new file mode 100644
index 0000000..4cdaaf5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.width.scaledefault.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.width.scaledefault</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.width.transformed.html" title="2d.line.width.transformed">
+<link rel="next" href="2d.line.width.valid.html" title="2d.line.width.valid">
+<body class="show_output">
+<p>
+ <a href="2d.line.width.transformed.html" accesskey="p" title="[p] 2d.line.width.transformed"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.width.valid.html" accesskey="n" title="[n] 2d.line.width.valid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.width.html">width</a>.scaledefault</h1>
+<p class="desc">Default lineWidth strokes are affected by scale transformations</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineWidth">2d.lineWidth</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.scale(50, 50);
+ctx.strokeStyle = '#0f0';
+ctx.moveTo(0, 0.5);
+ctx.lineTo(2, 0.5);
+ctx.stroke();
+
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+_assertPixel(canvas, 50,5, 0,255,0,255, "50,5", "0,255,0,255");
+_assertPixel(canvas, 50,45, 0,255,0,255, "50,45", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.width.transformed.html b/LayoutTests/fast/canvas/philip/tests/2d.line.width.transformed.html
new file mode 100644
index 0000000..9e39e3b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.width.transformed.html
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.width.transformed</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.width.basic.html" title="2d.line.width.basic">
+<link rel="next" href="2d.line.width.scaledefault.html" title="2d.line.width.scaledefault">
+<body class="show_output">
+<p>
+ <a href="2d.line.width.basic.html" accesskey="p" title="[p] 2d.line.width.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.width.scaledefault.html" accesskey="n" title="[n] 2d.line.width.scaledefault">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.width.html">width</a>.transformed</h1>
+<p class="desc">Line stroke widths are affected by scale transformations</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineWidth">2d.lineWidth</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineWidth = 4;
+// Draw a green line over a red box, to check the line is not too small
+ctx.fillStyle = '#f00';
+ctx.strokeStyle = '#0f0';
+ctx.fillRect(15, 15, 20, 20);
+ctx.save();
+ ctx.scale(5, 1);
+ ctx.beginPath();
+ ctx.moveTo(5, 15);
+ ctx.lineTo(5, 35);
+ ctx.stroke();
+ctx.restore();
+
+// Draw a green box over a red line, to check the line is not too large
+ctx.fillStyle = '#0f0';
+ctx.strokeStyle = '#f00';
+ctx.save();
+ ctx.scale(-5, 1);
+ ctx.beginPath();
+ ctx.moveTo(-15, 15);
+ ctx.lineTo(-15, 35);
+ ctx.stroke();
+ctx.restore();
+ctx.fillRect(65, 15, 20, 20);
+
+_assertPixel(canvas, 14,25, 0,255,0,255, "14,25", "0,255,0,255");
+_assertPixel(canvas, 15,25, 0,255,0,255, "15,25", "0,255,0,255");
+_assertPixel(canvas, 16,25, 0,255,0,255, "16,25", "0,255,0,255");
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 34,25, 0,255,0,255, "34,25", "0,255,0,255");
+_assertPixel(canvas, 35,25, 0,255,0,255, "35,25", "0,255,0,255");
+_assertPixel(canvas, 36,25, 0,255,0,255, "36,25", "0,255,0,255");
+
+_assertPixel(canvas, 64,25, 0,255,0,255, "64,25", "0,255,0,255");
+_assertPixel(canvas, 65,25, 0,255,0,255, "65,25", "0,255,0,255");
+_assertPixel(canvas, 66,25, 0,255,0,255, "66,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+_assertPixel(canvas, 84,25, 0,255,0,255, "84,25", "0,255,0,255");
+_assertPixel(canvas, 85,25, 0,255,0,255, "85,25", "0,255,0,255");
+_assertPixel(canvas, 86,25, 0,255,0,255, "86,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.line.width.valid.html b/LayoutTests/fast/canvas/philip/tests/2d.line.width.valid.html
new file mode 100644
index 0000000..293389a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.line.width.valid.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.line.width.valid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.width.scaledefault.html" title="2d.line.width.scaledefault">
+<link rel="next" href="2d.line.width.invalid.html" title="2d.line.width.invalid">
+<body class="show_output">
+<p>
+ <a href="2d.line.width.scaledefault.html" accesskey="p" title="[p] 2d.line.width.scaledefault"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.width.invalid.html" accesskey="n" title="[n] 2d.line.width.invalid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.line.html">line</a>.<a href="index.2d.line.width.html">width</a>.valid</h1>
+<p class="desc">Setting lineWidth to valid values works</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.lineWidth.set">2d.lineWidth.set</a>
+<li><a href="spec.html#testrefs.2d.lineWidth.get">2d.lineWidth.get</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.lineWidth = 1.5;
+_assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5");
+
+ctx.lineWidth = "1e1";
+_assertSame(ctx.lineWidth, 10, "ctx.lineWidth", "10");
+
+ctx.lineWidth = 1/1024;
+_assertSame(ctx.lineWidth, 1/1024, "ctx.lineWidth", "1/1024");
+
+ctx.lineWidth = 1000;
+_assertSame(ctx.lineWidth, 1000, "ctx.lineWidth", "1000");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.missingargs.html b/LayoutTests/fast/canvas/philip/tests/2d.missingargs.html
new file mode 100644
index 0000000..3e87066
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.missingargs.html
@@ -0,0 +1,337 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.missingargs</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.voidreturn.html" title="2d.voidreturn">
+<link rel="next" href="2d.coordinatespace.html" title="2d.coordinatespace">
+<body class="show_output">
+<p>
+ <a href="2d.voidreturn.html" accesskey="p" title="[p] 2d.voidreturn"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.coordinatespace.html" accesskey="n" title="[n] 2d.coordinatespace">></a>
+<h1><a href="index.2d.html">2d</a>.missingargs</h1>
+<p class="desc">Missing arguments cause NOT_SUPPORTED_ERR</p>
+<div class="refs">References:
+<ul>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.scale();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.scale()"); }
+try { var _thrown = false;
+ ctx.scale(1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.scale(1)"); }
+try { var _thrown = false;
+ ctx.rotate();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rotate()"); }
+try { var _thrown = false;
+ ctx.translate();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.translate()"); }
+try { var _thrown = false;
+ ctx.translate(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.translate(0)"); }
+if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported)
+ try { var _thrown = false;
+ ctx.transform();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform()"); }
+ try { var _thrown = false;
+ ctx.transform(1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1)"); }
+ try { var _thrown = false;
+ ctx.transform(1, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0)"); }
+ try { var _thrown = false;
+ ctx.transform(1, 0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0)"); }
+ try { var _thrown = false;
+ ctx.transform(1, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0, 1)"); }
+ try { var _thrown = false;
+ ctx.transform(1, 0, 0, 1, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.transform(1, 0, 0, 1, 0)"); }
+}
+if (ctx.setTransform) {
+ try { var _thrown = false;
+ ctx.setTransform();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform()"); }
+ try { var _thrown = false;
+ ctx.setTransform(1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1)"); }
+ try { var _thrown = false;
+ ctx.setTransform(1, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0)"); }
+ try { var _thrown = false;
+ ctx.setTransform(1, 0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0)"); }
+ try { var _thrown = false;
+ ctx.setTransform(1, 0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0, 1)"); }
+ try { var _thrown = false;
+ ctx.setTransform(1, 0, 0, 1, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.setTransform(1, 0, 0, 1, 0)"); }
+}
+try { var _thrown = false;
+ ctx.createLinearGradient();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient()"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0)"); }
+try { var _thrown = false;
+ ctx.createLinearGradient(0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createLinearGradient(0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient()"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0)"); }
+try { var _thrown = false;
+ ctx.createRadialGradient(0, 0, 1, 0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createRadialGradient(0, 0, 1, 0, 0)"); }
+try { var _thrown = false;
+ ctx.createPattern(canvas);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createPattern(canvas)"); }
+try { var _thrown = false;
+ ctx.clearRect();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect()"); }
+try { var _thrown = false;
+ ctx.clearRect(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0)"); }
+try { var _thrown = false;
+ ctx.clearRect(0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0, 0)"); }
+try { var _thrown = false;
+ ctx.clearRect(0, 0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.clearRect(0, 0, 0)"); }
+try { var _thrown = false;
+ ctx.fillRect();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect()"); }
+try { var _thrown = false;
+ ctx.fillRect(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0)"); }
+try { var _thrown = false;
+ ctx.fillRect(0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0, 0)"); }
+try { var _thrown = false;
+ ctx.fillRect(0, 0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillRect(0, 0, 0)"); }
+try { var _thrown = false;
+ ctx.strokeRect();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect()"); }
+try { var _thrown = false;
+ ctx.strokeRect(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect(0)"); }
+try { var _thrown = false;
+ ctx.strokeRect(0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect(0, 0)"); }
+try { var _thrown = false;
+ ctx.strokeRect(0, 0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeRect(0, 0, 0)"); }
+try { var _thrown = false;
+ ctx.moveTo();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.moveTo()"); }
+try { var _thrown = false;
+ ctx.moveTo(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.moveTo(0)"); }
+try { var _thrown = false;
+ ctx.lineTo();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.lineTo()"); }
+try { var _thrown = false;
+ ctx.lineTo(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.lineTo(0)"); }
+try { var _thrown = false;
+ ctx.quadraticCurveTo();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo()"); }
+try { var _thrown = false;
+ ctx.quadraticCurveTo(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0)"); }
+try { var _thrown = false;
+ ctx.quadraticCurveTo(0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0, 0)"); }
+try { var _thrown = false;
+ ctx.quadraticCurveTo(0, 0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.quadraticCurveTo(0, 0, 0)"); }
+try { var _thrown = false;
+ ctx.bezierCurveTo();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo()"); }
+try { var _thrown = false;
+ ctx.bezierCurveTo(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0)"); }
+try { var _thrown = false;
+ ctx.bezierCurveTo(0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0)"); }
+try { var _thrown = false;
+ ctx.bezierCurveTo(0, 0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0)"); }
+try { var _thrown = false;
+ ctx.bezierCurveTo(0, 0, 0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0, 0)"); }
+try { var _thrown = false;
+ ctx.bezierCurveTo(0, 0, 0, 0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.bezierCurveTo(0, 0, 0, 0, 0)"); }
+try { var _thrown = false;
+ ctx.arcTo();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo()"); }
+try { var _thrown = false;
+ ctx.arcTo(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0)"); }
+try { var _thrown = false;
+ ctx.arcTo(0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0)"); }
+try { var _thrown = false;
+ ctx.arcTo(0, 0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0, 0)"); }
+try { var _thrown = false;
+ ctx.arcTo(0, 0, 0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arcTo(0, 0, 0, 0)"); }
+try { var _thrown = false;
+ ctx.rect();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect()"); }
+try { var _thrown = false;
+ ctx.rect(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0)"); }
+try { var _thrown = false;
+ ctx.rect(0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0, 0)"); }
+try { var _thrown = false;
+ ctx.rect(0, 0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.rect(0, 0, 0)"); }
+try { var _thrown = false;
+ ctx.arc();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc()"); }
+try { var _thrown = false;
+ ctx.arc(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0)"); }
+try { var _thrown = false;
+ ctx.arc(0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0)"); }
+try { var _thrown = false;
+ ctx.arc(0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1)"); }
+try { var _thrown = false;
+ ctx.arc(0, 0, 1, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1, 0)"); }
+try { var _thrown = false;
+ ctx.arc(0, 0, 1, 0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.arc(0, 0, 1, 0, 0)"); }
+if (ctx.isPointInPath) {
+ try { var _thrown = false;
+ ctx.isPointInPath();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.isPointInPath()"); }
+ try { var _thrown = false;
+ ctx.isPointInPath(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.isPointInPath(0)"); }
+}
+if (ctx.drawFocusRing) {
+ try { var _thrown = false;
+ ctx.drawFocusRing();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawFocusRing()"); }
+ try { var _thrown = false;
+ ctx.drawFocusRing(canvas);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawFocusRing(canvas)"); }
+ try { var _thrown = false;
+ ctx.drawFocusRing(canvas, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawFocusRing(canvas, 0)"); }
+}
+if (ctx.fillText) {
+ try { var _thrown = false;
+ ctx.fillText();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillText()"); }
+ try { var _thrown = false;
+ ctx.fillText('test');
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillText('test')"); }
+ try { var _thrown = false;
+ ctx.fillText('test', 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.fillText('test', 0)"); }
+ try { var _thrown = false;
+ ctx.strokeText();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeText()"); }
+ try { var _thrown = false;
+ ctx.strokeText('test');
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeText('test')"); }
+ try { var _thrown = false;
+ ctx.strokeText('test', 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.strokeText('test', 0)"); }
+ try { var _thrown = false;
+ ctx.measureText();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.measureText()"); }
+}
+try { var _thrown = false;
+ ctx.drawImage();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage()"); }
+try { var _thrown = false;
+ ctx.drawImage(canvas);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage(canvas)"); }
+try { var _thrown = false;
+ ctx.drawImage(canvas, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.drawImage(canvas, 0)"); }
+// TODO: n >= 3 args on drawImage could be either a valid overload,
+// or too few for another overload, or too many for another
+// overload - what should happen?
+if (ctx.createImageData) {
+ try { var _thrown = false;
+ ctx.createImageData();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData()"); }
+ try { var _thrown = false;
+ ctx.createImageData(1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.createImageData(1)"); }
+}
+if (ctx.getImageData) {
+ try { var _thrown = false;
+ ctx.getImageData();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData()"); }
+ try { var _thrown = false;
+ ctx.getImageData(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(0)"); }
+ try { var _thrown = false;
+ ctx.getImageData(0, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(0, 0)"); }
+ try { var _thrown = false;
+ ctx.getImageData(0, 0, 1);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.getImageData(0, 0, 1)"); }
+}
+if (ctx.putImageData) {
+ var imgdata = ctx.getImageData(0, 0, 1, 1);
+ try { var _thrown = false;
+ ctx.putImageData();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData()"); }
+ try { var _thrown = false;
+ ctx.putImageData(imgdata);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata)"); }
+ try { var _thrown = false;
+ ctx.putImageData(imgdata, 0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: ctx.putImageData(imgdata, 0)"); }
+}
+var g = ctx.createLinearGradient(0, 0, 0, 0);
+try { var _thrown = false;
+ g.addColorStop();
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: g.addColorStop()"); }
+try { var _thrown = false;
+ g.addColorStop(0);
+} catch (e) { if (e.code != DOMException.NOT_SUPPORTED_ERR) _fail("Failed assertion: expected exception of type NOT_SUPPORTED_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type NOT_SUPPORTED_ERR: g.addColorStop(0)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.1.html
new file mode 100644
index 0000000..703c7f6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.1.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.angle.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.end.html" title="2d.path.arc.end">
+<link rel="next" href="2d.path.arc.angle.2.html" title="2d.path.arc.angle.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.end.html" accesskey="p" title="[p] 2d.path.arc.end"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.angle.2.html" accesskey="n" title="[n] 2d.path.arc.angle.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.angle.html">angle</a>.1</h1>
+<p class="desc">arc() draws pi/2 .. -pi anticlockwise correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(100, 0);
+ctx.arc(100, 0, 150, Math.PI/2, -Math.PI, true);
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.2.html
new file mode 100644
index 0000000..365e0ad
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.2.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.angle.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.angle.1.html" title="2d.path.arc.angle.1">
+<link rel="next" href="2d.path.arc.angle.3.html" title="2d.path.arc.angle.3">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.angle.1.html" accesskey="p" title="[p] 2d.path.arc.angle.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.angle.3.html" accesskey="n" title="[n] 2d.path.arc.angle.3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.angle.html">angle</a>.2</h1>
+<p class="desc">arc() draws -3pi/2 .. -pi anticlockwise correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(100, 0);
+ctx.arc(100, 0, 150, -3*Math.PI/2, -Math.PI, true);
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.3.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.3.html
new file mode 100644
index 0000000..57c2959
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.3.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.angle.3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.angle.2.html" title="2d.path.arc.angle.2">
+<link rel="next" href="2d.path.arc.angle.4.html" title="2d.path.arc.angle.4">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.angle.2.html" accesskey="p" title="[p] 2d.path.arc.angle.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.angle.4.html" accesskey="n" title="[n] 2d.path.arc.angle.4">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.angle.html">angle</a>.3</h1>
+<p class="desc">arc() wraps angles mod 2pi when anticlockwise and end > start+2pi</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(100, 0);
+ctx.arc(100, 0, 150, (512+1/2)*Math.PI, (1024-1)*Math.PI, true);
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.4.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.4.html
new file mode 100644
index 0000000..b39e05c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.4.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.angle.4</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.angle.3.html" title="2d.path.arc.angle.3">
+<link rel="next" href="2d.path.arc.angle.5.html" title="2d.path.arc.angle.5">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.angle.3.html" accesskey="p" title="[p] 2d.path.arc.angle.3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.angle.5.html" accesskey="n" title="[n] 2d.path.arc.angle.5">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.angle.html">angle</a>.4</h1>
+<p class="desc">arc() draws a full circle when clockwise and end > start+2pi</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(50, 25);
+ctx.arc(50, 25, 60, (512+1/2)*Math.PI, (1024-1)*Math.PI, false);
+ctx.fill();
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.5.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.5.html
new file mode 100644
index 0000000..03281e6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.5.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.angle.5</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.angle.4.html" title="2d.path.arc.angle.4">
+<link rel="next" href="2d.path.arc.angle.6.html" title="2d.path.arc.angle.6">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.angle.4.html" accesskey="p" title="[p] 2d.path.arc.angle.4"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.angle.6.html" accesskey="n" title="[n] 2d.path.arc.angle.6">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.angle.html">angle</a>.5</h1>
+<p class="desc">arc() wraps angles mod 2pi when clockwise and start > end+2pi</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(100, 0);
+ctx.arc(100, 0, 150, (1024-1)*Math.PI, (512+1/2)*Math.PI, false);
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.6.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.6.html
new file mode 100644
index 0000000..bbc2831
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.angle.6.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.angle.6</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.angle.5.html" title="2d.path.arc.angle.5">
+<link rel="next" href="2d.path.arc.zero.1.html" title="2d.path.arc.zero.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.angle.5.html" accesskey="p" title="[p] 2d.path.arc.angle.5"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.zero.1.html" accesskey="n" title="[n] 2d.path.arc.zero.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.angle.html">angle</a>.6</h1>
+<p class="desc">arc() draws a full circle when anticlockwise and start > end+2pi</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(50, 25);
+ctx.arc(50, 25, 60, (1024-1)*Math.PI, (512+1/2)*Math.PI, true);
+ctx.fill();
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.empty.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.empty.html
new file mode 100644
index 0000000..994b6bf
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.empty.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.empty</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.nonfinite.html" title="2d.path.arcTo.nonfinite">
+<link rel="next" href="2d.path.arc.nonempty.html" title="2d.path.arc.nonempty">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.nonfinite.html" accesskey="p" title="[p] 2d.path.arcTo.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.nonempty.html" accesskey="n" title="[n] 2d.path.arc.nonempty">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.empty</h1>
+<p class="desc">arc() with an empty path does not draw a straight line to the start point</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.nonempty">2d.path.arc.nonempty</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 50;
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.arc(200, 25, 5, 0, 2*Math.PI, true);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.end.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.end.html
new file mode 100644
index 0000000..106835a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.end.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.end</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.nonempty.html" title="2d.path.arc.nonempty">
+<link rel="next" href="2d.path.arc.angle.1.html" title="2d.path.arc.angle.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.nonempty.html" accesskey="p" title="[p] 2d.path.arc.nonempty"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.angle.1.html" accesskey="n" title="[n] 2d.path.arc.angle.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.end</h1>
+<p class="desc">arc() adds the end point of the arc to the subpath</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 50;
+ctx.strokeStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(-100, 0);
+ctx.arc(-100, 0, 25, -Math.PI/2, Math.PI/2, true);
+ctx.lineTo(100, 25);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.negative.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.negative.html
new file mode 100644
index 0000000..d159f72
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.negative.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.negative</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.selfintersect.2.html" title="2d.path.arc.selfintersect.2">
+<link rel="next" href="2d.path.arc.zeroradius.html" title="2d.path.arc.zeroradius">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.selfintersect.2.html" accesskey="p" title="[p] 2d.path.arc.selfintersect.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.zeroradius.html" accesskey="n" title="[n] 2d.path.arc.zeroradius">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.negative</h1>
+<p class="desc">arc() with negative radius throws INDEX_SIZE_ERR</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.negative">2d.path.arc.negative</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.arc(0, 0, -1, 0, 0, true);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.arc(0, 0, -1, 0, 0, true)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.nonempty.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.nonempty.html
new file mode 100644
index 0000000..83be7ea
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.nonempty.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.nonempty</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.empty.html" title="2d.path.arc.empty">
+<link rel="next" href="2d.path.arc.end.html" title="2d.path.arc.end">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.empty.html" accesskey="p" title="[p] 2d.path.arc.empty"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.end.html" accesskey="n" title="[n] 2d.path.arc.end">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.nonempty</h1>
+<p class="desc">arc() with a non-empty path does draw a straight line to the start point</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.nonempty">2d.path.arc.nonempty</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 50;
+ctx.strokeStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(0, 25);
+ctx.arc(200, 25, 5, 0, 2*Math.PI, true);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.nonfinite.html
new file mode 100644
index 0000000..457fe1b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.nonfinite.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.scale.2.html" title="2d.path.arc.scale.2">
+<link rel="next" href="2d.path.rect.basic.html" title="2d.path.rect.basic">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.scale.2.html" accesskey="p" title="[p] 2d.path.arc.scale.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.rect.basic.html" accesskey="n" title="[n] 2d.path.rect.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.nonfinite</h1>
+<p class="desc">arc() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.moveTo(0, 0);
+ctx.lineTo(100, 0);
+ctx.arc(Infinity, 50, 0, 2*Math.PI, true);
+ctx.arc(-Infinity, 50, 0, 2*Math.PI, true);
+ctx.arc(NaN, 50, 0, 2*Math.PI, true);
+ctx.arc(0, Infinity, 0, 2*Math.PI, true);
+ctx.arc(0, -Infinity, 0, 2*Math.PI, true);
+ctx.arc(0, NaN, 0, 2*Math.PI, true);
+ctx.arc(0, 50, Infinity, 2*Math.PI, true);
+ctx.arc(0, 50, -Infinity, 2*Math.PI, true);
+ctx.arc(0, 50, NaN, 2*Math.PI, true);
+ctx.arc(0, 50, 0, Infinity, true);
+ctx.arc(0, 50, 0, -Infinity, true);
+ctx.arc(0, 50, 0, NaN, true);
+ctx.arc(Infinity, Infinity, 0, 2*Math.PI, true);
+ctx.arc(Infinity, Infinity, Infinity, 2*Math.PI, true);
+ctx.arc(Infinity, Infinity, Infinity, Infinity, true);
+ctx.arc(Infinity, Infinity, 0, Infinity, true);
+ctx.arc(Infinity, 50, Infinity, 2*Math.PI, true);
+ctx.arc(Infinity, 50, Infinity, Infinity, true);
+ctx.arc(Infinity, 50, 0, Infinity, true);
+ctx.arc(0, Infinity, Infinity, 2*Math.PI, true);
+ctx.arc(0, Infinity, Infinity, Infinity, true);
+ctx.arc(0, Infinity, 0, Infinity, true);
+ctx.arc(0, 50, Infinity, Infinity, true);
+ctx.lineTo(100, 50);
+ctx.lineTo(0, 50);
+ctx.fillStyle = '#0f0';
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.scale.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.scale.1.html
new file mode 100644
index 0000000..ed72bc5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.scale.1.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.scale.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.zeroradius.html" title="2d.path.arc.zeroradius">
+<link rel="next" href="2d.path.arc.scale.2.html" title="2d.path.arc.scale.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.zeroradius.html" accesskey="p" title="[p] 2d.path.arc.zeroradius"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.scale.2.html" accesskey="n" title="[n] 2d.path.arc.scale.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.scale.html">scale</a>.1</h1>
+<p class="desc">Non-uniformly scaled arcs are the right shape</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.transformation">2d.path.transformation</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.scale(2, 0.5);
+ctx.fillStyle = '#0f0';
+ctx.beginPath();
+ctx.arc(25, 50, 56, 0, 2*Math.PI, false);
+ctx.fill();
+ctx.fillStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(-25, 50);
+ctx.arc(-25, 50, 24, 0, 2*Math.PI, false);
+ctx.moveTo(75, 50);
+ctx.arc(75, 50, 24, 0, 2*Math.PI, false);
+ctx.moveTo(25, -25);
+ctx.arc(25, -25, 24, 0, 2*Math.PI, false);
+ctx.moveTo(25, 125);
+ctx.arc(25, 125, 24, 0, 2*Math.PI, false);
+ctx.fill();
+
+_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255");
+_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255");
+_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255");
+_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255");
+_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255");
+_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255");
+_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.scale.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.scale.2.html
new file mode 100644
index 0000000..7fd5ea2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.scale.2.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.scale.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.scale.1.html" title="2d.path.arc.scale.1">
+<link rel="next" href="2d.path.arc.nonfinite.html" title="2d.path.arc.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.scale.1.html" accesskey="p" title="[p] 2d.path.arc.scale.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.nonfinite.html" accesskey="n" title="[n] 2d.path.arc.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.scale.html">scale</a>.2</h1>
+<p class="desc">Highly scaled arcs are the right shape</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.scale(100, 100);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 1.2;
+ctx.beginPath();
+ctx.arc(0, 0, 0.6, 0, Math.PI/2, false);
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.selfintersect.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.selfintersect.1.html
new file mode 100644
index 0000000..b9425aa
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.selfintersect.1.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.selfintersect.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.shape.5.html" title="2d.path.arc.shape.5">
+<link rel="next" href="2d.path.arc.selfintersect.2.html" title="2d.path.arc.selfintersect.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.shape.5.html" accesskey="p" title="[p] 2d.path.arc.shape.5"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.selfintersect.2.html" accesskey="n" title="[n] 2d.path.arc.selfintersect.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.selfintersect.html">selfintersect</a>.1</h1>
+<p class="desc">arc() with lineWidth > 2*radius is drawn sensibly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 200;
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.arc(100, 50, 25, 0, -Math.PI/2, true);
+ctx.stroke();
+ctx.beginPath();
+ctx.arc(0, 0, 25, 0, -Math.PI/2, true);
+ctx.stroke();
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.selfintersect.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.selfintersect.2.html
new file mode 100644
index 0000000..719e2ee
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.selfintersect.2.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.selfintersect.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.selfintersect.1.html" title="2d.path.arc.selfintersect.1">
+<link rel="next" href="2d.path.arc.negative.html" title="2d.path.arc.negative">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.selfintersect.1.html" accesskey="p" title="[p] 2d.path.arc.selfintersect.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.negative.html" accesskey="n" title="[n] 2d.path.arc.negative">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.selfintersect.html">selfintersect</a>.2</h1>
+<p class="desc">arc() with lineWidth > 2*radius is drawn sensibly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 180;
+ctx.strokeStyle = '#0f0';
+ctx.beginPath();
+ctx.arc(-50, 50, 25, 0, -Math.PI/2, true);
+ctx.stroke();
+ctx.beginPath();
+ctx.arc(100, 0, 25, 0, -Math.PI/2, true);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255");
+_assertPixel(canvas, 97,1, 0,255,0,255, "97,1", "0,255,0,255");
+_assertPixel(canvas, 97,2, 0,255,0,255, "97,2", "0,255,0,255");
+_assertPixel(canvas, 97,3, 0,255,0,255, "97,3", "0,255,0,255");
+_assertPixel(canvas, 2,48, 0,255,0,255, "2,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.shape.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.shape.1.html
new file mode 100644
index 0000000..30f9099
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.shape.1.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.shape.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.twopie.4.html" title="2d.path.arc.twopie.4">
+<link rel="next" href="2d.path.arc.shape.2.html" title="2d.path.arc.shape.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.twopie.4.html" accesskey="p" title="[p] 2d.path.arc.twopie.4"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.shape.2.html" accesskey="n" title="[n] 2d.path.arc.shape.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.shape.html">shape</a>.1</h1>
+<p class="desc">arc() from 0 to pi does not draw anything in the wrong half</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 50;
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.arc(50, 50, 50, 0, Math.PI, false);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 20,48, 0,255,0,255, "20,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.shape.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.shape.2.html
new file mode 100644
index 0000000..6400955
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.shape.2.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.shape.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.shape.1.html" title="2d.path.arc.shape.1">
+<link rel="next" href="2d.path.arc.shape.3.html" title="2d.path.arc.shape.3">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.shape.1.html" accesskey="p" title="[p] 2d.path.arc.shape.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.shape.3.html" accesskey="n" title="[n] 2d.path.arc.shape.3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.shape.html">shape</a>.2</h1>
+<p class="desc">arc() from 0 to pi draws stuff in the right half</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 100;
+ctx.strokeStyle = '#0f0';
+ctx.beginPath();
+ctx.arc(50, 50, 50, 0, Math.PI, true);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 20,48, 0,255,0,255, "20,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.shape.3.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.shape.3.html
new file mode 100644
index 0000000..aa36415
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.shape.3.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.shape.3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.shape.2.html" title="2d.path.arc.shape.2">
+<link rel="next" href="2d.path.arc.shape.4.html" title="2d.path.arc.shape.4">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.shape.2.html" accesskey="p" title="[p] 2d.path.arc.shape.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.shape.4.html" accesskey="n" title="[n] 2d.path.arc.shape.4">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.shape.html">shape</a>.3</h1>
+<p class="desc">arc() from 0 to -pi/2 does not draw anything in the wrong quadrant</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 100;
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.arc(0, 50, 50, 0, -Math.PI/2, false);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.shape.4.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.shape.4.html
new file mode 100644
index 0000000..b8c39f8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.shape.4.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.shape.4</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.shape.3.html" title="2d.path.arc.shape.3">
+<link rel="next" href="2d.path.arc.shape.5.html" title="2d.path.arc.shape.5">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.shape.3.html" accesskey="p" title="[p] 2d.path.arc.shape.3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.shape.5.html" accesskey="n" title="[n] 2d.path.arc.shape.5">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.shape.html">shape</a>.4</h1>
+<p class="desc">arc() from 0 to -pi/2 draws stuff in the right quadrant</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 150;
+ctx.strokeStyle = '#0f0';
+ctx.beginPath();
+ctx.arc(-50, 50, 100, 0, -Math.PI/2, true);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.shape.5.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.shape.5.html
new file mode 100644
index 0000000..00e0a69
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.shape.5.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.shape.5</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.shape.4.html" title="2d.path.arc.shape.4">
+<link rel="next" href="2d.path.arc.selfintersect.1.html" title="2d.path.arc.selfintersect.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.shape.4.html" accesskey="p" title="[p] 2d.path.arc.shape.4"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.selfintersect.1.html" accesskey="n" title="[n] 2d.path.arc.selfintersect.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.shape.html">shape</a>.5</h1>
+<p class="desc">arc() from 0 to 5pi does not draw crazy things</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 200;
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.arc(300, 0, 100, 0, 5*Math.PI, false);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.twopie.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.twopie.1.html
new file mode 100644
index 0000000..6e75e88
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.twopie.1.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.twopie.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.zero.2.html" title="2d.path.arc.zero.2">
+<link rel="next" href="2d.path.arc.twopie.2.html" title="2d.path.arc.twopie.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.zero.2.html" accesskey="p" title="[p] 2d.path.arc.zero.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.twopie.2.html" accesskey="n" title="[n] 2d.path.arc.twopie.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.twopie.html">twopie</a>.1</h1>
+<p class="desc">arc() draws nothing when end = start + 2pi-e and anticlockwise</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 100;
+ctx.beginPath();
+ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, true);
+ctx.stroke();
+_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.twopie.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.twopie.2.html
new file mode 100644
index 0000000..11faa8f1
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.twopie.2.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.twopie.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.twopie.1.html" title="2d.path.arc.twopie.1">
+<link rel="next" href="2d.path.arc.twopie.3.html" title="2d.path.arc.twopie.3">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.twopie.1.html" accesskey="p" title="[p] 2d.path.arc.twopie.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.twopie.3.html" accesskey="n" title="[n] 2d.path.arc.twopie.3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.twopie.html">twopie</a>.2</h1>
+<p class="desc">arc() draws a full circle when end = start + 2pi-e and clockwise</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 100;
+ctx.beginPath();
+ctx.arc(50, 25, 50, 0, 2*Math.PI - 1e-4, false);
+ctx.stroke();
+_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.twopie.3.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.twopie.3.html
new file mode 100644
index 0000000..cda7457
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.twopie.3.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.twopie.3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.twopie.2.html" title="2d.path.arc.twopie.2">
+<link rel="next" href="2d.path.arc.twopie.4.html" title="2d.path.arc.twopie.4">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.twopie.2.html" accesskey="p" title="[p] 2d.path.arc.twopie.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.twopie.4.html" accesskey="n" title="[n] 2d.path.arc.twopie.4">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.twopie.html">twopie</a>.3</h1>
+<p class="desc">arc() draws a full circle when end = start + 2pi+e and anticlockwise</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 100;
+ctx.beginPath();
+ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, true);
+ctx.stroke();
+_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.twopie.4.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.twopie.4.html
new file mode 100644
index 0000000..e7b1cac
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.twopie.4.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.twopie.4</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.twopie.3.html" title="2d.path.arc.twopie.3">
+<link rel="next" href="2d.path.arc.shape.1.html" title="2d.path.arc.shape.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.twopie.3.html" accesskey="p" title="[p] 2d.path.arc.twopie.3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.shape.1.html" accesskey="n" title="[n] 2d.path.arc.shape.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.twopie.html">twopie</a>.4</h1>
+<p class="desc">arc() draws nothing when end = start + 2pi+e and clockwise</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 100;
+ctx.beginPath();
+ctx.arc(50, 25, 50, 0, 2*Math.PI + 1e-4, false);
+ctx.stroke();
+_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.zero.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.zero.1.html
new file mode 100644
index 0000000..5f42774
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.zero.1.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.zero.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.angle.6.html" title="2d.path.arc.angle.6">
+<link rel="next" href="2d.path.arc.zero.2.html" title="2d.path.arc.zero.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.angle.6.html" accesskey="p" title="[p] 2d.path.arc.angle.6"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.zero.2.html" accesskey="n" title="[n] 2d.path.arc.zero.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.zero.html">zero</a>.1</h1>
+<p class="desc">arc() draws nothing when startAngle = endAngle and anticlockwise</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 100;
+ctx.beginPath();
+ctx.arc(50, 25, 50, 0, 0, true);
+ctx.stroke();
+_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.zero.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.zero.2.html
new file mode 100644
index 0000000..bfb3d9c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.zero.2.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.zero.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.zero.1.html" title="2d.path.arc.zero.1">
+<link rel="next" href="2d.path.arc.twopie.1.html" title="2d.path.arc.twopie.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.zero.1.html" accesskey="p" title="[p] 2d.path.arc.zero.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.twopie.1.html" accesskey="n" title="[n] 2d.path.arc.twopie.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.<a href="index.2d.path.arc.zero.html">zero</a>.2</h1>
+<p class="desc">arc() draws nothing when startAngle = endAngle and clockwise</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.draw">2d.path.arc.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 100;
+ctx.beginPath();
+ctx.arc(50, 25, 50, 0, 0, false);
+ctx.stroke();
+_assertPixel(canvas, 50,20, 0,255,0,255, "50,20", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arc.zeroradius.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.zeroradius.html
new file mode 100644
index 0000000..ed7f7a7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arc.zeroradius.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arc.zeroradius</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.negative.html" title="2d.path.arc.negative">
+<link rel="next" href="2d.path.arc.scale.1.html" title="2d.path.arc.scale.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.negative.html" accesskey="p" title="[p] 2d.path.arc.negative"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.scale.1.html" accesskey="n" title="[n] 2d.path.arc.scale.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arc.html">arc</a>.zeroradius</h1>
+<p class="desc">arc() with zero radius draws a line to the start point</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arc.zero">2d.path.arc.zero</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00'
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 50;
+ctx.strokeStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(0, 25);
+ctx.arc(200, 25, 0, 0, Math.PI, true);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.coincide.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.coincide.1.html
new file mode 100644
index 0000000..3968537
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.coincide.1.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.coincide.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.ensuresubpath.2.html" title="2d.path.arcTo.ensuresubpath.2">
+<link rel="next" href="2d.path.arcTo.coincide.2.html" title="2d.path.arcTo.coincide.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.ensuresubpath.2.html" accesskey="p" title="[p] 2d.path.arcTo.ensuresubpath.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.coincide.2.html" accesskey="n" title="[n] 2d.path.arcTo.coincide.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.<a href="index.2d.path.arcTo.coincide.html">coincide</a>.1</h1>
+<p class="desc">arcTo() has no effect if P0 = P1</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arcTo.coincide.01">2d.path.arcTo.coincide.01</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 50;
+
+ctx.strokeStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(0, 25);
+ctx.arcTo(0, 25, 50, 1000, 1);
+ctx.lineTo(100, 25);
+ctx.stroke();
+
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(50, 25);
+ctx.arcTo(50, 25, 100, 25, 1);
+ctx.stroke();
+
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.coincide.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.coincide.2.html
new file mode 100644
index 0000000..303dc2a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.coincide.2.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.coincide.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.coincide.1.html" title="2d.path.arcTo.coincide.1">
+<link rel="next" href="2d.path.arcTo.collinear.1.html" title="2d.path.arcTo.collinear.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.coincide.1.html" accesskey="p" title="[p] 2d.path.arcTo.coincide.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.collinear.1.html" accesskey="n" title="[n] 2d.path.arcTo.collinear.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.<a href="index.2d.path.arcTo.coincide.html">coincide</a>.2</h1>
+<p class="desc">arcTo() draws a straight line to P1 if P1 = P2</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arcTo.coincide.12">2d.path.arcTo.coincide.12</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 50;
+ctx.strokeStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(0, 25);
+ctx.arcTo(100, 25, 100, 25, 1);
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.collinear.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.collinear.1.html
new file mode 100644
index 0000000..04d9cdc
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.collinear.1.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.collinear.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.coincide.2.html" title="2d.path.arcTo.coincide.2">
+<link rel="next" href="2d.path.arcTo.collinear.2.html" title="2d.path.arcTo.collinear.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.coincide.2.html" accesskey="p" title="[p] 2d.path.arcTo.coincide.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.collinear.2.html" accesskey="n" title="[n] 2d.path.arcTo.collinear.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.<a href="index.2d.path.arcTo.collinear.html">collinear</a>.1</h1>
+<p class="desc">arcTo() with all points on a line, and P1 between P0/P2, draws a straight line to P1</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arcTo.collinear">2d.path.arcTo.collinear</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 50;
+
+ctx.strokeStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(0, 25);
+ctx.arcTo(100, 25, 200, 25, 1);
+ctx.stroke();
+
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(-100, 25);
+ctx.arcTo(0, 25, 100, 25, 1);
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.collinear.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.collinear.2.html
new file mode 100644
index 0000000..fc0a0a7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.collinear.2.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.collinear.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.collinear.1.html" title="2d.path.arcTo.collinear.1">
+<link rel="next" href="2d.path.arcTo.collinear.3.html" title="2d.path.arcTo.collinear.3">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.collinear.1.html" accesskey="p" title="[p] 2d.path.arcTo.collinear.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.collinear.3.html" accesskey="n" title="[n] 2d.path.arcTo.collinear.3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.<a href="index.2d.path.arcTo.collinear.html">collinear</a>.2</h1>
+<p class="desc">arcTo() with all points on a line, and P2 between P0/P1, draws a straight line to P1</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arcTo.collinear">2d.path.arcTo.collinear</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 50;
+
+ctx.strokeStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(0, 25);
+ctx.arcTo(100, 25, 10, 25, 1);
+ctx.stroke();
+
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(100, 25);
+ctx.arcTo(200, 25, 110, 25, 1);
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.collinear.3.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.collinear.3.html
new file mode 100644
index 0000000..06143a0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.collinear.3.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.collinear.3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.collinear.2.html" title="2d.path.arcTo.collinear.2">
+<link rel="next" href="2d.path.arcTo.shape.curve1.html" title="2d.path.arcTo.shape.curve1">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.collinear.2.html" accesskey="p" title="[p] 2d.path.arcTo.collinear.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.shape.curve1.html" accesskey="n" title="[n] 2d.path.arcTo.shape.curve1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.<a href="index.2d.path.arcTo.collinear.html">collinear</a>.3</h1>
+<p class="desc">arcTo() with all points on a line, and P0 between P1/P2, draws a straight line to P1</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arcTo.collinear">2d.path.arcTo.collinear</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 50;
+
+ctx.strokeStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(0, 25);
+ctx.arcTo(100, 25, -100, 25, 1);
+ctx.stroke();
+
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(100, 25);
+ctx.arcTo(200, 25, 0, 25, 1);
+ctx.stroke();
+
+ctx.beginPath();
+ctx.moveTo(-100, 25);
+ctx.arcTo(0, 25, -200, 25, 1);
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.ensuresubpath.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.ensuresubpath.1.html
new file mode 100644
index 0000000..cb489dc
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.ensuresubpath.1.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.ensuresubpath.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.bezierCurveTo.nonfinite.html" title="2d.path.bezierCurveTo.nonfinite">
+<link rel="next" href="2d.path.arcTo.ensuresubpath.2.html" title="2d.path.arcTo.ensuresubpath.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.bezierCurveTo.nonfinite.html" accesskey="p" title="[p] 2d.path.bezierCurveTo.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.ensuresubpath.2.html" accesskey="n" title="[n] 2d.path.arcTo.ensuresubpath.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.<a href="index.2d.path.arcTo.ensuresubpath.html">ensuresubpath</a>.1</h1>
+<p class="desc">If there is no subpath, the first control point is added (and nothing is drawn up to it)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arcTo.empty">2d.path.arcTo.empty</a>
+<li><a href="spec.html#testrefs.2d.path.ensure">2d.path.ensure</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 50;
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.arcTo(100, 50, 200, 50, 0.1);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.ensuresubpath.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.ensuresubpath.2.html
new file mode 100644
index 0000000..6412f7f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.ensuresubpath.2.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.ensuresubpath.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.ensuresubpath.1.html" title="2d.path.arcTo.ensuresubpath.1">
+<link rel="next" href="2d.path.arcTo.coincide.1.html" title="2d.path.arcTo.coincide.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.ensuresubpath.1.html" accesskey="p" title="[p] 2d.path.arcTo.ensuresubpath.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.coincide.1.html" accesskey="n" title="[n] 2d.path.arcTo.coincide.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.<a href="index.2d.path.arcTo.ensuresubpath.html">ensuresubpath</a>.2</h1>
+<p class="desc">If there is no subpath, the first control point is added</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arcTo.empty">2d.path.arcTo.empty</a>
+<li><a href="spec.html#testrefs.2d.path.ensure">2d.path.ensure</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 50;
+ctx.strokeStyle = '#0f0';
+ctx.beginPath();
+ctx.arcTo(0, 25, 50, 250, 0.1); // adds (x1,y1), draws nothing
+ctx.lineTo(100, 25);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.negative.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.negative.html
new file mode 100644
index 0000000..18151cb
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.negative.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.negative</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.shape.end.html" title="2d.path.arcTo.shape.end">
+<link rel="next" href="2d.path.arcTo.zero.1.html" title="2d.path.arcTo.zero.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.shape.end.html" accesskey="p" title="[p] 2d.path.arcTo.shape.end"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.zero.1.html" accesskey="n" title="[n] 2d.path.arcTo.zero.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.negative</h1>
+<p class="desc">arcTo() with negative radius throws an exception</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arcTo.negative">2d.path.arcTo.negative</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.arcTo(0, 0, 0, 0, -1);
+} catch (e) { if (e.code != DOMException.INDEX_SIZE_ERR) _fail("Failed assertion: expected exception of type INDEX_SIZE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INDEX_SIZE_ERR: ctx.arcTo(0, 0, 0, 0, -1)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.nonfinite.html
new file mode 100644
index 0000000..408fde8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.nonfinite.html
@@ -0,0 +1,81 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.scale.html" title="2d.path.arcTo.scale">
+<link rel="next" href="2d.path.arc.empty.html" title="2d.path.arc.empty">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.scale.html" accesskey="p" title="[p] 2d.path.arcTo.scale"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arc.empty.html" accesskey="n" title="[n] 2d.path.arc.empty">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.nonfinite</h1>
+<p class="desc">arcTo() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.moveTo(0, 0);
+ctx.lineTo(100, 0);
+ctx.arcTo(Infinity, 50, 0, 50, 0);
+ctx.arcTo(-Infinity, 50, 0, 50, 0);
+ctx.arcTo(NaN, 50, 0, 50, 0);
+ctx.arcTo(0, Infinity, 0, 50, 0);
+ctx.arcTo(0, -Infinity, 0, 50, 0);
+ctx.arcTo(0, NaN, 0, 50, 0);
+ctx.arcTo(0, 50, Infinity, 50, 0);
+ctx.arcTo(0, 50, -Infinity, 50, 0);
+ctx.arcTo(0, 50, NaN, 50, 0);
+ctx.arcTo(0, 50, 0, Infinity, 0);
+ctx.arcTo(0, 50, 0, -Infinity, 0);
+ctx.arcTo(0, 50, 0, NaN, 0);
+ctx.arcTo(0, 50, 0, 50, Infinity);
+ctx.arcTo(0, 50, 0, 50, -Infinity);
+ctx.arcTo(0, 50, 0, 50, NaN);
+ctx.arcTo(Infinity, Infinity, 0, 50, 0);
+ctx.arcTo(Infinity, Infinity, Infinity, 50, 0);
+ctx.arcTo(Infinity, Infinity, Infinity, Infinity, 0);
+ctx.arcTo(Infinity, Infinity, Infinity, Infinity, Infinity);
+ctx.arcTo(Infinity, Infinity, Infinity, 50, Infinity);
+ctx.arcTo(Infinity, Infinity, 0, Infinity, 0);
+ctx.arcTo(Infinity, Infinity, 0, Infinity, Infinity);
+ctx.arcTo(Infinity, Infinity, 0, 50, Infinity);
+ctx.arcTo(Infinity, 50, Infinity, 50, 0);
+ctx.arcTo(Infinity, 50, Infinity, Infinity, 0);
+ctx.arcTo(Infinity, 50, Infinity, Infinity, Infinity);
+ctx.arcTo(Infinity, 50, Infinity, 50, Infinity);
+ctx.arcTo(Infinity, 50, 0, Infinity, 0);
+ctx.arcTo(Infinity, 50, 0, Infinity, Infinity);
+ctx.arcTo(Infinity, 50, 0, 50, Infinity);
+ctx.arcTo(0, Infinity, Infinity, 50, 0);
+ctx.arcTo(0, Infinity, Infinity, Infinity, 0);
+ctx.arcTo(0, Infinity, Infinity, Infinity, Infinity);
+ctx.arcTo(0, Infinity, Infinity, 50, Infinity);
+ctx.arcTo(0, Infinity, 0, Infinity, 0);
+ctx.arcTo(0, Infinity, 0, Infinity, Infinity);
+ctx.arcTo(0, Infinity, 0, 50, Infinity);
+ctx.arcTo(0, 50, Infinity, Infinity, 0);
+ctx.arcTo(0, 50, Infinity, Infinity, Infinity);
+ctx.arcTo(0, 50, Infinity, 50, Infinity);
+ctx.arcTo(0, 50, 0, Infinity, Infinity);
+ctx.lineTo(100, 50);
+ctx.lineTo(0, 50);
+ctx.fillStyle = '#0f0';
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.scale.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.scale.html
new file mode 100644
index 0000000..d97e6cd
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.scale.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.scale</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.transformation.html" title="2d.path.arcTo.transformation">
+<link rel="next" href="2d.path.arcTo.nonfinite.html" title="2d.path.arcTo.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.transformation.html" accesskey="p" title="[p] 2d.path.arcTo.transformation"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.nonfinite.html" accesskey="n" title="[n] 2d.path.arcTo.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.scale</h1>
+<p class="desc">arcTo scales the curve, not just the control points</p>
+<div class="refs">References:
+<ul>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(0, 50);
+ctx.translate(100, 0);
+ctx.scale(0.1, 1);
+ctx.arcTo(50, 50, 50, 0, 50);
+ctx.lineTo(-1000, 0);
+ctx.fill();
+
+_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255");
+_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255");
+_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255");
+_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255");
+_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255");
+_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255");
+_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.shape.curve1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.shape.curve1.html
new file mode 100644
index 0000000..2d0f214
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.shape.curve1.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.shape.curve1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.collinear.3.html" title="2d.path.arcTo.collinear.3">
+<link rel="next" href="2d.path.arcTo.shape.curve2.html" title="2d.path.arcTo.shape.curve2">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.collinear.3.html" accesskey="p" title="[p] 2d.path.arcTo.collinear.3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.shape.curve2.html" accesskey="n" title="[n] 2d.path.arcTo.shape.curve2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.<a href="index.2d.path.arcTo.shape.html">shape</a>.curve1</h1>
+<p class="desc">arcTo() curves in the right kind of shape</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arcTo.shape">2d.path.arcTo.shape</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var tol = 1.5; // tolerance to avoid antialiasing artifacts
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 10;
+ctx.beginPath();
+ctx.moveTo(10, 25);
+ctx.arcTo(75, 25, 75, 60, 20);
+ctx.stroke();
+
+ctx.fillStyle = '#0f0';
+ctx.beginPath();
+ctx.rect(10, 20, 45, 10);
+ctx.moveTo(80, 45);
+ctx.arc(55, 45, 25+tol, 0, -Math.PI/2, true);
+ctx.arc(55, 45, 15-tol, -Math.PI/2, 0, false);
+ctx.fill();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 55,19, 0,255,0,255, "55,19", "0,255,0,255");
+_assertPixel(canvas, 55,20, 0,255,0,255, "55,20", "0,255,0,255");
+_assertPixel(canvas, 55,21, 0,255,0,255, "55,21", "0,255,0,255");
+_assertPixel(canvas, 64,22, 0,255,0,255, "64,22", "0,255,0,255");
+_assertPixel(canvas, 65,21, 0,255,0,255, "65,21", "0,255,0,255");
+_assertPixel(canvas, 72,28, 0,255,0,255, "72,28", "0,255,0,255");
+_assertPixel(canvas, 73,27, 0,255,0,255, "73,27", "0,255,0,255");
+_assertPixel(canvas, 78,36, 0,255,0,255, "78,36", "0,255,0,255");
+_assertPixel(canvas, 79,35, 0,255,0,255, "79,35", "0,255,0,255");
+_assertPixel(canvas, 80,44, 0,255,0,255, "80,44", "0,255,0,255");
+_assertPixel(canvas, 80,45, 0,255,0,255, "80,45", "0,255,0,255");
+_assertPixel(canvas, 80,46, 0,255,0,255, "80,46", "0,255,0,255");
+_assertPixel(canvas, 65,45, 0,255,0,255, "65,45", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.shape.curve2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.shape.curve2.html
new file mode 100644
index 0000000..417c97f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.shape.curve2.html
@@ -0,0 +1,65 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.shape.curve2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.shape.curve1.html" title="2d.path.arcTo.shape.curve1">
+<link rel="next" href="2d.path.arcTo.shape.start.html" title="2d.path.arcTo.shape.start">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.shape.curve1.html" accesskey="p" title="[p] 2d.path.arcTo.shape.curve1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.shape.start.html" accesskey="n" title="[n] 2d.path.arcTo.shape.start">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.<a href="index.2d.path.arcTo.shape.html">shape</a>.curve2</h1>
+<p class="desc">arcTo() curves in the right kind of shape</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arcTo.shape">2d.path.arcTo.shape</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var tol = 1.5; // tolerance to avoid antialiasing artifacts
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#f00';
+ctx.beginPath();
+ctx.rect(10, 20, 45, 10);
+ctx.moveTo(80, 45);
+ctx.arc(55, 45, 25-tol, 0, -Math.PI/2, true);
+ctx.arc(55, 45, 15+tol, -Math.PI/2, 0, false);
+ctx.fill();
+
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 10;
+ctx.beginPath();
+ctx.moveTo(10, 25);
+ctx.arcTo(75, 25, 75, 60, 20);
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 55,19, 0,255,0,255, "55,19", "0,255,0,255");
+_assertPixel(canvas, 55,20, 0,255,0,255, "55,20", "0,255,0,255");
+_assertPixel(canvas, 55,21, 0,255,0,255, "55,21", "0,255,0,255");
+_assertPixel(canvas, 64,22, 0,255,0,255, "64,22", "0,255,0,255");
+_assertPixel(canvas, 65,21, 0,255,0,255, "65,21", "0,255,0,255");
+_assertPixel(canvas, 72,28, 0,255,0,255, "72,28", "0,255,0,255");
+_assertPixel(canvas, 73,27, 0,255,0,255, "73,27", "0,255,0,255");
+_assertPixel(canvas, 78,36, 0,255,0,255, "78,36", "0,255,0,255");
+_assertPixel(canvas, 79,35, 0,255,0,255, "79,35", "0,255,0,255");
+_assertPixel(canvas, 80,44, 0,255,0,255, "80,44", "0,255,0,255");
+_assertPixel(canvas, 80,45, 0,255,0,255, "80,45", "0,255,0,255");
+_assertPixel(canvas, 80,46, 0,255,0,255, "80,46", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.shape.end.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.shape.end.html
new file mode 100644
index 0000000..1c47810
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.shape.end.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.shape.end</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.shape.start.html" title="2d.path.arcTo.shape.start">
+<link rel="next" href="2d.path.arcTo.negative.html" title="2d.path.arcTo.negative">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.shape.start.html" accesskey="p" title="[p] 2d.path.arcTo.shape.start"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.negative.html" accesskey="n" title="[n] 2d.path.arcTo.negative">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.<a href="index.2d.path.arcTo.shape.html">shape</a>.end</h1>
+<p class="desc">arcTo() does not draw anything from P1 to P2</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arcTo.shape">2d.path.arcTo.shape</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 50;
+ctx.beginPath();
+ctx.moveTo(-100, -100);
+ctx.arcTo(-100, 25, 200, 25, 10);
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.shape.start.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.shape.start.html
new file mode 100644
index 0000000..4178d41
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.shape.start.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.shape.start</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.shape.curve2.html" title="2d.path.arcTo.shape.curve2">
+<link rel="next" href="2d.path.arcTo.shape.end.html" title="2d.path.arcTo.shape.end">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.shape.curve2.html" accesskey="p" title="[p] 2d.path.arcTo.shape.curve2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.shape.end.html" accesskey="n" title="[n] 2d.path.arcTo.shape.end">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.<a href="index.2d.path.arcTo.shape.html">shape</a>.start</h1>
+<p class="desc">arcTo() draws a straight line from P0 to P1</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arcTo.shape">2d.path.arcTo.shape</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 50;
+ctx.beginPath();
+ctx.moveTo(0, 25);
+ctx.arcTo(200, 25, 200, 50, 10);
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.transformation.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.transformation.html
new file mode 100644
index 0000000..a582e83
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.transformation.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.transformation</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.zero.2.html" title="2d.path.arcTo.zero.2">
+<link rel="next" href="2d.path.arcTo.scale.html" title="2d.path.arcTo.scale">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.zero.2.html" accesskey="p" title="[p] 2d.path.arcTo.zero.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.scale.html" accesskey="n" title="[n] 2d.path.arcTo.scale">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.transformation</h1>
+<p class="desc">arcTo joins up to the last subpath point correctly</p>
+<div class="refs">References:
+<ul>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(0, 50);
+ctx.translate(100, 0);
+ctx.arcTo(50, 50, 50, 0, 50);
+ctx.lineTo(-100, 0);
+ctx.fill();
+
+_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255");
+_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255");
+_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255");
+_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255");
+_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255");
+_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255");
+_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.zero.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.zero.1.html
new file mode 100644
index 0000000..4d1578f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.zero.1.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.zero.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.negative.html" title="2d.path.arcTo.negative">
+<link rel="next" href="2d.path.arcTo.zero.2.html" title="2d.path.arcTo.zero.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.negative.html" accesskey="p" title="[p] 2d.path.arcTo.negative"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.zero.2.html" accesskey="n" title="[n] 2d.path.arcTo.zero.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.<a href="index.2d.path.arcTo.zero.html">zero</a>.1</h1>
+<p class="desc">arcTo() with zero radius draws a straight line from P0 to P1</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arcTo.zeroradius">2d.path.arcTo.zeroradius</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 50;
+
+ctx.strokeStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(0, 25);
+ctx.arcTo(100, 25, 100, 100, 0);
+ctx.stroke();
+
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(0, -25);
+ctx.arcTo(50, -25, 50, 50, 0);
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.zero.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.zero.2.html
new file mode 100644
index 0000000..99fbdb6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.arcTo.zero.2.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.arcTo.zero.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arcTo.zero.1.html" title="2d.path.arcTo.zero.1">
+<link rel="next" href="2d.path.arcTo.transformation.html" title="2d.path.arcTo.transformation">
+<body class="show_output">
+<p>
+ <a href="2d.path.arcTo.zero.1.html" accesskey="p" title="[p] 2d.path.arcTo.zero.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.transformation.html" accesskey="n" title="[n] 2d.path.arcTo.transformation">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.arcTo.html">arcTo</a>.<a href="index.2d.path.arcTo.zero.html">zero</a>.2</h1>
+<p class="desc">arcTo() with zero radius draws a straight line from P0 to P1, even when all points are collinear</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.arcTo.zeroradius">2d.path.arcTo.zeroradius</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.lineWidth = 50;
+
+ctx.strokeStyle = '#0f0';
+ctx.beginPath();
+ctx.moveTo(0, 25);
+ctx.arcTo(100, 25, -100, 25, 0);
+ctx.stroke();
+
+ctx.strokeStyle = '#f00';
+ctx.beginPath();
+ctx.moveTo(100, 25);
+ctx.arcTo(200, 25, 50, 25, 0);
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.beginPath.html b/LayoutTests/fast/canvas/philip/tests/2d.path.beginPath.html
new file mode 100644
index 0000000..3f09083
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.beginPath.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.beginPath</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.initial.html" title="2d.path.initial">
+<link rel="next" href="2d.path.moveTo.basic.html" title="2d.path.moveTo.basic">
+<body class="show_output">
+<p>
+ <a href="2d.path.initial.html" accesskey="p" title="[p] 2d.path.initial"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.moveTo.basic.html" accesskey="n" title="[n] 2d.path.moveTo.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.beginPath</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.beginPath">2d.path.beginPath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.rect(0, 0, 100, 50);
+ctx.beginPath();
+ctx.fillStyle = '#f00';
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.basic.html
new file mode 100644
index 0000000..00dc352
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.basic.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.bezierCurveTo.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.bezierCurveTo.ensuresubpath.2.html" title="2d.path.bezierCurveTo.ensuresubpath.2">
+<link rel="next" href="2d.path.bezierCurveTo.shape.html" title="2d.path.bezierCurveTo.shape">
+<body class="show_output">
+<p>
+ <a href="2d.path.bezierCurveTo.ensuresubpath.2.html" accesskey="p" title="[p] 2d.path.bezierCurveTo.ensuresubpath.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.bezierCurveTo.shape.html" accesskey="n" title="[n] 2d.path.bezierCurveTo.shape">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.bezierCurveTo.html">bezierCurveTo</a>.basic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.bezier.nonempty">2d.path.bezier.nonempty</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 50;
+ctx.beginPath();
+ctx.moveTo(0, 25);
+ctx.bezierCurveTo(100, 25, 100, 25, 100, 25);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.ensuresubpath.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.ensuresubpath.1.html
new file mode 100644
index 0000000..55d047e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.ensuresubpath.1.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.bezierCurveTo.ensuresubpath.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.quadraticCurveTo.nonfinite.html" title="2d.path.quadraticCurveTo.nonfinite">
+<link rel="next" href="2d.path.bezierCurveTo.ensuresubpath.2.html" title="2d.path.bezierCurveTo.ensuresubpath.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.quadraticCurveTo.nonfinite.html" accesskey="p" title="[p] 2d.path.quadraticCurveTo.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.bezierCurveTo.ensuresubpath.2.html" accesskey="n" title="[n] 2d.path.bezierCurveTo.ensuresubpath.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.bezierCurveTo.html">bezierCurveTo</a>.<a href="index.2d.path.bezierCurveTo.ensuresubpath.html">ensuresubpath</a>.1</h1>
+<p class="desc">If there is no subpath, the first control point is added (and nothing is drawn up to it)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.bezier.empty">2d.path.bezier.empty</a>
+<li><a href="spec.html#testrefs.2d.path.ensure">2d.path.ensure</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 50;
+ctx.beginPath();
+ctx.bezierCurveTo(100, 50, 200, 50, 200, 50);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.ensuresubpath.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.ensuresubpath.2.html
new file mode 100644
index 0000000..3bac073d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.ensuresubpath.2.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.bezierCurveTo.ensuresubpath.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.bezierCurveTo.ensuresubpath.1.html" title="2d.path.bezierCurveTo.ensuresubpath.1">
+<link rel="next" href="2d.path.bezierCurveTo.basic.html" title="2d.path.bezierCurveTo.basic">
+<body class="show_output">
+<p>
+ <a href="2d.path.bezierCurveTo.ensuresubpath.1.html" accesskey="p" title="[p] 2d.path.bezierCurveTo.ensuresubpath.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.bezierCurveTo.basic.html" accesskey="n" title="[n] 2d.path.bezierCurveTo.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.bezierCurveTo.html">bezierCurveTo</a>.<a href="index.2d.path.bezierCurveTo.ensuresubpath.html">ensuresubpath</a>.2</h1>
+<p class="desc">If there is no subpath, the first control point is added</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.bezier.empty">2d.path.bezier.empty</a>
+<li><a href="spec.html#testrefs.2d.path.ensure">2d.path.ensure</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 50;
+ctx.beginPath();
+ctx.bezierCurveTo(0, 25, 100, 25, 100, 25);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.nonfinite.html
new file mode 100644
index 0000000..3c07c47
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.nonfinite.html
@@ -0,0 +1,115 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.bezierCurveTo.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.bezierCurveTo.scaled.html" title="2d.path.bezierCurveTo.scaled">
+<link rel="next" href="2d.path.arcTo.ensuresubpath.1.html" title="2d.path.arcTo.ensuresubpath.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.bezierCurveTo.scaled.html" accesskey="p" title="[p] 2d.path.bezierCurveTo.scaled"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.arcTo.ensuresubpath.1.html" accesskey="n" title="[n] 2d.path.arcTo.ensuresubpath.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.bezierCurveTo.html">bezierCurveTo</a>.nonfinite</h1>
+<p class="desc">bezierCurveTo() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.moveTo(0, 0);
+ctx.lineTo(100, 0);
+ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, 50);
+ctx.bezierCurveTo(-Infinity, 50, 0, 50, 0, 50);
+ctx.bezierCurveTo(NaN, 50, 0, 50, 0, 50);
+ctx.bezierCurveTo(0, Infinity, 0, 50, 0, 50);
+ctx.bezierCurveTo(0, -Infinity, 0, 50, 0, 50);
+ctx.bezierCurveTo(0, NaN, 0, 50, 0, 50);
+ctx.bezierCurveTo(0, 50, Infinity, 50, 0, 50);
+ctx.bezierCurveTo(0, 50, -Infinity, 50, 0, 50);
+ctx.bezierCurveTo(0, 50, NaN, 50, 0, 50);
+ctx.bezierCurveTo(0, 50, 0, Infinity, 0, 50);
+ctx.bezierCurveTo(0, 50, 0, -Infinity, 0, 50);
+ctx.bezierCurveTo(0, 50, 0, NaN, 0, 50);
+ctx.bezierCurveTo(0, 50, 0, 50, Infinity, 50);
+ctx.bezierCurveTo(0, 50, 0, 50, -Infinity, 50);
+ctx.bezierCurveTo(0, 50, 0, 50, NaN, 50);
+ctx.bezierCurveTo(0, 50, 0, 50, 0, Infinity);
+ctx.bezierCurveTo(0, 50, 0, 50, 0, -Infinity);
+ctx.bezierCurveTo(0, 50, 0, 50, 0, NaN);
+ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, 50);
+ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, 50);
+ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, 50);
+ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, 50);
+ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
+ctx.bezierCurveTo(Infinity, Infinity, Infinity, Infinity, 0, Infinity);
+ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, 50);
+ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, Infinity, Infinity);
+ctx.bezierCurveTo(Infinity, Infinity, Infinity, 50, 0, Infinity);
+ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, 50);
+ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, 50);
+ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, Infinity, Infinity);
+ctx.bezierCurveTo(Infinity, Infinity, 0, Infinity, 0, Infinity);
+ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, 50);
+ctx.bezierCurveTo(Infinity, Infinity, 0, 50, Infinity, Infinity);
+ctx.bezierCurveTo(Infinity, Infinity, 0, 50, 0, Infinity);
+ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, 50);
+ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, 50);
+ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, 50);
+ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, Infinity, Infinity);
+ctx.bezierCurveTo(Infinity, 50, Infinity, Infinity, 0, Infinity);
+ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, 50);
+ctx.bezierCurveTo(Infinity, 50, Infinity, 50, Infinity, Infinity);
+ctx.bezierCurveTo(Infinity, 50, Infinity, 50, 0, Infinity);
+ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, 50);
+ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, 50);
+ctx.bezierCurveTo(Infinity, 50, 0, Infinity, Infinity, Infinity);
+ctx.bezierCurveTo(Infinity, 50, 0, Infinity, 0, Infinity);
+ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, 50);
+ctx.bezierCurveTo(Infinity, 50, 0, 50, Infinity, Infinity);
+ctx.bezierCurveTo(Infinity, 50, 0, 50, 0, Infinity);
+ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, 50);
+ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, 50);
+ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, 50);
+ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, Infinity, Infinity);
+ctx.bezierCurveTo(0, Infinity, Infinity, Infinity, 0, Infinity);
+ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, 50);
+ctx.bezierCurveTo(0, Infinity, Infinity, 50, Infinity, Infinity);
+ctx.bezierCurveTo(0, Infinity, Infinity, 50, 0, Infinity);
+ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, 50);
+ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, 50);
+ctx.bezierCurveTo(0, Infinity, 0, Infinity, Infinity, Infinity);
+ctx.bezierCurveTo(0, Infinity, 0, Infinity, 0, Infinity);
+ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, 50);
+ctx.bezierCurveTo(0, Infinity, 0, 50, Infinity, Infinity);
+ctx.bezierCurveTo(0, Infinity, 0, 50, 0, Infinity);
+ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, 50);
+ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, 50);
+ctx.bezierCurveTo(0, 50, Infinity, Infinity, Infinity, Infinity);
+ctx.bezierCurveTo(0, 50, Infinity, Infinity, 0, Infinity);
+ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, 50);
+ctx.bezierCurveTo(0, 50, Infinity, 50, Infinity, Infinity);
+ctx.bezierCurveTo(0, 50, Infinity, 50, 0, Infinity);
+ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, 50);
+ctx.bezierCurveTo(0, 50, 0, Infinity, Infinity, Infinity);
+ctx.bezierCurveTo(0, 50, 0, Infinity, 0, Infinity);
+ctx.bezierCurveTo(0, 50, 0, 50, Infinity, Infinity);
+ctx.lineTo(100, 50);
+ctx.lineTo(0, 50);
+ctx.fillStyle = '#0f0';
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.scaled.html b/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.scaled.html
new file mode 100644
index 0000000..8902237
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.scaled.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.bezierCurveTo.scaled</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.bezierCurveTo.shape.html" title="2d.path.bezierCurveTo.shape">
+<link rel="next" href="2d.path.bezierCurveTo.nonfinite.html" title="2d.path.bezierCurveTo.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.path.bezierCurveTo.shape.html" accesskey="p" title="[p] 2d.path.bezierCurveTo.shape"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.bezierCurveTo.nonfinite.html" accesskey="n" title="[n] 2d.path.bezierCurveTo.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.bezierCurveTo.html">bezierCurveTo</a>.scaled</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.bezier.nonempty">2d.path.bezier.nonempty</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.scale(1000, 1000);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 0.055;
+ctx.beginPath();
+ctx.moveTo(-2, 3.1);
+ctx.bezierCurveTo(-2, -1, 2.1, -1, 2.1, 3.1);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.shape.html b/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.shape.html
new file mode 100644
index 0000000..1a3a9e4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.bezierCurveTo.shape.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.bezierCurveTo.shape</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.bezierCurveTo.basic.html" title="2d.path.bezierCurveTo.basic">
+<link rel="next" href="2d.path.bezierCurveTo.scaled.html" title="2d.path.bezierCurveTo.scaled">
+<body class="show_output">
+<p>
+ <a href="2d.path.bezierCurveTo.basic.html" accesskey="p" title="[p] 2d.path.bezierCurveTo.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.bezierCurveTo.scaled.html" accesskey="n" title="[n] 2d.path.bezierCurveTo.scaled">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.bezierCurveTo.html">bezierCurveTo</a>.shape</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.bezier.nonempty">2d.path.bezier.nonempty</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 55;
+ctx.beginPath();
+ctx.moveTo(-2000, 3100);
+ctx.bezierCurveTo(-2000, -1000, 2100, -1000, 2100, 3100);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.clip.basic.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.clip.basic.1.html
new file mode 100644
index 0000000..2fc8e40
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.clip.basic.1.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.clip.basic.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.clip.empty.html" title="2d.path.clip.empty">
+<link rel="next" href="2d.path.clip.basic.2.html" title="2d.path.clip.basic.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.clip.empty.html" accesskey="p" title="[p] 2d.path.clip.empty"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.clip.basic.2.html" accesskey="n" title="[n] 2d.path.clip.basic.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.clip.html">clip</a>.<a href="index.2d.path.clip.basic.html">basic</a>.1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.clip.basic">2d.path.clip.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.beginPath();
+ctx.rect(0, 0, 100, 50);
+ctx.clip();
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.clip.basic.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.clip.basic.2.html
new file mode 100644
index 0000000..4c6bb53
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.clip.basic.2.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.clip.basic.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.clip.basic.1.html" title="2d.path.clip.basic.1">
+<link rel="next" href="2d.path.clip.intersect.html" title="2d.path.clip.intersect">
+<body class="show_output">
+<p>
+ <a href="2d.path.clip.basic.1.html" accesskey="p" title="[p] 2d.path.clip.basic.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.clip.intersect.html" accesskey="n" title="[n] 2d.path.clip.intersect">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.clip.html">clip</a>.<a href="index.2d.path.clip.basic.html">basic</a>.2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.clip.basic">2d.path.clip.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.beginPath();
+ctx.rect(-100, 0, 100, 50);
+ctx.clip();
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.clip.empty.html b/LayoutTests/fast/canvas/philip/tests/2d.path.clip.empty.html
new file mode 100644
index 0000000..397708a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.clip.empty.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.clip.empty</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.transformation.changing.html" title="2d.path.transformation.changing">
+<link rel="next" href="2d.path.clip.basic.1.html" title="2d.path.clip.basic.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.transformation.changing.html" accesskey="p" title="[p] 2d.path.transformation.changing"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.clip.basic.1.html" accesskey="n" title="[n] 2d.path.clip.basic.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.clip.html">clip</a>.empty</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.clip.basic">2d.path.clip.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.beginPath();
+ctx.clip();
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.clip.intersect.html b/LayoutTests/fast/canvas/philip/tests/2d.path.clip.intersect.html
new file mode 100644
index 0000000..a8842d1
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.clip.intersect.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.clip.intersect</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.clip.basic.2.html" title="2d.path.clip.basic.2">
+<link rel="next" href="2d.path.clip.winding.1.html" title="2d.path.clip.winding.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.clip.basic.2.html" accesskey="p" title="[p] 2d.path.clip.basic.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.clip.winding.1.html" accesskey="n" title="[n] 2d.path.clip.winding.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.clip.html">clip</a>.intersect</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.clip.basic">2d.path.clip.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.beginPath();
+ctx.rect(0, 0, 50, 50);
+ctx.clip();
+ctx.beginPath();
+ctx.rect(50, 0, 50, 50)
+ctx.clip();
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.clip.unaffected.html b/LayoutTests/fast/canvas/philip/tests/2d.path.clip.unaffected.html
new file mode 100644
index 0000000..0994d93
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.clip.unaffected.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.clip.unaffected</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.clip.winding.2.html" title="2d.path.clip.winding.2">
+<link rel="next" href="2d.path.isPointInPath.basic.1.html" title="2d.path.isPointInPath.basic.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.clip.winding.2.html" accesskey="p" title="[p] 2d.path.clip.winding.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.isPointInPath.basic.1.html" accesskey="n" title="[n] 2d.path.isPointInPath.basic.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.clip.html">clip</a>.unaffected</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.clip.closed">2d.path.clip.closed</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+
+ctx.beginPath();
+ctx.moveTo(0, 0);
+ctx.lineTo(0, 50);
+ctx.lineTo(100, 50);
+ctx.lineTo(100, 0);
+ctx.clip();
+
+ctx.lineTo(0, 0);
+ctx.fill();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.clip.winding.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.clip.winding.1.html
new file mode 100644
index 0000000..5ddd50d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.clip.winding.1.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.clip.winding.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.clip.intersect.html" title="2d.path.clip.intersect">
+<link rel="next" href="2d.path.clip.winding.2.html" title="2d.path.clip.winding.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.clip.intersect.html" accesskey="p" title="[p] 2d.path.clip.intersect"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.clip.winding.2.html" accesskey="n" title="[n] 2d.path.clip.winding.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.clip.html">clip</a>.<a href="index.2d.path.clip.winding.html">winding</a>.1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.clip.basic">2d.path.clip.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.beginPath();
+ctx.moveTo(-10, -10);
+ctx.lineTo(110, -10);
+ctx.lineTo(110, 60);
+ctx.lineTo(-10, 60);
+ctx.lineTo(-10, -10);
+ctx.lineTo(0, 0);
+ctx.lineTo(0, 50);
+ctx.lineTo(100, 50);
+ctx.lineTo(100, 0);
+ctx.clip();
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.clip.winding.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.clip.winding.2.html
new file mode 100644
index 0000000..a34782b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.clip.winding.2.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.clip.winding.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.clip.winding.1.html" title="2d.path.clip.winding.1">
+<link rel="next" href="2d.path.clip.unaffected.html" title="2d.path.clip.unaffected">
+<body class="show_output">
+<p>
+ <a href="2d.path.clip.winding.1.html" accesskey="p" title="[p] 2d.path.clip.winding.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.clip.unaffected.html" accesskey="n" title="[n] 2d.path.clip.unaffected">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.clip.html">clip</a>.<a href="index.2d.path.clip.winding.html">winding</a>.2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.clip.basic">2d.path.clip.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.beginPath();
+ctx.moveTo(-10, -10);
+ctx.lineTo(110, -10);
+ctx.lineTo(110, 60);
+ctx.lineTo(-10, 60);
+ctx.lineTo(-10, -10);
+ctx.clip();
+
+ctx.beginPath();
+ctx.moveTo(0, 0);
+ctx.lineTo(0, 50);
+ctx.lineTo(100, 50);
+ctx.lineTo(100, 0);
+ctx.lineTo(0, 0);
+ctx.clip();
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.closePath.empty.html b/LayoutTests/fast/canvas/philip/tests/2d.path.closePath.empty.html
new file mode 100644
index 0000000..e5e6f39
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.closePath.empty.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.closePath.empty</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.moveTo.nonfinite.html" title="2d.path.moveTo.nonfinite">
+<link rel="next" href="2d.path.closePath.newline.html" title="2d.path.closePath.newline">
+<body class="show_output">
+<p>
+ <a href="2d.path.moveTo.nonfinite.html" accesskey="p" title="[p] 2d.path.moveTo.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.closePath.newline.html" accesskey="n" title="[n] 2d.path.closePath.newline">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.closePath.html">closePath</a>.empty</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.closePath.empty">2d.path.closePath.empty</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.closePath();
+ctx.fillStyle = '#f00';
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.closePath.newline.html b/LayoutTests/fast/canvas/philip/tests/2d.path.closePath.newline.html
new file mode 100644
index 0000000..1ea4459
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.closePath.newline.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.closePath.newline</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.closePath.empty.html" title="2d.path.closePath.empty">
+<link rel="next" href="2d.path.closePath.nextpoint.html" title="2d.path.closePath.nextpoint">
+<body class="show_output">
+<p>
+ <a href="2d.path.closePath.empty.html" accesskey="p" title="[p] 2d.path.closePath.empty"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.closePath.nextpoint.html" accesskey="n" title="[n] 2d.path.closePath.nextpoint">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.closePath.html">closePath</a>.newline</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.closePath.nonempty">2d.path.closePath.nonempty</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 50;
+ctx.moveTo(-100, 25);
+ctx.lineTo(-100, -100);
+ctx.lineTo(200, -100);
+ctx.lineTo(200, 25);
+ctx.closePath();
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.closePath.nextpoint.html b/LayoutTests/fast/canvas/philip/tests/2d.path.closePath.nextpoint.html
new file mode 100644
index 0000000..b5bb14d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.closePath.nextpoint.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.closePath.nextpoint</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.closePath.newline.html" title="2d.path.closePath.newline">
+<link rel="next" href="2d.path.lineTo.ensuresubpath.1.html" title="2d.path.lineTo.ensuresubpath.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.closePath.newline.html" accesskey="p" title="[p] 2d.path.closePath.newline"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.lineTo.ensuresubpath.1.html" accesskey="n" title="[n] 2d.path.lineTo.ensuresubpath.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.closePath.html">closePath</a>.nextpoint</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.closePath.nonempty">2d.path.closePath.nonempty</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 50;
+ctx.moveTo(-100, 25);
+ctx.lineTo(-100, -1000);
+ctx.closePath();
+ctx.lineTo(1000, 25);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.fill.closed.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.closed.basic.html
new file mode 100644
index 0000000..41ca080
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.closed.basic.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.fill.closed.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.fill.winding.subtract.3.html" title="2d.path.fill.winding.subtract.3">
+<link rel="next" href="2d.path.fill.closed.unaffected.html" title="2d.path.fill.closed.unaffected">
+<body class="show_output">
+<p>
+ <a href="2d.path.fill.winding.subtract.3.html" accesskey="p" title="[p] 2d.path.fill.winding.subtract.3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.fill.closed.unaffected.html" accesskey="n" title="[n] 2d.path.fill.closed.unaffected">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.fill.html">fill</a>.<a href="index.2d.path.fill.closed.html">closed</a>.basic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.fill.closed">2d.path.fill.closed</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.moveTo(0, 0);
+ctx.lineTo(100, 0);
+ctx.lineTo(100, 50);
+ctx.lineTo(0, 50);
+ctx.fill();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.fill.closed.unaffected.html b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.closed.unaffected.html
new file mode 100644
index 0000000..56ef9f6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.closed.unaffected.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.fill.closed.unaffected</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.fill.closed.basic.html" title="2d.path.fill.closed.basic">
+<link rel="next" href="2d.path.stroke.overlap.html" title="2d.path.stroke.overlap">
+<body class="show_output">
+<p>
+ <a href="2d.path.fill.closed.basic.html" accesskey="p" title="[p] 2d.path.fill.closed.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.stroke.overlap.html" accesskey="n" title="[n] 2d.path.stroke.overlap">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.fill.html">fill</a>.<a href="index.2d.path.fill.closed.html">closed</a>.unaffected</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.fill.closed">2d.path.fill.closed</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#00f';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.moveTo(0, 0);
+ctx.lineTo(100, 0);
+ctx.lineTo(100, 50);
+ctx.fillStyle = '#f00';
+ctx.fill();
+ctx.lineTo(0, 50);
+ctx.fillStyle = '#0f0';
+ctx.fill();
+
+_assertPixel(canvas, 90,10, 0,255,0,255, "90,10", "0,255,0,255");
+_assertPixel(canvas, 10,40, 0,255,0,255, "10,40", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.fill.overlap.html b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.overlap.html
new file mode 100644
index 0000000..7de6b53
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.overlap.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.fill.overlap</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.rect.nonfinite.html" title="2d.path.rect.nonfinite">
+<link rel="next" href="2d.path.fill.winding.add.html" title="2d.path.fill.winding.add">
+<body class="show_output">
+<p>
+ <a href="2d.path.rect.nonfinite.html" accesskey="p" title="[p] 2d.path.rect.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.fill.winding.add.html" accesskey="n" title="[n] 2d.path.fill.winding.add">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.fill.html">fill</a>.overlap</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.fill.basic">2d.path.fill.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.path.fill.overlap.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#000';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.rect(0, 0, 100, 50);
+ctx.closePath();
+ctx.rect(10, 10, 80, 30);
+ctx.fill();
+
+_assertPixelApprox(canvas, 50,25, 0,127,0,255, "50,25", "0,127,0,255", 1);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.fill.overlap.png b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.overlap.png
new file mode 100644
index 0000000..0bd6828
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.overlap.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.fill.winding.add.html b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.winding.add.html
new file mode 100644
index 0000000..6e53a3d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.winding.add.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.fill.winding.add</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.fill.overlap.html" title="2d.path.fill.overlap">
+<link rel="next" href="2d.path.fill.winding.subtract.1.html" title="2d.path.fill.winding.subtract.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.fill.overlap.html" accesskey="p" title="[p] 2d.path.fill.overlap"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.fill.winding.subtract.1.html" accesskey="n" title="[n] 2d.path.fill.winding.subtract.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.fill.html">fill</a>.<a href="index.2d.path.fill.winding.html">winding</a>.add</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.fill.basic">2d.path.fill.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.moveTo(-10, -10);
+ctx.lineTo(110, -10);
+ctx.lineTo(110, 60);
+ctx.lineTo(-10, 60);
+ctx.lineTo(-10, -10);
+ctx.lineTo(0, 0);
+ctx.lineTo(100, 0);
+ctx.lineTo(100, 50);
+ctx.lineTo(0, 50);
+ctx.fill();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.fill.winding.subtract.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.winding.subtract.1.html
new file mode 100644
index 0000000..97d38a9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.winding.subtract.1.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.fill.winding.subtract.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.fill.winding.add.html" title="2d.path.fill.winding.add">
+<link rel="next" href="2d.path.fill.winding.subtract.2.html" title="2d.path.fill.winding.subtract.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.fill.winding.add.html" accesskey="p" title="[p] 2d.path.fill.winding.add"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.fill.winding.subtract.2.html" accesskey="n" title="[n] 2d.path.fill.winding.subtract.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.fill.html">fill</a>.<a href="index.2d.path.fill.winding.html">winding</a>.<a href="index.2d.path.fill.winding.subtract.html">subtract</a>.1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.fill.basic">2d.path.fill.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#f00';
+ctx.moveTo(-10, -10);
+ctx.lineTo(110, -10);
+ctx.lineTo(110, 60);
+ctx.lineTo(-10, 60);
+ctx.lineTo(-10, -10);
+ctx.lineTo(0, 0);
+ctx.lineTo(0, 50);
+ctx.lineTo(100, 50);
+ctx.lineTo(100, 0);
+ctx.fill();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.fill.winding.subtract.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.winding.subtract.2.html
new file mode 100644
index 0000000..7f4a782
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.winding.subtract.2.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.fill.winding.subtract.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.fill.winding.subtract.1.html" title="2d.path.fill.winding.subtract.1">
+<link rel="next" href="2d.path.fill.winding.subtract.3.html" title="2d.path.fill.winding.subtract.3">
+<body class="show_output">
+<p>
+ <a href="2d.path.fill.winding.subtract.1.html" accesskey="p" title="[p] 2d.path.fill.winding.subtract.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.fill.winding.subtract.3.html" accesskey="n" title="[n] 2d.path.fill.winding.subtract.3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.fill.html">fill</a>.<a href="index.2d.path.fill.winding.html">winding</a>.<a href="index.2d.path.fill.winding.subtract.html">subtract</a>.2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.fill.basic">2d.path.fill.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#f00';
+ctx.moveTo(-10, -10);
+ctx.lineTo(110, -10);
+ctx.lineTo(110, 60);
+ctx.lineTo(-10, 60);
+ctx.moveTo(0, 0);
+ctx.lineTo(0, 50);
+ctx.lineTo(100, 50);
+ctx.lineTo(100, 0);
+ctx.fill();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.fill.winding.subtract.3.html b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.winding.subtract.3.html
new file mode 100644
index 0000000..e451dd1
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.fill.winding.subtract.3.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.fill.winding.subtract.3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.fill.winding.subtract.2.html" title="2d.path.fill.winding.subtract.2">
+<link rel="next" href="2d.path.fill.closed.basic.html" title="2d.path.fill.closed.basic">
+<body class="show_output">
+<p>
+ <a href="2d.path.fill.winding.subtract.2.html" accesskey="p" title="[p] 2d.path.fill.winding.subtract.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.fill.closed.basic.html" accesskey="n" title="[n] 2d.path.fill.closed.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.fill.html">fill</a>.<a href="index.2d.path.fill.winding.html">winding</a>.<a href="index.2d.path.fill.winding.subtract.html">subtract</a>.3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.fill.basic">2d.path.fill.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.moveTo(-10, -10);
+ctx.lineTo(110, -10);
+ctx.lineTo(110, 60);
+ctx.lineTo(-10, 60);
+ctx.lineTo(-10, -10);
+ctx.lineTo(-20, -20);
+ctx.lineTo(120, -20);
+ctx.lineTo(120, 70);
+ctx.lineTo(-20, 70);
+ctx.lineTo(-20, -20);
+ctx.lineTo(0, 0);
+ctx.lineTo(0, 50);
+ctx.lineTo(100, 50);
+ctx.lineTo(100, 0);
+ctx.fill();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.initial.html b/LayoutTests/fast/canvas/philip/tests/2d.path.initial.html
new file mode 100644
index 0000000..bc9a9c1
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.initial.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.initial</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.strokeRect.nonfinite.html" title="2d.strokeRect.nonfinite">
+<link rel="next" href="2d.path.beginPath.html" title="2d.path.beginPath">
+<body class="show_output">
+<p>
+ <a href="2d.strokeRect.nonfinite.html" accesskey="p" title="[p] 2d.strokeRect.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.beginPath.html" accesskey="n" title="[n] 2d.path.beginPath">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.initial</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.initial">2d.path.initial</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.closePath();
+ctx.fillStyle = '#f00';
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.arc.html b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.arc.html
new file mode 100644
index 0000000..e707495
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.arc.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.isPointInPath.arc</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.isPointInPath.unclosed.html" title="2d.path.isPointInPath.unclosed">
+<link rel="next" href="2d.path.isPointInPath.bigarc.html" title="2d.path.isPointInPath.bigarc">
+<body class="show_output">
+<p>
+ <a href="2d.path.isPointInPath.unclosed.html" accesskey="p" title="[p] 2d.path.isPointInPath.unclosed"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.isPointInPath.bigarc.html" accesskey="n" title="[n] 2d.path.isPointInPath.bigarc">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.arc</h1>
+<p class="desc">isPointInPath() works on arcs</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.isPointInPath">2d.path.isPointInPath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.arc(50, 25, 10, 0, Math.PI, false);
+_assertSame(ctx.isPointInPath(50, 10), false, "ctx.isPointInPath(50, 10)", "false");
+_assertSame(ctx.isPointInPath(50, 20), false, "ctx.isPointInPath(50, 20)", "false");
+_assertSame(ctx.isPointInPath(50, 30), true, "ctx.isPointInPath(50, 30)", "true");
+_assertSame(ctx.isPointInPath(50, 40), false, "ctx.isPointInPath(50, 40)", "false");
+_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false");
+_assertSame(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false");
+_assertSame(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false");
+_assertSame(ctx.isPointInPath(70, 30), false, "ctx.isPointInPath(70, 30)", "false");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.basic.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.basic.1.html
new file mode 100644
index 0000000..d88a2e5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.basic.1.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.isPointInPath.basic.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.clip.unaffected.html" title="2d.path.clip.unaffected">
+<link rel="next" href="2d.path.isPointInPath.basic.2.html" title="2d.path.isPointInPath.basic.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.clip.unaffected.html" accesskey="p" title="[p] 2d.path.clip.unaffected"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.isPointInPath.basic.2.html" accesskey="n" title="[n] 2d.path.isPointInPath.basic.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.<a href="index.2d.path.isPointInPath.basic.html">basic</a>.1</h1>
+<p class="desc">isPointInPath() detects whether the point is inside the path</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.isPointInPath">2d.path.isPointInPath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.rect(0, 0, 20, 20);
+_assertSame(ctx.isPointInPath(10, 10), true, "ctx.isPointInPath(10, 10)", "true");
+_assertSame(ctx.isPointInPath(30, 10), false, "ctx.isPointInPath(30, 10)", "false");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.basic.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.basic.2.html
new file mode 100644
index 0000000..b61a9c6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.basic.2.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.isPointInPath.basic.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.isPointInPath.basic.1.html" title="2d.path.isPointInPath.basic.1">
+<link rel="next" href="2d.path.isPointInPath.edge.html" title="2d.path.isPointInPath.edge">
+<body class="show_output">
+<p>
+ <a href="2d.path.isPointInPath.basic.1.html" accesskey="p" title="[p] 2d.path.isPointInPath.basic.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.isPointInPath.edge.html" accesskey="n" title="[n] 2d.path.isPointInPath.edge">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.<a href="index.2d.path.isPointInPath.basic.html">basic</a>.2</h1>
+<p class="desc">isPointInPath() detects whether the point is inside the path</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.isPointInPath">2d.path.isPointInPath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.rect(20, 0, 20, 20);
+_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false");
+_assertSame(ctx.isPointInPath(30, 10), true, "ctx.isPointInPath(30, 10)", "true");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.bezier.html b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.bezier.html
new file mode 100644
index 0000000..b9fa06c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.bezier.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.isPointInPath.bezier</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.isPointInPath.bigarc.html" title="2d.path.isPointInPath.bigarc">
+<link rel="next" href="2d.path.isPointInPath.winding.html" title="2d.path.isPointInPath.winding">
+<body class="show_output">
+<p>
+ <a href="2d.path.isPointInPath.bigarc.html" accesskey="p" title="[p] 2d.path.isPointInPath.bigarc"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.isPointInPath.winding.html" accesskey="n" title="[n] 2d.path.isPointInPath.winding">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.bezier</h1>
+<p class="desc">isPointInPath() works on Bezier curves</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.isPointInPath">2d.path.isPointInPath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.moveTo(25, 25);
+ctx.bezierCurveTo(50, -50, 50, 100, 75, 25);
+_assertEqual(ctx.isPointInPath(25, 20), false, "ctx.isPointInPath(25, 20)", "false");
+_assertEqual(ctx.isPointInPath(25, 30), false, "ctx.isPointInPath(25, 30)", "false");
+_assertEqual(ctx.isPointInPath(30, 20), true, "ctx.isPointInPath(30, 20)", "true");
+_assertEqual(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false");
+_assertEqual(ctx.isPointInPath(40, 2), false, "ctx.isPointInPath(40, 2)", "false");
+_assertEqual(ctx.isPointInPath(40, 20), true, "ctx.isPointInPath(40, 20)", "true");
+_assertEqual(ctx.isPointInPath(40, 30), false, "ctx.isPointInPath(40, 30)", "false");
+_assertEqual(ctx.isPointInPath(40, 47), false, "ctx.isPointInPath(40, 47)", "false");
+_assertEqual(ctx.isPointInPath(45, 20), true, "ctx.isPointInPath(45, 20)", "true");
+_assertEqual(ctx.isPointInPath(45, 30), false, "ctx.isPointInPath(45, 30)", "false");
+_assertEqual(ctx.isPointInPath(55, 20), false, "ctx.isPointInPath(55, 20)", "false");
+_assertEqual(ctx.isPointInPath(55, 30), true, "ctx.isPointInPath(55, 30)", "true");
+_assertEqual(ctx.isPointInPath(60, 2), false, "ctx.isPointInPath(60, 2)", "false");
+_assertEqual(ctx.isPointInPath(60, 20), false, "ctx.isPointInPath(60, 20)", "false");
+_assertEqual(ctx.isPointInPath(60, 30), true, "ctx.isPointInPath(60, 30)", "true");
+_assertEqual(ctx.isPointInPath(60, 47), false, "ctx.isPointInPath(60, 47)", "false");
+_assertEqual(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false");
+_assertEqual(ctx.isPointInPath(70, 30), true, "ctx.isPointInPath(70, 30)", "true");
+_assertEqual(ctx.isPointInPath(75, 20), false, "ctx.isPointInPath(75, 20)", "false");
+_assertEqual(ctx.isPointInPath(75, 30), false, "ctx.isPointInPath(75, 30)", "false");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.bigarc.html b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.bigarc.html
new file mode 100644
index 0000000..0e1e4ed
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.bigarc.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.isPointInPath.bigarc</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.isPointInPath.arc.html" title="2d.path.isPointInPath.arc">
+<link rel="next" href="2d.path.isPointInPath.bezier.html" title="2d.path.isPointInPath.bezier">
+<body class="show_output">
+<p>
+ <a href="2d.path.isPointInPath.arc.html" accesskey="p" title="[p] 2d.path.isPointInPath.arc"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.isPointInPath.bezier.html" accesskey="n" title="[n] 2d.path.isPointInPath.bezier">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.bigarc</h1>
+<p class="desc">isPointInPath() works on unclosed arcs larger than 2pi</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.isPointInPath">2d.path.isPointInPath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.arc(50, 25, 10, 0, 7, false);
+_assertSame(ctx.isPointInPath(50, 10), false, "ctx.isPointInPath(50, 10)", "false");
+_assertSame(ctx.isPointInPath(50, 20), true, "ctx.isPointInPath(50, 20)", "true");
+_assertSame(ctx.isPointInPath(50, 30), true, "ctx.isPointInPath(50, 30)", "true");
+_assertSame(ctx.isPointInPath(50, 40), false, "ctx.isPointInPath(50, 40)", "false");
+_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false");
+_assertSame(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false");
+_assertSame(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false");
+_assertSame(ctx.isPointInPath(70, 30), false, "ctx.isPointInPath(70, 30)", "false");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.edge.html b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.edge.html
new file mode 100644
index 0000000..8a564b2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.edge.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.isPointInPath.edge</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.isPointInPath.basic.2.html" title="2d.path.isPointInPath.basic.2">
+<link rel="next" href="2d.path.isPointInPath.empty.html" title="2d.path.isPointInPath.empty">
+<body class="show_output">
+<p>
+ <a href="2d.path.isPointInPath.basic.2.html" accesskey="p" title="[p] 2d.path.isPointInPath.basic.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.isPointInPath.empty.html" accesskey="n" title="[n] 2d.path.isPointInPath.empty">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.edge</h1>
+<p class="desc">isPointInPath() counts points on the path as being inside</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.isPointInPath.edge">2d.path.isPointInPath.edge</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.rect(0, 0, 20, 20);
+_assertSame(ctx.isPointInPath(0, 0), true, "ctx.isPointInPath(0, 0)", "true");
+_assertSame(ctx.isPointInPath(10, 0), true, "ctx.isPointInPath(10, 0)", "true");
+_assertSame(ctx.isPointInPath(20, 0), true, "ctx.isPointInPath(20, 0)", "true");
+_assertSame(ctx.isPointInPath(20, 10), true, "ctx.isPointInPath(20, 10)", "true");
+_assertSame(ctx.isPointInPath(20, 20), true, "ctx.isPointInPath(20, 20)", "true");
+_assertSame(ctx.isPointInPath(10, 20), true, "ctx.isPointInPath(10, 20)", "true");
+_assertSame(ctx.isPointInPath(0, 20), true, "ctx.isPointInPath(0, 20)", "true");
+_assertSame(ctx.isPointInPath(0, 10), true, "ctx.isPointInPath(0, 10)", "true");
+_assertSame(ctx.isPointInPath(10, -0.01), false, "ctx.isPointInPath(10, -0.01)", "false");
+_assertSame(ctx.isPointInPath(10, 20.01), false, "ctx.isPointInPath(10, 20.01)", "false");
+_assertSame(ctx.isPointInPath(-0.01, 10), false, "ctx.isPointInPath(-0.01, 10)", "false");
+_assertSame(ctx.isPointInPath(20.01, 10), false, "ctx.isPointInPath(20.01, 10)", "false");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.empty.html b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.empty.html
new file mode 100644
index 0000000..58e4e6b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.empty.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.isPointInPath.empty</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.isPointInPath.edge.html" title="2d.path.isPointInPath.edge">
+<link rel="next" href="2d.path.isPointInPath.subpath.html" title="2d.path.isPointInPath.subpath">
+<body class="show_output">
+<p>
+ <a href="2d.path.isPointInPath.edge.html" accesskey="p" title="[p] 2d.path.isPointInPath.edge"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.isPointInPath.subpath.html" accesskey="n" title="[n] 2d.path.isPointInPath.subpath">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.empty</h1>
+<p class="desc">isPointInPath() works when there is no path</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.isPointInPath">2d.path.isPointInPath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(ctx.isPointInPath(0, 0), false, "ctx.isPointInPath(0, 0)", "false");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.nonfinite.html
new file mode 100644
index 0000000..819650a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.nonfinite.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.isPointInPath.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.isPointInPath.transform.3.html" title="2d.path.isPointInPath.transform.3">
+<link rel="next" href="2d.drawImage.3arg.html" title="2d.drawImage.3arg">
+<body class="show_output">
+<p>
+ <a href="2d.path.isPointInPath.transform.3.html" accesskey="p" title="[p] 2d.path.isPointInPath.transform.3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.drawImage.3arg.html" accesskey="n" title="[n] 2d.drawImage.3arg">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.nonfinite</h1>
+<p class="desc">isPointInPath() returns false for non-finite arguments</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.isPointInPath.nonfinite">2d.path.isPointInPath.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.rect(-100, -50, 200, 100);
+_assertSame(ctx.isPointInPath(Infinity, 0), false, "ctx.isPointInPath(Infinity, 0)", "false");
+_assertSame(ctx.isPointInPath(-Infinity, 0), false, "ctx.isPointInPath(-Infinity, 0)", "false");
+_assertSame(ctx.isPointInPath(NaN, 0), false, "ctx.isPointInPath(NaN, 0)", "false");
+_assertSame(ctx.isPointInPath(0, Infinity), false, "ctx.isPointInPath(0, Infinity)", "false");
+_assertSame(ctx.isPointInPath(0, -Infinity), false, "ctx.isPointInPath(0, -Infinity)", "false");
+_assertSame(ctx.isPointInPath(0, NaN), false, "ctx.isPointInPath(0, NaN)", "false");
+_assertSame(ctx.isPointInPath(NaN, NaN), false, "ctx.isPointInPath(NaN, NaN)", "false");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.outside.html b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.outside.html
new file mode 100644
index 0000000..9c9ad9d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.outside.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.isPointInPath.outside</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.isPointInPath.subpath.html" title="2d.path.isPointInPath.subpath">
+<link rel="next" href="2d.path.isPointInPath.unclosed.html" title="2d.path.isPointInPath.unclosed">
+<body class="show_output">
+<p>
+ <a href="2d.path.isPointInPath.subpath.html" accesskey="p" title="[p] 2d.path.isPointInPath.subpath"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.isPointInPath.unclosed.html" accesskey="n" title="[n] 2d.path.isPointInPath.unclosed">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.outside</h1>
+<p class="desc">isPointInPath() works on paths outside the canvas</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.isPointInPath">2d.path.isPointInPath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.rect(0, -100, 20, 20);
+ctx.rect(20, -10, 20, 20);
+_assertSame(ctx.isPointInPath(10, -110), false, "ctx.isPointInPath(10, -110)", "false");
+_assertSame(ctx.isPointInPath(10, -90), true, "ctx.isPointInPath(10, -90)", "true");
+_assertSame(ctx.isPointInPath(10, -70), false, "ctx.isPointInPath(10, -70)", "false");
+_assertSame(ctx.isPointInPath(30, -20), false, "ctx.isPointInPath(30, -20)", "false");
+_assertSame(ctx.isPointInPath(30, 0), true, "ctx.isPointInPath(30, 0)", "true");
+_assertSame(ctx.isPointInPath(30, 20), false, "ctx.isPointInPath(30, 20)", "false");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.subpath.html b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.subpath.html
new file mode 100644
index 0000000..2fec7c4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.subpath.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.isPointInPath.subpath</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.isPointInPath.empty.html" title="2d.path.isPointInPath.empty">
+<link rel="next" href="2d.path.isPointInPath.outside.html" title="2d.path.isPointInPath.outside">
+<body class="show_output">
+<p>
+ <a href="2d.path.isPointInPath.empty.html" accesskey="p" title="[p] 2d.path.isPointInPath.empty"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.isPointInPath.outside.html" accesskey="n" title="[n] 2d.path.isPointInPath.outside">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.subpath</h1>
+<p class="desc">isPointInPath() uses the current path, not just the subpath</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.isPointInPath">2d.path.isPointInPath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.rect(0, 0, 20, 20);
+ctx.beginPath();
+ctx.rect(20, 0, 20, 20);
+ctx.closePath();
+ctx.rect(40, 0, 20, 20);
+_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false");
+_assertSame(ctx.isPointInPath(30, 10), true, "ctx.isPointInPath(30, 10)", "true");
+_assertSame(ctx.isPointInPath(50, 10), true, "ctx.isPointInPath(50, 10)", "true");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.transform.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.transform.1.html
new file mode 100644
index 0000000..ac90d2c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.transform.1.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.isPointInPath.transform.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.isPointInPath.winding.html" title="2d.path.isPointInPath.winding">
+<link rel="next" href="2d.path.isPointInPath.transform.2.html" title="2d.path.isPointInPath.transform.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.isPointInPath.winding.html" accesskey="p" title="[p] 2d.path.isPointInPath.winding"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.isPointInPath.transform.2.html" accesskey="n" title="[n] 2d.path.isPointInPath.transform.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.<a href="index.2d.path.isPointInPath.transform.html">transform</a>.1</h1>
+<p class="desc">isPointInPath() handles transformations correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.isPointInPath">2d.path.isPointInPath</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=405300">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.translate(50, 0);
+ctx.rect(0, 0, 20, 20);
+_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false");
+_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false");
+_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false");
+_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true");
+_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true");
+_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.transform.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.transform.2.html
new file mode 100644
index 0000000..d2279dc
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.transform.2.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.isPointInPath.transform.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.isPointInPath.transform.1.html" title="2d.path.isPointInPath.transform.1">
+<link rel="next" href="2d.path.isPointInPath.transform.3.html" title="2d.path.isPointInPath.transform.3">
+<body class="show_output">
+<p>
+ <a href="2d.path.isPointInPath.transform.1.html" accesskey="p" title="[p] 2d.path.isPointInPath.transform.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.isPointInPath.transform.3.html" accesskey="n" title="[n] 2d.path.isPointInPath.transform.3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.<a href="index.2d.path.isPointInPath.transform.html">transform</a>.2</h1>
+<p class="desc">isPointInPath() handles transformations correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.isPointInPath">2d.path.isPointInPath</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=405300">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.rect(50, 0, 20, 20);
+ctx.translate(50, 0);
+_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false");
+_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false");
+_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false");
+_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true");
+_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true");
+_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.transform.3.html b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.transform.3.html
new file mode 100644
index 0000000..8492a4e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.transform.3.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.isPointInPath.transform.3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.isPointInPath.transform.2.html" title="2d.path.isPointInPath.transform.2">
+<link rel="next" href="2d.path.isPointInPath.nonfinite.html" title="2d.path.isPointInPath.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.path.isPointInPath.transform.2.html" accesskey="p" title="[p] 2d.path.isPointInPath.transform.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.isPointInPath.nonfinite.html" accesskey="n" title="[n] 2d.path.isPointInPath.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.<a href="index.2d.path.isPointInPath.transform.html">transform</a>.3</h1>
+<p class="desc">isPointInPath() handles transformations correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.isPointInPath">2d.path.isPointInPath</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=405300">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.scale(-1, 1);
+ctx.rect(-70, 0, 20, 20);
+_assertSame(ctx.isPointInPath(-40, 10), false, "ctx.isPointInPath(-40, 10)", "false");
+_assertSame(ctx.isPointInPath(10, 10), false, "ctx.isPointInPath(10, 10)", "false");
+_assertSame(ctx.isPointInPath(49, 10), false, "ctx.isPointInPath(49, 10)", "false");
+_assertSame(ctx.isPointInPath(51, 10), true, "ctx.isPointInPath(51, 10)", "true");
+_assertSame(ctx.isPointInPath(69, 10), true, "ctx.isPointInPath(69, 10)", "true");
+_assertSame(ctx.isPointInPath(71, 10), false, "ctx.isPointInPath(71, 10)", "false");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.unclosed.html b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.unclosed.html
new file mode 100644
index 0000000..a2e30e4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.unclosed.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.isPointInPath.unclosed</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.isPointInPath.outside.html" title="2d.path.isPointInPath.outside">
+<link rel="next" href="2d.path.isPointInPath.arc.html" title="2d.path.isPointInPath.arc">
+<body class="show_output">
+<p>
+ <a href="2d.path.isPointInPath.outside.html" accesskey="p" title="[p] 2d.path.isPointInPath.outside"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.isPointInPath.arc.html" accesskey="n" title="[n] 2d.path.isPointInPath.arc">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.unclosed</h1>
+<p class="desc">isPointInPath() works on unclosed subpaths</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.isPointInPath">2d.path.isPointInPath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.moveTo(0, 0);
+ctx.lineTo(20, 0);
+ctx.lineTo(20, 20);
+ctx.lineTo(0, 20);
+_assertSame(ctx.isPointInPath(10, 10), true, "ctx.isPointInPath(10, 10)", "true");
+_assertSame(ctx.isPointInPath(30, 10), false, "ctx.isPointInPath(30, 10)", "false");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.winding.html b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.winding.html
new file mode 100644
index 0000000..95daf08
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.isPointInPath.winding.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.isPointInPath.winding</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.isPointInPath.bezier.html" title="2d.path.isPointInPath.bezier">
+<link rel="next" href="2d.path.isPointInPath.transform.1.html" title="2d.path.isPointInPath.transform.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.isPointInPath.bezier.html" accesskey="p" title="[p] 2d.path.isPointInPath.bezier"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.isPointInPath.transform.1.html" accesskey="n" title="[n] 2d.path.isPointInPath.transform.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.isPointInPath.html">isPointInPath</a>.winding</h1>
+<p class="desc">isPointInPath() uses the non-zero winding number rule</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.isPointInPath">2d.path.isPointInPath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Create a square ring, using opposite windings to make a hole in the centre
+ctx.moveTo(0, 0);
+ctx.lineTo(50, 0);
+ctx.lineTo(50, 50);
+ctx.lineTo(0, 50);
+ctx.lineTo(0, 0);
+ctx.lineTo(10, 10);
+ctx.lineTo(10, 40);
+ctx.lineTo(40, 40);
+ctx.lineTo(40, 10);
+ctx.lineTo(10, 10);
+
+_assertSame(ctx.isPointInPath(5, 5), true, "ctx.isPointInPath(5, 5)", "true");
+_assertSame(ctx.isPointInPath(25, 5), true, "ctx.isPointInPath(25, 5)", "true");
+_assertSame(ctx.isPointInPath(45, 5), true, "ctx.isPointInPath(45, 5)", "true");
+_assertSame(ctx.isPointInPath(5, 25), true, "ctx.isPointInPath(5, 25)", "true");
+_assertSame(ctx.isPointInPath(25, 25), false, "ctx.isPointInPath(25, 25)", "false");
+_assertSame(ctx.isPointInPath(45, 25), true, "ctx.isPointInPath(45, 25)", "true");
+_assertSame(ctx.isPointInPath(5, 45), true, "ctx.isPointInPath(5, 45)", "true");
+_assertSame(ctx.isPointInPath(25, 45), true, "ctx.isPointInPath(25, 45)", "true");
+_assertSame(ctx.isPointInPath(45, 45), true, "ctx.isPointInPath(45, 45)", "true");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.lineTo.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.path.lineTo.basic.html
new file mode 100644
index 0000000..8ddcc5d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.lineTo.basic.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.lineTo.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.lineTo.ensuresubpath.2.html" title="2d.path.lineTo.ensuresubpath.2">
+<link rel="next" href="2d.path.lineTo.nextpoint.html" title="2d.path.lineTo.nextpoint">
+<body class="show_output">
+<p>
+ <a href="2d.path.lineTo.ensuresubpath.2.html" accesskey="p" title="[p] 2d.path.lineTo.ensuresubpath.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.lineTo.nextpoint.html" accesskey="n" title="[n] 2d.path.lineTo.nextpoint">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.lineTo.html">lineTo</a>.basic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.lineTo.nonempty">2d.path.lineTo.nonempty</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 50;
+ctx.beginPath();
+ctx.moveTo(0, 25);
+ctx.lineTo(100, 25);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.lineTo.ensuresubpath.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.lineTo.ensuresubpath.1.html
new file mode 100644
index 0000000..705b3c6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.lineTo.ensuresubpath.1.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.lineTo.ensuresubpath.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.closePath.nextpoint.html" title="2d.path.closePath.nextpoint">
+<link rel="next" href="2d.path.lineTo.ensuresubpath.2.html" title="2d.path.lineTo.ensuresubpath.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.closePath.nextpoint.html" accesskey="p" title="[p] 2d.path.closePath.nextpoint"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.lineTo.ensuresubpath.2.html" accesskey="n" title="[n] 2d.path.lineTo.ensuresubpath.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.lineTo.html">lineTo</a>.<a href="index.2d.path.lineTo.ensuresubpath.html">ensuresubpath</a>.1</h1>
+<p class="desc">If there is no subpath, the point is added and nothing is drawn</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.lineTo.empty">2d.path.lineTo.empty</a>
+<li><a href="spec.html#testrefs.2d.path.ensure">2d.path.ensure</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 50;
+ctx.beginPath();
+ctx.lineTo(100, 50);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.lineTo.ensuresubpath.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.lineTo.ensuresubpath.2.html
new file mode 100644
index 0000000..d4c534e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.lineTo.ensuresubpath.2.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.lineTo.ensuresubpath.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.lineTo.ensuresubpath.1.html" title="2d.path.lineTo.ensuresubpath.1">
+<link rel="next" href="2d.path.lineTo.basic.html" title="2d.path.lineTo.basic">
+<body class="show_output">
+<p>
+ <a href="2d.path.lineTo.ensuresubpath.1.html" accesskey="p" title="[p] 2d.path.lineTo.ensuresubpath.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.lineTo.basic.html" accesskey="n" title="[n] 2d.path.lineTo.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.lineTo.html">lineTo</a>.<a href="index.2d.path.lineTo.ensuresubpath.html">ensuresubpath</a>.2</h1>
+<p class="desc">If there is no subpath, the point is added and used for subsequent drawing</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.lineTo.empty">2d.path.lineTo.empty</a>
+<li><a href="spec.html#testrefs.2d.path.ensure">2d.path.ensure</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 50;
+ctx.beginPath();
+ctx.lineTo(0, 25);
+ctx.lineTo(100, 25);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.lineTo.nextpoint.html b/LayoutTests/fast/canvas/philip/tests/2d.path.lineTo.nextpoint.html
new file mode 100644
index 0000000..8033722
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.lineTo.nextpoint.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.lineTo.nextpoint</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.lineTo.basic.html" title="2d.path.lineTo.basic">
+<link rel="next" href="2d.path.lineTo.nonfinite.html" title="2d.path.lineTo.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.path.lineTo.basic.html" accesskey="p" title="[p] 2d.path.lineTo.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.lineTo.nonfinite.html" accesskey="n" title="[n] 2d.path.lineTo.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.lineTo.html">lineTo</a>.nextpoint</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.lineTo.nonempty">2d.path.lineTo.nonempty</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 50;
+ctx.beginPath();
+ctx.moveTo(-100, -100);
+ctx.lineTo(0, 25);
+ctx.lineTo(100, 25);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.lineTo.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.path.lineTo.nonfinite.html
new file mode 100644
index 0000000..2937e7b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.lineTo.nonfinite.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.lineTo.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.lineTo.nextpoint.html" title="2d.path.lineTo.nextpoint">
+<link rel="next" href="2d.path.quadraticCurveTo.ensuresubpath.1.html" title="2d.path.quadraticCurveTo.ensuresubpath.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.lineTo.nextpoint.html" accesskey="p" title="[p] 2d.path.lineTo.nextpoint"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.quadraticCurveTo.ensuresubpath.1.html" accesskey="n" title="[n] 2d.path.quadraticCurveTo.ensuresubpath.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.lineTo.html">lineTo</a>.nonfinite</h1>
+<p class="desc">lineTo() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.moveTo(0, 0);
+ctx.lineTo(100, 0);
+ctx.lineTo(Infinity, 50);
+ctx.lineTo(-Infinity, 50);
+ctx.lineTo(NaN, 50);
+ctx.lineTo(0, Infinity);
+ctx.lineTo(0, -Infinity);
+ctx.lineTo(0, NaN);
+ctx.lineTo(Infinity, Infinity);
+ctx.lineTo(100, 50);
+ctx.lineTo(0, 50);
+ctx.fillStyle = '#0f0';
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.moveTo.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.path.moveTo.basic.html
new file mode 100644
index 0000000..b90d040
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.moveTo.basic.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.moveTo.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.beginPath.html" title="2d.path.beginPath">
+<link rel="next" href="2d.path.moveTo.newsubpath.html" title="2d.path.moveTo.newsubpath">
+<body class="show_output">
+<p>
+ <a href="2d.path.beginPath.html" accesskey="p" title="[p] 2d.path.beginPath"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.moveTo.newsubpath.html" accesskey="n" title="[n] 2d.path.moveTo.newsubpath">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.moveTo.html">moveTo</a>.basic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.moveTo">2d.path.moveTo</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.rect(0, 0, 10, 50);
+ctx.moveTo(100, 0);
+ctx.lineTo(10, 0);
+ctx.lineTo(10, 50);
+ctx.lineTo(100, 50);
+ctx.fillStyle = '#0f0';
+ctx.fill();
+_assertPixel(canvas, 90,25, 0,255,0,255, "90,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.moveTo.multiple.html b/LayoutTests/fast/canvas/philip/tests/2d.path.moveTo.multiple.html
new file mode 100644
index 0000000..b1ab3c6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.moveTo.multiple.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.moveTo.multiple</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.moveTo.newsubpath.html" title="2d.path.moveTo.newsubpath">
+<link rel="next" href="2d.path.moveTo.nonfinite.html" title="2d.path.moveTo.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.path.moveTo.newsubpath.html" accesskey="p" title="[p] 2d.path.moveTo.newsubpath"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.moveTo.nonfinite.html" accesskey="n" title="[n] 2d.path.moveTo.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.moveTo.html">moveTo</a>.multiple</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.moveTo">2d.path.moveTo</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.moveTo(0, 25);
+ctx.moveTo(100, 25);
+ctx.moveTo(0, 25);
+ctx.lineTo(100, 25);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 50;
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.moveTo.newsubpath.html b/LayoutTests/fast/canvas/philip/tests/2d.path.moveTo.newsubpath.html
new file mode 100644
index 0000000..337ce7c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.moveTo.newsubpath.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.moveTo.newsubpath</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.moveTo.basic.html" title="2d.path.moveTo.basic">
+<link rel="next" href="2d.path.moveTo.multiple.html" title="2d.path.moveTo.multiple">
+<body class="show_output">
+<p>
+ <a href="2d.path.moveTo.basic.html" accesskey="p" title="[p] 2d.path.moveTo.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.moveTo.multiple.html" accesskey="n" title="[n] 2d.path.moveTo.multiple">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.moveTo.html">moveTo</a>.newsubpath</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.moveTo">2d.path.moveTo</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.beginPath();
+ctx.moveTo(0, 0);
+ctx.moveTo(100, 0);
+ctx.moveTo(100, 50);
+ctx.moveTo(0, 50);
+ctx.fillStyle = '#f00';
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.moveTo.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.path.moveTo.nonfinite.html
new file mode 100644
index 0000000..ec00eb4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.moveTo.nonfinite.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.moveTo.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.moveTo.multiple.html" title="2d.path.moveTo.multiple">
+<link rel="next" href="2d.path.closePath.empty.html" title="2d.path.closePath.empty">
+<body class="show_output">
+<p>
+ <a href="2d.path.moveTo.multiple.html" accesskey="p" title="[p] 2d.path.moveTo.multiple"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.closePath.empty.html" accesskey="n" title="[n] 2d.path.closePath.empty">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.moveTo.html">moveTo</a>.nonfinite</h1>
+<p class="desc">moveTo() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.moveTo(0, 0);
+ctx.lineTo(100, 0);
+ctx.moveTo(Infinity, 50);
+ctx.moveTo(-Infinity, 50);
+ctx.moveTo(NaN, 50);
+ctx.moveTo(0, Infinity);
+ctx.moveTo(0, -Infinity);
+ctx.moveTo(0, NaN);
+ctx.moveTo(Infinity, Infinity);
+ctx.lineTo(100, 50);
+ctx.lineTo(0, 50);
+ctx.fillStyle = '#0f0';
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.basic.html
new file mode 100644
index 0000000..3539351
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.basic.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.quadraticCurveTo.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.quadraticCurveTo.ensuresubpath.2.html" title="2d.path.quadraticCurveTo.ensuresubpath.2">
+<link rel="next" href="2d.path.quadraticCurveTo.shape.html" title="2d.path.quadraticCurveTo.shape">
+<body class="show_output">
+<p>
+ <a href="2d.path.quadraticCurveTo.ensuresubpath.2.html" accesskey="p" title="[p] 2d.path.quadraticCurveTo.ensuresubpath.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.quadraticCurveTo.shape.html" accesskey="n" title="[n] 2d.path.quadraticCurveTo.shape">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.quadraticCurveTo.html">quadraticCurveTo</a>.basic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.quadratic.nonempty">2d.path.quadratic.nonempty</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 50;
+ctx.beginPath();
+ctx.moveTo(0, 25);
+ctx.quadraticCurveTo(100, 25, 100, 25);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.ensuresubpath.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.ensuresubpath.1.html
new file mode 100644
index 0000000..831e4c7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.ensuresubpath.1.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.quadraticCurveTo.ensuresubpath.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.lineTo.nonfinite.html" title="2d.path.lineTo.nonfinite">
+<link rel="next" href="2d.path.quadraticCurveTo.ensuresubpath.2.html" title="2d.path.quadraticCurveTo.ensuresubpath.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.lineTo.nonfinite.html" accesskey="p" title="[p] 2d.path.lineTo.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.quadraticCurveTo.ensuresubpath.2.html" accesskey="n" title="[n] 2d.path.quadraticCurveTo.ensuresubpath.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.quadraticCurveTo.html">quadraticCurveTo</a>.<a href="index.2d.path.quadraticCurveTo.ensuresubpath.html">ensuresubpath</a>.1</h1>
+<p class="desc">If there is no subpath, the first control point is added (and nothing is drawn up to it)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.quadratic.empty">2d.path.quadratic.empty</a>
+<li><a href="spec.html#testrefs.2d.path.ensure">2d.path.ensure</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 50;
+ctx.beginPath();
+ctx.quadraticCurveTo(100, 50, 200, 50);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.ensuresubpath.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.ensuresubpath.2.html
new file mode 100644
index 0000000..0a01309
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.ensuresubpath.2.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.quadraticCurveTo.ensuresubpath.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.quadraticCurveTo.ensuresubpath.1.html" title="2d.path.quadraticCurveTo.ensuresubpath.1">
+<link rel="next" href="2d.path.quadraticCurveTo.basic.html" title="2d.path.quadraticCurveTo.basic">
+<body class="show_output">
+<p>
+ <a href="2d.path.quadraticCurveTo.ensuresubpath.1.html" accesskey="p" title="[p] 2d.path.quadraticCurveTo.ensuresubpath.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.quadraticCurveTo.basic.html" accesskey="n" title="[n] 2d.path.quadraticCurveTo.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.quadraticCurveTo.html">quadraticCurveTo</a>.<a href="index.2d.path.quadraticCurveTo.ensuresubpath.html">ensuresubpath</a>.2</h1>
+<p class="desc">If there is no subpath, the first control point is added</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.quadratic.empty">2d.path.quadratic.empty</a>
+<li><a href="spec.html#testrefs.2d.path.ensure">2d.path.ensure</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 50;
+ctx.beginPath();
+ctx.quadraticCurveTo(0, 25, 100, 25);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.nonfinite.html
new file mode 100644
index 0000000..383ecf8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.nonfinite.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.quadraticCurveTo.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.quadraticCurveTo.scaled.html" title="2d.path.quadraticCurveTo.scaled">
+<link rel="next" href="2d.path.bezierCurveTo.ensuresubpath.1.html" title="2d.path.bezierCurveTo.ensuresubpath.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.quadraticCurveTo.scaled.html" accesskey="p" title="[p] 2d.path.quadraticCurveTo.scaled"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.bezierCurveTo.ensuresubpath.1.html" accesskey="n" title="[n] 2d.path.bezierCurveTo.ensuresubpath.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.quadraticCurveTo.html">quadraticCurveTo</a>.nonfinite</h1>
+<p class="desc">quadraticCurveTo() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.moveTo(0, 0);
+ctx.lineTo(100, 0);
+ctx.quadraticCurveTo(Infinity, 50, 0, 50);
+ctx.quadraticCurveTo(-Infinity, 50, 0, 50);
+ctx.quadraticCurveTo(NaN, 50, 0, 50);
+ctx.quadraticCurveTo(0, Infinity, 0, 50);
+ctx.quadraticCurveTo(0, -Infinity, 0, 50);
+ctx.quadraticCurveTo(0, NaN, 0, 50);
+ctx.quadraticCurveTo(0, 50, Infinity, 50);
+ctx.quadraticCurveTo(0, 50, -Infinity, 50);
+ctx.quadraticCurveTo(0, 50, NaN, 50);
+ctx.quadraticCurveTo(0, 50, 0, Infinity);
+ctx.quadraticCurveTo(0, 50, 0, -Infinity);
+ctx.quadraticCurveTo(0, 50, 0, NaN);
+ctx.quadraticCurveTo(Infinity, Infinity, 0, 50);
+ctx.quadraticCurveTo(Infinity, Infinity, Infinity, 50);
+ctx.quadraticCurveTo(Infinity, Infinity, Infinity, Infinity);
+ctx.quadraticCurveTo(Infinity, Infinity, 0, Infinity);
+ctx.quadraticCurveTo(Infinity, 50, Infinity, 50);
+ctx.quadraticCurveTo(Infinity, 50, Infinity, Infinity);
+ctx.quadraticCurveTo(Infinity, 50, 0, Infinity);
+ctx.quadraticCurveTo(0, Infinity, Infinity, 50);
+ctx.quadraticCurveTo(0, Infinity, Infinity, Infinity);
+ctx.quadraticCurveTo(0, Infinity, 0, Infinity);
+ctx.quadraticCurveTo(0, 50, Infinity, Infinity);
+ctx.lineTo(100, 50);
+ctx.lineTo(0, 50);
+ctx.fillStyle = '#0f0';
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.scaled.html b/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.scaled.html
new file mode 100644
index 0000000..e526511
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.scaled.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.quadraticCurveTo.scaled</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.quadraticCurveTo.shape.html" title="2d.path.quadraticCurveTo.shape">
+<link rel="next" href="2d.path.quadraticCurveTo.nonfinite.html" title="2d.path.quadraticCurveTo.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.path.quadraticCurveTo.shape.html" accesskey="p" title="[p] 2d.path.quadraticCurveTo.shape"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.quadraticCurveTo.nonfinite.html" accesskey="n" title="[n] 2d.path.quadraticCurveTo.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.quadraticCurveTo.html">quadraticCurveTo</a>.scaled</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.quadratic.nonempty">2d.path.quadratic.nonempty</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.scale(1000, 1000);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 0.055;
+ctx.beginPath();
+ctx.moveTo(-1, 1.05);
+ctx.quadraticCurveTo(0, -1, 1.2, 1.05);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.shape.html b/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.shape.html
new file mode 100644
index 0000000..360d3bf
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.quadraticCurveTo.shape.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.quadraticCurveTo.shape</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.quadraticCurveTo.basic.html" title="2d.path.quadraticCurveTo.basic">
+<link rel="next" href="2d.path.quadraticCurveTo.scaled.html" title="2d.path.quadraticCurveTo.scaled">
+<body class="show_output">
+<p>
+ <a href="2d.path.quadraticCurveTo.basic.html" accesskey="p" title="[p] 2d.path.quadraticCurveTo.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.quadraticCurveTo.scaled.html" accesskey="n" title="[n] 2d.path.quadraticCurveTo.scaled">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.quadraticCurveTo.html">quadraticCurveTo</a>.shape</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.quadratic.nonempty">2d.path.quadratic.nonempty</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 55;
+ctx.beginPath();
+ctx.moveTo(-1000, 1050);
+ctx.quadraticCurveTo(0, -1000, 1200, 1050);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.rect.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.basic.html
new file mode 100644
index 0000000..623c86b0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.basic.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.rect.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.arc.nonfinite.html" title="2d.path.arc.nonfinite">
+<link rel="next" href="2d.path.rect.newsubpath.html" title="2d.path.rect.newsubpath">
+<body class="show_output">
+<p>
+ <a href="2d.path.arc.nonfinite.html" accesskey="p" title="[p] 2d.path.arc.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.rect.newsubpath.html" accesskey="n" title="[n] 2d.path.rect.newsubpath">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.rect.html">rect</a>.basic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.rect.subpath">2d.path.rect.subpath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.rect(0, 0, 100, 50);
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.rect.closed.html b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.closed.html
new file mode 100644
index 0000000..feba0a1
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.closed.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.rect.closed</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.rect.newsubpath.html" title="2d.path.rect.newsubpath">
+<link rel="next" href="2d.path.rect.end.1.html" title="2d.path.rect.end.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.rect.newsubpath.html" accesskey="p" title="[p] 2d.path.rect.newsubpath"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.rect.end.1.html" accesskey="n" title="[n] 2d.path.rect.end.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.rect.html">rect</a>.closed</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.rect.closed">2d.path.rect.closed</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 200;
+ctx.lineJoin = 'miter';
+ctx.rect(100, 50, 100, 100);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.rect.end.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.end.1.html
new file mode 100644
index 0000000..472fc35
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.end.1.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.rect.end.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.rect.closed.html" title="2d.path.rect.closed">
+<link rel="next" href="2d.path.rect.end.2.html" title="2d.path.rect.end.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.rect.closed.html" accesskey="p" title="[p] 2d.path.rect.closed"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.rect.end.2.html" accesskey="n" title="[n] 2d.path.rect.end.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.rect.html">rect</a>.<a href="index.2d.path.rect.end.html">end</a>.1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.rect.newsubpath">2d.path.rect.newsubpath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 100;
+ctx.rect(200, 100, 400, 1000);
+ctx.lineTo(-2000, -1000);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.rect.end.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.end.2.html
new file mode 100644
index 0000000..cdc607f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.end.2.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.rect.end.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.rect.end.1.html" title="2d.path.rect.end.1">
+<link rel="next" href="2d.path.rect.zero.1.html" title="2d.path.rect.zero.1">
+<body class="show_output">
+<p>
+ <a href="2d.path.rect.end.1.html" accesskey="p" title="[p] 2d.path.rect.end.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.rect.zero.1.html" accesskey="n" title="[n] 2d.path.rect.zero.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.rect.html">rect</a>.<a href="index.2d.path.rect.end.html">end</a>.2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.rect.newsubpath">2d.path.rect.newsubpath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 450;
+ctx.lineCap = 'round';
+ctx.lineJoin = 'bevel';
+ctx.rect(150, 150, 2000, 2000);
+ctx.lineTo(160, 160);
+ctx.stroke();
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.rect.negative.html b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.negative.html
new file mode 100644
index 0000000..8de12f6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.negative.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.rect.negative</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.rect.zero.6.html" title="2d.path.rect.zero.6">
+<link rel="next" href="2d.path.rect.winding.html" title="2d.path.rect.winding">
+<body class="show_output">
+<p>
+ <a href="2d.path.rect.zero.6.html" accesskey="p" title="[p] 2d.path.rect.zero.6"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.rect.winding.html" accesskey="n" title="[n] 2d.path.rect.winding">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.rect.html">rect</a>.negative</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.rect.subpath">2d.path.rect.subpath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.beginPath();
+ctx.fillStyle = '#0f0';
+ctx.rect(0, 0, 50, 25);
+ctx.rect(100, 0, -50, 25);
+ctx.rect(0, 50, 50, -25);
+ctx.rect(100, 50, -50, -25);
+ctx.fill();
+_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255");
+_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255");
+_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255");
+_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.rect.newsubpath.html b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.newsubpath.html
new file mode 100644
index 0000000..20f01ad
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.newsubpath.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.rect.newsubpath</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.rect.basic.html" title="2d.path.rect.basic">
+<link rel="next" href="2d.path.rect.closed.html" title="2d.path.rect.closed">
+<body class="show_output">
+<p>
+ <a href="2d.path.rect.basic.html" accesskey="p" title="[p] 2d.path.rect.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.rect.closed.html" accesskey="n" title="[n] 2d.path.rect.closed">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.rect.html">rect</a>.newsubpath</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.rect.subpath">2d.path.rect.subpath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.beginPath();
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 50;
+ctx.moveTo(-100, 25);
+ctx.lineTo(-50, 25);
+ctx.rect(200, 25, 1, 1);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.rect.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.nonfinite.html
new file mode 100644
index 0000000..8def033
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.nonfinite.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.rect.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.rect.selfintersect.html" title="2d.path.rect.selfintersect">
+<link rel="next" href="2d.path.fill.overlap.html" title="2d.path.fill.overlap">
+<body class="show_output">
+<p>
+ <a href="2d.path.rect.selfintersect.html" accesskey="p" title="[p] 2d.path.rect.selfintersect"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.fill.overlap.html" accesskey="n" title="[n] 2d.path.fill.overlap">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.rect.html">rect</a>.nonfinite</h1>
+<p class="desc">rect() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.moveTo(0, 0);
+ctx.lineTo(100, 0);
+ctx.rect(Infinity, 50, 1, 1);
+ctx.rect(-Infinity, 50, 1, 1);
+ctx.rect(NaN, 50, 1, 1);
+ctx.rect(0, Infinity, 1, 1);
+ctx.rect(0, -Infinity, 1, 1);
+ctx.rect(0, NaN, 1, 1);
+ctx.rect(0, 50, Infinity, 1);
+ctx.rect(0, 50, -Infinity, 1);
+ctx.rect(0, 50, NaN, 1);
+ctx.rect(0, 50, 1, Infinity);
+ctx.rect(0, 50, 1, -Infinity);
+ctx.rect(0, 50, 1, NaN);
+ctx.rect(Infinity, Infinity, 1, 1);
+ctx.rect(Infinity, Infinity, Infinity, 1);
+ctx.rect(Infinity, Infinity, Infinity, Infinity);
+ctx.rect(Infinity, Infinity, 1, Infinity);
+ctx.rect(Infinity, 50, Infinity, 1);
+ctx.rect(Infinity, 50, Infinity, Infinity);
+ctx.rect(Infinity, 50, 1, Infinity);
+ctx.rect(0, Infinity, Infinity, 1);
+ctx.rect(0, Infinity, Infinity, Infinity);
+ctx.rect(0, Infinity, 1, Infinity);
+ctx.rect(0, 50, Infinity, Infinity);
+ctx.lineTo(100, 50);
+ctx.lineTo(0, 50);
+ctx.fillStyle = '#0f0';
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 90,45, 0,255,0,255, "90,45", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.rect.selfintersect.html b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.selfintersect.html
new file mode 100644
index 0000000..3e2fddb
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.selfintersect.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.rect.selfintersect</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.rect.winding.html" title="2d.path.rect.winding">
+<link rel="next" href="2d.path.rect.nonfinite.html" title="2d.path.rect.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.path.rect.winding.html" accesskey="p" title="[p] 2d.path.rect.winding"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.rect.nonfinite.html" accesskey="n" title="[n] 2d.path.rect.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.rect.html">rect</a>.selfintersect</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 90;
+ctx.beginPath();
+ctx.rect(45, 20, 10, 10);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.rect.winding.html b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.winding.html
new file mode 100644
index 0000000..34ebce7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.winding.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.rect.winding</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.rect.negative.html" title="2d.path.rect.negative">
+<link rel="next" href="2d.path.rect.selfintersect.html" title="2d.path.rect.selfintersect">
+<body class="show_output">
+<p>
+ <a href="2d.path.rect.negative.html" accesskey="p" title="[p] 2d.path.rect.negative"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.rect.selfintersect.html" accesskey="n" title="[n] 2d.path.rect.selfintersect">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.rect.html">rect</a>.winding</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.rect.subpath">2d.path.rect.subpath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.beginPath();
+ctx.fillStyle = '#f00';
+ctx.rect(0, 0, 50, 50);
+ctx.rect(100, 50, -50, -50);
+ctx.rect(0, 25, 100, -25);
+ctx.rect(100, 25, -100, 25);
+ctx.fill();
+_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255");
+_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255");
+_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255");
+_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.1.html
new file mode 100644
index 0000000..e50a21f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.1.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.rect.zero.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.rect.end.2.html" title="2d.path.rect.end.2">
+<link rel="next" href="2d.path.rect.zero.2.html" title="2d.path.rect.zero.2">
+<body class="show_output">
+<p>
+ <a href="2d.path.rect.end.2.html" accesskey="p" title="[p] 2d.path.rect.end.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.rect.zero.2.html" accesskey="n" title="[n] 2d.path.rect.zero.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.rect.html">rect</a>.<a href="index.2d.path.rect.zero.html">zero</a>.1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.rect.subpath">2d.path.rect.subpath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 100;
+ctx.beginPath();
+ctx.rect(0, 50, 100, 0);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.2.html
new file mode 100644
index 0000000..e693b69
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.2.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.rect.zero.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.rect.zero.1.html" title="2d.path.rect.zero.1">
+<link rel="next" href="2d.path.rect.zero.3.html" title="2d.path.rect.zero.3">
+<body class="show_output">
+<p>
+ <a href="2d.path.rect.zero.1.html" accesskey="p" title="[p] 2d.path.rect.zero.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.rect.zero.3.html" accesskey="n" title="[n] 2d.path.rect.zero.3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.rect.html">rect</a>.<a href="index.2d.path.rect.zero.html">zero</a>.2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.rect.subpath">2d.path.rect.subpath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 100;
+ctx.beginPath();
+ctx.rect(50, -100, 0, 250);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.3.html b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.3.html
new file mode 100644
index 0000000..ab9b4da
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.3.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.rect.zero.3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.rect.zero.2.html" title="2d.path.rect.zero.2">
+<link rel="next" href="2d.path.rect.zero.4.html" title="2d.path.rect.zero.4">
+<body class="show_output">
+<p>
+ <a href="2d.path.rect.zero.2.html" accesskey="p" title="[p] 2d.path.rect.zero.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.rect.zero.4.html" accesskey="n" title="[n] 2d.path.rect.zero.4">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.rect.html">rect</a>.<a href="index.2d.path.rect.zero.html">zero</a>.3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.rect.subpath">2d.path.rect.subpath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 100;
+ctx.beginPath();
+ctx.rect(50, 25, 0, 0);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.4.html b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.4.html
new file mode 100644
index 0000000..fd70a69
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.4.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.rect.zero.4</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.rect.zero.3.html" title="2d.path.rect.zero.3">
+<link rel="next" href="2d.path.rect.zero.5.html" title="2d.path.rect.zero.5">
+<body class="show_output">
+<p>
+ <a href="2d.path.rect.zero.3.html" accesskey="p" title="[p] 2d.path.rect.zero.3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.rect.zero.5.html" accesskey="n" title="[n] 2d.path.rect.zero.5">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.rect.html">rect</a>.<a href="index.2d.path.rect.zero.html">zero</a>.4</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.rect.subpath">2d.path.rect.subpath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 50;
+ctx.rect(100, 25, 0, 0);
+ctx.lineTo(0, 25);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.5.html b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.5.html
new file mode 100644
index 0000000..d9bb7bd
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.5.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.rect.zero.5</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.rect.zero.4.html" title="2d.path.rect.zero.4">
+<link rel="next" href="2d.path.rect.zero.6.html" title="2d.path.rect.zero.6">
+<body class="show_output">
+<p>
+ <a href="2d.path.rect.zero.4.html" accesskey="p" title="[p] 2d.path.rect.zero.4"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.rect.zero.6.html" accesskey="n" title="[n] 2d.path.rect.zero.6">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.rect.html">rect</a>.<a href="index.2d.path.rect.zero.html">zero</a>.5</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.rect.subpath">2d.path.rect.subpath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 50;
+ctx.moveTo(0, 0);
+ctx.rect(100, 25, 0, 0);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.6.html b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.6.html
new file mode 100644
index 0000000..17c624d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.rect.zero.6.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.rect.zero.6</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.rect.zero.5.html" title="2d.path.rect.zero.5">
+<link rel="next" href="2d.path.rect.negative.html" title="2d.path.rect.negative">
+<body class="show_output">
+<p>
+ <a href="2d.path.rect.zero.5.html" accesskey="p" title="[p] 2d.path.rect.zero.5"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.rect.negative.html" accesskey="n" title="[n] 2d.path.rect.negative">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.rect.html">rect</a>.<a href="index.2d.path.rect.zero.html">zero</a>.6</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.rect.subpath">2d.path.rect.subpath</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.lineJoin = 'miter';
+ctx.miterLimit = 1.5;
+ctx.lineWidth = 200;
+ctx.beginPath();
+ctx.rect(100, 25, 1000, 0);
+ctx.stroke();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.empty.html b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.empty.html
new file mode 100644
index 0000000..97a0789
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.empty.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.stroke.empty</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.stroke.skew.html" title="2d.path.stroke.skew">
+<link rel="next" href="2d.path.stroke.prune.line.html" title="2d.path.stroke.prune.line">
+<body class="show_output">
+<p>
+ <a href="2d.path.stroke.skew.html" accesskey="p" title="[p] 2d.path.stroke.skew"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.stroke.prune.line.html" accesskey="n" title="[n] 2d.path.stroke.prune.line">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.stroke.html">stroke</a>.empty</h1>
+<p class="desc">Empty subpaths are not stroked</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.stroke.empty">2d.path.stroke.empty</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 100;
+ctx.lineCap = 'round';
+ctx.lineJoin = 'round';
+
+ctx.beginPath();
+ctx.moveTo(40, 25);
+ctx.moveTo(60, 25);
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.overlap.html b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.overlap.html
new file mode 100644
index 0000000..9860387
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.overlap.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.stroke.overlap</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.fill.closed.unaffected.html" title="2d.path.fill.closed.unaffected">
+<link rel="next" href="2d.path.stroke.union.html" title="2d.path.stroke.union">
+<body class="show_output">
+<p>
+ <a href="2d.path.fill.closed.unaffected.html" accesskey="p" title="[p] 2d.path.fill.closed.unaffected"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.stroke.union.html" accesskey="n" title="[n] 2d.path.stroke.union">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.stroke.html">stroke</a>.overlap</h1>
+<p class="desc">Stroked subpaths are combined before being drawn</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.stroke.basic">2d.path.stroke.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.path.stroke.overlap.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#000';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.strokeStyle = 'rgba(0, 255, 0, 0.5)';
+ctx.lineWidth = 50;
+ctx.moveTo(0, 20);
+ctx.lineTo(100, 20);
+ctx.moveTo(0, 30);
+ctx.lineTo(100, 30);
+ctx.stroke();
+
+_assertPixelApprox(canvas, 50,25, 0,127,0,255, "50,25", "0,127,0,255", 1);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.overlap.png b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.overlap.png
new file mode 100644
index 0000000..0bd6828
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.overlap.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.arc.html b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.arc.html
new file mode 100644
index 0000000..55219f4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.arc.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.stroke.prune.arc</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.stroke.prune.curve.html" title="2d.path.stroke.prune.curve">
+<link rel="next" href="2d.path.stroke.prune.rect.html" title="2d.path.stroke.prune.rect">
+<body class="show_output">
+<p>
+ <a href="2d.path.stroke.prune.curve.html" accesskey="p" title="[p] 2d.path.stroke.prune.curve"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.stroke.prune.rect.html" accesskey="n" title="[n] 2d.path.stroke.prune.rect">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.stroke.html">stroke</a>.<a href="index.2d.path.stroke.prune.html">prune</a>.arc</h1>
+<p class="desc">Zero-length line segments from arcTo and arc are removed before stroking</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.stroke.prune">2d.path.stroke.prune</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 100;
+ctx.lineCap = 'round';
+ctx.lineJoin = 'round';
+
+ctx.beginPath();
+ctx.moveTo(50, 25);
+ctx.arcTo(50, 25, 150, 25, 10);
+ctx.stroke();
+
+ctx.beginPath();
+ctx.moveTo(50, 25);
+ctx.arc(50, 25, 10, 0, 0, false);
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.closed.html b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.closed.html
new file mode 100644
index 0000000..4abb50b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.closed.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.stroke.prune.closed</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.stroke.prune.line.html" title="2d.path.stroke.prune.line">
+<link rel="next" href="2d.path.stroke.prune.curve.html" title="2d.path.stroke.prune.curve">
+<body class="show_output">
+<p>
+ <a href="2d.path.stroke.prune.line.html" accesskey="p" title="[p] 2d.path.stroke.prune.line"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.stroke.prune.curve.html" accesskey="n" title="[n] 2d.path.stroke.prune.curve">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.stroke.html">stroke</a>.<a href="index.2d.path.stroke.prune.html">prune</a>.closed</h1>
+<p class="desc">Zero-length line segments from closed paths are removed before stroking</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.stroke.prune">2d.path.stroke.prune</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 100;
+ctx.lineCap = 'round';
+ctx.lineJoin = 'round';
+
+ctx.beginPath();
+ctx.moveTo(50, 25);
+ctx.lineTo(50, 25);
+ctx.closePath();
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.corner.html b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.corner.html
new file mode 100644
index 0000000..821656a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.corner.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.stroke.prune.corner</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.stroke.prune.rect.html" title="2d.path.stroke.prune.rect">
+<link rel="next" href="2d.path.transformation.basic.html" title="2d.path.transformation.basic">
+<body class="show_output">
+<p>
+ <a href="2d.path.stroke.prune.rect.html" accesskey="p" title="[p] 2d.path.stroke.prune.rect"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.transformation.basic.html" accesskey="n" title="[n] 2d.path.transformation.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.stroke.html">stroke</a>.<a href="index.2d.path.stroke.prune.html">prune</a>.corner</h1>
+<p class="desc">Zero-length line segments are removed before stroking with miters</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.stroke.prune">2d.path.stroke.prune</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 400;
+ctx.lineJoin = 'miter';
+ctx.miterLimit = 1.4;
+
+ctx.beginPath();
+ctx.moveTo(-1000, 200, 0, 0);
+ctx.lineTo(-100, 200);
+ctx.lineTo(-100, 200);
+ctx.lineTo(-100, 200);
+ctx.lineTo(-100, 1000);
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.curve.html b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.curve.html
new file mode 100644
index 0000000..2a745ea
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.curve.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.stroke.prune.curve</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.stroke.prune.closed.html" title="2d.path.stroke.prune.closed">
+<link rel="next" href="2d.path.stroke.prune.arc.html" title="2d.path.stroke.prune.arc">
+<body class="show_output">
+<p>
+ <a href="2d.path.stroke.prune.closed.html" accesskey="p" title="[p] 2d.path.stroke.prune.closed"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.stroke.prune.arc.html" accesskey="n" title="[n] 2d.path.stroke.prune.arc">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.stroke.html">stroke</a>.<a href="index.2d.path.stroke.prune.html">prune</a>.curve</h1>
+<p class="desc">Zero-length line segments from quadraticCurveTo and bezierCurveTo are removed before stroking</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.stroke.prune">2d.path.stroke.prune</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 100;
+ctx.lineCap = 'round';
+ctx.lineJoin = 'round';
+
+ctx.beginPath();
+ctx.moveTo(50, 25);
+ctx.quadraticCurveTo(50, 25, 50, 25);
+ctx.stroke();
+
+ctx.beginPath();
+ctx.moveTo(50, 25);
+ctx.bezierCurveTo(50, 25, 50, 25, 50, 25);
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.line.html b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.line.html
new file mode 100644
index 0000000..5be8a9b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.line.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.stroke.prune.line</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.stroke.empty.html" title="2d.path.stroke.empty">
+<link rel="next" href="2d.path.stroke.prune.closed.html" title="2d.path.stroke.prune.closed">
+<body class="show_output">
+<p>
+ <a href="2d.path.stroke.empty.html" accesskey="p" title="[p] 2d.path.stroke.empty"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.stroke.prune.closed.html" accesskey="n" title="[n] 2d.path.stroke.prune.closed">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.stroke.html">stroke</a>.<a href="index.2d.path.stroke.prune.html">prune</a>.line</h1>
+<p class="desc">Zero-length line segments from lineTo are removed before stroking</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.stroke.prune">2d.path.stroke.prune</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 100;
+ctx.lineCap = 'round';
+ctx.lineJoin = 'round';
+
+ctx.beginPath();
+ctx.moveTo(50, 25);
+ctx.lineTo(50, 25);
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.rect.html b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.rect.html
new file mode 100644
index 0000000..84d3502
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.prune.rect.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.stroke.prune.rect</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.stroke.prune.arc.html" title="2d.path.stroke.prune.arc">
+<link rel="next" href="2d.path.stroke.prune.corner.html" title="2d.path.stroke.prune.corner">
+<body class="show_output">
+<p>
+ <a href="2d.path.stroke.prune.arc.html" accesskey="p" title="[p] 2d.path.stroke.prune.arc"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.stroke.prune.corner.html" accesskey="n" title="[n] 2d.path.stroke.prune.corner">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.stroke.html">stroke</a>.<a href="index.2d.path.stroke.prune.html">prune</a>.rect</h1>
+<p class="desc">Zero-length line segments from rect and strokeRect are removed before stroking</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.stroke.prune">2d.path.stroke.prune</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 100;
+ctx.lineCap = 'round';
+ctx.lineJoin = 'round';
+
+ctx.beginPath();
+ctx.rect(50, 25, 0, 0);
+ctx.stroke();
+
+ctx.strokeRect(50, 25, 0, 0);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.scale1.html b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.scale1.html
new file mode 100644
index 0000000..e648ba5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.scale1.html
@@ -0,0 +1,60 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.stroke.scale1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.stroke.unaffected.html" title="2d.path.stroke.unaffected">
+<link rel="next" href="2d.path.stroke.scale2.html" title="2d.path.stroke.scale2">
+<body class="show_output">
+<p>
+ <a href="2d.path.stroke.unaffected.html" accesskey="p" title="[p] 2d.path.stroke.unaffected"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.stroke.scale2.html" accesskey="n" title="[n] 2d.path.stroke.scale2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.stroke.html">stroke</a>.scale1</h1>
+<p class="desc">Stroke line widths are scaled by the current transformation matrix</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.transformation">2d.path.transformation</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.beginPath();
+ctx.rect(25, 12.5, 50, 25);
+ctx.save();
+ctx.scale(50, 25);
+ctx.strokeStyle = '#0f0';
+ctx.stroke();
+ctx.restore();
+
+ctx.beginPath();
+ctx.rect(-25, -12.5, 150, 75);
+ctx.save();
+ctx.scale(50, 25);
+ctx.strokeStyle = '#f00';
+ctx.stroke();
+ctx.restore();
+
+_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255");
+_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255");
+_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255");
+_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255");
+_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255");
+_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255");
+_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.scale2.html b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.scale2.html
new file mode 100644
index 0000000..45145bb
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.scale2.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.stroke.scale2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.stroke.scale1.html" title="2d.path.stroke.scale1">
+<link rel="next" href="2d.path.stroke.skew.html" title="2d.path.stroke.skew">
+<body class="show_output">
+<p>
+ <a href="2d.path.stroke.scale1.html" accesskey="p" title="[p] 2d.path.stroke.scale1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.stroke.skew.html" accesskey="n" title="[n] 2d.path.stroke.skew">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.stroke.html">stroke</a>.scale2</h1>
+<p class="desc">Stroke line widths are scaled by the current transformation matrix</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.transformation">2d.path.transformation</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.beginPath();
+ctx.rect(25, 12.5, 50, 25);
+ctx.save();
+ctx.rotate(Math.PI/2);
+ctx.scale(25, 50);
+ctx.strokeStyle = '#0f0';
+ctx.stroke();
+ctx.restore();
+
+ctx.beginPath();
+ctx.rect(-25, -12.5, 150, 75);
+ctx.save();
+ctx.rotate(Math.PI/2);
+ctx.scale(25, 50);
+ctx.strokeStyle = '#f00';
+ctx.stroke();
+ctx.restore();
+
+_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255");
+_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255");
+_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255");
+_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255");
+_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255");
+_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255");
+_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.skew.html b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.skew.html
new file mode 100644
index 0000000..c9bbde0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.skew.html
@@ -0,0 +1,76 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.stroke.skew</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.stroke.scale2.html" title="2d.path.stroke.scale2">
+<link rel="next" href="2d.path.stroke.empty.html" title="2d.path.stroke.empty">
+<body class="show_output">
+<p>
+ <a href="2d.path.stroke.scale2.html" accesskey="p" title="[p] 2d.path.stroke.scale2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.stroke.empty.html" accesskey="n" title="[n] 2d.path.stroke.empty">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.stroke.html">stroke</a>.skew</h1>
+<p class="desc">Strokes lines are skewed by the current transformation matrix</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.transformation">2d.path.transformation</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.save();
+ctx.beginPath();
+ctx.moveTo(49, -50);
+ctx.lineTo(201, -50);
+ctx.rotate(Math.PI/4);
+ctx.scale(1, 283);
+ctx.strokeStyle = '#0f0';
+ctx.stroke();
+ctx.restore();
+
+ctx.save();
+ctx.beginPath();
+ctx.translate(-150, 0);
+ctx.moveTo(49, -50);
+ctx.lineTo(199, -50);
+ctx.rotate(Math.PI/4);
+ctx.scale(1, 142);
+ctx.strokeStyle = '#f00';
+ctx.stroke();
+ctx.restore();
+
+ctx.save();
+ctx.beginPath();
+ctx.translate(-150, 0);
+ctx.moveTo(49, -50);
+ctx.lineTo(199, -50);
+ctx.rotate(Math.PI/4);
+ctx.scale(1, 142);
+ctx.strokeStyle = '#f00';
+ctx.stroke();
+ctx.restore();
+
+_assertPixel(canvas, 0,0, 0,255,0,255, "0,0", "0,255,0,255");
+_assertPixel(canvas, 50,0, 0,255,0,255, "50,0", "0,255,0,255");
+_assertPixel(canvas, 99,0, 0,255,0,255, "99,0", "0,255,0,255");
+_assertPixel(canvas, 0,25, 0,255,0,255, "0,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 99,25, 0,255,0,255, "99,25", "0,255,0,255");
+_assertPixel(canvas, 0,49, 0,255,0,255, "0,49", "0,255,0,255");
+_assertPixel(canvas, 50,49, 0,255,0,255, "50,49", "0,255,0,255");
+_assertPixel(canvas, 99,49, 0,255,0,255, "99,49", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.unaffected.html b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.unaffected.html
new file mode 100644
index 0000000..7dd2fb2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.unaffected.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.stroke.unaffected</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.stroke.union.html" title="2d.path.stroke.union">
+<link rel="next" href="2d.path.stroke.scale1.html" title="2d.path.stroke.scale1">
+<body class="show_output">
+<p>
+ <a href="2d.path.stroke.union.html" accesskey="p" title="[p] 2d.path.stroke.union"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.stroke.scale1.html" accesskey="n" title="[n] 2d.path.stroke.scale1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.stroke.html">stroke</a>.unaffected</h1>
+<p class="desc">Stroking does not start a new path or subpath</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.stroke.basic">2d.path.stroke.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.lineWidth = 50;
+ctx.moveTo(-100, 25);
+ctx.lineTo(-100, -100);
+ctx.lineTo(200, -100);
+ctx.lineTo(200, 25);
+ctx.strokeStyle = '#f00';
+ctx.stroke();
+
+ctx.closePath();
+ctx.strokeStyle = '#0f0';
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.union.html b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.union.html
new file mode 100644
index 0000000..f4c904c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.stroke.union.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.stroke.union</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.stroke.overlap.html" title="2d.path.stroke.overlap">
+<link rel="next" href="2d.path.stroke.unaffected.html" title="2d.path.stroke.unaffected">
+<body class="show_output">
+<p>
+ <a href="2d.path.stroke.overlap.html" accesskey="p" title="[p] 2d.path.stroke.overlap"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.stroke.unaffected.html" accesskey="n" title="[n] 2d.path.stroke.unaffected">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.stroke.html">stroke</a>.union</h1>
+<p class="desc">Strokes in opposite directions are unioned, not subtracted</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.stroke.basic">2d.path.stroke.basic</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 40;
+ctx.moveTo(0, 10);
+ctx.lineTo(100, 10);
+ctx.moveTo(100, 40);
+ctx.lineTo(0, 40);
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.transformation.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.path.transformation.basic.html
new file mode 100644
index 0000000..49188e2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.transformation.basic.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.transformation.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.stroke.prune.corner.html" title="2d.path.stroke.prune.corner">
+<link rel="next" href="2d.path.transformation.multiple.html" title="2d.path.transformation.multiple">
+<body class="show_output">
+<p>
+ <a href="2d.path.stroke.prune.corner.html" accesskey="p" title="[p] 2d.path.stroke.prune.corner"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.transformation.multiple.html" accesskey="n" title="[n] 2d.path.transformation.multiple">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.transformation.html">transformation</a>.basic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.transformation">2d.path.transformation</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.translate(-100, 0);
+ctx.rect(100, 0, 100, 50);
+ctx.translate(0, -100);
+ctx.fillStyle = '#0f0';
+ctx.fill();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.transformation.changing.html b/LayoutTests/fast/canvas/philip/tests/2d.path.transformation.changing.html
new file mode 100644
index 0000000..aa60860
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.transformation.changing.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.transformation.changing</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.transformation.multiple.html" title="2d.path.transformation.multiple">
+<link rel="next" href="2d.path.clip.empty.html" title="2d.path.clip.empty">
+<body class="show_output">
+<p>
+ <a href="2d.path.transformation.multiple.html" accesskey="p" title="[p] 2d.path.transformation.multiple"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.clip.empty.html" accesskey="n" title="[n] 2d.path.clip.empty">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.transformation.html">transformation</a>.changing</h1>
+<p class="desc">Transformations are applied while building paths, not when drawing</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.transformation">2d.path.transformation</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.moveTo(0, 0);
+ctx.translate(100, 0);
+ctx.lineTo(0, 0);
+ctx.translate(0, 50);
+ctx.lineTo(0, 0);
+ctx.translate(-100, 0);
+ctx.lineTo(0, 0);
+ctx.translate(1000, 1000);
+ctx.rotate(Math.PI/2);
+ctx.scale(0.1, 0.1);
+ctx.fill();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.path.transformation.multiple.html b/LayoutTests/fast/canvas/philip/tests/2d.path.transformation.multiple.html
new file mode 100644
index 0000000..e85c109
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.path.transformation.multiple.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.path.transformation.multiple</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.path.transformation.basic.html" title="2d.path.transformation.basic">
+<link rel="next" href="2d.path.transformation.changing.html" title="2d.path.transformation.changing">
+<body class="show_output">
+<p>
+ <a href="2d.path.transformation.basic.html" accesskey="p" title="[p] 2d.path.transformation.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.transformation.changing.html" accesskey="n" title="[n] 2d.path.transformation.changing">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.path.html">path</a>.<a href="index.2d.path.transformation.html">transformation</a>.multiple</h1>
+<p class="desc">Transformations are applied while building paths, not when drawing</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.path.transformation">2d.path.transformation</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#f00';
+ctx.translate(-100, 0);
+ctx.rect(0, 0, 100, 50);
+ctx.fill();
+ctx.translate(100, 0);
+ctx.fill();
+
+ctx.beginPath();
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 50;
+ctx.translate(0, -50);
+ctx.moveTo(0, 25);
+ctx.lineTo(100, 25);
+ctx.stroke();
+ctx.translate(0, 50);
+ctx.stroke();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.animated.gif.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.animated.gif.html
new file mode 100644
index 0000000..a1ab59f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.animated.gif.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.animated.gif</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.orientation.canvas.html" title="2d.pattern.paint.orientation.canvas">
+<link rel="next" href="2d.line.defaults.html" title="2d.line.defaults">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.orientation.canvas.html" accesskey="p" title="[p] 2d.pattern.paint.orientation.canvas"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.line.defaults.html" accesskey="n" title="[n] 2d.line.defaults">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.animated.html">animated</a>.gif</h1>
+<p class="desc">createPattern() of an animated GIF draws the first frame</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.animated.image">2d.pattern.animated.image</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+deferTest();
+setTimeout(function () {
+ var pattern = ctx.createPattern(document.getElementById('anim-gr.gif'), 'repeat');
+ ctx.fillStyle = pattern;
+ ctx.fillRect(0, 0, 50, 50);
+ setTimeout(wrapFunction(function () {
+ ctx.fillRect(50, 0, 50, 50);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+ }), 250);
+}, 250);
+
+
+});
+</script>
+<img src="../images/anim-gr.gif" id="anim-gr.gif" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.basic.canvas.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.basic.canvas.html
new file mode 100644
index 0000000..5e61c07
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.basic.canvas.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.basic.canvas</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.basic.image.html" title="2d.pattern.basic.image">
+<link rel="next" href="2d.pattern.basic.zerocanvas.html" title="2d.pattern.basic.zerocanvas">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.basic.image.html" accesskey="p" title="[p] 2d.pattern.basic.image"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.basic.zerocanvas.html" accesskey="n" title="[n] 2d.pattern.basic.zerocanvas">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.basic.html">basic</a>.canvas</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.fillStyle = '#0f0';
+ctx2.fillRect(0, 0, 100, 50);
+
+var pattern = ctx.createPattern(canvas2, 'no-repeat');
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.basic.image.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.basic.image.html
new file mode 100644
index 0000000..d62151f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.basic.image.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.basic.image</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.basic.type.html" title="2d.pattern.basic.type">
+<link rel="next" href="2d.pattern.basic.canvas.html" title="2d.pattern.basic.canvas">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.basic.type.html" accesskey="p" title="[p] 2d.pattern.basic.type"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.basic.canvas.html" accesskey="n" title="[n] 2d.pattern.basic.canvas">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.basic.html">basic</a>.image</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+var img = document.getElementById('green.png');
+var pattern = ctx.createPattern(img, 'no-repeat');
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/green.png" id="green.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.basic.nocontext.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.basic.nocontext.html
new file mode 100644
index 0000000..e91676e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.basic.nocontext.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.basic.nocontext</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.basic.zerocanvas.html" title="2d.pattern.basic.zerocanvas">
+<link rel="next" href="2d.pattern.image.undefined.html" title="2d.pattern.image.undefined">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.basic.zerocanvas.html" accesskey="p" title="[p] 2d.pattern.basic.zerocanvas"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.image.undefined.html" accesskey="n" title="[n] 2d.pattern.image.undefined">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.basic.html">basic</a>.nocontext</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var pattern = ctx.createPattern(canvas2, 'no-repeat');
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.basic.type.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.basic.type.html
new file mode 100644
index 0000000..186ac5b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.basic.type.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.basic.type</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.gradient.radial.transform.3.html" title="2d.gradient.radial.transform.3">
+<link rel="next" href="2d.pattern.basic.image.html" title="2d.pattern.basic.image">
+<body class="show_output">
+<p>
+ <a href="2d.gradient.radial.transform.3.html" accesskey="p" title="[p] 2d.gradient.radial.transform.3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.basic.image.html" accesskey="n" title="[n] 2d.pattern.basic.image">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.basic.html">basic</a>.type</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.return">2d.pattern.return</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertDifferent(window.CanvasPattern, undefined, "window.CanvasPattern", "undefined");
+
+window.CanvasPattern.prototype.thisImplementsCanvasPattern = true;
+
+var img = document.getElementById('green.png');
+var pattern = ctx.createPattern(img, 'no-repeat');
+_assert(pattern.thisImplementsCanvasPattern, "pattern.thisImplementsCanvasPattern");
+
+
+});
+</script>
+<img src="../images/green.png" id="green.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.basic.zerocanvas.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.basic.zerocanvas.html
new file mode 100644
index 0000000..0351e5a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.basic.zerocanvas.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.basic.zerocanvas</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.basic.canvas.html" title="2d.pattern.basic.canvas">
+<link rel="next" href="2d.pattern.basic.nocontext.html" title="2d.pattern.basic.nocontext">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.basic.canvas.html" accesskey="p" title="[p] 2d.pattern.basic.canvas"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.basic.nocontext.html" accesskey="n" title="[n] 2d.pattern.basic.nocontext">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.basic.html">basic</a>.zerocanvas</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.zerocanvas">2d.pattern.zerocanvas</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = 0;
+canvas.height = 10;
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 10, "canvas.height", "10");
+try { var _thrown = false;
+ ctx.createPattern(canvas, 'repeat');
+} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')"); }
+
+canvas.width = 10;
+canvas.height = 0;
+_assertSame(canvas.width, 10, "canvas.width", "10");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+try { var _thrown = false;
+ ctx.createPattern(canvas, 'repeat');
+} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')"); }
+
+canvas.width = 0;
+canvas.height = 0;
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+try { var _thrown = false;
+ ctx.createPattern(canvas, 'repeat');
+} catch (e) { if (e.code != DOMException.INVALID_STATE_ERR) _fail("Failed assertion: expected exception of type INVALID_STATE_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type INVALID_STATE_ERR: ctx.createPattern(canvas, 'repeat')"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.crosscanvas.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.crosscanvas.html
new file mode 100644
index 0000000..45a0033
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.crosscanvas.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.crosscanvas</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.modify.canvas2.html" title="2d.pattern.modify.canvas2">
+<link rel="next" href="2d.pattern.paint.norepeat.basic.html" title="2d.pattern.paint.norepeat.basic">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.modify.canvas2.html" accesskey="p" title="[p] 2d.pattern.modify.canvas2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.norepeat.basic.html" accesskey="n" title="[n] 2d.pattern.paint.norepeat.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.crosscanvas</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var img = document.getElementById('green.png');
+
+var pattern = document.createElement('canvas').getContext('2d').createPattern(img, 'no-repeat');
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/green.png" id="green.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.image.broken.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.image.broken.html
new file mode 100644
index 0000000..51fb4af
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.image.broken.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.image.broken</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.image.incomplete.html" title="2d.pattern.image.incomplete">
+<link rel="next" href="2d.pattern.repeat.empty.html" title="2d.pattern.repeat.empty">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.image.incomplete.html" accesskey="p" title="[p] 2d.pattern.image.incomplete"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.repeat.empty.html" accesskey="n" title="[n] 2d.pattern.repeat.empty">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.image.html">image</a>.broken</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.incomplete.image">2d.pattern.incomplete.image</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var img = document.getElementById('broken.png');
+_assertSame(img.complete, false, "img.complete", "false");
+_assertSame(ctx.createPattern(img, 'repeat'), NULL, "ctx.createPattern(img, 'repeat')", "NULL");
+
+
+});
+</script>
+<img src="../images/broken.png" id="broken.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.image.incomplete.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.image.incomplete.html
new file mode 100644
index 0000000..c32eccb
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.image.incomplete.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.image.incomplete</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.image.string.html" title="2d.pattern.image.string">
+<link rel="next" href="2d.pattern.image.broken.html" title="2d.pattern.image.broken">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.image.string.html" accesskey="p" title="[p] 2d.pattern.image.string"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.image.broken.html" accesskey="n" title="[n] 2d.pattern.image.broken">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.image.html">image</a>.incomplete</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.incomplete.image">2d.pattern.incomplete.image</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var img = new Image();
+_assertSame(img.complete, false, "img.complete", "false");
+_assertSame(ctx.createPattern(img, 'repeat'), NULL, "ctx.createPattern(img, 'repeat')", "NULL");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.image.null.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.image.null.html
new file mode 100644
index 0000000..f282adb
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.image.null.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.image.null</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.image.undefined.html" title="2d.pattern.image.undefined">
+<link rel="next" href="2d.pattern.image.string.html" title="2d.pattern.image.string">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.image.undefined.html" accesskey="p" title="[p] 2d.pattern.image.undefined"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.image.string.html" accesskey="n" title="[n] 2d.pattern.image.string">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.image.html">image</a>.null</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.wrongtype">2d.pattern.wrongtype</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.createPattern(null, 'repeat');
+} 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.createPattern(null, 'repeat')"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.image.string.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.image.string.html
new file mode 100644
index 0000000..7e35977
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.image.string.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.image.string</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.image.null.html" title="2d.pattern.image.null">
+<link rel="next" href="2d.pattern.image.incomplete.html" title="2d.pattern.image.incomplete">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.image.null.html" accesskey="p" title="[p] 2d.pattern.image.null"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.image.incomplete.html" accesskey="n" title="[n] 2d.pattern.image.incomplete">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.image.html">image</a>.string</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.wrongtype">2d.pattern.wrongtype</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.createPattern('../images/red.png', 'repeat');
+} 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.createPattern('../images/red.png', 'repeat')"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.image.undefined.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.image.undefined.html
new file mode 100644
index 0000000..10cba60
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.image.undefined.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.image.undefined</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.basic.nocontext.html" title="2d.pattern.basic.nocontext">
+<link rel="next" href="2d.pattern.image.null.html" title="2d.pattern.image.null">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.basic.nocontext.html" accesskey="p" title="[p] 2d.pattern.basic.nocontext"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.image.null.html" accesskey="n" title="[n] 2d.pattern.image.null">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.image.html">image</a>.undefined</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.wrongtype">2d.pattern.wrongtype</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.createPattern(undefined, 'repeat');
+} 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.createPattern(undefined, 'repeat')"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.modify.canvas1.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.modify.canvas1.html
new file mode 100644
index 0000000..4f6e053
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.modify.canvas1.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.modify.canvas1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.modify.image2.html" title="2d.pattern.modify.image2">
+<link rel="next" href="2d.pattern.modify.canvas2.html" title="2d.pattern.modify.canvas2">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.modify.image2.html" accesskey="p" title="[p] 2d.pattern.modify.image2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.modify.canvas2.html" accesskey="n" title="[n] 2d.pattern.modify.canvas2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.modify.html">modify</a>.canvas1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.modify">2d.pattern.modify</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.fillStyle = '#0f0';
+ctx2.fillRect(0, 0, 100, 50);
+
+var pattern = ctx.createPattern(canvas2, 'no-repeat');
+
+ctx2.fillStyle = '#f00';
+ctx2.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.modify.canvas2.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.modify.canvas2.html
new file mode 100644
index 0000000..3298edd
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.modify.canvas2.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.modify.canvas2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.modify.canvas1.html" title="2d.pattern.modify.canvas1">
+<link rel="next" href="2d.pattern.crosscanvas.html" title="2d.pattern.crosscanvas">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.modify.canvas1.html" accesskey="p" title="[p] 2d.pattern.modify.canvas1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.crosscanvas.html" accesskey="n" title="[n] 2d.pattern.crosscanvas">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.modify.html">modify</a>.canvas2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.modify">2d.pattern.modify</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.fillStyle = '#0f0';
+ctx2.fillRect(0, 0, 100, 50);
+
+var pattern = ctx.createPattern(canvas2, 'no-repeat');
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx2.fillStyle = '#f00';
+ctx2.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.modify.image1.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.modify.image1.html
new file mode 100644
index 0000000..859f085
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.modify.image1.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.modify.image1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.repeat.nullsuffix.html" title="2d.pattern.repeat.nullsuffix">
+<link rel="next" href="2d.pattern.modify.image2.html" title="2d.pattern.modify.image2">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.repeat.nullsuffix.html" accesskey="p" title="[p] 2d.pattern.repeat.nullsuffix"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.modify.image2.html" accesskey="n" title="[n] 2d.pattern.modify.image2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.modify.html">modify</a>.image1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.modify">2d.pattern.modify</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var img = document.getElementById('green.png');
+var pattern = ctx.createPattern(img, 'no-repeat');
+deferTest();
+img.onload = wrapFunction(function ()
+{
+ ctx.fillStyle = pattern;
+ ctx.fillRect(0, 0, 100, 50);
+
+ _assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+ _assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+ _assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+ _assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+});
+img.src = '../images/red.png';
+
+
+});
+</script>
+<img src="../images/green.png" id="green.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.modify.image2.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.modify.image2.html
new file mode 100644
index 0000000..ebfc203
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.modify.image2.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.modify.image2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.modify.image1.html" title="2d.pattern.modify.image1">
+<link rel="next" href="2d.pattern.modify.canvas1.html" title="2d.pattern.modify.canvas1">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.modify.image1.html" accesskey="p" title="[p] 2d.pattern.modify.image1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.modify.canvas1.html" accesskey="n" title="[n] 2d.pattern.modify.canvas1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.modify.html">modify</a>.image2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.modify">2d.pattern.modify</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var img = document.getElementById('green.png');
+var pattern = ctx.createPattern(img, 'no-repeat');
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#00f';
+ctx.fillRect(0, 0, 100, 50);
+deferTest();
+img.onload = wrapFunction(function ()
+{
+ ctx.fillStyle = pattern;
+ ctx.fillRect(0, 0, 100, 50);
+
+ _assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+ _assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+ _assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+ _assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+});
+img.src = '../images/red.png';
+
+
+});
+</script>
+<img src="../images/green.png" id="green.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.norepeat.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.norepeat.basic.html
new file mode 100644
index 0000000..87417d4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.norepeat.basic.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.norepeat.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.crosscanvas.html" title="2d.pattern.crosscanvas">
+<link rel="next" href="2d.pattern.paint.norepeat.outside.html" title="2d.pattern.paint.norepeat.outside">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.crosscanvas.html" accesskey="p" title="[p] 2d.pattern.crosscanvas"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.norepeat.outside.html" accesskey="n" title="[n] 2d.pattern.paint.norepeat.outside">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.norepeat.html">norepeat</a>.basic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var img = document.getElementById('green.png');
+var pattern = ctx.createPattern(img, 'no-repeat');
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/green.png" id="green.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.norepeat.coord1.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.norepeat.coord1.html
new file mode 100644
index 0000000..5b53ca8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.norepeat.coord1.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.norepeat.coord1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.norepeat.outside.html" title="2d.pattern.paint.norepeat.outside">
+<link rel="next" href="2d.pattern.paint.norepeat.coord2.html" title="2d.pattern.paint.norepeat.coord2">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.norepeat.outside.html" accesskey="p" title="[p] 2d.pattern.paint.norepeat.outside"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.norepeat.coord2.html" accesskey="n" title="[n] 2d.pattern.paint.norepeat.coord2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.norepeat.html">norepeat</a>.coord1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 50, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(50, 0, 50, 50);
+
+var img = document.getElementById('green.png');
+var pattern = ctx.createPattern(img, 'no-repeat');
+ctx.fillStyle = pattern;
+ctx.translate(50, 0);
+ctx.fillRect(-50, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/green.png" id="green.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.norepeat.coord2.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.norepeat.coord2.html
new file mode 100644
index 0000000..0981c98
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.norepeat.coord2.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.norepeat.coord2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.norepeat.coord1.html" title="2d.pattern.paint.norepeat.coord1">
+<link rel="next" href="2d.pattern.paint.norepeat.coord3.html" title="2d.pattern.paint.norepeat.coord3">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.norepeat.coord1.html" accesskey="p" title="[p] 2d.pattern.paint.norepeat.coord1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.norepeat.coord3.html" accesskey="n" title="[n] 2d.pattern.paint.norepeat.coord3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.norepeat.html">norepeat</a>.coord2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var img = document.getElementById('green.png');
+var pattern = ctx.createPattern(img, 'no-repeat');
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 50, 50);
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(50, 0, 50, 50);
+
+ctx.fillStyle = pattern;
+ctx.translate(50, 0);
+ctx.fillRect(-50, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/green.png" id="green.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.norepeat.coord3.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.norepeat.coord3.html
new file mode 100644
index 0000000..24fbe53
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.norepeat.coord3.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.norepeat.coord3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.norepeat.coord2.html" title="2d.pattern.paint.norepeat.coord2">
+<link rel="next" href="2d.pattern.paint.repeat.basic.html" title="2d.pattern.paint.repeat.basic">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.norepeat.coord2.html" accesskey="p" title="[p] 2d.pattern.paint.norepeat.coord2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.repeat.basic.html" accesskey="n" title="[n] 2d.pattern.paint.repeat.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.norepeat.html">norepeat</a>.coord3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var img = document.getElementById('red.png');
+var pattern = ctx.createPattern(img, 'no-repeat');
+ctx.fillStyle = pattern;
+ctx.translate(50, 25);
+ctx.fillRect(-50, -25, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 50, 25);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.norepeat.outside.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.norepeat.outside.html
new file mode 100644
index 0000000..911e362
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.norepeat.outside.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.norepeat.outside</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.norepeat.basic.html" title="2d.pattern.paint.norepeat.basic">
+<link rel="next" href="2d.pattern.paint.norepeat.coord1.html" title="2d.pattern.paint.norepeat.coord1">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.norepeat.basic.html" accesskey="p" title="[p] 2d.pattern.paint.norepeat.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.norepeat.coord1.html" accesskey="n" title="[n] 2d.pattern.paint.norepeat.coord1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.norepeat.html">norepeat</a>.outside</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var img = document.getElementById('red.png');
+var pattern = ctx.createPattern(img, 'no-repeat');
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = pattern;
+ctx.fillRect(0, -50, 100, 50);
+ctx.fillRect(-100, 0, 100, 50);
+ctx.fillRect(0, 50, 100, 50);
+ctx.fillRect(100, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.orientation.canvas.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.orientation.canvas.html
new file mode 100644
index 0000000..76ee98f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.orientation.canvas.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.orientation.canvas</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.orientation.image.html" title="2d.pattern.paint.orientation.image">
+<link rel="next" href="2d.pattern.animated.gif.html" title="2d.pattern.animated.gif">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.orientation.image.html" accesskey="p" title="[p] 2d.pattern.paint.orientation.image"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.animated.gif.html" accesskey="n" title="[n] 2d.pattern.animated.gif">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.orientation.html">orientation</a>.canvas</h1>
+<p class="desc">Canvas patterns do not get flipped when painted</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.fillStyle = '#f00';
+ctx2.fillRect(0, 0, 100, 25);
+ctx2.fillStyle = '#0f0';
+ctx2.fillRect(0, 25, 100, 25);
+
+var pattern = ctx.createPattern(canvas2, 'no-repeat');
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 25);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.orientation.image.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.orientation.image.html
new file mode 100644
index 0000000..cdac5f6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.orientation.image.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.orientation.image</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.repeaty.coord1.html" title="2d.pattern.paint.repeaty.coord1">
+<link rel="next" href="2d.pattern.paint.orientation.canvas.html" title="2d.pattern.paint.orientation.canvas">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.repeaty.coord1.html" accesskey="p" title="[p] 2d.pattern.paint.repeaty.coord1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.orientation.canvas.html" accesskey="n" title="[n] 2d.pattern.paint.orientation.canvas">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.orientation.html">orientation</a>.image</h1>
+<p class="desc">Image patterns do not get flipped when painted</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var img = document.getElementById('rrgg-256x256.png');
+var pattern = ctx.createPattern(img, 'no-repeat');
+ctx.fillStyle = pattern;
+ctx.save();
+ctx.translate(0, -103);
+ctx.fillRect(0, 103, 100, 50);
+ctx.restore();
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 25);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/rrgg-256x256.png" id="rrgg-256x256.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeat.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeat.basic.html
new file mode 100644
index 0000000..58d38a3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeat.basic.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.repeat.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.norepeat.coord3.html" title="2d.pattern.paint.norepeat.coord3">
+<link rel="next" href="2d.pattern.paint.repeat.outside.html" title="2d.pattern.paint.repeat.outside">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.norepeat.coord3.html" accesskey="p" title="[p] 2d.pattern.paint.norepeat.coord3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.repeat.outside.html" accesskey="n" title="[n] 2d.pattern.paint.repeat.outside">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.repeat.html">repeat</a>.basic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var img = document.getElementById('green-16x16.png');
+var pattern = ctx.createPattern(img, 'repeat');
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/green-16x16.png" id="green-16x16.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeat.coord1.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeat.coord1.html
new file mode 100644
index 0000000..882f95a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeat.coord1.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.repeat.coord1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.repeat.outside.html" title="2d.pattern.paint.repeat.outside">
+<link rel="next" href="2d.pattern.paint.repeat.coord2.html" title="2d.pattern.paint.repeat.coord2">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.repeat.outside.html" accesskey="p" title="[p] 2d.pattern.paint.repeat.outside"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.repeat.coord2.html" accesskey="n" title="[n] 2d.pattern.paint.repeat.coord2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.repeat.html">repeat</a>.coord1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var img = document.getElementById('rgrg-256x256.png');
+var pattern = ctx.createPattern(img, 'repeat');
+ctx.fillStyle = pattern;
+ctx.translate(-128, -78);
+ctx.fillRect(128, 78, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/rgrg-256x256.png" id="rgrg-256x256.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeat.coord2.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeat.coord2.html
new file mode 100644
index 0000000..d121d97
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeat.coord2.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.repeat.coord2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.repeat.coord1.html" title="2d.pattern.paint.repeat.coord1">
+<link rel="next" href="2d.pattern.paint.repeat.coord3.html" title="2d.pattern.paint.repeat.coord3">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.repeat.coord1.html" accesskey="p" title="[p] 2d.pattern.paint.repeat.coord1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.repeat.coord3.html" accesskey="n" title="[n] 2d.pattern.paint.repeat.coord3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.repeat.html">repeat</a>.coord2</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var img = document.getElementById('ggrr-256x256.png');
+var pattern = ctx.createPattern(img, 'repeat');
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/ggrr-256x256.png" id="ggrr-256x256.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeat.coord3.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeat.coord3.html
new file mode 100644
index 0000000..c8bce22
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeat.coord3.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.repeat.coord3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.repeat.coord2.html" title="2d.pattern.paint.repeat.coord2">
+<link rel="next" href="2d.pattern.paint.repeatx.basic.html" title="2d.pattern.paint.repeatx.basic">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.repeat.coord2.html" accesskey="p" title="[p] 2d.pattern.paint.repeat.coord2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.repeatx.basic.html" accesskey="n" title="[n] 2d.pattern.paint.repeatx.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.repeat.html">repeat</a>.coord3</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var img = document.getElementById('rgrg-256x256.png');
+var pattern = ctx.createPattern(img, 'repeat');
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.translate(-128, -78);
+ctx.fillRect(128, 78, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/rgrg-256x256.png" id="rgrg-256x256.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeat.outside.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeat.outside.html
new file mode 100644
index 0000000..3ca666c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeat.outside.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.repeat.outside</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.repeat.basic.html" title="2d.pattern.paint.repeat.basic">
+<link rel="next" href="2d.pattern.paint.repeat.coord1.html" title="2d.pattern.paint.repeat.coord1">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.repeat.basic.html" accesskey="p" title="[p] 2d.pattern.paint.repeat.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.repeat.coord1.html" accesskey="n" title="[n] 2d.pattern.paint.repeat.coord1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.repeat.html">repeat</a>.outside</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+var img = document.getElementById('green-16x16.png');
+var pattern = ctx.createPattern(img, 'repeat');
+ctx.fillStyle = pattern;
+ctx.translate(50, 25);
+ctx.fillRect(-50, -25, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/green-16x16.png" id="green-16x16.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeatx.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeatx.basic.html
new file mode 100644
index 0000000..04513e6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeatx.basic.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.repeatx.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.repeat.coord3.html" title="2d.pattern.paint.repeat.coord3">
+<link rel="next" href="2d.pattern.paint.repeatx.outside.html" title="2d.pattern.paint.repeatx.outside">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.repeat.coord3.html" accesskey="p" title="[p] 2d.pattern.paint.repeat.coord3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.repeatx.outside.html" accesskey="n" title="[n] 2d.pattern.paint.repeatx.outside">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.repeatx.html">repeatx</a>.basic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 16);
+
+var img = document.getElementById('green-16x16.png');
+var pattern = ctx.createPattern(img, 'repeat-x');
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/green-16x16.png" id="green-16x16.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeatx.coord1.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeatx.coord1.html
new file mode 100644
index 0000000..d5f9fb0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeatx.coord1.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.repeatx.coord1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.repeatx.outside.html" title="2d.pattern.paint.repeatx.outside">
+<link rel="next" href="2d.pattern.paint.repeaty.basic.html" title="2d.pattern.paint.repeaty.basic">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.repeatx.outside.html" accesskey="p" title="[p] 2d.pattern.paint.repeatx.outside"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.repeaty.basic.html" accesskey="n" title="[n] 2d.pattern.paint.repeaty.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.repeatx.html">repeatx</a>.coord1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var img = document.getElementById('red-16x16.png');
+var pattern = ctx.createPattern(img, 'repeat-x');
+ctx.fillStyle = pattern;
+ctx.translate(0, 16);
+ctx.fillRect(0, -16, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 16);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/red-16x16.png" id="red-16x16.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeatx.outside.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeatx.outside.html
new file mode 100644
index 0000000..2ee5586
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeatx.outside.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.repeatx.outside</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.repeatx.basic.html" title="2d.pattern.paint.repeatx.basic">
+<link rel="next" href="2d.pattern.paint.repeatx.coord1.html" title="2d.pattern.paint.repeatx.coord1">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.repeatx.basic.html" accesskey="p" title="[p] 2d.pattern.paint.repeatx.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.repeatx.coord1.html" accesskey="n" title="[n] 2d.pattern.paint.repeatx.coord1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.repeatx.html">repeatx</a>.outside</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var img = document.getElementById('red-16x16.png');
+var pattern = ctx.createPattern(img, 'repeat-x');
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 16);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/red-16x16.png" id="red-16x16.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeaty.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeaty.basic.html
new file mode 100644
index 0000000..44e9b3c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeaty.basic.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.repeaty.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.repeatx.coord1.html" title="2d.pattern.paint.repeatx.coord1">
+<link rel="next" href="2d.pattern.paint.repeaty.outside.html" title="2d.pattern.paint.repeaty.outside">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.repeatx.coord1.html" accesskey="p" title="[p] 2d.pattern.paint.repeatx.coord1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.repeaty.outside.html" accesskey="n" title="[n] 2d.pattern.paint.repeaty.outside">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.repeaty.html">repeaty</a>.basic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 16, 50);
+
+var img = document.getElementById('green-16x16.png');
+var pattern = ctx.createPattern(img, 'repeat-y');
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/green-16x16.png" id="green-16x16.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeaty.coord1.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeaty.coord1.html
new file mode 100644
index 0000000..aa90d65
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeaty.coord1.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.repeaty.coord1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.repeaty.outside.html" title="2d.pattern.paint.repeaty.outside">
+<link rel="next" href="2d.pattern.paint.orientation.image.html" title="2d.pattern.paint.orientation.image">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.repeaty.outside.html" accesskey="p" title="[p] 2d.pattern.paint.repeaty.outside"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.orientation.image.html" accesskey="n" title="[n] 2d.pattern.paint.orientation.image">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.repeaty.html">repeaty</a>.coord1</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var img = document.getElementById('red-16x16.png');
+var pattern = ctx.createPattern(img, 'repeat-y');
+ctx.fillStyle = pattern;
+ctx.translate(48, 0);
+ctx.fillRect(-48, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 16, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 50,1, 0,255,0,255, "50,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 50,48, 0,255,0,255, "50,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/red-16x16.png" id="red-16x16.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeaty.outside.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeaty.outside.html
new file mode 100644
index 0000000..eee6f0e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.paint.repeaty.outside.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.paint.repeaty.outside</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.paint.repeaty.basic.html" title="2d.pattern.paint.repeaty.basic">
+<link rel="next" href="2d.pattern.paint.repeaty.coord1.html" title="2d.pattern.paint.repeaty.coord1">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.paint.repeaty.basic.html" accesskey="p" title="[p] 2d.pattern.paint.repeaty.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.paint.repeaty.coord1.html" accesskey="n" title="[n] 2d.pattern.paint.repeaty.coord1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.paint.html">paint</a>.<a href="index.2d.pattern.paint.repeaty.html">repeaty</a>.outside</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.painting">2d.pattern.painting</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+var img = document.getElementById('red-16x16.png');
+var pattern = ctx.createPattern(img, 'repeat-y');
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 16, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/red-16x16.png" id="red-16x16.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.case.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.case.html
new file mode 100644
index 0000000..ccb2646
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.case.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.repeat.case</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.repeat.unrecognised.html" title="2d.pattern.repeat.unrecognised">
+<link rel="next" href="2d.pattern.repeat.nullsuffix.html" title="2d.pattern.repeat.nullsuffix">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.repeat.unrecognised.html" accesskey="p" title="[p] 2d.pattern.repeat.unrecognised"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.repeat.nullsuffix.html" accesskey="n" title="[n] 2d.pattern.repeat.nullsuffix">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.repeat.html">repeat</a>.case</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.exact">2d.pattern.exact</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.createPattern(canvas, "Repeat");
+} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, \"Repeat\")"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.empty.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.empty.html
new file mode 100644
index 0000000..e50f792
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.empty.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.repeat.empty</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.image.broken.html" title="2d.pattern.image.broken">
+<link rel="next" href="2d.pattern.repeat.null.html" title="2d.pattern.repeat.null">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.image.broken.html" accesskey="p" title="[p] 2d.pattern.image.broken"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.repeat.null.html" accesskey="n" title="[n] 2d.pattern.repeat.null">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.repeat.html">repeat</a>.empty</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.missing">2d.pattern.missing</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+var img = document.getElementById('green-1x1.png');
+var pattern = ctx.createPattern(img, "");
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 200, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/green-1x1.png" id="green-1x1.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.null.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.null.html
new file mode 100644
index 0000000..c4c3719
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.null.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.repeat.null</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.repeat.empty.html" title="2d.pattern.repeat.empty">
+<link rel="next" href="2d.pattern.repeat.undefined.html" title="2d.pattern.repeat.undefined">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.repeat.empty.html" accesskey="p" title="[p] 2d.pattern.repeat.empty"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.repeat.undefined.html" accesskey="n" title="[n] 2d.pattern.repeat.undefined">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.repeat.html">repeat</a>.null</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.missing">2d.pattern.missing</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+var img = document.getElementById('green-1x1.png');
+var pattern = ctx.createPattern(img, null);
+ctx.fillStyle = pattern;
+ctx.fillRect(0, 0, 100, 50);
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 98,1, 0,255,0,255, "98,1", "0,255,0,255");
+_assertPixel(canvas, 1,48, 0,255,0,255, "1,48", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/green-1x1.png" id="green-1x1.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.nullsuffix.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.nullsuffix.html
new file mode 100644
index 0000000..5f931bb
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.nullsuffix.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.repeat.nullsuffix</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.repeat.case.html" title="2d.pattern.repeat.case">
+<link rel="next" href="2d.pattern.modify.image1.html" title="2d.pattern.modify.image1">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.repeat.case.html" accesskey="p" title="[p] 2d.pattern.repeat.case"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.modify.image1.html" accesskey="n" title="[n] 2d.pattern.modify.image1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.repeat.html">repeat</a>.nullsuffix</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.exact">2d.pattern.exact</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.createPattern(canvas, "repeat\0");
+} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, \"repeat\\0\")"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.undefined.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.undefined.html
new file mode 100644
index 0000000..09c8f44
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.undefined.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.repeat.undefined</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.repeat.null.html" title="2d.pattern.repeat.null">
+<link rel="next" href="2d.pattern.repeat.unrecognised.html" title="2d.pattern.repeat.unrecognised">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.repeat.null.html" accesskey="p" title="[p] 2d.pattern.repeat.null"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.repeat.unrecognised.html" accesskey="n" title="[n] 2d.pattern.repeat.unrecognised">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.repeat.html">repeat</a>.undefined</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.unrecognised">2d.pattern.unrecognised</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.createPattern(canvas, undefined);
+} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, undefined)"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.unrecognised.html b/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.unrecognised.html
new file mode 100644
index 0000000..9e06d7c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.pattern.repeat.unrecognised.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.pattern.repeat.unrecognised</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.pattern.repeat.undefined.html" title="2d.pattern.repeat.undefined">
+<link rel="next" href="2d.pattern.repeat.case.html" title="2d.pattern.repeat.case">
+<body class="show_output">
+<p>
+ <a href="2d.pattern.repeat.undefined.html" accesskey="p" title="[p] 2d.pattern.repeat.undefined"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.pattern.repeat.case.html" accesskey="n" title="[n] 2d.pattern.repeat.case">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.pattern.html">pattern</a>.<a href="index.2d.pattern.repeat.html">repeat</a>.unrecognised</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.pattern.unrecognised">2d.pattern.unrecognised</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+try { var _thrown = false;
+ ctx.createPattern(canvas, "invalid");
+} catch (e) { if (e.code != DOMException.SYNTAX_ERR) _fail("Failed assertion: expected exception of type SYNTAX_ERR, got: "+e.message); _thrown = true; } finally { _assert(_thrown, "should throw exception of type SYNTAX_ERR: ctx.createPattern(canvas, \"invalid\")"); }
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.scaled.html b/LayoutTests/fast/canvas/philip/tests/2d.scaled.html
new file mode 100644
index 0000000..e16cf03
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.scaled.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.scaled</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.coordinatespace.html" title="2d.coordinatespace">
+<link rel="next" href="2d.canvas.reference.html" title="2d.canvas.reference">
+<body class="show_output">
+<p>
+ <a href="2d.coordinatespace.html" accesskey="p" title="[p] 2d.coordinatespace"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.canvas.reference.html" accesskey="n" title="[n] 2d.canvas.reference">></a>
+<h1><a href="index.2d.html">2d</a>.scaled</h1>
+<p class="desc">CSS-scaled canvases get drawn correctly</p>
+<div class="refs">References:
+<ul>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="25" style="width: 100px; height: 50px"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.scaled.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#00f';
+ctx.fillRect(0, 0, 50, 25);
+ctx.fillStyle = '#0ff';
+ctx.fillRect(0, 0, 25, 10);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.scaled.png b/LayoutTests/fast/canvas/philip/tests/2d.scaled.png
new file mode 100644
index 0000000..85ccb32
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.scaled.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.1.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.1.html
new file mode 100644
index 0000000..ba16ff7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.1.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.alpha.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.blur.high.html" title="2d.shadow.blur.high">
+<link rel="next" href="2d.shadow.alpha.2.html" title="2d.shadow.alpha.2">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.blur.high.html" accesskey="p" title="[p] 2d.shadow.blur.high"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.alpha.2.html" accesskey="n" title="[n] 2d.shadow.alpha.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.alpha.html">alpha</a>.1</h1>
+<p class="desc">Shadow colour alpha components are used</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowColor = 'rgba(255, 0, 0, 0.01)';
+ctx.shadowOffsetY = 50;
+ctx.fillRect(0, -50, 100, 50);
+
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 4);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.2.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.2.html
new file mode 100644
index 0000000..5da243a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.2.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.alpha.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.alpha.1.html" title="2d.shadow.alpha.1">
+<link rel="next" href="2d.shadow.alpha.3.html" title="2d.shadow.alpha.3">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.alpha.1.html" accesskey="p" title="[p] 2d.shadow.alpha.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.alpha.3.html" accesskey="n" title="[n] 2d.shadow.alpha.3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.alpha.html">alpha</a>.2</h1>
+<p class="desc">Shadow colour alpha components are used</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.shadow.alpha.2.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowColor = 'rgba(0, 0, 255, 0.5)';
+ctx.shadowOffsetY = 50;
+ctx.fillRect(0, -50, 100, 50);
+
+_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.2.png b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.2.png
new file mode 100644
index 0000000..d723a2c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.2.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.3.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.3.html
new file mode 100644
index 0000000..f8ad04a5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.3.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.alpha.3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.alpha.2.html" title="2d.shadow.alpha.2">
+<link rel="next" href="2d.shadow.alpha.4.html" title="2d.shadow.alpha.4">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.alpha.2.html" accesskey="p" title="[p] 2d.shadow.alpha.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.alpha.4.html" accesskey="n" title="[n] 2d.shadow.alpha.4">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.alpha.html">alpha</a>.3</h1>
+<p class="desc">Shadows are affected by globalAlpha</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.shadow.alpha.3.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00'; // (work around broken Firefox globalAlpha caching)
+ctx.shadowColor = '#00f';
+ctx.shadowOffsetY = 50;
+ctx.globalAlpha = 0.5;
+ctx.fillRect(0, -50, 100, 50);
+
+_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.3.png b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.3.png
new file mode 100644
index 0000000..d723a2c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.3.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.4.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.4.html
new file mode 100644
index 0000000..1a15534
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.4.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.alpha.4</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.alpha.3.html" title="2d.shadow.alpha.3">
+<link rel="next" href="2d.shadow.alpha.5.html" title="2d.shadow.alpha.5">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.alpha.3.html" accesskey="p" title="[p] 2d.shadow.alpha.3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.alpha.5.html" accesskey="n" title="[n] 2d.shadow.alpha.5">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.alpha.html">alpha</a>.4</h1>
+<p class="desc">Shadows with alpha components are correctly affected by globalAlpha</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.shadow.alpha.4.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00'; // (work around broken Firefox globalAlpha caching)
+ctx.shadowColor = 'rgba(0, 0, 255, 0.707)';
+ctx.shadowOffsetY = 50;
+ctx.globalAlpha = 0.707;
+ctx.fillRect(0, -50, 100, 50);
+
+_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.4.png b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.4.png
new file mode 100644
index 0000000..d723a2c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.4.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.5.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.5.html
new file mode 100644
index 0000000..70c4fcb
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.5.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.alpha.5</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.alpha.4.html" title="2d.shadow.alpha.4">
+<link rel="next" href="2d.shadow.composite.1.html" title="2d.shadow.composite.1">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.alpha.4.html" accesskey="p" title="[p] 2d.shadow.alpha.4"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.composite.1.html" accesskey="n" title="[n] 2d.shadow.composite.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.alpha.html">alpha</a>.5</h1>
+<p class="desc">Shadows of shapes with alpha components are drawn correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.shadow.alpha.5.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = 'rgba(64, 0, 0, 0.5)';
+ctx.shadowColor = '#00f';
+ctx.shadowOffsetY = 50;
+ctx.fillRect(0, -50, 100, 50);
+
+_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.5.png b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.5.png
new file mode 100644
index 0000000..d723a2c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.alpha.5.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowBlur.initial.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowBlur.initial.html
new file mode 100644
index 0000000..c0488ba
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowBlur.initial.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.attributes.shadowBlur.initial</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.line.union.html" title="2d.line.union">
+<link rel="next" href="2d.shadow.attributes.shadowBlur.valid.html" title="2d.shadow.attributes.shadowBlur.valid">
+<body class="show_output">
+<p>
+ <a href="2d.line.union.html" accesskey="p" title="[p] 2d.line.union"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.attributes.shadowBlur.valid.html" accesskey="n" title="[n] 2d.shadow.attributes.shadowBlur.valid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.attributes.html">attributes</a>.<a href="index.2d.shadow.attributes.shadowBlur.html">shadowBlur</a>.initial</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.blur.get">2d.shadow.blur.get</a>
+<li><a href="spec.html#testrefs.2d.shadow.blur.initial">2d.shadow.blur.initial</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(ctx.shadowBlur, 0, "ctx.shadowBlur", "0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowBlur.invalid.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowBlur.invalid.html
new file mode 100644
index 0000000..b981af2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowBlur.invalid.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.attributes.shadowBlur.invalid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.attributes.shadowBlur.valid.html" title="2d.shadow.attributes.shadowBlur.valid">
+<link rel="next" href="2d.shadow.attributes.shadowOffset.initial.html" title="2d.shadow.attributes.shadowOffset.initial">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.attributes.shadowBlur.valid.html" accesskey="p" title="[p] 2d.shadow.attributes.shadowBlur.valid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.attributes.shadowOffset.initial.html" accesskey="n" title="[n] 2d.shadow.attributes.shadowOffset.initial">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.attributes.html">attributes</a>.<a href="index.2d.shadow.attributes.shadowBlur.html">shadowBlur</a>.invalid</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.blur.invalid">2d.shadow.blur.invalid</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.shadowBlur = 1;
+ctx.shadowBlur = -2;
+_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1");
+
+ctx.shadowBlur = 1;
+ctx.shadowBlur = Infinity;
+_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1");
+
+ctx.shadowBlur = 1;
+ctx.shadowBlur = -Infinity;
+_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1");
+
+ctx.shadowBlur = 1;
+ctx.shadowBlur = NaN;
+_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowBlur.valid.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowBlur.valid.html
new file mode 100644
index 0000000..804472c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowBlur.valid.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.attributes.shadowBlur.valid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.attributes.shadowBlur.initial.html" title="2d.shadow.attributes.shadowBlur.initial">
+<link rel="next" href="2d.shadow.attributes.shadowBlur.invalid.html" title="2d.shadow.attributes.shadowBlur.invalid">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.attributes.shadowBlur.initial.html" accesskey="p" title="[p] 2d.shadow.attributes.shadowBlur.initial"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.attributes.shadowBlur.invalid.html" accesskey="n" title="[n] 2d.shadow.attributes.shadowBlur.invalid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.attributes.html">attributes</a>.<a href="index.2d.shadow.attributes.shadowBlur.html">shadowBlur</a>.valid</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.blur.get">2d.shadow.blur.get</a>
+<li><a href="spec.html#testrefs.2d.shadow.blur.set">2d.shadow.blur.set</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.shadowBlur = 1;
+_assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1");
+
+ctx.shadowBlur = 0.5;
+_assertSame(ctx.shadowBlur, 0.5, "ctx.shadowBlur", "0.5");
+
+ctx.shadowBlur = 1e6;
+_assertSame(ctx.shadowBlur, 1e6, "ctx.shadowBlur", "1e6");
+
+ctx.shadowBlur = 0;
+_assertSame(ctx.shadowBlur, 0, "ctx.shadowBlur", "0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowColor.initial.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowColor.initial.html
new file mode 100644
index 0000000..6fda765
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowColor.initial.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.attributes.shadowColor.initial</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.attributes.shadowOffset.invalid.html" title="2d.shadow.attributes.shadowOffset.invalid">
+<link rel="next" href="2d.shadow.attributes.shadowColor.valid.html" title="2d.shadow.attributes.shadowColor.valid">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.attributes.shadowOffset.invalid.html" accesskey="p" title="[p] 2d.shadow.attributes.shadowOffset.invalid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.attributes.shadowColor.valid.html" accesskey="n" title="[n] 2d.shadow.attributes.shadowColor.valid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.attributes.html">attributes</a>.<a href="index.2d.shadow.attributes.shadowColor.html">shadowColor</a>.initial</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.color.initial">2d.shadow.color.initial</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(ctx.shadowColor, 'rgba(0, 0, 0, 0.0)', "ctx.shadowColor", "'rgba(0, 0, 0, 0.0)'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowColor.invalid.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowColor.invalid.html
new file mode 100644
index 0000000..0dfb57e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowColor.invalid.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.attributes.shadowColor.invalid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.attributes.shadowColor.valid.html" title="2d.shadow.attributes.shadowColor.valid">
+<link rel="next" href="2d.shadow.enable.off.1.html" title="2d.shadow.enable.off.1">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.attributes.shadowColor.valid.html" accesskey="p" title="[p] 2d.shadow.attributes.shadowColor.valid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.enable.off.1.html" accesskey="n" title="[n] 2d.shadow.enable.off.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.attributes.html">attributes</a>.<a href="index.2d.shadow.attributes.shadowColor.html">shadowColor</a>.invalid</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.color.invalid">2d.shadow.color.invalid</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.shadowColor = '#00ff00';
+ctx.shadowColor = 'bogus';
+_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'");
+
+ctx.shadowColor = '#00ff00';
+ctx.shadowColor = 'red bogus';
+_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'");
+
+ctx.shadowColor = '#00ff00';
+ctx.shadowColor = ctx;
+_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'");
+
+ctx.shadowColor = '#00ff00';
+ctx.shadowColor = undefined;
+_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowColor.valid.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowColor.valid.html
new file mode 100644
index 0000000..4611e98
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowColor.valid.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.attributes.shadowColor.valid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.attributes.shadowColor.initial.html" title="2d.shadow.attributes.shadowColor.initial">
+<link rel="next" href="2d.shadow.attributes.shadowColor.invalid.html" title="2d.shadow.attributes.shadowColor.invalid">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.attributes.shadowColor.initial.html" accesskey="p" title="[p] 2d.shadow.attributes.shadowColor.initial"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.attributes.shadowColor.invalid.html" accesskey="n" title="[n] 2d.shadow.attributes.shadowColor.invalid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.attributes.html">attributes</a>.<a href="index.2d.shadow.attributes.shadowColor.html">shadowColor</a>.valid</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.color.get">2d.shadow.color.get</a>
+<li><a href="spec.html#testrefs.2d.shadow.color.set">2d.shadow.color.set</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.shadowColor = 'lime';
+_assertSame(ctx.shadowColor, '#00ff00', "ctx.shadowColor", "'#00ff00'");
+
+ctx.shadowColor = 'RGBA(0,255, 0,0)';
+_assertSame(ctx.shadowColor, 'rgba(0, 255, 0, 0.0)', "ctx.shadowColor", "'rgba(0, 255, 0, 0.0)'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowOffset.initial.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowOffset.initial.html
new file mode 100644
index 0000000..66ce2a7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowOffset.initial.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.attributes.shadowOffset.initial</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.attributes.shadowBlur.invalid.html" title="2d.shadow.attributes.shadowBlur.invalid">
+<link rel="next" href="2d.shadow.attributes.shadowOffset.valid.html" title="2d.shadow.attributes.shadowOffset.valid">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.attributes.shadowBlur.invalid.html" accesskey="p" title="[p] 2d.shadow.attributes.shadowBlur.invalid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.attributes.shadowOffset.valid.html" accesskey="n" title="[n] 2d.shadow.attributes.shadowOffset.valid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.attributes.html">attributes</a>.<a href="index.2d.shadow.attributes.shadowOffset.html">shadowOffset</a>.initial</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.offset.initial">2d.shadow.offset.initial</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(ctx.shadowOffsetX, 0, "ctx.shadowOffsetX", "0");
+_assertSame(ctx.shadowOffsetY, 0, "ctx.shadowOffsetY", "0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowOffset.invalid.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowOffset.invalid.html
new file mode 100644
index 0000000..30d531a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowOffset.invalid.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.attributes.shadowOffset.invalid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.attributes.shadowOffset.valid.html" title="2d.shadow.attributes.shadowOffset.valid">
+<link rel="next" href="2d.shadow.attributes.shadowColor.initial.html" title="2d.shadow.attributes.shadowColor.initial">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.attributes.shadowOffset.valid.html" accesskey="p" title="[p] 2d.shadow.attributes.shadowOffset.valid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.attributes.shadowColor.initial.html" accesskey="n" title="[n] 2d.shadow.attributes.shadowColor.initial">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.attributes.html">attributes</a>.<a href="index.2d.shadow.attributes.shadowOffset.html">shadowOffset</a>.invalid</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.offset.invalid">2d.shadow.offset.invalid</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.shadowOffsetX = 1;
+ctx.shadowOffsetY = 2;
+ctx.shadowOffsetX = Infinity;
+ctx.shadowOffsetY = Infinity;
+_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1");
+_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2");
+
+ctx.shadowOffsetX = 1;
+ctx.shadowOffsetY = 2;
+ctx.shadowOffsetX = -Infinity;
+ctx.shadowOffsetY = -Infinity;
+_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1");
+_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2");
+
+ctx.shadowOffsetX = 1;
+ctx.shadowOffsetY = 2;
+ctx.shadowOffsetX = NaN;
+ctx.shadowOffsetY = NaN;
+_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1");
+_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowOffset.valid.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowOffset.valid.html
new file mode 100644
index 0000000..3ab2ffa
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.attributes.shadowOffset.valid.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.attributes.shadowOffset.valid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.attributes.shadowOffset.initial.html" title="2d.shadow.attributes.shadowOffset.initial">
+<link rel="next" href="2d.shadow.attributes.shadowOffset.invalid.html" title="2d.shadow.attributes.shadowOffset.invalid">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.attributes.shadowOffset.initial.html" accesskey="p" title="[p] 2d.shadow.attributes.shadowOffset.initial"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.attributes.shadowOffset.invalid.html" accesskey="n" title="[n] 2d.shadow.attributes.shadowOffset.invalid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.attributes.html">attributes</a>.<a href="index.2d.shadow.attributes.shadowOffset.html">shadowOffset</a>.valid</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.offset.get">2d.shadow.offset.get</a>
+<li><a href="spec.html#testrefs.2d.shadow.offset.set">2d.shadow.offset.set</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.shadowOffsetX = 1;
+ctx.shadowOffsetY = 2;
+_assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1");
+_assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2");
+
+ctx.shadowOffsetX = 0.5;
+ctx.shadowOffsetY = 0.25;
+_assertSame(ctx.shadowOffsetX, 0.5, "ctx.shadowOffsetX", "0.5");
+_assertSame(ctx.shadowOffsetY, 0.25, "ctx.shadowOffsetY", "0.25");
+
+ctx.shadowOffsetX = -0.5;
+ctx.shadowOffsetY = -0.25;
+_assertSame(ctx.shadowOffsetX, -0.5, "ctx.shadowOffsetX", "-0.5");
+_assertSame(ctx.shadowOffsetY, -0.25, "ctx.shadowOffsetY", "-0.25");
+
+ctx.shadowOffsetX = 0;
+ctx.shadowOffsetY = 0;
+_assertSame(ctx.shadowOffsetX, 0, "ctx.shadowOffsetX", "0");
+_assertSame(ctx.shadowOffsetY, 0, "ctx.shadowOffsetY", "0");
+
+ctx.shadowOffsetX = 1e6;
+ctx.shadowOffsetY = 1e6;
+_assertSame(ctx.shadowOffsetX, 1e6, "ctx.shadowOffsetX", "1e6");
+_assertSame(ctx.shadowOffsetY, 1e6, "ctx.shadowOffsetY", "1e6");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.blur.high.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.blur.high.html
new file mode 100644
index 0000000..5170b11
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.blur.high.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.blur.high</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.blur.low.html" title="2d.shadow.blur.low">
+<link rel="next" href="2d.shadow.alpha.1.html" title="2d.shadow.alpha.1">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.blur.low.html" accesskey="p" title="[p] 2d.shadow.blur.low"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.alpha.1.html" accesskey="n" title="[n] 2d.shadow.alpha.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.blur.html">blur</a>.high</h1>
+<p class="desc">Shadows look correct for large blurs</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.shadow.blur.high.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#ff0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowColor = '#00f';
+ctx.shadowOffsetY = 0;
+ctx.shadowBlur = 555.6;
+ctx.fillRect(-200, -200, 200, 400);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.blur.high.png b/LayoutTests/fast/canvas/philip/tests/2d.shadow.blur.high.png
new file mode 100644
index 0000000..2310362
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.blur.high.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.blur.low.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.blur.low.html
new file mode 100644
index 0000000..07bc30b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.blur.low.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.blur.low</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.transform.2.html" title="2d.shadow.transform.2">
+<link rel="next" href="2d.shadow.blur.high.html" title="2d.shadow.blur.high">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.transform.2.html" accesskey="p" title="[p] 2d.shadow.transform.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.blur.high.html" accesskey="n" title="[n] 2d.shadow.blur.high">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.blur.html">blur</a>.low</h1>
+<p class="desc">Shadows look correct for small blurs</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.shadow.blur.low.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#ff0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowColor = '#00f';
+ctx.shadowOffsetY = 25;
+for (var x = 0; x < 100; ++x) {
+ ctx.save();
+ ctx.beginPath();
+ ctx.rect(x, 0, 1, 50);
+ ctx.clip();
+ ctx.shadowBlur = x;
+ ctx.fillRect(-200, -200, 500, 200);
+ ctx.restore();
+}
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.blur.low.png b/LayoutTests/fast/canvas/philip/tests/2d.shadow.blur.low.png
new file mode 100644
index 0000000..e43d82a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.blur.low.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.canvas.alpha.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.canvas.alpha.html
new file mode 100644
index 0000000..760e55f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.canvas.alpha.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.canvas.alpha</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.canvas.transparent.2.html" title="2d.shadow.canvas.transparent.2">
+<link rel="next" href="2d.shadow.pattern.basic.html" title="2d.shadow.pattern.basic">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.canvas.transparent.2.html" accesskey="p" title="[p] 2d.shadow.canvas.transparent.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.pattern.basic.html" accesskey="n" title="[n] 2d.shadow.pattern.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.canvas.html">canvas</a>.alpha</h1>
+<p class="desc">Shadows are drawn correctly for partially-transparent canvases</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.shadow.canvas.alpha.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.fillStyle = 'rgba(255, 0, 0, 0.5)';
+ctx2.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowOffsetY = 50;
+ctx.shadowColor = '#00f';
+ctx.drawImage(canvas2, 0, -50);
+
+_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2);
+
+
+});
+</script>
+<img src="../images/transparent50.png" id="transparent50.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.canvas.alpha.png b/LayoutTests/fast/canvas/philip/tests/2d.shadow.canvas.alpha.png
new file mode 100644
index 0000000..d723a2c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.canvas.alpha.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.canvas.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.canvas.basic.html
new file mode 100644
index 0000000..60e8c3a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.canvas.basic.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.canvas.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.image.scale.html" title="2d.shadow.image.scale">
+<link rel="next" href="2d.shadow.canvas.transparent.1.html" title="2d.shadow.canvas.transparent.1">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.image.scale.html" accesskey="p" title="[p] 2d.shadow.image.scale"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.canvas.transparent.1.html" accesskey="n" title="[n] 2d.shadow.canvas.transparent.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.canvas.html">canvas</a>.basic</h1>
+<p class="desc">Shadows are drawn for canvases</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.fillStyle = '#f00';
+ctx2.fillRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetY = 50;
+ctx.drawImage(canvas2, 0, -50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.canvas.transparent.1.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.canvas.transparent.1.html
new file mode 100644
index 0000000..f47301e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.canvas.transparent.1.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.canvas.transparent.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.canvas.basic.html" title="2d.shadow.canvas.basic">
+<link rel="next" href="2d.shadow.canvas.transparent.2.html" title="2d.shadow.canvas.transparent.2">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.canvas.basic.html" accesskey="p" title="[p] 2d.shadow.canvas.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.canvas.transparent.2.html" accesskey="n" title="[n] 2d.shadow.canvas.transparent.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.canvas.html">canvas</a>.<a href="index.2d.shadow.canvas.transparent.html">transparent</a>.1</h1>
+<p class="desc">Shadows are not drawn for transparent canvases</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowColor = '#f00';
+ctx.shadowOffsetY = 50;
+ctx.drawImage(canvas2, 0, -50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.canvas.transparent.2.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.canvas.transparent.2.html
new file mode 100644
index 0000000..b9e1a03
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.canvas.transparent.2.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.canvas.transparent.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.canvas.transparent.1.html" title="2d.shadow.canvas.transparent.1">
+<link rel="next" href="2d.shadow.canvas.alpha.html" title="2d.shadow.canvas.alpha">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.canvas.transparent.1.html" accesskey="p" title="[p] 2d.shadow.canvas.transparent.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.canvas.alpha.html" accesskey="n" title="[n] 2d.shadow.canvas.alpha">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.canvas.html">canvas</a>.<a href="index.2d.shadow.canvas.transparent.html">transparent</a>.2</h1>
+<p class="desc">Shadows are not drawn for transparent parts of canvases</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.fillStyle = '#f00';
+ctx2.fillRect(0, 0, 50, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 50, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(50, 0, 50, 50);
+ctx.shadowOffsetY = 50;
+ctx.shadowColor = '#0f0';
+ctx.drawImage(canvas2, 50, -50);
+ctx.shadowColor = '#f00';
+ctx.drawImage(canvas2, -50, -50);
+
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.clip.1.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.clip.1.html
new file mode 100644
index 0000000..afa95d0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.clip.1.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.clip.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.outside.html" title="2d.shadow.outside">
+<link rel="next" href="2d.shadow.clip.2.html" title="2d.shadow.clip.2">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.outside.html" accesskey="p" title="[p] 2d.shadow.outside"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.clip.2.html" accesskey="n" title="[n] 2d.shadow.clip.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.clip.html">clip</a>.1</h1>
+<p class="desc">Shadows of clipped shapes are still drawn within the clipping region</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 50, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(50, 0, 50, 50);
+
+ctx.save();
+ctx.beginPath();
+ctx.rect(50, 0, 50, 50);
+ctx.clip();
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetX = 50;
+ctx.fillRect(0, 0, 50, 50);
+ctx.restore();
+
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.clip.2.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.clip.2.html
new file mode 100644
index 0000000..aee72a0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.clip.2.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.clip.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.clip.1.html" title="2d.shadow.clip.1">
+<link rel="next" href="2d.shadow.clip.3.html" title="2d.shadow.clip.3">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.clip.1.html" accesskey="p" title="[p] 2d.shadow.clip.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.clip.3.html" accesskey="n" title="[n] 2d.shadow.clip.3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.clip.html">clip</a>.2</h1>
+<p class="desc">Shadows are not drawn outside the clipping region</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(50, 0, 50, 50);
+
+ctx.save();
+ctx.beginPath();
+ctx.rect(0, 0, 50, 50);
+ctx.clip();
+ctx.shadowColor = '#f00';
+ctx.shadowOffsetX = 50;
+ctx.fillRect(0, 0, 50, 50);
+ctx.restore();
+
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.clip.3.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.clip.3.html
new file mode 100644
index 0000000..3b55f14e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.clip.3.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.clip.3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.clip.2.html" title="2d.shadow.clip.2">
+<link rel="next" href="2d.shadow.stroke.basic.html" title="2d.shadow.stroke.basic">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.clip.2.html" accesskey="p" title="[p] 2d.shadow.clip.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.stroke.basic.html" accesskey="n" title="[n] 2d.shadow.stroke.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.clip.html">clip</a>.3</h1>
+<p class="desc">Shadows of clipped shapes are still drawn within the clipping region</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(50, 0, 50, 50);
+
+ctx.save();
+ctx.beginPath();
+ctx.rect(0, 0, 50, 50);
+ctx.clip();
+ctx.fillStyle = '#f00';
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetX = 50;
+ctx.fillRect(-50, 0, 50, 50);
+ctx.restore();
+
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.composite.1.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.composite.1.html
new file mode 100644
index 0000000..ddb886f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.composite.1.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.composite.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.alpha.5.html" title="2d.shadow.alpha.5">
+<link rel="next" href="2d.shadow.composite.2.html" title="2d.shadow.composite.2">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.alpha.5.html" accesskey="p" title="[p] 2d.shadow.alpha.5"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.composite.2.html" accesskey="n" title="[n] 2d.shadow.composite.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.composite.html">composite</a>.1</h1>
+<p class="desc">Shadows are drawn using globalCompositeOperation</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'xor';
+ctx.shadowColor = '#f00';
+ctx.shadowOffsetX = 100;
+ctx.fillStyle = '#0f0';
+ctx.fillRect(-100, 0, 200, 50);
+
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.composite.2.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.composite.2.html
new file mode 100644
index 0000000..00c85b1
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.composite.2.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.composite.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.composite.1.html" title="2d.shadow.composite.1">
+<link rel="next" href="2d.shadow.composite.3.html" title="2d.shadow.composite.3">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.composite.1.html" accesskey="p" title="[p] 2d.shadow.composite.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.composite.3.html" accesskey="n" title="[n] 2d.shadow.composite.3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.composite.html">composite</a>.2</h1>
+<p class="desc">Shadows are drawn using globalCompositeOperation</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'xor';
+ctx.shadowColor = '#f00';
+ctx.shadowBlur = 1;
+ctx.fillStyle = '#0f0';
+ctx.fillRect(-10, -10, 120, 70);
+
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.composite.3.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.composite.3.html
new file mode 100644
index 0000000..f065d92
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.composite.3.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.composite.3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.composite.2.html" title="2d.shadow.composite.2">
+<link rel="next" href="2d.clearRect.basic.html" title="2d.clearRect.basic">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.composite.2.html" accesskey="p" title="[p] 2d.shadow.composite.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.clearRect.basic.html" accesskey="n" title="[n] 2d.clearRect.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.composite.html">composite</a>.3</h1>
+<p class="desc">Areas outside shadows are drawn correctly with destination-out</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-out';
+ctx.shadowColor = '#f00';
+ctx.shadowBlur = 10;
+ctx.fillStyle = '#f00';
+ctx.fillRect(200, 0, 100, 50);
+
+_assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.enable.blur.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.enable.blur.html
new file mode 100644
index 0000000..a866001
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.enable.blur.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.enable.blur</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.enable.off.2.html" title="2d.shadow.enable.off.2">
+<link rel="next" href="2d.shadow.enable.x.html" title="2d.shadow.enable.x">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.enable.off.2.html" accesskey="p" title="[p] 2d.shadow.enable.off.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.enable.x.html" accesskey="n" title="[n] 2d.shadow.enable.x">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.enable.html">enable</a>.blur</h1>
+<p class="desc">Shadows are drawn if shadowBlur is set</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.enable">2d.shadow.enable</a>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.shadowColor = '#0f0';
+ctx.shadowBlur = 0.1;
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.enable.off.1.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.enable.off.1.html
new file mode 100644
index 0000000..85d987c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.enable.off.1.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.enable.off.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.attributes.shadowColor.invalid.html" title="2d.shadow.attributes.shadowColor.invalid">
+<link rel="next" href="2d.shadow.enable.off.2.html" title="2d.shadow.enable.off.2">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.attributes.shadowColor.invalid.html" accesskey="p" title="[p] 2d.shadow.attributes.shadowColor.invalid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.enable.off.2.html" accesskey="n" title="[n] 2d.shadow.enable.off.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.enable.html">enable</a>.<a href="index.2d.shadow.enable.off.html">off</a>.1</h1>
+<p class="desc">Shadows are not drawn when only shadowColor is set</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.enable">2d.shadow.enable</a>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.shadowColor = '#f00';
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.enable.off.2.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.enable.off.2.html
new file mode 100644
index 0000000..e6b15f4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.enable.off.2.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.enable.off.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.enable.off.1.html" title="2d.shadow.enable.off.1">
+<link rel="next" href="2d.shadow.enable.blur.html" title="2d.shadow.enable.blur">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.enable.off.1.html" accesskey="p" title="[p] 2d.shadow.enable.off.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.enable.blur.html" accesskey="n" title="[n] 2d.shadow.enable.blur">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.enable.html">enable</a>.<a href="index.2d.shadow.enable.off.html">off</a>.2</h1>
+<p class="desc">Shadows are not drawn when only shadowColor is set</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.enable">2d.shadow.enable</a>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.shadowColor = '#f00';
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.enable.x.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.enable.x.html
new file mode 100644
index 0000000..e2dd251
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.enable.x.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.enable.x</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.enable.blur.html" title="2d.shadow.enable.blur">
+<link rel="next" href="2d.shadow.enable.y.html" title="2d.shadow.enable.y">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.enable.blur.html" accesskey="p" title="[p] 2d.shadow.enable.blur"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.enable.y.html" accesskey="n" title="[n] 2d.shadow.enable.y">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.enable.html">enable</a>.x</h1>
+<p class="desc">Shadows are drawn if shadowOffsetX is set</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.enable">2d.shadow.enable</a>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetX = 0.1;
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.enable.y.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.enable.y.html
new file mode 100644
index 0000000..e774c14
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.enable.y.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.enable.y</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.enable.x.html" title="2d.shadow.enable.x">
+<link rel="next" href="2d.shadow.offset.positiveX.html" title="2d.shadow.offset.positiveX">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.enable.x.html" accesskey="p" title="[p] 2d.shadow.enable.x"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.offset.positiveX.html" accesskey="n" title="[n] 2d.shadow.offset.positiveX">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.enable.html">enable</a>.y</h1>
+<p class="desc">Shadows are drawn if shadowOffsetY is set</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.enable">2d.shadow.enable</a>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'destination-atop';
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetY = 0.1;
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.gradient.alpha.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.gradient.alpha.html
new file mode 100644
index 0000000..dc67fda
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.gradient.alpha.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.gradient.alpha</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.gradient.transparent.2.html" title="2d.shadow.gradient.transparent.2">
+<link rel="next" href="2d.shadow.transform.1.html" title="2d.shadow.transform.1">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.gradient.transparent.2.html" accesskey="p" title="[p] 2d.shadow.gradient.transparent.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.transform.1.html" accesskey="n" title="[n] 2d.shadow.transform.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.gradient.html">gradient</a>.alpha</h1>
+<p class="desc">Shadows are drawn correctly for partially-transparent gradient fills</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.shadow.gradient.alpha.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var gradient = ctx.createLinearGradient(0, 0, 100, 0);
+gradient.addColorStop(0, 'rgba(255,0,0,0.5)');
+gradient.addColorStop(1, 'rgba(255,0,0,0.5)');
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowOffsetY = 50;
+ctx.shadowColor = '#00f';
+ctx.fillStyle = gradient;
+ctx.fillRect(0, -50, 100, 50);
+
+_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.gradient.alpha.png b/LayoutTests/fast/canvas/philip/tests/2d.shadow.gradient.alpha.png
new file mode 100644
index 0000000..d723a2c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.gradient.alpha.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.gradient.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.gradient.basic.html
new file mode 100644
index 0000000..ab6e3b1
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.gradient.basic.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.gradient.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.pattern.alpha.html" title="2d.shadow.pattern.alpha">
+<link rel="next" href="2d.shadow.gradient.transparent.1.html" title="2d.shadow.gradient.transparent.1">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.pattern.alpha.html" accesskey="p" title="[p] 2d.shadow.pattern.alpha"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.gradient.transparent.1.html" accesskey="n" title="[n] 2d.shadow.gradient.transparent.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.gradient.html">gradient</a>.basic</h1>
+<p class="desc">Shadows are drawn for gradient fills</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var gradient = ctx.createLinearGradient(0, 0, 100, 0);
+gradient.addColorStop(0, '#f00');
+gradient.addColorStop(1, '#f00');
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetY = 50;
+ctx.fillStyle = gradient;
+ctx.fillRect(0, -50, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.gradient.transparent.1.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.gradient.transparent.1.html
new file mode 100644
index 0000000..e086788
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.gradient.transparent.1.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.gradient.transparent.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.gradient.basic.html" title="2d.shadow.gradient.basic">
+<link rel="next" href="2d.shadow.gradient.transparent.2.html" title="2d.shadow.gradient.transparent.2">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.gradient.basic.html" accesskey="p" title="[p] 2d.shadow.gradient.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.gradient.transparent.2.html" accesskey="n" title="[n] 2d.shadow.gradient.transparent.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.gradient.html">gradient</a>.<a href="index.2d.shadow.gradient.transparent.html">transparent</a>.1</h1>
+<p class="desc">Shadows are not drawn for transparent gradient fills</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var gradient = ctx.createLinearGradient(0, 0, 100, 0);
+gradient.addColorStop(0, 'rgba(0,0,0,0)');
+gradient.addColorStop(1, 'rgba(0,0,0,0)');
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowColor = '#f00';
+ctx.shadowOffsetY = 50;
+ctx.fillStyle = gradient;
+ctx.fillRect(0, -50, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.gradient.transparent.2.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.gradient.transparent.2.html
new file mode 100644
index 0000000..04bd5c3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.gradient.transparent.2.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.gradient.transparent.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.gradient.transparent.1.html" title="2d.shadow.gradient.transparent.1">
+<link rel="next" href="2d.shadow.gradient.alpha.html" title="2d.shadow.gradient.alpha">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.gradient.transparent.1.html" accesskey="p" title="[p] 2d.shadow.gradient.transparent.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.gradient.alpha.html" accesskey="n" title="[n] 2d.shadow.gradient.alpha">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.gradient.html">gradient</a>.<a href="index.2d.shadow.gradient.transparent.html">transparent</a>.2</h1>
+<p class="desc">Shadows are not drawn for transparent parts of gradient fills</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var gradient = ctx.createLinearGradient(0, 0, 100, 0);
+gradient.addColorStop(0, '#f00');
+gradient.addColorStop(0.499, '#f00');
+gradient.addColorStop(0.5, 'rgba(0,0,0,0)');
+gradient.addColorStop(1, 'rgba(0,0,0,0)');
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(50, 0, 50, 50);
+ctx.shadowOffsetY = 50;
+ctx.shadowColor = '#0f0';
+ctx.fillStyle = gradient;
+ctx.fillRect(0, -50, 100, 50);
+
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.alpha.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.alpha.html
new file mode 100644
index 0000000..e22957d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.alpha.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.image.alpha</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.image.transparent.2.html" title="2d.shadow.image.transparent.2">
+<link rel="next" href="2d.shadow.image.section.html" title="2d.shadow.image.section">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.image.transparent.2.html" accesskey="p" title="[p] 2d.shadow.image.transparent.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.image.section.html" accesskey="n" title="[n] 2d.shadow.image.section">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.image.html">image</a>.alpha</h1>
+<p class="desc">Shadows are drawn correctly for partially-transparent images</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.shadow.image.alpha.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowOffsetY = 50;
+ctx.shadowColor = '#00f';
+ctx.drawImage(document.getElementById('transparent50.png'), 0, -50);
+
+_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2);
+
+
+});
+</script>
+<img src="../images/transparent50.png" id="transparent50.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.alpha.png b/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.alpha.png
new file mode 100644
index 0000000..d723a2c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.alpha.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.basic.html
new file mode 100644
index 0000000..8a8c08c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.basic.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.image.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.stroke.join.3.html" title="2d.shadow.stroke.join.3">
+<link rel="next" href="2d.shadow.image.transparent.1.html" title="2d.shadow.image.transparent.1">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.stroke.join.3.html" accesskey="p" title="[p] 2d.shadow.stroke.join.3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.image.transparent.1.html" accesskey="n" title="[n] 2d.shadow.image.transparent.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.image.html">image</a>.basic</h1>
+<p class="desc">Shadows are drawn for images</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetY = 50;
+ctx.drawImage(document.getElementById('red.png'), 0, -50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.scale.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.scale.html
new file mode 100644
index 0000000..97bb092
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.scale.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.image.scale</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.image.section.html" title="2d.shadow.image.section">
+<link rel="next" href="2d.shadow.canvas.basic.html" title="2d.shadow.canvas.basic">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.image.section.html" accesskey="p" title="[p] 2d.shadow.image.section"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.canvas.basic.html" accesskey="n" title="[n] 2d.shadow.canvas.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.image.html">image</a>.scale</h1>
+<p class="desc">Shadows are drawn correctly for scaled images</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowOffsetY = 50;
+ctx.shadowColor = '#0f0';
+ctx.drawImage(document.getElementById('redtransparent.png'), 0, 0, 100, 50, -10, -50, 240, 50);
+
+_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/redtransparent.png" id="redtransparent.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.section.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.section.html
new file mode 100644
index 0000000..7a58bda
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.section.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.image.section</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.image.alpha.html" title="2d.shadow.image.alpha">
+<link rel="next" href="2d.shadow.image.scale.html" title="2d.shadow.image.scale">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.image.alpha.html" accesskey="p" title="[p] 2d.shadow.image.alpha"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.image.scale.html" accesskey="n" title="[n] 2d.shadow.image.scale">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.image.html">image</a>.section</h1>
+<p class="desc">Shadows are not drawn for areas outside image source rectangles</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowOffsetY = 50;
+ctx.shadowColor = '#f00';
+ctx.drawImage(document.getElementById('redtransparent.png'), 50, 0, 50, 50, 0, -50, 50, 50);
+
+_assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255", 2);
+_assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+
+
+});
+</script>
+<img src="../images/redtransparent.png" id="redtransparent.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.transparent.1.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.transparent.1.html
new file mode 100644
index 0000000..22d0d30
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.transparent.1.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.image.transparent.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.image.basic.html" title="2d.shadow.image.basic">
+<link rel="next" href="2d.shadow.image.transparent.2.html" title="2d.shadow.image.transparent.2">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.image.basic.html" accesskey="p" title="[p] 2d.shadow.image.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.image.transparent.2.html" accesskey="n" title="[n] 2d.shadow.image.transparent.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.image.html">image</a>.<a href="index.2d.shadow.image.transparent.html">transparent</a>.1</h1>
+<p class="desc">Shadows are not drawn for transparent images</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowColor = '#f00';
+ctx.shadowOffsetY = 50;
+ctx.drawImage(document.getElementById('transparent.png'), 0, -50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/transparent.png" id="transparent.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.transparent.2.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.transparent.2.html
new file mode 100644
index 0000000..6badf3d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.image.transparent.2.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.image.transparent.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.image.transparent.1.html" title="2d.shadow.image.transparent.1">
+<link rel="next" href="2d.shadow.image.alpha.html" title="2d.shadow.image.alpha">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.image.transparent.1.html" accesskey="p" title="[p] 2d.shadow.image.transparent.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.image.alpha.html" accesskey="n" title="[n] 2d.shadow.image.alpha">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.image.html">image</a>.<a href="index.2d.shadow.image.transparent.html">transparent</a>.2</h1>
+<p class="desc">Shadows are not drawn for transparent parts of images</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 50, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(50, 0, 50, 50);
+ctx.shadowOffsetY = 50;
+ctx.shadowColor = '#0f0';
+ctx.drawImage(document.getElementById('redtransparent.png'), 50, -50);
+ctx.shadowColor = '#f00';
+ctx.drawImage(document.getElementById('redtransparent.png'), -50, -50);
+
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/redtransparent.png" id="redtransparent.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.offset.negativeX.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.offset.negativeX.html
new file mode 100644
index 0000000..ba39470
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.offset.negativeX.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.offset.negativeX</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.offset.positiveX.html" title="2d.shadow.offset.positiveX">
+<link rel="next" href="2d.shadow.offset.positiveY.html" title="2d.shadow.offset.positiveY">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.offset.positiveX.html" accesskey="p" title="[p] 2d.shadow.offset.positiveX"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.offset.positiveY.html" accesskey="n" title="[n] 2d.shadow.offset.positiveY">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.offset.html">offset</a>.negativeX</h1>
+<p class="desc">Shadows can be offset with negative x</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetX = -50;
+ctx.fillRect(50, 0, 50, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.offset.negativeY.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.offset.negativeY.html
new file mode 100644
index 0000000..4ea776c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.offset.negativeY.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.offset.negativeY</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.offset.positiveY.html" title="2d.shadow.offset.positiveY">
+<link rel="next" href="2d.shadow.outside.html" title="2d.shadow.outside">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.offset.positiveY.html" accesskey="p" title="[p] 2d.shadow.offset.positiveY"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.outside.html" accesskey="n" title="[n] 2d.shadow.outside">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.offset.html">offset</a>.negativeY</h1>
+<p class="desc">Shadows can be offset with negative y</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetY = -25;
+ctx.fillRect(0, 25, 100, 25);
+_assertPixel(canvas, 50,12, 0,255,0,255, "50,12", "0,255,0,255");
+_assertPixel(canvas, 50,37, 0,255,0,255, "50,37", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.offset.positiveX.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.offset.positiveX.html
new file mode 100644
index 0000000..ae6716f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.offset.positiveX.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.offset.positiveX</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.enable.y.html" title="2d.shadow.enable.y">
+<link rel="next" href="2d.shadow.offset.negativeX.html" title="2d.shadow.offset.negativeX">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.enable.y.html" accesskey="p" title="[p] 2d.shadow.enable.y"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.offset.negativeX.html" accesskey="n" title="[n] 2d.shadow.offset.negativeX">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.offset.html">offset</a>.positiveX</h1>
+<p class="desc">Shadows can be offset with positive x</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetX = 50;
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.offset.positiveY.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.offset.positiveY.html
new file mode 100644
index 0000000..1e28976
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.offset.positiveY.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.offset.positiveY</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.offset.negativeX.html" title="2d.shadow.offset.negativeX">
+<link rel="next" href="2d.shadow.offset.negativeY.html" title="2d.shadow.offset.negativeY">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.offset.negativeX.html" accesskey="p" title="[p] 2d.shadow.offset.negativeX"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.offset.negativeY.html" accesskey="n" title="[n] 2d.shadow.offset.negativeY">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.offset.html">offset</a>.positiveY</h1>
+<p class="desc">Shadows can be offset with positive y</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetY = 25;
+ctx.fillRect(0, 0, 100, 25);
+_assertPixel(canvas, 50,12, 0,255,0,255, "50,12", "0,255,0,255");
+_assertPixel(canvas, 50,37, 0,255,0,255, "50,37", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.outside.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.outside.html
new file mode 100644
index 0000000..06c8f28
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.outside.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.outside</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.offset.negativeY.html" title="2d.shadow.offset.negativeY">
+<link rel="next" href="2d.shadow.clip.1.html" title="2d.shadow.clip.1">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.offset.negativeY.html" accesskey="p" title="[p] 2d.shadow.offset.negativeY"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.clip.1.html" accesskey="n" title="[n] 2d.shadow.clip.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.outside</h1>
+<p class="desc">Shadows of shapes outside the visible area can be offset onto the visible area</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetX = 100;
+ctx.fillRect(-100, 0, 25, 50);
+ctx.shadowOffsetX = -100;
+ctx.fillRect(175, 0, 25, 50);
+ctx.shadowOffsetX = 0;
+ctx.shadowOffsetY = 100;
+ctx.fillRect(25, -100, 50, 25);
+ctx.shadowOffsetY = -100;
+ctx.fillRect(25, 125, 50, 25);
+_assertPixel(canvas, 12,25, 0,255,0,255, "12,25", "0,255,0,255");
+_assertPixel(canvas, 87,25, 0,255,0,255, "87,25", "0,255,0,255");
+_assertPixel(canvas, 50,12, 0,255,0,255, "50,12", "0,255,0,255");
+_assertPixel(canvas, 50,37, 0,255,0,255, "50,37", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.pattern.alpha.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.pattern.alpha.html
new file mode 100644
index 0000000..0744b41
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.pattern.alpha.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.pattern.alpha</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.pattern.transparent.2.html" title="2d.shadow.pattern.transparent.2">
+<link rel="next" href="2d.shadow.gradient.basic.html" title="2d.shadow.gradient.basic">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.pattern.transparent.2.html" accesskey="p" title="[p] 2d.shadow.pattern.transparent.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.gradient.basic.html" accesskey="n" title="[n] 2d.shadow.gradient.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.pattern.html">pattern</a>.alpha</h1>
+<p class="desc">Shadows are drawn correctly for partially-transparent fill patterns</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.shadow.pattern.alpha.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var pattern = ctx.createPattern(document.getElementById('transparent50.png'), 'repeat');
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowOffsetY = 50;
+ctx.shadowColor = '#00f';
+ctx.fillStyle = pattern;
+ctx.fillRect(0, -50, 100, 50);
+
+_assertPixelApprox(canvas, 50,25, 127,0,127,255, "50,25", "127,0,127,255", 2);
+
+
+});
+</script>
+<img src="../images/transparent50.png" id="transparent50.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.pattern.alpha.png b/LayoutTests/fast/canvas/philip/tests/2d.shadow.pattern.alpha.png
new file mode 100644
index 0000000..d723a2c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.pattern.alpha.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.pattern.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.pattern.basic.html
new file mode 100644
index 0000000..3f1c6f8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.pattern.basic.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.pattern.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.canvas.alpha.html" title="2d.shadow.canvas.alpha">
+<link rel="next" href="2d.shadow.pattern.transparent.1.html" title="2d.shadow.pattern.transparent.1">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.canvas.alpha.html" accesskey="p" title="[p] 2d.shadow.canvas.alpha"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.pattern.transparent.1.html" accesskey="n" title="[n] 2d.shadow.pattern.transparent.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.pattern.html">pattern</a>.basic</h1>
+<p class="desc">Shadows are drawn for fill patterns</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var pattern = ctx.createPattern(document.getElementById('red.png'), 'repeat');
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetY = 50;
+ctx.fillStyle = pattern;
+ctx.fillRect(0, -50, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/red.png" id="red.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.pattern.transparent.1.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.pattern.transparent.1.html
new file mode 100644
index 0000000..c3b5a5c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.pattern.transparent.1.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.pattern.transparent.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.pattern.basic.html" title="2d.shadow.pattern.basic">
+<link rel="next" href="2d.shadow.pattern.transparent.2.html" title="2d.shadow.pattern.transparent.2">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.pattern.basic.html" accesskey="p" title="[p] 2d.shadow.pattern.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.pattern.transparent.2.html" accesskey="n" title="[n] 2d.shadow.pattern.transparent.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.pattern.html">pattern</a>.<a href="index.2d.shadow.pattern.transparent.html">transparent</a>.1</h1>
+<p class="desc">Shadows are not drawn for transparent fill patterns</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var pattern = ctx.createPattern(document.getElementById('transparent.png'), 'repeat');
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowColor = '#f00';
+ctx.shadowOffsetY = 50;
+ctx.fillStyle = pattern;
+ctx.fillRect(0, -50, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/transparent.png" id="transparent.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.pattern.transparent.2.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.pattern.transparent.2.html
new file mode 100644
index 0000000..70f0c92
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.pattern.transparent.2.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.pattern.transparent.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.pattern.transparent.1.html" title="2d.shadow.pattern.transparent.1">
+<link rel="next" href="2d.shadow.pattern.alpha.html" title="2d.shadow.pattern.alpha">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.pattern.transparent.1.html" accesskey="p" title="[p] 2d.shadow.pattern.transparent.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.pattern.alpha.html" accesskey="n" title="[n] 2d.shadow.pattern.alpha">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.pattern.html">pattern</a>.<a href="index.2d.shadow.pattern.transparent.html">transparent</a>.2</h1>
+<p class="desc">Shadows are not drawn for transparent parts of fill patterns</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var pattern = ctx.createPattern(document.getElementById('redtransparent.png'), 'repeat');
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(50, 0, 50, 50);
+ctx.shadowOffsetY = 50;
+ctx.shadowColor = '#0f0';
+ctx.fillStyle = pattern;
+ctx.fillRect(0, -50, 100, 50);
+
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+<img src="../images/redtransparent.png" id="redtransparent.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.basic.html
new file mode 100644
index 0000000..22b4759
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.basic.html
@@ -0,0 +1,46 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.stroke.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.clip.3.html" title="2d.shadow.clip.3">
+<link rel="next" href="2d.shadow.stroke.cap.1.html" title="2d.shadow.stroke.cap.1">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.clip.3.html" accesskey="p" title="[p] 2d.shadow.clip.3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.stroke.cap.1.html" accesskey="n" title="[n] 2d.shadow.stroke.cap.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.stroke.html">stroke</a>.basic</h1>
+<p class="desc">Shadows are drawn for strokes</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetY = 50;
+ctx.beginPath();
+ctx.lineWidth = 50;
+ctx.moveTo(0, -25);
+ctx.lineTo(100, -25);
+ctx.stroke();
+
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.cap.1.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.cap.1.html
new file mode 100644
index 0000000..16ada35
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.cap.1.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.stroke.cap.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.stroke.basic.html" title="2d.shadow.stroke.basic">
+<link rel="next" href="2d.shadow.stroke.cap.2.html" title="2d.shadow.stroke.cap.2">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.stroke.basic.html" accesskey="p" title="[p] 2d.shadow.stroke.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.stroke.cap.2.html" accesskey="n" title="[n] 2d.shadow.stroke.cap.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.stroke.html">stroke</a>.<a href="index.2d.shadow.stroke.cap.html">cap</a>.1</h1>
+<p class="desc">Shadows are not drawn for areas outside stroke caps</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.shadowColor = '#f00';
+ctx.shadowOffsetY = 50;
+ctx.beginPath();
+ctx.lineWidth = 50;
+ctx.lineCap = 'butt';
+ctx.moveTo(-50, -25);
+ctx.lineTo(0, -25);
+ctx.moveTo(100, -25);
+ctx.lineTo(150, -25);
+ctx.stroke();
+
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.cap.2.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.cap.2.html
new file mode 100644
index 0000000..414d3ba
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.cap.2.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.stroke.cap.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.stroke.cap.1.html" title="2d.shadow.stroke.cap.1">
+<link rel="next" href="2d.shadow.stroke.join.1.html" title="2d.shadow.stroke.join.1">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.stroke.cap.1.html" accesskey="p" title="[p] 2d.shadow.stroke.cap.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.stroke.join.1.html" accesskey="n" title="[n] 2d.shadow.stroke.join.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.stroke.html">stroke</a>.<a href="index.2d.shadow.stroke.cap.html">cap</a>.2</h1>
+<p class="desc">Shadows are drawn for stroke caps</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetY = 50;
+ctx.beginPath();
+ctx.lineWidth = 50;
+ctx.lineCap = 'square';
+ctx.moveTo(25, -25);
+ctx.lineTo(75, -25);
+ctx.stroke();
+
+_assertPixel(canvas, 1,25, 0,255,0,255, "1,25", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,25, 0,255,0,255, "98,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.join.1.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.join.1.html
new file mode 100644
index 0000000..9d045c8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.join.1.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.stroke.join.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.stroke.cap.2.html" title="2d.shadow.stroke.cap.2">
+<link rel="next" href="2d.shadow.stroke.join.2.html" title="2d.shadow.stroke.join.2">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.stroke.cap.2.html" accesskey="p" title="[p] 2d.shadow.stroke.cap.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.stroke.join.2.html" accesskey="n" title="[n] 2d.shadow.stroke.join.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.stroke.html">stroke</a>.<a href="index.2d.shadow.stroke.join.html">join</a>.1</h1>
+<p class="desc">Shadows are not drawn for areas outside stroke joins</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.shadowColor = '#f00';
+ctx.shadowOffsetX = 100;
+ctx.lineWidth = 200;
+ctx.lineJoin = 'bevel';
+ctx.beginPath();
+ctx.moveTo(-200, -50);
+ctx.lineTo(-150, -50);
+ctx.lineTo(-151, -100);
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.join.2.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.join.2.html
new file mode 100644
index 0000000..87f05d0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.join.2.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.stroke.join.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.stroke.join.1.html" title="2d.shadow.stroke.join.1">
+<link rel="next" href="2d.shadow.stroke.join.3.html" title="2d.shadow.stroke.join.3">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.stroke.join.1.html" accesskey="p" title="[p] 2d.shadow.stroke.join.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.stroke.join.3.html" accesskey="n" title="[n] 2d.shadow.stroke.join.3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.stroke.html">stroke</a>.<a href="index.2d.shadow.stroke.join.html">join</a>.2</h1>
+<p class="desc">Shadows are drawn for stroke joins</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(50, 0, 50, 50);
+ctx.strokeStyle = '#f00';
+ctx.shadowColor = '#0f0';
+ctx.shadowOffsetX = 100;
+ctx.lineWidth = 200;
+ctx.lineJoin = 'miter';
+ctx.beginPath();
+ctx.moveTo(-200, -50);
+ctx.lineTo(-150, -50);
+ctx.lineTo(-151, -100);
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.join.3.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.join.3.html
new file mode 100644
index 0000000..2ad5fb8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.stroke.join.3.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.stroke.join.3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.stroke.join.2.html" title="2d.shadow.stroke.join.2">
+<link rel="next" href="2d.shadow.image.basic.html" title="2d.shadow.image.basic">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.stroke.join.2.html" accesskey="p" title="[p] 2d.shadow.stroke.join.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.image.basic.html" accesskey="n" title="[n] 2d.shadow.image.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.stroke.html">stroke</a>.<a href="index.2d.shadow.stroke.join.html">join</a>.3</h1>
+<p class="desc">Shadows are drawn for stroke joins respecting miter limit</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.shadowColor = '#f00';
+ctx.shadowOffsetX = 100;
+ctx.lineWidth = 200;
+ctx.lineJoin = 'miter';
+ctx.miterLimit = 0.1;
+ctx.beginPath();
+ctx.moveTo(-200, -50);
+ctx.lineTo(-150, -50);
+ctx.lineTo(-151, -100); // (not an exact right angle, to avoid some other bug in Firefox 3)
+ctx.stroke();
+
+_assertPixel(canvas, 1,1, 0,255,0,255, "1,1", "0,255,0,255");
+_assertPixel(canvas, 48,48, 0,255,0,255, "48,48", "0,255,0,255");
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,48, 0,255,0,255, "98,48", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.transform.1.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.transform.1.html
new file mode 100644
index 0000000..80bd2f5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.transform.1.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.transform.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.gradient.alpha.html" title="2d.shadow.gradient.alpha">
+<link rel="next" href="2d.shadow.transform.2.html" title="2d.shadow.transform.2">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.gradient.alpha.html" accesskey="p" title="[p] 2d.shadow.gradient.alpha"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.transform.2.html" accesskey="n" title="[n] 2d.shadow.transform.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.transform.html">transform</a>.1</h1>
+<p class="desc">Shadows take account of transformations</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowOffsetY = 50;
+ctx.shadowColor = '#0f0';
+ctx.translate(100, 100);
+ctx.fillRect(-100, -150, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.shadow.transform.2.html b/LayoutTests/fast/canvas/philip/tests/2d.shadow.transform.2.html
new file mode 100644
index 0000000..c4cd508
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.shadow.transform.2.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.shadow.transform.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.shadow.transform.1.html" title="2d.shadow.transform.1">
+<link rel="next" href="2d.shadow.blur.low.html" title="2d.shadow.blur.low">
+<body class="show_output">
+<p>
+ <a href="2d.shadow.transform.1.html" accesskey="p" title="[p] 2d.shadow.transform.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.shadow.blur.low.html" accesskey="n" title="[n] 2d.shadow.blur.low">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.shadow.html">shadow</a>.<a href="index.2d.shadow.transform.html">transform</a>.2</h1>
+<p class="desc">Shadow offsets are not affected by transformations</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.shadow.render">2d.shadow.render</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.shadowOffsetY = 50;
+ctx.shadowColor = '#0f0';
+ctx.rotate(Math.PI)
+ctx.fillRect(-100, 0, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.bitmap.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.bitmap.html
new file mode 100644
index 0000000..54efc7f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.bitmap.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.bitmap</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.path.html" title="2d.state.saverestore.path">
+<link rel="next" href="2d.state.saverestore.stack.html" title="2d.state.saverestore.stack">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.path.html" accesskey="p" title="[p] 2d.state.saverestore.path"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.stack.html" accesskey="n" title="[n] 2d.state.saverestore.stack">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.bitmap</h1>
+<p class="desc">save()/restore() does not affect the current bitmap</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.bitmap">2d.state.bitmap</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.save();
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.restore();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.clip.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.clip.html
new file mode 100644
index 0000000..80d6937
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.clip.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.clip</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.transformation.html" title="2d.state.saverestore.transformation">
+<link rel="next" href="2d.state.saverestore.path.html" title="2d.state.saverestore.path">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.transformation.html" accesskey="p" title="[p] 2d.state.saverestore.transformation"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.path.html" accesskey="n" title="[n] 2d.state.saverestore.path">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.clip</h1>
+<p class="desc">save()/restore() affects the clipping path</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.clip">2d.state.clip</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.save();
+ctx.rect(0, 0, 1, 1);
+ctx.clip();
+ctx.restore();
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.fillStyle.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.fillStyle.html
new file mode 100644
index 0000000..01103f2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.fillStyle.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.fillStyle</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.strokeStyle.html" title="2d.state.saverestore.strokeStyle">
+<link rel="next" href="2d.state.saverestore.globalAlpha.html" title="2d.state.saverestore.globalAlpha">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.strokeStyle.html" accesskey="p" title="[p] 2d.state.saverestore.strokeStyle"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.globalAlpha.html" accesskey="n" title="[n] 2d.state.saverestore.globalAlpha">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.fillStyle</h1>
+<p class="desc">save()/restore() works for fillStyle</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.fillStyle">2d.state.fillStyle</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Test that restore() undoes any modifications
+var old = ctx.fillStyle;
+ctx.save();
+ctx.fillStyle = "#ff0000";
+ctx.restore();
+_assertSame(ctx.fillStyle, old, "ctx.fillStyle", "old");
+
+// Also test that save() doesn't modify the values
+ctx.fillStyle = "#ff0000";
+old = ctx.fillStyle;
+ // we're not interested in failures caused by get(set(x)) != x (e.g.
+ // from rounding), so compare against 'old' instead of against "#ff0000"
+ctx.save();
+_assertSame(ctx.fillStyle, old, "ctx.fillStyle", "old");
+ctx.restore();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.font.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.font.html
new file mode 100644
index 0000000..56b789e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.font.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.font</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.globalCompositeOperation.html" title="2d.state.saverestore.globalCompositeOperation">
+<link rel="next" href="2d.state.saverestore.textAlign.html" title="2d.state.saverestore.textAlign">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.globalCompositeOperation.html" accesskey="p" title="[p] 2d.state.saverestore.globalCompositeOperation"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.textAlign.html" accesskey="n" title="[n] 2d.state.saverestore.textAlign">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.font</h1>
+<p class="desc">save()/restore() works for font</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.font">2d.state.font</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Test that restore() undoes any modifications
+var old = ctx.font;
+ctx.save();
+ctx.font = "25px serif";
+ctx.restore();
+_assertSame(ctx.font, old, "ctx.font", "old");
+
+// Also test that save() doesn't modify the values
+ctx.font = "25px serif";
+old = ctx.font;
+ // we're not interested in failures caused by get(set(x)) != x (e.g.
+ // from rounding), so compare against 'old' instead of against "25px serif"
+ctx.save();
+_assertSame(ctx.font, old, "ctx.font", "old");
+ctx.restore();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.globalAlpha.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.globalAlpha.html
new file mode 100644
index 0000000..c4fcd90
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.globalAlpha.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.globalAlpha</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.fillStyle.html" title="2d.state.saverestore.fillStyle">
+<link rel="next" href="2d.state.saverestore.lineWidth.html" title="2d.state.saverestore.lineWidth">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.fillStyle.html" accesskey="p" title="[p] 2d.state.saverestore.fillStyle"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.lineWidth.html" accesskey="n" title="[n] 2d.state.saverestore.lineWidth">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.globalAlpha</h1>
+<p class="desc">save()/restore() works for globalAlpha</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.globalAlpha">2d.state.globalAlpha</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Test that restore() undoes any modifications
+var old = ctx.globalAlpha;
+ctx.save();
+ctx.globalAlpha = 0.5;
+ctx.restore();
+_assertSame(ctx.globalAlpha, old, "ctx.globalAlpha", "old");
+
+// Also test that save() doesn't modify the values
+ctx.globalAlpha = 0.5;
+old = ctx.globalAlpha;
+ // we're not interested in failures caused by get(set(x)) != x (e.g.
+ // from rounding), so compare against 'old' instead of against 0.5
+ctx.save();
+_assertSame(ctx.globalAlpha, old, "ctx.globalAlpha", "old");
+ctx.restore();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.globalCompositeOperation.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.globalCompositeOperation.html
new file mode 100644
index 0000000..df5c7db
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.globalCompositeOperation.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.globalCompositeOperation</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.shadowColor.html" title="2d.state.saverestore.shadowColor">
+<link rel="next" href="2d.state.saverestore.font.html" title="2d.state.saverestore.font">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.shadowColor.html" accesskey="p" title="[p] 2d.state.saverestore.shadowColor"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.font.html" accesskey="n" title="[n] 2d.state.saverestore.font">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.globalCompositeOperation</h1>
+<p class="desc">save()/restore() works for globalCompositeOperation</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.globalCompositeOperation">2d.state.globalCompositeOperation</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Test that restore() undoes any modifications
+var old = ctx.globalCompositeOperation;
+ctx.save();
+ctx.globalCompositeOperation = "copy";
+ctx.restore();
+_assertSame(ctx.globalCompositeOperation, old, "ctx.globalCompositeOperation", "old");
+
+// Also test that save() doesn't modify the values
+ctx.globalCompositeOperation = "copy";
+old = ctx.globalCompositeOperation;
+ // we're not interested in failures caused by get(set(x)) != x (e.g.
+ // from rounding), so compare against 'old' instead of against "copy"
+ctx.save();
+_assertSame(ctx.globalCompositeOperation, old, "ctx.globalCompositeOperation", "old");
+ctx.restore();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.lineCap.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.lineCap.html
new file mode 100644
index 0000000..2b8e73e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.lineCap.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.lineCap</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.lineWidth.html" title="2d.state.saverestore.lineWidth">
+<link rel="next" href="2d.state.saverestore.lineJoin.html" title="2d.state.saverestore.lineJoin">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.lineWidth.html" accesskey="p" title="[p] 2d.state.saverestore.lineWidth"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.lineJoin.html" accesskey="n" title="[n] 2d.state.saverestore.lineJoin">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.lineCap</h1>
+<p class="desc">save()/restore() works for lineCap</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.lineCap">2d.state.lineCap</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Test that restore() undoes any modifications
+var old = ctx.lineCap;
+ctx.save();
+ctx.lineCap = "round";
+ctx.restore();
+_assertSame(ctx.lineCap, old, "ctx.lineCap", "old");
+
+// Also test that save() doesn't modify the values
+ctx.lineCap = "round";
+old = ctx.lineCap;
+ // we're not interested in failures caused by get(set(x)) != x (e.g.
+ // from rounding), so compare against 'old' instead of against "round"
+ctx.save();
+_assertSame(ctx.lineCap, old, "ctx.lineCap", "old");
+ctx.restore();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.lineJoin.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.lineJoin.html
new file mode 100644
index 0000000..9438c04
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.lineJoin.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.lineJoin</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.lineCap.html" title="2d.state.saverestore.lineCap">
+<link rel="next" href="2d.state.saverestore.miterLimit.html" title="2d.state.saverestore.miterLimit">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.lineCap.html" accesskey="p" title="[p] 2d.state.saverestore.lineCap"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.miterLimit.html" accesskey="n" title="[n] 2d.state.saverestore.miterLimit">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.lineJoin</h1>
+<p class="desc">save()/restore() works for lineJoin</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.lineJoin">2d.state.lineJoin</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Test that restore() undoes any modifications
+var old = ctx.lineJoin;
+ctx.save();
+ctx.lineJoin = "round";
+ctx.restore();
+_assertSame(ctx.lineJoin, old, "ctx.lineJoin", "old");
+
+// Also test that save() doesn't modify the values
+ctx.lineJoin = "round";
+old = ctx.lineJoin;
+ // we're not interested in failures caused by get(set(x)) != x (e.g.
+ // from rounding), so compare against 'old' instead of against "round"
+ctx.save();
+_assertSame(ctx.lineJoin, old, "ctx.lineJoin", "old");
+ctx.restore();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.lineWidth.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.lineWidth.html
new file mode 100644
index 0000000..76ba174
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.lineWidth.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.lineWidth</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.globalAlpha.html" title="2d.state.saverestore.globalAlpha">
+<link rel="next" href="2d.state.saverestore.lineCap.html" title="2d.state.saverestore.lineCap">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.globalAlpha.html" accesskey="p" title="[p] 2d.state.saverestore.globalAlpha"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.lineCap.html" accesskey="n" title="[n] 2d.state.saverestore.lineCap">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.lineWidth</h1>
+<p class="desc">save()/restore() works for lineWidth</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.lineWidth">2d.state.lineWidth</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Test that restore() undoes any modifications
+var old = ctx.lineWidth;
+ctx.save();
+ctx.lineWidth = 0.5;
+ctx.restore();
+_assertSame(ctx.lineWidth, old, "ctx.lineWidth", "old");
+
+// Also test that save() doesn't modify the values
+ctx.lineWidth = 0.5;
+old = ctx.lineWidth;
+ // we're not interested in failures caused by get(set(x)) != x (e.g.
+ // from rounding), so compare against 'old' instead of against 0.5
+ctx.save();
+_assertSame(ctx.lineWidth, old, "ctx.lineWidth", "old");
+ctx.restore();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.miterLimit.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.miterLimit.html
new file mode 100644
index 0000000..7cfb2fa
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.miterLimit.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.miterLimit</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.lineJoin.html" title="2d.state.saverestore.lineJoin">
+<link rel="next" href="2d.state.saverestore.shadowOffsetX.html" title="2d.state.saverestore.shadowOffsetX">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.lineJoin.html" accesskey="p" title="[p] 2d.state.saverestore.lineJoin"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.shadowOffsetX.html" accesskey="n" title="[n] 2d.state.saverestore.shadowOffsetX">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.miterLimit</h1>
+<p class="desc">save()/restore() works for miterLimit</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.miterLimit">2d.state.miterLimit</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Test that restore() undoes any modifications
+var old = ctx.miterLimit;
+ctx.save();
+ctx.miterLimit = 0.5;
+ctx.restore();
+_assertSame(ctx.miterLimit, old, "ctx.miterLimit", "old");
+
+// Also test that save() doesn't modify the values
+ctx.miterLimit = 0.5;
+old = ctx.miterLimit;
+ // we're not interested in failures caused by get(set(x)) != x (e.g.
+ // from rounding), so compare against 'old' instead of against 0.5
+ctx.save();
+_assertSame(ctx.miterLimit, old, "ctx.miterLimit", "old");
+ctx.restore();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.path.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.path.html
new file mode 100644
index 0000000..e390f0c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.path.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.path</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.clip.html" title="2d.state.saverestore.clip">
+<link rel="next" href="2d.state.saverestore.bitmap.html" title="2d.state.saverestore.bitmap">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.clip.html" accesskey="p" title="[p] 2d.state.saverestore.clip"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.bitmap.html" accesskey="n" title="[n] 2d.state.saverestore.bitmap">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.path</h1>
+<p class="desc">save()/restore() does not affect the current path</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.path">2d.state.path</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.save();
+ctx.rect(0, 0, 100, 50);
+ctx.restore();
+ctx.fillStyle = '#0f0';
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.shadowBlur.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.shadowBlur.html
new file mode 100644
index 0000000..2b69749
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.shadowBlur.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.shadowBlur</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.shadowOffsetY.html" title="2d.state.saverestore.shadowOffsetY">
+<link rel="next" href="2d.state.saverestore.shadowColor.html" title="2d.state.saverestore.shadowColor">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.shadowOffsetY.html" accesskey="p" title="[p] 2d.state.saverestore.shadowOffsetY"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.shadowColor.html" accesskey="n" title="[n] 2d.state.saverestore.shadowColor">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.shadowBlur</h1>
+<p class="desc">save()/restore() works for shadowBlur</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.shadowBlur">2d.state.shadowBlur</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Test that restore() undoes any modifications
+var old = ctx.shadowBlur;
+ctx.save();
+ctx.shadowBlur = 5;
+ctx.restore();
+_assertSame(ctx.shadowBlur, old, "ctx.shadowBlur", "old");
+
+// Also test that save() doesn't modify the values
+ctx.shadowBlur = 5;
+old = ctx.shadowBlur;
+ // we're not interested in failures caused by get(set(x)) != x (e.g.
+ // from rounding), so compare against 'old' instead of against 5
+ctx.save();
+_assertSame(ctx.shadowBlur, old, "ctx.shadowBlur", "old");
+ctx.restore();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.shadowColor.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.shadowColor.html
new file mode 100644
index 0000000..d1d36a8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.shadowColor.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.shadowColor</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.shadowBlur.html" title="2d.state.saverestore.shadowBlur">
+<link rel="next" href="2d.state.saverestore.globalCompositeOperation.html" title="2d.state.saverestore.globalCompositeOperation">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.shadowBlur.html" accesskey="p" title="[p] 2d.state.saverestore.shadowBlur"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.globalCompositeOperation.html" accesskey="n" title="[n] 2d.state.saverestore.globalCompositeOperation">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.shadowColor</h1>
+<p class="desc">save()/restore() works for shadowColor</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.shadowColor">2d.state.shadowColor</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Test that restore() undoes any modifications
+var old = ctx.shadowColor;
+ctx.save();
+ctx.shadowColor = "#ff0000";
+ctx.restore();
+_assertSame(ctx.shadowColor, old, "ctx.shadowColor", "old");
+
+// Also test that save() doesn't modify the values
+ctx.shadowColor = "#ff0000";
+old = ctx.shadowColor;
+ // we're not interested in failures caused by get(set(x)) != x (e.g.
+ // from rounding), so compare against 'old' instead of against "#ff0000"
+ctx.save();
+_assertSame(ctx.shadowColor, old, "ctx.shadowColor", "old");
+ctx.restore();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.shadowOffsetX.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.shadowOffsetX.html
new file mode 100644
index 0000000..d18d1af
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.shadowOffsetX.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.shadowOffsetX</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.miterLimit.html" title="2d.state.saverestore.miterLimit">
+<link rel="next" href="2d.state.saverestore.shadowOffsetY.html" title="2d.state.saverestore.shadowOffsetY">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.miterLimit.html" accesskey="p" title="[p] 2d.state.saverestore.miterLimit"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.shadowOffsetY.html" accesskey="n" title="[n] 2d.state.saverestore.shadowOffsetY">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.shadowOffsetX</h1>
+<p class="desc">save()/restore() works for shadowOffsetX</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.shadowOffsetX">2d.state.shadowOffsetX</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Test that restore() undoes any modifications
+var old = ctx.shadowOffsetX;
+ctx.save();
+ctx.shadowOffsetX = 5;
+ctx.restore();
+_assertSame(ctx.shadowOffsetX, old, "ctx.shadowOffsetX", "old");
+
+// Also test that save() doesn't modify the values
+ctx.shadowOffsetX = 5;
+old = ctx.shadowOffsetX;
+ // we're not interested in failures caused by get(set(x)) != x (e.g.
+ // from rounding), so compare against 'old' instead of against 5
+ctx.save();
+_assertSame(ctx.shadowOffsetX, old, "ctx.shadowOffsetX", "old");
+ctx.restore();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.shadowOffsetY.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.shadowOffsetY.html
new file mode 100644
index 0000000..fd3c6cb
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.shadowOffsetY.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.shadowOffsetY</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.shadowOffsetX.html" title="2d.state.saverestore.shadowOffsetX">
+<link rel="next" href="2d.state.saverestore.shadowBlur.html" title="2d.state.saverestore.shadowBlur">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.shadowOffsetX.html" accesskey="p" title="[p] 2d.state.saverestore.shadowOffsetX"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.shadowBlur.html" accesskey="n" title="[n] 2d.state.saverestore.shadowBlur">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.shadowOffsetY</h1>
+<p class="desc">save()/restore() works for shadowOffsetY</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.shadowOffsetY">2d.state.shadowOffsetY</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Test that restore() undoes any modifications
+var old = ctx.shadowOffsetY;
+ctx.save();
+ctx.shadowOffsetY = 5;
+ctx.restore();
+_assertSame(ctx.shadowOffsetY, old, "ctx.shadowOffsetY", "old");
+
+// Also test that save() doesn't modify the values
+ctx.shadowOffsetY = 5;
+old = ctx.shadowOffsetY;
+ // we're not interested in failures caused by get(set(x)) != x (e.g.
+ // from rounding), so compare against 'old' instead of against 5
+ctx.save();
+_assertSame(ctx.shadowOffsetY, old, "ctx.shadowOffsetY", "old");
+ctx.restore();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.stack.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.stack.html
new file mode 100644
index 0000000..054e443
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.stack.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.stack</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.bitmap.html" title="2d.state.saverestore.bitmap">
+<link rel="next" href="2d.state.saverestore.stackdepth.html" title="2d.state.saverestore.stackdepth">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.bitmap.html" accesskey="p" title="[p] 2d.state.saverestore.bitmap"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.stackdepth.html" accesskey="n" title="[n] 2d.state.saverestore.stackdepth">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.stack</h1>
+<p class="desc">save()/restore() can be nested as a stack</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.save">2d.state.save</a>
+<li><a href="spec.html#testrefs.2d.state.restore">2d.state.restore</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.lineWidth = 1;
+ctx.save();
+ctx.lineWidth = 2;
+ctx.save();
+ctx.lineWidth = 3;
+_assertEqual(ctx.lineWidth, 3, "ctx.lineWidth", "3");
+ctx.restore();
+_assertEqual(ctx.lineWidth, 2, "ctx.lineWidth", "2");
+ctx.restore();
+_assertEqual(ctx.lineWidth, 1, "ctx.lineWidth", "1");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.stackdepth.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.stackdepth.html
new file mode 100644
index 0000000..3e41ca4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.stackdepth.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.stackdepth</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.stack.html" title="2d.state.saverestore.stack">
+<link rel="next" href="2d.state.saverestore.underflow.html" title="2d.state.saverestore.underflow">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.stack.html" accesskey="p" title="[p] 2d.state.saverestore.stack"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.underflow.html" accesskey="n" title="[n] 2d.state.saverestore.underflow">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.stackdepth</h1>
+<p class="desc">save()/restore() stack depth is not unreasonably limited</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.save">2d.state.save</a>
+<li><a href="spec.html#testrefs.2d.state.restore">2d.state.restore</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var limit = 512;
+for (var i = 1; i < limit; ++i)
+{
+ ctx.save();
+ ctx.lineWidth = i;
+}
+for (var i = limit-1; i > 0; --i)
+{
+ _assertEqual(ctx.lineWidth, i, "ctx.lineWidth", "i");
+ ctx.restore();
+}
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.strokeStyle.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.strokeStyle.html
new file mode 100644
index 0000000..ccdb6cb
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.strokeStyle.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.strokeStyle</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.canvas.readonly.html" title="2d.canvas.readonly">
+<link rel="next" href="2d.state.saverestore.fillStyle.html" title="2d.state.saverestore.fillStyle">
+<body class="show_output">
+<p>
+ <a href="2d.canvas.readonly.html" accesskey="p" title="[p] 2d.canvas.readonly"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.fillStyle.html" accesskey="n" title="[n] 2d.state.saverestore.fillStyle">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.strokeStyle</h1>
+<p class="desc">save()/restore() works for strokeStyle</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.strokeStyle">2d.state.strokeStyle</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Test that restore() undoes any modifications
+var old = ctx.strokeStyle;
+ctx.save();
+ctx.strokeStyle = "#ff0000";
+ctx.restore();
+_assertSame(ctx.strokeStyle, old, "ctx.strokeStyle", "old");
+
+// Also test that save() doesn't modify the values
+ctx.strokeStyle = "#ff0000";
+old = ctx.strokeStyle;
+ // we're not interested in failures caused by get(set(x)) != x (e.g.
+ // from rounding), so compare against 'old' instead of against "#ff0000"
+ctx.save();
+_assertSame(ctx.strokeStyle, old, "ctx.strokeStyle", "old");
+ctx.restore();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.textAlign.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.textAlign.html
new file mode 100644
index 0000000..ad7d0a7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.textAlign.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.textAlign</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.font.html" title="2d.state.saverestore.font">
+<link rel="next" href="2d.state.saverestore.textBaseline.html" title="2d.state.saverestore.textBaseline">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.font.html" accesskey="p" title="[p] 2d.state.saverestore.font"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.textBaseline.html" accesskey="n" title="[n] 2d.state.saverestore.textBaseline">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.textAlign</h1>
+<p class="desc">save()/restore() works for textAlign</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.textAlign">2d.state.textAlign</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Test that restore() undoes any modifications
+var old = ctx.textAlign;
+ctx.save();
+ctx.textAlign = "center";
+ctx.restore();
+_assertSame(ctx.textAlign, old, "ctx.textAlign", "old");
+
+// Also test that save() doesn't modify the values
+ctx.textAlign = "center";
+old = ctx.textAlign;
+ // we're not interested in failures caused by get(set(x)) != x (e.g.
+ // from rounding), so compare against 'old' instead of against "center"
+ctx.save();
+_assertSame(ctx.textAlign, old, "ctx.textAlign", "old");
+ctx.restore();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.textBaseline.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.textBaseline.html
new file mode 100644
index 0000000..420c6b2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.textBaseline.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.textBaseline</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.textAlign.html" title="2d.state.saverestore.textAlign">
+<link rel="next" href="initial.reset.2dstate.html" title="initial.reset.2dstate">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.textAlign.html" accesskey="p" title="[p] 2d.state.saverestore.textAlign"><</a>
+ <a href="index.html">[index]</a>
+ <a href="initial.reset.2dstate.html" accesskey="n" title="[n] initial.reset.2dstate">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.textBaseline</h1>
+<p class="desc">save()/restore() works for textBaseline</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.textBaseline">2d.state.textBaseline</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Test that restore() undoes any modifications
+var old = ctx.textBaseline;
+ctx.save();
+ctx.textBaseline = "bottom";
+ctx.restore();
+_assertSame(ctx.textBaseline, old, "ctx.textBaseline", "old");
+
+// Also test that save() doesn't modify the values
+ctx.textBaseline = "bottom";
+old = ctx.textBaseline;
+ // we're not interested in failures caused by get(set(x)) != x (e.g.
+ // from rounding), so compare against 'old' instead of against "bottom"
+ctx.save();
+_assertSame(ctx.textBaseline, old, "ctx.textBaseline", "old");
+ctx.restore();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.transformation.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.transformation.html
new file mode 100644
index 0000000..9b29a4f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.transformation.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.transformation</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="initial.reset.2dstate.html" title="initial.reset.2dstate">
+<link rel="next" href="2d.state.saverestore.clip.html" title="2d.state.saverestore.clip">
+<body class="show_output">
+<p>
+ <a href="initial.reset.2dstate.html" accesskey="p" title="[p] initial.reset.2dstate"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.clip.html" accesskey="n" title="[n] 2d.state.saverestore.clip">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.transformation</h1>
+<p class="desc">save()/restore() affects the current transformation matrix</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.transformation">2d.state.transformation</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.save();
+ctx.translate(200, 0);
+ctx.restore();
+ctx.fillStyle = '#f00';
+ctx.fillRect(-200, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.underflow.html b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.underflow.html
new file mode 100644
index 0000000..de2ba72
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.state.saverestore.underflow.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.state.saverestore.underflow</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.stackdepth.html" title="2d.state.saverestore.stackdepth">
+<link rel="next" href="2d.transformation.order.html" title="2d.transformation.order">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.stackdepth.html" accesskey="p" title="[p] 2d.state.saverestore.stackdepth"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.order.html" accesskey="n" title="[n] 2d.transformation.order">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.state.html">state</a>.<a href="index.2d.state.saverestore.html">saverestore</a>.underflow</h1>
+<p class="desc">restore() with an empty stack has no effect</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.state.restore.underflow">2d.state.restore.underflow</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=296821">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+for (var i = 0; i < 16; ++i)
+ ctx.restore();
+ctx.lineWidth = 0.5;
+ctx.restore();
+_assertEqual(ctx.lineWidth, 0.5, "ctx.lineWidth", "0.5");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.basic.html
new file mode 100644
index 0000000..4ac62b0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.basic.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.strokeRect.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillRect.nonfinite.html" title="2d.fillRect.nonfinite">
+<link rel="next" href="2d.strokeRect.path.html" title="2d.strokeRect.path">
+<body class="show_output">
+<p>
+ <a href="2d.fillRect.nonfinite.html" accesskey="p" title="[p] 2d.fillRect.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.strokeRect.path.html" accesskey="n" title="[n] 2d.strokeRect.path">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.strokeRect.html">strokeRect</a>.basic</h1>
+<p class="desc">strokeRect works</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.strokeRect">2d.strokeRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 50;
+ctx.strokeRect(25, 24, 50, 2);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.clip.html b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.clip.html
new file mode 100644
index 0000000..c5c905c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.clip.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.strokeRect.clip</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.strokeRect.globalcomposite.html" title="2d.strokeRect.globalcomposite">
+<link rel="next" href="2d.strokeRect.shadow.html" title="2d.strokeRect.shadow">
+<body class="show_output">
+<p>
+ <a href="2d.strokeRect.globalcomposite.html" accesskey="p" title="[p] 2d.strokeRect.globalcomposite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.strokeRect.shadow.html" accesskey="n" title="[n] 2d.strokeRect.shadow">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.strokeRect.html">strokeRect</a>.clip</h1>
+<p class="desc">strokeRect is affected by clipping regions</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.strokeRect">2d.strokeRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.beginPath();
+ctx.rect(0, 0, 16, 16);
+ctx.clip();
+
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 50;
+ctx.strokeRect(0, 0, 100, 50);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 16, 16);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.globalalpha.html b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.globalalpha.html
new file mode 100644
index 0000000..3597a47
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.globalalpha.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.strokeRect.globalalpha</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.strokeRect.transform.html" title="2d.strokeRect.transform">
+<link rel="next" href="2d.strokeRect.globalcomposite.html" title="2d.strokeRect.globalcomposite">
+<body class="show_output">
+<p>
+ <a href="2d.strokeRect.transform.html" accesskey="p" title="[p] 2d.strokeRect.transform"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.strokeRect.globalcomposite.html" accesskey="n" title="[n] 2d.strokeRect.globalcomposite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.strokeRect.html">strokeRect</a>.globalalpha</h1>
+<p class="desc">strokeRect is affected by globalAlpha</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.strokeRect">2d.strokeRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="clear-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.globalAlpha = 0;
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 50;
+ctx.strokeRect(25, 24, 50, 2);
+_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.globalcomposite.html b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.globalcomposite.html
new file mode 100644
index 0000000..54c2eb1
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.globalcomposite.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.strokeRect.globalcomposite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.strokeRect.globalalpha.html" title="2d.strokeRect.globalalpha">
+<link rel="next" href="2d.strokeRect.clip.html" title="2d.strokeRect.clip">
+<body class="show_output">
+<p>
+ <a href="2d.strokeRect.globalalpha.html" accesskey="p" title="[p] 2d.strokeRect.globalalpha"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.strokeRect.clip.html" accesskey="n" title="[n] 2d.strokeRect.clip">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.strokeRect.html">strokeRect</a>.globalcomposite</h1>
+<p class="desc">strokeRect is not affected by globalCompositeOperation</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.strokeRect">2d.strokeRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="clear-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.globalCompositeOperation = 'source-in';
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 50;
+ctx.strokeRect(25, 24, 50, 2);
+_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.negative.html b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.negative.html
new file mode 100644
index 0000000..572b406
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.negative.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.strokeRect.negative</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.strokeRect.zero.5.html" title="2d.strokeRect.zero.5">
+<link rel="next" href="2d.strokeRect.transform.html" title="2d.strokeRect.transform">
+<body class="show_output">
+<p>
+ <a href="2d.strokeRect.zero.5.html" accesskey="p" title="[p] 2d.strokeRect.zero.5"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.strokeRect.transform.html" accesskey="n" title="[n] 2d.strokeRect.transform">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.strokeRect.html">strokeRect</a>.negative</h1>
+<p class="desc">strokeRect of negative sizes works</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.strokeRect">2d.strokeRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 25;
+ctx.strokeRect(12, 12, 26, 1);
+ctx.strokeRect(88, 12, -26, 1);
+ctx.strokeRect(12, 38, 26, -1);
+ctx.strokeRect(88, 38, -26, -1);
+_assertPixel(canvas, 25,12, 0,255,0,255, "25,12", "0,255,0,255");
+_assertPixel(canvas, 75,12, 0,255,0,255, "75,12", "0,255,0,255");
+_assertPixel(canvas, 25,37, 0,255,0,255, "25,37", "0,255,0,255");
+_assertPixel(canvas, 75,37, 0,255,0,255, "75,37", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.nonfinite.html
new file mode 100644
index 0000000..2465082
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.nonfinite.html
@@ -0,0 +1,62 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.strokeRect.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.strokeRect.shadow.html" title="2d.strokeRect.shadow">
+<link rel="next" href="2d.path.initial.html" title="2d.path.initial">
+<body class="show_output">
+<p>
+ <a href="2d.strokeRect.shadow.html" accesskey="p" title="[p] 2d.strokeRect.shadow"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.path.initial.html" accesskey="n" title="[n] 2d.path.initial">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.strokeRect.html">strokeRect</a>.nonfinite</h1>
+<p class="desc">strokeRect() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 150;
+ctx.strokeRect(Infinity, 0, 100, 50);
+ctx.strokeRect(-Infinity, 0, 100, 50);
+ctx.strokeRect(NaN, 0, 100, 50);
+ctx.strokeRect(0, Infinity, 100, 50);
+ctx.strokeRect(0, -Infinity, 100, 50);
+ctx.strokeRect(0, NaN, 100, 50);
+ctx.strokeRect(0, 0, Infinity, 50);
+ctx.strokeRect(0, 0, -Infinity, 50);
+ctx.strokeRect(0, 0, NaN, 50);
+ctx.strokeRect(0, 0, 100, Infinity);
+ctx.strokeRect(0, 0, 100, -Infinity);
+ctx.strokeRect(0, 0, 100, NaN);
+ctx.strokeRect(Infinity, Infinity, 100, 50);
+ctx.strokeRect(Infinity, Infinity, Infinity, 50);
+ctx.strokeRect(Infinity, Infinity, Infinity, Infinity);
+ctx.strokeRect(Infinity, Infinity, 100, Infinity);
+ctx.strokeRect(Infinity, 0, Infinity, 50);
+ctx.strokeRect(Infinity, 0, Infinity, Infinity);
+ctx.strokeRect(Infinity, 0, 100, Infinity);
+ctx.strokeRect(0, Infinity, Infinity, 50);
+ctx.strokeRect(0, Infinity, Infinity, Infinity);
+ctx.strokeRect(0, Infinity, 100, Infinity);
+ctx.strokeRect(0, 0, Infinity, Infinity);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.path.html b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.path.html
new file mode 100644
index 0000000..0efa73c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.path.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.strokeRect.path</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.strokeRect.basic.html" title="2d.strokeRect.basic">
+<link rel="next" href="2d.strokeRect.zero.1.html" title="2d.strokeRect.zero.1">
+<body class="show_output">
+<p>
+ <a href="2d.strokeRect.basic.html" accesskey="p" title="[p] 2d.strokeRect.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.strokeRect.zero.1.html" accesskey="n" title="[n] 2d.strokeRect.zero.1">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.strokeRect.html">strokeRect</a>.path</h1>
+<p class="desc">strokeRect does not affect the current path</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.strokeRect">2d.strokeRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.beginPath();
+ctx.rect(0, 0, 100, 50);
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 5;
+ctx.strokeRect(0, 0, 16, 16);
+ctx.fillStyle = '#0f0';
+ctx.fill();
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.shadow.html b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.shadow.html
new file mode 100644
index 0000000..421d0d5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.shadow.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.strokeRect.shadow</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.strokeRect.clip.html" title="2d.strokeRect.clip">
+<link rel="next" href="2d.strokeRect.nonfinite.html" title="2d.strokeRect.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.strokeRect.clip.html" accesskey="p" title="[p] 2d.strokeRect.clip"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.strokeRect.nonfinite.html" accesskey="n" title="[n] 2d.strokeRect.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.strokeRect.html">strokeRect</a>.shadow</h1>
+<p class="desc">strokeRect draws shadows</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.strokeRect">2d.strokeRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.shadowColor = '#0f0';
+ctx.shadowBlur = 0;
+ctx.shadowOffsetX = 0;
+ctx.shadowOffsetY = 50;
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 50;
+ctx.strokeRect(0, -75, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.transform.html b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.transform.html
new file mode 100644
index 0000000..1d7051e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.transform.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.strokeRect.transform</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.strokeRect.negative.html" title="2d.strokeRect.negative">
+<link rel="next" href="2d.strokeRect.globalalpha.html" title="2d.strokeRect.globalalpha">
+<body class="show_output">
+<p>
+ <a href="2d.strokeRect.negative.html" accesskey="p" title="[p] 2d.strokeRect.negative"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.strokeRect.globalalpha.html" accesskey="n" title="[n] 2d.strokeRect.globalalpha">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.strokeRect.html">strokeRect</a>.transform</h1>
+<p class="desc">fillRect is affected by transforms</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.strokeRect">2d.strokeRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.scale(10, 10);
+ctx.translate(0, 5);
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 5;
+ctx.strokeRect(2.5, -2.6, 5, 0.2);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.zero.1.html b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.zero.1.html
new file mode 100644
index 0000000..3efa18c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.zero.1.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.strokeRect.zero.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.strokeRect.path.html" title="2d.strokeRect.path">
+<link rel="next" href="2d.strokeRect.zero.2.html" title="2d.strokeRect.zero.2">
+<body class="show_output">
+<p>
+ <a href="2d.strokeRect.path.html" accesskey="p" title="[p] 2d.strokeRect.path"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.strokeRect.zero.2.html" accesskey="n" title="[n] 2d.strokeRect.zero.2">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.strokeRect.html">strokeRect</a>.<a href="index.2d.strokeRect.zero.html">zero</a>.1</h1>
+<p class="desc">strokeRect of 0x0 pixels draws nothing</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.strokeRect">2d.strokeRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="clear-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 250;
+ctx.strokeRect(50, 25, 0, 0);
+_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.zero.2.html b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.zero.2.html
new file mode 100644
index 0000000..d369c5e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.zero.2.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.strokeRect.zero.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.strokeRect.zero.1.html" title="2d.strokeRect.zero.1">
+<link rel="next" href="2d.strokeRect.zero.3.html" title="2d.strokeRect.zero.3">
+<body class="show_output">
+<p>
+ <a href="2d.strokeRect.zero.1.html" accesskey="p" title="[p] 2d.strokeRect.zero.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.strokeRect.zero.3.html" accesskey="n" title="[n] 2d.strokeRect.zero.3">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.strokeRect.html">strokeRect</a>.<a href="index.2d.strokeRect.zero.html">zero</a>.2</h1>
+<p class="desc">strokeRect of 0x0 pixels draws nothing, including caps and joins</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.strokeRect">2d.strokeRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="clear-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 250;
+ctx.lineCap = 'round';
+ctx.lineJoin = 'round';
+ctx.strokeRect(50, 25, 0, 0);
+_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.zero.3.html b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.zero.3.html
new file mode 100644
index 0000000..5f02f27
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.zero.3.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.strokeRect.zero.3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.strokeRect.zero.2.html" title="2d.strokeRect.zero.2">
+<link rel="next" href="2d.strokeRect.zero.4.html" title="2d.strokeRect.zero.4">
+<body class="show_output">
+<p>
+ <a href="2d.strokeRect.zero.2.html" accesskey="p" title="[p] 2d.strokeRect.zero.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.strokeRect.zero.4.html" accesskey="n" title="[n] 2d.strokeRect.zero.4">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.strokeRect.html">strokeRect</a>.<a href="index.2d.strokeRect.zero.html">zero</a>.3</h1>
+<p class="desc">strokeRect of Nx0 pixels draws a straight line</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.strokeRect">2d.strokeRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 50;
+ctx.strokeRect(0, 25, 100, 0);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.zero.4.html b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.zero.4.html
new file mode 100644
index 0000000..6170fa4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.zero.4.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.strokeRect.zero.4</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.strokeRect.zero.3.html" title="2d.strokeRect.zero.3">
+<link rel="next" href="2d.strokeRect.zero.5.html" title="2d.strokeRect.zero.5">
+<body class="show_output">
+<p>
+ <a href="2d.strokeRect.zero.3.html" accesskey="p" title="[p] 2d.strokeRect.zero.3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.strokeRect.zero.5.html" accesskey="n" title="[n] 2d.strokeRect.zero.5">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.strokeRect.html">strokeRect</a>.<a href="index.2d.strokeRect.zero.html">zero</a>.4</h1>
+<p class="desc">strokeRect of Nx0 pixels draws a closed line with no caps</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.strokeRect">2d.strokeRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="clear-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.strokeStyle = '#f00';
+ctx.lineWidth = 250;
+ctx.lineCap = 'round';
+ctx.strokeRect(100, 25, 100, 0);
+_assertPixel(canvas, 50,25, 0,0,0,0, "50,25", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.zero.5.html b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.zero.5.html
new file mode 100644
index 0000000..889668e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.strokeRect.zero.5.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.strokeRect.zero.5</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.strokeRect.zero.4.html" title="2d.strokeRect.zero.4">
+<link rel="next" href="2d.strokeRect.negative.html" title="2d.strokeRect.negative">
+<body class="show_output">
+<p>
+ <a href="2d.strokeRect.zero.4.html" accesskey="p" title="[p] 2d.strokeRect.zero.4"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.strokeRect.negative.html" accesskey="n" title="[n] 2d.strokeRect.negative">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.strokeRect.html">strokeRect</a>.<a href="index.2d.strokeRect.zero.html">zero</a>.5</h1>
+<p class="desc">strokeRect of Nx0 pixels draws a closed line with joins</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.strokeRect">2d.strokeRect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 250;
+ctx.lineJoin = 'round';
+ctx.strokeRect(100, 25, 100, 0);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.strokeStyle.default.html b/LayoutTests/fast/canvas/philip/tests/2d.strokeStyle.default.html
new file mode 100644
index 0000000..b358d49
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.strokeStyle.default.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.strokeStyle.default</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.fillStyle.default.html" title="2d.fillStyle.default">
+<link rel="next" href="2d.gradient.object.return.html" title="2d.gradient.object.return">
+<body class="show_output">
+<p>
+ <a href="2d.fillStyle.default.html" accesskey="p" title="[p] 2d.fillStyle.default"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.gradient.object.return.html" accesskey="n" title="[n] 2d.gradient.object.return">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.strokeStyle.html">strokeStyle</a>.default</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.colours.default">2d.colours.default</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertEqual(ctx.strokeStyle, '#000000', "ctx.strokeStyle", "'#000000'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.align.default.html b/LayoutTests/fast/canvas/philip/tests/2d.text.align.default.html
new file mode 100644
index 0000000..5d83b29
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.align.default.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.align.default</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.align.invalid.html" title="2d.text.align.invalid">
+<link rel="next" href="2d.text.baseline.valid.html" title="2d.text.baseline.valid">
+<body class="show_output">
+<p>
+ <a href="2d.text.align.invalid.html" accesskey="p" title="[p] 2d.text.align.invalid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.baseline.valid.html" accesskey="n" title="[n] 2d.text.baseline.valid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.align.html">align</a>.default</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.align.default">2d.text.align.default</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.align.invalid.html b/LayoutTests/fast/canvas/philip/tests/2d.text.align.invalid.html
new file mode 100644
index 0000000..d6c1949
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.align.invalid.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.align.invalid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.align.valid.html" title="2d.text.align.valid">
+<link rel="next" href="2d.text.align.default.html" title="2d.text.align.default">
+<body class="show_output">
+<p>
+ <a href="2d.text.align.valid.html" accesskey="p" title="[p] 2d.text.align.valid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.align.default.html" accesskey="n" title="[n] 2d.text.align.default">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.align.html">align</a>.invalid</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.align.invalid">2d.text.align.invalid</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.textAlign = 'start';
+ctx.textAlign = 'bogus';
+_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'");
+
+ctx.textAlign = 'start';
+ctx.textAlign = 'END';
+_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'");
+
+ctx.textAlign = 'start';
+ctx.textAlign = 'end ';
+_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'");
+
+ctx.textAlign = 'start';
+ctx.textAlign = 'end\0';
+_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.align.valid.html b/LayoutTests/fast/canvas/philip/tests/2d.text.align.valid.html
new file mode 100644
index 0000000..68260a7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.align.valid.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.align.valid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.font.default.html" title="2d.text.font.default">
+<link rel="next" href="2d.text.align.invalid.html" title="2d.text.align.invalid">
+<body class="show_output">
+<p>
+ <a href="2d.text.font.default.html" accesskey="p" title="[p] 2d.text.font.default"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.align.invalid.html" accesskey="n" title="[n] 2d.text.align.invalid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.align.html">align</a>.valid</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.align.get">2d.text.align.get</a>
+<li><a href="spec.html#testrefs.2d.text.align.set">2d.text.align.set</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.textAlign = 'start';
+_assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'");
+
+ctx.textAlign = 'end';
+_assertSame(ctx.textAlign, 'end', "ctx.textAlign", "'end'");
+
+ctx.textAlign = 'left';
+_assertSame(ctx.textAlign, 'left', "ctx.textAlign", "'left'");
+
+ctx.textAlign = 'right';
+_assertSame(ctx.textAlign, 'right', "ctx.textAlign", "'right'");
+
+ctx.textAlign = 'center';
+_assertSame(ctx.textAlign, 'center', "ctx.textAlign", "'center'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.baseline.default.html b/LayoutTests/fast/canvas/philip/tests/2d.text.baseline.default.html
new file mode 100644
index 0000000..5c389d6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.baseline.default.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.baseline.default</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.baseline.invalid.html" title="2d.text.baseline.invalid">
+<link rel="next" href="2d.text.draw.fill.basic.html" title="2d.text.draw.fill.basic">
+<body class="show_output">
+<p>
+ <a href="2d.text.baseline.invalid.html" accesskey="p" title="[p] 2d.text.baseline.invalid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.fill.basic.html" accesskey="n" title="[n] 2d.text.draw.fill.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.baseline.html">baseline</a>.default</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.baseline.default">2d.text.baseline.default</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(ctx.textBaseline, 'alphabetic', "ctx.textBaseline", "'alphabetic'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.baseline.invalid.html b/LayoutTests/fast/canvas/philip/tests/2d.text.baseline.invalid.html
new file mode 100644
index 0000000..3b2e252
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.baseline.invalid.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.baseline.invalid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.baseline.valid.html" title="2d.text.baseline.valid">
+<link rel="next" href="2d.text.baseline.default.html" title="2d.text.baseline.default">
+<body class="show_output">
+<p>
+ <a href="2d.text.baseline.valid.html" accesskey="p" title="[p] 2d.text.baseline.valid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.baseline.default.html" accesskey="n" title="[n] 2d.text.baseline.default">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.baseline.html">baseline</a>.invalid</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.baseline.invalid">2d.text.baseline.invalid</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.textBaseline = 'top';
+ctx.textBaseline = 'bogus';
+_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'");
+
+ctx.textBaseline = 'top';
+ctx.textBaseline = 'MIDDLE';
+_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'");
+
+ctx.textBaseline = 'top';
+ctx.textBaseline = 'middle ';
+_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'");
+
+ctx.textBaseline = 'top';
+ctx.textBaseline = 'middle\0';
+_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.baseline.valid.html b/LayoutTests/fast/canvas/philip/tests/2d.text.baseline.valid.html
new file mode 100644
index 0000000..c0f8a11
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.baseline.valid.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.baseline.valid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.align.default.html" title="2d.text.align.default">
+<link rel="next" href="2d.text.baseline.invalid.html" title="2d.text.baseline.invalid">
+<body class="show_output">
+<p>
+ <a href="2d.text.align.default.html" accesskey="p" title="[p] 2d.text.align.default"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.baseline.invalid.html" accesskey="n" title="[n] 2d.text.baseline.invalid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.baseline.html">baseline</a>.valid</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.baseline.get">2d.text.baseline.get</a>
+<li><a href="spec.html#testrefs.2d.text.baseline.set">2d.text.baseline.set</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.textBaseline = 'top';
+_assertSame(ctx.textBaseline, 'top', "ctx.textBaseline", "'top'");
+
+ctx.textBaseline = 'hanging';
+_assertSame(ctx.textBaseline, 'hanging', "ctx.textBaseline", "'hanging'");
+
+ctx.textBaseline = 'middle';
+_assertSame(ctx.textBaseline, 'middle', "ctx.textBaseline", "'middle'");
+
+ctx.textBaseline = 'alphabetic';
+_assertSame(ctx.textBaseline, 'alphabetic', "ctx.textBaseline", "'alphabetic'");
+
+ctx.textBaseline = 'ideographic';
+_assertSame(ctx.textBaseline, 'ideographic', "ctx.textBaseline", "'ideographic'");
+
+ctx.textBaseline = 'bottom';
+_assertSame(ctx.textBaseline, 'bottom', "ctx.textBaseline", "'bottom'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.center.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.center.html
new file mode 100644
index 0000000..82467bb
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.center.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.align.center</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.align.end.rtl.html" title="2d.text.draw.align.end.rtl">
+<link rel="next" href="2d.text.draw.space.basic.html" title="2d.text.draw.space.basic">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.align.end.rtl.html" accesskey="p" title="[p] 2d.text.draw.align.end.rtl"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.space.basic.html" accesskey="n" title="[n] 2d.text.draw.space.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.align.html">align</a>.center</h1>
+<p class="desc">textAlign center is the center of the em squares (not the bounding box)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.align.center">2d.text.align.center</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.textAlign = 'center';
+ ctx.fillText('DD', 50, 37.5);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.end.ltr.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.end.ltr.html
new file mode 100644
index 0000000..d03e40f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.end.ltr.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.align.end.ltr</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.align.start.rtl.html" title="2d.text.draw.align.start.rtl">
+<link rel="next" href="2d.text.draw.align.end.rtl.html" title="2d.text.draw.align.end.rtl">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.align.start.rtl.html" accesskey="p" title="[p] 2d.text.draw.align.start.rtl"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.align.end.rtl.html" accesskey="n" title="[n] 2d.text.draw.align.end.rtl">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.align.html">align</a>.<a href="index.2d.text.draw.align.end.html">end</a>.ltr</h1>
+<p class="desc">textAlign end with ltr is the right edge</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.align.right">2d.text.align.right</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50" dir="ltr"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.textAlign = 'end';
+ ctx.fillText('DD', 100, 37.5);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.end.rtl.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.end.rtl.html
new file mode 100644
index 0000000..747237b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.end.rtl.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.align.end.rtl</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.align.end.ltr.html" title="2d.text.draw.align.end.ltr">
+<link rel="next" href="2d.text.draw.align.center.html" title="2d.text.draw.align.center">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.align.end.ltr.html" accesskey="p" title="[p] 2d.text.draw.align.end.ltr"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.align.center.html" accesskey="n" title="[n] 2d.text.draw.align.center">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.align.html">align</a>.<a href="index.2d.text.draw.align.end.html">end</a>.rtl</h1>
+<p class="desc">textAlign end with rtl is the left edge</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.align.left">2d.text.align.left</a>
+<li><a href="spec.html#testrefs.2d.text.draw.direction">2d.text.draw.direction</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50" dir="rtl"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.textAlign = 'end';
+ ctx.fillText('DD', 0, 37.5);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.left.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.left.html
new file mode 100644
index 0000000..635dc59
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.left.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.align.left</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.baseline.hanging.html" title="2d.text.draw.baseline.hanging">
+<link rel="next" href="2d.text.draw.align.right.html" title="2d.text.draw.align.right">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.baseline.hanging.html" accesskey="p" title="[p] 2d.text.draw.baseline.hanging"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.align.right.html" accesskey="n" title="[n] 2d.text.draw.align.right">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.align.html">align</a>.left</h1>
+<p class="desc">textAlign left is the left of the first em square (not the bounding box)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.align.left">2d.text.align.left</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.textAlign = 'left';
+ ctx.fillText('DD', 0, 37.5);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.right.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.right.html
new file mode 100644
index 0000000..6d7a5b3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.right.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.align.right</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.align.left.html" title="2d.text.draw.align.left">
+<link rel="next" href="2d.text.draw.align.start.ltr.html" title="2d.text.draw.align.start.ltr">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.align.left.html" accesskey="p" title="[p] 2d.text.draw.align.left"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.align.start.ltr.html" accesskey="n" title="[n] 2d.text.draw.align.start.ltr">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.align.html">align</a>.right</h1>
+<p class="desc">textAlign right is the right of the last em square (not the bounding box)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.align.right">2d.text.align.right</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.textAlign = 'right';
+ ctx.fillText('DD', 100, 37.5);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.start.ltr.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.start.ltr.html
new file mode 100644
index 0000000..cf38db7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.start.ltr.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.align.start.ltr</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.align.right.html" title="2d.text.draw.align.right">
+<link rel="next" href="2d.text.draw.align.start.rtl.html" title="2d.text.draw.align.start.rtl">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.align.right.html" accesskey="p" title="[p] 2d.text.draw.align.right"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.align.start.rtl.html" accesskey="n" title="[n] 2d.text.draw.align.start.rtl">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.align.html">align</a>.<a href="index.2d.text.draw.align.start.html">start</a>.ltr</h1>
+<p class="desc">textAlign start with ltr is the left edge</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.align.left">2d.text.align.left</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50" dir="ltr"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.textAlign = 'start';
+ ctx.fillText('DD', 0, 37.5);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.start.rtl.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.start.rtl.html
new file mode 100644
index 0000000..fd0b57a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.align.start.rtl.html
@@ -0,0 +1,54 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.align.start.rtl</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.align.start.ltr.html" title="2d.text.draw.align.start.ltr">
+<link rel="next" href="2d.text.draw.align.end.ltr.html" title="2d.text.draw.align.end.ltr">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.align.start.ltr.html" accesskey="p" title="[p] 2d.text.draw.align.start.ltr"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.align.end.ltr.html" accesskey="n" title="[n] 2d.text.draw.align.end.ltr">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.align.html">align</a>.<a href="index.2d.text.draw.align.start.html">start</a>.rtl</h1>
+<p class="desc">textAlign start with rtl is the right edge</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.align.right">2d.text.align.right</a>
+<li><a href="spec.html#testrefs.2d.text.draw.direction">2d.text.draw.direction</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50" dir="rtl"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.textAlign = 'start';
+ ctx.fillText('DD', 100, 37.5);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.alphabetic.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.alphabetic.html
new file mode 100644
index 0000000..701ad9b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.alphabetic.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.baseline.alphabetic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.baseline.middle.html" title="2d.text.draw.baseline.middle">
+<link rel="next" href="2d.text.draw.baseline.ideographic.html" title="2d.text.draw.baseline.ideographic">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.baseline.middle.html" accesskey="p" title="[p] 2d.text.draw.baseline.middle"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.baseline.ideographic.html" accesskey="n" title="[n] 2d.text.draw.baseline.ideographic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.baseline.html">baseline</a>.alphabetic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.baseline.alphabetic">2d.text.baseline.alphabetic</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.textBaseline = 'alphabetic';
+ ctx.fillText('CC', 0, 37.5);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.bottom.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.bottom.html
new file mode 100644
index 0000000..9b62275
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.bottom.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.baseline.bottom</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.baseline.top.html" title="2d.text.draw.baseline.top">
+<link rel="next" href="2d.text.draw.baseline.middle.html" title="2d.text.draw.baseline.middle">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.baseline.top.html" accesskey="p" title="[p] 2d.text.draw.baseline.top"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.baseline.middle.html" accesskey="n" title="[n] 2d.text.draw.baseline.middle">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.baseline.html">baseline</a>.bottom</h1>
+<p class="desc">textBaseline bottom is the bottom of the em square (not the bounding box)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.baseline.bottom">2d.text.baseline.bottom</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.textBaseline = 'bottom';
+ ctx.fillText('CC', 0, 50);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.hanging.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.hanging.html
new file mode 100644
index 0000000..5fd8481
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.hanging.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.baseline.hanging</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.baseline.ideographic.html" title="2d.text.draw.baseline.ideographic">
+<link rel="next" href="2d.text.draw.align.left.html" title="2d.text.draw.align.left">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.baseline.ideographic.html" accesskey="p" title="[p] 2d.text.draw.baseline.ideographic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.align.left.html" accesskey="n" title="[n] 2d.text.draw.align.left">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.baseline.html">baseline</a>.hanging</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.baseline.hanging">2d.text.baseline.hanging</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.textBaseline = 'hanging';
+ ctx.fillText('CC', 0, 12.5);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.ideographic.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.ideographic.html
new file mode 100644
index 0000000..d7f9bf6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.ideographic.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.baseline.ideographic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.baseline.alphabetic.html" title="2d.text.draw.baseline.alphabetic">
+<link rel="next" href="2d.text.draw.baseline.hanging.html" title="2d.text.draw.baseline.hanging">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.baseline.alphabetic.html" accesskey="p" title="[p] 2d.text.draw.baseline.alphabetic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.baseline.hanging.html" accesskey="n" title="[n] 2d.text.draw.baseline.hanging">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.baseline.html">baseline</a>.ideographic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.baseline.ideographic">2d.text.baseline.ideographic</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.textBaseline = 'ideographic';
+ ctx.fillText('CC', 0, 31.25);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.middle.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.middle.html
new file mode 100644
index 0000000..79e3fcc
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.middle.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.baseline.middle</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.baseline.bottom.html" title="2d.text.draw.baseline.bottom">
+<link rel="next" href="2d.text.draw.baseline.alphabetic.html" title="2d.text.draw.baseline.alphabetic">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.baseline.bottom.html" accesskey="p" title="[p] 2d.text.draw.baseline.bottom"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.baseline.alphabetic.html" accesskey="n" title="[n] 2d.text.draw.baseline.alphabetic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.baseline.html">baseline</a>.middle</h1>
+<p class="desc">textBaseline middle is the middle of the em square (not the bounding box)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.baseline.middle">2d.text.baseline.middle</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.textBaseline = 'middle';
+ ctx.fillText('CC', 0, 25);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.top.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.top.html
new file mode 100644
index 0000000..709b2c8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.baseline.top.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.baseline.top</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.fontface.notinpage.html" title="2d.text.draw.fontface.notinpage">
+<link rel="next" href="2d.text.draw.baseline.bottom.html" title="2d.text.draw.baseline.bottom">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.fontface.notinpage.html" accesskey="p" title="[p] 2d.text.draw.fontface.notinpage"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.baseline.bottom.html" accesskey="n" title="[n] 2d.text.draw.baseline.bottom">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.baseline.html">baseline</a>.top</h1>
+<p class="desc">textBaseline top is the top of the em square (not the bounding box)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.baseline.top">2d.text.baseline.top</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.textBaseline = 'top';
+ ctx.fillText('CC', 0, 0);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,45, 0,255,0,255, "95,45", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.basic.html
new file mode 100644
index 0000000..b151243
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.basic.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.fill.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.baseline.default.html" title="2d.text.baseline.default">
+<link rel="next" href="2d.text.draw.fill.unaffected.html" title="2d.text.draw.fill.unaffected">
+<body class="show_output">
+<p>
+ <a href="2d.text.baseline.default.html" accesskey="p" title="[p] 2d.text.baseline.default"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.fill.unaffected.html" accesskey="n" title="[n] 2d.text.draw.fill.unaffected">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.fill.html">fill</a>.basic</h1>
+<p class="desc">fillText draws filled text</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw">2d.text.draw</a>
+<li><a href="spec.html#testrefs.2d.text.draw.fill">2d.text.draw.fill</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.text.draw.fill.basic.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#000';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.strokeStyle = '#f00';
+ctx.font = '35px Arial, sans-serif';
+ctx.fillText('PASS', 5, 35);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.basic.png b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.basic.png
new file mode 100644
index 0000000..2c2b557
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.basic.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.bound.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.bound.html
new file mode 100644
index 0000000..209419b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.bound.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.fill.maxWidth.bound</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.fill.maxWidth.fontface.html" title="2d.text.draw.fill.maxWidth.fontface">
+<link rel="next" href="2d.text.draw.fontface.html" title="2d.text.draw.fontface">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.fill.maxWidth.fontface.html" accesskey="p" title="[p] 2d.text.draw.fill.maxWidth.fontface"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.fontface.html" accesskey="n" title="[n] 2d.text.draw.fontface">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.fill.html">fill</a>.<a href="index.2d.text.draw.fill.maxWidth.html">maxWidth</a>.bound</h1>
+<p class="desc">fillText handles maxWidth based on line size, not bounding box size</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw.maxwidth">2d.text.draw.maxwidth</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.fillText('DD', 0, 37.5, 100);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.fontface.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.fontface.html
new file mode 100644
index 0000000..1e95642
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.fontface.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.fill.maxWidth.fontface</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.kern.consistent.html" title="2d.text.draw.kern.consistent">
+<link rel="next" href="2d.text.draw.fill.maxWidth.bound.html" title="2d.text.draw.fill.maxWidth.bound">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.kern.consistent.html" accesskey="p" title="[p] 2d.text.draw.kern.consistent"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.fill.maxWidth.bound.html" accesskey="n" title="[n] 2d.text.draw.fill.maxWidth.bound">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.fill.html">fill</a>.<a href="index.2d.text.draw.fill.maxWidth.html">maxWidth</a>.fontface</h1>
+<p class="desc">fillText works on @font-face fonts</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw.maxwidth">2d.text.draw.maxwidth</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#0f0';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#f00';
+ ctx.fillText('EEEE', -50, 37.5, 40);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.large.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.large.html
new file mode 100644
index 0000000..c64d9d1
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.large.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.fill.maxWidth.large</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.fill.rtl.html" title="2d.text.draw.fill.rtl">
+<link rel="next" href="2d.text.draw.fill.maxWidth.small.html" title="2d.text.draw.fill.maxWidth.small">
+<body class="show_output">
+<p>
+ <a href="2d.text.draw.fill.rtl.html" accesskey="p" title="[p] 2d.text.draw.fill.rtl"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.fill.maxWidth.small.html" accesskey="n" title="[n] 2d.text.draw.fill.maxWidth.small">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.fill.html">fill</a>.<a href="index.2d.text.draw.fill.maxWidth.html">maxWidth</a>.large</h1>
+<p class="desc">fillText handles maxWidth correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw.maxwidth">2d.text.draw.maxwidth</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.text.draw.fill.maxWidth.large.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#000';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.font = '35px Arial, sans-serif';
+ctx.fillText('PASS', 5, 35, 200);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.large.png b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.large.png
new file mode 100644
index 0000000..2c2b557
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.large.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.small.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.small.html
new file mode 100644
index 0000000..84d9cf8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.small.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.fill.maxWidth.small</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.fill.maxWidth.large.html" title="2d.text.draw.fill.maxWidth.large">
+<link rel="next" href="2d.text.draw.fill.maxWidth.zero.html" title="2d.text.draw.fill.maxWidth.zero">
+<body class="show_output">
+<p>
+ <a href="2d.text.draw.fill.maxWidth.large.html" accesskey="p" title="[p] 2d.text.draw.fill.maxWidth.large"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.fill.maxWidth.zero.html" accesskey="n" title="[n] 2d.text.draw.fill.maxWidth.zero">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.fill.html">fill</a>.<a href="index.2d.text.draw.fill.maxWidth.html">maxWidth</a>.small</h1>
+<p class="desc">fillText handles maxWidth correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw.maxwidth">2d.text.draw.maxwidth</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.font = '35px Arial, sans-serif';
+ctx.fillText('fail fail fail fail fail', -100, 35, 90);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.zero.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.zero.html
new file mode 100644
index 0000000..2b7d092
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.maxWidth.zero.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.fill.maxWidth.zero</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.fill.maxWidth.small.html" title="2d.text.draw.fill.maxWidth.small">
+<link rel="next" href="2d.text.draw.stroke.basic.html" title="2d.text.draw.stroke.basic">
+<body class="show_output">
+<p>
+ <a href="2d.text.draw.fill.maxWidth.small.html" accesskey="p" title="[p] 2d.text.draw.fill.maxWidth.small"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.stroke.basic.html" accesskey="n" title="[n] 2d.text.draw.stroke.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.fill.html">fill</a>.<a href="index.2d.text.draw.fill.maxWidth.html">maxWidth</a>.zero</h1>
+<p class="desc">fillText handles maxWidth correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw.maxwidth">2d.text.draw.maxwidth</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.font = '35px Arial, sans-serif';
+ctx.fillText('fail fail fail fail fail', 5, 35, 0);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.rtl.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.rtl.html
new file mode 100644
index 0000000..a59093ef
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.rtl.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.fill.rtl</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.fill.unaffected.html" title="2d.text.draw.fill.unaffected">
+<link rel="next" href="2d.text.draw.fill.maxWidth.large.html" title="2d.text.draw.fill.maxWidth.large">
+<body class="show_output">
+<p>
+ <a href="2d.text.draw.fill.unaffected.html" accesskey="p" title="[p] 2d.text.draw.fill.unaffected"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.fill.maxWidth.large.html" accesskey="n" title="[n] 2d.text.draw.fill.maxWidth.large">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.fill.html">fill</a>.rtl</h1>
+<p class="desc">fillText respects Right-To-Left Override characters</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw">2d.text.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.text.draw.fill.rtl.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#000';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0f0';
+ctx.strokeStyle = '#f00';
+ctx.font = '35px Arial, sans-serif';
+ctx.fillText('\u202eFAIL \xa0 \xa0 SSAP', 5, 35);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.rtl.png b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.rtl.png
new file mode 100644
index 0000000..2c2b557
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.rtl.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.unaffected.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.unaffected.html
new file mode 100644
index 0000000..21a2b52
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fill.unaffected.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.fill.unaffected</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.fill.basic.html" title="2d.text.draw.fill.basic">
+<link rel="next" href="2d.text.draw.fill.rtl.html" title="2d.text.draw.fill.rtl">
+<body class="show_output">
+<p>
+ <a href="2d.text.draw.fill.basic.html" accesskey="p" title="[p] 2d.text.draw.fill.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.fill.rtl.html" accesskey="n" title="[n] 2d.text.draw.fill.rtl">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.fill.html">fill</a>.unaffected</h1>
+<p class="desc">fillText does not start a new path or subpath</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw.fill">2d.text.draw.fill</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.moveTo(0, 0);
+ctx.lineTo(100, 0);
+
+ctx.font = '35px Arial, sans-serif';
+ctx.fillText('FAIL', 5, 35);
+
+ctx.lineTo(100, 50);
+ctx.lineTo(0, 50);
+ctx.fillStyle = '#0f0';
+ctx.fill();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fontface.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fontface.html
new file mode 100644
index 0000000..6aea420
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fontface.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.fontface</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.fill.maxWidth.bound.html" title="2d.text.draw.fill.maxWidth.bound">
+<link rel="next" href="2d.text.draw.fontface.repeat.html" title="2d.text.draw.fontface.repeat">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.fill.maxWidth.bound.html" accesskey="p" title="[p] 2d.text.draw.fill.maxWidth.bound"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.fontface.repeat.html" accesskey="n" title="[n] 2d.text.draw.fontface.repeat">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.fontface</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.font.fontface">2d.text.font.fontface</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '67px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.fillText('AA', 0, 50);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fontface.notinpage.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fontface.notinpage.html
new file mode 100644
index 0000000..a4d2881
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fontface.notinpage.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.fontface.notinpage</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.fontface.repeat.html" title="2d.text.draw.fontface.repeat">
+<link rel="next" href="2d.text.draw.baseline.top.html" title="2d.text.draw.baseline.top">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.fontface.repeat.html" accesskey="p" title="[p] 2d.text.draw.fontface.repeat"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.baseline.top.html" accesskey="n" title="[n] 2d.text.draw.baseline.top">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.fontface.html">fontface</a>.notinpage</h1>
+<p class="desc">@font-face fonts should work even if they are not used in the page</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.font.fontface">2d.text.font.fontface</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '67px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.fillText('AA', 0, 50);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fontface.repeat.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fontface.repeat.html
new file mode 100644
index 0000000..8d4cc4f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.fontface.repeat.html
@@ -0,0 +1,50 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.fontface.repeat</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.fontface.html" title="2d.text.draw.fontface">
+<link rel="next" href="2d.text.draw.fontface.notinpage.html" title="2d.text.draw.fontface.notinpage">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.fontface.html" accesskey="p" title="[p] 2d.text.draw.fontface"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.fontface.notinpage.html" accesskey="n" title="[n] 2d.text.draw.fontface.notinpage">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.fontface.html">fontface</a>.repeat</h1>
+<p class="desc">Draw with the font immediately, then wait a bit until and draw again. (This crashes some version of WebKit.)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.font.fontface">2d.text.font.fontface</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.font = '67px CanvasTest';
+ctx.fillStyle = '#0f0';
+ctx.fillText('AA', 0, 50);
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillText('AA', 0, 50);
+ _assertPixelApprox(canvas, 5,5, 0,255,0,255, "5,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 95,5, 0,255,0,255, "95,5", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.kern.consistent.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.kern.consistent.html
new file mode 100644
index 0000000..d49284f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.kern.consistent.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.kern.consistent</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.stroke.unaffected.html" title="2d.text.draw.stroke.unaffected">
+<link rel="next" href="2d.text.draw.fill.maxWidth.fontface.html" title="2d.text.draw.fill.maxWidth.fontface">
+<body class="show_output">
+<p>
+ <a href="2d.text.draw.stroke.unaffected.html" accesskey="p" title="[p] 2d.text.draw.stroke.unaffected"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.fill.maxWidth.fontface.html" accesskey="n" title="[n] 2d.text.draw.fill.maxWidth.fontface">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.kern.html">kern</a>.consistent</h1>
+<p class="desc">Stroked and filled text should have exactly the same kerning so it overlaps</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw">2d.text.draw</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.strokeStyle = '#0f0';
+ctx.lineWidth = 3;
+ctx.font = '20px Arial, sans-serif';
+ctx.fillText('VAVAVAVAVAVAVA', -50, 25);
+ctx.fillText('ToToToToToToTo', -50, 45);
+ctx.strokeText('VAVAVAVAVAVAVA', -50, 25);
+ctx.strokeText('ToToToToToToTo', -50, 45);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.basic.html
new file mode 100644
index 0000000..66b35f1
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.basic.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.space.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.align.center.html" title="2d.text.draw.align.center">
+<link rel="next" href="2d.text.draw.space.collapse.space.html" title="2d.text.draw.space.collapse.space">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.align.center.html" accesskey="p" title="[p] 2d.text.draw.align.center"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.space.collapse.space.html" accesskey="n" title="[n] 2d.text.draw.space.collapse.space">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.space.html">space</a>.basic</h1>
+<p class="desc">U+0020 is rendered the correct size (1em wide)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw.spaces">2d.text.draw.spaces</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.fillText('E EE', -100, 37.5);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.collapse.end.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.collapse.end.html
new file mode 100644
index 0000000..6350eb3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.collapse.end.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.space.collapse.end</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.space.collapse.start.html" title="2d.text.draw.space.collapse.start">
+<link rel="next" href="2d.text.measure.width.basic.html" title="2d.text.measure.width.basic">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.space.collapse.start.html" accesskey="p" title="[p] 2d.text.draw.space.collapse.start"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.measure.width.basic.html" accesskey="n" title="[n] 2d.text.measure.width.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.space.html">space</a>.<a href="index.2d.text.draw.space.collapse.html">collapse</a>.end</h1>
+<p class="desc">Space characters at the end of a line are collapsed (per CSS)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw.spaces">2d.text.draw.spaces</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.textAlign = 'right';
+ ctx.fillText('EE ', 100, 37.5);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html
new file mode 100644
index 0000000..72b5de4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.collapse.nonspace.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.space.collapse.nonspace</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.space.collapse.other.html" title="2d.text.draw.space.collapse.other">
+<link rel="next" href="2d.text.draw.space.collapse.start.html" title="2d.text.draw.space.collapse.start">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.space.collapse.other.html" accesskey="p" title="[p] 2d.text.draw.space.collapse.other"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.space.collapse.start.html" accesskey="n" title="[n] 2d.text.draw.space.collapse.start">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.space.html">space</a>.<a href="index.2d.text.draw.space.collapse.html">collapse</a>.nonspace</h1>
+<p class="desc">Non-space characters are not converted to U+0020 and collapsed</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw.spaces">2d.text.draw.spaces</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.fillText('E\x0b EE', -150, 37.5);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.collapse.other.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.collapse.other.html
new file mode 100644
index 0000000..9f1a365
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.collapse.other.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.space.collapse.other</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.space.collapse.space.html" title="2d.text.draw.space.collapse.space">
+<link rel="next" href="2d.text.draw.space.collapse.nonspace.html" title="2d.text.draw.space.collapse.nonspace">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.space.collapse.space.html" accesskey="p" title="[p] 2d.text.draw.space.collapse.space"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.space.collapse.nonspace.html" accesskey="n" title="[n] 2d.text.draw.space.collapse.nonspace">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.space.html">space</a>.<a href="index.2d.text.draw.space.collapse.html">collapse</a>.other</h1>
+<p class="desc">Space characters are converted to U+0020, and collapsed (per CSS)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw.spaces">2d.text.draw.spaces</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.fillText('E \x09\x0a\x0c\x0d \x09\x0a\x0c\x0dEE', -100, 37.5);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.collapse.space.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.collapse.space.html
new file mode 100644
index 0000000..284ccb9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.collapse.space.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.space.collapse.space</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.space.basic.html" title="2d.text.draw.space.basic">
+<link rel="next" href="2d.text.draw.space.collapse.other.html" title="2d.text.draw.space.collapse.other">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.space.basic.html" accesskey="p" title="[p] 2d.text.draw.space.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.space.collapse.other.html" accesskey="n" title="[n] 2d.text.draw.space.collapse.other">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.space.html">space</a>.<a href="index.2d.text.draw.space.collapse.html">collapse</a>.space</h1>
+<p class="desc">Space characters are converted to U+0020, and collapsed (per CSS)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw.spaces">2d.text.draw.spaces</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.fillText('E EE', -100, 37.5);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.collapse.start.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.collapse.start.html
new file mode 100644
index 0000000..30fd8e1
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.space.collapse.start.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.space.collapse.start</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.space.collapse.nonspace.html" title="2d.text.draw.space.collapse.nonspace">
+<link rel="next" href="2d.text.draw.space.collapse.end.html" title="2d.text.draw.space.collapse.end">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.space.collapse.nonspace.html" accesskey="p" title="[p] 2d.text.draw.space.collapse.nonspace"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.space.collapse.end.html" accesskey="n" title="[n] 2d.text.draw.space.collapse.end">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.space.html">space</a>.<a href="index.2d.text.draw.space.collapse.html">collapse</a>.start</h1>
+<p class="desc">Space characters at the start of a line are collapsed (per CSS)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw.spaces">2d.text.draw.spaces</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50px CanvasTest';
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ ctx.fillStyle = '#0f0';
+ ctx.fillText(' EE', 0, 37.5);
+ _assertPixelApprox(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255", 2);
+ _assertPixelApprox(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255", 2);
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.stroke.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.stroke.basic.html
new file mode 100644
index 0000000..b6c99b8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.stroke.basic.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.stroke.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.fill.maxWidth.zero.html" title="2d.text.draw.fill.maxWidth.zero">
+<link rel="next" href="2d.text.draw.stroke.unaffected.html" title="2d.text.draw.stroke.unaffected">
+<body class="show_output">
+<p>
+ <a href="2d.text.draw.fill.maxWidth.zero.html" accesskey="p" title="[p] 2d.text.draw.fill.maxWidth.zero"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.stroke.unaffected.html" accesskey="n" title="[n] 2d.text.draw.stroke.unaffected">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.stroke.html">stroke</a>.basic</h1>
+<p class="desc">strokeText draws stroked text</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw">2d.text.draw</a>
+<li><a href="spec.html#testrefs.2d.text.draw.stroke">2d.text.draw.stroke</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="2d.text.draw.stroke.basic.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#000';
+ctx.fillRect(0, 0, 100, 50);
+ctx.strokeStyle = '#0f0';
+ctx.fillStyle = '#f00';
+ctx.lineWidth = 1;
+ctx.font = '35px Arial, sans-serif';
+ctx.strokeText('PASS', 5, 35);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.stroke.basic.png b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.stroke.basic.png
new file mode 100644
index 0000000..a0c90fc
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.stroke.basic.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.draw.stroke.unaffected.html b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.stroke.unaffected.html
new file mode 100644
index 0000000..dc67e54
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.draw.stroke.unaffected.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.draw.stroke.unaffected</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.stroke.basic.html" title="2d.text.draw.stroke.basic">
+<link rel="next" href="2d.text.draw.kern.consistent.html" title="2d.text.draw.kern.consistent">
+<body class="show_output">
+<p>
+ <a href="2d.text.draw.stroke.basic.html" accesskey="p" title="[p] 2d.text.draw.stroke.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.draw.kern.consistent.html" accesskey="n" title="[n] 2d.text.draw.kern.consistent">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.draw.html">draw</a>.<a href="index.2d.text.draw.stroke.html">stroke</a>.unaffected</h1>
+<p class="desc">strokeText does not start a new path or subpath</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.draw.stroke">2d.text.draw.stroke</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.moveTo(0, 0);
+ctx.lineTo(100, 0);
+
+ctx.font = '35px Arial, sans-serif';
+ctx.strokeStyle = '#f00';
+ctx.strokeText('FAIL', 5, 35);
+
+ctx.lineTo(100, 50);
+ctx.lineTo(0, 50);
+ctx.fillStyle = '#0f0';
+ctx.fill();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 5,45, 0,255,0,255, "5,45", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.font.default.html b/LayoutTests/fast/canvas/philip/tests/2d.text.font.default.html
new file mode 100644
index 0000000..0989223
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.font.default.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.font.default</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.font.parse.invalid.html" title="2d.text.font.parse.invalid">
+<link rel="next" href="2d.text.align.valid.html" title="2d.text.align.valid">
+<body class="show_output">
+<p>
+ <a href="2d.text.font.parse.invalid.html" accesskey="p" title="[p] 2d.text.font.parse.invalid"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.align.valid.html" accesskey="n" title="[n] 2d.text.align.valid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.font.html">font</a>.default</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.font.default">2d.text.font.default</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(ctx.font, '10px sans-serif', "ctx.font", "'10px sans-serif'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.basic.html
new file mode 100644
index 0000000..cc2aced
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.basic.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.font.parse.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.imageData.put.path.html" title="2d.imageData.put.path">
+<link rel="next" href="2d.text.font.parse.complex.html" title="2d.text.font.parse.complex">
+<body class="show_output">
+<p>
+ <a href="2d.imageData.put.path.html" accesskey="p" title="[p] 2d.imageData.put.path"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.font.parse.complex.html" accesskey="n" title="[n] 2d.text.font.parse.complex">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.font.html">font</a>.<a href="index.2d.text.font.parse.html">parse</a>.basic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.font.parse">2d.text.font.parse</a>
+<li><a href="spec.html#testrefs.2d.text.font.get">2d.text.font.get</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '20px serif';
+_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'");
+
+ctx.font = '20PX SERIF';
+_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.complex.html b/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.complex.html
new file mode 100644
index 0000000..a00d637
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.complex.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.font.parse.complex</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.font.parse.basic.html" title="2d.text.font.parse.basic">
+<link rel="next" href="2d.text.font.parse.size.percentage.html" title="2d.text.font.parse.size.percentage">
+<body class="show_output">
+<p>
+ <a href="2d.text.font.parse.basic.html" accesskey="p" title="[p] 2d.text.font.parse.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.font.parse.size.percentage.html" accesskey="n" title="[n] 2d.text.font.parse.size.percentage">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.font.html">font</a>.<a href="index.2d.text.font.parse.html">parse</a>.complex</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.font.parse">2d.text.font.parse</a>
+<li><a href="spec.html#testrefs.2d.text.font.get">2d.text.font.get</a>
+<li><a href="spec.html#testrefs.2d.text.font.lineheight">2d.text.font.lineheight</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = 'small-caps italic 400 12px/2 Unknown Font, sans-serif';
+_assertSame(ctx.font, 'italic small-caps 12px "Unknown Font", sans-serif', "ctx.font", "'italic small-caps 12px \"Unknown Font\", sans-serif'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.invalid.html b/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.invalid.html
new file mode 100644
index 0000000..b224dd9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.invalid.html
@@ -0,0 +1,58 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.font.parse.invalid</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.font.parse.system.html" title="2d.text.font.parse.system">
+<link rel="next" href="2d.text.font.default.html" title="2d.text.font.default">
+<body class="show_output">
+<p>
+ <a href="2d.text.font.parse.system.html" accesskey="p" title="[p] 2d.text.font.parse.system"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.font.default.html" accesskey="n" title="[n] 2d.text.font.default">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.font.html">font</a>.<a href="index.2d.text.font.parse.html">parse</a>.invalid</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.font.invalid">2d.text.font.invalid</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '20px serif';
+_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'");
+
+ctx.font = '20px serif';
+ctx.font = 'bogus';
+_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'");
+
+ctx.font = '20px serif';
+ctx.font = 'inherit';
+_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'");
+
+ctx.font = '20px serif';
+ctx.font = '10px {bogus}';
+_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'");
+
+ctx.font = '20px serif';
+ctx.font = '10px initial';
+_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'");
+
+ctx.font = '20px serif';
+ctx.font = '10px default';
+_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'");
+
+ctx.font = '20px serif';
+ctx.font = '10px inherit';
+_assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.size.percentage.default.html b/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.size.percentage.default.html
new file mode 100644
index 0000000..892cd91
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.size.percentage.default.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.font.parse.size.percentage.default</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.font.parse.size.percentage.html" title="2d.text.font.parse.size.percentage">
+<link rel="next" href="2d.text.font.parse.system.html" title="2d.text.font.parse.system">
+<body class="show_output">
+<p>
+ <a href="2d.text.font.parse.size.percentage.html" accesskey="p" title="[p] 2d.text.font.parse.size.percentage"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.font.parse.system.html" accesskey="n" title="[n] 2d.text.font.parse.system">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.font.html">font</a>.<a href="index.2d.text.font.parse.html">parse</a>.<a href="index.2d.text.font.parse.size.html">size</a>.<a href="index.2d.text.font.parse.size.percentage.html">percentage</a>.default</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.font.undefined">2d.text.font.undefined</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+var ctx2 = canvas2.getContext('2d');
+ctx.font = '1000% serif';
+_assertSame(ctx.font, '100px serif', "ctx.font", "'100px serif'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.size.percentage.html b/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.size.percentage.html
new file mode 100644
index 0000000..80ba212
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.size.percentage.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.font.parse.size.percentage</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.font.parse.complex.html" title="2d.text.font.parse.complex">
+<link rel="next" href="2d.text.font.parse.size.percentage.default.html" title="2d.text.font.parse.size.percentage.default">
+<body class="show_output">
+<p>
+ <a href="2d.text.font.parse.complex.html" accesskey="p" title="[p] 2d.text.font.parse.complex"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.font.parse.size.percentage.default.html" accesskey="n" title="[n] 2d.text.font.parse.size.percentage.default">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.font.html">font</a>.<a href="index.2d.text.font.parse.html">parse</a>.<a href="index.2d.text.font.parse.size.html">size</a>.percentage</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.font.parse">2d.text.font.parse</a>
+<li><a href="spec.html#testrefs.2d.text.font.get">2d.text.font.get</a>
+<li><a href="spec.html#testrefs.2d.text.font.fontsize">2d.text.font.fontsize</a>
+<li><a href="spec.html#testrefs.2d.text.font.size">2d.text.font.size</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" style="font-size: 144px" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = '50% serif';
+_assertSame(ctx.font, '72px serif', "ctx.font", "'72px serif'");
+canvas.setAttribute('style', 'font-size: 100px');
+_assertSame(ctx.font, '72px serif', "ctx.font", "'72px serif'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.system.html b/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.system.html
new file mode 100644
index 0000000..4846917
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.font.parse.system.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.font.parse.system</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.font.parse.size.percentage.default.html" title="2d.text.font.parse.size.percentage.default">
+<link rel="next" href="2d.text.font.parse.invalid.html" title="2d.text.font.parse.invalid">
+<body class="show_output">
+<p>
+ <a href="2d.text.font.parse.size.percentage.default.html" accesskey="p" title="[p] 2d.text.font.parse.size.percentage.default"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.font.parse.invalid.html" accesskey="n" title="[n] 2d.text.font.parse.invalid">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.font.html">font</a>.<a href="index.2d.text.font.parse.html">parse</a>.system</h1>
+<p class="desc">System fonts must be computed to explicit values</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.font.parse">2d.text.font.parse</a>
+<li><a href="spec.html#testrefs.2d.text.font.get">2d.text.font.get</a>
+<li><a href="spec.html#testrefs.2d.text.font.systemfonts">2d.text.font.systemfonts</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.font = 'message-box';
+_assertDifferent(ctx.font, 'message-box', "ctx.font", "'message-box'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.measure.width.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.text.measure.width.basic.html
new file mode 100644
index 0000000..961dd57
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.measure.width.basic.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.measure.width.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.draw.space.collapse.end.html" title="2d.text.draw.space.collapse.end">
+<link rel="next" href="2d.text.measure.width.empty.html" title="2d.text.measure.width.empty">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.draw.space.collapse.end.html" accesskey="p" title="[p] 2d.text.draw.space.collapse.end"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.measure.width.empty.html" accesskey="n" title="[n] 2d.text.measure.width.empty">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.measure.html">measure</a>.<a href="index.2d.text.measure.width.html">width</a>.basic</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.measure">2d.text.measure</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.font = '50px CanvasTest';
+ _assertSame(ctx.measureText('A').width, 50, "ctx.measureText('A').width", "50");
+ _assertSame(ctx.measureText('AA').width, 100, "ctx.measureText('AA').width", "100");
+ _assertSame(ctx.measureText('ABCD').width, 200, "ctx.measureText('ABCD').width", "200");
+
+ ctx.font = '100px CanvasTest';
+ _assertSame(ctx.measureText('A').width, 100, "ctx.measureText('A').width", "100");
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.measure.width.empty.html b/LayoutTests/fast/canvas/philip/tests/2d.text.measure.width.empty.html
new file mode 100644
index 0000000..8bb83e4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.measure.width.empty.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.measure.width.empty</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.measure.width.basic.html" title="2d.text.measure.width.basic">
+<link rel="next" href="2d.text.measure.width.space.html" title="2d.text.measure.width.space">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.measure.width.basic.html" accesskey="p" title="[p] 2d.text.measure.width.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.text.measure.width.space.html" accesskey="n" title="[n] 2d.text.measure.width.space">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.measure.html">measure</a>.<a href="index.2d.text.measure.width.html">width</a>.empty</h1>
+<p class="desc">The empty string has zero width</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.measure">2d.text.measure</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.font = '50px CanvasTest';
+ _assertSame(ctx.measureText("").width, 0, "ctx.measureText(\"\").width", "0");
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.text.measure.width.space.html b/LayoutTests/fast/canvas/philip/tests/2d.text.measure.width.space.html
new file mode 100644
index 0000000..e86b3e0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.text.measure.width.space.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.text.measure.width.space</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.text.measure.width.empty.html" title="2d.text.measure.width.empty">
+<link rel="next" href="index.html" title="index">
+<style>
+@font-face {
+ font-family: CanvasTest;
+ src: url("../fonts/CanvasTest.ttf");
+}
+</style><body class="show_output">
+<p>
+ <a href="2d.text.measure.width.empty.html" accesskey="p" title="[p] 2d.text.measure.width.empty"><</a>
+ <a href="index.html">[index]</a>
+ <a href="index.html" accesskey="n" title="[n] index">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.text.html">text</a>.<a href="index.2d.text.measure.html">measure</a>.<a href="index.2d.text.measure.width.html">width</a>.space</h1>
+<p class="desc">Space characters are converted to U+0020 and collapsed (per CSS)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.text.measure.spaces">2d.text.measure.spaces</a>
+
+</ul>
+</div>
+
+<span style="font-family: CanvasTest; position: absolute; visibility: hidden">A</span>
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+deferTest();
+setTimeout(wrapFunction(function () {
+ ctx.font = '50px CanvasTest';
+ _assertSame(ctx.measureText('A B').width, 150, "ctx.measureText('A B').width", "150");
+ _assertSame(ctx.measureText('A B').width, 150, "ctx.measureText('A B').width", "150");
+ _assertSame(ctx.measureText('A \x09\x0a\x0c\x0d \x09\x0a\x0c\x0dB').width, 150, "ctx.measureText('A \\x09\\x0a\\x0c\\x0d \\x09\\x0a\\x0c\\x0dB').width", "150");
+ _assert(ctx.measureText('A \x0b B').width >= 200, "ctx.measureText('A \\x0b B').width >= 200");
+
+ _assertSame(ctx.measureText(' AB').width, 100, "ctx.measureText(' AB').width", "100");
+ _assertSame(ctx.measureText('AB ').width, 100, "ctx.measureText('AB ').width", "100");
+}), 500);
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.order.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.order.html
new file mode 100644
index 0000000..8fa6aba
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.order.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.order</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.underflow.html" title="2d.state.saverestore.underflow">
+<link rel="next" href="2d.transformation.scale.basic.html" title="2d.transformation.scale.basic">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.underflow.html" accesskey="p" title="[p] 2d.state.saverestore.underflow"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.scale.basic.html" accesskey="n" title="[n] 2d.transformation.scale.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.order</h1>
+<p class="desc">Transformations are applied in the right order</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.order">2d.transformation.order</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.scale(2, 1);
+ctx.rotate(Math.PI / 2);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, -50, 50, 50);
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.direction.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.direction.html
new file mode 100644
index 0000000..1699c131
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.direction.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.rotate.direction</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.rotate.radians.html" title="2d.transformation.rotate.radians">
+<link rel="next" href="2d.transformation.rotate.wrap.html" title="2d.transformation.rotate.wrap">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.rotate.radians.html" accesskey="p" title="[p] 2d.transformation.rotate.radians"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.rotate.wrap.html" accesskey="n" title="[n] 2d.transformation.rotate.wrap">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.rotate.html">rotate</a>.direction</h1>
+<p class="desc">rotate() is clockwise</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.rotate.direction">2d.transformation.rotate.direction</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.rotate(Math.PI / 2);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, -100, 50, 100);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.nonfinite.html
new file mode 100644
index 0000000..b5462ed
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.nonfinite.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.rotate.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.rotate.wrapnegative.html" title="2d.transformation.rotate.wrapnegative">
+<link rel="next" href="2d.transformation.translate.basic.html" title="2d.transformation.translate.basic">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.rotate.wrapnegative.html" accesskey="p" title="[p] 2d.transformation.rotate.wrapnegative"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.translate.basic.html" accesskey="n" title="[n] 2d.transformation.translate.basic">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.rotate.html">rotate</a>.nonfinite</h1>
+<p class="desc">rotate() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.translate(100, 10);
+ctx.rotate(Infinity);
+ctx.rotate(-Infinity);
+ctx.rotate(NaN);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(-100, -10, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.radians.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.radians.html
new file mode 100644
index 0000000..2a3a2f1
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.radians.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.rotate.radians</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.rotate.zero.html" title="2d.transformation.rotate.zero">
+<link rel="next" href="2d.transformation.rotate.direction.html" title="2d.transformation.rotate.direction">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.rotate.zero.html" accesskey="p" title="[p] 2d.transformation.rotate.zero"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.rotate.direction.html" accesskey="n" title="[n] 2d.transformation.rotate.direction">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.rotate.html">rotate</a>.radians</h1>
+<p class="desc">rotate() uses radians</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.rotate.radians">2d.transformation.rotate.radians</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.rotate(Math.PI); // should fail obviously if this is 3.1 degrees
+ctx.fillStyle = '#0f0';
+ctx.fillRect(-100, -50, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.wrap.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.wrap.html
new file mode 100644
index 0000000..4fa3b87a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.wrap.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.rotate.wrap</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.rotate.direction.html" title="2d.transformation.rotate.direction">
+<link rel="next" href="2d.transformation.rotate.wrapnegative.html" title="2d.transformation.rotate.wrapnegative">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.rotate.direction.html" accesskey="p" title="[p] 2d.transformation.rotate.direction"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.rotate.wrapnegative.html" accesskey="n" title="[n] 2d.transformation.rotate.wrapnegative">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.rotate.html">rotate</a>.wrap</h1>
+<p class="desc">rotate() wraps large positive values correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.rotate">2d.transformation.rotate</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.rotate(Math.PI * (1 + 4096)); // == pi (mod 2*pi)
+// We need about pi +/- 0.001 in order to get correct-looking results
+// 32-bit floats can store pi*4097 with precision 2^-10, so that should
+// be safe enough on reasonable implementations
+ctx.fillStyle = '#0f0';
+ctx.fillRect(-100, -50, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,2, 0,255,0,255, "98,2", "0,255,0,255");
+_assertPixel(canvas, 98,47, 0,255,0,255, "98,47", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.wrapnegative.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.wrapnegative.html
new file mode 100644
index 0000000..12ba369
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.wrapnegative.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.rotate.wrapnegative</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.rotate.wrap.html" title="2d.transformation.rotate.wrap">
+<link rel="next" href="2d.transformation.rotate.nonfinite.html" title="2d.transformation.rotate.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.rotate.wrap.html" accesskey="p" title="[p] 2d.transformation.rotate.wrap"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.rotate.nonfinite.html" accesskey="n" title="[n] 2d.transformation.rotate.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.rotate.html">rotate</a>.wrapnegative</h1>
+<p class="desc">rotate() wraps large negative values correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.rotate">2d.transformation.rotate</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.rotate(-Math.PI * (1 + 4096));
+ctx.fillStyle = '#0f0';
+ctx.fillRect(-100, -50, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+_assertPixel(canvas, 98,2, 0,255,0,255, "98,2", "0,255,0,255");
+_assertPixel(canvas, 98,47, 0,255,0,255, "98,47", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.zero.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.zero.html
new file mode 100644
index 0000000..3bc9d20
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.rotate.zero.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.rotate.zero</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.scale.multiple.html" title="2d.transformation.scale.multiple">
+<link rel="next" href="2d.transformation.rotate.radians.html" title="2d.transformation.rotate.radians">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.scale.multiple.html" accesskey="p" title="[p] 2d.transformation.scale.multiple"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.rotate.radians.html" accesskey="n" title="[n] 2d.transformation.rotate.radians">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.rotate.html">rotate</a>.zero</h1>
+<p class="desc">rotate() by 0 does nothing</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.rotate">2d.transformation.rotate</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.rotate(0);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.basic.html
new file mode 100644
index 0000000..ce8bf97
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.basic.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.scale.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.order.html" title="2d.transformation.order">
+<link rel="next" href="2d.transformation.scale.zero.html" title="2d.transformation.scale.zero">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.order.html" accesskey="p" title="[p] 2d.transformation.order"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.scale.zero.html" accesskey="n" title="[n] 2d.transformation.scale.zero">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.scale.html">scale</a>.basic</h1>
+<p class="desc">scale() works</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.scale">2d.transformation.scale</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.scale(2, 4);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 50, 12.5);
+_assertPixel(canvas, 90,40, 0,255,0,255, "90,40", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.large.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.large.html
new file mode 100644
index 0000000..493c6a3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.large.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.scale.large</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.scale.negative.html" title="2d.transformation.scale.negative">
+<link rel="next" href="2d.transformation.scale.nonfinite.html" title="2d.transformation.scale.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.scale.negative.html" accesskey="p" title="[p] 2d.transformation.scale.negative"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.scale.nonfinite.html" accesskey="n" title="[n] 2d.transformation.scale.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.scale.html">scale</a>.large</h1>
+<p class="desc">scale() with large scale factors works</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.scale">2d.transformation.scale</a>
+
+</ul>
+</div>
+<p class="notes">Not really that large at all, but it hits the limits in Firefox.
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.scale(1e5, 1e5);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 1, 1);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.multiple.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.multiple.html
new file mode 100644
index 0000000..32a7bf9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.multiple.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.scale.multiple</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.scale.nonfinite.html" title="2d.transformation.scale.nonfinite">
+<link rel="next" href="2d.transformation.rotate.zero.html" title="2d.transformation.rotate.zero">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.scale.nonfinite.html" accesskey="p" title="[p] 2d.transformation.scale.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.rotate.zero.html" accesskey="n" title="[n] 2d.transformation.rotate.zero">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.scale.html">scale</a>.multiple</h1>
+<p class="desc">Multiple scale()s combine</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.scale.multiple">2d.transformation.scale.multiple</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.scale(Math.sqrt(2), Math.sqrt(2));
+ctx.scale(Math.sqrt(2), Math.sqrt(2));
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 50, 25);
+_assertPixel(canvas, 90,40, 0,255,0,255, "90,40", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.negative.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.negative.html
new file mode 100644
index 0000000..79cea92
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.negative.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.scale.negative</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.scale.zero.html" title="2d.transformation.scale.zero">
+<link rel="next" href="2d.transformation.scale.large.html" title="2d.transformation.scale.large">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.scale.zero.html" accesskey="p" title="[p] 2d.transformation.scale.zero"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.scale.large.html" accesskey="n" title="[n] 2d.transformation.scale.large">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.scale.html">scale</a>.negative</h1>
+<p class="desc">scale() with negative scale factors works</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.scale">2d.transformation.scale</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.save();
+ctx.scale(-1, 1);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(-50, 0, 50, 50);
+ctx.restore();
+
+ctx.save();
+ctx.scale(1, -1);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(50, -50, 50, 50);
+ctx.restore();
+_assertPixel(canvas, 25,25, 0,255,0,255, "25,25", "0,255,0,255");
+_assertPixel(canvas, 75,25, 0,255,0,255, "75,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.nonfinite.html
new file mode 100644
index 0000000..a67e6bf
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.nonfinite.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.scale.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.scale.large.html" title="2d.transformation.scale.large">
+<link rel="next" href="2d.transformation.scale.multiple.html" title="2d.transformation.scale.multiple">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.scale.large.html" accesskey="p" title="[p] 2d.transformation.scale.large"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.scale.multiple.html" accesskey="n" title="[n] 2d.transformation.scale.multiple">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.scale.html">scale</a>.nonfinite</h1>
+<p class="desc">scale() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.translate(100, 10);
+ctx.scale(Infinity, 0.1);
+ctx.scale(-Infinity, 0.1);
+ctx.scale(NaN, 0.1);
+ctx.scale(0.1, Infinity);
+ctx.scale(0.1, -Infinity);
+ctx.scale(0.1, NaN);
+ctx.scale(Infinity, Infinity);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(-100, -10, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.zero.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.zero.html
new file mode 100644
index 0000000..ce4c761
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.scale.zero.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.scale.zero</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.scale.basic.html" title="2d.transformation.scale.basic">
+<link rel="next" href="2d.transformation.scale.negative.html" title="2d.transformation.scale.negative">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.scale.basic.html" accesskey="p" title="[p] 2d.transformation.scale.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.scale.negative.html" accesskey="n" title="[n] 2d.transformation.scale.negative">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.scale.html">scale</a>.zero</h1>
+<p class="desc">scale() with a scale factor of zero works</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.scale">2d.transformation.scale</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.save();
+ctx.translate(50, 0);
+ctx.scale(0, 1);
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.restore();
+
+ctx.save();
+ctx.translate(0, 25);
+ctx.scale(1, 0);
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.restore();
+
+// Firefox has a bug where it renders the canvas as empty and toDataURL throws an exception
+canvas.toDataURL();
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.setTransform.multiple.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.setTransform.multiple.html
new file mode 100644
index 0000000..2be9465
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.setTransform.multiple.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.setTransform.multiple</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.setTransform.skewed.html" title="2d.transformation.setTransform.skewed">
+<link rel="next" href="2d.transformation.setTransform.nonfinite.html" title="2d.transformation.setTransform.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.setTransform.skewed.html" accesskey="p" title="[p] 2d.transformation.setTransform.skewed"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.setTransform.nonfinite.html" accesskey="n" title="[n] 2d.transformation.setTransform.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.setTransform.html">setTransform</a>.multiple</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.setTransform.identity">2d.transformation.setTransform.identity</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.setTransform(1/2,0, 0,1/2, 0,0);
+ctx.setTransform(2,0, 0,2, 0,0);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 50, 25);
+_assertPixel(canvas, 75,35, 0,255,0,255, "75,35", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.setTransform.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.setTransform.nonfinite.html
new file mode 100644
index 0000000..15fce1e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.setTransform.nonfinite.html
@@ -0,0 +1,116 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.setTransform.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.setTransform.multiple.html" title="2d.transformation.setTransform.multiple">
+<link rel="next" href="2d.composite.globalAlpha.range.html" title="2d.composite.globalAlpha.range">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.setTransform.multiple.html" accesskey="p" title="[p] 2d.transformation.setTransform.multiple"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.composite.globalAlpha.range.html" accesskey="n" title="[n] 2d.composite.globalAlpha.range">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.setTransform.html">setTransform</a>.nonfinite</h1>
+<p class="desc">setTransform() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.translate(100, 10);
+ctx.setTransform(Infinity, 0, 0, 0, 0, 0);
+ctx.setTransform(-Infinity, 0, 0, 0, 0, 0);
+ctx.setTransform(NaN, 0, 0, 0, 0, 0);
+ctx.setTransform(0, Infinity, 0, 0, 0, 0);
+ctx.setTransform(0, -Infinity, 0, 0, 0, 0);
+ctx.setTransform(0, NaN, 0, 0, 0, 0);
+ctx.setTransform(0, 0, Infinity, 0, 0, 0);
+ctx.setTransform(0, 0, -Infinity, 0, 0, 0);
+ctx.setTransform(0, 0, NaN, 0, 0, 0);
+ctx.setTransform(0, 0, 0, Infinity, 0, 0);
+ctx.setTransform(0, 0, 0, -Infinity, 0, 0);
+ctx.setTransform(0, 0, 0, NaN, 0, 0);
+ctx.setTransform(0, 0, 0, 0, Infinity, 0);
+ctx.setTransform(0, 0, 0, 0, -Infinity, 0);
+ctx.setTransform(0, 0, 0, 0, NaN, 0);
+ctx.setTransform(0, 0, 0, 0, 0, Infinity);
+ctx.setTransform(0, 0, 0, 0, 0, -Infinity);
+ctx.setTransform(0, 0, 0, 0, 0, NaN);
+ctx.setTransform(Infinity, Infinity, 0, 0, 0, 0);
+ctx.setTransform(Infinity, Infinity, Infinity, 0, 0, 0);
+ctx.setTransform(Infinity, Infinity, Infinity, Infinity, 0, 0);
+ctx.setTransform(Infinity, Infinity, Infinity, Infinity, Infinity, 0);
+ctx.setTransform(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
+ctx.setTransform(Infinity, Infinity, Infinity, Infinity, 0, Infinity);
+ctx.setTransform(Infinity, Infinity, Infinity, 0, Infinity, 0);
+ctx.setTransform(Infinity, Infinity, Infinity, 0, Infinity, Infinity);
+ctx.setTransform(Infinity, Infinity, Infinity, 0, 0, Infinity);
+ctx.setTransform(Infinity, Infinity, 0, Infinity, 0, 0);
+ctx.setTransform(Infinity, Infinity, 0, Infinity, Infinity, 0);
+ctx.setTransform(Infinity, Infinity, 0, Infinity, Infinity, Infinity);
+ctx.setTransform(Infinity, Infinity, 0, Infinity, 0, Infinity);
+ctx.setTransform(Infinity, Infinity, 0, 0, Infinity, 0);
+ctx.setTransform(Infinity, Infinity, 0, 0, Infinity, Infinity);
+ctx.setTransform(Infinity, Infinity, 0, 0, 0, Infinity);
+ctx.setTransform(Infinity, 0, Infinity, 0, 0, 0);
+ctx.setTransform(Infinity, 0, Infinity, Infinity, 0, 0);
+ctx.setTransform(Infinity, 0, Infinity, Infinity, Infinity, 0);
+ctx.setTransform(Infinity, 0, Infinity, Infinity, Infinity, Infinity);
+ctx.setTransform(Infinity, 0, Infinity, Infinity, 0, Infinity);
+ctx.setTransform(Infinity, 0, Infinity, 0, Infinity, 0);
+ctx.setTransform(Infinity, 0, Infinity, 0, Infinity, Infinity);
+ctx.setTransform(Infinity, 0, Infinity, 0, 0, Infinity);
+ctx.setTransform(Infinity, 0, 0, Infinity, 0, 0);
+ctx.setTransform(Infinity, 0, 0, Infinity, Infinity, 0);
+ctx.setTransform(Infinity, 0, 0, Infinity, Infinity, Infinity);
+ctx.setTransform(Infinity, 0, 0, Infinity, 0, Infinity);
+ctx.setTransform(Infinity, 0, 0, 0, Infinity, 0);
+ctx.setTransform(Infinity, 0, 0, 0, Infinity, Infinity);
+ctx.setTransform(Infinity, 0, 0, 0, 0, Infinity);
+ctx.setTransform(0, Infinity, Infinity, 0, 0, 0);
+ctx.setTransform(0, Infinity, Infinity, Infinity, 0, 0);
+ctx.setTransform(0, Infinity, Infinity, Infinity, Infinity, 0);
+ctx.setTransform(0, Infinity, Infinity, Infinity, Infinity, Infinity);
+ctx.setTransform(0, Infinity, Infinity, Infinity, 0, Infinity);
+ctx.setTransform(0, Infinity, Infinity, 0, Infinity, 0);
+ctx.setTransform(0, Infinity, Infinity, 0, Infinity, Infinity);
+ctx.setTransform(0, Infinity, Infinity, 0, 0, Infinity);
+ctx.setTransform(0, Infinity, 0, Infinity, 0, 0);
+ctx.setTransform(0, Infinity, 0, Infinity, Infinity, 0);
+ctx.setTransform(0, Infinity, 0, Infinity, Infinity, Infinity);
+ctx.setTransform(0, Infinity, 0, Infinity, 0, Infinity);
+ctx.setTransform(0, Infinity, 0, 0, Infinity, 0);
+ctx.setTransform(0, Infinity, 0, 0, Infinity, Infinity);
+ctx.setTransform(0, Infinity, 0, 0, 0, Infinity);
+ctx.setTransform(0, 0, Infinity, Infinity, 0, 0);
+ctx.setTransform(0, 0, Infinity, Infinity, Infinity, 0);
+ctx.setTransform(0, 0, Infinity, Infinity, Infinity, Infinity);
+ctx.setTransform(0, 0, Infinity, Infinity, 0, Infinity);
+ctx.setTransform(0, 0, Infinity, 0, Infinity, 0);
+ctx.setTransform(0, 0, Infinity, 0, Infinity, Infinity);
+ctx.setTransform(0, 0, Infinity, 0, 0, Infinity);
+ctx.setTransform(0, 0, 0, Infinity, Infinity, 0);
+ctx.setTransform(0, 0, 0, Infinity, Infinity, Infinity);
+ctx.setTransform(0, 0, 0, Infinity, 0, Infinity);
+ctx.setTransform(0, 0, 0, 0, Infinity, Infinity);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(-100, -10, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.setTransform.skewed.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.setTransform.skewed.html
new file mode 100644
index 0000000..387c381
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.setTransform.skewed.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.setTransform.skewed</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.transform.nonfinite.html" title="2d.transformation.transform.nonfinite">
+<link rel="next" href="2d.transformation.setTransform.multiple.html" title="2d.transformation.setTransform.multiple">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.transform.nonfinite.html" accesskey="p" title="[p] 2d.transformation.transform.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.setTransform.multiple.html" accesskey="n" title="[n] 2d.transformation.setTransform.multiple">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.setTransform.html">setTransform</a>.skewed</h1>
+<p class="desc"></p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.setTransform">2d.transformation.setTransform</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Create green with a red square ring inside it
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(20, 10, 60, 30);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(40, 20, 20, 10);
+
+// Draw a skewed shape to fill that gap, to make sure it is aligned correctly
+ctx.setTransform(1,4, 2,3, 5,6);
+// Post-transform coordinates:
+// [[20,10],[80,10],[80,40],[20,40],[20,10],[40,20],[40,30],[60,30],[60,20],[40,20],[20,10]];
+// Hence pre-transform coordinates:
+var pts=[[-7.4,11.2],[-43.4,59.2],[-31.4,53.2],[4.6,5.2],[-7.4,11.2],
+ [-15.4,25.2],[-11.4,23.2],[-23.4,39.2],[-27.4,41.2],[-15.4,25.2],
+ [-7.4,11.2]];
+ctx.beginPath();
+ctx.moveTo(pts[0][0], pts[0][1]);
+for (var i = 0; i < pts.length; ++i)
+ ctx.lineTo(pts[i][0], pts[i][1]);
+ctx.fill();
+_assertPixel(canvas, 21,11, 0,255,0,255, "21,11", "0,255,0,255");
+_assertPixel(canvas, 79,11, 0,255,0,255, "79,11", "0,255,0,255");
+_assertPixel(canvas, 21,39, 0,255,0,255, "21,39", "0,255,0,255");
+_assertPixel(canvas, 79,39, 0,255,0,255, "79,39", "0,255,0,255");
+_assertPixel(canvas, 39,19, 0,255,0,255, "39,19", "0,255,0,255");
+_assertPixel(canvas, 61,19, 0,255,0,255, "61,19", "0,255,0,255");
+_assertPixel(canvas, 39,31, 0,255,0,255, "39,31", "0,255,0,255");
+_assertPixel(canvas, 61,31, 0,255,0,255, "61,31", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.transform.identity.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.transform.identity.html
new file mode 100644
index 0000000..838501f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.transform.identity.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.transform.identity</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.translate.nonfinite.html" title="2d.transformation.translate.nonfinite">
+<link rel="next" href="2d.transformation.transform.skewed.html" title="2d.transformation.transform.skewed">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.translate.nonfinite.html" accesskey="p" title="[p] 2d.transformation.translate.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.transform.skewed.html" accesskey="n" title="[n] 2d.transformation.transform.skewed">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.transform.html">transform</a>.identity</h1>
+<p class="desc">transform() with the identity matrix does nothing</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.transform">2d.transformation.transform</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.transform(1,0, 0,1, 0,0);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.transform.multiply.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.transform.multiply.html
new file mode 100644
index 0000000..30e48aa
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.transform.multiply.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.transform.multiply</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.transform.skewed.html" title="2d.transformation.transform.skewed">
+<link rel="next" href="2d.transformation.transform.nonfinite.html" title="2d.transformation.transform.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.transform.skewed.html" accesskey="p" title="[p] 2d.transformation.transform.skewed"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.transform.nonfinite.html" accesskey="n" title="[n] 2d.transformation.transform.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.transform.html">transform</a>.multiply</h1>
+<p class="desc">transform() multiplies the CTM</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.transform.multiply">2d.transformation.transform.multiply</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.transform(1,2, 3,4, 5,6);
+ctx.transform(-2,1, 3/2,-1/2, 1,-2);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.transform.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.transform.nonfinite.html
new file mode 100644
index 0000000..2114407
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.transform.nonfinite.html
@@ -0,0 +1,116 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.transform.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.transform.multiply.html" title="2d.transformation.transform.multiply">
+<link rel="next" href="2d.transformation.setTransform.skewed.html" title="2d.transformation.setTransform.skewed">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.transform.multiply.html" accesskey="p" title="[p] 2d.transformation.transform.multiply"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.setTransform.skewed.html" accesskey="n" title="[n] 2d.transformation.setTransform.skewed">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.transform.html">transform</a>.nonfinite</h1>
+<p class="desc">transform() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.translate(100, 10);
+ctx.transform(Infinity, 0, 0, 0, 0, 0);
+ctx.transform(-Infinity, 0, 0, 0, 0, 0);
+ctx.transform(NaN, 0, 0, 0, 0, 0);
+ctx.transform(0, Infinity, 0, 0, 0, 0);
+ctx.transform(0, -Infinity, 0, 0, 0, 0);
+ctx.transform(0, NaN, 0, 0, 0, 0);
+ctx.transform(0, 0, Infinity, 0, 0, 0);
+ctx.transform(0, 0, -Infinity, 0, 0, 0);
+ctx.transform(0, 0, NaN, 0, 0, 0);
+ctx.transform(0, 0, 0, Infinity, 0, 0);
+ctx.transform(0, 0, 0, -Infinity, 0, 0);
+ctx.transform(0, 0, 0, NaN, 0, 0);
+ctx.transform(0, 0, 0, 0, Infinity, 0);
+ctx.transform(0, 0, 0, 0, -Infinity, 0);
+ctx.transform(0, 0, 0, 0, NaN, 0);
+ctx.transform(0, 0, 0, 0, 0, Infinity);
+ctx.transform(0, 0, 0, 0, 0, -Infinity);
+ctx.transform(0, 0, 0, 0, 0, NaN);
+ctx.transform(Infinity, Infinity, 0, 0, 0, 0);
+ctx.transform(Infinity, Infinity, Infinity, 0, 0, 0);
+ctx.transform(Infinity, Infinity, Infinity, Infinity, 0, 0);
+ctx.transform(Infinity, Infinity, Infinity, Infinity, Infinity, 0);
+ctx.transform(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity);
+ctx.transform(Infinity, Infinity, Infinity, Infinity, 0, Infinity);
+ctx.transform(Infinity, Infinity, Infinity, 0, Infinity, 0);
+ctx.transform(Infinity, Infinity, Infinity, 0, Infinity, Infinity);
+ctx.transform(Infinity, Infinity, Infinity, 0, 0, Infinity);
+ctx.transform(Infinity, Infinity, 0, Infinity, 0, 0);
+ctx.transform(Infinity, Infinity, 0, Infinity, Infinity, 0);
+ctx.transform(Infinity, Infinity, 0, Infinity, Infinity, Infinity);
+ctx.transform(Infinity, Infinity, 0, Infinity, 0, Infinity);
+ctx.transform(Infinity, Infinity, 0, 0, Infinity, 0);
+ctx.transform(Infinity, Infinity, 0, 0, Infinity, Infinity);
+ctx.transform(Infinity, Infinity, 0, 0, 0, Infinity);
+ctx.transform(Infinity, 0, Infinity, 0, 0, 0);
+ctx.transform(Infinity, 0, Infinity, Infinity, 0, 0);
+ctx.transform(Infinity, 0, Infinity, Infinity, Infinity, 0);
+ctx.transform(Infinity, 0, Infinity, Infinity, Infinity, Infinity);
+ctx.transform(Infinity, 0, Infinity, Infinity, 0, Infinity);
+ctx.transform(Infinity, 0, Infinity, 0, Infinity, 0);
+ctx.transform(Infinity, 0, Infinity, 0, Infinity, Infinity);
+ctx.transform(Infinity, 0, Infinity, 0, 0, Infinity);
+ctx.transform(Infinity, 0, 0, Infinity, 0, 0);
+ctx.transform(Infinity, 0, 0, Infinity, Infinity, 0);
+ctx.transform(Infinity, 0, 0, Infinity, Infinity, Infinity);
+ctx.transform(Infinity, 0, 0, Infinity, 0, Infinity);
+ctx.transform(Infinity, 0, 0, 0, Infinity, 0);
+ctx.transform(Infinity, 0, 0, 0, Infinity, Infinity);
+ctx.transform(Infinity, 0, 0, 0, 0, Infinity);
+ctx.transform(0, Infinity, Infinity, 0, 0, 0);
+ctx.transform(0, Infinity, Infinity, Infinity, 0, 0);
+ctx.transform(0, Infinity, Infinity, Infinity, Infinity, 0);
+ctx.transform(0, Infinity, Infinity, Infinity, Infinity, Infinity);
+ctx.transform(0, Infinity, Infinity, Infinity, 0, Infinity);
+ctx.transform(0, Infinity, Infinity, 0, Infinity, 0);
+ctx.transform(0, Infinity, Infinity, 0, Infinity, Infinity);
+ctx.transform(0, Infinity, Infinity, 0, 0, Infinity);
+ctx.transform(0, Infinity, 0, Infinity, 0, 0);
+ctx.transform(0, Infinity, 0, Infinity, Infinity, 0);
+ctx.transform(0, Infinity, 0, Infinity, Infinity, Infinity);
+ctx.transform(0, Infinity, 0, Infinity, 0, Infinity);
+ctx.transform(0, Infinity, 0, 0, Infinity, 0);
+ctx.transform(0, Infinity, 0, 0, Infinity, Infinity);
+ctx.transform(0, Infinity, 0, 0, 0, Infinity);
+ctx.transform(0, 0, Infinity, Infinity, 0, 0);
+ctx.transform(0, 0, Infinity, Infinity, Infinity, 0);
+ctx.transform(0, 0, Infinity, Infinity, Infinity, Infinity);
+ctx.transform(0, 0, Infinity, Infinity, 0, Infinity);
+ctx.transform(0, 0, Infinity, 0, Infinity, 0);
+ctx.transform(0, 0, Infinity, 0, Infinity, Infinity);
+ctx.transform(0, 0, Infinity, 0, 0, Infinity);
+ctx.transform(0, 0, 0, Infinity, Infinity, 0);
+ctx.transform(0, 0, 0, Infinity, Infinity, Infinity);
+ctx.transform(0, 0, 0, Infinity, 0, Infinity);
+ctx.transform(0, 0, 0, 0, Infinity, Infinity);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(-100, -10, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.transform.skewed.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.transform.skewed.html
new file mode 100644
index 0000000..338efee
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.transform.skewed.html
@@ -0,0 +1,61 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.transform.skewed</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.transform.identity.html" title="2d.transformation.transform.identity">
+<link rel="next" href="2d.transformation.transform.multiply.html" title="2d.transformation.transform.multiply">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.transform.identity.html" accesskey="p" title="[p] 2d.transformation.transform.identity"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.transform.multiply.html" accesskey="n" title="[n] 2d.transformation.transform.multiply">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.transform.html">transform</a>.skewed</h1>
+<p class="desc">transform() with skewy matrix transforms correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.transform">2d.transformation.transform</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Create green with a red square ring inside it
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#f00';
+ctx.fillRect(20, 10, 60, 30);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(40, 20, 20, 10);
+
+// Draw a skewed shape to fill that gap, to make sure it is aligned correctly
+ctx.transform(1,4, 2,3, 5,6);
+// Post-transform coordinates:
+// [[20,10],[80,10],[80,40],[20,40],[20,10],[40,20],[40,30],[60,30],[60,20],[40,20],[20,10]];
+// Hence pre-transform coordinates:
+var pts=[[-7.4,11.2],[-43.4,59.2],[-31.4,53.2],[4.6,5.2],[-7.4,11.2],
+ [-15.4,25.2],[-11.4,23.2],[-23.4,39.2],[-27.4,41.2],[-15.4,25.2],
+ [-7.4,11.2]];
+ctx.beginPath();
+ctx.moveTo(pts[0][0], pts[0][1]);
+for (var i = 0; i < pts.length; ++i)
+ ctx.lineTo(pts[i][0], pts[i][1]);
+ctx.fill();
+_assertPixel(canvas, 21,11, 0,255,0,255, "21,11", "0,255,0,255");
+_assertPixel(canvas, 79,11, 0,255,0,255, "79,11", "0,255,0,255");
+_assertPixel(canvas, 21,39, 0,255,0,255, "21,39", "0,255,0,255");
+_assertPixel(canvas, 79,39, 0,255,0,255, "79,39", "0,255,0,255");
+_assertPixel(canvas, 39,19, 0,255,0,255, "39,19", "0,255,0,255");
+_assertPixel(canvas, 61,19, 0,255,0,255, "61,19", "0,255,0,255");
+_assertPixel(canvas, 39,31, 0,255,0,255, "39,31", "0,255,0,255");
+_assertPixel(canvas, 61,31, 0,255,0,255, "61,31", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.translate.basic.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.translate.basic.html
new file mode 100644
index 0000000..e8a90e4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.translate.basic.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.translate.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.rotate.nonfinite.html" title="2d.transformation.rotate.nonfinite">
+<link rel="next" href="2d.transformation.translate.nonfinite.html" title="2d.transformation.translate.nonfinite">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.rotate.nonfinite.html" accesskey="p" title="[p] 2d.transformation.rotate.nonfinite"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.translate.nonfinite.html" accesskey="n" title="[n] 2d.transformation.translate.nonfinite">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.translate.html">translate</a>.basic</h1>
+<p class="desc">translate() works</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.transformation.translate">2d.transformation.translate</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.translate(100, 50);
+ctx.fillStyle = '#0f0';
+ctx.fillRect(-100, -50, 100, 50);
+_assertPixel(canvas, 90,40, 0,255,0,255, "90,40", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.transformation.translate.nonfinite.html b/LayoutTests/fast/canvas/philip/tests/2d.transformation.translate.nonfinite.html
new file mode 100644
index 0000000..b42ade8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.transformation.translate.nonfinite.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.transformation.translate.nonfinite</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.transformation.translate.basic.html" title="2d.transformation.translate.basic">
+<link rel="next" href="2d.transformation.transform.identity.html" title="2d.transformation.transform.identity">
+<body class="show_output">
+<p>
+ <a href="2d.transformation.translate.basic.html" accesskey="p" title="[p] 2d.transformation.translate.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.transformation.transform.identity.html" accesskey="n" title="[n] 2d.transformation.transform.identity">></a>
+<h1><a href="index.2d.html">2d</a>.<a href="index.2d.transformation.html">transformation</a>.<a href="index.2d.transformation.translate.html">translate</a>.nonfinite</h1>
+<p class="desc">translate() with Infinity/NaN is ignored</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.2d.nonfinite">2d.nonfinite</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+
+ctx.translate(100, 10);
+ctx.translate(Infinity, 0.1);
+ctx.translate(-Infinity, 0.1);
+ctx.translate(NaN, 0.1);
+ctx.translate(0.1, Infinity);
+ctx.translate(0.1, -Infinity);
+ctx.translate(0.1, NaN);
+ctx.translate(Infinity, Infinity);
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(-100, -10, 100, 50);
+
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/2d.voidreturn.html b/LayoutTests/fast/canvas/philip/tests/2d.voidreturn.html
new file mode 100644
index 0000000..05f40d0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/2d.voidreturn.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<title>Canvas test: 2d.voidreturn</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.getcontext.shared.html" title="2d.getcontext.shared">
+<link rel="next" href="2d.missingargs.html" title="2d.missingargs">
+<body class="show_output">
+<p>
+ <a href="2d.getcontext.shared.html" accesskey="p" title="[p] 2d.getcontext.shared"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.missingargs.html" accesskey="n" title="[n] 2d.missingargs">></a>
+<h1><a href="index.2d.html">2d</a>.voidreturn</h1>
+<p class="desc">void methods return undefined</p>
+<div class="refs">References:
+<ul>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(ctx.save(), undefined, "ctx.save()", "undefined");
+_assertSame(ctx.restore(), undefined, "ctx.restore()", "undefined");
+_assertSame(ctx.scale(1, 1), undefined, "ctx.scale(1, 1)", "undefined");
+_assertSame(ctx.rotate(0), undefined, "ctx.rotate(0)", "undefined");
+_assertSame(ctx.translate(0, 0), undefined, "ctx.translate(0, 0)", "undefined");
+if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported)
+ _assertSame(ctx.transform(1, 0, 0, 1, 0, 0), undefined, "ctx.transform(1, 0, 0, 1, 0, 0)", "undefined");
+}
+if (ctx.setTransform) {
+ _assertSame(ctx.setTransform(1, 0, 0, 1, 0, 0), undefined, "ctx.setTransform(1, 0, 0, 1, 0, 0)", "undefined");
+}
+_assertSame(ctx.clearRect(0, 0, 0, 0), undefined, "ctx.clearRect(0, 0, 0, 0)", "undefined");
+_assertSame(ctx.fillRect(0, 0, 0, 0), undefined, "ctx.fillRect(0, 0, 0, 0)", "undefined");
+_assertSame(ctx.strokeRect(0, 0, 0, 0), undefined, "ctx.strokeRect(0, 0, 0, 0)", "undefined");
+_assertSame(ctx.beginPath(), undefined, "ctx.beginPath()", "undefined");
+_assertSame(ctx.closePath(), undefined, "ctx.closePath()", "undefined");
+_assertSame(ctx.moveTo(0, 0), undefined, "ctx.moveTo(0, 0)", "undefined");
+_assertSame(ctx.lineTo(0, 0), undefined, "ctx.lineTo(0, 0)", "undefined");
+_assertSame(ctx.quadraticCurveTo(0, 0, 0, 0), undefined, "ctx.quadraticCurveTo(0, 0, 0, 0)", "undefined");
+_assertSame(ctx.bezierCurveTo(0, 0, 0, 0, 0, 0), undefined, "ctx.bezierCurveTo(0, 0, 0, 0, 0, 0)", "undefined");
+_assertSame(ctx.arcTo(0, 0, 0, 0, 1), undefined, "ctx.arcTo(0, 0, 0, 0, 1)", "undefined");
+_assertSame(ctx.rect(0, 0, 0, 0), undefined, "ctx.rect(0, 0, 0, 0)", "undefined");
+_assertSame(ctx.arc(0, 0, 1, 0, 0, true), undefined, "ctx.arc(0, 0, 1, 0, 0, true)", "undefined");
+_assertSame(ctx.fill(), undefined, "ctx.fill()", "undefined");
+_assertSame(ctx.stroke(), undefined, "ctx.stroke()", "undefined");
+_assertSame(ctx.clip(), undefined, "ctx.clip()", "undefined");
+if (ctx.fillText) {
+ _assertSame(ctx.fillText('test', 0, 0), undefined, "ctx.fillText('test', 0, 0)", "undefined");
+ _assertSame(ctx.strokeText('test', 0, 0), undefined, "ctx.strokeText('test', 0, 0)", "undefined");
+}
+if (ctx.putImageData) {
+ _assertSame(ctx.putImageData(ctx.getImageData(0, 0, 1, 1), 0, 0), undefined, "ctx.putImageData(ctx.getImageData(0, 0, 1, 1), 0, 0)", "undefined");
+}
+_assertSame(ctx.drawImage(document.getElementById('yellow.png'), 0, 0, 1, 1, 0, 0, 0, 0), undefined, "ctx.drawImage(document.getElementById('yellow.png'), 0, 0, 1, 1, 0, 0, 0, 0)", "undefined");
+_assertSame(ctx.drawImage(canvas, 0, 0, 1, 1, 0, 0, 0, 0), undefined, "ctx.drawImage(canvas, 0, 0, 1, 1, 0, 0, 0, 0)", "undefined");
+_assertSame(ctx.createLinearGradient(0, 0, 0, 0).addColorStop(0, 'white'), undefined, "ctx.createLinearGradient(0, 0, 0, 0).addColorStop(0, 'white')", "undefined");
+
+
+});
+</script>
+<img src="../images/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/clear-100x50.png b/LayoutTests/fast/canvas/philip/tests/clear-100x50.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/clear-100x50.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/context.casesensitive.html b/LayoutTests/fast/canvas/philip/tests/context.casesensitive.html
new file mode 100644
index 0000000..1aa3f14
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/context.casesensitive.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: context.casesensitive</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="context.unrecognised.unicode.html" title="context.unrecognised.unicode">
+<link rel="next" href="toDataURL.default.html" title="toDataURL.default">
+<body class="show_output">
+<p>
+ <a href="context.unrecognised.unicode.html" accesskey="p" title="[p] context.unrecognised.unicode"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.default.html" accesskey="n" title="[n] toDataURL.default">></a>
+<h1><a href="index.context.html">context</a>.casesensitive</h1>
+<p class="desc">Context name "2D" is unrecognised; matching is case sensitive</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.context.casesensitive">context.casesensitive</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401788">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.getContext('2D'), null, "canvas.getContext('2D')", "null");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/context.emptystring.html b/LayoutTests/fast/canvas/philip/tests/context.emptystring.html
new file mode 100644
index 0000000..e8c027c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/context.emptystring.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: context.emptystring</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="initial.reset.pattern.html" title="initial.reset.pattern">
+<link rel="next" href="context.unrecognised.badname.html" title="context.unrecognised.badname">
+<body class="show_output">
+<p>
+ <a href="initial.reset.pattern.html" accesskey="p" title="[p] initial.reset.pattern"><</a>
+ <a href="index.html">[index]</a>
+ <a href="context.unrecognised.badname.html" accesskey="n" title="[n] context.unrecognised.badname">></a>
+<h1><a href="index.context.html">context</a>.emptystring</h1>
+<p class="desc">getContext with empty string returns null</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.context.empty">context.empty</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401788">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.getContext(""), null, "canvas.getContext(\"\")", "null");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/context.unrecognised.badname.html b/LayoutTests/fast/canvas/philip/tests/context.unrecognised.badname.html
new file mode 100644
index 0000000..9533e2f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/context.unrecognised.badname.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: context.unrecognised.badname</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="context.emptystring.html" title="context.emptystring">
+<link rel="next" href="context.unrecognised.badsuffix.html" title="context.unrecognised.badsuffix">
+<body class="show_output">
+<p>
+ <a href="context.emptystring.html" accesskey="p" title="[p] context.emptystring"><</a>
+ <a href="index.html">[index]</a>
+ <a href="context.unrecognised.badsuffix.html" accesskey="n" title="[n] context.unrecognised.badsuffix">></a>
+<h1><a href="index.context.html">context</a>.<a href="index.context.unrecognised.html">unrecognised</a>.badname</h1>
+<p class="desc">getContext with unrecognised context name returns null</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.context.unrecognised">context.unrecognised</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401788">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.getContext('This is not an implemented context in any real browser'), null, "canvas.getContext('This is not an implemented context in any real browser')", "null");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/context.unrecognised.badsuffix.html b/LayoutTests/fast/canvas/philip/tests/context.unrecognised.badsuffix.html
new file mode 100644
index 0000000..7f5ce6d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/context.unrecognised.badsuffix.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: context.unrecognised.badsuffix</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="context.unrecognised.badname.html" title="context.unrecognised.badname">
+<link rel="next" href="context.unrecognised.nullsuffix.html" title="context.unrecognised.nullsuffix">
+<body class="show_output">
+<p>
+ <a href="context.unrecognised.badname.html" accesskey="p" title="[p] context.unrecognised.badname"><</a>
+ <a href="index.html">[index]</a>
+ <a href="context.unrecognised.nullsuffix.html" accesskey="n" title="[n] context.unrecognised.nullsuffix">></a>
+<h1><a href="index.context.html">context</a>.<a href="index.context.unrecognised.html">unrecognised</a>.badsuffix</h1>
+<p class="desc">Context name "2d" plus a suffix is unrecognised</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.context.unrecognised">context.unrecognised</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401788">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.getContext("2d#"), null, "canvas.getContext(\"2d#\")", "null");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/context.unrecognised.nullsuffix.html b/LayoutTests/fast/canvas/philip/tests/context.unrecognised.nullsuffix.html
new file mode 100644
index 0000000..16174ed
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/context.unrecognised.nullsuffix.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: context.unrecognised.nullsuffix</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="context.unrecognised.badsuffix.html" title="context.unrecognised.badsuffix">
+<link rel="next" href="context.unrecognised.unicode.html" title="context.unrecognised.unicode">
+<body class="show_output">
+<p>
+ <a href="context.unrecognised.badsuffix.html" accesskey="p" title="[p] context.unrecognised.badsuffix"><</a>
+ <a href="index.html">[index]</a>
+ <a href="context.unrecognised.unicode.html" accesskey="n" title="[n] context.unrecognised.unicode">></a>
+<h1><a href="index.context.html">context</a>.<a href="index.context.unrecognised.html">unrecognised</a>.nullsuffix</h1>
+<p class="desc">Context name "2d" plus a "\0" suffix is unrecognised</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.context.unrecognised">context.unrecognised</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401788">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.getContext("2d\0"), null, "canvas.getContext(\"2d\\0\")", "null");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/context.unrecognised.unicode.html b/LayoutTests/fast/canvas/philip/tests/context.unrecognised.unicode.html
new file mode 100644
index 0000000..d182970
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/context.unrecognised.unicode.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: context.unrecognised.unicode</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="context.unrecognised.nullsuffix.html" title="context.unrecognised.nullsuffix">
+<link rel="next" href="context.casesensitive.html" title="context.casesensitive">
+<body class="show_output">
+<p>
+ <a href="context.unrecognised.nullsuffix.html" accesskey="p" title="[p] context.unrecognised.nullsuffix"><</a>
+ <a href="index.html">[index]</a>
+ <a href="context.casesensitive.html" accesskey="n" title="[n] context.casesensitive">></a>
+<h1><a href="index.context.html">context</a>.<a href="index.context.unrecognised.html">unrecognised</a>.unicode</h1>
+<p class="desc">Context name which kind of looks like "2d" is unrecognised</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.context.unrecognised">context.unrecognised</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401788">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.getContext("2\uFF44"), null, "canvas.getContext(\"2\\uFF44\")", "null"); // Fullwidth Latin Small Letter D
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/fallback.basic.html b/LayoutTests/fast/canvas/philip/tests/fallback.basic.html
new file mode 100644
index 0000000..1b8614d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/fallback.basic.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: fallback.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="index.html" title="index">
+<link rel="next" href="fallback.multiple.html" title="fallback.multiple">
+<body class="show_output">
+<p>
+ <a href="index.html" accesskey="p" title="[p] index"><</a>
+ <a href="index.html">[index]</a>
+ <a href="fallback.multiple.html" accesskey="n" title="[n] fallback.multiple">></a>
+<h1><a href="index.fallback.html">fallback</a>.basic</h1>
+<p class="desc">Fallback content is inserted into the DOM</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.fallback">fallback</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertEqual(canvas.childNodes.length, 1, "canvas.childNodes.length", "1");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/fallback.multiple.html b/LayoutTests/fast/canvas/philip/tests/fallback.multiple.html
new file mode 100644
index 0000000..ee7a16c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/fallback.multiple.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: fallback.multiple</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="fallback.basic.html" title="fallback.basic">
+<link rel="next" href="fallback.nested.html" title="fallback.nested">
+<body class="show_output">
+<p>
+ <a href="fallback.basic.html" accesskey="p" title="[p] fallback.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="fallback.nested.html" accesskey="n" title="[n] fallback.nested">></a>
+<h1><a href="index.fallback.html">fallback</a>.multiple</h1>
+<p class="desc">Fallback content with multiple elements</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.fallback">fallback</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL</p><p class="fallback">FAIL</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertEqual(canvas.childNodes.length, 2, "canvas.childNodes.length", "2");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/fallback.nested.html b/LayoutTests/fast/canvas/philip/tests/fallback.nested.html
new file mode 100644
index 0000000..2db3797
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/fallback.nested.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: fallback.nested</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="fallback.multiple.html" title="fallback.multiple">
+<link rel="next" href="type.name.html" title="type.name">
+<body class="show_output">
+<p>
+ <a href="fallback.multiple.html" accesskey="p" title="[p] fallback.multiple"><</a>
+ <a href="index.html">[index]</a>
+ <a href="type.name.html" accesskey="n" title="[n] type.name">></a>
+<h1><a href="index.fallback.html">fallback</a>.nested</h1>
+<p class="desc">Fallback content containing another canvas (mostly testing parsers)</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.fallback">fallback</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><canvas><p class="fallback">FAIL (fallback content)</p></canvas><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertEqual(canvas.childNodes.length, 2, "canvas.childNodes.length", "2");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/green-100x50.png b/LayoutTests/fast/canvas/philip/tests/green-100x50.png
new file mode 100644
index 0000000..2b7577d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/green-100x50.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/initial.colour.html b/LayoutTests/fast/canvas/philip/tests/initial.colour.html
new file mode 100644
index 0000000..fbd3e82
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/initial.colour.html
@@ -0,0 +1,36 @@
+<!DOCTYPE html>
+<title>Canvas test: initial.colour</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.style.html" title="size.attributes.style">
+<link rel="next" href="initial.reset.different.html" title="initial.reset.different">
+<body class="show_output">
+<p>
+ <a href="size.attributes.style.html" accesskey="p" title="[p] size.attributes.style"><</a>
+ <a href="index.html">[index]</a>
+ <a href="initial.reset.different.html" accesskey="n" title="[n] initial.reset.different">></a>
+<h1><a href="index.initial.html">initial</a>.colour</h1>
+<p class="desc">Initial state is transparent black</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.initial.colour">initial.colour</a>
+
+</ul>
+</div>
+<p class="notes">Output should be transparent black (not transparent anything-else), but manual
+verification can only confirm that it's transparent - it's not possible to make
+the actual blackness visible.
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="initial.colour.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/initial.colour.png b/LayoutTests/fast/canvas/philip/tests/initial.colour.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/initial.colour.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/initial.reset.2dstate.html b/LayoutTests/fast/canvas/philip/tests/initial.reset.2dstate.html
new file mode 100644
index 0000000..08ad0fd
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/initial.reset.2dstate.html
@@ -0,0 +1,109 @@
+<!DOCTYPE html>
+<title>Canvas test: initial.reset.2dstate</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="2d.state.saverestore.textBaseline.html" title="2d.state.saverestore.textBaseline">
+<link rel="next" href="2d.state.saverestore.transformation.html" title="2d.state.saverestore.transformation">
+<body class="show_output">
+<p>
+ <a href="2d.state.saverestore.textBaseline.html" accesskey="p" title="[p] 2d.state.saverestore.textBaseline"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.state.saverestore.transformation.html" accesskey="n" title="[n] 2d.state.saverestore.transformation">></a>
+<h1><a href="index.initial.html">initial</a>.<a href="index.initial.reset.html">reset</a>.2dstate</h1>
+<p class="desc">Resetting the canvas state resets 2D state variables</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.initial.reset">initial.reset</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = 100;
+var default_val;
+
+default_val = ctx.strokeStyle;
+ctx.strokeStyle = "#ff0000";
+canvas.width = 100;
+_assertSame(ctx.strokeStyle, default_val, "ctx.strokeStyle", "default_val");
+
+default_val = ctx.fillStyle;
+ctx.fillStyle = "#ff0000";
+canvas.width = 100;
+_assertSame(ctx.fillStyle, default_val, "ctx.fillStyle", "default_val");
+
+default_val = ctx.globalAlpha;
+ctx.globalAlpha = 0.5;
+canvas.width = 100;
+_assertSame(ctx.globalAlpha, default_val, "ctx.globalAlpha", "default_val");
+
+default_val = ctx.lineWidth;
+ctx.lineWidth = 0.5;
+canvas.width = 100;
+_assertSame(ctx.lineWidth, default_val, "ctx.lineWidth", "default_val");
+
+default_val = ctx.lineCap;
+ctx.lineCap = "round";
+canvas.width = 100;
+_assertSame(ctx.lineCap, default_val, "ctx.lineCap", "default_val");
+
+default_val = ctx.lineJoin;
+ctx.lineJoin = "round";
+canvas.width = 100;
+_assertSame(ctx.lineJoin, default_val, "ctx.lineJoin", "default_val");
+
+default_val = ctx.miterLimit;
+ctx.miterLimit = 0.5;
+canvas.width = 100;
+_assertSame(ctx.miterLimit, default_val, "ctx.miterLimit", "default_val");
+
+default_val = ctx.shadowOffsetX;
+ctx.shadowOffsetX = 5;
+canvas.width = 100;
+_assertSame(ctx.shadowOffsetX, default_val, "ctx.shadowOffsetX", "default_val");
+
+default_val = ctx.shadowOffsetY;
+ctx.shadowOffsetY = 5;
+canvas.width = 100;
+_assertSame(ctx.shadowOffsetY, default_val, "ctx.shadowOffsetY", "default_val");
+
+default_val = ctx.shadowBlur;
+ctx.shadowBlur = 5;
+canvas.width = 100;
+_assertSame(ctx.shadowBlur, default_val, "ctx.shadowBlur", "default_val");
+
+default_val = ctx.shadowColor;
+ctx.shadowColor = "#ff0000";
+canvas.width = 100;
+_assertSame(ctx.shadowColor, default_val, "ctx.shadowColor", "default_val");
+
+default_val = ctx.globalCompositeOperation;
+ctx.globalCompositeOperation = "copy";
+canvas.width = 100;
+_assertSame(ctx.globalCompositeOperation, default_val, "ctx.globalCompositeOperation", "default_val");
+
+default_val = ctx.font;
+ctx.font = "25px serif";
+canvas.width = 100;
+_assertSame(ctx.font, default_val, "ctx.font", "default_val");
+
+default_val = ctx.textAlign;
+ctx.textAlign = "center";
+canvas.width = 100;
+_assertSame(ctx.textAlign, default_val, "ctx.textAlign", "default_val");
+
+default_val = ctx.textBaseline;
+ctx.textBaseline = "bottom";
+canvas.width = 100;
+_assertSame(ctx.textBaseline, default_val, "ctx.textBaseline", "default_val");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/initial.reset.clip.html b/LayoutTests/fast/canvas/philip/tests/initial.reset.clip.html
new file mode 100644
index 0000000..6332178
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/initial.reset.clip.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<title>Canvas test: initial.reset.clip</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="initial.reset.path.html" title="initial.reset.path">
+<link rel="next" href="initial.reset.transform.html" title="initial.reset.transform">
+<body class="show_output">
+<p>
+ <a href="initial.reset.path.html" accesskey="p" title="[p] initial.reset.path"><</a>
+ <a href="index.html">[index]</a>
+ <a href="initial.reset.transform.html" accesskey="n" title="[n] initial.reset.transform">></a>
+<h1><a href="index.initial.html">initial</a>.<a href="index.initial.reset.html">reset</a>.clip</h1>
+<p class="desc">Resetting the canvas state resets the current clip region</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.initial.reset">initial.reset</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = 100;
+ctx.rect(0, 0, 1, 1);
+ctx.clip();
+canvas.width = 100;
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 20,20, 0,255,0,255, "20,20", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/initial.reset.different.html b/LayoutTests/fast/canvas/philip/tests/initial.reset.different.html
new file mode 100644
index 0000000..1effaad
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/initial.reset.different.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: initial.reset.different</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="initial.colour.html" title="initial.colour">
+<link rel="next" href="initial.reset.same.html" title="initial.reset.same">
+<body class="show_output">
+<p>
+ <a href="initial.colour.html" accesskey="p" title="[p] initial.colour"><</a>
+ <a href="index.html">[index]</a>
+ <a href="initial.reset.same.html" accesskey="n" title="[n] initial.reset.same">></a>
+<h1><a href="index.initial.html">initial</a>.<a href="index.initial.reset.html">reset</a>.different</h1>
+<p class="desc">Changing size resets canvas to transparent black</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.initial.reset">initial.reset</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="initial.reset.different.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 20,20, 255,0,0,255, "20,20", "255,0,0,255");
+canvas.width = 50;
+_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/initial.reset.different.png b/LayoutTests/fast/canvas/philip/tests/initial.reset.different.png
new file mode 100644
index 0000000..d83fdd5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/initial.reset.different.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/initial.reset.gradient.html b/LayoutTests/fast/canvas/philip/tests/initial.reset.gradient.html
new file mode 100644
index 0000000..d8585af
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/initial.reset.gradient.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: initial.reset.gradient</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="initial.reset.transform.html" title="initial.reset.transform">
+<link rel="next" href="initial.reset.pattern.html" title="initial.reset.pattern">
+<body class="show_output">
+<p>
+ <a href="initial.reset.transform.html" accesskey="p" title="[p] initial.reset.transform"><</a>
+ <a href="index.html">[index]</a>
+ <a href="initial.reset.pattern.html" accesskey="n" title="[n] initial.reset.pattern">></a>
+<h1><a href="index.initial.html">initial</a>.<a href="index.initial.reset.html">reset</a>.gradient</h1>
+<p class="desc">Resetting the canvas state does not invalidate any existing gradients</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.initial.reset">initial.reset</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = 50;
+var g = ctx.createLinearGradient(0, 0, 100, 0);
+g.addColorStop(0, '#0f0');
+g.addColorStop(1, '#0f0');
+canvas.width = 100;
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = g;
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/initial.reset.path.html b/LayoutTests/fast/canvas/philip/tests/initial.reset.path.html
new file mode 100644
index 0000000..76b6f70
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/initial.reset.path.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: initial.reset.path</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="initial.reset.same.html" title="initial.reset.same">
+<link rel="next" href="initial.reset.clip.html" title="initial.reset.clip">
+<body class="show_output">
+<p>
+ <a href="initial.reset.same.html" accesskey="p" title="[p] initial.reset.same"><</a>
+ <a href="index.html">[index]</a>
+ <a href="initial.reset.clip.html" accesskey="n" title="[n] initial.reset.clip">></a>
+<h1><a href="index.initial.html">initial</a>.<a href="index.initial.reset.html">reset</a>.path</h1>
+<p class="desc">Resetting the canvas state resets the current path</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.initial.reset">initial.reset</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="initial.reset.path.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = 100;
+ctx.rect(0, 0, 100, 50);
+canvas.width = 100;
+ctx.fillStyle = '#f00';
+ctx.fill();
+_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/initial.reset.path.png b/LayoutTests/fast/canvas/philip/tests/initial.reset.path.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/initial.reset.path.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/initial.reset.pattern.html b/LayoutTests/fast/canvas/philip/tests/initial.reset.pattern.html
new file mode 100644
index 0000000..cbf078a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/initial.reset.pattern.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: initial.reset.pattern</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="initial.reset.gradient.html" title="initial.reset.gradient">
+<link rel="next" href="context.emptystring.html" title="context.emptystring">
+<body class="show_output">
+<p>
+ <a href="initial.reset.gradient.html" accesskey="p" title="[p] initial.reset.gradient"><</a>
+ <a href="index.html">[index]</a>
+ <a href="context.emptystring.html" accesskey="n" title="[n] context.emptystring">></a>
+<h1><a href="index.initial.html">initial</a>.<a href="index.initial.reset.html">reset</a>.pattern</h1>
+<p class="desc">Resetting the canvas state does not invalidate any existing patterns</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.initial.reset">initial.reset</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = 30;
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 30, 50);
+var p = ctx.createPattern(canvas, 'repeat-x');
+canvas.width = 100;
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = p;
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/initial.reset.same.html b/LayoutTests/fast/canvas/philip/tests/initial.reset.same.html
new file mode 100644
index 0000000..84e66f5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/initial.reset.same.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: initial.reset.same</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="initial.reset.different.html" title="initial.reset.different">
+<link rel="next" href="initial.reset.path.html" title="initial.reset.path">
+<body class="show_output">
+<p>
+ <a href="initial.reset.different.html" accesskey="p" title="[p] initial.reset.different"><</a>
+ <a href="index.html">[index]</a>
+ <a href="initial.reset.path.html" accesskey="n" title="[n] initial.reset.path">></a>
+<h1><a href="index.initial.html">initial</a>.<a href="index.initial.reset.html">reset</a>.same</h1>
+<p class="desc">Setting size (not changing the value) resets canvas to transparent black</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.initial.reset">initial.reset</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="initial.reset.same.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = 100;
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 50, 50);
+_assertPixel(canvas, 20,20, 255,0,0,255, "20,20", "255,0,0,255");
+canvas.width = 100;
+_assertPixel(canvas, 20,20, 0,0,0,0, "20,20", "0,0,0,0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/initial.reset.same.png b/LayoutTests/fast/canvas/philip/tests/initial.reset.same.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/initial.reset.same.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/initial.reset.transform.html b/LayoutTests/fast/canvas/philip/tests/initial.reset.transform.html
new file mode 100644
index 0000000..6b8187d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/initial.reset.transform.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: initial.reset.transform</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="initial.reset.clip.html" title="initial.reset.clip">
+<link rel="next" href="initial.reset.gradient.html" title="initial.reset.gradient">
+<body class="show_output">
+<p>
+ <a href="initial.reset.clip.html" accesskey="p" title="[p] initial.reset.clip"><</a>
+ <a href="index.html">[index]</a>
+ <a href="initial.reset.gradient.html" accesskey="n" title="[n] initial.reset.gradient">></a>
+<h1><a href="index.initial.html">initial</a>.<a href="index.initial.reset.html">reset</a>.transform</h1>
+<p class="desc">Resetting the canvas state resets the current transformation matrix</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.initial.reset">initial.reset</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = 100;
+ctx.scale(0.1, 0.1);
+canvas.width = 100;
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+_assertPixel(canvas, 20,20, 0,255,0,255, "20,20", "0,255,0,255");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/security.dataURI.html b/LayoutTests/fast/canvas/philip/tests/security.dataURI.html
new file mode 100644
index 0000000..659adcf
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/security.dataURI.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<title>Canvas test: security.dataURI</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="security.pattern.canvas.strokeStyle.html" title="security.pattern.canvas.strokeStyle">
+<link rel="next" href="security.reset.html" title="security.reset">
+<body class="show_output">
+<p>
+ <a href="security.pattern.canvas.strokeStyle.html" accesskey="p" title="[p] security.pattern.canvas.strokeStyle"><</a>
+ <a href="index.html">[index]</a>
+ <a href="security.reset.html" accesskey="n" title="[n] security.reset">></a>
+<h1><a href="index.security.html">security</a>.dataURI</h1>
+<p class="desc">data: URIs do not count as different-origin, and do not taint the canvas</p>
+<div class="refs">References:
+<ul>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=417836">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="green-100x50.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 100, 50);
+var data = canvas.toDataURL();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+var img = new Image();
+deferTest();
+img.onload = wrapFunction(function ()
+{
+ ctx.drawImage(img, 0, 0);
+ canvas.toDataURL(); // should be permitted
+ _assertPixel(canvas, 50,25, 0,255,0,255, "50,25", "0,255,0,255");
+});
+img.src = data;
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/security.drawImage.canvas.html b/LayoutTests/fast/canvas/philip/tests/security.drawImage.canvas.html
new file mode 100644
index 0000000..2eb9466
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/security.drawImage.canvas.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: security.drawImage.canvas</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="security.drawImage.image.html" title="security.drawImage.image">
+<link rel="next" href="security.pattern.create.html" title="security.pattern.create">
+<body class="show_output">
+<p>
+ <a href="security.drawImage.image.html" accesskey="p" title="[p] security.drawImage.image"><</a>
+ <a href="index.html">[index]</a>
+ <a href="security.pattern.create.html" accesskey="n" title="[n] security.pattern.create">></a>
+<h1><a href="index.security.html">security</a>.<a href="index.security.drawImage.html">drawImage</a>.canvas</h1>
+<p class="desc">drawImage of unclean canvas makes the canvas origin-unclean</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.security.drawImage.canvas">security.drawImage.canvas</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow.png'), 0, 0);
+ctx.drawImage(canvas2, 0, 0);
+try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); }
+try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); }
+
+
+});
+</script>
+<img src="http://excors.googlepages.com/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/security.drawImage.image.html b/LayoutTests/fast/canvas/philip/tests/security.drawImage.image.html
new file mode 100644
index 0000000..271380e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/security.drawImage.image.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: security.drawImage.image</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.jpeg.quality.outsiderange.html" title="toDataURL.jpeg.quality.outsiderange">
+<link rel="next" href="security.drawImage.canvas.html" title="security.drawImage.canvas">
+<body class="show_output">
+<p>
+ <a href="toDataURL.jpeg.quality.outsiderange.html" accesskey="p" title="[p] toDataURL.jpeg.quality.outsiderange"><</a>
+ <a href="index.html">[index]</a>
+ <a href="security.drawImage.canvas.html" accesskey="n" title="[n] security.drawImage.canvas">></a>
+<h1><a href="index.security.html">security</a>.<a href="index.security.drawImage.html">drawImage</a>.image</h1>
+<p class="desc">drawImage of different-origin image makes the canvas origin-unclean</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.security.drawImage.image">security.drawImage.image</a>
+<li><a href="spec.html#testrefs.security.toDataURL">security.toDataURL</a>
+<li><a href="spec.html#testrefs.security.getImageData">security.getImageData</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.drawImage(document.getElementById('yellow.png'), 0, 0);
+try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); }
+try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); }
+
+
+});
+</script>
+<img src="http://excors.googlepages.com/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/security.pattern.canvas.fillStyle.html b/LayoutTests/fast/canvas/philip/tests/security.pattern.canvas.fillStyle.html
new file mode 100644
index 0000000..cadd8ce
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/security.pattern.canvas.fillStyle.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: security.pattern.canvas.fillStyle</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="security.pattern.image.fillStyle.html" title="security.pattern.image.fillStyle">
+<link rel="next" href="security.pattern.image.strokeStyle.html" title="security.pattern.image.strokeStyle">
+<body class="show_output">
+<p>
+ <a href="security.pattern.image.fillStyle.html" accesskey="p" title="[p] security.pattern.image.fillStyle"><</a>
+ <a href="index.html">[index]</a>
+ <a href="security.pattern.image.strokeStyle.html" accesskey="n" title="[n] security.pattern.image.strokeStyle">></a>
+<h1><a href="index.security.html">security</a>.<a href="index.security.pattern.html">pattern</a>.<a href="index.security.pattern.canvas.html">canvas</a>.fillStyle</h1>
+<p class="desc">Setting fillStyle to a pattern of an unclean canvas makes the canvas origin-unclean</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.security.fillStyle.canvas">security.fillStyle.canvas</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=354127">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow.png'), 0, 0);
+var p = ctx.createPattern(canvas2, 'repeat');
+ctx.fillStyle = p;
+ctx.fillStyle = 'red';
+try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); }
+try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); }
+
+
+});
+</script>
+<img src="http://excors.googlepages.com/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/security.pattern.canvas.strokeStyle.html b/LayoutTests/fast/canvas/philip/tests/security.pattern.canvas.strokeStyle.html
new file mode 100644
index 0000000..847645d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/security.pattern.canvas.strokeStyle.html
@@ -0,0 +1,43 @@
+<!DOCTYPE html>
+<title>Canvas test: security.pattern.canvas.strokeStyle</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="security.pattern.image.strokeStyle.html" title="security.pattern.image.strokeStyle">
+<link rel="next" href="security.dataURI.html" title="security.dataURI">
+<body class="show_output">
+<p>
+ <a href="security.pattern.image.strokeStyle.html" accesskey="p" title="[p] security.pattern.image.strokeStyle"><</a>
+ <a href="index.html">[index]</a>
+ <a href="security.dataURI.html" accesskey="n" title="[n] security.dataURI">></a>
+<h1><a href="index.security.html">security</a>.<a href="index.security.pattern.html">pattern</a>.<a href="index.security.pattern.canvas.html">canvas</a>.strokeStyle</h1>
+<p class="desc">Setting strokeStyle to a pattern of an unclean canvas makes the canvas origin-unclean</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.security.strokeStyle.canvas">security.strokeStyle.canvas</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=354127">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.drawImage(document.getElementById('yellow.png'), 0, 0);
+var p = ctx.createPattern(canvas2, 'repeat');
+ctx.strokeStyle = p;
+ctx.strokeStyle = 'red';
+try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); }
+try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); }
+
+
+});
+</script>
+<img src="http://excors.googlepages.com/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/security.pattern.canvas.timing.html b/LayoutTests/fast/canvas/philip/tests/security.pattern.canvas.timing.html
new file mode 100644
index 0000000..6d54797
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/security.pattern.canvas.timing.html
@@ -0,0 +1,47 @@
+<!DOCTYPE html>
+<title>Canvas test: security.pattern.canvas.timing</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="security.pattern.cross.html" title="security.pattern.cross">
+<link rel="next" href="security.pattern.image.fillStyle.html" title="security.pattern.image.fillStyle">
+<body class="show_output">
+<p>
+ <a href="security.pattern.cross.html" accesskey="p" title="[p] security.pattern.cross"><</a>
+ <a href="index.html">[index]</a>
+ <a href="security.pattern.image.fillStyle.html" accesskey="n" title="[n] security.pattern.image.fillStyle">></a>
+<h1><a href="index.security.html">security</a>.<a href="index.security.pattern.html">pattern</a>.<a href="index.security.pattern.canvas.html">canvas</a>.timing</h1>
+<p class="desc">Pattern safety depends on whether the source was origin-clean, not on whether it still is clean</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.security.start">security.start</a>
+<li><a href="spec.html#testrefs.security.fillStyle.canvas">security.fillStyle.canvas</a>
+
+</ul>
+</div>
+<p class="notes">Disagrees with spec on "is" vs "was"
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+ctx2.fillStyle = '#0f0';
+ctx2.fillRect(0, 0, 100, 50);
+var p = ctx.createPattern(canvas2, 'repeat');
+ctx2.drawImage(document.getElementById('yellow.png'), 0, 0); // make canvas2 origin-unclean
+ctx.fillStyle = p;
+ctx.fillRect(0, 0, 100, 50);
+canvas.toDataURL();
+ctx.getImageData(0, 0, 1, 1);
+_assert(true, "true"); // okay if there was no exception
+
+
+});
+</script>
+<img src="http://excors.googlepages.com/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/security.pattern.create.html b/LayoutTests/fast/canvas/philip/tests/security.pattern.create.html
new file mode 100644
index 0000000..9bbd225
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/security.pattern.create.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: security.pattern.create</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="security.drawImage.canvas.html" title="security.drawImage.canvas">
+<link rel="next" href="security.pattern.cross.html" title="security.pattern.cross">
+<body class="show_output">
+<p>
+ <a href="security.drawImage.canvas.html" accesskey="p" title="[p] security.drawImage.canvas"><</a>
+ <a href="index.html">[index]</a>
+ <a href="security.pattern.cross.html" accesskey="n" title="[n] security.pattern.cross">></a>
+<h1><a href="index.security.html">security</a>.<a href="index.security.pattern.html">pattern</a>.create</h1>
+<p class="desc">Creating an unclean pattern does not make the canvas origin-unclean</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.security.start">security.start</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat');
+canvas.toDataURL();
+ctx.getImageData(0, 0, 1, 1);
+_assert(true, "true"); // okay if there was no exception
+
+
+});
+</script>
+<img src="http://excors.googlepages.com/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/security.pattern.cross.html b/LayoutTests/fast/canvas/philip/tests/security.pattern.cross.html
new file mode 100644
index 0000000..c632f03
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/security.pattern.cross.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<title>Canvas test: security.pattern.cross</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="security.pattern.create.html" title="security.pattern.create">
+<link rel="next" href="security.pattern.canvas.timing.html" title="security.pattern.canvas.timing">
+<body class="show_output">
+<p>
+ <a href="security.pattern.create.html" accesskey="p" title="[p] security.pattern.create"><</a>
+ <a href="index.html">[index]</a>
+ <a href="security.pattern.canvas.timing.html" accesskey="n" title="[n] security.pattern.canvas.timing">></a>
+<h1><a href="index.security.html">security</a>.<a href="index.security.pattern.html">pattern</a>.cross</h1>
+<p class="desc">Using an unclean pattern makes the target canvas origin-unclean, not the pattern canvas</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.security.start">security.start</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+canvas2.width = 100;
+canvas2.height = 50;
+var ctx2 = canvas2.getContext('2d');
+var p = ctx2.createPattern(document.getElementById('yellow.png'), 'repeat');
+ctx.fillStyle = p;
+ctx.fillRect(0, 0, 100, 50);
+try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); }
+try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); }
+canvas2.toDataURL();
+ctx2.getImageData(0, 0, 1, 1);
+
+
+});
+</script>
+<img src="http://excors.googlepages.com/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/security.pattern.image.fillStyle.html b/LayoutTests/fast/canvas/philip/tests/security.pattern.image.fillStyle.html
new file mode 100644
index 0000000..450bc6d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/security.pattern.image.fillStyle.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: security.pattern.image.fillStyle</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="security.pattern.canvas.timing.html" title="security.pattern.canvas.timing">
+<link rel="next" href="security.pattern.canvas.fillStyle.html" title="security.pattern.canvas.fillStyle">
+<body class="show_output">
+<p>
+ <a href="security.pattern.canvas.timing.html" accesskey="p" title="[p] security.pattern.canvas.timing"><</a>
+ <a href="index.html">[index]</a>
+ <a href="security.pattern.canvas.fillStyle.html" accesskey="n" title="[n] security.pattern.canvas.fillStyle">></a>
+<h1><a href="index.security.html">security</a>.<a href="index.security.pattern.html">pattern</a>.<a href="index.security.pattern.image.html">image</a>.fillStyle</h1>
+<p class="desc">Setting fillStyle to a pattern of a different-origin image makes the canvas origin-unclean</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.security.fillStyle.image">security.fillStyle.image</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat');
+ctx.fillStyle = p;
+ctx.fillStyle = 'red';
+try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); }
+try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); }
+
+
+});
+</script>
+<img src="http://excors.googlepages.com/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/security.pattern.image.strokeStyle.html b/LayoutTests/fast/canvas/philip/tests/security.pattern.image.strokeStyle.html
new file mode 100644
index 0000000..b21bf67
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/security.pattern.image.strokeStyle.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: security.pattern.image.strokeStyle</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="security.pattern.canvas.fillStyle.html" title="security.pattern.canvas.fillStyle">
+<link rel="next" href="security.pattern.canvas.strokeStyle.html" title="security.pattern.canvas.strokeStyle">
+<body class="show_output">
+<p>
+ <a href="security.pattern.canvas.fillStyle.html" accesskey="p" title="[p] security.pattern.canvas.fillStyle"><</a>
+ <a href="index.html">[index]</a>
+ <a href="security.pattern.canvas.strokeStyle.html" accesskey="n" title="[n] security.pattern.canvas.strokeStyle">></a>
+<h1><a href="index.security.html">security</a>.<a href="index.security.pattern.html">pattern</a>.<a href="index.security.pattern.image.html">image</a>.strokeStyle</h1>
+<p class="desc">Setting strokeStyle to a pattern of a different-origin image makes the canvas origin-unclean</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.security.strokeStyle.image">security.strokeStyle.image</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var p = ctx.createPattern(document.getElementById('yellow.png'), 'repeat');
+ctx.strokeStyle = p;
+ctx.strokeStyle = 'red';
+try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); }
+try { var _thrown = false; ctx.getImageData(0, 0, 1, 1); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: ctx.getImageData(0, 0, 1, 1)"); }
+
+
+});
+</script>
+<img src="http://excors.googlepages.com/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/security.reset.html b/LayoutTests/fast/canvas/philip/tests/security.reset.html
new file mode 100644
index 0000000..7cf12a0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/security.reset.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: security.reset</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="security.dataURI.html" title="security.dataURI">
+<link rel="next" href="2d.getcontext.exists.html" title="2d.getcontext.exists">
+<body class="show_output">
+<p>
+ <a href="security.dataURI.html" accesskey="p" title="[p] security.dataURI"><</a>
+ <a href="index.html">[index]</a>
+ <a href="2d.getcontext.exists.html" accesskey="n" title="[n] 2d.getcontext.exists">></a>
+<h1><a href="index.security.html">security</a>.reset</h1>
+<p class="desc">Resetting the canvas state does not reset the origin-clean flag</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.initial.reset">initial.reset</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = 50;
+ctx.drawImage(document.getElementById('yellow.png'), 0, 0);
+try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); }
+canvas.width = 100;
+try { var _thrown = false; canvas.toDataURL(); } catch (e) { _thrown = true; } finally { _assert(_thrown, "should throw exception: canvas.toDataURL()"); }
+
+
+});
+</script>
+<img src="http://excors.googlepages.com/yellow.png" id="yellow.png" class="resource">
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.default.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.default.html
new file mode 100644
index 0000000..c7a49a4
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.default.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.default</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.idl.html" title="size.attributes.idl">
+<link rel="next" href="size.attributes.reflect.setidl.html" title="size.attributes.reflect.setidl">
+<body class="show_output">
+<p>
+ <a href="size.attributes.idl.html" accesskey="p" title="[p] size.attributes.idl"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.reflect.setidl.html" accesskey="n" title="[n] size.attributes.reflect.setidl">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.default</h1>
+<p class="desc">Default width/height when attributes are missing</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.default">size.default</a>
+<li><a href="spec.html#testrefs.size.missing">size.missing</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" ><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.default.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+_assert(!canvas.hasAttribute('width'), "!canvas.hasAttribute('width')");
+_assert(!canvas.hasAttribute('height'), "!canvas.hasAttribute('height')");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.default.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.default.png
new file mode 100644
index 0000000..a72d047
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.default.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.get.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.get.html
new file mode 100644
index 0000000..fe53cc7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.get.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.get</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="type.extend.html" title="type.extend">
+<link rel="next" href="size.attributes.set.html" title="size.attributes.set">
+<body class="show_output">
+<p>
+ <a href="type.extend.html" accesskey="p" title="[p] type.extend"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.set.html" accesskey="n" title="[n] size.attributes.set">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.get</h1>
+<p class="desc">Getting width/height IDL/content attributes</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.width">size.width</a>
+<li><a href="spec.html#testrefs.size.height">size.height</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="120" height="60"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.get.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 120, "canvas.width", "120");
+_assertSame(canvas.height, 60, "canvas.height", "60");
+_assertSame(canvas.getAttribute('width'), '120', "canvas.getAttribute('width')", "'120'");
+_assertSame(canvas.getAttribute('height'), '60', "canvas.getAttribute('height')", "'60'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.get.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.get.png
new file mode 100644
index 0000000..47830c8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.get.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.idl.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.idl.html
new file mode 100644
index 0000000..8dfdaed
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.idl.html
@@ -0,0 +1,57 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.idl</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.idl.set.zero.html" title="size.attributes.idl.set.zero">
+<link rel="next" href="size.attributes.default.html" title="size.attributes.default">
+<body class="show_output">
+<p>
+ <a href="size.attributes.idl.set.zero.html" accesskey="p" title="[p] size.attributes.idl.set.zero"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.default.html" accesskey="n" title="[n] size.attributes.default">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.idl</h1>
+<p class="desc">Getting/setting width/height IDL attributes</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.width">size.width</a>
+<li><a href="spec.html#testrefs.size.height">size.height</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = "100";
+canvas.height = "100";
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+
+canvas.width = "+1.5e2";
+canvas.height = "0x96";
+_assertSame(canvas.width, 150, "canvas.width", "150");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+
+canvas.width = 200 - Math.pow(2, 32);
+canvas.height = 200 - Math.pow(2, 32);
+_assertSame(canvas.width, 200, "canvas.width", "200");
+_assertSame(canvas.height, 200, "canvas.height", "200");
+
+canvas.width = 301.999;
+canvas.height = 301.001;
+_assertSame(canvas.width, 301, "canvas.width", "301");
+_assertSame(canvas.height, 301, "canvas.height", "301");
+
+canvas.width = "400x";
+canvas.height = "foo";
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.idl.set.zero.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.idl.set.zero.html
new file mode 100644
index 0000000..4046b12
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.idl.set.zero.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.idl.set.zero</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.set.html" title="size.attributes.set">
+<link rel="next" href="size.attributes.idl.html" title="size.attributes.idl">
+<body class="show_output">
+<p>
+ <a href="size.attributes.set.html" accesskey="p" title="[p] size.attributes.set"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.idl.html" accesskey="n" title="[n] size.attributes.idl">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.idl.html">idl</a>.<a href="index.size.attributes.idl.set.html">set</a>.zero</h1>
+<p class="desc">Setting width/height IDL attributes to 0</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.width">size.width</a>
+<li><a href="spec.html#testrefs.size.height">size.height</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = 0;
+canvas.height = 0;
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.decimal.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.decimal.html
new file mode 100644
index 0000000..7344725
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.decimal.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.parse.decimal</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.parse.exp.html" title="size.attributes.parse.exp">
+<link rel="next" href="size.attributes.parse.percent.html" title="size.attributes.parse.percent">
+<body class="show_output">
+<p>
+ <a href="size.attributes.parse.exp.html" accesskey="p" title="[p] size.attributes.parse.exp"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.parse.percent.html" accesskey="n" title="[n] size.attributes.parse.percent">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.parse.html">parse</a>.decimal</h1>
+<p class="desc">Parsing of non-negative integers</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100.999" height="100.999"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.decimal.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.decimal.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.decimal.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.decimal.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.em.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.em.html
new file mode 100644
index 0000000..e88c0d9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.em.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.parse.em</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.parse.percent.html" title="size.attributes.parse.percent">
+<link rel="next" href="size.attributes.parse.junk.html" title="size.attributes.parse.junk">
+<body class="show_output">
+<p>
+ <a href="size.attributes.parse.percent.html" accesskey="p" title="[p] size.attributes.parse.percent"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.parse.junk.html" accesskey="n" title="[n] size.attributes.parse.junk">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.parse.html">parse</a>.em</h1>
+<p class="desc">Parsing of non-negative integers</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100em" height="100em"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.em.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.em.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.em.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.em.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.empty.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.empty.html
new file mode 100644
index 0000000..bcad3ca
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.empty.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.parse.empty</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.parse.zero.html" title="size.attributes.parse.zero">
+<link rel="next" href="size.attributes.parse.onlyspace.html" title="size.attributes.parse.onlyspace">
+<body class="show_output">
+<p>
+ <a href="size.attributes.parse.zero.html" accesskey="p" title="[p] size.attributes.parse.zero"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.parse.onlyspace.html" accesskey="n" title="[n] size.attributes.parse.onlyspace">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.parse.html">parse</a>.empty</h1>
+<p class="desc">Parsing of non-negative integers</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+<li><a href="spec.html#testrefs.size.error">size.error</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="" height=""><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.empty.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.empty.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.empty.png
new file mode 100644
index 0000000..a72d047
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.empty.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.exp.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.exp.html
new file mode 100644
index 0000000..0148af6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.exp.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.parse.exp</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.parse.hex.html" title="size.attributes.parse.hex">
+<link rel="next" href="size.attributes.parse.decimal.html" title="size.attributes.parse.decimal">
+<body class="show_output">
+<p>
+ <a href="size.attributes.parse.hex.html" accesskey="p" title="[p] size.attributes.parse.hex"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.parse.decimal.html" accesskey="n" title="[n] size.attributes.parse.decimal">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.parse.html">parse</a>.exp</h1>
+<p class="desc">Parsing of non-negative integers</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100e1" height="100e1"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.exp.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.exp.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.exp.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.exp.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.hex.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.hex.html
new file mode 100644
index 0000000..41e9721
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.hex.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.parse.hex</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.parse.octal.html" title="size.attributes.parse.octal">
+<link rel="next" href="size.attributes.parse.exp.html" title="size.attributes.parse.exp">
+<body class="show_output">
+<p>
+ <a href="size.attributes.parse.octal.html" accesskey="p" title="[p] size.attributes.parse.octal"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.parse.exp.html" accesskey="n" title="[n] size.attributes.parse.exp">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.parse.html">parse</a>.hex</h1>
+<p class="desc">Parsing of non-negative integers</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="0x100" height="0x100"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.junk.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.junk.html
new file mode 100644
index 0000000..448705c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.junk.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.parse.junk</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.parse.em.html" title="size.attributes.parse.em">
+<link rel="next" href="size.attributes.parse.trailingjunk.html" title="size.attributes.parse.trailingjunk">
+<body class="show_output">
+<p>
+ <a href="size.attributes.parse.em.html" accesskey="p" title="[p] size.attributes.parse.em"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.parse.trailingjunk.html" accesskey="n" title="[n] size.attributes.parse.trailingjunk">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.parse.html">parse</a>.junk</h1>
+<p class="desc">Parsing of non-negative integers</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+<li><a href="spec.html#testrefs.size.error">size.error</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="#!?" height="#!?"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.junk.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.junk.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.junk.png
new file mode 100644
index 0000000..a72d047
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.junk.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.minus.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.minus.html
new file mode 100644
index 0000000..6477690
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.minus.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.parse.minus</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.parse.plus.html" title="size.attributes.parse.plus">
+<link rel="next" href="size.attributes.parse.octal.html" title="size.attributes.parse.octal">
+<body class="show_output">
+<p>
+ <a href="size.attributes.parse.plus.html" accesskey="p" title="[p] size.attributes.parse.plus"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.parse.octal.html" accesskey="n" title="[n] size.attributes.parse.octal">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.parse.html">parse</a>.minus</h1>
+<p class="desc">Parsing of non-negative integers</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+<li><a href="spec.html#testrefs.size.error">size.error</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="-100" height="-100"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.minus.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.minus.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.minus.png
new file mode 100644
index 0000000..a72d047
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.minus.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.octal.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.octal.html
new file mode 100644
index 0000000..14f04ea
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.octal.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.parse.octal</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.parse.minus.html" title="size.attributes.parse.minus">
+<link rel="next" href="size.attributes.parse.hex.html" title="size.attributes.parse.hex">
+<body class="show_output">
+<p>
+ <a href="size.attributes.parse.minus.html" accesskey="p" title="[p] size.attributes.parse.minus"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.parse.hex.html" accesskey="n" title="[n] size.attributes.parse.hex">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.parse.html">parse</a>.octal</h1>
+<p class="desc">Parsing of non-negative integers</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="0100" height="0100"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.octal.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.octal.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.octal.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.octal.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.onlyspace.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.onlyspace.html
new file mode 100644
index 0000000..ff6a0b7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.onlyspace.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.parse.onlyspace</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.parse.empty.html" title="size.attributes.parse.empty">
+<link rel="next" href="size.attributes.parse.space.html" title="size.attributes.parse.space">
+<body class="show_output">
+<p>
+ <a href="size.attributes.parse.empty.html" accesskey="p" title="[p] size.attributes.parse.empty"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.parse.space.html" accesskey="n" title="[n] size.attributes.parse.space">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.parse.html">parse</a>.onlyspace</h1>
+<p class="desc">Parsing of non-negative integers</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+<li><a href="spec.html#testrefs.size.error">size.error</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width=" " height=" "><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.onlyspace.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.onlyspace.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.onlyspace.png
new file mode 100644
index 0000000..a72d047
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.onlyspace.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.percent.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.percent.html
new file mode 100644
index 0000000..51eadce
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.percent.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.parse.percent</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.parse.decimal.html" title="size.attributes.parse.decimal">
+<link rel="next" href="size.attributes.parse.em.html" title="size.attributes.parse.em">
+<body class="show_output">
+<p>
+ <a href="size.attributes.parse.decimal.html" accesskey="p" title="[p] size.attributes.parse.decimal"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.parse.em.html" accesskey="n" title="[n] size.attributes.parse.em">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.parse.html">parse</a>.percent</h1>
+<p class="desc">Parsing of non-negative integers</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100%" height="100%"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.percent.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.percent.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.percent.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.percent.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.plus.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.plus.html
new file mode 100644
index 0000000..446ef99
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.plus.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.parse.plus</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.parse.whitespace.html" title="size.attributes.parse.whitespace">
+<link rel="next" href="size.attributes.parse.minus.html" title="size.attributes.parse.minus">
+<body class="show_output">
+<p>
+ <a href="size.attributes.parse.whitespace.html" accesskey="p" title="[p] size.attributes.parse.whitespace"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.parse.minus.html" accesskey="n" title="[n] size.attributes.parse.minus">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.parse.html">parse</a>.plus</h1>
+<p class="desc">Parsing of non-negative integers</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="+100" height="+100"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.plus.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.plus.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.plus.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.plus.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.space.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.space.html
new file mode 100644
index 0000000..9c915bf
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.space.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.parse.space</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.parse.onlyspace.html" title="size.attributes.parse.onlyspace">
+<link rel="next" href="size.attributes.parse.whitespace.html" title="size.attributes.parse.whitespace">
+<body class="show_output">
+<p>
+ <a href="size.attributes.parse.onlyspace.html" accesskey="p" title="[p] size.attributes.parse.onlyspace"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.parse.whitespace.html" accesskey="n" title="[n] size.attributes.parse.whitespace">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.parse.html">parse</a>.space</h1>
+<p class="desc">Parsing of non-negative integers</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width=" 100" height=" 100"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.space.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.space.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.space.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.space.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.trailingjunk.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.trailingjunk.html
new file mode 100644
index 0000000..010672e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.trailingjunk.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.parse.trailingjunk</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.parse.junk.html" title="size.attributes.parse.junk">
+<link rel="next" href="size.attributes.setAttribute.zero.html" title="size.attributes.setAttribute.zero">
+<body class="show_output">
+<p>
+ <a href="size.attributes.parse.junk.html" accesskey="p" title="[p] size.attributes.parse.junk"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.setAttribute.zero.html" accesskey="n" title="[n] size.attributes.setAttribute.zero">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.parse.html">parse</a>.trailingjunk</h1>
+<p class="desc">Parsing of non-negative integers</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100#!?" height="100#!?"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.trailingjunk.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.trailingjunk.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.trailingjunk.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.trailingjunk.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.whitespace.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.whitespace.html
new file mode 100644
index 0000000..ab0f7fa
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.whitespace.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.parse.whitespace</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.parse.space.html" title="size.attributes.parse.space">
+<link rel="next" href="size.attributes.parse.plus.html" title="size.attributes.parse.plus">
+<body class="show_output">
+<p>
+ <a href="size.attributes.parse.space.html" accesskey="p" title="[p] size.attributes.parse.space"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.parse.plus.html" accesskey="n" title="[n] size.attributes.parse.plus">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.parse.html">parse</a>.whitespace</h1>
+<p class="desc">Parsing of non-negative integers</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="
+ 100" height="
+ 100"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.parse.whitespace.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.whitespace.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.whitespace.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.whitespace.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.zero.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.zero.html
new file mode 100644
index 0000000..cb0ecd3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.parse.zero.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.parse.zero</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.removed.html" title="size.attributes.removed">
+<link rel="next" href="size.attributes.parse.empty.html" title="size.attributes.parse.empty">
+<body class="show_output">
+<p>
+ <a href="size.attributes.removed.html" accesskey="p" title="[p] size.attributes.removed"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.parse.empty.html" accesskey="n" title="[n] size.attributes.parse.empty">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.parse.html">parse</a>.zero</h1>
+<p class="desc">Parsing of non-negative integers</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="0" height="0"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.reflect.setcontent.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.reflect.setcontent.html
new file mode 100644
index 0000000..a91fe83b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.reflect.setcontent.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.reflect.setcontent</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.reflect.setidlzero.html" title="size.attributes.reflect.setidlzero">
+<link rel="next" href="size.attributes.removed.html" title="size.attributes.removed">
+<body class="show_output">
+<p>
+ <a href="size.attributes.reflect.setidlzero.html" accesskey="p" title="[p] size.attributes.reflect.setidlzero"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.removed.html" accesskey="n" title="[n] size.attributes.removed">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.reflect.html">reflect</a>.setcontent</h1>
+<p class="desc">Setting content attributes updates IDL and content attributes</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.reflect">size.reflect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.reflect.setcontent.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '120');
+canvas.setAttribute('height', '60');
+_assertSame(canvas.getAttribute('width'), '120', "canvas.getAttribute('width')", "'120'");
+_assertSame(canvas.getAttribute('height'), '60', "canvas.getAttribute('height')", "'60'");
+_assertSame(canvas.width, 120, "canvas.width", "120");
+_assertSame(canvas.height, 60, "canvas.height", "60");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.reflect.setcontent.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.reflect.setcontent.png
new file mode 100644
index 0000000..47830c8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.reflect.setcontent.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.reflect.setidl.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.reflect.setidl.html
new file mode 100644
index 0000000..7a1fd69
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.reflect.setidl.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.reflect.setidl</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.default.html" title="size.attributes.default">
+<link rel="next" href="size.attributes.reflect.setidlzero.html" title="size.attributes.reflect.setidlzero">
+<body class="show_output">
+<p>
+ <a href="size.attributes.default.html" accesskey="p" title="[p] size.attributes.default"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.reflect.setidlzero.html" accesskey="n" title="[n] size.attributes.reflect.setidlzero">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.reflect.html">reflect</a>.setidl</h1>
+<p class="desc">Setting IDL attributes updates IDL and content attributes</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.reflect">size.reflect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.reflect.setidl.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = 120;
+canvas.height = 60;
+_assertSame(canvas.getAttribute('width'), '120', "canvas.getAttribute('width')", "'120'");
+_assertSame(canvas.getAttribute('height'), '60', "canvas.getAttribute('height')", "'60'");
+_assertSame(canvas.width, 120, "canvas.width", "120");
+_assertSame(canvas.height, 60, "canvas.height", "60");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.reflect.setidl.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.reflect.setidl.png
new file mode 100644
index 0000000..47830c8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.reflect.setidl.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.reflect.setidlzero.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.reflect.setidlzero.html
new file mode 100644
index 0000000..d501a91
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.reflect.setidlzero.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.reflect.setidlzero</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.reflect.setidl.html" title="size.attributes.reflect.setidl">
+<link rel="next" href="size.attributes.reflect.setcontent.html" title="size.attributes.reflect.setcontent">
+<body class="show_output">
+<p>
+ <a href="size.attributes.reflect.setidl.html" accesskey="p" title="[p] size.attributes.reflect.setidl"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.reflect.setcontent.html" accesskey="n" title="[n] size.attributes.reflect.setcontent">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.reflect.html">reflect</a>.setidlzero</h1>
+<p class="desc">Setting IDL attributes to 0 updates IDL and content attributes</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.reflect">size.reflect</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = 0;
+canvas.height = 0;
+_assertSame(canvas.getAttribute('width'), '0', "canvas.getAttribute('width')", "'0'");
+_assertSame(canvas.getAttribute('height'), '0', "canvas.getAttribute('height')", "'0'");
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.removed.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.removed.html
new file mode 100644
index 0000000..157f32e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.removed.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.removed</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.reflect.setcontent.html" title="size.attributes.reflect.setcontent">
+<link rel="next" href="size.attributes.parse.zero.html" title="size.attributes.parse.zero">
+<body class="show_output">
+<p>
+ <a href="size.attributes.reflect.setcontent.html" accesskey="p" title="[p] size.attributes.reflect.setcontent"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.parse.zero.html" accesskey="n" title="[n] size.attributes.parse.zero">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.removed</h1>
+<p class="desc">Removing content attributes reverts to default size</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.missing">size.missing</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="120" height="60"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.removed.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(canvas.width, 120, "canvas.width", "120");
+canvas.removeAttribute('width');
+_assertSame(canvas.width, 300, "canvas.width", "300");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.removed.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.removed.png
new file mode 100644
index 0000000..1ebf30d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.removed.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.set.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.set.html
new file mode 100644
index 0000000..9350946
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.set.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.set</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.get.html" title="size.attributes.get">
+<link rel="next" href="size.attributes.idl.set.zero.html" title="size.attributes.idl.set.zero">
+<body class="show_output">
+<p>
+ <a href="size.attributes.get.html" accesskey="p" title="[p] size.attributes.get"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.idl.set.zero.html" accesskey="n" title="[n] size.attributes.idl.set.zero">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.set</h1>
+<p class="desc">Setting width/height IDL attributes</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.width">size.width</a>
+<li><a href="spec.html#testrefs.size.height">size.height</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.set.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.width = 120;
+canvas.height = 60;
+_assertSame(canvas.width, 120, "canvas.width", "120");
+_assertSame(canvas.height, 60, "canvas.height", "60");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.set.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.set.png
new file mode 100644
index 0000000..47830c8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.set.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.decimal.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.decimal.html
new file mode 100644
index 0000000..d2e07bd
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.decimal.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.setAttribute.decimal</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.setAttribute.exp.html" title="size.attributes.setAttribute.exp">
+<link rel="next" href="size.attributes.setAttribute.percent.html" title="size.attributes.setAttribute.percent">
+<body class="show_output">
+<p>
+ <a href="size.attributes.setAttribute.exp.html" accesskey="p" title="[p] size.attributes.setAttribute.exp"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.setAttribute.percent.html" accesskey="n" title="[n] size.attributes.setAttribute.percent">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.setAttribute.html">setAttribute</a>.decimal</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.decimal.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '100.999');
+canvas.setAttribute('height', '100.999');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.decimal.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.decimal.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.decimal.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.em.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.em.html
new file mode 100644
index 0000000..fcecb91
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.em.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.setAttribute.em</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.setAttribute.percent.html" title="size.attributes.setAttribute.percent">
+<link rel="next" href="size.attributes.setAttribute.junk.html" title="size.attributes.setAttribute.junk">
+<body class="show_output">
+<p>
+ <a href="size.attributes.setAttribute.percent.html" accesskey="p" title="[p] size.attributes.setAttribute.percent"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.setAttribute.junk.html" accesskey="n" title="[n] size.attributes.setAttribute.junk">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.setAttribute.html">setAttribute</a>.em</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.em.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '100em');
+canvas.setAttribute('height', '100em');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.em.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.em.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.em.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.empty.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.empty.html
new file mode 100644
index 0000000..0c5355c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.empty.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.setAttribute.empty</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.setAttribute.zero.html" title="size.attributes.setAttribute.zero">
+<link rel="next" href="size.attributes.setAttribute.onlyspace.html" title="size.attributes.setAttribute.onlyspace">
+<body class="show_output">
+<p>
+ <a href="size.attributes.setAttribute.zero.html" accesskey="p" title="[p] size.attributes.setAttribute.zero"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.setAttribute.onlyspace.html" accesskey="n" title="[n] size.attributes.setAttribute.onlyspace">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.setAttribute.html">setAttribute</a>.empty</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+<li><a href="spec.html#testrefs.size.error">size.error</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.empty.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '');
+canvas.setAttribute('height', '');
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.empty.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.empty.png
new file mode 100644
index 0000000..a72d047
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.empty.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.exp.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.exp.html
new file mode 100644
index 0000000..6448448
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.exp.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.setAttribute.exp</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.setAttribute.hex.html" title="size.attributes.setAttribute.hex">
+<link rel="next" href="size.attributes.setAttribute.decimal.html" title="size.attributes.setAttribute.decimal">
+<body class="show_output">
+<p>
+ <a href="size.attributes.setAttribute.hex.html" accesskey="p" title="[p] size.attributes.setAttribute.hex"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.setAttribute.decimal.html" accesskey="n" title="[n] size.attributes.setAttribute.decimal">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.setAttribute.html">setAttribute</a>.exp</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.exp.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '100e1');
+canvas.setAttribute('height', '100e1');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.exp.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.exp.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.exp.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.hex.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.hex.html
new file mode 100644
index 0000000..e8f8ad2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.hex.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.setAttribute.hex</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.setAttribute.octal.html" title="size.attributes.setAttribute.octal">
+<link rel="next" href="size.attributes.setAttribute.exp.html" title="size.attributes.setAttribute.exp">
+<body class="show_output">
+<p>
+ <a href="size.attributes.setAttribute.octal.html" accesskey="p" title="[p] size.attributes.setAttribute.octal"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.setAttribute.exp.html" accesskey="n" title="[n] size.attributes.setAttribute.exp">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.setAttribute.html">setAttribute</a>.hex</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '0x100');
+canvas.setAttribute('height', '0x100');
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.junk.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.junk.html
new file mode 100644
index 0000000..7e2b58e
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.junk.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.setAttribute.junk</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.setAttribute.em.html" title="size.attributes.setAttribute.em">
+<link rel="next" href="size.attributes.setAttribute.trailingjunk.html" title="size.attributes.setAttribute.trailingjunk">
+<body class="show_output">
+<p>
+ <a href="size.attributes.setAttribute.em.html" accesskey="p" title="[p] size.attributes.setAttribute.em"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.setAttribute.trailingjunk.html" accesskey="n" title="[n] size.attributes.setAttribute.trailingjunk">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.setAttribute.html">setAttribute</a>.junk</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+<li><a href="spec.html#testrefs.size.error">size.error</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.junk.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '#!?');
+canvas.setAttribute('height', '#!?');
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.junk.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.junk.png
new file mode 100644
index 0000000..a72d047
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.junk.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.minus.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.minus.html
new file mode 100644
index 0000000..c3c66a5
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.minus.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.setAttribute.minus</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.setAttribute.plus.html" title="size.attributes.setAttribute.plus">
+<link rel="next" href="size.attributes.setAttribute.octal.html" title="size.attributes.setAttribute.octal">
+<body class="show_output">
+<p>
+ <a href="size.attributes.setAttribute.plus.html" accesskey="p" title="[p] size.attributes.setAttribute.plus"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.setAttribute.octal.html" accesskey="n" title="[n] size.attributes.setAttribute.octal">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.setAttribute.html">setAttribute</a>.minus</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+<li><a href="spec.html#testrefs.size.error">size.error</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.minus.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '-100');
+canvas.setAttribute('height', '-100');
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.minus.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.minus.png
new file mode 100644
index 0000000..a72d047
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.minus.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.octal.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.octal.html
new file mode 100644
index 0000000..c986c14
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.octal.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.setAttribute.octal</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.setAttribute.minus.html" title="size.attributes.setAttribute.minus">
+<link rel="next" href="size.attributes.setAttribute.hex.html" title="size.attributes.setAttribute.hex">
+<body class="show_output">
+<p>
+ <a href="size.attributes.setAttribute.minus.html" accesskey="p" title="[p] size.attributes.setAttribute.minus"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.setAttribute.hex.html" accesskey="n" title="[n] size.attributes.setAttribute.hex">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.setAttribute.html">setAttribute</a>.octal</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.octal.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '0100');
+canvas.setAttribute('height', '0100');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.octal.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.octal.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.octal.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.onlyspace.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.onlyspace.html
new file mode 100644
index 0000000..5f33594
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.onlyspace.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.setAttribute.onlyspace</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.setAttribute.empty.html" title="size.attributes.setAttribute.empty">
+<link rel="next" href="size.attributes.setAttribute.space.html" title="size.attributes.setAttribute.space">
+<body class="show_output">
+<p>
+ <a href="size.attributes.setAttribute.empty.html" accesskey="p" title="[p] size.attributes.setAttribute.empty"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.setAttribute.space.html" accesskey="n" title="[n] size.attributes.setAttribute.space">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.setAttribute.html">setAttribute</a>.onlyspace</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+<li><a href="spec.html#testrefs.size.error">size.error</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.onlyspace.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', ' ');
+canvas.setAttribute('height', ' ');
+_assertSame(canvas.width, 300, "canvas.width", "300");
+_assertSame(canvas.height, 150, "canvas.height", "150");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.onlyspace.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.onlyspace.png
new file mode 100644
index 0000000..a72d047
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.onlyspace.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.percent.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.percent.html
new file mode 100644
index 0000000..88d1f5a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.percent.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.setAttribute.percent</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.setAttribute.decimal.html" title="size.attributes.setAttribute.decimal">
+<link rel="next" href="size.attributes.setAttribute.em.html" title="size.attributes.setAttribute.em">
+<body class="show_output">
+<p>
+ <a href="size.attributes.setAttribute.decimal.html" accesskey="p" title="[p] size.attributes.setAttribute.decimal"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.setAttribute.em.html" accesskey="n" title="[n] size.attributes.setAttribute.em">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.setAttribute.html">setAttribute</a>.percent</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.percent.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '100%');
+canvas.setAttribute('height', '100%');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.percent.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.percent.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.percent.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.plus.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.plus.html
new file mode 100644
index 0000000..5c61ad6
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.plus.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.setAttribute.plus</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.setAttribute.whitespace.html" title="size.attributes.setAttribute.whitespace">
+<link rel="next" href="size.attributes.setAttribute.minus.html" title="size.attributes.setAttribute.minus">
+<body class="show_output">
+<p>
+ <a href="size.attributes.setAttribute.whitespace.html" accesskey="p" title="[p] size.attributes.setAttribute.whitespace"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.setAttribute.minus.html" accesskey="n" title="[n] size.attributes.setAttribute.minus">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.setAttribute.html">setAttribute</a>.plus</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.plus.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '+100');
+canvas.setAttribute('height', '+100');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.plus.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.plus.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.plus.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.space.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.space.html
new file mode 100644
index 0000000..c05ce0c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.space.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.setAttribute.space</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.setAttribute.onlyspace.html" title="size.attributes.setAttribute.onlyspace">
+<link rel="next" href="size.attributes.setAttribute.whitespace.html" title="size.attributes.setAttribute.whitespace">
+<body class="show_output">
+<p>
+ <a href="size.attributes.setAttribute.onlyspace.html" accesskey="p" title="[p] size.attributes.setAttribute.onlyspace"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.setAttribute.whitespace.html" accesskey="n" title="[n] size.attributes.setAttribute.whitespace">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.setAttribute.html">setAttribute</a>.space</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.space.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', ' 100');
+canvas.setAttribute('height', ' 100');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.space.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.space.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.space.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.trailingjunk.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.trailingjunk.html
new file mode 100644
index 0000000..505fcb9
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.trailingjunk.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.setAttribute.trailingjunk</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.setAttribute.junk.html" title="size.attributes.setAttribute.junk">
+<link rel="next" href="size.attributes.style.html" title="size.attributes.style">
+<body class="show_output">
+<p>
+ <a href="size.attributes.setAttribute.junk.html" accesskey="p" title="[p] size.attributes.setAttribute.junk"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.style.html" accesskey="n" title="[n] size.attributes.style">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.setAttribute.html">setAttribute</a>.trailingjunk</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.trailingjunk.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '100#!?');
+canvas.setAttribute('height', '100#!?');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.trailingjunk.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.trailingjunk.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.trailingjunk.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.whitespace.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.whitespace.html
new file mode 100644
index 0000000..30a9581
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.whitespace.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.setAttribute.whitespace</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.setAttribute.space.html" title="size.attributes.setAttribute.space">
+<link rel="next" href="size.attributes.setAttribute.plus.html" title="size.attributes.setAttribute.plus">
+<body class="show_output">
+<p>
+ <a href="size.attributes.setAttribute.space.html" accesskey="p" title="[p] size.attributes.setAttribute.space"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.setAttribute.plus.html" accesskey="n" title="[n] size.attributes.setAttribute.plus">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.setAttribute.html">setAttribute</a>.whitespace</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.setAttribute.whitespace.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '\r\n\t\x0c100');
+canvas.setAttribute('height', '\r\n\t\x0c100');
+_assertSame(canvas.width, 100, "canvas.width", "100");
+_assertSame(canvas.height, 100, "canvas.height", "100");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "100px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"100px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.whitespace.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.whitespace.png
new file mode 100644
index 0000000..f842673
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.whitespace.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.zero.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.zero.html
new file mode 100644
index 0000000..fbec20d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.setAttribute.zero.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.setAttribute.zero</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.parse.trailingjunk.html" title="size.attributes.parse.trailingjunk">
+<link rel="next" href="size.attributes.setAttribute.empty.html" title="size.attributes.setAttribute.empty">
+<body class="show_output">
+<p>
+ <a href="size.attributes.parse.trailingjunk.html" accesskey="p" title="[p] size.attributes.parse.trailingjunk"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.setAttribute.empty.html" accesskey="n" title="[n] size.attributes.setAttribute.empty">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.<a href="index.size.attributes.setAttribute.html">setAttribute</a>.zero</h1>
+<p class="desc">Parsing of non-negative integers in setAttribute</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.nonnegativeinteger">size.nonnegativeinteger</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+canvas.setAttribute('width', '0');
+canvas.setAttribute('height', '0');
+_assertSame(canvas.width, 0, "canvas.width", "0");
+_assertSame(canvas.height, 0, "canvas.height", "0");
+_assertEqual(window.getComputedStyle(canvas, null).getPropertyValue("width"), "0px", "window.getComputedStyle(canvas, null).getPropertyValue(\"width\")", "\"0px\"");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.style.html b/LayoutTests/fast/canvas/philip/tests/size.attributes.style.html
new file mode 100644
index 0000000..5b711cf
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.style.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Canvas test: size.attributes.style</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="size.attributes.setAttribute.trailingjunk.html" title="size.attributes.setAttribute.trailingjunk">
+<link rel="next" href="initial.colour.html" title="initial.colour">
+<body class="show_output">
+<p>
+ <a href="size.attributes.setAttribute.trailingjunk.html" accesskey="p" title="[p] size.attributes.setAttribute.trailingjunk"><</a>
+ <a href="index.html">[index]</a>
+ <a href="initial.colour.html" accesskey="n" title="[n] initial.colour">></a>
+<h1><a href="index.size.html">size</a>.<a href="index.size.attributes.html">attributes</a>.style</h1>
+<p class="desc">Canvas size is independent of CSS resizing</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.size.css">size.css</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="50" height="30" style="width: 100px; height: 50px"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="size.attributes.style.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertEqual(canvas.width, 50, "canvas.width", "50");
+_assertEqual(canvas.height, 30, "canvas.height", "30");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/size.attributes.style.png b/LayoutTests/fast/canvas/philip/tests/size.attributes.style.png
new file mode 100644
index 0000000..eeedd0f
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/size.attributes.style.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.arguments.1.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.arguments.1.html
new file mode 100644
index 0000000..f49ea0a
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.arguments.1.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.arguments.1</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.lowercase.unicode.html" title="toDataURL.lowercase.unicode">
+<link rel="next" href="toDataURL.arguments.2.html" title="toDataURL.arguments.2">
+<body class="show_output">
+<p>
+ <a href="toDataURL.lowercase.unicode.html" accesskey="p" title="[p] toDataURL.lowercase.unicode"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.arguments.2.html" accesskey="n" title="[n] toDataURL.arguments.2">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.<a href="index.toDataURL.arguments.html">arguments</a>.1</h1>
+<p class="desc">toDataURL ignores extra arguments</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.arguments">toDataURL.arguments</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401795">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL('image/png', 'another argument that should not raise an exception');
+_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.arguments.2.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.arguments.2.html
new file mode 100644
index 0000000..a17a28c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.arguments.2.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.arguments.2</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.arguments.1.html" title="toDataURL.arguments.1">
+<link rel="next" href="toDataURL.arguments.3.html" title="toDataURL.arguments.3">
+<body class="show_output">
+<p>
+ <a href="toDataURL.arguments.1.html" accesskey="p" title="[p] toDataURL.arguments.1"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.arguments.3.html" accesskey="n" title="[n] toDataURL.arguments.3">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.<a href="index.toDataURL.arguments.html">arguments</a>.2</h1>
+<p class="desc">toDataURL ignores extra arguments</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.arguments">toDataURL.arguments</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401795">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL('image/png', 'another argument that should not raise an exception', 'and another');
+_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.arguments.3.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.arguments.3.html
new file mode 100644
index 0000000..3bedaaf
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.arguments.3.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.arguments.3</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.arguments.2.html" title="toDataURL.arguments.2">
+<link rel="next" href="toDataURL.nocontext.html" title="toDataURL.nocontext">
+<body class="show_output">
+<p>
+ <a href="toDataURL.arguments.2.html" accesskey="p" title="[p] toDataURL.arguments.2"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.nocontext.html" accesskey="n" title="[n] toDataURL.nocontext">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.<a href="index.toDataURL.arguments.html">arguments</a>.3</h1>
+<p class="desc">toDataURL ignores extra arguments</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.arguments">toDataURL.arguments</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=401795">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// More arguments that should not raise exceptions
+var data = canvas.toDataURL('image/png', null, null, null);
+_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.bogustype.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.bogustype.html
new file mode 100644
index 0000000..a4e2131
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.bogustype.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.bogustype</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.png.html" title="toDataURL.png">
+<link rel="next" href="toDataURL.unrecognised.html" title="toDataURL.unrecognised">
+<body class="show_output">
+<p>
+ <a href="toDataURL.png.html" accesskey="p" title="[p] toDataURL.png"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.unrecognised.html" accesskey="n" title="[n] toDataURL.unrecognised">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.bogustype</h1>
+<p class="desc">toDataURL with a syntactically invalid type returns a PNG</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.unrecognised">toDataURL.unrecognised</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=489304">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL('bogus');
+_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.default.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.default.html
new file mode 100644
index 0000000..2c2be6c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.default.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.default</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="context.casesensitive.html" title="context.casesensitive">
+<link rel="next" href="toDataURL.png.html" title="toDataURL.png">
+<body class="show_output">
+<p>
+ <a href="context.casesensitive.html" accesskey="p" title="[p] context.casesensitive"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.png.html" accesskey="n" title="[n] toDataURL.png">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.default</h1>
+<p class="desc">toDataURL with no arguments returns a PNG</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.noarguments">toDataURL.noarguments</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL();
+_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.alpha.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.alpha.html
new file mode 100644
index 0000000..c1cc7d3
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.alpha.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.jpeg.alpha</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.jpeg.primarycolours.html" title="toDataURL.jpeg.primarycolours">
+<link rel="next" href="toDataURL.jpeg.quality.basic.html" title="toDataURL.jpeg.quality.basic">
+<body class="show_output">
+<p>
+ <a href="toDataURL.jpeg.primarycolours.html" accesskey="p" title="[p] toDataURL.jpeg.primarycolours"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.jpeg.quality.basic.html" accesskey="n" title="[n] toDataURL.jpeg.quality.basic">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.<a href="index.toDataURL.jpeg.html">jpeg</a>.alpha</h1>
+<p class="desc">toDataURL with JPEG composites onto black</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.jpeg">toDataURL.jpeg</a>
+<li><a href="spec.html#testrefs.toDataURL.noalpha">toDataURL.noalpha</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="toDataURL.jpeg.alpha.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = 'rgba(128, 255, 128, 0.5)';
+ctx.fillRect(0, 0, 100, 50);
+ctx.globalCompositeOperation = 'destination-over'; // should be ignored by toDataURL
+var data = canvas.toDataURL('image/jpeg');
+ctx.globalCompositeOperation = 'source-over';
+if (!data.match(/^data:image\/jpeg[;,]/)) {
+ _assert(true, "true");
+} else {
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ var img = new Image();
+ deferTest();
+ img.onload = wrapFunction(function ()
+ {
+ ctx.drawImage(img, 0, 0);
+
+ _assertPixelApprox(canvas, 50,25, 63,127,63,255, "50,25", "63,127,63,255", 8);
+ });
+ img.src = data;
+}
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.alpha.png b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.alpha.png
new file mode 100644
index 0000000..5eba3882
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.alpha.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.primarycolours.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.primarycolours.html
new file mode 100644
index 0000000..00fff67
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.primarycolours.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.jpeg.primarycolours</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.png.complexcolours.html" title="toDataURL.png.complexcolours">
+<link rel="next" href="toDataURL.jpeg.alpha.html" title="toDataURL.jpeg.alpha">
+<body class="show_output">
+<p>
+ <a href="toDataURL.png.complexcolours.html" accesskey="p" title="[p] toDataURL.png.complexcolours"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.jpeg.alpha.html" accesskey="n" title="[n] toDataURL.jpeg.alpha">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.<a href="index.toDataURL.jpeg.html">jpeg</a>.primarycolours</h1>
+<p class="desc">toDataURL with JPEG handles simple colours correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.jpeg">toDataURL.jpeg</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="toDataURL.jpeg.primarycolours.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#ff0';
+ctx.fillRect(0, 0, 25, 40);
+ctx.fillStyle = '#0ff';
+ctx.fillRect(25, 0, 50, 40);
+ctx.fillStyle = '#00f';
+ctx.fillRect(75, 0, 25, 40);
+ctx.fillStyle = '#fff';
+ctx.fillRect(0, 40, 100, 10);
+var data = canvas.toDataURL('image/jpeg'); // it is okay if this returns a PNG instead
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+var img = new Image();
+deferTest();
+img.onload = wrapFunction(function ()
+{
+ ctx.drawImage(img, 0, 0);
+
+ _assertPixelApprox(canvas, 12,20, 255,255,0,255, "12,20", "255,255,0,255", 8);
+ _assertPixelApprox(canvas, 50,20, 0,255,255,255, "50,20", "0,255,255,255", 8);
+ _assertPixelApprox(canvas, 87,20, 0,0,255,255, "87,20", "0,0,255,255", 8);
+ _assertPixelApprox(canvas, 50,45, 255,255,255,255, "50,45", "255,255,255,255", 8);
+});
+img.src = data;
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.primarycolours.png b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.primarycolours.png
new file mode 100644
index 0000000..86649c7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.primarycolours.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.quality.basic.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.quality.basic.html
new file mode 100644
index 0000000..ca8c104
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.quality.basic.html
@@ -0,0 +1,63 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.jpeg.quality.basic</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.jpeg.alpha.html" title="toDataURL.jpeg.alpha">
+<link rel="next" href="toDataURL.jpeg.quality.notnumber.html" title="toDataURL.jpeg.quality.notnumber">
+<body class="show_output">
+<p>
+ <a href="toDataURL.jpeg.alpha.html" accesskey="p" title="[p] toDataURL.jpeg.alpha"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.jpeg.quality.notnumber.html" accesskey="n" title="[n] toDataURL.jpeg.quality.notnumber">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.<a href="index.toDataURL.jpeg.html">jpeg</a>.<a href="index.toDataURL.jpeg.quality.html">quality</a>.basic</h1>
+<p class="desc">toDataURL with JPEG uses the quality parameter</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.jpeg.quality">toDataURL.jpeg.quality</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="toDataURL.jpeg.quality.basic.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#00f';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0ff';
+ctx.fillRect(0, 3, 100, 1);
+// Check for JPEG support first
+var data = canvas.toDataURL('image/jpeg');
+if (!data.match(/^data:image\/jpeg[;,]/)) {
+ _assert(true, "true");
+} else {
+ var data_hi = canvas.toDataURL('image/jpeg', 0.99);
+ var data_lo = canvas.toDataURL('image/jpeg', 0.01);
+ ctx.fillStyle = '#f00';
+ ctx.fillRect(0, 0, 100, 50);
+ deferTest();
+ var img_hi = new Image();
+ img_hi.onload = function ()
+ {
+ var img_lo = new Image();
+ img_lo.onload = wrapFunction(function ()
+ {
+ ctx.drawImage(img_hi, 0, 0, 50, 50, 0, 0, 50, 50);
+ ctx.drawImage(img_lo, 0, 0, 50, 50, 50, 0, 50, 50);
+
+ _assert(data_hi.length > data_lo.length, "data_hi.length > data_lo.length");
+ _assertPixelApprox(canvas, 25,25, 0,0,255,255, "25,25", "0,0,255,255", 8);
+ _assertPixelApprox(canvas, 75,25, 0,0,255,255, "75,25", "0,0,255,255", 8);
+ });
+ img_lo.src = data_lo;
+ };
+ img_hi.src = data_hi;
+}
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.quality.basic.png b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.quality.basic.png
new file mode 100644
index 0000000..785ad39
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.quality.basic.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.quality.notnumber.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.quality.notnumber.html
new file mode 100644
index 0000000..4a5a50b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.quality.notnumber.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.jpeg.quality.notnumber</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.jpeg.quality.basic.html" title="toDataURL.jpeg.quality.basic">
+<link rel="next" href="toDataURL.jpeg.quality.outsiderange.html" title="toDataURL.jpeg.quality.outsiderange">
+<body class="show_output">
+<p>
+ <a href="toDataURL.jpeg.quality.basic.html" accesskey="p" title="[p] toDataURL.jpeg.quality.basic"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.jpeg.quality.outsiderange.html" accesskey="n" title="[n] toDataURL.jpeg.quality.outsiderange">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.<a href="index.toDataURL.jpeg.html">jpeg</a>.<a href="index.toDataURL.jpeg.quality.html">quality</a>.notnumber</h1>
+<p class="desc">toDataURL with JPEG handles non-numeric quality parameters</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.jpeg.nan">toDataURL.jpeg.nan</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#00f';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0ff';
+ctx.fillRect(0, 3, 100, 1);
+// Check for JPEG support first
+var data = canvas.toDataURL('image/jpeg');
+if (!data.match(/^data:image\/jpeg[;,]/)) {
+ _assert(true, "true");
+} else {
+ _assertSame(canvas.toDataURL('image/jpeg', 'bogus'), data, "canvas.toDataURL('image/jpeg', 'bogus')", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', {}), data, "canvas.toDataURL('image/jpeg', {})", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', null), data, "canvas.toDataURL('image/jpeg', null)", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', undefined), data, "canvas.toDataURL('image/jpeg', undefined)", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', true), data, "canvas.toDataURL('image/jpeg', true)", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', '0.01'), data, "canvas.toDataURL('image/jpeg', '0.01')", "data");
+}
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.quality.outsiderange.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.quality.outsiderange.html
new file mode 100644
index 0000000..bc554e2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.jpeg.quality.outsiderange.html
@@ -0,0 +1,49 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.jpeg.quality.outsiderange</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.jpeg.quality.notnumber.html" title="toDataURL.jpeg.quality.notnumber">
+<link rel="next" href="security.drawImage.image.html" title="security.drawImage.image">
+<body class="show_output">
+<p>
+ <a href="toDataURL.jpeg.quality.notnumber.html" accesskey="p" title="[p] toDataURL.jpeg.quality.notnumber"><</a>
+ <a href="index.html">[index]</a>
+ <a href="security.drawImage.image.html" accesskey="n" title="[n] security.drawImage.image">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.<a href="index.toDataURL.jpeg.html">jpeg</a>.<a href="index.toDataURL.jpeg.quality.html">quality</a>.outsiderange</h1>
+<p class="desc">toDataURL with JPEG handles out-of-range quality parameters</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.jpeg.range">toDataURL.jpeg.range</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#00f';
+ctx.fillRect(0, 0, 100, 50);
+ctx.fillStyle = '#0ff';
+ctx.fillRect(0, 3, 100, 1);
+// Check for JPEG support first
+var data = canvas.toDataURL('image/jpeg');
+if (!data.match(/^data:image\/jpeg[;,]/)) {
+ _assert(true, "true");
+} else {
+ _assertSame(canvas.toDataURL('image/jpeg', 10), data, "canvas.toDataURL('image/jpeg', 10)", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', -10), data, "canvas.toDataURL('image/jpeg', -10)", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', 1.01), data, "canvas.toDataURL('image/jpeg', 1.01)", "data");
+ _assertSame(canvas.toDataURL('image/jpeg', -0.01), data, "canvas.toDataURL('image/jpeg', -0.01)", "data");
+
+ _assert(canvas.toDataURL('image/jpeg', 1).length >= canvas.toDataURL('image/jpeg', 0.9).length, "canvas.toDataURL('image/jpeg', 1).length >= canvas.toDataURL('image/jpeg', 0.9).length");
+ _assert(canvas.toDataURL('image/jpeg', 0).length <= canvas.toDataURL('image/jpeg', 0.1).length, "canvas.toDataURL('image/jpeg', 0).length <= canvas.toDataURL('image/jpeg', 0.1).length");
+}
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.lowercase.ascii.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.lowercase.ascii.html
new file mode 100644
index 0000000..16cb65b
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.lowercase.ascii.html
@@ -0,0 +1,41 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.lowercase.ascii</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.unrecognised.html" title="toDataURL.unrecognised">
+<link rel="next" href="toDataURL.lowercase.unicode.html" title="toDataURL.lowercase.unicode">
+<body class="show_output">
+<p>
+ <a href="toDataURL.unrecognised.html" accesskey="p" title="[p] toDataURL.unrecognised"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.lowercase.unicode.html" accesskey="n" title="[n] toDataURL.lowercase.unicode">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.<a href="index.toDataURL.lowercase.html">lowercase</a>.ascii</h1>
+<p class="desc">toDataURL type is case-insensitive</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.lowercase">toDataURL.lowercase</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL('ImAgE/PnG');
+_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/");
+
+// If JPEG is supported at all, it must be supported case-insensitively
+data = canvas.toDataURL('image/jpeg');
+if (data.match(/^data:image\/jpeg[;,]/)) {
+ data = canvas.toDataURL('ImAgE/JpEg');
+ _assertMatch(data, /^data:image\/jpeg[;,]/, "data", "/^data:image\\/jpeg[;,]/");
+}
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.lowercase.unicode.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.lowercase.unicode.html
new file mode 100644
index 0000000..2f5ed42
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.lowercase.unicode.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.lowercase.unicode</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.lowercase.ascii.html" title="toDataURL.lowercase.ascii">
+<link rel="next" href="toDataURL.arguments.1.html" title="toDataURL.arguments.1">
+<body class="show_output">
+<p>
+ <a href="toDataURL.lowercase.ascii.html" accesskey="p" title="[p] toDataURL.lowercase.ascii"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.arguments.1.html" accesskey="n" title="[n] toDataURL.arguments.1">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.<a href="index.toDataURL.lowercase.html">lowercase</a>.unicode</h1>
+<p class="desc">toDataURL type is ASCII-case-insensitive</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.lowercase">toDataURL.lowercase</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// Use LATIN CAPITAL LETTER I WITH DOT ABOVE (Unicode lowercase is "i")
+var data = canvas.toDataURL('\u0130mage/png');
+_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/");
+
+var data = canvas.toDataURL('\u0130mage/jpeg');
+_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.nocontext.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.nocontext.html
new file mode 100644
index 0000000..f65bff8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.nocontext.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.nocontext</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.arguments.3.html" title="toDataURL.arguments.3">
+<link rel="next" href="toDataURL.zerosize.html" title="toDataURL.zerosize">
+<body class="show_output">
+<p>
+ <a href="toDataURL.arguments.3.html" accesskey="p" title="[p] toDataURL.arguments.3"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.zerosize.html" accesskey="n" title="[n] toDataURL.zerosize">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.nocontext</h1>
+<p class="desc">toDataURL works before any context has been got</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.noarguments">toDataURL.noarguments</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var canvas2 = document.createElement('canvas');
+var data = canvas2.toDataURL();
+_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.png.complexcolours.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.png.complexcolours.html
new file mode 100644
index 0000000..e297560
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.png.complexcolours.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.png.complexcolours</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.png.primarycolours.html" title="toDataURL.png.primarycolours">
+<link rel="next" href="toDataURL.jpeg.primarycolours.html" title="toDataURL.jpeg.primarycolours">
+<body class="show_output">
+<p>
+ <a href="toDataURL.png.primarycolours.html" accesskey="p" title="[p] toDataURL.png.primarycolours"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.jpeg.primarycolours.html" accesskey="n" title="[n] toDataURL.jpeg.primarycolours">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.<a href="index.toDataURL.png.html">png</a>.complexcolours</h1>
+<p class="desc">toDataURL with PNG handles non-primary and non-solid colours correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.png">toDataURL.png</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="toDataURL.png.complexcolours.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+// (These values are chosen to survive relatively alright through being premultiplied)
+ctx.fillStyle = 'rgba(1, 3, 254, 1)';
+ctx.fillRect(0, 0, 25, 25);
+ctx.fillStyle = 'rgba(8, 252, 248, 0.75)';
+ctx.fillRect(25, 0, 25, 25);
+ctx.fillStyle = 'rgba(6, 10, 250, 0.502)';
+ctx.fillRect(50, 0, 25, 25);
+ctx.fillStyle = 'rgba(12, 16, 244, 0.25)';
+ctx.fillRect(75, 0, 25, 25);
+var img = new Image();
+deferTest();
+img.onload = wrapFunction(function ()
+{
+ ctx.drawImage(img, 0, 25);
+ // (The alpha values do not really survive float->int conversion, so just
+ // do approximate comparisons)
+
+ _assertPixel(canvas, 12,40, 1,3,254,255, "12,40", "1,3,254,255");
+ _assertPixelApprox(canvas, 37,40, 8,252,248,191, "37,40", "8,252,248,191", 2);
+ _assertPixelApprox(canvas, 62,40, 6,10,250,127, "62,40", "6,10,250,127", 4);
+ _assertPixelApprox(canvas, 87,40, 12,16,244,63, "87,40", "12,16,244,63", 8);
+});
+img.src = canvas.toDataURL();
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.png.complexcolours.png b/LayoutTests/fast/canvas/philip/tests/toDataURL.png.complexcolours.png
new file mode 100644
index 0000000..9bc8146
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.png.complexcolours.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.png.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.png.html
new file mode 100644
index 0000000..3bbdf0c
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.png.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.png</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.default.html" title="toDataURL.default">
+<link rel="next" href="toDataURL.bogustype.html" title="toDataURL.bogustype">
+<body class="show_output">
+<p>
+ <a href="toDataURL.default.html" accesskey="p" title="[p] toDataURL.default"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.bogustype.html" accesskey="n" title="[n] toDataURL.bogustype">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.png</h1>
+<p class="desc">toDataURL with image/png returns a PNG</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.png">toDataURL.png</a>
+<li><a href="spec.html#testrefs.toDataURL.witharguments">toDataURL.witharguments</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL('image/png');
+_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.png.primarycolours.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.png.primarycolours.html
new file mode 100644
index 0000000..35c8b85
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.png.primarycolours.html
@@ -0,0 +1,55 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.png.primarycolours</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.zerosize.html" title="toDataURL.zerosize">
+<link rel="next" href="toDataURL.png.complexcolours.html" title="toDataURL.png.complexcolours">
+<body class="show_output">
+<p>
+ <a href="toDataURL.zerosize.html" accesskey="p" title="[p] toDataURL.zerosize"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.png.complexcolours.html" accesskey="n" title="[n] toDataURL.png.complexcolours">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.<a href="index.toDataURL.png.html">png</a>.primarycolours</h1>
+<p class="desc">toDataURL with PNG handles simple colours correctly</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.png">toDataURL.png</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+<p class="output expectedtext">Expected output:<p><img src="toDataURL.png.primarycolours.png" class="output expected" id="expected" alt="">
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+ctx.fillStyle = '#ff0';
+ctx.fillRect(0, 0, 25, 40);
+ctx.fillStyle = '#0ff';
+ctx.fillRect(25, 0, 50, 40);
+ctx.fillStyle = '#00f';
+ctx.fillRect(75, 0, 25, 40);
+ctx.fillStyle = '#fff';
+ctx.fillRect(0, 40, 100, 10);
+var data = canvas.toDataURL();
+ctx.fillStyle = '#f00';
+ctx.fillRect(0, 0, 100, 50);
+var img = new Image();
+deferTest();
+img.onload = wrapFunction(function ()
+{
+ ctx.drawImage(img, 0, 0);
+
+ _assertPixel(canvas, 12,20, 255,255,0,255, "12,20", "255,255,0,255");
+ _assertPixel(canvas, 50,20, 0,255,255,255, "50,20", "0,255,255,255");
+ _assertPixel(canvas, 87,20, 0,0,255,255, "87,20", "0,0,255,255");
+ _assertPixel(canvas, 50,45, 255,255,255,255, "50,45", "255,255,255,255");
+});
+img.src = data;
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.png.primarycolours.png b/LayoutTests/fast/canvas/philip/tests/toDataURL.png.primarycolours.png
new file mode 100644
index 0000000..86649c7
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.png.primarycolours.png
Binary files differ
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.unrecognised.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.unrecognised.html
new file mode 100644
index 0000000..cc4e8c2
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.unrecognised.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.unrecognised</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.bogustype.html" title="toDataURL.bogustype">
+<link rel="next" href="toDataURL.lowercase.ascii.html" title="toDataURL.lowercase.ascii">
+<body class="show_output">
+<p>
+ <a href="toDataURL.bogustype.html" accesskey="p" title="[p] toDataURL.bogustype"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.lowercase.ascii.html" accesskey="n" title="[n] toDataURL.lowercase.ascii">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.unrecognised</h1>
+<p class="desc">toDataURL with an unhandled type returns a PNG</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.unrecognised">toDataURL.unrecognised</a>
+<li><a href="https://bugzilla.mozilla.org/show_bug.cgi?id=489304">Bugzilla</a>
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL('image/example');
+_assertMatch(data, /^data:image\/png[;,]/, "data", "/^data:image\\/png[;,]/");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/toDataURL.zerosize.html b/LayoutTests/fast/canvas/philip/tests/toDataURL.zerosize.html
new file mode 100644
index 0000000..a6ee8cd
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/toDataURL.zerosize.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Canvas test: toDataURL.zerosize</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="toDataURL.nocontext.html" title="toDataURL.nocontext">
+<link rel="next" href="toDataURL.png.primarycolours.html" title="toDataURL.png.primarycolours">
+<body class="show_output">
+<p>
+ <a href="toDataURL.nocontext.html" accesskey="p" title="[p] toDataURL.nocontext"><</a>
+ <a href="index.html">[index]</a>
+ <a href="toDataURL.png.primarycolours.html" accesskey="n" title="[n] toDataURL.png.primarycolours">></a>
+<h1><a href="index.toDataURL.html">toDataURL</a>.zerosize</h1>
+<p class="desc">toDataURL on zero-size canvas returns 'data:,'</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.toDataURL.zerosize">toDataURL.zerosize</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="0" height="0"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+var data = canvas.toDataURL();
+_assertSame(data, 'data:,', "data", "'data:,'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/type.delete.html b/LayoutTests/fast/canvas/philip/tests/type.delete.html
new file mode 100644
index 0000000..d0b708d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/type.delete.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Canvas test: type.delete</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="type.exists.html" title="type.exists">
+<link rel="next" href="type.prototype.html" title="type.prototype">
+<body class="show_output">
+<p>
+ <a href="type.exists.html" accesskey="p" title="[p] type.exists"><</a>
+ <a href="index.html">[index]</a>
+ <a href="type.prototype.html" accesskey="n" title="[n] type.prototype">></a>
+<h1><a href="index.type.html">type</a>.delete</h1>
+<p class="desc">window.HTMLCanvasElement interface object is DontDelete</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.canvas.type">canvas.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>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+delete window.HTMLCanvasElement;
+_assert(window.HTMLCanvasElement, "window.HTMLCanvasElement");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/type.exists.html b/LayoutTests/fast/canvas/philip/tests/type.exists.html
new file mode 100644
index 0000000..f77bed0
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/type.exists.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: type.exists</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="type.name.html" title="type.name">
+<link rel="next" href="type.delete.html" title="type.delete">
+<body class="show_output">
+<p>
+ <a href="type.name.html" accesskey="p" title="[p] type.name"><</a>
+ <a href="index.html">[index]</a>
+ <a href="type.delete.html" accesskey="n" title="[n] type.delete">></a>
+<h1><a href="index.type.html">type</a>.exists</h1>
+<p class="desc">HTMLCanvasElement is a property of window</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.canvas.type">canvas.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>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assert(window.HTMLCanvasElement, "window.HTMLCanvasElement");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/type.extend.html b/LayoutTests/fast/canvas/philip/tests/type.extend.html
new file mode 100644
index 0000000..d81d6ee
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/type.extend.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Canvas test: type.extend</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="type.replace.html" title="type.replace">
+<link rel="next" href="size.attributes.get.html" title="size.attributes.get">
+<body class="show_output">
+<p>
+ <a href="type.replace.html" accesskey="p" title="[p] type.replace"><</a>
+ <a href="index.html">[index]</a>
+ <a href="size.attributes.get.html" accesskey="n" title="[n] size.attributes.get">></a>
+<h1><a href="index.type.html">type</a>.extend</h1>
+<p class="desc">HTMLCanvasElement methods can be added, and the new methods used by canvases</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.canvas.type">canvas.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>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+window.HTMLCanvasElement.prototype.getZero = function () { return 0; };
+_assertSame(canvas.getZero(), 0, "canvas.getZero()", "0");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/type.name.html b/LayoutTests/fast/canvas/philip/tests/type.name.html
new file mode 100644
index 0000000..c41588d
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/type.name.html
@@ -0,0 +1,33 @@
+<!DOCTYPE html>
+<title>Canvas test: type.name</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="fallback.nested.html" title="fallback.nested">
+<link rel="next" href="type.exists.html" title="type.exists">
+<body class="show_output">
+<p>
+ <a href="fallback.nested.html" accesskey="p" title="[p] fallback.nested"><</a>
+ <a href="index.html">[index]</a>
+ <a href="type.exists.html" accesskey="n" title="[n] type.exists">></a>
+<h1><a href="index.type.html">type</a>.name</h1>
+<p class="desc">HTMLCanvasElement type and toString</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.canvas.type">canvas.type</a>
+
+</ul>
+</div>
+
+<p class="output">Actual output:</p>
+<canvas id="c" class="output" width="100" height="50"><p class="fallback">FAIL (fallback content)</p></canvas>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assertSame(Object.prototype.toString.call(canvas), '[object HTMLCanvasElement]', "Object.prototype.toString.call(canvas)", "'[object HTMLCanvasElement]'");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/type.prototype.html b/LayoutTests/fast/canvas/philip/tests/type.prototype.html
new file mode 100644
index 0000000..9e47618
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/type.prototype.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<title>Canvas test: type.prototype</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="type.delete.html" title="type.delete">
+<link rel="next" href="type.replace.html" title="type.replace">
+<body class="show_output">
+<p>
+ <a href="type.delete.html" accesskey="p" title="[p] type.delete"><</a>
+ <a href="index.html">[index]</a>
+ <a href="type.replace.html" accesskey="n" title="[n] type.replace">></a>
+<h1><a href="index.type.html">type</a>.prototype</h1>
+<p class="desc">window.HTMLCanvasElement has prototype, which is { ReadOnly, DontDelete }. prototype has getContext, which is not</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.canvas.type">canvas.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>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+_assert(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype");
+_assert(window.HTMLCanvasElement.prototype.getContext, "window.HTMLCanvasElement.prototype.getContext");
+window.HTMLCanvasElement.prototype = null;
+_assert(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype");
+delete window.HTMLCanvasElement.prototype;
+_assert(window.HTMLCanvasElement.prototype, "window.HTMLCanvasElement.prototype");
+window.HTMLCanvasElement.prototype.getContext = 1;
+_assertSame(window.HTMLCanvasElement.prototype.getContext, 1, "window.HTMLCanvasElement.prototype.getContext", "1");
+delete window.HTMLCanvasElement.prototype.getContext;
+_assertSame(window.HTMLCanvasElement.prototype.getContext, undefined, "window.HTMLCanvasElement.prototype.getContext", "undefined");
+
+
+});
+</script>
+
diff --git a/LayoutTests/fast/canvas/philip/tests/type.replace.html b/LayoutTests/fast/canvas/philip/tests/type.replace.html
new file mode 100644
index 0000000..638a3d8
--- /dev/null
+++ b/LayoutTests/fast/canvas/philip/tests/type.replace.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<title>Canvas test: type.replace</title>
+<script src="../tests.js"></script>
+<link rel="stylesheet" href="../tests.css">
+<link rel="prev" href="type.prototype.html" title="type.prototype">
+<link rel="next" href="type.extend.html" title="type.extend">
+<body class="show_output">
+<p>
+ <a href="type.prototype.html" accesskey="p" title="[p] type.prototype"><</a>
+ <a href="index.html">[index]</a>
+ <a href="type.extend.html" accesskey="n" title="[n] type.extend">></a>
+<h1><a href="index.type.html">type</a>.replace</h1>
+<p class="desc">HTMLCanvasElement methods can be replaced, and the replacement methods used by canvases</p>
+<div class="refs">References:
+<ul>
+<li><a href="spec.html#testrefs.canvas.type">canvas.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>
+
+<ul id="d"></ul>
+<script>
+_addTest(function(canvas, ctx) {
+
+window.HTMLCanvasElement.prototype.getContext = function (name) { return 0; };
+_assertSame(canvas.getContext('2d'), 0, "canvas.getContext('2d')", "0");
+
+
+});
+</script>
+