From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- .../2d.conformance.requirements.basics.html | 62 ++++ .../2d.conformance.requirements.basics.worker.js | 58 ++++ .../2d.conformance.requirements.missingargs.html | 141 +++++++++ ....conformance.requirements.missingargs.worker.js | 137 +++++++++ .../tests/html/canvas/offscreen/META.yml | 7 + .../tests/html/canvas/offscreen/WEB_FEATURES.yml | 3 + .../2d.canvas.context.arguments.missing.html | 28 ++ .../2d.canvas.context.arguments.missing.worker.js | 23 ++ .../2d.canvas.context.casesensitive.html | 28 ++ .../2d.canvas.context.casesensitive.worker.js | 23 ++ .../2d.canvas.context.emptystring.html | 28 ++ .../2d.canvas.context.emptystring.worker.js | 23 ++ .../canvas-context/2d.canvas.context.exists.html | 28 ++ .../2d.canvas.context.exists.worker.js | 23 ++ .../2d.canvas.context.extraargs.cache.html | 32 ++ .../2d.canvas.context.extraargs.cache.worker.js | 27 ++ .../2d.canvas.context.extraargs.create.html | 32 ++ .../2d.canvas.context.extraargs.create.worker.js | 27 ++ .../canvas-context/2d.canvas.context.shared.html | 31 ++ .../2d.canvas.context.shared.worker.js | 26 ++ .../canvas-context/2d.canvas.context.unique.html | 28 ++ .../2d.canvas.context.unique.worker.js | 23 ++ .../2d.canvas.context.unrecognised.badname.html | 28 ++ ...d.canvas.context.unrecognised.badname.worker.js | 23 ++ .../2d.canvas.context.unrecognised.badsuffix.html | 28 ++ ...canvas.context.unrecognised.badsuffix.worker.js | 23 ++ .../2d.canvas.context.unrecognised.nullsuffix.html | 28 ++ ...anvas.context.unrecognised.nullsuffix.worker.js | 23 ++ .../2d.canvas.context.unrecognised.unicode.html | 28 ++ ...d.canvas.context.unrecognised.unicode.worker.js | 23 ++ .../canvas-context/2d.getContext.options.any.js | 46 +++ .../canvas-host/2d.canvas.host.initial.color.html | 27 ++ .../2d.canvas.host.initial.color.worker.js | 22 ++ .../2d.canvas.host.initial.reset.2dstate.html | 89 ++++++ .../2d.canvas.host.initial.reset.2dstate.worker.js | 84 +++++ .../2d.canvas.host.initial.reset.clip.html | 33 ++ .../2d.canvas.host.initial.reset.clip.worker.js | 28 ++ .../2d.canvas.host.initial.reset.different.html | 31 ++ ...d.canvas.host.initial.reset.different.worker.js | 26 ++ .../2d.canvas.host.initial.reset.gradient.html | 36 +++ ...2d.canvas.host.initial.reset.gradient.worker.js | 31 ++ .../2d.canvas.host.initial.reset.path.html | 32 ++ .../2d.canvas.host.initial.reset.path.worker.js | 27 ++ .../2d.canvas.host.initial.reset.pattern.html | 36 +++ .../2d.canvas.host.initial.reset.pattern.worker.js | 31 ++ .../2d.canvas.host.initial.reset.same.html | 32 ++ .../2d.canvas.host.initial.reset.same.worker.js | 27 ++ .../2d.canvas.host.initial.reset.transform.html | 32 ++ ...d.canvas.host.initial.reset.transform.worker.js | 27 ++ .../canvas-host/2d.canvas.host.readonly.html | 31 ++ .../canvas-host/2d.canvas.host.readonly.worker.js | 26 ++ .../canvas-host/2d.canvas.host.reference.html | 27 ++ .../canvas-host/2d.canvas.host.reference.worker.js | 22 ++ .../2d.canvas.host.size.attributes.default.html | 28 ++ ...d.canvas.host.size.attributes.default.worker.js | 23 ++ .../2d.canvas.host.size.attributes.idl.html | 42 +++ ...d.canvas.host.size.attributes.idl.set.zero.html | 30 ++ ...vas.host.size.attributes.idl.set.zero.worker.js | 25 ++ .../2d.canvas.host.size.attributes.idl.worker.js | 37 +++ ....canvas.host.size.attributes.parse.decimal.html | 30 ++ ...as.host.size.attributes.parse.decimal.worker.js | 25 ++ .../2d.canvas.host.size.attributes.parse.em.html | 27 ++ ....canvas.host.size.attributes.parse.em.worker.js | 22 ++ ...2d.canvas.host.size.attributes.parse.empty.html | 30 ++ ...nvas.host.size.attributes.parse.empty.worker.js | 25 ++ .../2d.canvas.host.size.attributes.parse.exp.html | 30 ++ ...canvas.host.size.attributes.parse.exp.worker.js | 25 ++ .../2d.canvas.host.size.attributes.parse.hex.html | 30 ++ ...canvas.host.size.attributes.parse.hex.worker.js | 25 ++ .../2d.canvas.host.size.attributes.parse.junk.html | 27 ++ ...anvas.host.size.attributes.parse.junk.worker.js | 22 ++ ...2d.canvas.host.size.attributes.parse.minus.html | 27 ++ ...nvas.host.size.attributes.parse.minus.worker.js | 22 ++ ...2d.canvas.host.size.attributes.parse.octal.html | 30 ++ ...nvas.host.size.attributes.parse.octal.worker.js | 25 ++ ...anvas.host.size.attributes.parse.onlyspace.html | 30 ++ ....host.size.attributes.parse.onlyspace.worker.js | 25 ++ ....canvas.host.size.attributes.parse.percent.html | 27 ++ ...as.host.size.attributes.parse.percent.worker.js | 22 ++ .../2d.canvas.host.size.attributes.parse.plus.html | 30 ++ ...anvas.host.size.attributes.parse.plus.worker.js | 25 ++ ...2d.canvas.host.size.attributes.parse.space.html | 30 ++ ...nvas.host.size.attributes.parse.space.worker.js | 25 ++ ...as.host.size.attributes.parse.trailingjunk.html | 27 ++ ...st.size.attributes.parse.trailingjunk.worker.js | 22 ++ ...nvas.host.size.attributes.parse.whitespace.html | 30 ++ ...host.size.attributes.parse.whitespace.worker.js | 25 ++ .../2d.canvas.host.size.attributes.parse.zero.html | 30 ++ ...anvas.host.size.attributes.parse.zero.worker.js | 25 ++ ...canvas.host.size.attributes.reflect.setidl.html | 30 ++ ...s.host.size.attributes.reflect.setidl.worker.js | 25 ++ ...as.host.size.attributes.reflect.setidlzero.html | 30 ++ ...st.size.attributes.reflect.setidlzero.worker.js | 25 ++ .../canvas-host/2d.canvas.host.size.large.html | 31 ++ .../2d.canvas.host.size.large.worker.js | 26 ++ .../compositing/2d.composite.canvas.clear.html | 46 +++ .../2d.composite.canvas.clear.worker.js | 41 +++ .../compositing/2d.composite.canvas.copy.html | 46 +++ .../compositing/2d.composite.canvas.copy.worker.js | 41 +++ .../2d.composite.canvas.destination-atop.html | 46 +++ .../2d.composite.canvas.destination-atop.worker.js | 41 +++ .../2d.composite.canvas.destination-in.html | 46 +++ .../2d.composite.canvas.destination-in.worker.js | 41 +++ .../2d.composite.canvas.destination-out.html | 46 +++ .../2d.composite.canvas.destination-out.worker.js | 41 +++ .../2d.composite.canvas.destination-over.html | 46 +++ .../2d.composite.canvas.destination-over.worker.js | 41 +++ .../compositing/2d.composite.canvas.lighter.html | 46 +++ .../2d.composite.canvas.lighter.worker.js | 41 +++ .../2d.composite.canvas.source-atop.html | 46 +++ .../2d.composite.canvas.source-atop.worker.js | 41 +++ .../compositing/2d.composite.canvas.source-in.html | 46 +++ .../2d.composite.canvas.source-in.worker.js | 41 +++ .../2d.composite.canvas.source-out.html | 46 +++ .../2d.composite.canvas.source-out.worker.js | 41 +++ .../2d.composite.canvas.source-over.html | 46 +++ .../2d.composite.canvas.source-over.worker.js | 41 +++ .../compositing/2d.composite.canvas.xor.html | 46 +++ .../compositing/2d.composite.canvas.xor.worker.js | 41 +++ .../compositing/2d.composite.clip.clear.html | 35 +++ .../compositing/2d.composite.clip.clear.worker.js | 30 ++ .../compositing/2d.composite.clip.copy.html | 35 +++ .../compositing/2d.composite.clip.copy.worker.js | 30 ++ .../2d.composite.clip.destination-atop.html | 35 +++ .../2d.composite.clip.destination-atop.worker.js | 30 ++ .../2d.composite.clip.destination-in.html | 35 +++ .../2d.composite.clip.destination-in.worker.js | 30 ++ .../2d.composite.clip.destination-out.html | 35 +++ .../2d.composite.clip.destination-out.worker.js | 30 ++ .../2d.composite.clip.destination-over.html | 35 +++ .../2d.composite.clip.destination-over.worker.js | 30 ++ .../compositing/2d.composite.clip.lighter.html | 35 +++ .../2d.composite.clip.lighter.worker.js | 30 ++ .../compositing/2d.composite.clip.source-atop.html | 35 +++ .../2d.composite.clip.source-atop.worker.js | 30 ++ .../compositing/2d.composite.clip.source-in.html | 35 +++ .../2d.composite.clip.source-in.worker.js | 30 ++ .../compositing/2d.composite.clip.source-out.html | 35 +++ .../2d.composite.clip.source-out.worker.js | 30 ++ .../compositing/2d.composite.clip.source-over.html | 35 +++ .../2d.composite.clip.source-over.worker.js | 30 ++ .../compositing/2d.composite.clip.xor.html | 35 +++ .../compositing/2d.composite.clip.xor.worker.js | 30 ++ .../2d.composite.globalAlpha.canvas.html | 36 +++ .../2d.composite.globalAlpha.canvas.worker.js | 31 ++ .../2d.composite.globalAlpha.canvascopy.html | 36 +++ .../2d.composite.globalAlpha.canvascopy.worker.js | 31 ++ .../2d.composite.globalAlpha.canvaspattern.html | 37 +++ ...d.composite.globalAlpha.canvaspattern.worker.js | 32 ++ .../2d.composite.globalAlpha.default.html | 27 ++ .../2d.composite.globalAlpha.default.worker.js | 22 ++ .../compositing/2d.composite.globalAlpha.fill.html | 33 ++ .../2d.composite.globalAlpha.fill.worker.js | 28 ++ .../2d.composite.globalAlpha.image.html | 30 ++ .../2d.composite.globalAlpha.image.worker.js | 26 ++ .../2d.composite.globalAlpha.imagepattern.html | 31 ++ ...2d.composite.globalAlpha.imagepattern.worker.js | 27 ++ .../2d.composite.globalAlpha.invalid.html | 36 +++ .../2d.composite.globalAlpha.invalid.worker.js | 31 ++ .../2d.composite.globalAlpha.range.html | 39 +++ .../2d.composite.globalAlpha.range.worker.js | 34 +++ .../compositing/2d.composite.image.clear.html | 43 +++ .../compositing/2d.composite.image.clear.worker.js | 38 +++ .../compositing/2d.composite.image.copy.html | 43 +++ .../compositing/2d.composite.image.copy.worker.js | 38 +++ .../2d.composite.image.destination-atop.html | 43 +++ .../2d.composite.image.destination-atop.worker.js | 38 +++ .../2d.composite.image.destination-in.html | 43 +++ .../2d.composite.image.destination-in.worker.js | 38 +++ .../2d.composite.image.destination-out.html | 43 +++ .../2d.composite.image.destination-out.worker.js | 38 +++ .../2d.composite.image.destination-over.html | 43 +++ .../2d.composite.image.destination-over.worker.js | 38 +++ .../compositing/2d.composite.image.lighter.html | 43 +++ .../2d.composite.image.lighter.worker.js | 38 +++ .../2d.composite.image.source-atop.html | 43 +++ .../2d.composite.image.source-atop.worker.js | 38 +++ .../compositing/2d.composite.image.source-in.html | 43 +++ .../2d.composite.image.source-in.worker.js | 38 +++ .../compositing/2d.composite.image.source-out.html | 43 +++ .../2d.composite.image.source-out.worker.js | 38 +++ .../2d.composite.image.source-over.html | 43 +++ .../2d.composite.image.source-over.worker.js | 38 +++ .../compositing/2d.composite.image.xor.html | 43 +++ .../compositing/2d.composite.image.xor.worker.js | 38 +++ .../2d.composite.operation.casesensitive.html | 29 ++ .../2d.composite.operation.casesensitive.worker.js | 24 ++ .../compositing/2d.composite.operation.clear.html | 29 ++ .../2d.composite.operation.clear.worker.js | 24 ++ .../compositing/2d.composite.operation.darker.html | 29 ++ .../2d.composite.operation.darker.worker.js | 24 ++ .../2d.composite.operation.default.html | 27 ++ .../2d.composite.operation.default.worker.js | 22 ++ .../compositing/2d.composite.operation.get.html | 34 +++ .../2d.composite.operation.get.worker.js | 29 ++ .../2d.composite.operation.highlight.html | 29 ++ .../2d.composite.operation.highlight.worker.js | 24 ++ .../2d.composite.operation.nullsuffix.html | 29 ++ .../2d.composite.operation.nullsuffix.worker.js | 24 ++ .../compositing/2d.composite.operation.over.html | 29 ++ .../2d.composite.operation.over.worker.js | 24 ++ .../2d.composite.operation.unrecognised.html | 29 ++ .../2d.composite.operation.unrecognised.worker.js | 24 ++ .../compositing/2d.composite.solid.clear.html | 32 ++ .../compositing/2d.composite.solid.clear.worker.js | 27 ++ .../compositing/2d.composite.solid.copy.html | 32 ++ .../compositing/2d.composite.solid.copy.worker.js | 27 ++ .../2d.composite.solid.destination-atop.html | 32 ++ .../2d.composite.solid.destination-atop.worker.js | 27 ++ .../2d.composite.solid.destination-in.html | 32 ++ .../2d.composite.solid.destination-in.worker.js | 27 ++ .../2d.composite.solid.destination-out.html | 32 ++ .../2d.composite.solid.destination-out.worker.js | 27 ++ .../2d.composite.solid.destination-over.html | 32 ++ .../2d.composite.solid.destination-over.worker.js | 27 ++ .../compositing/2d.composite.solid.lighter.html | 32 ++ .../2d.composite.solid.lighter.worker.js | 27 ++ .../2d.composite.solid.source-atop.html | 32 ++ .../2d.composite.solid.source-atop.worker.js | 27 ++ .../compositing/2d.composite.solid.source-in.html | 32 ++ .../2d.composite.solid.source-in.worker.js | 27 ++ .../compositing/2d.composite.solid.source-out.html | 32 ++ .../2d.composite.solid.source-out.worker.js | 27 ++ .../2d.composite.solid.source-over.html | 32 ++ .../2d.composite.solid.source-over.worker.js | 27 ++ .../compositing/2d.composite.solid.xor.html | 32 ++ .../compositing/2d.composite.solid.xor.worker.js | 27 ++ .../2d.composite.transparent.clear.html | 32 ++ .../2d.composite.transparent.clear.worker.js | 27 ++ .../compositing/2d.composite.transparent.copy.html | 32 ++ .../2d.composite.transparent.copy.worker.js | 27 ++ .../2d.composite.transparent.destination-atop.html | 32 ++ ...omposite.transparent.destination-atop.worker.js | 27 ++ .../2d.composite.transparent.destination-in.html | 32 ++ ....composite.transparent.destination-in.worker.js | 27 ++ .../2d.composite.transparent.destination-out.html | 32 ++ ...composite.transparent.destination-out.worker.js | 27 ++ .../2d.composite.transparent.destination-over.html | 32 ++ ...omposite.transparent.destination-over.worker.js | 27 ++ .../2d.composite.transparent.lighter.html | 32 ++ .../2d.composite.transparent.lighter.worker.js | 27 ++ .../2d.composite.transparent.source-atop.html | 32 ++ .../2d.composite.transparent.source-atop.worker.js | 27 ++ .../2d.composite.transparent.source-in.html | 32 ++ .../2d.composite.transparent.source-in.worker.js | 27 ++ .../2d.composite.transparent.source-out.html | 32 ++ .../2d.composite.transparent.source-out.worker.js | 27 ++ .../2d.composite.transparent.source-over.html | 32 ++ .../2d.composite.transparent.source-over.worker.js | 27 ++ .../compositing/2d.composite.transparent.xor.html | 32 ++ .../2d.composite.transparent.xor.worker.js | 27 ++ .../2d.composite.uncovered.fill.copy.html | 33 ++ .../2d.composite.uncovered.fill.copy.worker.js | 28 ++ ....composite.uncovered.fill.destination-atop.html | 33 ++ ...osite.uncovered.fill.destination-atop.worker.js | 28 ++ ...2d.composite.uncovered.fill.destination-in.html | 34 +++ ...mposite.uncovered.fill.destination-in.worker.js | 29 ++ .../2d.composite.uncovered.fill.source-in.html | 33 ++ ...2d.composite.uncovered.fill.source-in.worker.js | 28 ++ .../2d.composite.uncovered.fill.source-out.html | 33 ++ ...d.composite.uncovered.fill.source-out.worker.js | 28 ++ .../2d.composite.uncovered.image.copy.html | 44 +++ .../2d.composite.uncovered.image.copy.worker.js | 39 +++ ...composite.uncovered.image.destination-atop.html | 44 +++ ...site.uncovered.image.destination-atop.worker.js | 39 +++ ...d.composite.uncovered.image.destination-in.html | 44 +++ ...posite.uncovered.image.destination-in.worker.js | 39 +++ .../2d.composite.uncovered.image.source-in.html | 44 +++ ...d.composite.uncovered.image.source-in.worker.js | 39 +++ .../2d.composite.uncovered.image.source-out.html | 44 +++ ....composite.uncovered.image.source-out.worker.js | 39 +++ .../2d.composite.uncovered.nocontext.copy.html | 32 ++ ...2d.composite.uncovered.nocontext.copy.worker.js | 27 ++ ...osite.uncovered.nocontext.destination-atop.html | 32 ++ ....uncovered.nocontext.destination-atop.worker.js | 27 ++ ...mposite.uncovered.nocontext.destination-in.html | 32 ++ ...te.uncovered.nocontext.destination-in.worker.js | 27 ++ ...2d.composite.uncovered.nocontext.source-in.html | 32 ++ ...mposite.uncovered.nocontext.source-in.worker.js | 27 ++ ...d.composite.uncovered.nocontext.source-out.html | 32 ++ ...posite.uncovered.nocontext.source-out.worker.js | 27 ++ .../2d.composite.uncovered.pattern.copy.html | 44 +++ .../2d.composite.uncovered.pattern.copy.worker.js | 39 +++ ...mposite.uncovered.pattern.destination-atop.html | 44 +++ ...te.uncovered.pattern.destination-atop.worker.js | 39 +++ ...composite.uncovered.pattern.destination-in.html | 44 +++ ...site.uncovered.pattern.destination-in.worker.js | 39 +++ .../2d.composite.uncovered.pattern.source-in.html | 44 +++ ...composite.uncovered.pattern.source-in.worker.js | 39 +++ .../2d.composite.uncovered.pattern.source-out.html | 44 +++ ...omposite.uncovered.pattern.source-out.worker.js | 39 +++ .../2d.conformance.requirements.basics.html | 62 ++++ .../2d.conformance.requirements.basics.worker.js | 57 ++++ .../2d.conformance.requirements.missingargs.html | 141 +++++++++ ....conformance.requirements.missingargs.worker.js | 136 +++++++++ .../2d.drawImage.3arg.html | 37 +++ .../2d.drawImage.3arg.worker.js | 33 ++ .../2d.drawImage.5arg.html | 38 +++ .../2d.drawImage.5arg.worker.js | 34 +++ .../2d.drawImage.9arg.basic.html | 31 ++ .../2d.drawImage.9arg.basic.worker.js | 27 ++ .../2d.drawImage.9arg.destpos.html | 37 +++ .../2d.drawImage.9arg.destpos.worker.js | 33 ++ .../2d.drawImage.9arg.destsize.html | 39 +++ .../2d.drawImage.9arg.destsize.worker.js | 35 +++ .../2d.drawImage.9arg.sourcepos.html | 30 ++ .../2d.drawImage.9arg.sourcepos.worker.js | 26 ++ .../2d.drawImage.9arg.sourcesize.html | 37 +++ .../2d.drawImage.9arg.sourcesize.worker.js | 33 ++ .../2d.drawImage.alpha.html | 29 ++ .../2d.drawImage.alpha.worker.js | 25 ++ .../2d.drawImage.broken.html | 24 ++ .../2d.drawImage.broken.worker.js | 20 ++ .../2d.drawImage.canvas.html | 36 +++ .../2d.drawImage.canvas.worker.js | 31 ++ .../2d.drawImage.clip.html | 34 +++ .../2d.drawImage.clip.worker.js | 30 ++ .../2d.drawImage.composite.html | 29 ++ .../2d.drawImage.composite.worker.js | 25 ++ .../2d.drawImage.floatsource.html | 25 ++ .../2d.drawImage.floatsource.worker.js | 21 ++ .../2d.drawImage.negativedest.html | 37 +++ .../2d.drawImage.negativedest.worker.js | 33 ++ .../2d.drawImage.negativedir.html | 37 +++ .../2d.drawImage.negativedir.worker.js | 33 ++ .../2d.drawImage.negativesource.html | 37 +++ .../2d.drawImage.negativesource.worker.js | 33 ++ .../2d.drawImage.nonfinite.html | 328 ++++++++++++++++++++ .../2d.drawImage.nonfinite.worker.js | 324 ++++++++++++++++++++ .../2d.drawImage.nowrap.html | 30 ++ .../2d.drawImage.nowrap.worker.js | 26 ++ .../2d.drawImage.null.html | 27 ++ .../2d.drawImage.null.worker.js | 22 ++ .../2d.drawImage.path.html | 29 ++ .../2d.drawImage.path.worker.js | 25 ++ .../2d.drawImage.self.1.html | 36 +++ .../2d.drawImage.self.1.worker.js | 31 ++ .../2d.drawImage.self.2.html | 38 +++ .../2d.drawImage.self.2.worker.js | 33 ++ .../2d.drawImage.svg.html | 30 ++ .../2d.drawImage.transform.html | 29 ++ .../2d.drawImage.transform.worker.js | 25 ++ .../2d.drawImage.wrongtype.html | 29 ++ .../2d.drawImage.wrongtype.worker.js | 24 ++ .../2d.drawImage.zerocanvas.html | 36 +++ .../2d.drawImage.zerocanvas.worker.js | 31 ++ .../2d.drawImage.zerosource.html | 29 ++ .../2d.drawImage.zerosource.image.html | 39 +++ .../2d.drawImage.zerosource.worker.js | 25 ++ .../2d.clearRect.basic.html | 30 ++ .../2d.clearRect.basic.worker.js | 25 ++ .../2d.clearRect.clip.html | 35 +++ .../2d.clearRect.clip.worker.js | 30 ++ .../2d.clearRect.globalalpha.html | 31 ++ .../2d.clearRect.globalalpha.worker.js | 26 ++ .../2d.clearRect.globalcomposite.html | 31 ++ .../2d.clearRect.globalcomposite.worker.js | 26 ++ .../2d.clearRect.negative.html | 36 +++ .../2d.clearRect.negative.worker.js | 31 ++ .../2d.clearRect.nonfinite.html | 52 ++++ .../2d.clearRect.nonfinite.worker.js | 47 +++ .../2d.clearRect.path.html | 32 ++ .../2d.clearRect.path.worker.js | 27 ++ .../2d.clearRect.shadow.html | 34 +++ .../2d.clearRect.shadow.worker.js | 29 ++ .../2d.clearRect.transform.html | 32 ++ .../2d.clearRect.transform.worker.js | 27 ++ .../2d.clearRect.zero.html | 32 ++ .../2d.clearRect.zero.worker.js | 27 ++ .../2d.fillRect.basic.html | 29 ++ .../2d.fillRect.basic.worker.js | 24 ++ .../2d.fillRect.clip.html | 36 +++ .../2d.fillRect.clip.worker.js | 31 ++ .../2d.fillRect.negative.html | 37 +++ .../2d.fillRect.negative.worker.js | 32 ++ .../2d.fillRect.nonfinite.html | 53 ++++ .../2d.fillRect.nonfinite.worker.js | 48 +++ .../2d.fillRect.path.html | 33 ++ .../2d.fillRect.path.worker.js | 28 ++ .../2d.fillRect.shadow.html | 34 +++ .../2d.fillRect.shadow.worker.js | 29 ++ .../2d.fillRect.transform.html | 31 ++ .../2d.fillRect.transform.worker.js | 26 ++ .../2d.fillRect.zero.html | 33 ++ .../2d.fillRect.zero.worker.js | 28 ++ .../2d.strokeRect.basic.html | 30 ++ .../2d.strokeRect.basic.worker.js | 25 ++ .../2d.strokeRect.clip.html | 37 +++ .../2d.strokeRect.clip.worker.js | 32 ++ .../2d.strokeRect.globalalpha.html | 31 ++ .../2d.strokeRect.globalalpha.worker.js | 26 ++ .../2d.strokeRect.globalcomposite.html | 31 ++ .../2d.strokeRect.globalcomposite.worker.js | 26 ++ .../2d.strokeRect.negative.html | 38 +++ .../2d.strokeRect.negative.worker.js | 33 ++ .../2d.strokeRect.nonfinite.html | 54 ++++ .../2d.strokeRect.nonfinite.worker.js | 49 +++ .../2d.strokeRect.path.html | 34 +++ .../2d.strokeRect.path.worker.js | 29 ++ .../2d.strokeRect.shadow.html | 37 +++ .../2d.strokeRect.shadow.worker.js | 32 ++ .../2d.strokeRect.transform.html | 32 ++ .../2d.strokeRect.transform.worker.js | 27 ++ .../2d.strokeRect.zero.1.html | 30 ++ .../2d.strokeRect.zero.1.worker.js | 25 ++ .../2d.strokeRect.zero.2.html | 32 ++ .../2d.strokeRect.zero.2.worker.js | 27 ++ .../2d.strokeRect.zero.3.html | 30 ++ .../2d.strokeRect.zero.3.worker.js | 25 ++ .../2d.strokeRect.zero.4.html | 31 ++ .../2d.strokeRect.zero.4.worker.js | 26 ++ .../2d.strokeRect.zero.5.html | 31 ++ .../2d.strokeRect.zero.5.worker.js | 26 ++ .../2d.fillStyle.CSSHSL.html | 51 ++++ .../2d.fillStyle.CSSRGB.html | 60 ++++ .../2d.fillStyle.colormix.html | 30 ++ .../2d.fillStyle.colormix.worker.js | 25 ++ .../2d.fillStyle.default.html | 27 ++ .../2d.fillStyle.default.worker.js | 22 ++ .../2d.fillStyle.get.halftransparent.html | 28 ++ .../2d.fillStyle.get.halftransparent.worker.js | 23 ++ .../2d.fillStyle.get.semitransparent.html | 28 ++ .../2d.fillStyle.get.semitransparent.worker.js | 23 ++ .../2d.fillStyle.get.solid.html | 28 ++ .../2d.fillStyle.get.solid.worker.js | 23 ++ .../2d.fillStyle.get.transparent.html | 28 ++ .../2d.fillStyle.get.transparent.worker.js | 23 ++ .../2d.fillStyle.invalidstring.html | 32 ++ .../2d.fillStyle.invalidstring.worker.js | 27 ++ .../2d.fillStyle.invalidtype.html | 32 ++ .../2d.fillStyle.invalidtype.worker.js | 27 ++ .../2d.fillStyle.parse.css-color-4-hsl-1.html | 30 ++ .../2d.fillStyle.parse.css-color-4-hsl-1.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsl-2.html | 30 ++ .../2d.fillStyle.parse.css-color-4-hsl-2.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsl-3.html | 30 ++ .../2d.fillStyle.parse.css-color-4-hsl-3.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsl-4.html | 30 ++ .../2d.fillStyle.parse.css-color-4-hsl-4.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsl-5.html | 30 ++ .../2d.fillStyle.parse.css-color-4-hsl-5.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsl-6.html | 30 ++ .../2d.fillStyle.parse.css-color-4-hsl-6.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsl-7.html | 30 ++ .../2d.fillStyle.parse.css-color-4-hsl-7.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsl-8.html | 30 ++ .../2d.fillStyle.parse.css-color-4-hsl-8.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsl-9.html | 30 ++ .../2d.fillStyle.parse.css-color-4-hsl-9.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsla-1.html | 30 ++ ...2d.fillStyle.parse.css-color-4-hsla-1.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsla-2.html | 30 ++ ...2d.fillStyle.parse.css-color-4-hsla-2.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsla-3.html | 30 ++ ...2d.fillStyle.parse.css-color-4-hsla-3.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsla-4.html | 30 ++ ...2d.fillStyle.parse.css-color-4-hsla-4.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsla-5.html | 30 ++ ...2d.fillStyle.parse.css-color-4-hsla-5.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsla-6.html | 30 ++ ...2d.fillStyle.parse.css-color-4-hsla-6.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsla-7.html | 30 ++ ...2d.fillStyle.parse.css-color-4-hsla-7.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsla-8.html | 30 ++ ...2d.fillStyle.parse.css-color-4-hsla-8.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-hsla-9.html | 30 ++ ...2d.fillStyle.parse.css-color-4-hsla-9.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-rgb-1.html | 30 ++ .../2d.fillStyle.parse.css-color-4-rgb-1.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-rgb-2.html | 30 ++ .../2d.fillStyle.parse.css-color-4-rgb-2.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-rgb-3.html | 30 ++ .../2d.fillStyle.parse.css-color-4-rgb-3.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-rgb-4.html | 30 ++ .../2d.fillStyle.parse.css-color-4-rgb-4.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-rgb-5.html | 30 ++ .../2d.fillStyle.parse.css-color-4-rgb-5.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-rgb-6.html | 30 ++ .../2d.fillStyle.parse.css-color-4-rgb-6.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-rgba-1.html | 30 ++ ...2d.fillStyle.parse.css-color-4-rgba-1.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-rgba-2.html | 30 ++ ...2d.fillStyle.parse.css-color-4-rgba-2.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-rgba-3.html | 30 ++ ...2d.fillStyle.parse.css-color-4-rgba-3.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-rgba-4.html | 30 ++ ...2d.fillStyle.parse.css-color-4-rgba-4.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-rgba-5.html | 30 ++ ...2d.fillStyle.parse.css-color-4-rgba-5.worker.js | 25 ++ .../2d.fillStyle.parse.css-color-4-rgba-6.html | 30 ++ ...2d.fillStyle.parse.css-color-4-rgba-6.worker.js | 25 ++ .../2d.fillStyle.parse.hex3.html | 30 ++ .../2d.fillStyle.parse.hex3.worker.js | 25 ++ .../2d.fillStyle.parse.hex4.html | 30 ++ .../2d.fillStyle.parse.hex4.worker.js | 25 ++ .../2d.fillStyle.parse.hex6.html | 30 ++ .../2d.fillStyle.parse.hex6.worker.js | 25 ++ .../2d.fillStyle.parse.hex8.html | 30 ++ .../2d.fillStyle.parse.hex8.worker.js | 25 ++ .../2d.fillStyle.parse.hsl-1.html | 30 ++ .../2d.fillStyle.parse.hsl-1.worker.js | 25 ++ .../2d.fillStyle.parse.hsl-2.html | 30 ++ .../2d.fillStyle.parse.hsl-2.worker.js | 25 ++ .../2d.fillStyle.parse.hsl-3.html | 30 ++ .../2d.fillStyle.parse.hsl-3.worker.js | 25 ++ .../2d.fillStyle.parse.hsl-4.html | 30 ++ .../2d.fillStyle.parse.hsl-4.worker.js | 25 ++ .../2d.fillStyle.parse.hsl-5.html | 30 ++ .../2d.fillStyle.parse.hsl-5.worker.js | 25 ++ .../2d.fillStyle.parse.hsl-6.html | 30 ++ .../2d.fillStyle.parse.hsl-6.worker.js | 25 ++ .../2d.fillStyle.parse.hsl-clamp-1.html | 30 ++ .../2d.fillStyle.parse.hsl-clamp-1.worker.js | 25 ++ .../2d.fillStyle.parse.hsl-clamp-2.html | 30 ++ .../2d.fillStyle.parse.hsl-clamp-2.worker.js | 25 ++ .../2d.fillStyle.parse.hsl-clamp-3.html | 30 ++ .../2d.fillStyle.parse.hsl-clamp-3.worker.js | 25 ++ .../2d.fillStyle.parse.hsl-clamp-4.html | 30 ++ .../2d.fillStyle.parse.hsl-clamp-4.worker.js | 25 ++ .../2d.fillStyle.parse.hsla-1.html | 30 ++ .../2d.fillStyle.parse.hsla-1.worker.js | 25 ++ .../2d.fillStyle.parse.hsla-2.html | 30 ++ .../2d.fillStyle.parse.hsla-2.worker.js | 25 ++ .../2d.fillStyle.parse.hsla-clamp-1.html | 30 ++ .../2d.fillStyle.parse.hsla-clamp-1.worker.js | 25 ++ .../2d.fillStyle.parse.hsla-clamp-2.html | 30 ++ .../2d.fillStyle.parse.hsla-clamp-2.worker.js | 25 ++ .../2d.fillStyle.parse.hsla-clamp-3.html | 30 ++ .../2d.fillStyle.parse.hsla-clamp-3.worker.js | 25 ++ .../2d.fillStyle.parse.hsla-clamp-4.html | 30 ++ .../2d.fillStyle.parse.hsla-clamp-4.worker.js | 25 ++ .../2d.fillStyle.parse.hsla-clamp-5.html | 30 ++ .../2d.fillStyle.parse.hsla-clamp-5.worker.js | 25 ++ .../2d.fillStyle.parse.hsla-clamp-6.html | 30 ++ .../2d.fillStyle.parse.hsla-clamp-6.worker.js | 25 ++ .../2d.fillStyle.parse.html4.html | 30 ++ .../2d.fillStyle.parse.html4.worker.js | 25 ++ ....fillStyle.parse.invalid.css-color-4-hsl-1.html | 30 ++ ...Style.parse.invalid.css-color-4-hsl-1.worker.js | 25 ++ ....fillStyle.parse.invalid.css-color-4-hsl-2.html | 30 ++ ...Style.parse.invalid.css-color-4-hsl-2.worker.js | 25 ++ ....fillStyle.parse.invalid.css-color-4-hsl-3.html | 30 ++ ...Style.parse.invalid.css-color-4-hsl-3.worker.js | 25 ++ ....fillStyle.parse.invalid.css-color-4-hsl-4.html | 30 ++ ...Style.parse.invalid.css-color-4-hsl-4.worker.js | 25 ++ ....fillStyle.parse.invalid.css-color-4-hsl-5.html | 30 ++ ...Style.parse.invalid.css-color-4-hsl-5.worker.js | 25 ++ ...fillStyle.parse.invalid.css-color-4-hsla-1.html | 30 ++ ...tyle.parse.invalid.css-color-4-hsla-1.worker.js | 25 ++ ...fillStyle.parse.invalid.css-color-4-hsla-2.html | 30 ++ ...tyle.parse.invalid.css-color-4-hsla-2.worker.js | 25 ++ ...fillStyle.parse.invalid.css-color-4-hsla-3.html | 30 ++ ...tyle.parse.invalid.css-color-4-hsla-3.worker.js | 25 ++ ....fillStyle.parse.invalid.css-color-4-rgb-1.html | 30 ++ ...Style.parse.invalid.css-color-4-rgb-1.worker.js | 25 ++ ....fillStyle.parse.invalid.css-color-4-rgb-2.html | 30 ++ ...Style.parse.invalid.css-color-4-rgb-2.worker.js | 25 ++ ....fillStyle.parse.invalid.css-color-4-rgb-3.html | 30 ++ ...Style.parse.invalid.css-color-4-rgb-3.worker.js | 25 ++ ....fillStyle.parse.invalid.css-color-4-rgb-4.html | 30 ++ ...Style.parse.invalid.css-color-4-rgb-4.worker.js | 25 ++ ....fillStyle.parse.invalid.css-color-4-rgb-5.html | 30 ++ ...Style.parse.invalid.css-color-4-rgb-5.worker.js | 25 ++ ...fillStyle.parse.invalid.css-color-4-rgba-1.html | 30 ++ ...tyle.parse.invalid.css-color-4-rgba-1.worker.js | 25 ++ ...fillStyle.parse.invalid.css-color-4-rgba-2.html | 30 ++ ...tyle.parse.invalid.css-color-4-rgba-2.worker.js | 25 ++ ...fillStyle.parse.invalid.css-color-4-rgba-3.html | 30 ++ ...tyle.parse.invalid.css-color-4-rgba-3.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hex1.html | 30 ++ .../2d.fillStyle.parse.invalid.hex1.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hex2.html | 30 ++ .../2d.fillStyle.parse.invalid.hex2.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hex3.html | 30 ++ .../2d.fillStyle.parse.invalid.hex3.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hex4.html | 30 ++ .../2d.fillStyle.parse.invalid.hex4.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hex5.html | 30 ++ .../2d.fillStyle.parse.invalid.hex5.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hex6.html | 30 ++ .../2d.fillStyle.parse.invalid.hex6.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hex7.html | 30 ++ .../2d.fillStyle.parse.invalid.hex7.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hex8.html | 30 ++ .../2d.fillStyle.parse.invalid.hex8.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hsl-1.html | 30 ++ .../2d.fillStyle.parse.invalid.hsl-1.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hsl-2.html | 30 ++ .../2d.fillStyle.parse.invalid.hsl-2.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hsl-3.html | 30 ++ .../2d.fillStyle.parse.invalid.hsl-3.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hsl-4.html | 30 ++ .../2d.fillStyle.parse.invalid.hsl-4.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hsl-5.html | 30 ++ .../2d.fillStyle.parse.invalid.hsl-5.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hsl-6.html | 30 ++ .../2d.fillStyle.parse.invalid.hsl-6.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hsla-1.html | 30 ++ .../2d.fillStyle.parse.invalid.hsla-1.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hsla-2.html | 30 ++ .../2d.fillStyle.parse.invalid.hsla-2.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.hsla-3.html | 30 ++ .../2d.fillStyle.parse.invalid.hsla-3.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.name-1.html | 30 ++ .../2d.fillStyle.parse.invalid.name-1.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.name-2.html | 30 ++ .../2d.fillStyle.parse.invalid.name-2.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.name-3.html | 30 ++ .../2d.fillStyle.parse.invalid.name-3.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.name-4.html | 30 ++ .../2d.fillStyle.parse.invalid.name-4.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.name-5.html | 30 ++ .../2d.fillStyle.parse.invalid.name-5.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.rgb-1.html | 30 ++ .../2d.fillStyle.parse.invalid.rgb-1.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.rgb-2.html | 30 ++ .../2d.fillStyle.parse.invalid.rgb-2.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.rgb-3.html | 30 ++ .../2d.fillStyle.parse.invalid.rgb-3.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.rgba-1.html | 30 ++ .../2d.fillStyle.parse.invalid.rgba-1.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.rgba-2.html | 30 ++ .../2d.fillStyle.parse.invalid.rgba-2.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.rgba-3.html | 30 ++ .../2d.fillStyle.parse.invalid.rgba-3.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.rgba-4.html | 30 ++ .../2d.fillStyle.parse.invalid.rgba-4.worker.js | 25 ++ .../2d.fillStyle.parse.invalid.rgba-5.html | 30 ++ .../2d.fillStyle.parse.invalid.rgba-5.worker.js | 25 ++ .../2d.fillStyle.parse.rgb-clamp-1.html | 30 ++ .../2d.fillStyle.parse.rgb-clamp-1.worker.js | 25 ++ .../2d.fillStyle.parse.rgb-clamp-2.html | 30 ++ .../2d.fillStyle.parse.rgb-clamp-2.worker.js | 25 ++ .../2d.fillStyle.parse.rgb-clamp-3.html | 30 ++ .../2d.fillStyle.parse.rgb-clamp-3.worker.js | 25 ++ .../2d.fillStyle.parse.rgb-clamp-4.html | 30 ++ .../2d.fillStyle.parse.rgb-clamp-4.worker.js | 25 ++ .../2d.fillStyle.parse.rgb-clamp-5.html | 30 ++ .../2d.fillStyle.parse.rgb-clamp-5.worker.js | 25 ++ .../2d.fillStyle.parse.rgb-eof.html | 30 ++ .../2d.fillStyle.parse.rgb-eof.worker.js | 25 ++ .../2d.fillStyle.parse.rgb-num.html | 30 ++ .../2d.fillStyle.parse.rgb-num.worker.js | 25 ++ .../2d.fillStyle.parse.rgb-percent.html | 30 ++ .../2d.fillStyle.parse.rgb-percent.worker.js | 25 ++ .../2d.fillStyle.parse.rgba-clamp-1.html | 30 ++ .../2d.fillStyle.parse.rgba-clamp-1.worker.js | 25 ++ .../2d.fillStyle.parse.rgba-clamp-2.html | 30 ++ .../2d.fillStyle.parse.rgba-clamp-2.worker.js | 25 ++ .../2d.fillStyle.parse.rgba-eof.html | 30 ++ .../2d.fillStyle.parse.rgba-eof.worker.js | 25 ++ .../2d.fillStyle.parse.rgba-num-1.html | 30 ++ .../2d.fillStyle.parse.rgba-num-1.worker.js | 25 ++ .../2d.fillStyle.parse.rgba-num-2.html | 30 ++ .../2d.fillStyle.parse.rgba-num-2.worker.js | 25 ++ .../2d.fillStyle.parse.rgba-percent.html | 30 ++ .../2d.fillStyle.parse.rgba-percent.worker.js | 25 ++ .../2d.fillStyle.parse.rgba-solid-1.html | 30 ++ .../2d.fillStyle.parse.rgba-solid-1.worker.js | 25 ++ .../2d.fillStyle.parse.rgba-solid-2.html | 30 ++ .../2d.fillStyle.parse.rgba-solid-2.worker.js | 25 ++ .../2d.fillStyle.parse.rgba-solid-3.html | 30 ++ .../2d.fillStyle.parse.rgba-solid-3.worker.js | 25 ++ .../2d.fillStyle.parse.rgba-solid-4.html | 30 ++ .../2d.fillStyle.parse.rgba-solid-4.worker.js | 25 ++ .../2d.fillStyle.parse.svg-1.html | 30 ++ .../2d.fillStyle.parse.svg-1.worker.js | 25 ++ .../2d.fillStyle.parse.svg-2.html | 30 ++ .../2d.fillStyle.parse.svg-2.worker.js | 25 ++ .../2d.fillStyle.parse.system.html | 29 ++ .../2d.fillStyle.parse.system.worker.js | 24 ++ .../2d.fillStyle.parse.transparent-1.html | 30 ++ .../2d.fillStyle.parse.transparent-1.worker.js | 25 ++ .../2d.fillStyle.parse.transparent-2.html | 30 ++ .../2d.fillStyle.parse.transparent-2.worker.js | 25 ++ .../2d.fillStyle.toStringFunctionCallback.html | 40 +++ ...2d.fillStyle.toStringFunctionCallback.worker.js | 35 +++ .../2d.gradient.conic.invalid.inputs.html | 45 +++ .../2d.gradient.conic.invalid.inputs.worker.js | 40 +++ .../2d.gradient.conic.negative.rotation.html | 36 +++ .../2d.gradient.conic.negative.rotation.worker.js | 31 ++ .../2d.gradient.conic.positive.rotation.html | 36 +++ .../2d.gradient.conic.positive.rotation.worker.js | 31 ++ .../fill-and-stroke-styles/2d.gradient.empty.html | 32 ++ .../2d.gradient.empty.worker.js | 27 ++ .../2d.gradient.interpolate.alpha.html | 36 +++ .../2d.gradient.interpolate.alpha.png | Bin 0 -> 219 bytes .../2d.gradient.interpolate.alpha.worker.js | 31 ++ .../2d.gradient.interpolate.color.html | 34 +++ .../2d.gradient.interpolate.color.png | Bin 0 -> 219 bytes .../2d.gradient.interpolate.color.worker.js | 29 ++ .../2d.gradient.interpolate.coloralpha.html | 34 +++ .../2d.gradient.interpolate.coloralpha.png | Bin 0 -> 396 bytes .../2d.gradient.interpolate.coloralpha.worker.js | 29 ++ .../2d.gradient.interpolate.multiple.html | 36 +++ .../2d.gradient.interpolate.multiple.png | Bin 0 -> 256 bytes .../2d.gradient.interpolate.multiple.worker.js | 31 ++ .../2d.gradient.interpolate.outside.html | 38 +++ .../2d.gradient.interpolate.outside.worker.js | 33 ++ .../2d.gradient.interpolate.overlap.html | 52 ++++ .../2d.gradient.interpolate.overlap.png | Bin 0 -> 248 bytes .../2d.gradient.interpolate.overlap.worker.js | 47 +++ .../2d.gradient.interpolate.overlap2.html | 42 +++ .../2d.gradient.interpolate.overlap2.worker.js | 37 +++ .../2d.gradient.interpolate.solid.html | 32 ++ .../2d.gradient.interpolate.solid.worker.js | 27 ++ .../2d.gradient.interpolate.vertical.html | 34 +++ .../2d.gradient.interpolate.vertical.png | Bin 0 -> 229 bytes .../2d.gradient.interpolate.vertical.worker.js | 29 ++ .../2d.gradient.interpolate.zerosize.fill.html | 36 +++ ...2d.gradient.interpolate.zerosize.fill.worker.js | 31 ++ .../2d.gradient.interpolate.zerosize.fillRect.html | 35 +++ ...radient.interpolate.zerosize.fillRect.worker.js | 30 ++ .../2d.gradient.interpolate.zerosize.fillText.html | 36 +++ ...radient.interpolate.zerosize.fillText.worker.js | 31 ++ .../2d.gradient.interpolate.zerosize.stroke.html | 44 +++ ....gradient.interpolate.zerosize.stroke.worker.js | 39 +++ ...d.gradient.interpolate.zerosize.strokeRect.html | 43 +++ ...dient.interpolate.zerosize.strokeRect.worker.js | 38 +++ ...d.gradient.interpolate.zerosize.strokeText.html | 36 +++ ...dient.interpolate.zerosize.strokeText.worker.js | 31 ++ .../2d.gradient.linear.nonfinite.html | 49 +++ .../2d.gradient.linear.nonfinite.worker.js | 44 +++ .../2d.gradient.linear.transform.1.html | 37 +++ .../2d.gradient.linear.transform.1.worker.js | 32 ++ .../2d.gradient.linear.transform.2.html | 38 +++ .../2d.gradient.linear.transform.2.worker.js | 33 ++ .../2d.gradient.linear.transform.3.html | 38 +++ .../2d.gradient.linear.transform.3.worker.js | 33 ++ .../2d.gradient.object.compare.html | 31 ++ .../2d.gradient.object.compare.worker.js | 26 ++ .../2d.gradient.object.crosscanvas.html | 34 +++ .../2d.gradient.object.crosscanvas.worker.js | 29 ++ .../2d.gradient.object.invalidcolor.html | 41 +++ .../2d.gradient.object.invalidcolor.worker.js | 36 +++ .../2d.gradient.object.invalidoffset.html | 32 ++ .../2d.gradient.object.invalidoffset.worker.js | 27 ++ .../2d.gradient.object.return.html | 35 +++ .../2d.gradient.object.return.worker.js | 30 ++ .../2d.gradient.object.type.html | 28 ++ .../2d.gradient.object.type.worker.js | 23 ++ .../2d.gradient.object.update.html | 35 +++ .../2d.gradient.object.update.worker.js | 30 ++ .../2d.gradient.radial.cone.behind.html | 44 +++ .../2d.gradient.radial.cone.behind.worker.js | 39 +++ .../2d.gradient.radial.cone.beside.html | 44 +++ .../2d.gradient.radial.cone.beside.worker.js | 39 +++ .../2d.gradient.radial.cone.bottom.html | 44 +++ .../2d.gradient.radial.cone.bottom.worker.js | 39 +++ .../2d.gradient.radial.cone.cylinder.html | 44 +++ .../2d.gradient.radial.cone.cylinder.worker.js | 39 +++ .../2d.gradient.radial.cone.front.html | 44 +++ .../2d.gradient.radial.cone.front.worker.js | 39 +++ .../2d.gradient.radial.cone.shape1.html | 53 ++++ .../2d.gradient.radial.cone.shape1.worker.js | 48 +++ .../2d.gradient.radial.cone.shape2.html | 53 ++++ .../2d.gradient.radial.cone.shape2.worker.js | 48 +++ .../2d.gradient.radial.cone.top.html | 44 +++ .../2d.gradient.radial.cone.top.worker.js | 39 +++ .../2d.gradient.radial.equal.html | 44 +++ .../2d.gradient.radial.equal.worker.js | 39 +++ .../2d.gradient.radial.inside1.html | 44 +++ .../2d.gradient.radial.inside1.worker.js | 39 +++ .../2d.gradient.radial.inside2.html | 44 +++ .../2d.gradient.radial.inside2.worker.js | 39 +++ .../2d.gradient.radial.inside3.html | 45 +++ .../2d.gradient.radial.inside3.worker.js | 40 +++ .../2d.gradient.radial.negative.html | 29 ++ .../2d.gradient.radial.negative.worker.js | 24 ++ .../2d.gradient.radial.nonfinite.html | 101 ++++++ .../2d.gradient.radial.nonfinite.worker.js | 96 ++++++ .../2d.gradient.radial.outside1.html | 44 +++ .../2d.gradient.radial.outside1.worker.js | 39 +++ .../2d.gradient.radial.outside2.html | 44 +++ .../2d.gradient.radial.outside2.worker.js | 39 +++ .../2d.gradient.radial.outside3.html | 45 +++ .../2d.gradient.radial.outside3.worker.js | 40 +++ .../2d.gradient.radial.touch1.html | 44 +++ .../2d.gradient.radial.touch1.worker.js | 39 +++ .../2d.gradient.radial.touch2.html | 46 +++ .../2d.gradient.radial.touch2.worker.js | 41 +++ .../2d.gradient.radial.touch3.html | 44 +++ .../2d.gradient.radial.touch3.worker.js | 39 +++ .../2d.gradient.radial.transform.1.html | 38 +++ .../2d.gradient.radial.transform.1.worker.js | 33 ++ .../2d.gradient.radial.transform.2.html | 39 +++ .../2d.gradient.radial.transform.2.worker.js | 34 +++ .../2d.gradient.radial.transform.3.html | 39 +++ .../2d.gradient.radial.transform.3.worker.js | 34 +++ .../2d.pattern.basic.canvas.html | 47 +++ .../2d.pattern.basic.canvas.worker.js | 42 +++ .../2d.pattern.basic.image.html | 33 ++ .../2d.pattern.basic.image.worker.js | 29 ++ .../2d.pattern.basic.nocontext.html | 39 +++ .../2d.pattern.basic.nocontext.worker.js | 34 +++ .../2d.pattern.basic.type.html | 29 ++ .../2d.pattern.basic.type.worker.js | 25 ++ .../2d.pattern.basic.zerocanvas.html | 43 +++ .../2d.pattern.basic.zerocanvas.worker.js | 38 +++ .../2d.pattern.crosscanvas.html | 31 ++ .../2d.pattern.crosscanvas.worker.js | 27 ++ .../2d.pattern.image.null.html | 27 ++ .../2d.pattern.image.null.worker.js | 22 ++ .../2d.pattern.image.string.html | 27 ++ .../2d.pattern.image.string.worker.js | 22 ++ .../2d.pattern.image.undefined.html | 27 ++ .../2d.pattern.image.undefined.worker.js | 22 ++ .../2d.pattern.modify.canvas1.html | 43 +++ .../2d.pattern.modify.canvas1.worker.js | 38 +++ .../2d.pattern.modify.canvas2.html | 47 +++ .../2d.pattern.modify.canvas2.worker.js | 42 +++ .../2d.pattern.paint.norepeat.basic.html | 34 +++ .../2d.pattern.paint.norepeat.basic.worker.js | 30 ++ .../2d.pattern.paint.norepeat.coord1.html | 37 +++ .../2d.pattern.paint.norepeat.coord1.worker.js | 33 ++ .../2d.pattern.paint.norepeat.coord2.html | 38 +++ .../2d.pattern.paint.norepeat.coord2.worker.js | 34 +++ .../2d.pattern.paint.norepeat.coord3.html | 38 +++ .../2d.pattern.paint.norepeat.coord3.worker.js | 34 +++ .../2d.pattern.paint.norepeat.outside.html | 40 +++ .../2d.pattern.paint.norepeat.outside.worker.js | 36 +++ .../2d.pattern.paint.orientation.canvas.html | 46 +++ .../2d.pattern.paint.orientation.canvas.worker.js | 41 +++ .../2d.pattern.paint.orientation.image.html | 40 +++ .../2d.pattern.paint.orientation.image.worker.js | 36 +++ .../2d.pattern.paint.repeat.basic.html | 34 +++ .../2d.pattern.paint.repeat.basic.worker.js | 30 ++ .../2d.pattern.paint.repeat.coord1.html | 35 +++ .../2d.pattern.paint.repeat.coord1.worker.js | 31 ++ .../2d.pattern.paint.repeat.coord2.html | 31 ++ .../2d.pattern.paint.repeat.coord2.worker.js | 27 ++ .../2d.pattern.paint.repeat.coord3.html | 34 +++ .../2d.pattern.paint.repeat.coord3.worker.js | 30 ++ .../2d.pattern.paint.repeat.outside.html | 35 +++ .../2d.pattern.paint.repeat.outside.worker.js | 31 ++ .../2d.pattern.paint.repeatx.basic.html | 36 +++ .../2d.pattern.paint.repeatx.basic.worker.js | 32 ++ .../2d.pattern.paint.repeatx.coord1.html | 40 +++ .../2d.pattern.paint.repeatx.coord1.worker.js | 36 +++ .../2d.pattern.paint.repeatx.outside.html | 37 +++ .../2d.pattern.paint.repeatx.outside.worker.js | 33 ++ .../2d.pattern.paint.repeaty.basic.html | 36 +++ .../2d.pattern.paint.repeaty.basic.worker.js | 32 ++ .../2d.pattern.paint.repeaty.coord1.html | 40 +++ .../2d.pattern.paint.repeaty.coord1.worker.js | 36 +++ .../2d.pattern.paint.repeaty.outside.html | 37 +++ .../2d.pattern.paint.repeaty.outside.worker.js | 33 ++ .../2d.pattern.repeat.case.html | 27 ++ .../2d.pattern.repeat.case.worker.js | 22 ++ .../2d.pattern.repeat.empty.html | 33 ++ .../2d.pattern.repeat.empty.worker.js | 29 ++ .../2d.pattern.repeat.null.html | 27 ++ .../2d.pattern.repeat.null.worker.js | 22 ++ .../2d.pattern.repeat.nullsuffix.html | 27 ++ .../2d.pattern.repeat.nullsuffix.worker.js | 22 ++ .../2d.pattern.repeat.undefined.html | 27 ++ .../2d.pattern.repeat.undefined.worker.js | 22 ++ .../2d.pattern.repeat.unrecognised.html | 27 ++ .../2d.pattern.repeat.unrecognised.worker.js | 22 ++ .../2d.pattern.repeat.unrecognisednull.html | 27 ++ .../2d.pattern.repeat.unrecognisednull.worker.js | 22 ++ .../2d.pattern.transform.identity.html | 40 +++ .../2d.pattern.transform.identity.worker.js | 35 +++ .../2d.pattern.transform.infinity.html | 40 +++ .../2d.pattern.transform.infinity.worker.js | 35 +++ .../2d.pattern.transform.invalid.html | 29 ++ .../2d.pattern.transform.invalid.worker.js | 24 ++ .../2d.strokeStyle.colormix.html | 30 ++ .../2d.strokeStyle.default.html | 27 ++ .../2d.strokeStyle.default.worker.js | 22 ++ ...nvasFilterObject.blur.exceptions.tentative.html | 32 ++ ...ilterObject.blur.exceptions.tentative.worker.js | 27 ++ ...r.canvasFilterObject.colorMatrix.tentative.html | 69 +++++ ...vasFilterObject.colorMatrix.tentative.worker.js | 64 ++++ ...bject.componentTransfer.discrete.tentative.html | 67 ++++ ....componentTransfer.discrete.tentative.worker.js | 62 ++++ ...erObject.componentTransfer.gamma.tentative.html | 58 ++++ ...ect.componentTransfer.gamma.tentative.worker.js | 53 ++++ ...bject.componentTransfer.identity.tentative.html | 45 +++ ....componentTransfer.identity.tentative.worker.js | 40 +++ ...rObject.componentTransfer.linear.tentative.html | 57 ++++ ...ct.componentTransfer.linear.tentative.worker.js | 52 ++++ ...erObject.componentTransfer.table.tentative.html | 67 ++++ ...ect.componentTransfer.table.tentative.worker.js | 62 ++++ ...Object.convolveMatrix.exceptions.tentative.html | 43 +++ ...t.convolveMatrix.exceptions.tentative.worker.js | 38 +++ ...lterObject.dropShadow.exceptions.tentative.html | 124 ++++++++ ...bject.dropShadow.exceptions.tentative.worker.js | 119 ++++++++ ...FilterObject.dropShadow.tentative-expected.html | 57 ++++ ...er.canvasFilterObject.dropShadow.tentative.html | 110 +++++++ ....canvasFilterObject.dropShadow.tentative.w.html | 124 ++++++++ ....gaussianBlur.tentative.isotropic-expected.html | 15 + ...terObject.gaussianBlur.tentative.isotropic.html | 23 ++ ...rObject.gaussianBlur.tentative.isotropic.w.html | 37 +++ ...t.gaussianBlur.tentative.mostly-x-expected.html | 15 + ...lterObject.gaussianBlur.tentative.mostly-x.html | 23 ++ ...erObject.gaussianBlur.tentative.mostly-x.w.html | 37 +++ ...t.gaussianBlur.tentative.mostly-y-expected.html | 15 + ...lterObject.gaussianBlur.tentative.mostly-y.html | 23 ++ ...erObject.gaussianBlur.tentative.mostly-y.w.html | 37 +++ ...ect.gaussianBlur.tentative.x-only-expected.html | 15 + ...FilterObject.gaussianBlur.tentative.x-only.html | 23 ++ ...lterObject.gaussianBlur.tentative.x-only.w.html | 37 +++ ...ect.gaussianBlur.tentative.y-only-expected.html | 15 + ...FilterObject.gaussianBlur.tentative.y-only.html | 23 ++ ...lterObject.gaussianBlur.tentative.y-only.w.html | 37 +++ .../2d.filter.canvasFilterObject.tentative.html | 49 +++ ...d.filter.canvasFilterObject.tentative.worker.js | 44 +++ ...lterObject.turbulence.inputTypes.tentative.html | 130 ++++++++ ...bject.turbulence.inputTypes.tentative.worker.js | 125 ++++++++ .../canvas/offscreen/filters/2d.filter.value.html | 56 ++++ .../offscreen/filters/2d.filter.value.worker.js | 51 ++++ ....layer.anisotropic-blur.isotropic-expected.html | 16 + .../2d.layer.anisotropic-blur.isotropic.html | 23 ++ .../2d.layer.anisotropic-blur.isotropic.w.html | 37 +++ ...d.layer.anisotropic-blur.mostly-x-expected.html | 16 + .../layers/2d.layer.anisotropic-blur.mostly-x.html | 23 ++ .../2d.layer.anisotropic-blur.mostly-x.w.html | 37 +++ ...d.layer.anisotropic-blur.mostly-y-expected.html | 16 + .../layers/2d.layer.anisotropic-blur.mostly-y.html | 23 ++ .../2d.layer.anisotropic-blur.mostly-y.w.html | 37 +++ .../2d.layer.anisotropic-blur.x-only-expected.html | 16 + .../layers/2d.layer.anisotropic-blur.x-only.html | 23 ++ .../layers/2d.layer.anisotropic-blur.x-only.w.html | 37 +++ .../2d.layer.anisotropic-blur.y-only-expected.html | 16 + .../layers/2d.layer.anisotropic-blur.y-only.html | 23 ++ .../layers/2d.layer.anisotropic-blur.y-only.w.html | 37 +++ .../layers/2d.layer.beginLayer-options.html | 51 ++++ .../layers/2d.layer.beginLayer-options.worker.js | 46 +++ ...r-from-outside-canvas.no-clipping-expected.html | 36 +++ ...layer.blur-from-outside-canvas.no-clipping.html | 31 ++ ...yer.blur-from-outside-canvas.no-clipping.w.html | 45 +++ ...from-outside-canvas.with-clipping-expected.html | 38 +++ ...yer.blur-from-outside-canvas.with-clipping.html | 33 ++ ...r.blur-from-outside-canvas.with-clipping.w.html | 47 +++ .../layers/2d.layer.clearRect.full-expected.html | 15 + .../offscreen/layers/2d.layer.clearRect.full.html | 26 ++ .../layers/2d.layer.clearRect.full.w.html | 40 +++ .../2d.layer.clearRect.partial-expected.html | 21 ++ .../layers/2d.layer.clearRect.partial.html | 25 ++ .../layers/2d.layer.clearRect.partial.w.html | 39 +++ .../2d.layer.clip-inside-and-outside-expected.html | 34 +++ .../layers/2d.layer.clip-inside-and-outside.html | 30 ++ .../layers/2d.layer.clip-inside-and-outside.w.html | 44 +++ .../layers/2d.layer.clip-inside-expected.html | 26 ++ .../offscreen/layers/2d.layer.clip-inside.html | 26 ++ .../offscreen/layers/2d.layer.clip-inside.w.html | 40 +++ .../layers/2d.layer.clip-outside-expected.html | 26 ++ .../offscreen/layers/2d.layer.clip-outside.html | 25 ++ .../offscreen/layers/2d.layer.clip-outside.w.html | 39 +++ .../2d.layer.cross-layer-paths-expected.html | 14 + .../layers/2d.layer.cross-layer-paths.html | 23 ++ .../layers/2d.layer.cross-layer-paths.w.html | 37 +++ ...layer.css-filters.blur-and-shadow-expected.html | 17 ++ .../2d.layer.css-filters.blur-and-shadow.html | 23 ++ .../2d.layer.css-filters.blur-and-shadow.w.html | 37 +++ .../layers/2d.layer.css-filters.blur-expected.html | 16 + .../layers/2d.layer.css-filters.blur.html | 23 ++ .../layers/2d.layer.css-filters.blur.w.html | 37 +++ .../2d.layer.css-filters.shadow-expected.html | 16 + .../layers/2d.layer.css-filters.shadow.html | 23 ++ .../layers/2d.layer.css-filters.shadow.w.html | 37 +++ .../layers/2d.layer.exceptions-are-no-op.html | 32 ++ .../layers/2d.layer.exceptions-are-no-op.worker.js | 27 ++ .../layers/2d.layer.global-filter-expected.html | 17 ++ .../offscreen/layers/2d.layer.global-filter.html | 29 ++ .../offscreen/layers/2d.layer.global-filter.w.html | 43 +++ .../2d.layer.global-states.alpha-expected.html | 31 ++ ...ayer.global-states.alpha.blending-expected.html | 32 ++ .../2d.layer.global-states.alpha.blending.html | 38 +++ ...obal-states.alpha.blending.shadow-expected.html | 36 +++ ....layer.global-states.alpha.blending.shadow.html | 42 +++ ...ayer.global-states.alpha.blending.shadow.w.html | 56 ++++ .../2d.layer.global-states.alpha.blending.w.html | 52 ++++ ...yer.global-states.alpha.composite-expected.html | 32 ++ .../2d.layer.global-states.alpha.composite.html | 38 +++ ...bal-states.alpha.composite.shadow-expected.html | 36 +++ ...layer.global-states.alpha.composite.shadow.html | 42 +++ ...yer.global-states.alpha.composite.shadow.w.html | 56 ++++ .../2d.layer.global-states.alpha.composite.w.html | 52 ++++ .../layers/2d.layer.global-states.alpha.html | 37 +++ ....layer.global-states.alpha.shadow-expected.html | 35 +++ .../2d.layer.global-states.alpha.shadow.html | 41 +++ .../2d.layer.global-states.alpha.shadow.w.html | 55 ++++ .../layers/2d.layer.global-states.alpha.w.html | 51 ++++ .../2d.layer.global-states.blending-expected.html | 31 ++ .../layers/2d.layer.global-states.blending.html | 37 +++ ...yer.global-states.blending.shadow-expected.html | 35 +++ .../2d.layer.global-states.blending.shadow.html | 41 +++ .../2d.layer.global-states.blending.shadow.w.html | 55 ++++ .../layers/2d.layer.global-states.blending.w.html | 51 ++++ .../2d.layer.global-states.composite-expected.html | 31 ++ .../layers/2d.layer.global-states.composite.html | 37 +++ ...er.global-states.composite.shadow-expected.html | 35 +++ .../2d.layer.global-states.composite.shadow.html | 41 +++ .../2d.layer.global-states.composite.shadow.w.html | 55 ++++ .../layers/2d.layer.global-states.composite.w.html | 51 ++++ ....layer.global-states.filter.alpha-expected.html | 50 +++ ...obal-states.filter.alpha.blending-expected.html | 51 ++++ ....layer.global-states.filter.alpha.blending.html | 41 +++ ...ates.filter.alpha.blending.shadow-expected.html | 55 ++++ ...global-states.filter.alpha.blending.shadow.html | 45 +++ ...obal-states.filter.alpha.blending.shadow.w.html | 59 ++++ ...ayer.global-states.filter.alpha.blending.w.html | 55 ++++ ...bal-states.filter.alpha.composite-expected.html | 51 ++++ ...layer.global-states.filter.alpha.composite.html | 41 +++ ...tes.filter.alpha.composite.shadow-expected.html | 55 ++++ ...lobal-states.filter.alpha.composite.shadow.html | 45 +++ ...bal-states.filter.alpha.composite.shadow.w.html | 59 ++++ ...yer.global-states.filter.alpha.composite.w.html | 55 ++++ .../2d.layer.global-states.filter.alpha.html | 40 +++ ...global-states.filter.alpha.shadow-expected.html | 54 ++++ ...2d.layer.global-states.filter.alpha.shadow.html | 44 +++ ....layer.global-states.filter.alpha.shadow.w.html | 58 ++++ .../2d.layer.global-states.filter.alpha.w.html | 54 ++++ ...yer.global-states.filter.blending-expected.html | 50 +++ .../2d.layer.global-states.filter.blending.html | 40 +++ ...bal-states.filter.blending.shadow-expected.html | 54 ++++ ...layer.global-states.filter.blending.shadow.html | 44 +++ ...yer.global-states.filter.blending.shadow.w.html | 58 ++++ .../2d.layer.global-states.filter.blending.w.html | 54 ++++ ...er.global-states.filter.composite-expected.html | 50 +++ .../2d.layer.global-states.filter.composite.html | 40 +++ ...al-states.filter.composite.shadow-expected.html | 54 ++++ ...ayer.global-states.filter.composite.shadow.html | 44 +++ ...er.global-states.filter.composite.shadow.w.html | 58 ++++ .../2d.layer.global-states.filter.composite.w.html | 54 ++++ ...al-states.filter.no-global-states-expected.html | 50 +++ ...ayer.global-states.filter.no-global-states.html | 40 +++ ...er.global-states.filter.no-global-states.w.html | 54 ++++ ...layer.global-states.filter.shadow-expected.html | 53 ++++ .../2d.layer.global-states.filter.shadow.html | 43 +++ .../2d.layer.global-states.filter.shadow.w.html | 57 ++++ ...er.global-states.no-global-states-expected.html | 31 ++ .../2d.layer.global-states.no-global-states.html | 37 +++ .../2d.layer.global-states.no-global-states.w.html | 51 ++++ .../2d.layer.global-states.shadow-expected.html | 34 +++ .../layers/2d.layer.global-states.shadow.html | 40 +++ .../layers/2d.layer.global-states.shadow.w.html | 54 ++++ ...er.invalid-calls.beginLayer-reset-endLayer.html | 31 ++ ...valid-calls.beginLayer-reset-endLayer.worker.js | 26 ++ .../2d.layer.invalid-calls.beginLayer-restore.html | 30 ++ ...ayer.invalid-calls.beginLayer-restore.worker.js | 25 ++ ...yer.invalid-calls.beginLayer-save-endLayer.html | 31 ++ ...nvalid-calls.beginLayer-save-endLayer.worker.js | 26 ++ .../layers/2d.layer.invalid-calls.endLayer.html | 29 ++ .../2d.layer.invalid-calls.endLayer.worker.js | 24 ++ ...ayer.invalid-calls.save-beginLayer-restore.html | 31 ++ ...invalid-calls.save-beginLayer-restore.worker.js | 26 ++ .../2d.layer.invalid-calls.save-endLayer.html | 30 ++ .../2d.layer.invalid-calls.save-endLayer.worker.js | 25 ++ ...layer.layer-rendering-state-reset-in-layer.html | 57 ++++ ....layer-rendering-state-reset-in-layer.worker.js | 52 ++++ ...med-operations-with-promises.convertToBlob.html | 27 ++ ...perations-with-promises.convertToBlob.worker.js | 23 ++ ...operations-with-promises.createImageBitmap.html | 27 ++ ...tions-with-promises.createImageBitmap.worker.js | 23 ++ ...d.layer.malformed-operations.createPattern.html | 34 +++ ...er.malformed-operations.createPattern.worker.js | 29 ++ .../2d.layer.malformed-operations.drawImage.html | 36 +++ ....layer.malformed-operations.drawImage.worker.js | 31 ++ ...2d.layer.malformed-operations.getImageData.html | 34 +++ ...yer.malformed-operations.getImageData.worker.js | 29 ++ ...2d.layer.malformed-operations.putImageData.html | 37 +++ ...yer.malformed-operations.putImageData.worker.js | 32 ++ ...malformed-operations.transferToImageBitmap.html | 34 +++ ...rmed-operations.transferToImageBitmap.worker.js | 29 ++ .../offscreen/layers/2d.layer.nested-expected.html | 37 +++ .../layers/2d.layer.nested-filters-expected.html | 28 ++ .../offscreen/layers/2d.layer.nested-filters.html | 36 +++ .../layers/2d.layer.nested-filters.w.html | 50 +++ .../canvas/offscreen/layers/2d.layer.nested.html | 39 +++ .../canvas/offscreen/layers/2d.layer.nested.w.html | 53 ++++ .../layers/2d.layer.opaque-canvas-expected.html | 34 +++ .../offscreen/layers/2d.layer.opaque-canvas.html | 36 +++ .../offscreen/layers/2d.layer.opaque-canvas.w.html | 50 +++ .../offscreen/layers/2d.layer.reset-expected.html | 14 + .../canvas/offscreen/layers/2d.layer.reset.html | 38 +++ .../canvas/offscreen/layers/2d.layer.reset.w.html | 52 ++++ .../layers/2d.layer.restore-style-expected.html | 24 ++ .../offscreen/layers/2d.layer.restore-style.html | 28 ++ .../offscreen/layers/2d.layer.restore-style.w.html | 42 +++ .../layers/2d.layer.several-complex-expected.html | 35 +++ .../offscreen/layers/2d.layer.several-complex.html | 37 +++ .../layers/2d.layer.several-complex.w.html | 51 ++++ ...from-outside-canvas.long-distance-expected.html | 19 ++ ...anvas.long-distance-with-clipping-expected.html | 21 ++ ...outside-canvas.long-distance-with-clipping.html | 33 ++ ...tside-canvas.long-distance-with-clipping.w.html | 47 +++ ...r.shadow-from-outside-canvas.long-distance.html | 31 ++ ...shadow-from-outside-canvas.long-distance.w.html | 45 +++ ...rom-outside-canvas.short-distance-expected.html | 19 ++ ...nvas.short-distance-with-clipping-expected.html | 21 ++ ...utside-canvas.short-distance-with-clipping.html | 33 ++ ...side-canvas.short-distance-with-clipping.w.html | 47 +++ ....shadow-from-outside-canvas.short-distance.html | 31 ++ ...hadow-from-outside-canvas.short-distance.w.html | 45 +++ .../2d.layer.valid-calls.beginLayer-endLayer.html | 28 ++ ...layer.valid-calls.beginLayer-endLayer.worker.js | 23 ++ .../2d.layer.valid-calls.beginLayer-save.html | 28 ++ .../2d.layer.valid-calls.beginLayer-save.worker.js | 23 ++ .../layers/2d.layer.valid-calls.beginLayer.html | 27 ++ .../2d.layer.valid-calls.beginLayer.worker.js | 22 ++ .../layers/2d.layer.valid-calls.restore.html | 27 ++ .../layers/2d.layer.valid-calls.restore.worker.js | 22 ++ .../2d.layer.valid-calls.save-beginLayer.html | 28 ++ .../2d.layer.valid-calls.save-beginLayer.worker.js | 23 ++ .../layers/2d.layer.valid-calls.save.html | 27 ++ .../layers/2d.layer.valid-calls.save.worker.js | 22 ++ .../2d.layer.valid-calls.save_reset_restore.html | 29 ++ ....layer.valid-calls.save_reset_restore.worker.js | 24 ++ .../layers/2d.layer.valid-calls.save_restore.html | 28 ++ .../2d.layer.valid-calls.save_restore.worker.js | 23 ++ .../offscreen/line-styles/2d.line.cap.butt.html | 61 ++++ .../line-styles/2d.line.cap.butt.worker.js | 56 ++++ .../offscreen/line-styles/2d.line.cap.closed.html | 46 +++ .../line-styles/2d.line.cap.closed.worker.js | 41 +++ .../offscreen/line-styles/2d.line.cap.invalid.html | 52 ++++ .../line-styles/2d.line.cap.invalid.worker.js | 47 +++ .../offscreen/line-styles/2d.line.cap.open.html | 46 +++ .../line-styles/2d.line.cap.open.worker.js | 41 +++ .../offscreen/line-styles/2d.line.cap.round.html | 77 +++++ .../line-styles/2d.line.cap.round.worker.js | 72 +++++ .../offscreen/line-styles/2d.line.cap.square.html | 61 ++++ .../line-styles/2d.line.cap.square.worker.js | 56 ++++ .../offscreen/line-styles/2d.line.cap.valid.html | 34 +++ .../line-styles/2d.line.cap.valid.worker.js | 29 ++ .../offscreen/line-styles/2d.line.cross.html | 43 +++ .../offscreen/line-styles/2d.line.cross.worker.js | 38 +++ .../offscreen/line-styles/2d.line.defaults.html | 30 ++ .../line-styles/2d.line.defaults.worker.js | 25 ++ .../offscreen/line-styles/2d.line.fill.noop.html | 37 +++ .../line-styles/2d.line.fill.noop.worker.js | 32 ++ .../line-styles/2d.line.invalid.strokestyle.html | 37 +++ .../2d.line.invalid.strokestyle.worker.js | 32 ++ .../offscreen/line-styles/2d.line.join.bevel.html | 80 +++++ .../line-styles/2d.line.join.bevel.worker.js | 75 +++++ .../offscreen/line-styles/2d.line.join.closed.html | 45 +++ .../line-styles/2d.line.join.closed.worker.js | 40 +++ .../line-styles/2d.line.join.invalid.html | 52 ++++ .../line-styles/2d.line.join.invalid.worker.js | 47 +++ .../offscreen/line-styles/2d.line.join.miter.html | 71 +++++ .../line-styles/2d.line.join.miter.worker.js | 66 ++++ .../offscreen/line-styles/2d.line.join.open.html | 45 +++ .../line-styles/2d.line.join.open.worker.js | 40 +++ .../line-styles/2d.line.join.parallel.html | 42 +++ .../line-styles/2d.line.join.parallel.worker.js | 37 +++ .../offscreen/line-styles/2d.line.join.round.html | 78 +++++ .../line-styles/2d.line.join.round.worker.js | 73 +++++ .../offscreen/line-styles/2d.line.join.valid.html | 34 +++ .../line-styles/2d.line.join.valid.worker.js | 29 ++ .../offscreen/line-styles/2d.line.miter.acute.html | 52 ++++ .../line-styles/2d.line.miter.acute.worker.js | 47 +++ .../line-styles/2d.line.miter.exceeded.html | 44 +++ .../line-styles/2d.line.miter.exceeded.worker.js | 39 +++ .../line-styles/2d.line.miter.invalid.html | 60 ++++ .../line-styles/2d.line.miter.invalid.worker.js | 55 ++++ .../line-styles/2d.line.miter.lineedge.html | 41 +++ .../line-styles/2d.line.miter.lineedge.worker.js | 36 +++ .../line-styles/2d.line.miter.obtuse.html | 52 ++++ .../line-styles/2d.line.miter.obtuse.worker.js | 47 +++ .../line-styles/2d.line.miter.rightangle.html | 44 +++ .../line-styles/2d.line.miter.rightangle.worker.js | 39 +++ .../offscreen/line-styles/2d.line.miter.valid.html | 37 +++ .../line-styles/2d.line.miter.valid.worker.js | 32 ++ .../line-styles/2d.line.miter.within.html | 44 +++ .../line-styles/2d.line.miter.within.worker.js | 39 +++ .../offscreen/line-styles/2d.line.union.html | 46 +++ .../offscreen/line-styles/2d.line.union.worker.js | 41 +++ .../offscreen/line-styles/2d.line.width.basic.html | 63 ++++ .../line-styles/2d.line.width.basic.worker.js | 58 ++++ .../line-styles/2d.line.width.invalid.html | 60 ++++ .../line-styles/2d.line.width.invalid.worker.js | 55 ++++ .../line-styles/2d.line.width.scaledefault.html | 40 +++ .../2d.line.width.scaledefault.worker.js | 35 +++ .../line-styles/2d.line.width.transformed.html | 69 +++++ .../2d.line.width.transformed.worker.js | 64 ++++ .../offscreen/line-styles/2d.line.width.valid.html | 37 +++ .../line-styles/2d.line.width.valid.worker.js | 32 ++ .../offscreencanvas.convert.to.blob.html | 165 ++++++++++ .../offscreencanvas.convert.to.blob.w.html | 337 +++++++++++++++++++++ .../2d.text.draw.generic.family.html | 49 +++ .../2d.text.draw.generic.family.w.html | 52 ++++ .../manual/filter/offscreencanvas.filter.html | 27 ++ .../manual/filter/offscreencanvas.filter.js | 48 +++ .../manual/filter/offscreencanvas.filter.w.html | 54 ++++ .../manual/image-smoothing/image.smoothing.html | 128 ++++++++ .../image-smoothing/image.smoothing.worker.js | 126 ++++++++ .../manual/layers/unclosed-layers-expected.html | 14 + .../offscreen/manual/layers/unclosed-layers.html | 33 ++ .../offscreen/manual/layers/unclosed-layers.w.html | 48 +++ .../layers/unclosed-nested-layers-expected.html | 14 + .../manual/layers/unclosed-nested-layers.html | 39 +++ .../manual/layers/unclosed-nested-layers.w.html | 54 ++++ .../offscreencanvas-worker-font-load-crash.html | 19 ++ .../offscreencanvas.constructor.html | 51 ++++ .../offscreencanvas.constructor.worker.js | 45 +++ .../offscreencanvas.getcontext.html | 80 +++++ .../offscreencanvas.getcontext.worker.js | 77 +++++ .../offscreencanvas.resize.html | 240 +++++++++++++++ ...ffscreencanvas.transfer.lowlatency.nocrash.html | 12 + .../offscreencanvas.transfer.to.imagebitmap.html | 112 +++++++ ...reencanvas.transfer.to.imagebitmap.nocrash.html | 16 + .../offscreencanvas.transfer.to.imagebitmap.w.html | 201 ++++++++++++ ...fscreencanvas.transfercontrol.to.offscreen.html | 34 +++ ...creencanvas.transfercontrol.to.offscreen.w.html | 76 +++++ .../offscreencanvas.transferrable.html | 83 +++++ .../offscreencanvas.transferrable.w.html | 142 +++++++++ .../2d.transformation.getTransform.html | 40 +++ .../2d.color.space.p3.convertToBlobp3.canvas.html | 50 +++ .../path-objects/2d.path.arc.angle.1.html | 34 +++ .../path-objects/2d.path.arc.angle.1.worker.js | 29 ++ .../path-objects/2d.path.arc.angle.2.html | 34 +++ .../path-objects/2d.path.arc.angle.2.worker.js | 29 ++ .../path-objects/2d.path.arc.angle.3.html | 34 +++ .../path-objects/2d.path.arc.angle.3.worker.js | 29 ++ .../path-objects/2d.path.arc.angle.4.html | 37 +++ .../path-objects/2d.path.arc.angle.4.worker.js | 32 ++ .../path-objects/2d.path.arc.angle.5.html | 34 +++ .../path-objects/2d.path.arc.angle.5.worker.js | 29 ++ .../path-objects/2d.path.arc.angle.6.html | 37 +++ .../path-objects/2d.path.arc.angle.6.worker.js | 32 ++ .../path-objects/2d.path.arc.default.html | 34 +++ .../path-objects/2d.path.arc.default.worker.js | 29 ++ .../offscreen/path-objects/2d.path.arc.empty.html | 34 +++ .../path-objects/2d.path.arc.empty.worker.js | 29 ++ .../offscreen/path-objects/2d.path.arc.end.html | 36 +++ .../path-objects/2d.path.arc.end.worker.js | 31 ++ .../path-objects/2d.path.arc.negative.html | 29 ++ .../path-objects/2d.path.arc.negative.worker.js | 24 ++ .../path-objects/2d.path.arc.nonempty.html | 35 +++ .../path-objects/2d.path.arc.nonempty.worker.js | 30 ++ .../path-objects/2d.path.arc.nonfinite.html | 77 +++++ .../path-objects/2d.path.arc.nonfinite.worker.js | 72 +++++ .../path-objects/2d.path.arc.scale.1.html | 54 ++++ .../path-objects/2d.path.arc.scale.1.worker.js | 49 +++ .../path-objects/2d.path.arc.scale.2.html | 44 +++ .../path-objects/2d.path.arc.scale.2.worker.js | 39 +++ .../path-objects/2d.path.arc.selfintersect.1.html | 38 +++ .../2d.path.arc.selfintersect.1.worker.js | 33 ++ .../path-objects/2d.path.arc.selfintersect.2.html | 42 +++ .../2d.path.arc.selfintersect.2.worker.js | 37 +++ .../path-objects/2d.path.arc.shape.1.html | 39 +++ .../path-objects/2d.path.arc.shape.1.worker.js | 34 +++ .../path-objects/2d.path.arc.shape.2.html | 39 +++ .../path-objects/2d.path.arc.shape.2.worker.js | 34 +++ .../path-objects/2d.path.arc.shape.3.html | 38 +++ .../path-objects/2d.path.arc.shape.3.worker.js | 33 ++ .../path-objects/2d.path.arc.shape.4.html | 38 +++ .../path-objects/2d.path.arc.shape.4.worker.js | 33 ++ .../path-objects/2d.path.arc.shape.5.html | 38 +++ .../path-objects/2d.path.arc.shape.5.worker.js | 33 ++ .../path-objects/2d.path.arc.twopie.1.html | 34 +++ .../path-objects/2d.path.arc.twopie.1.worker.js | 29 ++ .../path-objects/2d.path.arc.twopie.2.html | 34 +++ .../path-objects/2d.path.arc.twopie.2.worker.js | 29 ++ .../path-objects/2d.path.arc.twopie.3.html | 34 +++ .../path-objects/2d.path.arc.twopie.3.worker.js | 29 ++ .../path-objects/2d.path.arc.twopie.4.html | 34 +++ .../path-objects/2d.path.arc.twopie.4.worker.js | 29 ++ .../path-objects/2d.path.arc.twopie.5.html | 35 +++ .../path-objects/2d.path.arc.twopie.5.worker.js | 30 ++ .../path-objects/2d.path.arc.twopie.6.html | 35 +++ .../path-objects/2d.path.arc.twopie.6.worker.js | 30 ++ .../offscreen/path-objects/2d.path.arc.zero.1.html | 34 +++ .../path-objects/2d.path.arc.zero.1.worker.js | 29 ++ .../offscreen/path-objects/2d.path.arc.zero.2.html | 34 +++ .../path-objects/2d.path.arc.zero.2.worker.js | 29 ++ .../path-objects/2d.path.arc.zeroradius.html | 35 +++ .../path-objects/2d.path.arc.zeroradius.worker.js | 30 ++ .../path-objects/2d.path.arcTo.coincide.1.html | 46 +++ .../2d.path.arcTo.coincide.1.worker.js | 41 +++ .../path-objects/2d.path.arcTo.coincide.2.html | 36 +++ .../2d.path.arcTo.coincide.2.worker.js | 31 ++ .../path-objects/2d.path.arcTo.collinear.1.html | 43 +++ .../2d.path.arcTo.collinear.1.worker.js | 38 +++ .../path-objects/2d.path.arcTo.collinear.2.html | 43 +++ .../2d.path.arcTo.collinear.2.worker.js | 38 +++ .../path-objects/2d.path.arcTo.collinear.3.html | 48 +++ .../2d.path.arcTo.collinear.3.worker.js | 43 +++ .../2d.path.arcTo.ensuresubpath.1.html | 34 +++ .../2d.path.arcTo.ensuresubpath.1.worker.js | 29 ++ .../2d.path.arcTo.ensuresubpath.2.html | 35 +++ .../2d.path.arcTo.ensuresubpath.2.worker.js | 30 ++ .../path-objects/2d.path.arcTo.negative.html | 29 ++ .../path-objects/2d.path.arcTo.negative.worker.js | 24 ++ .../path-objects/2d.path.arcTo.nonfinite.html | 75 +++++ .../path-objects/2d.path.arcTo.nonfinite.worker.js | 70 +++++ .../path-objects/2d.path.arcTo.scale.html | 47 +++ .../path-objects/2d.path.arcTo.scale.worker.js | 42 +++ .../path-objects/2d.path.arcTo.shape.curve1.html | 60 ++++ .../2d.path.arcTo.shape.curve1.worker.js | 55 ++++ .../path-objects/2d.path.arcTo.shape.curve2.html | 59 ++++ .../2d.path.arcTo.shape.curve2.worker.js | 54 ++++ .../path-objects/2d.path.arcTo.shape.end.html | 40 +++ .../path-objects/2d.path.arcTo.shape.end.worker.js | 35 +++ .../path-objects/2d.path.arcTo.shape.start.html | 40 +++ .../2d.path.arcTo.shape.start.worker.js | 35 +++ .../path-objects/2d.path.arcTo.transformation.html | 46 +++ .../2d.path.arcTo.transformation.worker.js | 41 +++ .../path-objects/2d.path.arcTo.zero.1.html | 43 +++ .../path-objects/2d.path.arcTo.zero.1.worker.js | 38 +++ .../path-objects/2d.path.arcTo.zero.2.html | 43 +++ .../path-objects/2d.path.arcTo.zero.2.worker.js | 38 +++ .../offscreen/path-objects/2d.path.beginPath.html | 33 ++ .../path-objects/2d.path.beginPath.worker.js | 28 ++ .../path-objects/2d.path.bezierCurveTo.basic.html | 35 +++ .../2d.path.bezierCurveTo.basic.worker.js | 30 ++ .../2d.path.bezierCurveTo.ensuresubpath.1.html | 35 +++ ...2d.path.bezierCurveTo.ensuresubpath.1.worker.js | 30 ++ .../2d.path.bezierCurveTo.ensuresubpath.2.html | 35 +++ ...2d.path.bezierCurveTo.ensuresubpath.2.worker.js | 30 ++ .../2d.path.bezierCurveTo.nonfinite.html | 109 +++++++ .../2d.path.bezierCurveTo.nonfinite.worker.js | 104 +++++++ .../path-objects/2d.path.bezierCurveTo.scaled.html | 40 +++ .../2d.path.bezierCurveTo.scaled.worker.js | 35 +++ .../path-objects/2d.path.bezierCurveTo.shape.html | 39 +++ .../2d.path.bezierCurveTo.shape.worker.js | 34 +++ .../path-objects/2d.path.clip.basic.1.html | 37 +++ .../path-objects/2d.path.clip.basic.1.worker.js | 32 ++ .../path-objects/2d.path.clip.basic.2.html | 37 +++ .../path-objects/2d.path.clip.basic.2.worker.js | 32 ++ .../offscreen/path-objects/2d.path.clip.empty.html | 36 +++ .../path-objects/2d.path.clip.empty.worker.js | 31 ++ .../path-objects/2d.path.clip.intersect.html | 40 +++ .../path-objects/2d.path.clip.intersect.worker.js | 35 +++ .../path-objects/2d.path.clip.unaffected.html | 42 +++ .../path-objects/2d.path.clip.unaffected.worker.js | 37 +++ .../path-objects/2d.path.clip.winding.1.html | 45 +++ .../path-objects/2d.path.clip.winding.1.worker.js | 40 +++ .../path-objects/2d.path.clip.winding.2.html | 49 +++ .../path-objects/2d.path.clip.winding.2.worker.js | 44 +++ .../path-objects/2d.path.closePath.empty.html | 32 ++ .../path-objects/2d.path.closePath.empty.worker.js | 27 ++ .../path-objects/2d.path.closePath.newline.html | 37 +++ .../2d.path.closePath.newline.worker.js | 32 ++ .../path-objects/2d.path.closePath.nextpoint.html | 36 +++ .../2d.path.closePath.nextpoint.worker.js | 31 ++ .../path-objects/2d.path.ellipse.basics.html | 33 ++ .../path-objects/2d.path.ellipse.basics.worker.js | 28 ++ .../path-objects/2d.path.fill.closed.basic.html | 37 +++ .../2d.path.fill.closed.basic.worker.js | 32 ++ .../2d.path.fill.closed.unaffected.html | 40 +++ .../2d.path.fill.closed.unaffected.worker.js | 35 +++ .../path-objects/2d.path.fill.overlap.html | 36 +++ .../path-objects/2d.path.fill.overlap.png | Bin 0 -> 205 bytes .../path-objects/2d.path.fill.overlap.worker.js | 31 ++ .../path-objects/2d.path.fill.winding.add.html | 42 +++ .../2d.path.fill.winding.add.worker.js | 37 +++ .../2d.path.fill.winding.subtract.1.html | 42 +++ .../2d.path.fill.winding.subtract.1.worker.js | 37 +++ .../2d.path.fill.winding.subtract.2.html | 41 +++ .../2d.path.fill.winding.subtract.2.worker.js | 36 +++ .../2d.path.fill.winding.subtract.3.html | 47 +++ .../2d.path.fill.winding.subtract.3.worker.js | 42 +++ .../offscreen/path-objects/2d.path.initial.html | 32 ++ .../path-objects/2d.path.initial.worker.js | 27 ++ .../path-objects/2d.path.isPointInPath.arc.html | 35 +++ .../2d.path.isPointInPath.arc.worker.js | 30 ++ .../2d.path.isPointInPath.basic.1.html | 29 ++ .../2d.path.isPointInPath.basic.1.worker.js | 24 ++ .../2d.path.isPointInPath.basic.2.html | 29 ++ .../2d.path.isPointInPath.basic.2.worker.js | 24 ++ .../path-objects/2d.path.isPointInPath.basic.html | 66 ++++ .../2d.path.isPointInPath.basic.worker.js | 61 ++++ .../path-objects/2d.path.isPointInPath.bezier.html | 48 +++ .../2d.path.isPointInPath.bezier.worker.js | 43 +++ .../path-objects/2d.path.isPointInPath.bigarc.html | 35 +++ .../2d.path.isPointInPath.bigarc.worker.js | 30 ++ .../path-objects/2d.path.isPointInPath.edge.html | 39 +++ .../2d.path.isPointInPath.edge.worker.js | 34 +++ .../path-objects/2d.path.isPointInPath.empty.html | 27 ++ .../2d.path.isPointInPath.empty.worker.js | 22 ++ .../2d.path.isPointInPath.nonfinite.html | 34 +++ .../2d.path.isPointInPath.nonfinite.worker.js | 29 ++ .../2d.path.isPointInPath.outside.html | 34 +++ .../2d.path.isPointInPath.outside.worker.js | 29 ++ .../2d.path.isPointInPath.subpath.html | 34 +++ .../2d.path.isPointInPath.subpath.worker.js | 29 ++ .../2d.path.isPointInPath.transform.1.html | 34 +++ .../2d.path.isPointInPath.transform.1.worker.js | 29 ++ .../2d.path.isPointInPath.transform.2.html | 34 +++ .../2d.path.isPointInPath.transform.2.worker.js | 29 ++ .../2d.path.isPointInPath.transform.3.html | 34 +++ .../2d.path.isPointInPath.transform.3.worker.js | 29 ++ .../2d.path.isPointInPath.transform.4.html | 32 ++ .../2d.path.isPointInPath.transform.4.worker.js | 27 ++ .../2d.path.isPointInPath.unclosed.html | 32 ++ .../2d.path.isPointInPath.unclosed.worker.js | 27 ++ .../2d.path.isPointInPath.winding.html | 47 +++ .../2d.path.isPointInPath.winding.worker.js | 42 +++ .../2d.path.isPointInStroke.basic.html | 36 +++ .../2d.path.isPointInStroke.basic.worker.js | 32 ++ .../2d.path.isPointInStroke.scaleddashes.html | 40 +++ .../2d.path.isPointInStroke.scaleddashes.worker.js | 35 +++ .../2d.path.isPointInpath.invalid.html | 51 ++++ .../2d.path.isPointInpath.invalid.worker.js | 46 +++ .../2d.path.isPointInpath.multi.path.html | 49 +++ .../2d.path.isPointInpath.multi.path.worker.js | 44 +++ .../path-objects/2d.path.lineTo.basic.html | 35 +++ .../path-objects/2d.path.lineTo.basic.worker.js | 30 ++ .../2d.path.lineTo.ensuresubpath.1.html | 34 +++ .../2d.path.lineTo.ensuresubpath.1.worker.js | 29 ++ .../2d.path.lineTo.ensuresubpath.2.html | 35 +++ .../2d.path.lineTo.ensuresubpath.2.worker.js | 30 ++ .../path-objects/2d.path.lineTo.nextpoint.html | 36 +++ .../2d.path.lineTo.nextpoint.worker.js | 31 ++ .../2d.path.lineTo.nonfinite.details.html | 31 ++ .../2d.path.lineTo.nonfinite.details.worker.js | 26 ++ .../path-objects/2d.path.lineTo.nonfinite.html | 41 +++ .../2d.path.lineTo.nonfinite.worker.js | 36 +++ .../path-objects/2d.path.moveTo.basic.html | 36 +++ .../path-objects/2d.path.moveTo.basic.worker.js | 31 ++ .../path-objects/2d.path.moveTo.multiple.html | 36 +++ .../path-objects/2d.path.moveTo.multiple.worker.js | 31 ++ .../path-objects/2d.path.moveTo.newsubpath.html | 36 +++ .../2d.path.moveTo.newsubpath.worker.js | 31 ++ .../path-objects/2d.path.moveTo.nonfinite.html | 40 +++ .../2d.path.moveTo.nonfinite.worker.js | 35 +++ .../2d.path.quadraticCurveTo.basic.html | 35 +++ .../2d.path.quadraticCurveTo.basic.worker.js | 30 ++ .../2d.path.quadraticCurveTo.ensuresubpath.1.html | 35 +++ ...path.quadraticCurveTo.ensuresubpath.1.worker.js | 30 ++ .../2d.path.quadraticCurveTo.ensuresubpath.2.html | 35 +++ ...path.quadraticCurveTo.ensuresubpath.2.worker.js | 30 ++ .../2d.path.quadraticCurveTo.nonfinite.html | 57 ++++ .../2d.path.quadraticCurveTo.nonfinite.worker.js | 52 ++++ .../2d.path.quadraticCurveTo.scaled.html | 40 +++ .../2d.path.quadraticCurveTo.scaled.worker.js | 35 +++ .../2d.path.quadraticCurveTo.shape.html | 39 +++ .../2d.path.quadraticCurveTo.shape.worker.js | 34 +++ .../offscreen/path-objects/2d.path.rect.basic.html | 32 ++ .../path-objects/2d.path.rect.basic.worker.js | 27 ++ .../path-objects/2d.path.rect.closed.html | 34 +++ .../path-objects/2d.path.rect.closed.worker.js | 29 ++ .../offscreen/path-objects/2d.path.rect.end.1.html | 34 +++ .../path-objects/2d.path.rect.end.1.worker.js | 29 ++ .../offscreen/path-objects/2d.path.rect.end.2.html | 39 +++ .../path-objects/2d.path.rect.end.2.worker.js | 34 +++ .../path-objects/2d.path.rect.negative.html | 39 +++ .../path-objects/2d.path.rect.negative.worker.js | 34 +++ .../path-objects/2d.path.rect.newsubpath.html | 36 +++ .../path-objects/2d.path.rect.newsubpath.worker.js | 31 ++ .../path-objects/2d.path.rect.nonfinite.html | 57 ++++ .../path-objects/2d.path.rect.nonfinite.worker.js | 52 ++++ .../path-objects/2d.path.rect.selfintersect.html | 34 +++ .../2d.path.rect.selfintersect.worker.js | 29 ++ .../path-objects/2d.path.rect.winding.html | 39 +++ .../path-objects/2d.path.rect.winding.worker.js | 34 +++ .../path-objects/2d.path.rect.zero.1.html | 34 +++ .../path-objects/2d.path.rect.zero.1.worker.js | 29 ++ .../path-objects/2d.path.rect.zero.2.html | 34 +++ .../path-objects/2d.path.rect.zero.2.worker.js | 29 ++ .../path-objects/2d.path.rect.zero.3.html | 34 +++ .../path-objects/2d.path.rect.zero.3.worker.js | 29 ++ .../path-objects/2d.path.rect.zero.4.html | 34 +++ .../path-objects/2d.path.rect.zero.4.worker.js | 29 ++ .../path-objects/2d.path.rect.zero.5.html | 34 +++ .../path-objects/2d.path.rect.zero.5.worker.js | 29 ++ .../path-objects/2d.path.rect.zero.6.html | 36 +++ .../path-objects/2d.path.rect.zero.6.worker.js | 31 ++ .../2d.path.roundrect.1.radius.dompoint.html | 55 ++++ ...oundrect.1.radius.dompoint.single argument.html | 55 ++++ ...ect.1.radius.dompoint.single argument.worker.js | 50 +++ .../2d.path.roundrect.1.radius.dompoint.worker.js | 50 +++ .../2d.path.roundrect.1.radius.dompointinit.html | 55 ++++ ...rect.1.radius.dompointinit.single.argument.html | 55 ++++ ...1.radius.dompointinit.single.argument.worker.js | 50 +++ ....path.roundrect.1.radius.dompointinit.worker.js | 50 +++ .../2d.path.roundrect.1.radius.double.html | 35 +++ ....roundrect.1.radius.double.single.argument.html | 35 +++ ...drect.1.radius.double.single.argument.worker.js | 30 ++ .../2d.path.roundrect.1.radius.double.worker.js | 30 ++ .../2d.path.roundrect.2.radii.1.dompoint.html | 47 +++ .../2d.path.roundrect.2.radii.1.dompoint.worker.js | 42 +++ .../2d.path.roundrect.2.radii.1.dompointinit.html | 47 +++ ...path.roundrect.2.radii.1.dompointinit.worker.js | 42 +++ .../2d.path.roundrect.2.radii.1.double.html | 35 +++ .../2d.path.roundrect.2.radii.1.double.worker.js | 30 ++ .../2d.path.roundrect.2.radii.2.dompoint.html | 47 +++ .../2d.path.roundrect.2.radii.2.dompoint.worker.js | 42 +++ .../2d.path.roundrect.2.radii.2.dompointinit.html | 47 +++ ...path.roundrect.2.radii.2.dompointinit.worker.js | 42 +++ .../2d.path.roundrect.2.radii.2.double.html | 35 +++ .../2d.path.roundrect.2.radii.2.double.worker.js | 30 ++ .../2d.path.roundrect.3.radii.1.dompoint.html | 42 +++ .../2d.path.roundrect.3.radii.1.dompoint.worker.js | 37 +++ .../2d.path.roundrect.3.radii.1.dompointinit.html | 42 +++ ...path.roundrect.3.radii.1.dompointinit.worker.js | 37 +++ .../2d.path.roundrect.3.radii.1.double.html | 35 +++ .../2d.path.roundrect.3.radii.1.double.worker.js | 30 ++ .../2d.path.roundrect.3.radii.2.dompoint.html | 47 +++ .../2d.path.roundrect.3.radii.2.dompoint.worker.js | 42 +++ .../2d.path.roundrect.3.radii.2.dompointinit.html | 47 +++ ...path.roundrect.3.radii.2.dompointinit.worker.js | 42 +++ .../2d.path.roundrect.3.radii.2.double.html | 35 +++ .../2d.path.roundrect.3.radii.2.double.worker.js | 30 ++ .../2d.path.roundrect.3.radii.3.dompoint.html | 42 +++ .../2d.path.roundrect.3.radii.3.dompoint.worker.js | 37 +++ .../2d.path.roundrect.3.radii.3.dompointinit.html | 42 +++ ...path.roundrect.3.radii.3.dompointinit.worker.js | 37 +++ .../2d.path.roundrect.3.radii.3.double.html | 35 +++ .../2d.path.roundrect.3.radii.3.double.worker.js | 30 ++ .../2d.path.roundrect.4.radii.1.dompoint.html | 42 +++ .../2d.path.roundrect.4.radii.1.dompoint.worker.js | 37 +++ .../2d.path.roundrect.4.radii.1.dompointinit.html | 42 +++ ...path.roundrect.4.radii.1.dompointinit.worker.js | 37 +++ .../2d.path.roundrect.4.radii.1.double.html | 35 +++ .../2d.path.roundrect.4.radii.1.double.worker.js | 30 ++ .../2d.path.roundrect.4.radii.2.dompoint.html | 42 +++ .../2d.path.roundrect.4.radii.2.dompoint.worker.js | 37 +++ .../2d.path.roundrect.4.radii.2.dompointinit.html | 42 +++ ...path.roundrect.4.radii.2.dompointinit.worker.js | 37 +++ .../2d.path.roundrect.4.radii.2.double.html | 35 +++ .../2d.path.roundrect.4.radii.2.double.worker.js | 30 ++ .../2d.path.roundrect.4.radii.3.dompoint.html | 42 +++ .../2d.path.roundrect.4.radii.3.dompoint.worker.js | 37 +++ .../2d.path.roundrect.4.radii.3.dompointinit.html | 42 +++ ...path.roundrect.4.radii.3.dompointinit.worker.js | 37 +++ .../2d.path.roundrect.4.radii.3.double.html | 35 +++ .../2d.path.roundrect.4.radii.3.double.worker.js | 30 ++ .../2d.path.roundrect.4.radii.4.dompoint.html | 42 +++ .../2d.path.roundrect.4.radii.4.dompoint.worker.js | 37 +++ .../2d.path.roundrect.4.radii.4.dompointinit.html | 42 +++ ...path.roundrect.4.radii.4.dompointinit.worker.js | 37 +++ .../2d.path.roundrect.4.radii.4.double.html | 35 +++ .../2d.path.roundrect.4.radii.4.double.worker.js | 30 ++ .../path-objects/2d.path.roundrect.badinput.html | 34 +++ .../2d.path.roundrect.badinput.worker.js | 29 ++ .../path-objects/2d.path.roundrect.closed.html | 34 +++ .../2d.path.roundrect.closed.worker.js | 29 ++ .../path-objects/2d.path.roundrect.end.1.html | 34 +++ .../path-objects/2d.path.roundrect.end.1.worker.js | 29 ++ .../path-objects/2d.path.roundrect.end.2.html | 39 +++ .../path-objects/2d.path.roundrect.end.2.worker.js | 34 +++ .../path-objects/2d.path.roundrect.end.3.html | 37 +++ .../path-objects/2d.path.roundrect.end.3.worker.js | 32 ++ .../path-objects/2d.path.roundrect.end.4.html | 37 +++ .../path-objects/2d.path.roundrect.end.4.worker.js | 32 ++ .../path-objects/2d.path.roundrect.negative.html | 45 +++ .../2d.path.roundrect.negative.worker.js | 40 +++ .../path-objects/2d.path.roundrect.newsubpath.html | 36 +++ .../2d.path.roundrect.newsubpath.worker.js | 31 ++ .../path-objects/2d.path.roundrect.nonfinite.html | 116 +++++++ .../2d.path.roundrect.nonfinite.worker.js | 111 +++++++ .../2d.path.roundrect.radius.intersecting.1.html | 40 +++ ....path.roundrect.radius.intersecting.1.worker.js | 35 +++ .../2d.path.roundrect.radius.intersecting.2.html | 40 +++ ....path.roundrect.radius.intersecting.2.worker.js | 35 +++ .../2d.path.roundrect.radius.negative.html | 32 ++ .../2d.path.roundrect.radius.negative.worker.js | 27 ++ .../2d.path.roundrect.radius.noargument.html | 50 +++ .../2d.path.roundrect.radius.noargument.worker.js | 45 +++ .../2d.path.roundrect.radius.none.html | 27 ++ .../2d.path.roundrect.radius.none.worker.js | 22 ++ .../2d.path.roundrect.radius.toomany.html | 27 ++ .../2d.path.roundrect.radius.toomany.worker.js | 22 ++ .../2d.path.roundrect.selfintersect.html | 34 +++ .../2d.path.roundrect.selfintersect.worker.js | 29 ++ .../path-objects/2d.path.roundrect.winding.html | 39 +++ .../2d.path.roundrect.winding.worker.js | 34 +++ .../path-objects/2d.path.roundrect.zero.1.html | 34 +++ .../2d.path.roundrect.zero.1.worker.js | 29 ++ .../path-objects/2d.path.roundrect.zero.2.html | 34 +++ .../2d.path.roundrect.zero.2.worker.js | 29 ++ .../path-objects/2d.path.roundrect.zero.3.html | 34 +++ .../2d.path.roundrect.zero.3.worker.js | 29 ++ .../path-objects/2d.path.roundrect.zero.4.html | 34 +++ .../2d.path.roundrect.zero.4.worker.js | 29 ++ .../path-objects/2d.path.roundrect.zero.5.html | 34 +++ .../2d.path.roundrect.zero.5.worker.js | 29 ++ .../path-objects/2d.path.roundrect.zero.6.html | 36 +++ .../2d.path.roundrect.zero.6.worker.js | 31 ++ .../path-objects/2d.path.stroke.empty.html | 40 +++ .../path-objects/2d.path.stroke.empty.worker.js | 35 +++ .../path-objects/2d.path.stroke.overlap.html | 38 +++ .../path-objects/2d.path.stroke.overlap.png | Bin 0 -> 205 bytes .../path-objects/2d.path.stroke.overlap.worker.js | 33 ++ .../path-objects/2d.path.stroke.prune.arc.html | 45 +++ .../2d.path.stroke.prune.arc.worker.js | 40 +++ .../path-objects/2d.path.stroke.prune.closed.html | 41 +++ .../2d.path.stroke.prune.closed.worker.js | 36 +++ .../path-objects/2d.path.stroke.prune.corner.html | 43 +++ .../2d.path.stroke.prune.corner.worker.js | 38 +++ .../path-objects/2d.path.stroke.prune.curve.html | 45 +++ .../2d.path.stroke.prune.curve.worker.js | 40 +++ .../path-objects/2d.path.stroke.prune.line.html | 40 +++ .../2d.path.stroke.prune.line.worker.js | 35 +++ .../path-objects/2d.path.stroke.prune.rect.html | 41 +++ .../2d.path.stroke.prune.rect.worker.js | 36 +++ .../path-objects/2d.path.stroke.scale1.html | 54 ++++ .../path-objects/2d.path.stroke.scale1.worker.js | 49 +++ .../path-objects/2d.path.stroke.scale2.html | 56 ++++ .../path-objects/2d.path.stroke.scale2.worker.js | 51 ++++ .../path-objects/2d.path.stroke.skew.html | 70 +++++ .../path-objects/2d.path.stroke.skew.worker.js | 65 ++++ .../path-objects/2d.path.stroke.unaffected.html | 42 +++ .../2d.path.stroke.unaffected.worker.js | 37 +++ .../path-objects/2d.path.stroke.union.html | 38 +++ .../path-objects/2d.path.stroke.union.worker.js | 33 ++ .../path-objects/2d.path.transformation.basic.html | 36 +++ .../2d.path.transformation.basic.worker.js | 31 ++ .../2d.path.transformation.changing.html | 42 +++ .../2d.path.transformation.changing.worker.js | 37 +++ .../2d.path.transformation.multiple.html | 47 +++ .../2d.path.transformation.multiple.worker.js | 42 +++ .../2d.imageData.create1.basic.html | 27 ++ .../2d.imageData.create1.basic.worker.js | 22 ++ .../2d.imageData.create1.initial.html | 38 +++ .../2d.imageData.create1.initial.worker.js | 33 ++ .../2d.imageData.create1.zero.html | 27 ++ .../2d.imageData.create1.zero.worker.js | 22 ++ .../2d.imageData.create2.basic.html | 27 ++ .../2d.imageData.create2.basic.worker.js | 22 ++ .../2d.imageData.create2.double.html | 32 ++ .../2d.imageData.create2.double.worker.js | 27 ++ .../2d.imageData.create2.initial.html | 35 +++ .../2d.imageData.create2.initial.worker.js | 30 ++ .../2d.imageData.create2.large.html | 35 +++ .../2d.imageData.create2.large.worker.js | 30 ++ .../2d.imageData.create2.negative.html | 33 ++ .../2d.imageData.create2.negative.worker.js | 28 ++ .../2d.imageData.create2.nonfinite.html | 43 +++ .../2d.imageData.create2.nonfinite.worker.js | 38 +++ .../2d.imageData.create2.round.html | 30 ++ .../2d.imageData.create2.round.worker.js | 25 ++ .../2d.imageData.create2.zero.html | 31 ++ .../2d.imageData.create2.zero.worker.js | 26 ++ .../pixel-manipulation/2d.imageData.get.basic.html | 27 ++ .../2d.imageData.get.basic.worker.js | 22 ++ .../pixel-manipulation/2d.imageData.get.clamp.html | 38 +++ .../2d.imageData.get.clamp.worker.js | 33 ++ .../2d.imageData.get.double.html | 32 ++ .../2d.imageData.get.double.worker.js | 27 ++ .../2d.imageData.get.invalid.html | 45 +++ .../2d.imageData.get.invalid.worker.js | 40 +++ .../2d.imageData.get.large.crash.html | 27 ++ .../2d.imageData.get.large.crash.worker.js | 22 ++ .../2d.imageData.get.length.html | 28 ++ .../2d.imageData.get.length.worker.js | 23 ++ .../2d.imageData.get.nonfinite.html | 75 +++++ .../2d.imageData.get.nonfinite.worker.js | 70 +++++ .../2d.imageData.get.nonpremul.html | 34 +++ .../2d.imageData.get.nonpremul.worker.js | 29 ++ .../2d.imageData.get.order.alpha.html | 31 ++ .../2d.imageData.get.order.alpha.worker.js | 26 ++ .../2d.imageData.get.order.cols.html | 34 +++ .../2d.imageData.get.order.cols.worker.js | 29 ++ .../2d.imageData.get.order.rgb.html | 37 +++ .../2d.imageData.get.order.rgb.worker.js | 32 ++ .../2d.imageData.get.order.rows.html | 34 +++ .../2d.imageData.get.order.rows.worker.js | 29 ++ .../pixel-manipulation/2d.imageData.get.range.html | 34 +++ .../2d.imageData.get.range.worker.js | 29 ++ .../2d.imageData.get.rounding.html | 45 +++ .../2d.imageData.get.rounding.worker.js | 40 +++ .../2d.imageData.get.source.negative.html | 46 +++ .../2d.imageData.get.source.negative.worker.js | 41 +++ .../2d.imageData.get.source.outside.html | 86 ++++++ .../2d.imageData.get.source.outside.worker.js | 81 +++++ .../2d.imageData.get.source.size.html | 30 ++ .../2d.imageData.get.source.size.worker.js | 25 ++ .../2d.imageData.get.unaffected.html | 42 +++ .../2d.imageData.get.unaffected.worker.js | 37 +++ .../pixel-manipulation/2d.imageData.get.zero.html | 33 ++ .../2d.imageData.get.zero.worker.js | 28 ++ .../2d.imageData.object.clamp.html | 55 ++++ .../2d.imageData.object.clamp.worker.js | 50 +++ .../2d.imageData.object.nan.html | 33 ++ .../2d.imageData.object.nan.worker.js | 28 ++ .../2d.imageData.object.properties.html | 30 ++ .../2d.imageData.object.properties.worker.js | 25 ++ .../2d.imageData.object.readonly.html | 40 +++ .../2d.imageData.object.readonly.worker.js | 35 +++ .../2d.imageData.object.round.html | 55 ++++ .../2d.imageData.object.round.worker.js | 50 +++ .../2d.imageData.object.set.html | 31 ++ .../2d.imageData.object.set.worker.js | 26 ++ .../2d.imageData.object.string.html | 36 +++ .../2d.imageData.object.string.worker.js | 31 ++ .../2d.imageData.object.undefined.html | 30 ++ .../2d.imageData.object.undefined.worker.js | 25 ++ .../pixel-manipulation/2d.imageData.put.alpha.html | 33 ++ .../pixel-manipulation/2d.imageData.put.alpha.png | Bin 0 -> 221 bytes .../2d.imageData.put.alpha.worker.js | 28 ++ .../pixel-manipulation/2d.imageData.put.basic.html | 33 ++ .../2d.imageData.put.basic.worker.js | 28 ++ .../pixel-manipulation/2d.imageData.put.clip.html | 37 +++ .../2d.imageData.put.clip.worker.js | 32 ++ .../2d.imageData.put.created.html | 37 +++ .../2d.imageData.put.created.worker.js | 32 ++ .../pixel-manipulation/2d.imageData.put.cross.html | 35 +++ .../2d.imageData.put.cross.worker.js | 30 ++ .../2d.imageData.put.dirty.negative.html | 44 +++ .../2d.imageData.put.dirty.negative.worker.js | 39 +++ .../2d.imageData.put.dirty.outside.html | 46 +++ .../2d.imageData.put.dirty.outside.worker.js | 41 +++ .../2d.imageData.put.dirty.rect1.html | 44 +++ .../2d.imageData.put.dirty.rect1.worker.js | 39 +++ .../2d.imageData.put.dirty.rect2.html | 44 +++ .../2d.imageData.put.dirty.rect2.worker.js | 39 +++ .../2d.imageData.put.dirty.zero.html | 33 ++ .../2d.imageData.put.dirty.zero.worker.js | 28 ++ .../2d.imageData.put.modified.html | 38 +++ .../2d.imageData.put.modified.worker.js | 33 ++ .../2d.imageData.put.nonfinite.html | 109 +++++++ .../2d.imageData.put.nonfinite.worker.js | 104 +++++++ .../pixel-manipulation/2d.imageData.put.null.html | 27 ++ .../2d.imageData.put.null.worker.js | 22 ++ .../pixel-manipulation/2d.imageData.put.path.html | 34 +++ .../2d.imageData.put.path.worker.js | 29 ++ .../2d.imageData.put.unaffected.html | 39 +++ .../2d.imageData.put.unaffected.worker.js | 34 +++ .../2d.imageData.put.unchanged.html | 44 +++ .../2d.imageData.put.unchanged.worker.js | 39 +++ .../2d.imageData.put.wrongtype.html | 30 ++ .../2d.imageData.put.wrongtype.worker.js | 25 ++ .../canvas/offscreen/reset/2d.reset.basic.html | 36 +++ .../offscreen/reset/2d.reset.basic.worker.js | 31 ++ .../2d.reset.render.drop_shadow-expected.html | 14 + .../reset/2d.reset.render.drop_shadow.html | 25 ++ .../reset/2d.reset.render.drop_shadow.w.html | 39 +++ ...render.global_composite_operation-expected.html | 15 + ...2d.reset.render.global_composite_operation.html | 23 ++ ....reset.render.global_composite_operation.w.html | 37 +++ .../reset/2d.reset.render.line-expected.html | 19 ++ .../offscreen/reset/2d.reset.render.line.html | 31 ++ .../offscreen/reset/2d.reset.render.line.w.html | 45 +++ .../reset/2d.reset.render.misc-expected.html | 15 + .../offscreen/reset/2d.reset.render.misc.html | 26 ++ .../offscreen/reset/2d.reset.render.misc.w.html | 40 +++ .../2d.reset.render.miter_limit-expected.html | 22 ++ .../reset/2d.reset.render.miter_limit.html | 30 ++ .../reset/2d.reset.render.miter_limit.w.html | 44 +++ .../reset/2d.reset.render.text-expected.html | 14 + .../offscreen/reset/2d.reset.render.text.html | 31 ++ .../offscreen/reset/2d.reset.render.text.w.html | 45 +++ .../reset/2d.reset.state.clip-expected.html | 14 + .../offscreen/reset/2d.reset.state.clip.html | 26 ++ .../offscreen/reset/2d.reset.state.clip.w.html | 40 +++ .../offscreen/reset/2d.reset.state.direction.html | 33 ++ .../reset/2d.reset.state.direction.worker.js | 28 ++ .../offscreen/reset/2d.reset.state.fill_style.html | 33 ++ .../reset/2d.reset.state.fill_style.worker.js | 28 ++ .../offscreen/reset/2d.reset.state.filter.html | 33 ++ .../reset/2d.reset.state.filter.worker.js | 28 ++ .../offscreen/reset/2d.reset.state.font.html | 33 ++ .../offscreen/reset/2d.reset.state.font.worker.js | 28 ++ .../reset/2d.reset.state.font_kerning.html | 33 ++ .../reset/2d.reset.state.font_kerning.worker.js | 28 ++ .../reset/2d.reset.state.font_stretch.html | 33 ++ .../reset/2d.reset.state.font_stretch.worker.js | 28 ++ .../reset/2d.reset.state.font_variant_caps.html | 33 ++ .../2d.reset.state.font_variant_caps.worker.js | 28 ++ .../reset/2d.reset.state.global_alpha.html | 33 ++ .../reset/2d.reset.state.global_alpha.worker.js | 28 ++ .../2d.reset.state.global_composite_operation.html | 33 ++ ...eset.state.global_composite_operation.worker.js | 28 ++ .../2d.reset.state.image_smoothing_enabled.html | 33 ++ ...d.reset.state.image_smoothing_enabled.worker.js | 28 ++ .../2d.reset.state.image_smoothing_quality.html | 33 ++ ...d.reset.state.image_smoothing_quality.worker.js | 28 ++ .../reset/2d.reset.state.letter_spacing.html | 33 ++ .../reset/2d.reset.state.letter_spacing.worker.js | 28 ++ .../offscreen/reset/2d.reset.state.line_cap.html | 33 ++ .../reset/2d.reset.state.line_cap.worker.js | 28 ++ .../offscreen/reset/2d.reset.state.line_dash.html | 30 ++ .../reset/2d.reset.state.line_dash.worker.js | 25 ++ .../reset/2d.reset.state.line_dash_offset.html | 33 ++ .../2d.reset.state.line_dash_offset.worker.js | 28 ++ .../offscreen/reset/2d.reset.state.line_join.html | 33 ++ .../reset/2d.reset.state.line_join.worker.js | 28 ++ .../offscreen/reset/2d.reset.state.line_width.html | 33 ++ .../reset/2d.reset.state.line_width.worker.js | 28 ++ .../reset/2d.reset.state.miter_limit.html | 33 ++ .../reset/2d.reset.state.miter_limit.worker.js | 28 ++ .../reset/2d.reset.state.shadow_blur.html | 33 ++ .../reset/2d.reset.state.shadow_blur.worker.js | 28 ++ .../reset/2d.reset.state.shadow_color.html | 33 ++ .../reset/2d.reset.state.shadow_color.worker.js | 28 ++ .../reset/2d.reset.state.shadow_offset_x.html | 33 ++ .../reset/2d.reset.state.shadow_offset_x.worker.js | 28 ++ .../reset/2d.reset.state.shadow_offset_y.html | 33 ++ .../reset/2d.reset.state.shadow_offset_y.worker.js | 28 ++ .../reset/2d.reset.state.stroke_style.html | 33 ++ .../reset/2d.reset.state.stroke_style.worker.js | 28 ++ .../offscreen/reset/2d.reset.state.text_align.html | 33 ++ .../reset/2d.reset.state.text_align.worker.js | 28 ++ .../reset/2d.reset.state.text_baseline.html | 33 ++ .../reset/2d.reset.state.text_baseline.worker.js | 28 ++ .../reset/2d.reset.state.text_rendering.html | 33 ++ .../reset/2d.reset.state.text_rendering.worker.js | 28 ++ .../2d.reset.state.transformation_matrix.html | 30 ++ .../2d.reset.state.transformation_matrix.worker.js | 25 ++ .../reset/2d.reset.state.word_spacing.html | 33 ++ .../reset/2d.reset.state.word_spacing.worker.js | 28 ++ .../set-proprietary-font-names-001-crash.html | 13 + .../offscreen/shadows/2d.shadow.alpha.1.html | 33 ++ .../offscreen/shadows/2d.shadow.alpha.1.worker.js | 28 ++ .../offscreen/shadows/2d.shadow.alpha.2.html | 33 ++ .../canvas/offscreen/shadows/2d.shadow.alpha.2.png | Bin 0 -> 206 bytes .../offscreen/shadows/2d.shadow.alpha.2.worker.js | 28 ++ .../offscreen/shadows/2d.shadow.alpha.3.html | 35 +++ .../canvas/offscreen/shadows/2d.shadow.alpha.3.png | Bin 0 -> 206 bytes .../offscreen/shadows/2d.shadow.alpha.3.worker.js | 30 ++ .../offscreen/shadows/2d.shadow.alpha.4.html | 35 +++ .../canvas/offscreen/shadows/2d.shadow.alpha.4.png | Bin 0 -> 206 bytes .../offscreen/shadows/2d.shadow.alpha.4.worker.js | 30 ++ .../offscreen/shadows/2d.shadow.alpha.5.html | 34 +++ .../canvas/offscreen/shadows/2d.shadow.alpha.5.png | Bin 0 -> 206 bytes .../offscreen/shadows/2d.shadow.alpha.5.worker.js | 29 ++ .../2d.shadow.attributes.shadowBlur.initial.html | 27 ++ ....shadow.attributes.shadowBlur.initial.worker.js | 22 ++ .../2d.shadow.attributes.shadowBlur.invalid.html | 53 ++++ ....shadow.attributes.shadowBlur.invalid.worker.js | 48 +++ .../2d.shadow.attributes.shadowBlur.valid.html | 37 +++ ...2d.shadow.attributes.shadowBlur.valid.worker.js | 32 ++ .../2d.shadow.attributes.shadowColor.initial.html | 27 ++ ...shadow.attributes.shadowColor.initial.worker.js | 22 ++ .../2d.shadow.attributes.shadowColor.invalid.html | 41 +++ ...shadow.attributes.shadowColor.invalid.worker.js | 36 +++ .../2d.shadow.attributes.shadowColor.valid.html | 31 ++ ...d.shadow.attributes.shadowColor.valid.worker.js | 26 ++ .../2d.shadow.attributes.shadowOffset.initial.html | 28 ++ ...hadow.attributes.shadowOffset.initial.worker.js | 23 ++ .../2d.shadow.attributes.shadowOffset.invalid.html | 67 ++++ ...hadow.attributes.shadowOffset.invalid.worker.js | 62 ++++ .../2d.shadow.attributes.shadowOffset.valid.html | 50 +++ ....shadow.attributes.shadowOffset.valid.worker.js | 45 +++ .../shadows/2d.shadow.blur.high-manual.html | 32 ++ .../shadows/2d.shadow.blur.high-manual.worker.js | 27 ++ .../offscreen/shadows/2d.shadow.blur.high.png | Bin 0 -> 246 bytes .../shadows/2d.shadow.blur.low-manual.html | 39 +++ .../shadows/2d.shadow.blur.low-manual.worker.js | 34 +++ .../offscreen/shadows/2d.shadow.blur.low.png | Bin 0 -> 1586 bytes .../offscreen/shadows/2d.shadow.canvas.alpha.html | 38 +++ .../offscreen/shadows/2d.shadow.canvas.alpha.png | Bin 0 -> 206 bytes .../shadows/2d.shadow.canvas.alpha.worker.js | 33 ++ .../offscreen/shadows/2d.shadow.canvas.basic.html | 38 +++ .../shadows/2d.shadow.canvas.basic.worker.js | 33 ++ .../shadows/2d.shadow.canvas.transparent.1.html | 36 +++ .../2d.shadow.canvas.transparent.1.worker.js | 31 ++ .../shadows/2d.shadow.canvas.transparent.2.html | 44 +++ .../2d.shadow.canvas.transparent.2.worker.js | 39 +++ .../canvas/offscreen/shadows/2d.shadow.clip.1.html | 42 +++ .../offscreen/shadows/2d.shadow.clip.1.worker.js | 37 +++ .../canvas/offscreen/shadows/2d.shadow.clip.2.html | 42 +++ .../offscreen/shadows/2d.shadow.clip.2.worker.js | 37 +++ .../canvas/offscreen/shadows/2d.shadow.clip.3.html | 43 +++ .../offscreen/shadows/2d.shadow.clip.3.worker.js | 38 +++ .../offscreen/shadows/2d.shadow.composite.1.html | 35 +++ .../shadows/2d.shadow.composite.1.worker.js | 30 ++ .../offscreen/shadows/2d.shadow.composite.2.html | 35 +++ .../shadows/2d.shadow.composite.2.worker.js | 30 ++ .../offscreen/shadows/2d.shadow.composite.3.html | 36 +++ .../shadows/2d.shadow.composite.3.worker.js | 31 ++ .../offscreen/shadows/2d.shadow.enable.blur.html | 32 ++ .../shadows/2d.shadow.enable.blur.worker.js | 27 ++ .../offscreen/shadows/2d.shadow.enable.off.1.html | 30 ++ .../shadows/2d.shadow.enable.off.1.worker.js | 25 ++ .../offscreen/shadows/2d.shadow.enable.off.2.html | 31 ++ .../shadows/2d.shadow.enable.off.2.worker.js | 26 ++ .../offscreen/shadows/2d.shadow.enable.x.html | 32 ++ .../offscreen/shadows/2d.shadow.enable.x.worker.js | 27 ++ .../offscreen/shadows/2d.shadow.enable.y.html | 32 ++ .../offscreen/shadows/2d.shadow.enable.y.worker.js | 27 ++ .../shadows/2d.shadow.gradient.alpha.html | 37 +++ .../offscreen/shadows/2d.shadow.gradient.alpha.png | Bin 0 -> 206 bytes .../shadows/2d.shadow.gradient.alpha.worker.js | 32 ++ .../shadows/2d.shadow.gradient.basic.html | 37 +++ .../shadows/2d.shadow.gradient.basic.worker.js | 32 ++ .../shadows/2d.shadow.gradient.transparent.1.html | 37 +++ .../2d.shadow.gradient.transparent.1.worker.js | 32 ++ .../shadows/2d.shadow.gradient.transparent.2.html | 43 +++ .../2d.shadow.gradient.transparent.2.worker.js | 38 +++ .../offscreen/shadows/2d.shadow.image.alpha.html | 30 ++ .../offscreen/shadows/2d.shadow.image.alpha.png | Bin 0 -> 206 bytes .../shadows/2d.shadow.image.alpha.worker.js | 26 ++ .../offscreen/shadows/2d.shadow.image.basic.html | 30 ++ .../shadows/2d.shadow.image.basic.worker.js | 26 ++ .../offscreen/shadows/2d.shadow.image.scale.html | 32 ++ .../shadows/2d.shadow.image.scale.worker.js | 28 ++ .../offscreen/shadows/2d.shadow.image.section.html | 32 ++ .../shadows/2d.shadow.image.section.worker.js | 28 ++ .../shadows/2d.shadow.image.transparent.1.html | 30 ++ .../2d.shadow.image.transparent.1.worker.js | 26 ++ .../shadows/2d.shadow.image.transparent.2.html | 36 +++ .../2d.shadow.image.transparent.2.worker.js | 32 ++ .../shadows/2d.shadow.offset.negativeX.html | 34 +++ .../shadows/2d.shadow.offset.negativeX.worker.js | 29 ++ .../shadows/2d.shadow.offset.negativeY.html | 34 +++ .../shadows/2d.shadow.offset.negativeY.worker.js | 29 ++ .../shadows/2d.shadow.offset.positiveX.html | 34 +++ .../shadows/2d.shadow.offset.positiveX.worker.js | 29 ++ .../shadows/2d.shadow.offset.positiveY.html | 34 +++ .../shadows/2d.shadow.offset.positiveY.worker.js | 29 ++ .../offscreen/shadows/2d.shadow.outside.html | 42 +++ .../offscreen/shadows/2d.shadow.outside.worker.js | 37 +++ .../offscreen/shadows/2d.shadow.pattern.alpha.html | 32 ++ .../offscreen/shadows/2d.shadow.pattern.alpha.png | Bin 0 -> 206 bytes .../shadows/2d.shadow.pattern.alpha.worker.js | 28 ++ .../offscreen/shadows/2d.shadow.pattern.basic.html | 32 ++ .../shadows/2d.shadow.pattern.basic.worker.js | 28 ++ .../shadows/2d.shadow.pattern.transparent.1.html | 32 ++ .../2d.shadow.pattern.transparent.1.worker.js | 28 ++ .../shadows/2d.shadow.pattern.transparent.2.html | 36 +++ .../2d.shadow.pattern.transparent.2.worker.js | 32 ++ .../offscreen/shadows/2d.shadow.stroke.basic.html | 40 +++ .../shadows/2d.shadow.stroke.basic.worker.js | 35 +++ .../offscreen/shadows/2d.shadow.stroke.cap.1.html | 43 +++ .../shadows/2d.shadow.stroke.cap.1.worker.js | 38 +++ .../offscreen/shadows/2d.shadow.stroke.cap.2.html | 41 +++ .../shadows/2d.shadow.stroke.cap.2.worker.js | 36 +++ .../offscreen/shadows/2d.shadow.stroke.join.1.html | 43 +++ .../shadows/2d.shadow.stroke.join.1.worker.js | 38 +++ .../offscreen/shadows/2d.shadow.stroke.join.2.html | 45 +++ .../shadows/2d.shadow.stroke.join.2.worker.js | 40 +++ .../offscreen/shadows/2d.shadow.stroke.join.3.html | 44 +++ .../shadows/2d.shadow.stroke.join.3.worker.js | 39 +++ .../offscreen/shadows/2d.shadow.transform.1.html | 34 +++ .../shadows/2d.shadow.transform.1.worker.js | 29 ++ .../offscreen/shadows/2d.shadow.transform.2.html | 34 +++ .../shadows/2d.shadow.transform.2.worker.js | 29 ++ .../offscreen/text/2d.text.align.default.html | 27 ++ .../offscreen/text/2d.text.align.default.worker.js | 22 ++ .../offscreen/text/2d.text.align.invalid.html | 41 +++ .../offscreen/text/2d.text.align.invalid.worker.js | 36 +++ .../canvas/offscreen/text/2d.text.align.valid.html | 40 +++ .../offscreen/text/2d.text.align.valid.worker.js | 35 +++ .../offscreen/text/2d.text.baseline.default.html | 27 ++ .../text/2d.text.baseline.default.worker.js | 22 ++ .../offscreen/text/2d.text.baseline.invalid.html | 41 +++ .../text/2d.text.baseline.invalid.worker.js | 36 +++ .../offscreen/text/2d.text.baseline.valid.html | 43 +++ .../text/2d.text.baseline.valid.worker.js | 38 +++ .../offscreen/text/2d.text.draw.align.center.html | 36 +++ .../text/2d.text.draw.align.center.worker.js | 32 ++ .../offscreen/text/2d.text.draw.align.end.ltr.html | 37 +++ .../text/2d.text.draw.align.end.ltr.worker.js | 33 ++ .../offscreen/text/2d.text.draw.align.end.rtl.html | 37 +++ .../text/2d.text.draw.align.end.rtl.worker.js | 33 ++ .../offscreen/text/2d.text.draw.align.left.html | 36 +++ .../text/2d.text.draw.align.left.worker.js | 32 ++ .../offscreen/text/2d.text.draw.align.right.html | 36 +++ .../text/2d.text.draw.align.right.worker.js | 32 ++ .../text/2d.text.draw.align.start.ltr.html | 37 +++ .../text/2d.text.draw.align.start.ltr.worker.js | 33 ++ .../text/2d.text.draw.align.start.rtl.html | 37 +++ .../text/2d.text.draw.align.start.rtl.worker.js | 33 ++ .../text/2d.text.draw.baseline.alphabetic.html | 36 +++ .../2d.text.draw.baseline.alphabetic.worker.js | 32 ++ .../text/2d.text.draw.baseline.bottom.html | 36 +++ .../text/2d.text.draw.baseline.bottom.worker.js | 32 ++ .../text/2d.text.draw.baseline.hanging.html | 36 +++ .../text/2d.text.draw.baseline.hanging.worker.js | 32 ++ .../text/2d.text.draw.baseline.ideographic.html | 36 +++ .../2d.text.draw.baseline.ideographic.worker.js | 32 ++ .../text/2d.text.draw.baseline.middle.html | 36 +++ .../text/2d.text.draw.baseline.middle.worker.js | 32 ++ .../offscreen/text/2d.text.draw.baseline.top.html | 36 +++ .../text/2d.text.draw.baseline.top.worker.js | 32 ++ .../text/2d.text.draw.fill.basic-manual.html | 32 ++ .../text/2d.text.draw.fill.basic-manual.worker.js | 27 ++ .../offscreen/text/2d.text.draw.fill.basic.png | Bin 0 -> 1137 bytes .../text/2d.text.draw.fill.maxWidth.NaN.html | 32 ++ .../text/2d.text.draw.fill.maxWidth.NaN.worker.js | 27 ++ .../text/2d.text.draw.fill.maxWidth.bound.html | 33 ++ .../2d.text.draw.fill.maxWidth.bound.worker.js | 29 ++ .../text/2d.text.draw.fill.maxWidth.fontface.html | 33 ++ .../2d.text.draw.fill.maxWidth.fontface.worker.js | 29 ++ .../2d.text.draw.fill.maxWidth.large-manual.html | 31 ++ ....text.draw.fill.maxWidth.large-manual.worker.js | 26 ++ .../text/2d.text.draw.fill.maxWidth.large.png | Bin 0 -> 1137 bytes .../text/2d.text.draw.fill.maxWidth.negative.html | 32 ++ .../2d.text.draw.fill.maxWidth.negative.worker.js | 27 ++ .../text/2d.text.draw.fill.maxWidth.small.html | 32 ++ .../2d.text.draw.fill.maxWidth.small.worker.js | 27 ++ .../text/2d.text.draw.fill.maxWidth.zero.html | 32 ++ .../text/2d.text.draw.fill.maxWidth.zero.worker.js | 27 ++ .../text/2d.text.draw.fill.rtl-manual.html | 32 ++ .../text/2d.text.draw.fill.rtl-manual.worker.js | 27 ++ .../offscreen/text/2d.text.draw.fill.rtl.png | Bin 0 -> 1137 bytes .../text/2d.text.draw.fill.unaffected.html | 42 +++ .../text/2d.text.draw.fill.unaffected.worker.js | 37 +++ .../offscreen/text/2d.text.draw.fontface.html | 33 ++ .../text/2d.text.draw.fontface.notinpage.html | 33 ++ .../text/2d.text.draw.fontface.notinpage.worker.js | 29 ++ .../text/2d.text.draw.fontface.repeat.html | 36 +++ .../text/2d.text.draw.fontface.repeat.worker.js | 32 ++ .../offscreen/text/2d.text.draw.fontface.worker.js | 29 ++ .../text/2d.text.draw.kern.consistent-manual.html | 36 +++ .../2d.text.draw.kern.consistent-manual.worker.js | 31 ++ .../offscreen/text/2d.text.draw.space.basic.html | 31 ++ .../text/2d.text.draw.space.basic.worker.js | 27 ++ .../text/2d.text.draw.space.collapse.end.html | 32 ++ .../text/2d.text.draw.space.collapse.end.worker.js | 28 ++ .../text/2d.text.draw.space.collapse.nonspace.html | 31 ++ .../2d.text.draw.space.collapse.nonspace.worker.js | 27 ++ .../text/2d.text.draw.space.collapse.other.html | 31 ++ .../2d.text.draw.space.collapse.other.worker.js | 27 ++ .../text/2d.text.draw.space.collapse.space.html | 31 ++ .../2d.text.draw.space.collapse.space.worker.js | 27 ++ .../text/2d.text.draw.space.collapse.start.html | 31 ++ .../2d.text.draw.space.collapse.start.worker.js | 27 ++ .../text/2d.text.draw.stroke.basic-manual.html | 33 ++ .../2d.text.draw.stroke.basic-manual.worker.js | 28 ++ .../offscreen/text/2d.text.draw.stroke.basic.png | Bin 0 -> 1634 bytes .../text/2d.text.draw.stroke.unaffected.html | 43 +++ .../text/2d.text.draw.stroke.unaffected.worker.js | 38 +++ .../2d.text.drawing.style.absolute.spacing.html | 46 +++ ...d.text.drawing.style.absolute.spacing.worker.js | 41 +++ ...d.text.drawing.style.font-relative.spacing.html | 38 +++ ...t.drawing.style.font-relative.spacing.worker.js | 33 ++ .../text/2d.text.drawing.style.fontKerning.html | 34 +++ ...t.drawing.style.fontKerning.with.uppercase.html | 58 ++++ ...wing.style.fontKerning.with.uppercase.worker.js | 53 ++++ .../2d.text.drawing.style.fontKerning.worker.js | 29 ++ ...2d.text.drawing.style.fontStretch.settings.html | 82 +++++ ...xt.drawing.style.fontStretch.settings.worker.js | 77 +++++ ...2d.text.drawing.style.fontVariant.settings.html | 79 +++++ ...xt.drawing.style.fontVariant.settings.worker.js | 74 +++++ .../2d.text.drawing.style.invalid.spacing.html | 43 +++ ...2d.text.drawing.style.invalid.spacing.worker.js | 38 +++ ...xt.drawing.style.letterSpacing.change.font.html | 46 +++ ...awing.style.letterSpacing.change.font.worker.js | 41 +++ ...d.text.drawing.style.letterSpacing.measure.html | 55 ++++ ...t.drawing.style.letterSpacing.measure.worker.js | 50 +++ .../2d.text.drawing.style.measure.direction.html | 33 ++ ....text.drawing.style.measure.direction.worker.js | 28 ++ .../2d.text.drawing.style.measure.rtl.text.html | 31 ++ ...d.text.drawing.style.measure.rtl.text.worker.js | 26 ++ .../2d.text.drawing.style.measure.textAlign.html | 33 ++ ....text.drawing.style.measure.textAlign.worker.js | 28 ++ .../2d.text.drawing.style.nonfinite.spacing.html | 38 +++ ....text.drawing.style.nonfinite.spacing.worker.js | 33 ++ ....text.drawing.style.textRendering.settings.html | 81 +++++ ....drawing.style.textRendering.settings.worker.js | 76 +++++ ...text.drawing.style.wordSpacing.change.font.html | 46 +++ ...drawing.style.wordSpacing.change.font.worker.js | 41 +++ .../2d.text.drawing.style.wordSpacing.measure.html | 55 ++++ ...ext.drawing.style.wordSpacing.measure.worker.js | 50 +++ .../offscreen/text/2d.text.font.default.html | 27 ++ .../offscreen/text/2d.text.font.default.worker.js | 22 ++ .../offscreen/text/2d.text.font.parse.basic.html | 31 ++ .../text/2d.text.font.parse.basic.worker.js | 26 ++ .../offscreen/text/2d.text.font.parse.complex.html | 28 ++ .../text/2d.text.font.parse.complex.worker.js | 23 ++ .../text/2d.text.font.parse.complex2.html | 28 ++ .../text/2d.text.font.parse.complex2.worker.js | 23 ++ .../offscreen/text/2d.text.font.parse.family.html | 28 ++ .../text/2d.text.font.parse.family.worker.js | 23 ++ .../offscreen/text/2d.text.font.parse.invalid.html | 72 +++++ .../text/2d.text.font.parse.invalid.worker.js | 67 ++++ .../offscreen/text/2d.text.font.parse.system.html | 28 ++ .../text/2d.text.font.parse.system.worker.js | 23 ++ .../offscreen/text/2d.text.font.parse.tiny.html | 28 ++ .../text/2d.text.font.parse.tiny.worker.js | 23 ++ .../offscreen/text/2d.text.font.relative_size.html | 28 ++ .../text/2d.text.font.relative_size.worker.js | 23 ++ .../canvas/offscreen/text/2d.text.font.weight.html | 31 ++ .../offscreen/text/2d.text.font.weight.worker.js | 26 ++ .../text/2d.text.fontVariantCaps1-expected.html | 15 + .../offscreen/text/2d.text.fontVariantCaps1.html | 21 ++ .../offscreen/text/2d.text.fontVariantCaps1.w.html | 35 +++ .../text/2d.text.fontVariantCaps2-unexpected.html | 16 + .../offscreen/text/2d.text.fontVariantCaps2.html | 33 ++ .../text/2d.text.fontVariantCaps2.worker.js | 28 ++ .../text/2d.text.fontVariantCaps3-expected.html | 15 + .../offscreen/text/2d.text.fontVariantCaps3.html | 22 ++ .../offscreen/text/2d.text.fontVariantCaps3.w.html | 36 +++ .../text/2d.text.fontVariantCaps4-expected.html | 15 + .../offscreen/text/2d.text.fontVariantCaps4.html | 22 ++ .../offscreen/text/2d.text.fontVariantCaps4.w.html | 36 +++ .../text/2d.text.fontVariantCaps5-expected.html | 15 + .../offscreen/text/2d.text.fontVariantCaps5.html | 22 ++ .../offscreen/text/2d.text.fontVariantCaps5.w.html | 36 +++ .../text/2d.text.fontVariantCaps6-expected.html | 15 + .../offscreen/text/2d.text.fontVariantCaps6.html | 22 ++ .../offscreen/text/2d.text.fontVariantCaps6.w.html | 36 +++ .../text/2d.text.measure.actualBoundingBox.html | 50 +++ .../2d.text.measure.actualBoundingBox.worker.js | 46 +++ .../offscreen/text/2d.text.measure.advances.html | 41 +++ .../text/2d.text.measure.advances.worker.js | 37 +++ .../offscreen/text/2d.text.measure.baselines.html | 34 +++ .../text/2d.text.measure.baselines.worker.js | 30 ++ .../text/2d.text.measure.emHeights-low-ascent.html | 34 +++ .../2d.text.measure.emHeights-low-ascent.worker.js | 30 ++ .../2d.text.measure.emHeights-zero-descent.html | 34 +++ ...d.text.measure.emHeights-zero-descent.worker.js | 30 ++ .../offscreen/text/2d.text.measure.emHeights.html | 34 +++ .../text/2d.text.measure.emHeights.worker.js | 30 ++ ...ext.measure.fontBoundingBox-reduced-ascent.html | 32 ++ ...easure.fontBoundingBox-reduced-ascent.worker.js | 28 ++ ....text.measure.fontBoundingBox-zero-descent.html | 32 ++ ....measure.fontBoundingBox-zero-descent.worker.js | 28 ++ .../text/2d.text.measure.fontBoundingBox.ahem.html | 31 ++ .../2d.text.measure.fontBoundingBox.ahem.worker.js | 27 ++ .../text/2d.text.measure.fontBoundingBox.html | 32 ++ .../text/2d.text.measure.fontBoundingBox.worker.js | 28 ++ .../text/2d.text.measure.width.basic.html | 31 ++ .../text/2d.text.measure.width.basic.worker.js | 27 ++ .../text/2d.text.measure.width.empty.html | 26 ++ .../text/2d.text.measure.width.empty.worker.js | 22 ++ .../text/2d.text.measure.width.space.html | 32 ++ .../text/2d.text.measure.width.space.worker.js | 28 ++ .../offscreen/text/2d.text.setFont.mathFont.html | 27 ++ .../text/2d.text.setFont.mathFont.worker.js | 22 ++ .../offscreen/text/canvas.2d.fontStretch-ref.html | 19 ++ .../text/canvas.2d.fontStretch.condensed.html | 30 ++ .../text/canvas.2d.fontStretch.expanded.html | 30 ++ .../canvas.2d.fontStretch.extra-condensed.html | 30 ++ .../text/canvas.2d.fontStretch.extra-expanded.html | 30 ++ .../text/canvas.2d.fontStretch.normal.html | 33 ++ .../text/canvas.2d.fontStretch.semi-condensed.html | 30 ++ .../text/canvas.2d.fontStretch.semi-expanded.html | 30 ++ .../canvas.2d.fontStretch.ultra-condensed.html | 30 ++ .../text/canvas.2d.fontStretch.ultra-expanded.html | 30 ++ .../2d.state.saverestore.bitmap.html | 33 ++ .../2d.state.saverestore.bitmap.worker.js | 28 ++ .../2d.state.saverestore.clip.html | 35 +++ .../2d.state.saverestore.clip.worker.js | 30 ++ .../2d.state.saverestore.fillStyle.html | 41 +++ .../2d.state.saverestore.fillStyle.worker.js | 36 +++ .../2d.state.saverestore.globalAlpha.html | 41 +++ .../2d.state.saverestore.globalAlpha.worker.js | 36 +++ ...state.saverestore.globalCompositeOperation.html | 41 +++ ....saverestore.globalCompositeOperation.worker.js | 36 +++ .../2d.state.saverestore.lineCap.html | 41 +++ .../2d.state.saverestore.lineCap.worker.js | 36 +++ .../2d.state.saverestore.lineJoin.html | 41 +++ .../2d.state.saverestore.lineJoin.worker.js | 36 +++ .../2d.state.saverestore.lineWidth.html | 41 +++ .../2d.state.saverestore.lineWidth.worker.js | 36 +++ .../2d.state.saverestore.miterLimit.html | 41 +++ .../2d.state.saverestore.miterLimit.worker.js | 36 +++ .../2d.state.saverestore.path.html | 34 +++ .../2d.state.saverestore.path.worker.js | 29 ++ .../2d.state.saverestore.shadowBlur.html | 41 +++ .../2d.state.saverestore.shadowBlur.worker.js | 36 +++ .../2d.state.saverestore.shadowColor.html | 41 +++ .../2d.state.saverestore.shadowColor.worker.js | 36 +++ .../2d.state.saverestore.shadowOffsetX.html | 41 +++ .../2d.state.saverestore.shadowOffsetX.worker.js | 36 +++ .../2d.state.saverestore.shadowOffsetY.html | 41 +++ .../2d.state.saverestore.shadowOffsetY.worker.js | 36 +++ .../2d.state.saverestore.stack.html | 36 +++ .../2d.state.saverestore.stack.worker.js | 31 ++ .../2d.state.saverestore.stackdepth.html | 37 +++ .../2d.state.saverestore.stackdepth.worker.js | 32 ++ .../2d.state.saverestore.strokeStyle.html | 41 +++ .../2d.state.saverestore.strokeStyle.worker.js | 36 +++ .../2d.state.saverestore.transformation.html | 34 +++ .../2d.state.saverestore.transformation.worker.js | 29 ++ .../2d.state.saverestore.underflow.html | 31 ++ .../2d.state.saverestore.underflow.worker.js | 26 ++ .../transformations/2d.transformation.order.html | 34 +++ .../2d.transformation.order.worker.js | 29 ++ .../2d.transformation.rotate.direction.html | 33 ++ .../2d.transformation.rotate.direction.worker.js | 28 ++ .../2d.transformation.rotate.nonfinite.html | 38 +++ .../2d.transformation.rotate.nonfinite.worker.js | 33 ++ .../2d.transformation.rotate.radians.html | 33 ++ .../2d.transformation.rotate.radians.worker.js | 28 ++ .../2d.transformation.rotate.wrap.html | 38 +++ .../2d.transformation.rotate.wrap.worker.js | 33 ++ .../2d.transformation.rotate.wrapnegative.html | 35 +++ ...2d.transformation.rotate.wrapnegative.worker.js | 30 ++ .../2d.transformation.rotate.zero.html | 33 ++ .../2d.transformation.rotate.zero.worker.js | 28 ++ .../2d.transformation.scale.basic.html | 33 ++ .../2d.transformation.scale.basic.worker.js | 28 ++ .../2d.transformation.scale.large.html | 33 ++ .../2d.transformation.scale.large.worker.js | 28 ++ .../2d.transformation.scale.multiple.html | 34 +++ .../2d.transformation.scale.multiple.worker.js | 29 ++ .../2d.transformation.scale.negative.html | 42 +++ .../2d.transformation.scale.negative.worker.js | 37 +++ .../2d.transformation.scale.nonfinite.html | 42 +++ .../2d.transformation.scale.nonfinite.worker.js | 37 +++ .../2d.transformation.scale.zero.html | 44 +++ .../2d.transformation.scale.zero.worker.js | 39 +++ .../2d.transformation.setTransform.multiple.html | 35 +++ ....transformation.setTransform.multiple.worker.js | 30 ++ .../2d.transformation.setTransform.nonfinite.html | 110 +++++++ ...transformation.setTransform.nonfinite.worker.js | 105 +++++++ .../2d.transformation.setTransform.skewed.html | 55 ++++ ...2d.transformation.setTransform.skewed.worker.js | 50 +++ .../2d.transformation.transform.identity.html | 33 ++ .../2d.transformation.transform.identity.worker.js | 28 ++ .../2d.transformation.transform.multiply.html | 34 +++ .../2d.transformation.transform.multiply.worker.js | 29 ++ .../2d.transformation.transform.nonfinite.html | 110 +++++++ ...2d.transformation.transform.nonfinite.worker.js | 105 +++++++ .../2d.transformation.transform.skewed.html | 55 ++++ .../2d.transformation.transform.skewed.worker.js | 50 +++ .../2d.transformation.translate.basic.html | 33 ++ .../2d.transformation.translate.basic.worker.js | 28 ++ .../2d.transformation.translate.nonfinite.html | 42 +++ ...2d.transformation.translate.nonfinite.worker.js | 37 +++ .../wide-gamut-canvas/2d.color.space.p3.to.p3.html | 39 +++ .../2d.color.space.p3.to.p3.worker.js | 34 +++ .../2d.color.space.p3.to.srgb.html | 38 +++ .../2d.color.space.p3.to.srgb.worker.js | 33 ++ 2203 files changed, 78519 insertions(+) create mode 100644 testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.basics.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.basics.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.missingargs.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.missingargs.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/META.yml create mode 100644 testing/web-platform/tests/html/canvas/offscreen/WEB_FEATURES.yml create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.arguments.missing.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.arguments.missing.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.casesensitive.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.casesensitive.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.emptystring.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.emptystring.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.exists.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.exists.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.cache.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.cache.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.create.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.create.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.shared.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.shared.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unique.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unique.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badname.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badname.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badsuffix.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badsuffix.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.nullsuffix.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.nullsuffix.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.unicode.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.unicode.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.getContext.options.any.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.clear.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.clear.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.copy.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.copy.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-atop.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-atop.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-out.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-out.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-over.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-over.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.lighter.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.lighter.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-atop.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-atop.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-out.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-out.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-over.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-over.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.xor.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.xor.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.clear.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.clear.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.copy.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.copy.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-atop.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-atop.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-out.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-out.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-over.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-over.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.lighter.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.lighter.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-atop.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-atop.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-out.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-out.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-over.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-over.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.xor.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.xor.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvas.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvas.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvascopy.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvascopy.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvaspattern.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvaspattern.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.default.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.default.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.fill.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.fill.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.image.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.image.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.imagepattern.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.imagepattern.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.invalid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.range.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.range.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.clear.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.clear.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.copy.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.copy.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-atop.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-atop.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-out.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-out.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-over.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-over.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.lighter.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.lighter.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-atop.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-atop.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-out.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-out.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-over.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-over.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.xor.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.xor.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.casesensitive.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.casesensitive.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.clear.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.clear.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.darker.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.darker.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.default.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.default.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.get.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.get.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.highlight.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.highlight.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.nullsuffix.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.nullsuffix.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.over.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.over.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.unrecognised.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.unrecognised.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.clear.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.clear.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.copy.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.copy.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-atop.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-atop.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-out.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-out.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-over.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-over.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.lighter.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.lighter.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-atop.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-atop.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-out.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-out.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-over.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-over.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.xor.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.xor.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.clear.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.clear.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.copy.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.copy.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-atop.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-atop.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-out.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-out.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-over.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-over.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.lighter.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.lighter.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-atop.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-atop.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-out.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-out.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-over.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-over.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.xor.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.xor.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.copy.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.copy.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-atop.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-atop.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-out.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-out.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.copy.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.copy.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-atop.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-atop.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-out.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-out.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.copy.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.copy.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-atop.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-atop.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-out.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-out.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.copy.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.copy.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-atop.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-atop.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-in.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-in.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-out.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-out.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.basics.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.basics.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.missingargs.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.missingargs.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.3arg.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.3arg.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.5arg.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.5arg.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destpos.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destpos.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destsize.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destsize.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcepos.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcepos.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcesize.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcesize.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.alpha.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.alpha.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.broken.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.broken.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.canvas.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.canvas.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.clip.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.clip.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.composite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.composite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.floatsource.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.floatsource.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedest.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedest.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedir.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedir.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativesource.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativesource.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nowrap.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nowrap.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.null.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.null.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.path.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.path.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.svg.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.transform.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.transform.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.wrongtype.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.wrongtype.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerocanvas.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerocanvas.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.image.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.clip.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.clip.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalalpha.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalalpha.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalcomposite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalcomposite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.negative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.negative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.path.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.path.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.shadow.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.transform.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.transform.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.zero.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.zero.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.clip.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.clip.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.negative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.negative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.path.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.path.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.shadow.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.transform.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.transform.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.zero.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.zero.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.clip.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.clip.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalalpha.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalalpha.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalcomposite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalcomposite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.negative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.negative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.path.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.path.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.shadow.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.transform.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.transform.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.CSSHSL.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.CSSRGB.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.colormix.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.colormix.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.default.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.default.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.halftransparent.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.halftransparent.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.semitransparent.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.semitransparent.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.solid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.solid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.transparent.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.transparent.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidstring.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidstring.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidtype.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidtype.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-6.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-6.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-7.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-7.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-8.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-8.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-9.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-9.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-6.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-6.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-7.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-7.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-8.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-8.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-9.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-9.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-6.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-6.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-6.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-6.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex6.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex6.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex8.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex8.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-6.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-6.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-6.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-6.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.html4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.html4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex6.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex6.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex7.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex7.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex8.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex8.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-6.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-6.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-eof.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-eof.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-num.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-num.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-percent.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-percent.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-eof.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-eof.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-percent.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-percent.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.system.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.system.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.toStringFunctionCallback.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.toStringFunctionCallback.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.invalid.inputs.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.invalid.inputs.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.negative.rotation.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.negative.rotation.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.positive.rotation.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.positive.rotation.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.empty.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.empty.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.alpha.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.alpha.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.alpha.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.color.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.color.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.color.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.multiple.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.multiple.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.multiple.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.outside.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.outside.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.solid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.solid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.vertical.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.vertical.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.vertical.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fill.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fill.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillRect.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillRect.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillText.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillText.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.stroke.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.stroke.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeRect.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeRect.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeText.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeText.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.compare.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.compare.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.crosscanvas.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.crosscanvas.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidcolor.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidcolor.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidoffset.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidoffset.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.return.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.return.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.type.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.type.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.update.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.update.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.behind.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.behind.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.beside.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.beside.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.bottom.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.bottom.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.cylinder.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.cylinder.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.front.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.front.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.top.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.top.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.equal.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.equal.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.negative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.negative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.canvas.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.canvas.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.image.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.image.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.nocontext.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.nocontext.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.type.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.type.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.zerocanvas.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.zerocanvas.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.crosscanvas.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.crosscanvas.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.null.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.null.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.string.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.string.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.undefined.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.undefined.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.canvas.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.canvas.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.image.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.image.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.case.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.case.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.empty.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.empty.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.null.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.null.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.nullsuffix.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.nullsuffix.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.undefined.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.undefined.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognised.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognised.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognisednull.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognisednull.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.identity.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.identity.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.infinity.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.infinity.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.invalid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.strokeStyle.colormix.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.strokeStyle.default.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.strokeStyle.default.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.value.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.value.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.isotropic-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.isotropic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.isotropic.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-x-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-x.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-x.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-y-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-y.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-y.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.x-only-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.x-only.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.x-only.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.y-only-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.y-only.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.y-only.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.beginLayer-options.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.beginLayer-options.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.no-clipping-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.no-clipping.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.no-clipping.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.with-clipping-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.with-clipping.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.with-clipping.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.full-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.full.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.full.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.partial-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.partial.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.partial.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-and-outside-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-and-outside.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-and-outside.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-outside-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-outside.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-outside.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.cross-layer-paths-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.cross-layer-paths.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.cross-layer-paths.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-and-shadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-and-shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-and-shadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.shadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.shadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.exceptions-are-no-op.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.exceptions-are-no-op.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-filter-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-filter.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-filter.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.shadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.shadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.shadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.shadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.shadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.shadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.shadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.shadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.shadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.shadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.shadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.shadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.shadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.shadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.shadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.shadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.shadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.shadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.no-global-states-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.no-global-states.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.no-global-states.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.shadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.shadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.no-global-states-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.no-global-states.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.no-global-states.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.shadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.shadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-reset-endLayer.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-reset-endLayer.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-restore.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-restore.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-save-endLayer.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-save-endLayer.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.endLayer.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.endLayer.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-beginLayer-restore.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-beginLayer-restore.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-endLayer.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-endLayer.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.convertToBlob.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.convertToBlob.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.createImageBitmap.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.createImageBitmap.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.createPattern.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.createPattern.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.drawImage.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.drawImage.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.getImageData.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.getImageData.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.putImageData.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.putImageData.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.transferToImageBitmap.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.transferToImageBitmap.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-filters-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-filters.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-filters.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.opaque-canvas-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.opaque-canvas.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.opaque-canvas.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.reset-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.reset.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.reset.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.restore-style-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.restore-style.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.restore-style.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.several-complex-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.several-complex.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.several-complex.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-with-clipping-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-with-clipping.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-with-clipping.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-with-clipping-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-with-clipping.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-with-clipping.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-endLayer.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-endLayer.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-save.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-save.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.restore.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.restore.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save-beginLayer.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save-beginLayer.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_reset_restore.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_reset_restore.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_restore.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_restore.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.butt.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.butt.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.closed.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.closed.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.invalid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.open.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.open.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.round.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.round.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.square.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.square.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.valid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.valid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cross.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cross.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.defaults.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.defaults.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.fill.noop.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.fill.noop.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.invalid.strokestyle.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.invalid.strokestyle.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.bevel.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.bevel.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.closed.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.closed.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.invalid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.miter.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.miter.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.open.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.open.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.parallel.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.parallel.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.round.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.round.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.valid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.valid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.acute.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.acute.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.exceeded.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.exceeded.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.invalid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.lineedge.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.lineedge.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.obtuse.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.obtuse.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.rightangle.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.rightangle.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.valid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.valid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.within.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.within.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.union.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.union.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.invalid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.scaledefault.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.scaledefault.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.transformed.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.transformed.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.valid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.valid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/convert-to-blob/offscreencanvas.convert.to.blob.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/convert-to-blob/offscreencanvas.convert.to.blob.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/draw-generic-family/2d.text.draw.generic.family.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/draw-generic-family/2d.text.draw.generic.family.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/filter/offscreencanvas.filter.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/filter/offscreencanvas.filter.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/filter/offscreencanvas.filter.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/image-smoothing/image.smoothing.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/image-smoothing/image.smoothing.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-layers-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-layers.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-layers.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-nested-layers-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-nested-layers.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-nested-layers.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas-worker-font-load-crash.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.getcontext.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.getcontext.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.resize.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.lowlatency.nocrash.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.nocrash.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfercontrol.to.offscreen.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfercontrol.to.offscreen.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transferrable.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transferrable.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/transformations/2d.transformation.getTransform.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/manual/wide-gamut-canvas/2d.color.space.p3.convertToBlobp3.canvas.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.6.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.6.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.default.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.default.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.empty.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.empty.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.end.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.end.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.negative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.negative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonempty.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonempty.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.6.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.6.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zeroradius.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zeroradius.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.negative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.negative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.scale.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.scale.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.end.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.end.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.start.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.start.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.transformation.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.transformation.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.beginPath.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.beginPath.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.scaled.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.scaled.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.shape.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.shape.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.empty.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.empty.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.intersect.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.intersect.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.unaffected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.unaffected.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.empty.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.empty.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.newline.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.newline.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.nextpoint.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.nextpoint.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.ellipse.basics.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.ellipse.basics.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.unaffected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.unaffected.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.overlap.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.overlap.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.overlap.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.add.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.add.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.initial.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.initial.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.arc.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.arc.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bezier.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bezier.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bigarc.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bigarc.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.edge.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.edge.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.empty.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.empty.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.outside.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.outside.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.subpath.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.subpath.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.unclosed.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.unclosed.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.winding.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.winding.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.scaleddashes.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.scaleddashes.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.invalid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.multi.path.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.multi.path.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nextpoint.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nextpoint.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.details.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.details.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.multiple.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.multiple.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.newsubpath.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.newsubpath.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.scaled.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.scaled.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.shape.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.shape.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.closed.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.closed.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.negative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.negative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.newsubpath.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.newsubpath.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.selfintersect.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.selfintersect.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.winding.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.winding.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.6.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.6.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.single argument.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.single argument.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.single.argument.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.single.argument.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.single.argument.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.single.argument.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompoint.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompoint.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.double.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.double.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompoint.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompoint.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.double.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.double.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompoint.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompoint.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.double.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.double.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompoint.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompoint.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.double.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.double.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompoint.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompoint.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.double.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.double.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompoint.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompoint.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.double.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.double.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompoint.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompoint.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.double.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.double.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompoint.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompoint.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.double.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.double.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompoint.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompoint.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.double.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.double.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.badinput.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.badinput.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.closed.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.closed.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.negative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.negative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.newsubpath.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.newsubpath.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.negative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.negative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.noargument.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.noargument.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.none.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.none.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.toomany.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.toomany.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.selfintersect.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.selfintersect.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.winding.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.winding.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.6.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.6.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.empty.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.empty.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.overlap.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.overlap.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.overlap.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.corner.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.corner.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.skew.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.skew.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.unaffected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.unaffected.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.union.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.union.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.changing.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.changing.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.multiple.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.multiple.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.initial.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.initial.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.zero.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.zero.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.double.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.double.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.initial.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.initial.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.large.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.large.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.negative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.negative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.round.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.round.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.zero.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.zero.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.clamp.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.clamp.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.double.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.double.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.invalid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.large.crash.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.large.crash.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.length.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.length.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonpremul.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonpremul.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.alpha.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.alpha.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.cols.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.cols.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rgb.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rgb.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rows.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rows.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.range.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.range.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.rounding.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.rounding.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.negative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.negative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.outside.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.outside.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.size.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.size.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.unaffected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.unaffected.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.zero.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.zero.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.clamp.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.clamp.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.nan.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.nan.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.properties.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.properties.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.readonly.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.readonly.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.round.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.round.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.set.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.set.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.string.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.string.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.undefined.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.undefined.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.alpha.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.alpha.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.alpha.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.clip.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.clip.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.created.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.created.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.cross.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.cross.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.negative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.negative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.outside.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.outside.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.zero.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.zero.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.modified.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.modified.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.null.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.null.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.path.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.path.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unaffected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unaffected.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unchanged.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unchanged.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.wrongtype.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.wrongtype.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.direction.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.direction.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.fill_style.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.fill_style.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.filter.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.filter.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_kerning.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_kerning.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_stretch.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_stretch.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_variant_caps.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_variant_caps.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_alpha.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_alpha.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_composite_operation.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_composite_operation.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_enabled.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_enabled.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_quality.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_quality.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.letter_spacing.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.letter_spacing.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_cap.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_cap.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash_offset.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash_offset.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_join.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_join.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_width.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_width.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.miter_limit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.miter_limit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_blur.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_blur.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_color.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_color.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_x.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_x.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_y.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_y.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.stroke_style.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.stroke_style.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_align.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_align.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_baseline.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_baseline.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_rendering.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_rendering.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.transformation_matrix.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.transformation_matrix.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.word_spacing.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.word_spacing.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/set-proprietary-font-names-001-crash.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.2.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.3.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.4.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.4.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.5.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.5.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.initial.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.initial.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.invalid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.valid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.valid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.initial.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.initial.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.invalid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.valid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.valid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.initial.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.initial.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.invalid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.valid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.valid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.high-manual.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.high-manual.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.high.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.low-manual.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.low-manual.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.low.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.alpha.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.alpha.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.alpha.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.blur.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.blur.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.x.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.x.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.y.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.y.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.alpha.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.alpha.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.alpha.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.scale.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.scale.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.section.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.section.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeX.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeX.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeY.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeY.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveX.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveX.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveY.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveY.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.outside.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.outside.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.1.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.default.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.default.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.invalid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.valid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.valid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.default.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.default.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.invalid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.valid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.valid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.center.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.center.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.ltr.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.ltr.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.rtl.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.rtl.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.left.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.left.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.right.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.right.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.ltr.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.ltr.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.rtl.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.rtl.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.alphabetic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.alphabetic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.hanging.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.hanging.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.basic-manual.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.basic-manual.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.basic.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.NaN.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.NaN.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.fontface.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.fontface.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.large-manual.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.large-manual.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.large.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.negative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.negative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.small.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.small.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.zero.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.zero.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.rtl-manual.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.rtl-manual.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.rtl.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.unaffected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.unaffected.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.notinpage.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.notinpage.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.repeat.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.repeat.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.kern.consistent-manual.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.kern.consistent-manual.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.end.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.end.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.nonspace.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.nonspace.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.other.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.other.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.space.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.space.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.start.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.start.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.basic-manual.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.basic-manual.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.basic.png create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.unaffected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.unaffected.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.absolute.spacing.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.absolute.spacing.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.font-relative.spacing.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.font-relative.spacing.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.with.uppercase.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.with.uppercase.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontStretch.settings.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontStretch.settings.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontVariant.settings.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontVariant.settings.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.invalid.spacing.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.invalid.spacing.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.change.font.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.change.font.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.measure.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.measure.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.direction.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.direction.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.rtl.text.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.rtl.text.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.textAlign.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.textAlign.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.nonfinite.spacing.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.nonfinite.spacing.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.textRendering.settings.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.textRendering.settings.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.change.font.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.change.font.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.measure.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.measure.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.default.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.default.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.family.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.family.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.invalid.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.invalid.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.system.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.system.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.tiny.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.tiny.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.relative_size.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.relative_size.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.weight.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.weight.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps1-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps1.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps1.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps2-unexpected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps2.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps2.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps3-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps3.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps4-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps4.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps4.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps5-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps5.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps5.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps6-expected.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps6.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps6.w.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.actualBoundingBox.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.actualBoundingBox.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.advances.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.advances.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.baselines.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.ahem.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.ahem.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.empty.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.empty.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.space.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.space.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.setFont.mathFont.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/2d.text.setFont.mathFont.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch-ref.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.condensed.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.expanded.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.extra-condensed.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.extra-expanded.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.normal.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.semi-condensed.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.semi-expanded.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.ultra-condensed.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.ultra-expanded.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.bitmap.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.bitmap.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.clip.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.clip.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.fillStyle.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.fillStyle.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalAlpha.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalAlpha.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalCompositeOperation.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalCompositeOperation.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineCap.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineCap.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineJoin.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineJoin.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineWidth.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineWidth.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.miterLimit.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.miterLimit.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.path.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.path.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowBlur.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowBlur.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowColor.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowColor.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetX.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetX.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetY.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetY.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stack.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stack.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stackdepth.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stackdepth.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.strokeStyle.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.strokeStyle.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.transformation.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.transformation.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.underflow.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.underflow.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.order.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.order.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.direction.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.direction.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.radians.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.radians.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrap.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrap.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrapnegative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrapnegative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.zero.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.zero.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.large.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.large.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.multiple.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.multiple.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.negative.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.negative.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.zero.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.zero.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.multiple.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.multiple.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.skewed.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.skewed.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.identity.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.identity.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.multiply.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.multiply.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.skewed.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.skewed.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.basic.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.basic.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.nonfinite.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.nonfinite.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.p3.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.p3.worker.js create mode 100644 testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.srgb.html create mode 100644 testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.srgb.worker.js (limited to 'testing/web-platform/tests/html/canvas/offscreen') diff --git a/testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.basics.html b/testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.basics.html new file mode 100644 index 0000000000..a89ec10f9b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.basics.html @@ -0,0 +1,62 @@ + + +OffscreenCanvas test: 2d.conformance.requirements.basics + + + + +

2d.conformance.requirements.basics

+

void methods return undefined

+ +

Defined in "Web IDL" (draft) + diff --git a/testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.basics.worker.js b/testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.basics.worker.js new file mode 100644 index 0000000000..8d6ddc894f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.basics.worker.js @@ -0,0 +1,58 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.conformance.requirements.basics +// Description:void methods return undefined +// Note:

Defined in "Web IDL" (draft) + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("void methods return undefined"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + +var canvas = new OffscreenCanvas(100, 50); +var ctx = canvas.getContext('2d'); + +_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.setTransform(), undefined, "ctx.setTransform()", "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(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"); +t.done(); + +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.missingargs.html b/testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.missingargs.html new file mode 100644 index 0000000000..cfbbca9e5e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.missingargs.html @@ -0,0 +1,141 @@ + + +OffscreenCanvas test: 2d.conformance.requirements.missingargs + + + + +

2d.conformance.requirements.missingargs

+

Missing arguments cause TypeError

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.missingargs.worker.js b/testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.missingargs.worker.js new file mode 100644 index 0000000000..fe1b111f05 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/2d.conformance.requirements.missingargs.worker.js @@ -0,0 +1,137 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.conformance.requirements.missingargs +// Description:Missing arguments cause TypeError +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Missing arguments cause TypeError"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + +var canvas = new OffscreenCanvas(100, 50); +var ctx = canvas.getContext('2d'); + +assert_throws_js(TypeError, function() { ctx.scale(); }); +assert_throws_js(TypeError, function() { ctx.scale(1); }); +assert_throws_js(TypeError, function() { ctx.rotate(); }); +assert_throws_js(TypeError, function() { ctx.translate(); }); +assert_throws_js(TypeError, function() { ctx.translate(0); }); +if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported) + assert_throws_js(TypeError, function() { ctx.transform(); }); + assert_throws_js(TypeError, function() { ctx.transform(1); }); + assert_throws_js(TypeError, function() { ctx.transform(1, 0); }); + assert_throws_js(TypeError, function() { ctx.transform(1, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.transform(1, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.transform(1, 0, 0, 1, 0); }); +} +if (ctx.setTransform) { + assert_throws_js(TypeError, function() { ctx.setTransform(1); }); + assert_throws_js(TypeError, function() { ctx.setTransform(1, 0); }); + assert_throws_js(TypeError, function() { ctx.setTransform(1, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.setTransform(1, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.setTransform(1, 0, 0, 1, 0); }); +} +assert_throws_js(TypeError, function() { ctx.createLinearGradient(); }); +assert_throws_js(TypeError, function() { ctx.createLinearGradient(0); }); +assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0); }); +assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, 1); }); +assert_throws_js(TypeError, function() { ctx.createRadialGradient(); }); +assert_throws_js(TypeError, function() { ctx.createRadialGradient(0); }); +assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0); }); +assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1); }); +assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0); }); +assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, 0); }); +assert_throws_js(TypeError, function() { ctx.createPattern(canvas); }); +assert_throws_js(TypeError, function() { ctx.clearRect(); }); +assert_throws_js(TypeError, function() { ctx.clearRect(0); }); +assert_throws_js(TypeError, function() { ctx.clearRect(0, 0); }); +assert_throws_js(TypeError, function() { ctx.clearRect(0, 0, 0); }); +assert_throws_js(TypeError, function() { ctx.fillRect(); }); +assert_throws_js(TypeError, function() { ctx.fillRect(0); }); +assert_throws_js(TypeError, function() { ctx.fillRect(0, 0); }); +assert_throws_js(TypeError, function() { ctx.fillRect(0, 0, 0); }); +assert_throws_js(TypeError, function() { ctx.strokeRect(); }); +assert_throws_js(TypeError, function() { ctx.strokeRect(0); }); +assert_throws_js(TypeError, function() { ctx.strokeRect(0, 0); }); +assert_throws_js(TypeError, function() { ctx.strokeRect(0, 0, 0); }); +assert_throws_js(TypeError, function() { ctx.moveTo(); }); +assert_throws_js(TypeError, function() { ctx.moveTo(0); }); +assert_throws_js(TypeError, function() { ctx.lineTo(); }); +assert_throws_js(TypeError, function() { ctx.lineTo(0); }); +assert_throws_js(TypeError, function() { ctx.quadraticCurveTo(); }); +assert_throws_js(TypeError, function() { ctx.quadraticCurveTo(0); }); +assert_throws_js(TypeError, function() { ctx.quadraticCurveTo(0, 0); }); +assert_throws_js(TypeError, function() { ctx.quadraticCurveTo(0, 0, 0); }); +assert_throws_js(TypeError, function() { ctx.bezierCurveTo(); }); +assert_throws_js(TypeError, function() { ctx.bezierCurveTo(0); }); +assert_throws_js(TypeError, function() { ctx.bezierCurveTo(0, 0); }); +assert_throws_js(TypeError, function() { ctx.bezierCurveTo(0, 0, 0); }); +assert_throws_js(TypeError, function() { ctx.bezierCurveTo(0, 0, 0, 0); }); +assert_throws_js(TypeError, function() { ctx.bezierCurveTo(0, 0, 0, 0, 0); }); +assert_throws_js(TypeError, function() { ctx.arcTo(); }); +assert_throws_js(TypeError, function() { ctx.arcTo(0); }); +assert_throws_js(TypeError, function() { ctx.arcTo(0, 0); }); +assert_throws_js(TypeError, function() { ctx.arcTo(0, 0, 0); }); +assert_throws_js(TypeError, function() { ctx.arcTo(0, 0, 0, 0); }); +assert_throws_js(TypeError, function() { ctx.rect(); }); +assert_throws_js(TypeError, function() { ctx.rect(0); }); +assert_throws_js(TypeError, function() { ctx.rect(0, 0); }); +assert_throws_js(TypeError, function() { ctx.rect(0, 0, 0); }); +assert_throws_js(TypeError, function() { ctx.arc(); }); +assert_throws_js(TypeError, function() { ctx.arc(0); }); +assert_throws_js(TypeError, function() { ctx.arc(0, 0); }); +assert_throws_js(TypeError, function() { ctx.arc(0, 0, 1); }); +assert_throws_js(TypeError, function() { ctx.arc(0, 0, 1, 0); }); +// (6th argument to arc is optional) +if (ctx.isPointInPath) { + assert_throws_js(TypeError, function() { ctx.isPointInPath(); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath(0); }); +} +if (ctx.drawFocusRing) { + assert_throws_js(TypeError, function() { ctx.drawFocusRing(); }); + assert_throws_js(TypeError, function() { ctx.drawFocusRing(canvas); }); + assert_throws_js(TypeError, function() { ctx.drawFocusRing(canvas, 0); }); +} +if (ctx.fillText) { + assert_throws_js(TypeError, function() { ctx.fillText(); }); + assert_throws_js(TypeError, function() { ctx.fillText('test'); }); + assert_throws_js(TypeError, function() { ctx.fillText('test', 0); }); + assert_throws_js(TypeError, function() { ctx.strokeText(); }); + assert_throws_js(TypeError, function() { ctx.strokeText('test'); }); + assert_throws_js(TypeError, function() { ctx.strokeText('test', 0); }); + assert_throws_js(TypeError, function() { ctx.measureText(); }); +} +assert_throws_js(TypeError, function() { ctx.drawImage(); }); +assert_throws_js(TypeError, function() { ctx.drawImage(canvas); }); +assert_throws_js(TypeError, function() { 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) { + assert_throws_js(TypeError, function() { ctx.createImageData(); }); + assert_throws_js(TypeError, function() { ctx.createImageData(1); }); +} +if (ctx.getImageData) { + assert_throws_js(TypeError, function() { ctx.getImageData(); }); + assert_throws_js(TypeError, function() { ctx.getImageData(0); }); + assert_throws_js(TypeError, function() { ctx.getImageData(0, 0); }); + assert_throws_js(TypeError, function() { ctx.getImageData(0, 0, 1); }); +} +if (ctx.putImageData) { + var imgdata = ctx.getImageData(0, 0, 1, 1); + assert_throws_js(TypeError, function() { ctx.putImageData(); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 0); }); +} +var g = ctx.createLinearGradient(0, 0, 0, 0); +assert_throws_js(TypeError, function() { g.addColorStop(); }); +assert_throws_js(TypeError, function() { g.addColorStop(0); }); +t.done(); + +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/META.yml b/testing/web-platform/tests/html/canvas/offscreen/META.yml new file mode 100644 index 0000000000..d0524194c9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/META.yml @@ -0,0 +1,7 @@ +spec: https://html.spec.whatwg.org/multipage/canvas.html#the-offscreencanvas-interface +suggested_reviewers: + - AmeliaBR + - annevk + - kenrussell + - fserb + - Cwiiis diff --git a/testing/web-platform/tests/html/canvas/offscreen/WEB_FEATURES.yml b/testing/web-platform/tests/html/canvas/offscreen/WEB_FEATURES.yml new file mode 100644 index 0000000000..b1f003a745 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/WEB_FEATURES.yml @@ -0,0 +1,3 @@ +features: +- name: offscreen-canvas + files: "**" diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.arguments.missing.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.arguments.missing.html new file mode 100644 index 0000000000..0c9fdc9639 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.arguments.missing.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.canvas.context.arguments.missing + + + + +

2d.canvas.context.arguments.missing

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.arguments.missing.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.arguments.missing.worker.js new file mode 100644 index 0000000000..1b5c857a79 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.arguments.missing.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.context.arguments.missing +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + assert_throws_js(TypeError, function() { offscreenCanvas2.getContext(); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.casesensitive.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.casesensitive.html new file mode 100644 index 0000000000..aed71a37e9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.casesensitive.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.canvas.context.casesensitive + + + + +

2d.canvas.context.casesensitive

+

Context name "2D" is unrecognised; matching is case sensitive

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.casesensitive.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.casesensitive.worker.js new file mode 100644 index 0000000000..c1df3a9f80 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.casesensitive.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.context.casesensitive +// Description:Context name "2D" is unrecognised; matching is case sensitive +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Context name \"2D\" is unrecognised; matching is case sensitive"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + assert_throws_js(TypeError, function() { offscreenCanvas2.getContext('2D'); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.emptystring.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.emptystring.html new file mode 100644 index 0000000000..10548a6b7c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.emptystring.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.canvas.context.emptystring + + + + +

2d.canvas.context.emptystring

+

getContext with empty string returns null

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.emptystring.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.emptystring.worker.js new file mode 100644 index 0000000000..53a58c1f5d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.emptystring.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.context.emptystring +// Description:getContext with empty string returns null +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getContext with empty string returns null"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + assert_throws_js(TypeError, function() { offscreenCanvas2.getContext(""); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.exists.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.exists.html new file mode 100644 index 0000000000..41b5cfee31 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.exists.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.canvas.context.exists + + + + +

2d.canvas.context.exists

+

The 2D context is implemented

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.exists.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.exists.worker.js new file mode 100644 index 0000000000..77a43530a0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.exists.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.context.exists +// Description:The 2D context is implemented +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("The 2D context is implemented"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + _assertDifferent(offscreenCanvas2.getContext('2d'), null, "offscreenCanvas2.getContext('2d')", "null"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.cache.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.cache.html new file mode 100644 index 0000000000..2bcf34490e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.cache.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.canvas.context.extraargs.cache + + + + +

2d.canvas.context.extraargs.cache

+

The 2D context doesn't throw with extra getContext arguments (cached)

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.cache.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.cache.worker.js new file mode 100644 index 0000000000..14284a0a7d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.cache.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.context.extraargs.cache +// Description:The 2D context doesn't throw with extra getContext arguments (cached) +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("The 2D context doesn't throw with extra getContext arguments (cached)"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertDifferent(canvas.getContext('2d', false, {}, [], 1, "2"), null, "canvas.getContext('2d', false, {}, [], 1, \"2\")", "null"); + _assertDifferent(canvas.getContext('2d', 123), null, "canvas.getContext('2d', 123)", "null"); + _assertDifferent(canvas.getContext('2d', "test"), null, "canvas.getContext('2d', \"test\")", "null"); + _assertDifferent(canvas.getContext('2d', undefined), null, "canvas.getContext('2d', undefined)", "null"); + _assertDifferent(canvas.getContext('2d', null), null, "canvas.getContext('2d', null)", "null"); + _assertDifferent(canvas.getContext('2d', Symbol.hasInstance), null, "canvas.getContext('2d', Symbol.hasInstance)", "null"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.create.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.create.html new file mode 100644 index 0000000000..029122355c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.create.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.canvas.context.extraargs.create + + + + +

2d.canvas.context.extraargs.create

+

The 2D context doesn't throw with extra getContext arguments (new context)

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.create.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.create.worker.js new file mode 100644 index 0000000000..b4208edba8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.extraargs.create.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.context.extraargs.create +// Description:The 2D context doesn't throw with extra getContext arguments (new context) +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("The 2D context doesn't throw with extra getContext arguments (new context)"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertDifferent((new OffscreenCanvas(100, 50)).getContext('2d', false, {}, [], 1, "2"), null, "(new OffscreenCanvas(100, 50)).getContext('2d', false, {}, [], 1, \"2\")", "null"); + _assertDifferent((new OffscreenCanvas(100, 50)).getContext('2d', 123), null, "(new OffscreenCanvas(100, 50)).getContext('2d', 123)", "null"); + _assertDifferent((new OffscreenCanvas(100, 50)).getContext('2d', "test"), null, "(new OffscreenCanvas(100, 50)).getContext('2d', \"test\")", "null"); + _assertDifferent((new OffscreenCanvas(100, 50)).getContext('2d', undefined), null, "(new OffscreenCanvas(100, 50)).getContext('2d', undefined)", "null"); + _assertDifferent((new OffscreenCanvas(100, 50)).getContext('2d', null), null, "(new OffscreenCanvas(100, 50)).getContext('2d', null)", "null"); + _assertDifferent((new OffscreenCanvas(100, 50)).getContext('2d', Symbol.hasInstance), null, "(new OffscreenCanvas(100, 50)).getContext('2d', Symbol.hasInstance)", "null"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.shared.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.shared.html new file mode 100644 index 0000000000..cb9501747e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.shared.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.canvas.context.shared + + + + +

2d.canvas.context.shared

+

getContext('2d') returns objects which share canvas state

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.shared.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.shared.worker.js new file mode 100644 index 0000000000..8e53475756 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.shared.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.context.shared +// Description:getContext('2d') returns objects which share canvas state +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getContext('2d') returns objects which share canvas state"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unique.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unique.html new file mode 100644 index 0000000000..66e4a049ba --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unique.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.canvas.context.unique + + + + +

2d.canvas.context.unique

+

getContext('2d') returns the same object

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unique.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unique.worker.js new file mode 100644 index 0000000000..275e45fde6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unique.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.context.unique +// Description:getContext('2d') returns the same object +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getContext('2d') returns the same object"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + _assertSame(offscreenCanvas2.getContext('2d'), offscreenCanvas2.getContext('2d'), "offscreenCanvas2.getContext('2d')", "offscreenCanvas2.getContext('2d')"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badname.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badname.html new file mode 100644 index 0000000000..4313f40843 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badname.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.canvas.context.unrecognised.badname + + + + +

2d.canvas.context.unrecognised.badname

+

getContext with unrecognised context name returns null

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badname.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badname.worker.js new file mode 100644 index 0000000000..dd16f2fbe1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badname.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.context.unrecognised.badname +// Description:getContext with unrecognised context name returns null +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getContext with unrecognised context name returns null"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + assert_throws_js(TypeError, function() { offscreenCanvas2.getContext('This is not an implemented context in any real browser'); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badsuffix.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badsuffix.html new file mode 100644 index 0000000000..c00afa686e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badsuffix.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.canvas.context.unrecognised.badsuffix + + + + +

2d.canvas.context.unrecognised.badsuffix

+

Context name "2d" plus a suffix is unrecognised

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badsuffix.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badsuffix.worker.js new file mode 100644 index 0000000000..5e684c92c7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.badsuffix.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.context.unrecognised.badsuffix +// Description:Context name "2d" plus a suffix is unrecognised +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Context name \"2d\" plus a suffix is unrecognised"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + assert_throws_js(TypeError, function() { offscreenCanvas2.getContext("2d#"); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.nullsuffix.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.nullsuffix.html new file mode 100644 index 0000000000..0ce3d4195e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.nullsuffix.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.canvas.context.unrecognised.nullsuffix + + + + +

2d.canvas.context.unrecognised.nullsuffix

+

Context name "2d" plus a "\0" suffix is unrecognised

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.nullsuffix.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.nullsuffix.worker.js new file mode 100644 index 0000000000..2886010fb6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.nullsuffix.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.context.unrecognised.nullsuffix +// Description:Context name "2d" plus a "\0" suffix is unrecognised +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Context name \"2d\" plus a \"\\0\" suffix is unrecognised"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + assert_throws_js(TypeError, function() { offscreenCanvas2.getContext("2d\0"); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.unicode.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.unicode.html new file mode 100644 index 0000000000..316123675a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.unicode.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.canvas.context.unrecognised.unicode + + + + +

2d.canvas.context.unrecognised.unicode

+

Context name which kind of looks like "2d" is unrecognised

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.unicode.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.unicode.worker.js new file mode 100644 index 0000000000..46e562dd48 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.canvas.context.unrecognised.unicode.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.context.unrecognised.unicode +// Description:Context name which kind of looks like "2d" is unrecognised +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Context name which kind of looks like \"2d\" is unrecognised"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + assert_throws_js(TypeError, function() { offscreenCanvas2.getContext("2\uFF44"); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.getContext.options.any.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.getContext.options.any.js new file mode 100644 index 0000000000..930f7722ee --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-context/2d.getContext.options.any.js @@ -0,0 +1,46 @@ +test(() => { + const expected = [ + "alpha", + "colorSpace", + "colorSpace toString", + "desynchronized", + "willReadFrequently", + ]; + var actual = []; + const options = { + get alpha() { + actual.push("alpha"); + return true; + }, + get willReadFrequently() { + actual.push("willReadFrequently"); + return false; + }, + get desynchronized() { + actual.push("desynchronized"); + return false; + }, + get colorSpace() { + actual.push("colorSpace"); + return { + toString() { + actual.push("colorSpace toString"); + return "srgb"; + } + }; + }, + }; + + const canvas = new OffscreenCanvas(100, 50); + const context = canvas.getContext('2d', options); + assert_not_equals(context, null, "context"); + assert_array_equals(actual, expected, "order of operations (creation)"); + actual = []; + assert_equals(canvas.getContext('2d', options), context, "cached context"); + // Getting the cached context does not involve the options argument at all; + // the context retains its existing settings, and the new options (if any) + // are ignored. + // Therefore, there is no expectation that the 'options' dictionary will be + // accessed again here, and we cannot predict the contents, if any, of the + // 'actual' array. +}); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.html new file mode 100644 index 0000000000..0793c74f39 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.color + + + + +

2d.canvas.host.initial.color

+

Initial state is transparent black

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.worker.js new file mode 100644 index 0000000000..11d6b9f098 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.color.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.color +// Description:Initial state is transparent black +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Initial state is transparent black"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertPixel(canvas, 20,20, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.html new file mode 100644 index 0000000000..36230dab77 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.html @@ -0,0 +1,89 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.2dstate + + + + +

2d.canvas.host.initial.reset.2dstate

+

Resetting the canvas state resets 2D state variables

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.worker.js new file mode 100644 index 0000000000..df0bd9f63c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.2dstate.worker.js @@ -0,0 +1,84 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.2dstate +// Description:Resetting the canvas state resets 2D state variables +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Resetting the canvas state resets 2D state variables"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.html new file mode 100644 index 0000000000..fc53240795 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.clip + + + + +

2d.canvas.host.initial.reset.clip

+

Resetting the canvas state resets the current clip region

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.worker.js new file mode 100644 index 0000000000..80554b0a3f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.clip.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.clip +// Description:Resetting the canvas state resets the current clip region +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Resetting the canvas state resets the current clip region"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.html new file mode 100644 index 0000000000..3771a5e37a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.different + + + + +

2d.canvas.host.initial.reset.different

+

Changing size resets canvas to transparent black

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.worker.js new file mode 100644 index 0000000000..6074d4f2a2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.different.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.different +// Description:Changing size resets canvas to transparent black +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Changing size resets canvas to transparent black"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 50, 50); + _assertPixel(canvas, 20,20, 255,0,0,255); + canvas.width = 50; + _assertPixel(canvas, 20,20, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.html new file mode 100644 index 0000000000..387b4d1f1e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.gradient + + + + +

2d.canvas.host.initial.reset.gradient

+

Resetting the canvas state does not invalidate any existing gradients

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.worker.js new file mode 100644 index 0000000000..9029b48056 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.gradient.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.gradient +// Description:Resetting the canvas state does not invalidate any existing gradients +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Resetting the canvas state does not invalidate any existing gradients"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.html new file mode 100644 index 0000000000..3a887a8f1f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.path + + + + +

2d.canvas.host.initial.reset.path

+

Resetting the canvas state resets the current path

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.worker.js new file mode 100644 index 0000000000..0ab12872ae --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.path.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.path +// Description:Resetting the canvas state resets the current path +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Resetting the canvas state resets the current path"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.html new file mode 100644 index 0000000000..d822f90917 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.pattern + + + + +

2d.canvas.host.initial.reset.pattern

+

Resetting the canvas state does not invalidate any existing patterns

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.worker.js new file mode 100644 index 0000000000..c4870a6f99 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.pattern.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.pattern +// Description:Resetting the canvas state does not invalidate any existing patterns +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Resetting the canvas state does not invalidate any existing patterns"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.html new file mode 100644 index 0000000000..19394def37 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.same + + + + +

2d.canvas.host.initial.reset.same

+

Setting size (not changing the value) resets canvas to transparent black

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.worker.js new file mode 100644 index 0000000000..48d24750ac --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.same.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.same +// Description:Setting size (not changing the value) resets canvas to transparent black +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting size (not changing the value) resets canvas to transparent black"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 100; + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 50, 50); + _assertPixel(canvas, 20,20, 255,0,0,255); + canvas.width = 100; + _assertPixel(canvas, 20,20, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.html new file mode 100644 index 0000000000..ee3b5abf10 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.canvas.host.initial.reset.transform + + + + +

2d.canvas.host.initial.reset.transform

+

Resetting the canvas state resets the current transformation matrix

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.worker.js new file mode 100644 index 0000000000..218e64fa5d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.initial.reset.transform.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.initial.reset.transform +// Description:Resetting the canvas state resets the current transformation matrix +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Resetting the canvas state resets the current transformation matrix"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.html new file mode 100644 index 0000000000..0e7e10cd24 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.canvas.host.readonly + + + + +

2d.canvas.host.readonly

+

canvas is readonly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.worker.js new file mode 100644 index 0000000000..bbe50dcf61 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.readonly.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.readonly +// Description:canvas is readonly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("canvas is readonly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + var d = ctx.canvas; + _assertDifferent(offscreenCanvas2, d, "offscreenCanvas2", "d"); + ctx.canvas = offscreenCanvas2; + _assertSame(ctx.canvas, d, "ctx.canvas", "d"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.html new file mode 100644 index 0000000000..b5de73f403 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.canvas.host.reference + + + + +

2d.canvas.host.reference

+

canvas refers back to its canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.worker.js new file mode 100644 index 0000000000..7a1f0c5ab4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.reference.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.reference +// Description:canvas refers back to its canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("canvas refers back to its canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.canvas, canvas, "ctx.canvas", "canvas"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.html new file mode 100644 index 0000000000..dc7b894b20 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.default + + + + +

2d.canvas.host.size.attributes.default

+

Default width/height when attributes are missing

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.worker.js new file mode 100644 index 0000000000..78fce5aef8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.default.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.default +// Description:Default width/height when attributes are missing +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Default width/height when attributes are missing"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(canvas.width, 100, "canvas.width", "100"); + _assertSame(canvas.height, 50, "canvas.height", "50"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.html new file mode 100644 index 0000000000..7030103524 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.idl + + + + +

2d.canvas.host.size.attributes.idl

+

Getting/setting width/height IDL attributes

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.html new file mode 100644 index 0000000000..347c460cd7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.idl.set.zero + + + + +

2d.canvas.host.size.attributes.idl.set.zero

+

Setting width/height IDL attributes to 0

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.worker.js new file mode 100644 index 0000000000..21535da0eb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.set.zero.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.idl.set.zero +// Description:Setting width/height IDL attributes to 0 +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting width/height IDL attributes to 0"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 0; + canvas.height = 0; + _assertSame(canvas.width, 0, "canvas.width", "0"); + _assertSame(canvas.height, 0, "canvas.height", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.worker.js new file mode 100644 index 0000000000..a00201f18c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.idl.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.idl +// Description:Getting/setting width/height IDL attributes +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Getting/setting width/height IDL attributes"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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 = 301.999; + canvas.height = 301.001; + _assertSame(canvas.width, 301, "canvas.width", "301"); + _assertSame(canvas.height, 301, "canvas.height", "301"); + assert_throws_js(TypeError, function() { canvas.width = "400x"; }); + assert_throws_js(TypeError, function() { canvas.height = "foo"; }); + _assertSame(canvas.width, 301, "canvas.width", "301"); + _assertSame(canvas.height, 301, "canvas.height", "301"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.html new file mode 100644 index 0000000000..c3fa3b4ba6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.decimal + + + + +

2d.canvas.host.size.attributes.parse.decimal

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.worker.js new file mode 100644 index 0000000000..1267bb205a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.decimal.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.decimal +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = '100.999'; + canvas.height = '100.999'; + _assertSame(canvas.width, 100, "canvas.width", "100"); + _assertSame(canvas.height, 100, "canvas.height", "100"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.html new file mode 100644 index 0000000000..ea6f811b8f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.em + + + + +

2d.canvas.host.size.attributes.parse.em

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.js new file mode 100644 index 0000000000..2f0642d997 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.em.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.em +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { canvas.width = '100em'; }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.html new file mode 100644 index 0000000000..d38c159a6e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.empty + + + + +

2d.canvas.host.size.attributes.parse.empty

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.worker.js new file mode 100644 index 0000000000..b1eee3a5b2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.empty.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.empty +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = ''; + canvas.height = ''; + _assertSame(canvas.width, 0, "canvas.width", "0"); + _assertSame(canvas.height, 0, "canvas.height", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.html new file mode 100644 index 0000000000..2aa8245a49 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.exp + + + + +

2d.canvas.host.size.attributes.parse.exp

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.worker.js new file mode 100644 index 0000000000..8c8b4cc715 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.exp.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.exp +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = '100e1'; + canvas.height = '100e1'; + _assertSame(canvas.width, 1000.0, "canvas.width", "1000.0"); + _assertSame(canvas.height, 1000.0, "canvas.height", "1000.0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.html new file mode 100644 index 0000000000..4b0e47b53f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.hex + + + + +

2d.canvas.host.size.attributes.parse.hex

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.worker.js new file mode 100644 index 0000000000..b685aaffa2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.hex.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.hex +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = '0x100'; + canvas.height = '0x100'; + _assertSame(canvas.width, 256, "canvas.width", "256"); + _assertSame(canvas.height, 256, "canvas.height", "256"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.html new file mode 100644 index 0000000000..a619651f78 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.junk + + + + +

2d.canvas.host.size.attributes.parse.junk

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.js new file mode 100644 index 0000000000..f4822f4bd9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.junk.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.junk +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { canvas.width = '#!?'; }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.html new file mode 100644 index 0000000000..c7f12fdb02 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.minus + + + + +

2d.canvas.host.size.attributes.parse.minus

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.js new file mode 100644 index 0000000000..322b992eda --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.minus.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.minus +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { canvas.width = '-100'; }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.html new file mode 100644 index 0000000000..7bfb7658d4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.octal + + + + +

2d.canvas.host.size.attributes.parse.octal

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.worker.js new file mode 100644 index 0000000000..ce518e35c7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.octal.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.octal +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = '0100'; + canvas.height = '0100'; + _assertSame(canvas.width, 100, "canvas.width", "100"); + _assertSame(canvas.height, 100, "canvas.height", "100"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.html new file mode 100644 index 0000000000..16dace16ea --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.onlyspace + + + + +

2d.canvas.host.size.attributes.parse.onlyspace

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.worker.js new file mode 100644 index 0000000000..c186a4c08b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.onlyspace.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.onlyspace +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = ' '; + canvas.height = ' '; + _assertSame(canvas.width, 0, "canvas.width", "0"); + _assertSame(canvas.height, 0, "canvas.height", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.html new file mode 100644 index 0000000000..040a775ec7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.percent + + + + +

2d.canvas.host.size.attributes.parse.percent

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.js new file mode 100644 index 0000000000..f38a1862d4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.percent.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.percent +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { canvas.width = '100%'; }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.html new file mode 100644 index 0000000000..50c8467e2c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.plus + + + + +

2d.canvas.host.size.attributes.parse.plus

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.worker.js new file mode 100644 index 0000000000..bb45a1e4fa --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.plus.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.plus +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = '+100'; + canvas.height = '+100'; + _assertSame(canvas.width, 100, "canvas.width", "100"); + _assertSame(canvas.height, 100, "canvas.height", "100"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.html new file mode 100644 index 0000000000..cb1f3ae840 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.space + + + + +

2d.canvas.host.size.attributes.parse.space

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.worker.js new file mode 100644 index 0000000000..967a0939d8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.space.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.space +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = ' 100'; + canvas.height = ' 100'; + _assertSame(canvas.width, 100, "canvas.width", "100"); + _assertSame(canvas.height, 100, "canvas.height", "100"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html new file mode 100644 index 0000000000..8d8d481aef --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.trailingjunk + + + + +

2d.canvas.host.size.attributes.parse.trailingjunk

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.js new file mode 100644 index 0000000000..ffebcd97f1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.trailingjunk.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.trailingjunk +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { canvas.width = '100#!?'; }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.html new file mode 100644 index 0000000000..f6e29d6cb6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.whitespace + + + + +

2d.canvas.host.size.attributes.parse.whitespace

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.worker.js new file mode 100644 index 0000000000..fb7ba47975 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.whitespace.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.whitespace +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = ' 100'; + canvas.height = ' 100'; + _assertSame(canvas.width, 100, "canvas.width", "100"); + _assertSame(canvas.height, 100, "canvas.height", "100"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.html new file mode 100644 index 0000000000..07e924a603 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.parse.zero + + + + +

2d.canvas.host.size.attributes.parse.zero

+

Parsing of non-negative integers

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.worker.js new file mode 100644 index 0000000000..1363bff772 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.parse.zero.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.parse.zero +// Description:Parsing of non-negative integers +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Parsing of non-negative integers"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = '0'; + canvas.height = '0'; + _assertSame(canvas.width, 0, "canvas.width", "0"); + _assertSame(canvas.height, 0, "canvas.height", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.html new file mode 100644 index 0000000000..d24b2cc49f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.reflect.setidl + + + + +

2d.canvas.host.size.attributes.reflect.setidl

+

Setting IDL attributes updates IDL and content attributes

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.worker.js new file mode 100644 index 0000000000..3b3ced124a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidl.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.reflect.setidl +// Description:Setting IDL attributes updates IDL and content attributes +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting IDL attributes updates IDL and content attributes"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 120; + canvas.height = 60; + _assertSame(canvas.width, 120, "canvas.width", "120"); + _assertSame(canvas.height, 60, "canvas.height", "60"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.html new file mode 100644 index 0000000000..c4839afb0e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.attributes.reflect.setidlzero + + + + +

2d.canvas.host.size.attributes.reflect.setidlzero

+

Setting IDL attributes to 0 updates IDL and content attributes

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.worker.js new file mode 100644 index 0000000000..d440a9d807 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.attributes.reflect.setidlzero.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.attributes.reflect.setidlzero +// Description:Setting IDL attributes to 0 updates IDL and content attributes +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting IDL attributes to 0 updates IDL and content attributes"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 0; + canvas.height = 0; + _assertSame(canvas.width, 0, "canvas.width", "0"); + _assertSame(canvas.height, 0, "canvas.height", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.html b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.html new file mode 100644 index 0000000000..b220f8f2ed --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.canvas.host.size.large + + + + +

2d.canvas.host.size.large

+

+ +

Not sure how reasonable this is, but the spec doesn't say there's an upper limit on the size. + diff --git a/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.worker.js b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.worker.js new file mode 100644 index 0000000000..a763704131 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/canvas-host/2d.canvas.host.size.large.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.canvas.host.size.large +// Description: +// Note:

Not sure how reasonable this is, but the spec doesn't say there's an upper limit on the size. + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var n = 2147483647; // 2^31 - 1, which should be supported by any sensible definition of "long" + canvas.width = n; + canvas.height = n; + _assertSame(canvas.width, n, "canvas.width", "n"); + _assertSame(canvas.height, n, "canvas.height", "n"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.clear.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.clear.html new file mode 100644 index 0000000000..eac9dbdef9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.clear.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.composite.canvas.clear + + + + +

2d.composite.canvas.clear

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.clear.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.clear.worker.js new file mode 100644 index 0000000000..2f9fb92da1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.clear.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.canvas.clear +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(canvas.width, canvas.height); + var ctx2 = offscreenCanvas2.getContext('2d'); + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx2.drawImage(bitmap, 0, 0); + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'clear'; + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.copy.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.copy.html new file mode 100644 index 0000000000..7c9771c10f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.copy.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.composite.canvas.copy + + + + +

2d.composite.canvas.copy

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.copy.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.copy.worker.js new file mode 100644 index 0000000000..5b071665ce --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.copy.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.canvas.copy +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(canvas.width, canvas.height); + var ctx2 = offscreenCanvas2.getContext('2d'); + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx2.drawImage(bitmap, 0, 0); + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'copy'; + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 255,255,0,191, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-atop.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-atop.html new file mode 100644 index 0000000000..d9c34ded0b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-atop.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.composite.canvas.destination-atop + + + + +

2d.composite.canvas.destination-atop

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-atop.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-atop.worker.js new file mode 100644 index 0000000000..58828619a3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-atop.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.canvas.destination-atop +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(canvas.width, canvas.height); + var ctx2 = offscreenCanvas2.getContext('2d'); + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx2.drawImage(bitmap, 0, 0); + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-atop'; + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 128,255,128,191, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-in.html new file mode 100644 index 0000000000..9c1a8dbf47 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-in.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.composite.canvas.destination-in + + + + +

2d.composite.canvas.destination-in

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-in.worker.js new file mode 100644 index 0000000000..4e2ec058ec --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-in.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.canvas.destination-in +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(canvas.width, canvas.height); + var ctx2 = offscreenCanvas2.getContext('2d'); + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx2.drawImage(bitmap, 0, 0); + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-in'; + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,255,96, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-out.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-out.html new file mode 100644 index 0000000000..10c5baf485 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-out.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.composite.canvas.destination-out + + + + +

2d.composite.canvas.destination-out

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-out.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-out.worker.js new file mode 100644 index 0000000000..bc7be056a1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-out.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.canvas.destination-out +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(canvas.width, canvas.height); + var ctx2 = offscreenCanvas2.getContext('2d'); + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx2.drawImage(bitmap, 0, 0); + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-out'; + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,255,32, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-over.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-over.html new file mode 100644 index 0000000000..0e2ece9eab --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-over.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.composite.canvas.destination-over + + + + +

2d.composite.canvas.destination-over

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-over.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-over.worker.js new file mode 100644 index 0000000000..c1d15a0959 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.destination-over.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.canvas.destination-over +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(canvas.width, canvas.height); + var ctx2 = offscreenCanvas2.getContext('2d'); + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx2.drawImage(bitmap, 0, 0); + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-over'; + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 109,255,146,223, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.lighter.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.lighter.html new file mode 100644 index 0000000000..392bb855f6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.lighter.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.composite.canvas.lighter + + + + +

2d.composite.canvas.lighter

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.lighter.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.lighter.worker.js new file mode 100644 index 0000000000..df494f22d3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.lighter.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.canvas.lighter +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(canvas.width, canvas.height); + var ctx2 = offscreenCanvas2.getContext('2d'); + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx2.drawImage(bitmap, 0, 0); + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'lighter'; + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 191,255,128,255, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-atop.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-atop.html new file mode 100644 index 0000000000..f7d4da4d84 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-atop.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.composite.canvas.source-atop + + + + +

2d.composite.canvas.source-atop

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-atop.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-atop.worker.js new file mode 100644 index 0000000000..781a89c1b6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-atop.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.canvas.source-atop +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(canvas.width, canvas.height); + var ctx2 = offscreenCanvas2.getContext('2d'); + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx2.drawImage(bitmap, 0, 0); + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'source-atop'; + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 191,255,64,128, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-in.html new file mode 100644 index 0000000000..69e57e2578 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-in.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.composite.canvas.source-in + + + + +

2d.composite.canvas.source-in

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-in.worker.js new file mode 100644 index 0000000000..484399acfc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-in.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.canvas.source-in +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(canvas.width, canvas.height); + var ctx2 = offscreenCanvas2.getContext('2d'); + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx2.drawImage(bitmap, 0, 0); + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'source-in'; + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 255,255,0,96, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-out.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-out.html new file mode 100644 index 0000000000..eb9dbd0810 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-out.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.composite.canvas.source-out + + + + +

2d.composite.canvas.source-out

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-out.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-out.worker.js new file mode 100644 index 0000000000..d0d6cc12e9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-out.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.canvas.source-out +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(canvas.width, canvas.height); + var ctx2 = offscreenCanvas2.getContext('2d'); + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx2.drawImage(bitmap, 0, 0); + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'source-out'; + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 255,255,0,96, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-over.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-over.html new file mode 100644 index 0000000000..98629de8a4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-over.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.composite.canvas.source-over + + + + +

2d.composite.canvas.source-over

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-over.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-over.worker.js new file mode 100644 index 0000000000..848fbf3bec --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.source-over.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.canvas.source-over +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(canvas.width, canvas.height); + var ctx2 = offscreenCanvas2.getContext('2d'); + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx2.drawImage(bitmap, 0, 0); + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'source-over'; + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 219,255,36,223, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.xor.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.xor.html new file mode 100644 index 0000000000..bc69c8a08b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.xor.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.composite.canvas.xor + + + + +

2d.composite.canvas.xor

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.xor.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.xor.worker.js new file mode 100644 index 0000000000..250bba4bac --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.canvas.xor.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.canvas.xor +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(canvas.width, canvas.height); + var ctx2 = offscreenCanvas2.getContext('2d'); + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx2.drawImage(bitmap, 0, 0); + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'xor'; + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 191,255,64,128, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.clear.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.clear.html new file mode 100644 index 0000000000..f0e9989cce --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.clear.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.composite.clip.clear + + + + +

2d.composite.clip.clear

+

fill() does not affect pixels outside the clip region.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.clear.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.clear.worker.js new file mode 100644 index 0000000000..abae05ac24 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.clear.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.clip.clear +// Description:fill() does not affect pixels outside the clip region. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() does not affect pixels outside the clip region."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'clear'; + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.copy.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.copy.html new file mode 100644 index 0000000000..2471cd7edd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.copy.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.composite.clip.copy + + + + +

2d.composite.clip.copy

+

fill() does not affect pixels outside the clip region.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.copy.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.copy.worker.js new file mode 100644 index 0000000000..dfebd98a6b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.copy.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.clip.copy +// Description:fill() does not affect pixels outside the clip region. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() does not affect pixels outside the clip region."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-atop.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-atop.html new file mode 100644 index 0000000000..efb5e7ab6d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-atop.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.composite.clip.destination-atop + + + + +

2d.composite.clip.destination-atop

+

fill() does not affect pixels outside the clip region.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-atop.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-atop.worker.js new file mode 100644 index 0000000000..9c8fa79c5a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-atop.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.clip.destination-atop +// Description:fill() does not affect pixels outside the clip region. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() does not affect pixels outside the clip region."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-in.html new file mode 100644 index 0000000000..bc467a1d99 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-in.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.composite.clip.destination-in + + + + +

2d.composite.clip.destination-in

+

fill() does not affect pixels outside the clip region.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-in.worker.js new file mode 100644 index 0000000000..a98624f824 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-in.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.clip.destination-in +// Description:fill() does not affect pixels outside the clip region. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() does not affect pixels outside the clip region."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-out.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-out.html new file mode 100644 index 0000000000..674ec3aeb8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-out.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.composite.clip.destination-out + + + + +

2d.composite.clip.destination-out

+

fill() does not affect pixels outside the clip region.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-out.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-out.worker.js new file mode 100644 index 0000000000..0cf915d1c7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-out.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.clip.destination-out +// Description:fill() does not affect pixels outside the clip region. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() does not affect pixels outside the clip region."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-over.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-over.html new file mode 100644 index 0000000000..6abd0af788 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-over.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.composite.clip.destination-over + + + + +

2d.composite.clip.destination-over

+

fill() does not affect pixels outside the clip region.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-over.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-over.worker.js new file mode 100644 index 0000000000..b1b5eee6f4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.destination-over.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.clip.destination-over +// Description:fill() does not affect pixels outside the clip region. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() does not affect pixels outside the clip region."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.lighter.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.lighter.html new file mode 100644 index 0000000000..00782a683e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.lighter.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.composite.clip.lighter + + + + +

2d.composite.clip.lighter

+

fill() does not affect pixels outside the clip region.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.lighter.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.lighter.worker.js new file mode 100644 index 0000000000..8576d9db7c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.lighter.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.clip.lighter +// Description:fill() does not affect pixels outside the clip region. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() does not affect pixels outside the clip region."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-atop.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-atop.html new file mode 100644 index 0000000000..a7dc6a3bc8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-atop.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.composite.clip.source-atop + + + + +

2d.composite.clip.source-atop

+

fill() does not affect pixels outside the clip region.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-atop.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-atop.worker.js new file mode 100644 index 0000000000..fd220f52b3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-atop.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.clip.source-atop +// Description:fill() does not affect pixels outside the clip region. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() does not affect pixels outside the clip region."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-in.html new file mode 100644 index 0000000000..3f24076161 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-in.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.composite.clip.source-in + + + + +

2d.composite.clip.source-in

+

fill() does not affect pixels outside the clip region.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-in.worker.js new file mode 100644 index 0000000000..0c61fb7794 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-in.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.clip.source-in +// Description:fill() does not affect pixels outside the clip region. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() does not affect pixels outside the clip region."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-out.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-out.html new file mode 100644 index 0000000000..4033893b2b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-out.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.composite.clip.source-out + + + + +

2d.composite.clip.source-out

+

fill() does not affect pixels outside the clip region.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-out.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-out.worker.js new file mode 100644 index 0000000000..ec57663af1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-out.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.clip.source-out +// Description:fill() does not affect pixels outside the clip region. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() does not affect pixels outside the clip region."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-over.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-over.html new file mode 100644 index 0000000000..5b48161c65 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-over.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.composite.clip.source-over + + + + +

2d.composite.clip.source-over

+

fill() does not affect pixels outside the clip region.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-over.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-over.worker.js new file mode 100644 index 0000000000..15c322ee59 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.source-over.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.clip.source-over +// Description:fill() does not affect pixels outside the clip region. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() does not affect pixels outside the clip region."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.xor.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.xor.html new file mode 100644 index 0000000000..0156e4a2ef --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.xor.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.composite.clip.xor + + + + +

2d.composite.clip.xor

+

fill() does not affect pixels outside the clip region.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.xor.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.xor.worker.js new file mode 100644 index 0000000000..30bae44aa9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.clip.xor.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.clip.xor +// Description:fill() does not affect pixels outside the clip region. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() does not affect pixels outside the clip region."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvas.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvas.html new file mode 100644 index 0000000000..c096253e27 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvas.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.composite.globalAlpha.canvas + + + + +

2d.composite.globalAlpha.canvas

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvas.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvas.worker.js new file mode 100644 index 0000000000..ede4733a83 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvas.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.globalAlpha.canvas +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + var ctx2 = offscreenCanvas2.getContext('2d'); + ctx2.fillStyle = '#f00'; + ctx2.fillRect(0, 0, 100, 50); + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + // Avoiding any potential alpha = 0 optimisations. + ctx.globalAlpha = 0.01; + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 2,253,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvascopy.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvascopy.html new file mode 100644 index 0000000000..2eb06556ef --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvascopy.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.composite.globalAlpha.canvascopy + + + + +

2d.composite.globalAlpha.canvascopy

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvascopy.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvascopy.worker.js new file mode 100644 index 0000000000..f61859d231 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvascopy.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.globalAlpha.canvascopy +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + var ctx2 = offscreenCanvas2.getContext('2d'); + ctx2.fillStyle = '#0f0'; + ctx2.fillRect(0, 0, 100, 50); + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'copy' + ctx.globalAlpha = 0.51; + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,130, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvaspattern.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvaspattern.html new file mode 100644 index 0000000000..cbfe111092 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvaspattern.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.composite.globalAlpha.canvaspattern + + + + +

2d.composite.globalAlpha.canvaspattern

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvaspattern.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvaspattern.worker.js new file mode 100644 index 0000000000..7ecd568fae --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.canvaspattern.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.globalAlpha.canvaspattern +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + var ctx2 = offscreenCanvas2.getContext('2d'); + ctx2.fillStyle = '#f00'; + ctx2.fillRect(0, 0, 100, 50); + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.fillStyle = ctx.createPattern(offscreenCanvas2, 'no-repeat'); + // Avoiding any potential alpha = 0 optimisations. + ctx.globalAlpha = 0.01; + ctx.fillRect(0, 0, 100, 50); + _assertPixelApprox(canvas, 50,25, 2,253,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.default.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.default.html new file mode 100644 index 0000000000..57c3745d4e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.default.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.composite.globalAlpha.default + + + + +

2d.composite.globalAlpha.default

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.default.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.default.worker.js new file mode 100644 index 0000000000..8acbd6a37f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.default.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.globalAlpha.default +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.globalAlpha, 1.0, "ctx.globalAlpha", "1.0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.fill.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.fill.html new file mode 100644 index 0000000000..7b31db198e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.fill.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.composite.globalAlpha.fill + + + + +

2d.composite.globalAlpha.fill

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.fill.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.fill.worker.js new file mode 100644 index 0000000000..3ea8aa7ebe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.fill.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.globalAlpha.fill +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + // Avoiding any potential alpha = 0 optimisations. + ctx.globalAlpha = 0.01; + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + _assertPixelApprox(canvas, 50,25, 2,253,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.image.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.image.html new file mode 100644 index 0000000000..4590a2ea1f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.image.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.composite.globalAlpha.image + + + + +

2d.composite.globalAlpha.image

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.image.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.image.worker.js new file mode 100644 index 0000000000..20953417cc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.image.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.globalAlpha.image +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + // Avoiding any potential alpha = 0 optimisations. + ctx.globalAlpha = 0.01; + const response = await fetch('/images/red.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 2,253,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.imagepattern.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.imagepattern.html new file mode 100644 index 0000000000..2fcbca84d2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.imagepattern.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.composite.globalAlpha.imagepattern + + + + +

2d.composite.globalAlpha.imagepattern

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.imagepattern.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.imagepattern.worker.js new file mode 100644 index 0000000000..c6ab163b65 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.imagepattern.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.globalAlpha.imagepattern +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + const response = await fetch('/images/red.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + + ctx.fillStyle = ctx.createPattern(bitmap, 'no-repeat'); + // Avoiding any potential alpha = 0 optimisations. + ctx.globalAlpha = 0.01; + ctx.fillRect(0, 0, 100, 50); + _assertPixelApprox(canvas, 50,25, 2,253,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.invalid.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.invalid.html new file mode 100644 index 0000000000..9bcf85f1c4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.invalid.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.composite.globalAlpha.invalid + + + + +

2d.composite.globalAlpha.invalid

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.invalid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.invalid.worker.js new file mode 100644 index 0000000000..4ca577ad44 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.invalid.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.globalAlpha.invalid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.globalAlpha = 0.5; + // This may not set it to exactly 0.5 if it is rounded/quantised, so + // remember for future comparisons. + var a = ctx.globalAlpha; + ctx.globalAlpha = Infinity; + _assertSame(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); + ctx.globalAlpha = -Infinity; + _assertSame(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); + ctx.globalAlpha = NaN; + _assertSame(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.range.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.range.html new file mode 100644 index 0000000000..c064a41cbd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.range.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.composite.globalAlpha.range + + + + +

2d.composite.globalAlpha.range

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.range.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.range.worker.js new file mode 100644 index 0000000000..76ea819909 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.globalAlpha.range.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.globalAlpha.range +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.globalAlpha = 0.5; + // This may not set it to exactly 0.5 if it is rounded/quantised, so + // remember for future comparisons. + var a = ctx.globalAlpha; + _assertSame(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); + ctx.globalAlpha = 1.1; + _assertSame(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); + ctx.globalAlpha = -0.1; + _assertSame(ctx.globalAlpha, a, "ctx.globalAlpha", "a"); + ctx.globalAlpha = 0; + _assertSame(ctx.globalAlpha, 0, "ctx.globalAlpha", "0"); + ctx.globalAlpha = 1; + _assertSame(ctx.globalAlpha, 1, "ctx.globalAlpha", "1"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.clear.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.clear.html new file mode 100644 index 0000000000..f001c4409c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.clear.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.composite.image.clear + + + + +

2d.composite.image.clear

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.clear.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.clear.worker.js new file mode 100644 index 0000000000..f152cee739 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.clear.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.image.clear +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'clear'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.copy.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.copy.html new file mode 100644 index 0000000000..d472a0682d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.copy.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.composite.image.copy + + + + +

2d.composite.image.copy

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.copy.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.copy.worker.js new file mode 100644 index 0000000000..05ccab1711 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.copy.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.image.copy +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'copy'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 255,255,0,191, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-atop.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-atop.html new file mode 100644 index 0000000000..753c460ec6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-atop.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.composite.image.destination-atop + + + + +

2d.composite.image.destination-atop

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-atop.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-atop.worker.js new file mode 100644 index 0000000000..43648142d5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-atop.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.image.destination-atop +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-atop'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 128,255,128,191, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-in.html new file mode 100644 index 0000000000..df9f1ae786 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-in.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.composite.image.destination-in + + + + +

2d.composite.image.destination-in

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-in.worker.js new file mode 100644 index 0000000000..2787237c56 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-in.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.image.destination-in +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-in'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,255,96, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-out.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-out.html new file mode 100644 index 0000000000..6981ca1d72 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-out.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.composite.image.destination-out + + + + +

2d.composite.image.destination-out

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-out.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-out.worker.js new file mode 100644 index 0000000000..e030f533a0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-out.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.image.destination-out +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-out'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,255,32, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-over.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-over.html new file mode 100644 index 0000000000..3360115133 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-over.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.composite.image.destination-over + + + + +

2d.composite.image.destination-over

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-over.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-over.worker.js new file mode 100644 index 0000000000..964df4ae8b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.destination-over.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.image.destination-over +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-over'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 109,255,146,223, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.lighter.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.lighter.html new file mode 100644 index 0000000000..25f2a7684a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.lighter.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.composite.image.lighter + + + + +

2d.composite.image.lighter

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.lighter.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.lighter.worker.js new file mode 100644 index 0000000000..f3828b6411 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.lighter.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.image.lighter +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'lighter'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 191,255,128,255, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-atop.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-atop.html new file mode 100644 index 0000000000..cfa386cfd1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-atop.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.composite.image.source-atop + + + + +

2d.composite.image.source-atop

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-atop.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-atop.worker.js new file mode 100644 index 0000000000..7b1618e3f9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-atop.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.image.source-atop +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'source-atop'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 191,255,64,128, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-in.html new file mode 100644 index 0000000000..cc44706b1c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-in.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.composite.image.source-in + + + + +

2d.composite.image.source-in

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-in.worker.js new file mode 100644 index 0000000000..9accfb35c4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-in.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.image.source-in +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'source-in'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 255,255,0,96, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-out.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-out.html new file mode 100644 index 0000000000..bc2f7f2633 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-out.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.composite.image.source-out + + + + +

2d.composite.image.source-out

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-out.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-out.worker.js new file mode 100644 index 0000000000..8e8d9116bb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-out.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.image.source-out +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'source-out'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 255,255,0,96, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-over.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-over.html new file mode 100644 index 0000000000..88a8176f7e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-over.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.composite.image.source-over + + + + +

2d.composite.image.source-over

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-over.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-over.worker.js new file mode 100644 index 0000000000..679aa19ef9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.source-over.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.image.source-over +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'source-over'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 219,255,36,223, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.xor.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.xor.html new file mode 100644 index 0000000000..ef149b2f99 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.xor.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.composite.image.xor + + + + +

2d.composite.image.xor

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.xor.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.xor.worker.js new file mode 100644 index 0000000000..83a04928b5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.image.xor.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.image.xor +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'xor'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow75.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 191,255,64,128, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.casesensitive.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.casesensitive.html new file mode 100644 index 0000000000..f21b92f83e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.casesensitive.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.composite.operation.casesensitive + + + + +

2d.composite.operation.casesensitive

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.casesensitive.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.casesensitive.worker.js new file mode 100644 index 0000000000..db1b54f5ef --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.casesensitive.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.operation.casesensitive +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.globalCompositeOperation = 'xor'; + ctx.globalCompositeOperation = 'Source-over'; + _assertSame(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.clear.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.clear.html new file mode 100644 index 0000000000..02496b6d89 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.clear.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.composite.operation.clear + + + + +

2d.composite.operation.clear

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.clear.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.clear.worker.js new file mode 100644 index 0000000000..947dd16c5f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.clear.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.operation.clear +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.globalCompositeOperation = 'xor'; + ctx.globalCompositeOperation = 'clear'; + _assertSame(ctx.globalCompositeOperation, 'clear', "ctx.globalCompositeOperation", "'clear'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.darker.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.darker.html new file mode 100644 index 0000000000..29dc039157 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.darker.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.composite.operation.darker + + + + +

2d.composite.operation.darker

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.darker.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.darker.worker.js new file mode 100644 index 0000000000..528f6b93d9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.darker.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.operation.darker +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.globalCompositeOperation = 'xor'; + ctx.globalCompositeOperation = 'darker'; + _assertSame(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.default.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.default.html new file mode 100644 index 0000000000..106c0e73f4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.default.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.composite.operation.default + + + + +

2d.composite.operation.default

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.default.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.default.worker.js new file mode 100644 index 0000000000..ffdb75ad75 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.default.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.operation.default +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.globalCompositeOperation, 'source-over', "ctx.globalCompositeOperation", "'source-over'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.get.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.get.html new file mode 100644 index 0000000000..1ade1a4e54 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.get.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.composite.operation.get + + + + +

2d.composite.operation.get

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.get.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.get.worker.js new file mode 100644 index 0000000000..a266f1d537 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.get.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.operation.get +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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]; + _assertSame(ctx.globalCompositeOperation, modes[i], "ctx.globalCompositeOperation", "modes[\""+(i)+"\"]"); + } + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.highlight.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.highlight.html new file mode 100644 index 0000000000..08def9a516 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.highlight.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.composite.operation.highlight + + + + +

2d.composite.operation.highlight

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.highlight.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.highlight.worker.js new file mode 100644 index 0000000000..800c4605e6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.highlight.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.operation.highlight +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.globalCompositeOperation = 'xor'; + ctx.globalCompositeOperation = 'highlight'; + _assertSame(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.nullsuffix.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.nullsuffix.html new file mode 100644 index 0000000000..f021d40b53 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.nullsuffix.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.composite.operation.nullsuffix + + + + +

2d.composite.operation.nullsuffix

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.nullsuffix.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.nullsuffix.worker.js new file mode 100644 index 0000000000..1c1d5124a3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.nullsuffix.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.operation.nullsuffix +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.globalCompositeOperation = 'xor'; + ctx.globalCompositeOperation = 'source-over\0'; + _assertSame(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.over.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.over.html new file mode 100644 index 0000000000..df934336c6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.over.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.composite.operation.over + + + + +

2d.composite.operation.over

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.over.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.over.worker.js new file mode 100644 index 0000000000..f75a462e93 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.over.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.operation.over +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.globalCompositeOperation = 'xor'; + ctx.globalCompositeOperation = 'over'; + _assertSame(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.unrecognised.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.unrecognised.html new file mode 100644 index 0000000000..c649102cc7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.unrecognised.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.composite.operation.unrecognised + + + + +

2d.composite.operation.unrecognised

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.unrecognised.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.unrecognised.worker.js new file mode 100644 index 0000000000..23a6630e82 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.operation.unrecognised.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.operation.unrecognised +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.globalCompositeOperation = 'xor'; + ctx.globalCompositeOperation = 'nonexistent'; + _assertSame(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.clear.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.clear.html new file mode 100644 index 0000000000..9bb03097fc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.clear.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.solid.clear + + + + +

2d.composite.solid.clear

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.clear.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.clear.worker.js new file mode 100644 index 0000000000..c49ec7a322 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.clear.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.solid.clear +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 1.0)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'clear'; + ctx.fillStyle = 'rgba(255, 255, 0, 1.0)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.copy.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.copy.html new file mode 100644 index 0000000000..a5bcda9337 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.copy.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.solid.copy + + + + +

2d.composite.solid.copy

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.copy.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.copy.worker.js new file mode 100644 index 0000000000..ee4baecbd2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.copy.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.solid.copy +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-atop.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-atop.html new file mode 100644 index 0000000000..c5554ff240 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-atop.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.solid.destination-atop + + + + +

2d.composite.solid.destination-atop

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-atop.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-atop.worker.js new file mode 100644 index 0000000000..8829971c6b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-atop.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.solid.destination-atop +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-in.html new file mode 100644 index 0000000000..8e620e2714 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-in.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.solid.destination-in + + + + +

2d.composite.solid.destination-in

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-in.worker.js new file mode 100644 index 0000000000..fe9e461717 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-in.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.solid.destination-in +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-out.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-out.html new file mode 100644 index 0000000000..06da4d3650 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-out.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.solid.destination-out + + + + +

2d.composite.solid.destination-out

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-out.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-out.worker.js new file mode 100644 index 0000000000..05ec2fae16 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-out.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.solid.destination-out +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-over.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-over.html new file mode 100644 index 0000000000..e62c3fea70 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-over.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.solid.destination-over + + + + +

2d.composite.solid.destination-over

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-over.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-over.worker.js new file mode 100644 index 0000000000..5c171fc282 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.destination-over.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.solid.destination-over +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.lighter.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.lighter.html new file mode 100644 index 0000000000..2e09805cc1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.lighter.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.solid.lighter + + + + +

2d.composite.solid.lighter

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.lighter.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.lighter.worker.js new file mode 100644 index 0000000000..353389221d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.lighter.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.solid.lighter +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-atop.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-atop.html new file mode 100644 index 0000000000..dd36e0e622 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-atop.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.solid.source-atop + + + + +

2d.composite.solid.source-atop

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-atop.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-atop.worker.js new file mode 100644 index 0000000000..27e1c253ce --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-atop.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.solid.source-atop +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-in.html new file mode 100644 index 0000000000..83dcc8e523 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-in.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.solid.source-in + + + + +

2d.composite.solid.source-in

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-in.worker.js new file mode 100644 index 0000000000..7dfdb07075 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-in.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.solid.source-in +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-out.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-out.html new file mode 100644 index 0000000000..3067c44fcd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-out.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.solid.source-out + + + + +

2d.composite.solid.source-out

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-out.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-out.worker.js new file mode 100644 index 0000000000..8252549267 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-out.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.solid.source-out +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-over.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-over.html new file mode 100644 index 0000000000..059655334f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-over.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.solid.source-over + + + + +

2d.composite.solid.source-over

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-over.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-over.worker.js new file mode 100644 index 0000000000..1c82a95c36 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.source-over.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.solid.source-over +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.xor.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.xor.html new file mode 100644 index 0000000000..822c9c70d1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.xor.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.solid.xor + + + + +

2d.composite.solid.xor

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.xor.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.xor.worker.js new file mode 100644 index 0000000000..cb098ebab1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.solid.xor.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.solid.xor +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.clear.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.clear.html new file mode 100644 index 0000000000..81d781acc7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.clear.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.transparent.clear + + + + +

2d.composite.transparent.clear

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.clear.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.clear.worker.js new file mode 100644 index 0000000000..8f30463c41 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.clear.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.transparent.clear +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'clear'; + ctx.fillStyle = 'rgba(0, 0, 255, 0.75)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.copy.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.copy.html new file mode 100644 index 0000000000..ab3a97226f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.copy.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.transparent.copy + + + + +

2d.composite.transparent.copy

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.copy.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.copy.worker.js new file mode 100644 index 0000000000..6b9ea9dbcf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.copy.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.transparent.copy +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-atop.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-atop.html new file mode 100644 index 0000000000..5e580f5a67 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-atop.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.transparent.destination-atop + + + + +

2d.composite.transparent.destination-atop

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-atop.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-atop.worker.js new file mode 100644 index 0000000000..3247632e53 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-atop.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.transparent.destination-atop +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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,128,128,191, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-in.html new file mode 100644 index 0000000000..9f0ec56357 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-in.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.transparent.destination-in + + + + +

2d.composite.transparent.destination-in

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-in.worker.js new file mode 100644 index 0000000000..c9205230c0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-in.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.transparent.destination-in +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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,96, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-out.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-out.html new file mode 100644 index 0000000000..a1abe3eed9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-out.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.transparent.destination-out + + + + +

2d.composite.transparent.destination-out

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-out.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-out.worker.js new file mode 100644 index 0000000000..1a5409589b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-out.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.transparent.destination-out +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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,32, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-over.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-over.html new file mode 100644 index 0000000000..4f0305f27f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-over.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.transparent.destination-over + + + + +

2d.composite.transparent.destination-over

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-over.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-over.worker.js new file mode 100644 index 0000000000..37eb785d67 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.destination-over.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.transparent.destination-over +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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,146,109,223, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.lighter.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.lighter.html new file mode 100644 index 0000000000..6a2f5df71f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.lighter.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.transparent.lighter + + + + +

2d.composite.transparent.lighter

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.lighter.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.lighter.worker.js new file mode 100644 index 0000000000..3d890affd9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.lighter.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.transparent.lighter +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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,128,191,255, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-atop.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-atop.html new file mode 100644 index 0000000000..bac035cea3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-atop.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.transparent.source-atop + + + + +

2d.composite.transparent.source-atop

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-atop.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-atop.worker.js new file mode 100644 index 0000000000..d56ef6e2e4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-atop.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.transparent.source-atop +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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,64,191,128, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-in.html new file mode 100644 index 0000000000..5dd67046ed --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-in.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.transparent.source-in + + + + +

2d.composite.transparent.source-in

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-in.worker.js new file mode 100644 index 0000000000..58ad13bc5e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-in.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.transparent.source-in +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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,96, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-out.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-out.html new file mode 100644 index 0000000000..56b1d4ad46 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-out.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.transparent.source-out + + + + +

2d.composite.transparent.source-out

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-out.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-out.worker.js new file mode 100644 index 0000000000..62ec895955 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-out.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.transparent.source-out +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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,96, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-over.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-over.html new file mode 100644 index 0000000000..f038d44a54 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-over.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.transparent.source-over + + + + +

2d.composite.transparent.source-over

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-over.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-over.worker.js new file mode 100644 index 0000000000..494a45f848 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.source-over.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.transparent.source-over +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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,219,223, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.xor.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.xor.html new file mode 100644 index 0000000000..bbab8a086c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.xor.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.transparent.xor + + + + +

2d.composite.transparent.xor

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.xor.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.xor.worker.js new file mode 100644 index 0000000000..4b65667ed8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.transparent.xor.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.transparent.xor +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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,64,191,128, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.copy.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.copy.html new file mode 100644 index 0000000000..0ff9d851dd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.copy.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.fill.copy + + + + +

2d.composite.uncovered.fill.copy

+

fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.copy.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.copy.worker.js new file mode 100644 index 0000000000..50f3ed0f22 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.copy.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.fill.copy +// Description:fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-atop.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-atop.html new file mode 100644 index 0000000000..2d2f92edb5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-atop.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.fill.destination-atop + + + + +

2d.composite.uncovered.fill.destination-atop

+

fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-atop.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-atop.worker.js new file mode 100644 index 0000000000..9a84b0894a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-atop.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.fill.destination-atop +// Description:fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-in.html new file mode 100644 index 0000000000..5670b321a6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-in.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.fill.destination-in + + + + + +

2d.composite.uncovered.fill.destination-in

+

fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-in.worker.js new file mode 100644 index 0000000000..aa24ba97a6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.destination-in.worker.js @@ -0,0 +1,29 @@ +// META: timeout=long +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.fill.destination-in +// Description:fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-in.html new file mode 100644 index 0000000000..58347442bd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-in.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.fill.source-in + + + + +

2d.composite.uncovered.fill.source-in

+

fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-in.worker.js new file mode 100644 index 0000000000..33e326d1f4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-in.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.fill.source-in +// Description:fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-out.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-out.html new file mode 100644 index 0000000000..ea44ca4f04 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-out.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.fill.source-out + + + + +

2d.composite.uncovered.fill.source-out

+

fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-out.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-out.worker.js new file mode 100644 index 0000000000..1d39b364b0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.fill.source-out.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.fill.source-out +// Description:fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.copy.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.copy.html new file mode 100644 index 0000000000..0ecb5ed01d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.copy.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.image.copy + + + + +

2d.composite.uncovered.image.copy

+

drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.copy.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.copy.worker.js new file mode 100644 index 0000000000..0e56b4f71d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.copy.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.image.copy +// Description:drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'copy'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 40, 40, 10, 10, 40, 50, 10, 10); + _assertPixelApprox(canvas, 15,15, 0,0,0,0, 5); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-atop.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-atop.html new file mode 100644 index 0000000000..00a4465d0b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-atop.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.image.destination-atop + + + + +

2d.composite.uncovered.image.destination-atop

+

drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-atop.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-atop.worker.js new file mode 100644 index 0000000000..4c4a0a4c95 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-atop.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.image.destination-atop +// Description:drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-atop'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 40, 40, 10, 10, 40, 50, 10, 10); + _assertPixelApprox(canvas, 15,15, 0,0,0,0, 5); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-in.html new file mode 100644 index 0000000000..f5f8c68c51 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-in.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.image.destination-in + + + + +

2d.composite.uncovered.image.destination-in

+

drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-in.worker.js new file mode 100644 index 0000000000..af1dc50c9b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.destination-in.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.image.destination-in +// Description:drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-in'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 40, 40, 10, 10, 40, 50, 10, 10); + _assertPixelApprox(canvas, 15,15, 0,0,0,0, 5); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-in.html new file mode 100644 index 0000000000..2e1fe84b60 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-in.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.image.source-in + + + + +

2d.composite.uncovered.image.source-in

+

drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-in.worker.js new file mode 100644 index 0000000000..490ce4d001 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-in.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.image.source-in +// Description:drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'source-in'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 40, 40, 10, 10, 40, 50, 10, 10); + _assertPixelApprox(canvas, 15,15, 0,0,0,0, 5); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-out.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-out.html new file mode 100644 index 0000000000..1f5be066ee --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-out.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.image.source-out + + + + +

2d.composite.uncovered.image.source-out

+

drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-out.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-out.worker.js new file mode 100644 index 0000000000..3647e34574 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.image.source-out.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.image.source-out +// Description:drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("drawImage() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'source-out'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.drawImage(bitmap, 40, 40, 10, 10, 40, 50, 10, 10); + _assertPixelApprox(canvas, 15,15, 0,0,0,0, 5); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.copy.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.copy.html new file mode 100644 index 0000000000..10a9960559 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.copy.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.nocontext.copy + + + + +

2d.composite.uncovered.nocontext.copy

+

drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.copy.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.copy.worker.js new file mode 100644 index 0000000000..1f285eae4c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.copy.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.nocontext.copy +// Description:drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'copy'; + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-atop.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-atop.html new file mode 100644 index 0000000000..ead1299cf0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-atop.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.nocontext.destination-atop + + + + +

2d.composite.uncovered.nocontext.destination-atop

+

drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-atop.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-atop.worker.js new file mode 100644 index 0000000000..a9beb0f27e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-atop.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.nocontext.destination-atop +// Description:drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-atop'; + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-in.html new file mode 100644 index 0000000000..0322bfe258 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-in.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.nocontext.destination-in + + + + +

2d.composite.uncovered.nocontext.destination-in

+

drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-in.worker.js new file mode 100644 index 0000000000..e146e2e91a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.destination-in.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.nocontext.destination-in +// Description:drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-in'; + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-in.html new file mode 100644 index 0000000000..0d93a0362e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-in.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.nocontext.source-in + + + + +

2d.composite.uncovered.nocontext.source-in

+

drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-in.worker.js new file mode 100644 index 0000000000..cce4b54bd5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-in.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.nocontext.source-in +// Description:drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'source-in'; + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-out.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-out.html new file mode 100644 index 0000000000..b6ab8cbda4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-out.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.nocontext.source-out + + + + +

2d.composite.uncovered.nocontext.source-out

+

drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-out.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-out.worker.js new file mode 100644 index 0000000000..501a84f7e7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.nocontext.source-out.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.nocontext.source-out +// Description:drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("drawImage() of a canvas with no context draws pixels as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'source-out'; + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.copy.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.copy.html new file mode 100644 index 0000000000..c698c2517c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.copy.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.pattern.copy + + + + +

2d.composite.uncovered.pattern.copy

+

Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.copy.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.copy.worker.js new file mode 100644 index 0000000000..a5944be695 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.copy.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.pattern.copy +// Description:Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'copy'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.fillStyle = ctx.createPattern(bitmap, 'no-repeat'); + ctx.fillRect(0, 50, 100, 50); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-atop.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-atop.html new file mode 100644 index 0000000000..887570fad7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-atop.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.pattern.destination-atop + + + + +

2d.composite.uncovered.pattern.destination-atop

+

Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-atop.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-atop.worker.js new file mode 100644 index 0000000000..c34c748059 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-atop.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.pattern.destination-atop +// Description:Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-atop'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.fillStyle = ctx.createPattern(bitmap, 'no-repeat'); + ctx.fillRect(0, 50, 100, 50); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-in.html new file mode 100644 index 0000000000..7aa9e662f6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-in.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.pattern.destination-in + + + + +

2d.composite.uncovered.pattern.destination-in

+

Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-in.worker.js new file mode 100644 index 0000000000..10042455a7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.destination-in.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.pattern.destination-in +// Description:Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-in'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.fillStyle = ctx.createPattern(bitmap, 'no-repeat'); + ctx.fillRect(0, 50, 100, 50); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-in.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-in.html new file mode 100644 index 0000000000..3830e92f69 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-in.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.pattern.source-in + + + + +

2d.composite.uncovered.pattern.source-in

+

Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-in.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-in.worker.js new file mode 100644 index 0000000000..c658da8c99 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-in.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.pattern.source-in +// Description:Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'source-in'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.fillStyle = ctx.createPattern(bitmap, 'no-repeat'); + ctx.fillRect(0, 50, 100, 50); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-out.html b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-out.html new file mode 100644 index 0000000000..3c202dd556 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-out.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.composite.uncovered.pattern.source-out + + + + +

2d.composite.uncovered.pattern.source-out

+

Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-out.worker.js b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-out.worker.js new file mode 100644 index 0000000000..86baf476fe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/compositing/2d.composite.uncovered.pattern.source-out.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.composite.uncovered.pattern.source-out +// Description:Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Pattern fill() draws pixels not covered by the source object as (0,0,0,0), and does not leave the pixels unchanged."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0, 255, 255, 0.5)'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'source-out'; + var promise = new Promise(function(resolve, reject) { + var xhr = new XMLHttpRequest(); + xhr.open("GET", '/images/yellow.png'); + xhr.responseType = 'blob'; + xhr.send(); + xhr.onload = function() { + resolve(xhr.response); + }; + }); + promise.then(function(response) { + return createImageBitmap(response).then(bitmap => { + ctx.fillStyle = ctx.createPattern(bitmap, 'no-repeat'); + ctx.fillRect(0, 50, 100, 50); + _assertPixelApprox(canvas, 50,25, 0,0,0,0, 5); + }); + }).then(t_pass, t_fail); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.basics.html b/testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.basics.html new file mode 100644 index 0000000000..e754e6c6ba --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.basics.html @@ -0,0 +1,62 @@ + + +OffscreenCanvas test: 2d.conformance.requirements.basics + + + + +

2d.conformance.requirements.basics

+

void methods return undefined

+ +

Defined in "Web IDL" (draft) + diff --git a/testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.basics.worker.js b/testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.basics.worker.js new file mode 100644 index 0000000000..b16a39fd3c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.basics.worker.js @@ -0,0 +1,57 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.conformance.requirements.basics +// Description:void methods return undefined +// Note:

Defined in "Web IDL" (draft) + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("void methods return undefined"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _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.setTransform(), undefined, "ctx.setTransform()", "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(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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.missingargs.html b/testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.missingargs.html new file mode 100644 index 0000000000..fe28a68e90 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.missingargs.html @@ -0,0 +1,141 @@ + + +OffscreenCanvas test: 2d.conformance.requirements.missingargs + + + + +

2d.conformance.requirements.missingargs

+

Missing arguments cause TypeError

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.missingargs.worker.js b/testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.missingargs.worker.js new file mode 100644 index 0000000000..f249fcb881 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/conformance-requirements/2d.conformance.requirements.missingargs.worker.js @@ -0,0 +1,136 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.conformance.requirements.missingargs +// Description:Missing arguments cause TypeError +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Missing arguments cause TypeError"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { ctx.scale(); }); + assert_throws_js(TypeError, function() { ctx.scale(1); }); + assert_throws_js(TypeError, function() { ctx.rotate(); }); + assert_throws_js(TypeError, function() { ctx.translate(); }); + assert_throws_js(TypeError, function() { ctx.translate(0); }); + if (ctx.transform) { // (avoid spurious failures, since the aim here is not to test that all features are supported) + assert_throws_js(TypeError, function() { ctx.transform(); }); + assert_throws_js(TypeError, function() { ctx.transform(1); }); + assert_throws_js(TypeError, function() { ctx.transform(1, 0); }); + assert_throws_js(TypeError, function() { ctx.transform(1, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.transform(1, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.transform(1, 0, 0, 1, 0); }); + } + if (ctx.setTransform) { + assert_throws_js(TypeError, function() { ctx.setTransform(1); }); + assert_throws_js(TypeError, function() { ctx.setTransform(1, 0); }); + assert_throws_js(TypeError, function() { ctx.setTransform(1, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.setTransform(1, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.setTransform(1, 0, 0, 1, 0); }); + } + assert_throws_js(TypeError, function() { ctx.createLinearGradient(); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.createPattern(canvas); }); + assert_throws_js(TypeError, function() { ctx.clearRect(); }); + assert_throws_js(TypeError, function() { ctx.clearRect(0); }); + assert_throws_js(TypeError, function() { ctx.clearRect(0, 0); }); + assert_throws_js(TypeError, function() { ctx.clearRect(0, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.fillRect(); }); + assert_throws_js(TypeError, function() { ctx.fillRect(0); }); + assert_throws_js(TypeError, function() { ctx.fillRect(0, 0); }); + assert_throws_js(TypeError, function() { ctx.fillRect(0, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.strokeRect(); }); + assert_throws_js(TypeError, function() { ctx.strokeRect(0); }); + assert_throws_js(TypeError, function() { ctx.strokeRect(0, 0); }); + assert_throws_js(TypeError, function() { ctx.strokeRect(0, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.moveTo(); }); + assert_throws_js(TypeError, function() { ctx.moveTo(0); }); + assert_throws_js(TypeError, function() { ctx.lineTo(); }); + assert_throws_js(TypeError, function() { ctx.lineTo(0); }); + assert_throws_js(TypeError, function() { ctx.quadraticCurveTo(); }); + assert_throws_js(TypeError, function() { ctx.quadraticCurveTo(0); }); + assert_throws_js(TypeError, function() { ctx.quadraticCurveTo(0, 0); }); + assert_throws_js(TypeError, function() { ctx.quadraticCurveTo(0, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.bezierCurveTo(); }); + assert_throws_js(TypeError, function() { ctx.bezierCurveTo(0); }); + assert_throws_js(TypeError, function() { ctx.bezierCurveTo(0, 0); }); + assert_throws_js(TypeError, function() { ctx.bezierCurveTo(0, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.bezierCurveTo(0, 0, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.bezierCurveTo(0, 0, 0, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.arcTo(); }); + assert_throws_js(TypeError, function() { ctx.arcTo(0); }); + assert_throws_js(TypeError, function() { ctx.arcTo(0, 0); }); + assert_throws_js(TypeError, function() { ctx.arcTo(0, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.arcTo(0, 0, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.rect(); }); + assert_throws_js(TypeError, function() { ctx.rect(0); }); + assert_throws_js(TypeError, function() { ctx.rect(0, 0); }); + assert_throws_js(TypeError, function() { ctx.rect(0, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.arc(); }); + assert_throws_js(TypeError, function() { ctx.arc(0); }); + assert_throws_js(TypeError, function() { ctx.arc(0, 0); }); + assert_throws_js(TypeError, function() { ctx.arc(0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.arc(0, 0, 1, 0); }); + // (6th argument to arc is optional) + if (ctx.isPointInPath) { + assert_throws_js(TypeError, function() { ctx.isPointInPath(); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath(0); }); + } + if (ctx.drawFocusRing) { + assert_throws_js(TypeError, function() { ctx.drawFocusRing(); }); + assert_throws_js(TypeError, function() { ctx.drawFocusRing(canvas); }); + assert_throws_js(TypeError, function() { ctx.drawFocusRing(canvas, 0); }); + } + if (ctx.fillText) { + assert_throws_js(TypeError, function() { ctx.fillText(); }); + assert_throws_js(TypeError, function() { ctx.fillText('test'); }); + assert_throws_js(TypeError, function() { ctx.fillText('test', 0); }); + assert_throws_js(TypeError, function() { ctx.strokeText(); }); + assert_throws_js(TypeError, function() { ctx.strokeText('test'); }); + assert_throws_js(TypeError, function() { ctx.strokeText('test', 0); }); + assert_throws_js(TypeError, function() { ctx.measureText(); }); + } + assert_throws_js(TypeError, function() { ctx.drawImage(); }); + assert_throws_js(TypeError, function() { ctx.drawImage(canvas); }); + assert_throws_js(TypeError, function() { 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) { + assert_throws_js(TypeError, function() { ctx.createImageData(); }); + assert_throws_js(TypeError, function() { ctx.createImageData(1); }); + } + if (ctx.getImageData) { + assert_throws_js(TypeError, function() { ctx.getImageData(); }); + assert_throws_js(TypeError, function() { ctx.getImageData(0); }); + assert_throws_js(TypeError, function() { ctx.getImageData(0, 0); }); + assert_throws_js(TypeError, function() { ctx.getImageData(0, 0, 1); }); + } + if (ctx.putImageData) { + var imgdata = ctx.getImageData(0, 0, 1, 1); + assert_throws_js(TypeError, function() { ctx.putImageData(); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 0); }); + } + var g = ctx.createLinearGradient(0, 0, 0, 0); + assert_throws_js(TypeError, function() { g.addColorStop(); }); + assert_throws_js(TypeError, function() { g.addColorStop(0); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.3arg.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.3arg.html new file mode 100644 index 0000000000..7f1f66654d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.3arg.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.drawImage.3arg + + + + +

2d.drawImage.3arg

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.3arg.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.3arg.worker.js new file mode 100644 index 0000000000..b2f860bc60 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.3arg.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.3arg +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const response_red = await fetch('/images/red.png'); + const blob_red = await response_red.blob(); + const bitmap_red = await createImageBitmap(blob_red); + + const response_green = await fetch('/images/green.png'); + const blob_green = await response_green.blob(); + const bitmap_green = await createImageBitmap(blob_green); + + ctx.drawImage(bitmap_green, 0, 0); + ctx.drawImage(bitmap_red, -100, 0); + ctx.drawImage(bitmap_red, 100, 0); + ctx.drawImage(bitmap_red, 0, -50); + ctx.drawImage(bitmap_red, 0, 50); + _assertPixelApprox(canvas, 0,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.5arg.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.5arg.html new file mode 100644 index 0000000000..f7bf0568c4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.5arg.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.drawImage.5arg + + + + +

2d.drawImage.5arg

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.5arg.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.5arg.worker.js new file mode 100644 index 0000000000..f725acf011 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.5arg.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.5arg +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + const response_red = await fetch('/images/red.png'); + const blob_red = await response_red.blob(); + const bitmap_red = await createImageBitmap(blob_red); + + const response_green = await fetch('/images/green.png'); + const blob_green = await response_green.blob(); + const bitmap_green = await createImageBitmap(blob_green); + + ctx.drawImage(bitmap_green, 50, 0, 50, 50); + ctx.drawImage(bitmap_red, 0, 0, 50, 50); + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 50, 50); + _assertPixelApprox(canvas, 0,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.basic.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.basic.html new file mode 100644 index 0000000000..47e442e23e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.basic.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.drawImage.9arg.basic + + + + +

2d.drawImage.9arg.basic

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.basic.worker.js new file mode 100644 index 0000000000..b2d6f7d860 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.basic.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.9arg.basic +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + const response = await fetch('/images/green.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + + ctx.drawImage(bitmap, 0, 0, 100, 50, 0, 0, 100, 50); + _assertPixelApprox(canvas, 0,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destpos.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destpos.html new file mode 100644 index 0000000000..5e0f3f1088 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destpos.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.drawImage.9arg.destpos + + + + +

2d.drawImage.9arg.destpos

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destpos.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destpos.worker.js new file mode 100644 index 0000000000..380d526f9b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destpos.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.9arg.destpos +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const response_red = await fetch('/images/red.png'); + const blob_red = await response_red.blob(); + const bitmap_red = await createImageBitmap(blob_red); + + const response_green = await fetch('/images/green.png'); + const blob_green = await response_green.blob(); + const bitmap_green = await createImageBitmap(blob_green); + + ctx.drawImage(bitmap_green, 0, 0, 100, 50, 0, 0, 100, 50); + ctx.drawImage(bitmap_green, 0, 0, 100, 50, -100, 0, 100, 50); + ctx.drawImage(bitmap_red, 0, 0, 100, 50, 100, 0, 100, 50); + ctx.drawImage(bitmap_red, 0, 0, 100, 50, 0, -50, 100, 50); + ctx.drawImage(bitmap_red, 0, 0, 100, 50, 0, 50, 100, 50); + _assertPixelApprox(canvas, 0,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destsize.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destsize.html new file mode 100644 index 0000000000..93b587a44f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destsize.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.drawImage.9arg.destsize + + + + +

2d.drawImage.9arg.destsize

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destsize.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destsize.worker.js new file mode 100644 index 0000000000..76e3e8baaf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.destsize.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.9arg.destsize +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const response_red = await fetch('/images/red.png'); + const blob_red = await response_red.blob(); + const bitmap_red = await createImageBitmap(blob_red); + + const response_green = await fetch('/images/green.png'); + const blob_green = await response_green.blob(); + const bitmap_green = await createImageBitmap(blob_green); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.drawImage(bitmap_green, 1, 1, 1, 1, 0, 0, 100, 50); + ctx.drawImage(bitmap_red, 0, 0, 100, 50, -50, 0, 50, 50); + ctx.drawImage(bitmap_red, 0, 0, 100, 50, 100, 0, 50, 50); + ctx.drawImage(bitmap_red, 0, 0, 100, 50, 0, -25, 100, 25); + ctx.drawImage(bitmap_red, 0, 0, 100, 50, 0, 50, 100, 25); + _assertPixelApprox(canvas, 0,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcepos.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcepos.html new file mode 100644 index 0000000000..e822ab43fa --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcepos.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.drawImage.9arg.sourcepos + + + + +

2d.drawImage.9arg.sourcepos

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcepos.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcepos.worker.js new file mode 100644 index 0000000000..d3525435fa --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcepos.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.9arg.sourcepos +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + const response = await fetch('/images/rgrg-256x256.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + ctx.drawImage(bitmap, 140, 20, 100, 50, 0, 0, 100, 50); + _assertPixelApprox(canvas, 0,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcesize.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcesize.html new file mode 100644 index 0000000000..b99ca58768 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcesize.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.drawImage.9arg.sourcesize + + + + +

2d.drawImage.9arg.sourcesize

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcesize.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcesize.worker.js new file mode 100644 index 0000000000..aa15efb705 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.9arg.sourcesize.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.9arg.sourcesize +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + const response = await fetch('/images/rgrg-256x256.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + ctx.drawImage(bitmap, 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, 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, 2); + _assertPixelApprox(canvas, 20,20, 0,255,0,255, 2); + _assertPixelApprox(canvas, 80,20, 0,255,0,255, 2); + _assertPixelApprox(canvas, 20,30, 0,255,0,255, 2); + _assertPixelApprox(canvas, 80,30, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.alpha.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.alpha.html new file mode 100644 index 0000000000..a95f3ece7a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.alpha.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.drawImage.alpha + + + + +

2d.drawImage.alpha

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.alpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.alpha.worker.js new file mode 100644 index 0000000000..958a2431b6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.alpha.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.alpha +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalAlpha = 0; + const response = await fetch('/images/red.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.broken.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.broken.html new file mode 100644 index 0000000000..a2afa05f01 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.broken.html @@ -0,0 +1,24 @@ + + +OffscreenCanvas test: 2d.drawImage.broken + + + + +

2d.drawImage.broken

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.broken.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.broken.worker.js new file mode 100644 index 0000000000..dc695b5459 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.broken.worker.js @@ -0,0 +1,20 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.broken +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const response = await fetch('/images/broken.png'); + const blob = await response.blob(); + + await promise_rejects_dom(t, 'InvalidStateError', createImageBitmap(blob), 'The source image could not be decoded.'); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.canvas.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.canvas.html new file mode 100644 index 0000000000..e5eeedea6e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.canvas.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.drawImage.canvas + + + + +

2d.drawImage.canvas

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.canvas.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.canvas.worker.js new file mode 100644 index 0000000000..1f18cd7723 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.canvas.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.canvas +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + var ctx2 = offscreenCanvas2.getContext('2d'); + ctx2.fillStyle = '#0f0'; + ctx2.fillRect(0, 0, 100, 50); + ctx.fillStyle = '#f00'; + ctx.drawImage(offscreenCanvas2, 0, 0); + _assertPixelApprox(canvas, 0,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.clip.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.clip.html new file mode 100644 index 0000000000..a828039b7b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.clip.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.drawImage.clip + + + + +

2d.drawImage.clip

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.clip.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.clip.worker.js new file mode 100644 index 0000000000..fea2a7bac7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.clip.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.clip +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.rect(-10, -10, 1, 1); + ctx.clip(); + const response = await fetch('/images/red.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.rect(-10, -10, 1, 1); + ctx.clip(); + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.composite.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.composite.html new file mode 100644 index 0000000000..b32b5a12ed --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.composite.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.drawImage.composite + + + + +

2d.drawImage.composite

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.composite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.composite.worker.js new file mode 100644 index 0000000000..0b17673b68 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.composite.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.composite +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.globalCompositeOperation = 'destination-over'; + const response = await fetch('/images/red.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.floatsource.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.floatsource.html new file mode 100644 index 0000000000..e201082e35 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.floatsource.html @@ -0,0 +1,25 @@ + + +OffscreenCanvas test: 2d.drawImage.floatsource + + + + +

2d.drawImage.floatsource

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.floatsource.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.floatsource.worker.js new file mode 100644 index 0000000000..1efc17d04d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.floatsource.worker.js @@ -0,0 +1,21 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.floatsource +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const response = await fetch('/images/green.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + ctx.drawImage(bitmap, 10.1, 10.1, 0.1, 0.1, 0, 0, 100, 50); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedest.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedest.html new file mode 100644 index 0000000000..3e43a772c6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedest.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.drawImage.negativedest + + + + +

2d.drawImage.negativedest

+

Negative destination width/height represents the correct rectangle

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedest.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedest.worker.js new file mode 100644 index 0000000000..ce5cf5efad --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedest.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.negativedest +// Description:Negative destination width/height represents the correct rectangle +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + const response = await fetch('/images/ggrr-256x256.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + ctx.drawImage(bitmap, 100, 78, 50, 50, 0, 50, 50, -50); + ctx.drawImage(bitmap, 100, 128, 50, -50, 100, 50, -50, -50); + _assertPixelApprox(canvas, 1,1, 0,255,0,255, 2); + _assertPixelApprox(canvas, 1,48, 0,255,0,255, 2); + _assertPixelApprox(canvas, 98,1, 0,255,0,255, 2); + _assertPixelApprox(canvas, 98,48, 0,255,0,255, 2); + _assertPixelApprox(canvas, 48,1, 0,255,0,255, 2); + _assertPixelApprox(canvas, 48,48, 0,255,0,255, 2); + _assertPixelApprox(canvas, 51,1, 0,255,0,255, 2); + _assertPixelApprox(canvas, 51,48, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + t.done(); +}, "Negative destination width/height represents the correct rectangle"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedir.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedir.html new file mode 100644 index 0000000000..347b634cfd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedir.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.drawImage.negativedir + + + + +

2d.drawImage.negativedir

+

Negative dimensions do not affect the direction of the image

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedir.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedir.worker.js new file mode 100644 index 0000000000..c82b9ba1be --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativedir.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.negativedir +// Description:Negative dimensions do not affect the direction of the image +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + const response = await fetch('/images/ggrr-256x256.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + ctx.drawImage(bitmap, 0, 178, 50, -100, 0, 0, 50, 100); + ctx.drawImage(bitmap, 0, 78, 50, 100, 50, 100, 50, -100); + _assertPixelApprox(canvas, 1,1, 0,255,0,255, 2); + _assertPixelApprox(canvas, 1,48, 0,255,0,255, 2); + _assertPixelApprox(canvas, 98,1, 0,255,0,255, 2); + _assertPixelApprox(canvas, 98,48, 0,255,0,255, 2); + _assertPixelApprox(canvas, 48,1, 0,255,0,255, 2); + _assertPixelApprox(canvas, 48,48, 0,255,0,255, 2); + _assertPixelApprox(canvas, 51,1, 0,255,0,255, 2); + _assertPixelApprox(canvas, 51,48, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + t.done(); +}, "Negative dimensions do not affect the direction of the image"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativesource.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativesource.html new file mode 100644 index 0000000000..3e18725720 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativesource.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.drawImage.negativesource + + + + +

2d.drawImage.negativesource

+

Negative source width/height represents the correct rectangle

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativesource.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativesource.worker.js new file mode 100644 index 0000000000..f92d15774d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.negativesource.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.negativesource +// Description:Negative source width/height represents the correct rectangle +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + const response = await fetch('/images/ggrr-256x256.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + ctx.drawImage(bitmap, 100, 78, -100, 50, 0, 0, 50, 50); + ctx.drawImage(bitmap, 100, 128, -100, -50, 50, 0, 50, 50); + _assertPixelApprox(canvas, 1,1, 0,255,0,255, 2); + _assertPixelApprox(canvas, 1,48, 0,255,0,255, 2); + _assertPixelApprox(canvas, 98,1, 0,255,0,255, 2); + _assertPixelApprox(canvas, 98,48, 0,255,0,255, 2); + _assertPixelApprox(canvas, 48,1, 0,255,0,255, 2); + _assertPixelApprox(canvas, 48,48, 0,255,0,255, 2); + _assertPixelApprox(canvas, 51,1, 0,255,0,255, 2); + _assertPixelApprox(canvas, 51,48, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + t.done(); +}, "Negative source width/height represents the correct rectangle"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nonfinite.html new file mode 100644 index 0000000000..93dccd3d4e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nonfinite.html @@ -0,0 +1,328 @@ + + +OffscreenCanvas test: 2d.drawImage.nonfinite + + + + +

2d.drawImage.nonfinite

+

drawImage() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nonfinite.worker.js new file mode 100644 index 0000000000..a56f09e0b2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nonfinite.worker.js @@ -0,0 +1,324 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.nonfinite +// Description:drawImage() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + const response = await fetch('/images/redtransparent.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + + ctx.drawImage(bitmap, Infinity, 0); + ctx.drawImage(bitmap, -Infinity, 0); + ctx.drawImage(bitmap, NaN, 0); + ctx.drawImage(bitmap, 0, Infinity); + ctx.drawImage(bitmap, 0, -Infinity); + ctx.drawImage(bitmap, 0, NaN); + ctx.drawImage(bitmap, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, -Infinity, 0, 100, 50); + ctx.drawImage(bitmap, NaN, 0, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, -Infinity, 100, 50); + ctx.drawImage(bitmap, 0, NaN, 100, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, -Infinity, 50); + ctx.drawImage(bitmap, 0, 0, NaN, 50); + ctx.drawImage(bitmap, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, -Infinity); + ctx.drawImage(bitmap, 0, 0, 100, NaN); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, 0, 0, 100, 50); + ctx.drawImage(bitmap, -Infinity, 0, 100, 50, 0, 0, 100, 50); + ctx.drawImage(bitmap, NaN, 0, 100, 50, 0, 0, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, 0, 0, 100, 50); + ctx.drawImage(bitmap, 0, -Infinity, 100, 50, 0, 0, 100, 50); + ctx.drawImage(bitmap, 0, NaN, 100, 50, 0, 0, 100, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, 0, 0, 100, 50); + ctx.drawImage(bitmap, 0, 0, -Infinity, 50, 0, 0, 100, 50); + ctx.drawImage(bitmap, 0, 0, NaN, 50, 0, 0, 100, 50); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, 0, 0, 100, 50); + ctx.drawImage(bitmap, 0, 0, 100, -Infinity, 0, 0, 100, 50); + ctx.drawImage(bitmap, 0, 0, 100, NaN, 0, 0, 100, 50); + ctx.drawImage(bitmap, 0, 0, 100, 50, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, 0, 0, 100, 50, -Infinity, 0, 100, 50); + ctx.drawImage(bitmap, 0, 0, 100, 50, NaN, 0, 100, 50); + ctx.drawImage(bitmap, 0, 0, 100, 50, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, 0, 100, 50, 0, -Infinity, 100, 50); + ctx.drawImage(bitmap, 0, 0, 100, 50, 0, NaN, 100, 50); + ctx.drawImage(bitmap, 0, 0, 100, 50, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, 100, 50, 0, 0, -Infinity, 50); + ctx.drawImage(bitmap, 0, 0, 100, 50, 0, 0, NaN, 50); + ctx.drawImage(bitmap, 0, 0, 100, 50, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, 50, 0, 0, 100, -Infinity); + ctx.drawImage(bitmap, 0, 0, 100, 50, 0, 0, 100, NaN); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, 0, 0, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, 0, 0, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, 0, 0, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, Infinity, 50, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, 0, 0, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, Infinity, 100, 50, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, 0, 0, 100, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, 0, 0, 100, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, Infinity, 50, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, 0, 0, 100, 50); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, Infinity, 0, 100, 50, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, 0, 0, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, 0, 0, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, Infinity, 50, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, 0, 0, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, 0, Infinity, 100, 50, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, 0, 0, 100, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, 0, 0, Infinity, 50, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, Infinity, 0, 100, 50); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, 0, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, 0, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, 0, 0, Infinity, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, Infinity, 0, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, 50, Infinity, Infinity, 100, 50); + ctx.drawImage(bitmap, 0, 0, 100, 50, Infinity, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, 100, 50, Infinity, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, 50, Infinity, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, 50, Infinity, 0, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, 100, 50, Infinity, 0, Infinity, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, 50, Infinity, 0, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, 50, 0, Infinity, Infinity, 50); + ctx.drawImage(bitmap, 0, 0, 100, 50, 0, Infinity, Infinity, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, 50, 0, Infinity, 100, Infinity); + ctx.drawImage(bitmap, 0, 0, 100, 50, 0, 0, Infinity, Infinity); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}, "drawImage() with Infinity/NaN is ignored"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nowrap.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nowrap.html new file mode 100644 index 0000000000..1182baec3b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nowrap.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.drawImage.nowrap + + + + +

2d.drawImage.nowrap

+

Stretched images do not get pixels wrapping around the edges

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nowrap.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nowrap.worker.js new file mode 100644 index 0000000000..47a77834c0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.nowrap.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.nowrap +// Description:Stretched images do not get pixels wrapping around the edges +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + const response = await fetch('/images/redtransparent.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + + ctx.drawImage(bitmap, -1950, 0, 2000, 50); + _assertPixelApprox(canvas, 45,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 55,25, 0,255,0,255, 2); + t.done(); +}, "Stretched images do not get pixels wrapping around the edges"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.null.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.null.html new file mode 100644 index 0000000000..7a8338b353 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.null.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.drawImage.null + + + + +

2d.drawImage.null

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.null.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.null.worker.js new file mode 100644 index 0000000000..329abd2221 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.null.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.null +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { ctx.drawImage(null, 0, 0); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.path.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.path.html new file mode 100644 index 0000000000..063353c11f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.path.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.drawImage.path + + + + +

2d.drawImage.path

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.path.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.path.worker.js new file mode 100644 index 0000000000..3259ff0258 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.path.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.path +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.rect(0, 0, 100, 50); + const response = await fetch('/images/red.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + + ctx.drawImage(bitmap, 0, 0); + ctx.fill(); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.1.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.1.html new file mode 100644 index 0000000000..c5e51c2772 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.1.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.drawImage.self.1 + + + + +

2d.drawImage.self.1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.1.worker.js new file mode 100644 index 0000000000..a9af88d13a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.1.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.self.1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.2.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.2.html new file mode 100644 index 0000000000..ac67476966 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.2.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.drawImage.self.2 + + + + +

2d.drawImage.self.2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.2.worker.js new file mode 100644 index 0000000000..802d2d8c52 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.self.2.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.self.2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + _assertPixelApprox(canvas, 99,0, 0,255,0,255, 2); + _assertPixelApprox(canvas, 0,49, 0,255,0,255, 2); + _assertPixelApprox(canvas, 99,49, 0,255,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.svg.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.svg.html new file mode 100644 index 0000000000..c2ebd265cf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.svg.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.drawImage.svg + + + + +

2d.drawImage.svg

+

drawImage() of an SVG image

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.transform.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.transform.html new file mode 100644 index 0000000000..ca148c1a68 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.transform.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.drawImage.transform + + + + +

2d.drawImage.transform

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.transform.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.transform.worker.js new file mode 100644 index 0000000000..4a4cd07be9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.transform.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.transform +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.translate(100, 0); + const response = await fetch('/images/red.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + + ctx.drawImage(bitmap, 0, 0); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.wrongtype.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.wrongtype.html new file mode 100644 index 0000000000..96906e8fc3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.wrongtype.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.drawImage.wrongtype + + + + +

2d.drawImage.wrongtype

+

Incorrect image types in drawImage do not match any defined overloads, so WebIDL throws a TypeError

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.wrongtype.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.wrongtype.worker.js new file mode 100644 index 0000000000..176e418d64 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.wrongtype.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.wrongtype +// Description:Incorrect image types in drawImage do not match any defined overloads, so WebIDL throws a TypeError +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Incorrect image types in drawImage do not match any defined overloads, so WebIDL throws a TypeError"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { ctx.drawImage(undefined, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.drawImage(0, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.drawImage("", 0, 0); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerocanvas.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerocanvas.html new file mode 100644 index 0000000000..a30c300730 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerocanvas.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.drawImage.zerocanvas + + + + +

2d.drawImage.zerocanvas

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerocanvas.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerocanvas.worker.js new file mode 100644 index 0000000000..41346ad328 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerocanvas.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.zerocanvas +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(0, 10); + assert_throws_dom("INVALID_STATE_ERR", function() { ctx.drawImage(offscreenCanvas2, 0, 0); }); + + offscreenCanvas2.width = 10; + offscreenCanvas2.height = 0; + assert_throws_dom("INVALID_STATE_ERR", function() { ctx.drawImage(offscreenCanvas2, 0, 0); }); + + offscreenCanvas2.width = 0; + offscreenCanvas2.height = 0; + assert_throws_dom("INVALID_STATE_ERR", function() { ctx.drawImage(offscreenCanvas2, 0, 0); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.html new file mode 100644 index 0000000000..0239c5356d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.drawImage.zerosource + + + + +

2d.drawImage.zerosource

+

drawImage with zero-sized source rectangle draws nothing without exception

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.image.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.image.html new file mode 100644 index 0000000000..77182242d4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.image.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.drawImage.zerosource.image + + + + +

2d.drawImage.zerosource.image

+

drawImage with zero-sized source rectangle from image draws nothing without exception

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.worker.js new file mode 100644 index 0000000000..a80bfff562 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.drawImage.zerosource +// Description:drawImage with zero-sized source rectangle draws nothing without exception +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + const response = await fetch('/images/red.png'); + const blob = await response.blob(); + const bitmap = await createImageBitmap(blob); + ctx.drawImage(bitmap, 10, 10, 0, 1, 0, 0, 100, 50); + ctx.drawImage(bitmap, 10, 10, 1, 0, 0, 0, 100, 50); + ctx.drawImage(bitmap, 10, 10, 0, 0, 0, 0, 100, 50); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, 2); + t.done(); +}, "drawImage with zero-sized source rectangle draws nothing without exception"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.basic.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.basic.html new file mode 100644 index 0000000000..02a9cb37ca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.basic.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.clearRect.basic + + + + +

2d.clearRect.basic

+

clearRect clears to transparent black

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.basic.worker.js new file mode 100644 index 0000000000..8f3a7e46de --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.basic.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.clearRect.basic +// Description:clearRect clears to transparent black +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("clearRect clears to transparent black"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.clearRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.clip.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.clip.html new file mode 100644 index 0000000000..2f0f171601 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.clip.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.clearRect.clip + + + + +

2d.clearRect.clip

+

clearRect is affected by clipping regions

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.clip.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.clip.worker.js new file mode 100644 index 0000000000..3d3caedbb1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.clip.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.clearRect.clip +// Description:clearRect is affected by clipping regions +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("clearRect is affected by clipping regions"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalalpha.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalalpha.html new file mode 100644 index 0000000000..45875c5270 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalalpha.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.clearRect.globalalpha + + + + +

2d.clearRect.globalalpha

+

clearRect is not affected by globalAlpha

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalalpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalalpha.worker.js new file mode 100644 index 0000000000..1b07b66cb3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalalpha.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.clearRect.globalalpha +// Description:clearRect is not affected by globalAlpha +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("clearRect is not affected by globalAlpha"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalcomposite.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalcomposite.html new file mode 100644 index 0000000000..b57be641ca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalcomposite.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.clearRect.globalcomposite + + + + +

2d.clearRect.globalcomposite

+

clearRect is not affected by globalCompositeOperation

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalcomposite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalcomposite.worker.js new file mode 100644 index 0000000000..e8c1c9b27c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.globalcomposite.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.clearRect.globalcomposite +// Description:clearRect is not affected by globalCompositeOperation +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("clearRect is not affected by globalCompositeOperation"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.negative.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.negative.html new file mode 100644 index 0000000000..12126dfe87 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.negative.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.clearRect.negative + + + + +

2d.clearRect.negative

+

clearRect of negative sizes works

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.negative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.negative.worker.js new file mode 100644 index 0000000000..62846aec8e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.negative.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.clearRect.negative +// Description:clearRect of negative sizes works +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("clearRect of negative sizes works"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,12, 0,0,0,0); + _assertPixel(canvas, 25,37, 0,0,0,0); + _assertPixel(canvas, 75,37, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.nonfinite.html new file mode 100644 index 0000000000..3327834146 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.nonfinite.html @@ -0,0 +1,52 @@ + + +OffscreenCanvas test: 2d.clearRect.nonfinite + + + + +

2d.clearRect.nonfinite

+

clearRect() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.nonfinite.worker.js new file mode 100644 index 0000000000..e2525df3be --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.nonfinite.worker.js @@ -0,0 +1,47 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.clearRect.nonfinite +// Description:clearRect() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("clearRect() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.path.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.path.html new file mode 100644 index 0000000000..25ad954d06 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.path.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.clearRect.path + + + + +

2d.clearRect.path

+

clearRect does not affect the current path

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.path.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.path.worker.js new file mode 100644 index 0000000000..40f51f9f0e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.path.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.clearRect.path +// Description:clearRect does not affect the current path +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("clearRect does not affect the current path"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.shadow.html new file mode 100644 index 0000000000..3b3e41c19c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.shadow.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.clearRect.shadow + + + + +

2d.clearRect.shadow

+

clearRect does not draw shadows

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.shadow.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.shadow.worker.js new file mode 100644 index 0000000000..a1ec8ac7ae --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.shadow.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.clearRect.shadow +// Description:clearRect does not draw shadows +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("clearRect does not draw shadows"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.transform.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.transform.html new file mode 100644 index 0000000000..8208b6f657 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.transform.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.clearRect.transform + + + + +

2d.clearRect.transform

+

clearRect is affected by transforms

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.transform.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.transform.worker.js new file mode 100644 index 0000000000..f176f3da8a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.transform.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.clearRect.transform +// Description:clearRect is affected by transforms +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("clearRect is affected by transforms"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.zero.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.zero.html new file mode 100644 index 0000000000..461c318d24 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.zero.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.clearRect.zero + + + + +

2d.clearRect.zero

+

clearRect of zero pixels has no effect

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.zero.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.zero.worker.js new file mode 100644 index 0000000000..b6f42551a2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.clearRect.zero.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.clearRect.zero +// Description:clearRect of zero pixels has no effect +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("clearRect of zero pixels has no effect"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.basic.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.basic.html new file mode 100644 index 0000000000..3e65472b83 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.basic.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.fillRect.basic + + + + +

2d.fillRect.basic

+

fillRect works

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.basic.worker.js new file mode 100644 index 0000000000..69918278e4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.basic.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillRect.basic +// Description:fillRect works +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillRect works"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.clip.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.clip.html new file mode 100644 index 0000000000..3b26960e24 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.clip.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.fillRect.clip + + + + +

2d.fillRect.clip

+

fillRect is affected by clipping regions

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.clip.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.clip.worker.js new file mode 100644 index 0000000000..890b31e342 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.clip.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillRect.clip +// Description:fillRect is affected by clipping regions +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillRect is affected by clipping regions"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.negative.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.negative.html new file mode 100644 index 0000000000..2a1942811f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.negative.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.fillRect.negative + + + + +

2d.fillRect.negative

+

fillRect of negative sizes works

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.negative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.negative.worker.js new file mode 100644 index 0000000000..5df1652331 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.negative.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillRect.negative +// Description:fillRect of negative sizes works +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillRect of negative sizes works"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,12, 0,255,0,255); + _assertPixel(canvas, 25,37, 0,255,0,255); + _assertPixel(canvas, 75,37, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.nonfinite.html new file mode 100644 index 0000000000..e44a9d4b78 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.nonfinite.html @@ -0,0 +1,53 @@ + + +OffscreenCanvas test: 2d.fillRect.nonfinite + + + + +

2d.fillRect.nonfinite

+

fillRect() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.nonfinite.worker.js new file mode 100644 index 0000000000..bc0170918c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.nonfinite.worker.js @@ -0,0 +1,48 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillRect.nonfinite +// Description:fillRect() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillRect() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.path.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.path.html new file mode 100644 index 0000000000..bcf7ee5a97 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.path.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.fillRect.path + + + + +

2d.fillRect.path

+

fillRect does not affect the current path

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.path.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.path.worker.js new file mode 100644 index 0000000000..ddbfc4a96d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.path.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillRect.path +// Description:fillRect does not affect the current path +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillRect does not affect the current path"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.shadow.html new file mode 100644 index 0000000000..8a8e38070c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.shadow.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.fillRect.shadow + + + + +

2d.fillRect.shadow

+

fillRect draws shadows

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.shadow.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.shadow.worker.js new file mode 100644 index 0000000000..ff4ef0ca2d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.shadow.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillRect.shadow +// Description:fillRect draws shadows +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillRect draws shadows"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.transform.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.transform.html new file mode 100644 index 0000000000..19cb6ac77a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.transform.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.fillRect.transform + + + + +

2d.fillRect.transform

+

fillRect is affected by transforms

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.transform.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.transform.worker.js new file mode 100644 index 0000000000..a7f328955b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.transform.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillRect.transform +// Description:fillRect is affected by transforms +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillRect is affected by transforms"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.zero.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.zero.html new file mode 100644 index 0000000000..3ec78ba18a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.zero.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.fillRect.zero + + + + +

2d.fillRect.zero

+

fillRect of zero pixels has no effect

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.zero.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.zero.worker.js new file mode 100644 index 0000000000..a310d3ff28 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.fillRect.zero.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillRect.zero +// Description:fillRect of zero pixels has no effect +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillRect of zero pixels has no effect"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.basic.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.basic.html new file mode 100644 index 0000000000..79cc3934b4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.basic.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.strokeRect.basic + + + + +

2d.strokeRect.basic

+

strokeRect works

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.basic.worker.js new file mode 100644 index 0000000000..de7b13c8f9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.basic.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.strokeRect.basic +// Description:strokeRect works +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("strokeRect works"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.strokeStyle = '#0f0'; + ctx.lineWidth = 50; + ctx.strokeRect(25, 24, 50, 2); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.clip.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.clip.html new file mode 100644 index 0000000000..9990f2761e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.clip.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.strokeRect.clip + + + + +

2d.strokeRect.clip

+

strokeRect is affected by clipping regions

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.clip.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.clip.worker.js new file mode 100644 index 0000000000..f70a421f1e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.clip.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.strokeRect.clip +// Description:strokeRect is affected by clipping regions +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("strokeRect is affected by clipping regions"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalalpha.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalalpha.html new file mode 100644 index 0000000000..efc532f33f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalalpha.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.strokeRect.globalalpha + + + + +

2d.strokeRect.globalalpha

+

strokeRect is affected by globalAlpha

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalalpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalalpha.worker.js new file mode 100644 index 0000000000..2f938b3848 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalalpha.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.strokeRect.globalalpha +// Description:strokeRect is affected by globalAlpha +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("strokeRect is affected by globalAlpha"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.globalAlpha = 0; + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 50; + ctx.strokeRect(25, 24, 50, 2); + _assertPixel(canvas, 50,25, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalcomposite.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalcomposite.html new file mode 100644 index 0000000000..4532604c9a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalcomposite.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.strokeRect.globalcomposite + + + + +

2d.strokeRect.globalcomposite

+

strokeRect is not affected by globalCompositeOperation

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalcomposite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalcomposite.worker.js new file mode 100644 index 0000000000..9de70c15a0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.globalcomposite.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.strokeRect.globalcomposite +// Description:strokeRect is not affected by globalCompositeOperation +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("strokeRect is not affected by globalCompositeOperation"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.globalCompositeOperation = 'source-in'; + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 50; + ctx.strokeRect(25, 24, 50, 2); + _assertPixel(canvas, 50,25, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.negative.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.negative.html new file mode 100644 index 0000000000..13af38e565 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.negative.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.strokeRect.negative + + + + +

2d.strokeRect.negative

+

strokeRect of negative sizes works

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.negative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.negative.worker.js new file mode 100644 index 0000000000..bc2aa0434b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.negative.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.strokeRect.negative +// Description:strokeRect of negative sizes works +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("strokeRect of negative sizes works"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,12, 0,255,0,255); + _assertPixel(canvas, 25,37, 0,255,0,255); + _assertPixel(canvas, 75,37, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.nonfinite.html new file mode 100644 index 0000000000..6393797464 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.nonfinite.html @@ -0,0 +1,54 @@ + + +OffscreenCanvas test: 2d.strokeRect.nonfinite + + + + +

2d.strokeRect.nonfinite

+

strokeRect() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.nonfinite.worker.js new file mode 100644 index 0000000000..1878e54c5f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.nonfinite.worker.js @@ -0,0 +1,49 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.strokeRect.nonfinite +// Description:strokeRect() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("strokeRect() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.path.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.path.html new file mode 100644 index 0000000000..da8e903f9c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.path.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.strokeRect.path + + + + +

2d.strokeRect.path

+

strokeRect does not affect the current path

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.path.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.path.worker.js new file mode 100644 index 0000000000..839b973b17 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.path.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.strokeRect.path +// Description:strokeRect does not affect the current path +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("strokeRect does not affect the current path"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.shadow.html new file mode 100644 index 0000000000..2adf24e2b5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.shadow.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.strokeRect.shadow + + + + +

2d.strokeRect.shadow

+

strokeRect draws shadows

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.shadow.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.shadow.worker.js new file mode 100644 index 0000000000..36b3455016 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.shadow.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.strokeRect.shadow +// Description:strokeRect draws shadows +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("strokeRect draws shadows"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.transform.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.transform.html new file mode 100644 index 0000000000..214ea14023 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.transform.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.strokeRect.transform + + + + +

2d.strokeRect.transform

+

fillRect is affected by transforms

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.transform.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.transform.worker.js new file mode 100644 index 0000000000..43aab18533 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.transform.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.strokeRect.transform +// Description:fillRect is affected by transforms +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillRect is affected by transforms"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.1.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.1.html new file mode 100644 index 0000000000..2c63913fca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.strokeRect.zero.1 + + + + +

2d.strokeRect.zero.1

+

strokeRect of 0x0 pixels draws nothing

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.1.worker.js new file mode 100644 index 0000000000..115017b3bf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.strokeRect.zero.1 +// Description:strokeRect of 0x0 pixels draws nothing +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("strokeRect of 0x0 pixels draws nothing"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 250; + ctx.strokeRect(50, 25, 0, 0); + _assertPixel(canvas, 50,25, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.html new file mode 100644 index 0000000000..16bddea7ee --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.strokeRect.zero.2 + + + + +

2d.strokeRect.zero.2

+

strokeRect of 0x0 pixels draws nothing, including caps and joins

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.worker.js new file mode 100644 index 0000000000..973ebec44a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.2.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.strokeRect.zero.2 +// Description:strokeRect of 0x0 pixels draws nothing, including caps and joins +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("strokeRect of 0x0 pixels draws nothing, including caps and joins"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.3.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.3.html new file mode 100644 index 0000000000..8bf3e043db --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.strokeRect.zero.3 + + + + +

2d.strokeRect.zero.3

+

strokeRect of Nx0 pixels draws a straight line

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.3.worker.js new file mode 100644 index 0000000000..2612e54fdb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.strokeRect.zero.3 +// Description:strokeRect of Nx0 pixels draws a straight line +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("strokeRect of Nx0 pixels draws a straight line"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.strokeStyle = '#0f0'; + ctx.lineWidth = 50; + ctx.strokeRect(0, 25, 100, 0); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.html new file mode 100644 index 0000000000..87aeaf7c13 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.strokeRect.zero.4 + + + + +

2d.strokeRect.zero.4

+

strokeRect of Nx0 pixels draws a closed line with no caps

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.worker.js new file mode 100644 index 0000000000..3cec206313 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.4.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.strokeRect.zero.4 +// Description:strokeRect of Nx0 pixels draws a closed line with no caps +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("strokeRect of Nx0 pixels draws a closed line with no caps"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 250; + ctx.lineCap = 'round'; + ctx.strokeRect(100, 25, 100, 0); + _assertPixel(canvas, 50,25, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.html b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.html new file mode 100644 index 0000000000..e03e7aa118 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.strokeRect.zero.5 + + + + +

2d.strokeRect.zero.5

+

strokeRect of Nx0 pixels draws a closed line with joins

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.worker.js new file mode 100644 index 0000000000..8591409705 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/drawing-rectangles-to-the-canvas/2d.strokeRect.zero.5.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.strokeRect.zero.5 +// Description:strokeRect of Nx0 pixels draws a closed line with joins +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("strokeRect of Nx0 pixels draws a closed line with joins"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.strokeStyle = '#0f0'; + ctx.lineWidth = 250; + ctx.lineJoin = 'round'; + ctx.strokeRect(100, 25, 100, 0); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.CSSHSL.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.CSSHSL.html new file mode 100644 index 0000000000..8e488a5a58 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.CSSHSL.html @@ -0,0 +1,51 @@ + + +OffscreenCanvas test: 2d.fillStyle.CSSHSL + + + + +

2d.fillStyle.CSSHSL

+

CSSHSL works as color input

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.CSSRGB.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.CSSRGB.html new file mode 100644 index 0000000000..1670d64295 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.CSSRGB.html @@ -0,0 +1,60 @@ + + +OffscreenCanvas test: 2d.fillStyle.CSSRGB + + + + +

2d.fillStyle.CSSRGB

+

CSSRGB works as color input

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.colormix.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.colormix.html new file mode 100644 index 0000000000..059c551e46 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.colormix.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.colormix + + + + +

2d.fillStyle.colormix

+

color-mix works as color input

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.colormix.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.colormix.worker.js new file mode 100644 index 0000000000..d015790ead --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.colormix.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.colormix +// Description:color-mix works as color input +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("color-mix works as color input"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = "color-mix(in srgb, red, blue)"; + _assertSame(ctx.fillStyle, 'color(srgb 0.5 0 0.5)', "ctx.fillStyle", "'color(srgb 0.5 0 0.5)'"); + ctx.fillStyle = "color-mix(in srgb, red, color(srgb 1 0 0))"; + _assertSame(ctx.fillStyle, 'color(srgb 1 0 0)', "ctx.fillStyle", "'color(srgb 1 0 0)'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.default.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.default.html new file mode 100644 index 0000000000..58075168e8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.default.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.fillStyle.default + + + + +

2d.fillStyle.default

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.default.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.default.worker.js new file mode 100644 index 0000000000..34a6f1276a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.default.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.default +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.fillStyle, '#000000', "ctx.fillStyle", "'#000000'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.halftransparent.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.halftransparent.html new file mode 100644 index 0000000000..cd0b0c2437 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.halftransparent.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.fillStyle.get.halftransparent + + + + +

2d.fillStyle.get.halftransparent

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.halftransparent.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.halftransparent.worker.js new file mode 100644 index 0000000000..7590816b32 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.halftransparent.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.get.halftransparent +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(255,255,255,0.5)'; + _assertSame(ctx.fillStyle, 'rgba(255, 255, 255, 0.5)', "ctx.fillStyle", "'rgba(255, 255, 255, 0.5)'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.semitransparent.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.semitransparent.html new file mode 100644 index 0000000000..6be295ae0b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.semitransparent.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.fillStyle.get.semitransparent + + + + +

2d.fillStyle.get.semitransparent

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.semitransparent.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.semitransparent.worker.js new file mode 100644 index 0000000000..1c25bc2ed5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.semitransparent.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.get.semitransparent +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(255,255,255,0.45)'; + assert_regexp_match(ctx.fillStyle, /^rgba\(255, 255, 255, 0\.4\d+\)$/); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.solid.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.solid.html new file mode 100644 index 0000000000..4d8ccc0ff4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.solid.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.fillStyle.get.solid + + + + +

2d.fillStyle.get.solid

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.solid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.solid.worker.js new file mode 100644 index 0000000000..efec71ca9e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.solid.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.get.solid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#fa0'; + _assertSame(ctx.fillStyle, '#ffaa00', "ctx.fillStyle", "'#ffaa00'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.transparent.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.transparent.html new file mode 100644 index 0000000000..8fe102f2b1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.transparent.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.fillStyle.get.transparent + + + + +

2d.fillStyle.get.transparent

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.transparent.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.transparent.worker.js new file mode 100644 index 0000000000..51542bad82 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.get.transparent.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.get.transparent +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = 'rgba(0,0,0,0)'; + _assertSame(ctx.fillStyle, 'rgba(0, 0, 0, 0)', "ctx.fillStyle", "'rgba(0, 0, 0, 0)'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidstring.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidstring.html new file mode 100644 index 0000000000..a30bc4ac7c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidstring.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.fillStyle.invalidstring + + + + +

2d.fillStyle.invalidstring

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidstring.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidstring.worker.js new file mode 100644 index 0000000000..f2f5ccacce --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidstring.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.invalidstring +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidtype.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidtype.html new file mode 100644 index 0000000000..23814ae87c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidtype.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.fillStyle.invalidtype + + + + +

2d.fillStyle.invalidtype

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidtype.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidtype.worker.js new file mode 100644 index 0000000000..13e10e1254 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.invalidtype.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.invalidtype +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-1.html new file mode 100644 index 0000000000..222d7f6077 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsl-1 + + + + +

2d.fillStyle.parse.css-color-4-hsl-1

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-1.worker.js new file mode 100644 index 0000000000..74137880b7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsl-1 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120 100.0% 50.0%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-2.html new file mode 100644 index 0000000000..b2c93c1e26 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsl-2 + + + + +

2d.fillStyle.parse.css-color-4-hsl-2

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-2.worker.js new file mode 100644 index 0000000000..3ccd75a400 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsl-2 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120 100.0% 50.0% / 0.2)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-3.html new file mode 100644 index 0000000000..fc8726904c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsl-3 + + + + +

2d.fillStyle.parse.css-color-4-hsl-3

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-3.worker.js new file mode 100644 index 0000000000..bfaba36446 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsl-3 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120.0, 100.0%, 50.0%, 0.2)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-4.html new file mode 100644 index 0000000000..71cb327c5f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsl-4 + + + + +

2d.fillStyle.parse.css-color-4-hsl-4

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-4.worker.js new file mode 100644 index 0000000000..afe12657bc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsl-4 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120.0, 100.0%, 50.0%, 20%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-5.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-5.html new file mode 100644 index 0000000000..787d5e7644 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-5.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsl-5 + + + + +

2d.fillStyle.parse.css-color-4-hsl-5

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-5.worker.js new file mode 100644 index 0000000000..05c77b0a1d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-5.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsl-5 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120deg, 100.0%, 50.0%, 0.2)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-6.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-6.html new file mode 100644 index 0000000000..8acc67f968 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-6.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsl-6 + + + + +

2d.fillStyle.parse.css-color-4-hsl-6

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-6.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-6.worker.js new file mode 100644 index 0000000000..8ff08394b7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-6.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsl-6 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120deg, 100.0%, 50.0%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-7.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-7.html new file mode 100644 index 0000000000..dc295d070a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-7.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsl-7 + + + + +

2d.fillStyle.parse.css-color-4-hsl-7

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-7.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-7.worker.js new file mode 100644 index 0000000000..9d0513ffca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-7.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsl-7 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(133.33333333grad, 100.0%, 50.0%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-8.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-8.html new file mode 100644 index 0000000000..50970585ca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-8.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsl-8 + + + + +

2d.fillStyle.parse.css-color-4-hsl-8

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-8.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-8.worker.js new file mode 100644 index 0000000000..ce56342cea --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-8.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsl-8 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(2.0943951024rad, 100.0%, 50.0%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-9.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-9.html new file mode 100644 index 0000000000..47cd157c44 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-9.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsl-9 + + + + +

2d.fillStyle.parse.css-color-4-hsl-9

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-9.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-9.worker.js new file mode 100644 index 0000000000..e45f55930d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsl-9.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsl-9 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(0.3333333333turn, 100.0%, 50.0%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-1.html new file mode 100644 index 0000000000..2d1e46f1a9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsla-1 + + + + +

2d.fillStyle.parse.css-color-4-hsla-1

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-1.worker.js new file mode 100644 index 0000000000..2a1157ed1f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsla-1 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120 100.0% 50.0%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-2.html new file mode 100644 index 0000000000..f5531f68e1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsla-2 + + + + +

2d.fillStyle.parse.css-color-4-hsla-2

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-2.worker.js new file mode 100644 index 0000000000..23cd58d1a0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsla-2 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120 100.0% 50.0% / 0.2)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-3.html new file mode 100644 index 0000000000..fde2328c43 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsla-3 + + + + +

2d.fillStyle.parse.css-color-4-hsla-3

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-3.worker.js new file mode 100644 index 0000000000..64577bc348 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsla-3 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120.0, 100.0%, 50.0%, 0.2)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-4.html new file mode 100644 index 0000000000..3b6e1f1347 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsla-4 + + + + +

2d.fillStyle.parse.css-color-4-hsla-4

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-4.worker.js new file mode 100644 index 0000000000..05b08f0a0c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsla-4 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120.0, 100.0%, 50.0%, 20%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-5.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-5.html new file mode 100644 index 0000000000..b0677c16dc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-5.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsla-5 + + + + +

2d.fillStyle.parse.css-color-4-hsla-5

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-5.worker.js new file mode 100644 index 0000000000..51484f3aef --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-5.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsla-5 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120deg, 100.0%, 50.0%, 0.2)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-6.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-6.html new file mode 100644 index 0000000000..809d11c4cd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-6.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsla-6 + + + + +

2d.fillStyle.parse.css-color-4-hsla-6

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-6.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-6.worker.js new file mode 100644 index 0000000000..7b224e5c93 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-6.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsla-6 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120deg, 100.0%, 50.0%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-7.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-7.html new file mode 100644 index 0000000000..48c3c6927e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-7.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsla-7 + + + + +

2d.fillStyle.parse.css-color-4-hsla-7

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-7.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-7.worker.js new file mode 100644 index 0000000000..ed51a5df40 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-7.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsla-7 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(133.33333333grad, 100.0%, 50.0%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-8.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-8.html new file mode 100644 index 0000000000..f49b313a1f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-8.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsla-8 + + + + +

2d.fillStyle.parse.css-color-4-hsla-8

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-8.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-8.worker.js new file mode 100644 index 0000000000..c61fb1a1fc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-8.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsla-8 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(2.0943951024rad, 100.0%, 50.0%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-9.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-9.html new file mode 100644 index 0000000000..68c4e224a2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-9.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-hsla-9 + + + + +

2d.fillStyle.parse.css-color-4-hsla-9

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-9.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-9.worker.js new file mode 100644 index 0000000000..51541b7148 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-hsla-9.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-hsla-9 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(0.3333333333turn, 100.0%, 50.0%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-1.html new file mode 100644 index 0000000000..c9d75ca5c6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-rgb-1 + + + + +

2d.fillStyle.parse.css-color-4-rgb-1

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-1.worker.js new file mode 100644 index 0000000000..f0a67250f1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-rgb-1 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgb(0, 255.0, 0)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-2.html new file mode 100644 index 0000000000..0acc23ef95 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-rgb-2 + + + + +

2d.fillStyle.parse.css-color-4-rgb-2

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-2.worker.js new file mode 100644 index 0000000000..eb6b952b4c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-rgb-2 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgb(0, 255, 0, 0.2)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.html new file mode 100644 index 0000000000..85c2606c98 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-rgb-3 + + + + +

2d.fillStyle.parse.css-color-4-rgb-3

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.worker.js new file mode 100644 index 0000000000..9db5b7c33e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-rgb-3 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgb(0, 255, 0, 20%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-4.html new file mode 100644 index 0000000000..e028260ee5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-rgb-4 + + + + +

2d.fillStyle.parse.css-color-4-rgb-4

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-4.worker.js new file mode 100644 index 0000000000..fecb3ecb6e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-rgb-4 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgb(0 255 0)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-5.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-5.html new file mode 100644 index 0000000000..51ace916b1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-5.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-rgb-5 + + + + +

2d.fillStyle.parse.css-color-4-rgb-5

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-5.worker.js new file mode 100644 index 0000000000..03948b0c69 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-5.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-rgb-5 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgb(0 255 0 / 0.2)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-6.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-6.html new file mode 100644 index 0000000000..6df2f914e8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-6.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-rgb-6 + + + + +

2d.fillStyle.parse.css-color-4-rgb-6

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-6.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-6.worker.js new file mode 100644 index 0000000000..5f31d9a9f4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgb-6.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-rgb-6 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgb(0 255 0 / 20%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-1.html new file mode 100644 index 0000000000..19d726ee3b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-rgba-1 + + + + +

2d.fillStyle.parse.css-color-4-rgba-1

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-1.worker.js new file mode 100644 index 0000000000..24f278221e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-rgba-1 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgba(0, 255.0, 0)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-2.html new file mode 100644 index 0000000000..1603ae93ab --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-rgba-2 + + + + +

2d.fillStyle.parse.css-color-4-rgba-2

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-2.worker.js new file mode 100644 index 0000000000..fcda86bae2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-rgba-2 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgba(0, 255, 0, 0.2)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-3.html new file mode 100644 index 0000000000..53ad71781a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-rgba-3 + + + + +

2d.fillStyle.parse.css-color-4-rgba-3

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-3.worker.js new file mode 100644 index 0000000000..164f17f3d8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-rgba-3 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgba(0, 255, 0, 20%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-4.html new file mode 100644 index 0000000000..3dc9f9c7a7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-rgba-4 + + + + +

2d.fillStyle.parse.css-color-4-rgba-4

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-4.worker.js new file mode 100644 index 0000000000..da512a261e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-rgba-4 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgba(0 255 0)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-5.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-5.html new file mode 100644 index 0000000000..db0e891f22 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-5.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-rgba-5 + + + + +

2d.fillStyle.parse.css-color-4-rgba-5

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-5.worker.js new file mode 100644 index 0000000000..7f10cba4d5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-5.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-rgba-5 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgba(0 255 0 / 0.2)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-6.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-6.html new file mode 100644 index 0000000000..c4ec4622a5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-6.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.css-color-4-rgba-6 + + + + +

2d.fillStyle.parse.css-color-4-rgba-6

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-6.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-6.worker.js new file mode 100644 index 0000000000..2d81992eba --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.css-color-4-rgba-6.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.css-color-4-rgba-6 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgba(0 255 0 / 20%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,51); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex3.html new file mode 100644 index 0000000000..90c4d4f5d7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hex3 + + + + +

2d.fillStyle.parse.hex3

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex3.worker.js new file mode 100644 index 0000000000..7ee281b443 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hex3 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex4.html new file mode 100644 index 0000000000..8a6260fa89 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hex4 + + + + +

2d.fillStyle.parse.hex4

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex4.worker.js new file mode 100644 index 0000000000..53001f9580 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hex4 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = '#0f0f'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex6.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex6.html new file mode 100644 index 0000000000..02f698ea30 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex6.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hex6 + + + + +

2d.fillStyle.parse.hex6

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex6.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex6.worker.js new file mode 100644 index 0000000000..e9420b62e1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex6.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hex6 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = '#00fF00'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex8.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex8.html new file mode 100644 index 0000000000..1563bab113 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex8.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hex8 + + + + +

2d.fillStyle.parse.hex8

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex8.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex8.worker.js new file mode 100644 index 0000000000..35cdc5c292 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hex8.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hex8 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = '#00ff00ff'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-1.html new file mode 100644 index 0000000000..96e6515a61 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsl-1 + + + + +

2d.fillStyle.parse.hsl-1

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-1.worker.js new file mode 100644 index 0000000000..204df1a35f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsl-1 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120, 100%, 50%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-2.html new file mode 100644 index 0000000000..b6f8f2bb76 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsl-2 + + + + +

2d.fillStyle.parse.hsl-2

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-2.worker.js new file mode 100644 index 0000000000..f282d3ca1f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsl-2 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl( -240 , 100% , 50% )'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-3.html new file mode 100644 index 0000000000..5ed3b96b9b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsl-3 + + + + +

2d.fillStyle.parse.hsl-3

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-3.worker.js new file mode 100644 index 0000000000..a4abd304a8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsl-3 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(360120, 100%, 50%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-4.html new file mode 100644 index 0000000000..f91edd75bf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsl-4 + + + + +

2d.fillStyle.parse.hsl-4

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-4.worker.js new file mode 100644 index 0000000000..19cbfd08cf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsl-4 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(-360240, 100%, 50%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-5.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-5.html new file mode 100644 index 0000000000..c4624da0c9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-5.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsl-5 + + + + +

2d.fillStyle.parse.hsl-5

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-5.worker.js new file mode 100644 index 0000000000..49689b8274 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-5.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsl-5 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-6.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-6.html new file mode 100644 index 0000000000..5baa5b3b00 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-6.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsl-6 + + + + +

2d.fillStyle.parse.hsl-6

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-6.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-6.worker.js new file mode 100644 index 0000000000..9f99d96403 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-6.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsl-6 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(+120, +100%, +50%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-1.html new file mode 100644 index 0000000000..db43c45dc8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsl-clamp-1 + + + + +

2d.fillStyle.parse.hsl-clamp-1

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-1.worker.js new file mode 100644 index 0000000000..868beda764 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsl-clamp-1 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120, 200%, 50%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-2.html new file mode 100644 index 0000000000..a5b399a748 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsl-clamp-2 + + + + +

2d.fillStyle.parse.hsl-clamp-2

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-2.worker.js new file mode 100644 index 0000000000..2f1d2d72e6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsl-clamp-2 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120, -200%, 49.9%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 127,127,127,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-3.html new file mode 100644 index 0000000000..cfa6d82382 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsl-clamp-3 + + + + +

2d.fillStyle.parse.hsl-clamp-3

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-3.worker.js new file mode 100644 index 0000000000..4c71d6d140 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsl-clamp-3 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120, 100%, 200%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 255,255,255,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-4.html new file mode 100644 index 0000000000..a3bfd8c22f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsl-clamp-4 + + + + +

2d.fillStyle.parse.hsl-clamp-4

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-4.worker.js new file mode 100644 index 0000000000..e4477f5cb8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsl-clamp-4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsl-clamp-4 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsl(120, 100%, -200%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,0,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-1.html new file mode 100644 index 0000000000..67a65da730 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsla-1 + + + + +

2d.fillStyle.parse.hsla-1

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-1.worker.js new file mode 100644 index 0000000000..c002368227 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsla-1 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-2.html new file mode 100644 index 0000000000..c63fac5dd6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsla-2 + + + + +

2d.fillStyle.parse.hsla-2

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-2.worker.js new file mode 100644 index 0000000000..aca5d8d916 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsla-2 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-1.html new file mode 100644 index 0000000000..ebd766165d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsla-clamp-1 + + + + +

2d.fillStyle.parse.hsla-clamp-1

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-1.worker.js new file mode 100644 index 0000000000..6a29123d95 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsla-clamp-1 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsla(120, 200%, 50%, 1)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-2.html new file mode 100644 index 0000000000..91ec54841c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsla-clamp-2 + + + + +

2d.fillStyle.parse.hsla-clamp-2

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-2.worker.js new file mode 100644 index 0000000000..c27c9f8619 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsla-clamp-2 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-3.html new file mode 100644 index 0000000000..343bf8b2e2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsla-clamp-3 + + + + +

2d.fillStyle.parse.hsla-clamp-3

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-3.worker.js new file mode 100644 index 0000000000..64f459c23f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsla-clamp-3 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsla(120, 100%, 200%, 1)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 255,255,255,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-4.html new file mode 100644 index 0000000000..c54d409934 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsla-clamp-4 + + + + +

2d.fillStyle.parse.hsla-clamp-4

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-4.worker.js new file mode 100644 index 0000000000..b24163a786 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsla-clamp-4 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsla(120, 100%, -200%, 1)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,0,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-5.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-5.html new file mode 100644 index 0000000000..d068ffa921 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-5.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsla-clamp-5 + + + + +

2d.fillStyle.parse.hsla-clamp-5

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-5.worker.js new file mode 100644 index 0000000000..a10af90a0f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-5.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsla-clamp-5 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsla(120, 100%, 50%, 2)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-6.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-6.html new file mode 100644 index 0000000000..f8f0a78f21 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-6.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.hsla-clamp-6 + + + + +

2d.fillStyle.parse.hsla-clamp-6

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-6.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-6.worker.js new file mode 100644 index 0000000000..da6cd93e2a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.hsla-clamp-6.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.hsla-clamp-6 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'hsla(120, 100%, 0%, -2)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.html4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.html4.html new file mode 100644 index 0000000000..fc1c1af18b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.html4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.html4 + + + + +

2d.fillStyle.parse.html4

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.html4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.html4.worker.js new file mode 100644 index 0000000000..7430608f63 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.html4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.html4 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'limE'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-1.html new file mode 100644 index 0000000000..3edffc6d93 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-hsl-1 + + + + +

2d.fillStyle.parse.invalid.css-color-4-hsl-1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-1.worker.js new file mode 100644 index 0000000000..054568e1de --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-hsl-1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + try { ctx.fillStyle = 'hsl(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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-2.html new file mode 100644 index 0000000000..477b318f41 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-hsl-2 + + + + +

2d.fillStyle.parse.invalid.css-color-4-hsl-2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-2.worker.js new file mode 100644 index 0000000000..74d6904f84 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-hsl-2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + try { ctx.fillStyle = 'hsl(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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-3.html new file mode 100644 index 0000000000..e2092666c6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-hsl-3 + + + + +

2d.fillStyle.parse.invalid.css-color-4-hsl-3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-3.worker.js new file mode 100644 index 0000000000..7e930df400 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-hsl-3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-4.html new file mode 100644 index 0000000000..5bcc1755b0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-hsl-4 + + + + +

2d.fillStyle.parse.invalid.css-color-4-hsl-4

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-4.worker.js new file mode 100644 index 0000000000..cca9d52ab1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-hsl-4 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-5.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-5.html new file mode 100644 index 0000000000..ba46540802 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-5.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-hsl-5 + + + + +

2d.fillStyle.parse.invalid.css-color-4-hsl-5

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-5.worker.js new file mode 100644 index 0000000000..5c17b9eeb3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsl-5.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-hsl-5 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-1.html new file mode 100644 index 0000000000..a5f8f3fe9c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-hsla-1 + + + + +

2d.fillStyle.parse.invalid.css-color-4-hsla-1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-1.worker.js new file mode 100644 index 0000000000..1ab7e713d0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-hsla-1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-2.html new file mode 100644 index 0000000000..bd543220d0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-hsla-2 + + + + +

2d.fillStyle.parse.invalid.css-color-4-hsla-2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-2.worker.js new file mode 100644 index 0000000000..9f1aeed563 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-hsla-2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-3.html new file mode 100644 index 0000000000..e33b9415b2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-hsla-3 + + + + +

2d.fillStyle.parse.invalid.css-color-4-hsla-3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-3.worker.js new file mode 100644 index 0000000000..c06a31941b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-hsla-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-hsla-3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + try { ctx.fillStyle = 'hsla(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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-1.html new file mode 100644 index 0000000000..8fbbc7ae51 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-rgb-1 + + + + +

2d.fillStyle.parse.invalid.css-color-4-rgb-1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-1.worker.js new file mode 100644 index 0000000000..a728e8d358 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-rgb-1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-2.html new file mode 100644 index 0000000000..adc8297488 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-rgb-2 + + + + +

2d.fillStyle.parse.invalid.css-color-4-rgb-2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-2.worker.js new file mode 100644 index 0000000000..da9b95c191 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-rgb-2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-3.html new file mode 100644 index 0000000000..4d385d56cc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-rgb-3 + + + + +

2d.fillStyle.parse.invalid.css-color-4-rgb-3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-3.worker.js new file mode 100644 index 0000000000..eee7fb92fd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-rgb-3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-4.html new file mode 100644 index 0000000000..6b855b4357 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-rgb-4 + + + + +

2d.fillStyle.parse.invalid.css-color-4-rgb-4

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-4.worker.js new file mode 100644 index 0000000000..2b25416de7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-rgb-4 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + try { ctx.fillStyle = 'rgb(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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-5.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-5.html new file mode 100644 index 0000000000..13fadb9a24 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-5.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-rgb-5 + + + + +

2d.fillStyle.parse.invalid.css-color-4-rgb-5

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-5.worker.js new file mode 100644 index 0000000000..7932932d93 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgb-5.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-rgb-5 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + try { ctx.fillStyle = 'rgb(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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-1.html new file mode 100644 index 0000000000..5353f77b8f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-rgba-1 + + + + +

2d.fillStyle.parse.invalid.css-color-4-rgba-1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-1.worker.js new file mode 100644 index 0000000000..ef559c45f0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-rgba-1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + try { ctx.fillStyle = 'rgba(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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-2.html new file mode 100644 index 0000000000..aaa555aa05 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-rgba-2 + + + + +

2d.fillStyle.parse.invalid.css-color-4-rgba-2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-2.worker.js new file mode 100644 index 0000000000..7a06f832e8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-rgba-2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + try { ctx.fillStyle = 'rgba(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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-3.html new file mode 100644 index 0000000000..e8c0588851 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.css-color-4-rgba-3 + + + + +

2d.fillStyle.parse.invalid.css-color-4-rgba-3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-3.worker.js new file mode 100644 index 0000000000..65ed246a39 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.css-color-4-rgba-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.css-color-4-rgba-3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex1.html new file mode 100644 index 0000000000..28a7ff4739 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hex1 + + + + +

2d.fillStyle.parse.invalid.hex1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex1.worker.js new file mode 100644 index 0000000000..0cb79048c5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hex1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex2.html new file mode 100644 index 0000000000..0dcf0f8282 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hex2 + + + + +

2d.fillStyle.parse.invalid.hex2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex2.worker.js new file mode 100644 index 0000000000..d2dd193748 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hex2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex3.html new file mode 100644 index 0000000000..8e1bd9fa0f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hex3 + + + + +

2d.fillStyle.parse.invalid.hex3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex3.worker.js new file mode 100644 index 0000000000..805becb3b8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hex3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex4.html new file mode 100644 index 0000000000..f59991d317 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hex4 + + + + +

2d.fillStyle.parse.invalid.hex4

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex4.worker.js new file mode 100644 index 0000000000..1499fb7e13 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hex4 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + try { ctx.fillStyle = '#fg00'; } 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex5.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex5.html new file mode 100644 index 0000000000..9567114a13 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex5.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hex5 + + + + +

2d.fillStyle.parse.invalid.hex5

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex5.worker.js new file mode 100644 index 0000000000..d50daeb4c4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex5.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hex5 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex6.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex6.html new file mode 100644 index 0000000000..b36d0c8654 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex6.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hex6 + + + + +

2d.fillStyle.parse.invalid.hex6

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex6.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex6.worker.js new file mode 100644 index 0000000000..606aa4f458 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex6.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hex6 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex7.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex7.html new file mode 100644 index 0000000000..5b38e7873f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex7.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hex7 + + + + +

2d.fillStyle.parse.invalid.hex7

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex7.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex7.worker.js new file mode 100644 index 0000000000..92ff04a530 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex7.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hex7 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex8.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex8.html new file mode 100644 index 0000000000..1eda0c74a1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex8.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hex8 + + + + +

2d.fillStyle.parse.invalid.hex8

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex8.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex8.worker.js new file mode 100644 index 0000000000..4508cc567c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hex8.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hex8 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + try { ctx.fillStyle = '#fg0000ff'; } 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-1.html new file mode 100644 index 0000000000..9ff3c68fe2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hsl-1 + + + + +

2d.fillStyle.parse.invalid.hsl-1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-1.worker.js new file mode 100644 index 0000000000..e3cbe474b2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hsl-1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-2.html new file mode 100644 index 0000000000..46fac5fd40 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hsl-2 + + + + +

2d.fillStyle.parse.invalid.hsl-2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-2.worker.js new file mode 100644 index 0000000000..56c36f3688 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hsl-2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-3.html new file mode 100644 index 0000000000..1f05e8d944 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hsl-3 + + + + +

2d.fillStyle.parse.invalid.hsl-3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-3.worker.js new file mode 100644 index 0000000000..491b5bdf49 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hsl-3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-4.html new file mode 100644 index 0000000000..dd2cec7977 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hsl-4 + + + + +

2d.fillStyle.parse.invalid.hsl-4

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-4.worker.js new file mode 100644 index 0000000000..fef0f0aee2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hsl-4 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-5.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-5.html new file mode 100644 index 0000000000..909e230b16 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-5.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hsl-5 + + + + +

2d.fillStyle.parse.invalid.hsl-5

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-5.worker.js new file mode 100644 index 0000000000..635e0bf72e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-5.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hsl-5 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-6.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-6.html new file mode 100644 index 0000000000..9bb652c076 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-6.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hsl-6 + + + + +

2d.fillStyle.parse.invalid.hsl-6

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-6.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-6.worker.js new file mode 100644 index 0000000000..efe1aa7ded --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsl-6.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hsl-6 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-1.html new file mode 100644 index 0000000000..9b553c669d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hsla-1 + + + + +

2d.fillStyle.parse.invalid.hsla-1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-1.worker.js new file mode 100644 index 0000000000..757ca911fb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hsla-1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-2.html new file mode 100644 index 0000000000..d894bc42fd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hsla-2 + + + + +

2d.fillStyle.parse.invalid.hsla-2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-2.worker.js new file mode 100644 index 0000000000..be2b2ddf00 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hsla-2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-3.html new file mode 100644 index 0000000000..8901a112b2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.hsla-3 + + + + +

2d.fillStyle.parse.invalid.hsla-3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-3.worker.js new file mode 100644 index 0000000000..52d3707f70 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.hsla-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.hsla-3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-1.html new file mode 100644 index 0000000000..ceb6c53a83 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.name-1 + + + + +

2d.fillStyle.parse.invalid.name-1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-1.worker.js new file mode 100644 index 0000000000..6331a2dfb2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.name-1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-2.html new file mode 100644 index 0000000000..684a665574 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.name-2 + + + + +

2d.fillStyle.parse.invalid.name-2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-2.worker.js new file mode 100644 index 0000000000..101646c995 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.name-2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-3.html new file mode 100644 index 0000000000..ebf508f464 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.name-3 + + + + +

2d.fillStyle.parse.invalid.name-3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-3.worker.js new file mode 100644 index 0000000000..61e43e03d8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.name-3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-4.html new file mode 100644 index 0000000000..ba1f71b123 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.name-4 + + + + +

2d.fillStyle.parse.invalid.name-4

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-4.worker.js new file mode 100644 index 0000000000..b1efecdc57 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.name-4 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + try { ctx.fillStyle = '"red"'; } 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-5.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-5.html new file mode 100644 index 0000000000..a889a387af --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-5.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.name-5 + + + + +

2d.fillStyle.parse.invalid.name-5

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-5.worker.js new file mode 100644 index 0000000000..e519fff426 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.name-5.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.name-5 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + try { ctx.fillStyle = '"red'; } 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-1.html new file mode 100644 index 0000000000..e1fb32a179 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.rgb-1 + + + + +

2d.fillStyle.parse.invalid.rgb-1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-1.worker.js new file mode 100644 index 0000000000..8255f35478 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.rgb-1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-2.html new file mode 100644 index 0000000000..54d7daf999 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.rgb-2 + + + + +

2d.fillStyle.parse.invalid.rgb-2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-2.worker.js new file mode 100644 index 0000000000..c0787e32cb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.rgb-2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-3.html new file mode 100644 index 0000000000..9874fc6f74 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.rgb-3 + + + + +

2d.fillStyle.parse.invalid.rgb-3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-3.worker.js new file mode 100644 index 0000000000..62365ac17a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgb-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.rgb-3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-1.html new file mode 100644 index 0000000000..fbfa4baef2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.rgba-1 + + + + +

2d.fillStyle.parse.invalid.rgba-1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-1.worker.js new file mode 100644 index 0000000000..53063fd9b5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.rgba-1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-2.html new file mode 100644 index 0000000000..43cd1763c1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.rgba-2 + + + + +

2d.fillStyle.parse.invalid.rgba-2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-2.worker.js new file mode 100644 index 0000000000..df7079284c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.rgba-2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-3.html new file mode 100644 index 0000000000..96955226a5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.rgba-3 + + + + +

2d.fillStyle.parse.invalid.rgba-3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-3.worker.js new file mode 100644 index 0000000000..8f45ef582f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.rgba-3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + try { ctx.fillStyle = 'rgba(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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-4.html new file mode 100644 index 0000000000..9334d693ab --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.rgba-4 + + + + +

2d.fillStyle.parse.invalid.rgba-4

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-4.worker.js new file mode 100644 index 0000000000..47549bea5e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.rgba-4 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-5.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-5.html new file mode 100644 index 0000000000..7b53652a94 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-5.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.invalid.rgba-5 + + + + +

2d.fillStyle.parse.invalid.rgba-5

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-5.worker.js new file mode 100644 index 0000000000..562b9661ec --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.invalid.rgba-5.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.invalid.rgba-5 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + try { ctx.fillStyle = 'rgba(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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-1.html new file mode 100644 index 0000000000..c9e9e4c413 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgb-clamp-1 + + + + +

2d.fillStyle.parse.rgb-clamp-1

+

+ +

Assumes colors are clamped to [0,255]. + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-1.worker.js new file mode 100644 index 0000000000..51b81c5bba --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgb-clamp-1 +// Description: +// Note:

Assumes colors are clamped to [0,255]. + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgb(-1000, 1000, -1000)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-2.html new file mode 100644 index 0000000000..98df8d67e4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgb-clamp-2 + + + + +

2d.fillStyle.parse.rgb-clamp-2

+

+ +

Assumes colors are clamped to [0,255]. + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-2.worker.js new file mode 100644 index 0000000000..bfe9102f99 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgb-clamp-2 +// Description: +// Note:

Assumes colors are clamped to [0,255]. + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgb(-200%, 200%, -200%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-3.html new file mode 100644 index 0000000000..70f5ed05f6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgb-clamp-3 + + + + +

2d.fillStyle.parse.rgb-clamp-3

+

+ +

Assumes colors are clamped to [0,255]. + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-3.worker.js new file mode 100644 index 0000000000..809d209348 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgb-clamp-3 +// Description: +// Note:

Assumes colors are clamped to [0,255]. + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgb(-2147483649, 4294967298, -18446744073709551619)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-4.html new file mode 100644 index 0000000000..1f387998e0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgb-clamp-4 + + + + +

2d.fillStyle.parse.rgb-clamp-4

+

+ +

Assumes colors are clamped to [0,255]. + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-4.worker.js new file mode 100644 index 0000000000..c0ec5ec921 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgb-clamp-4 +// Description: +// Note:

Assumes colors are clamped to [0,255]. + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgb(-1000000000000000000000000000000000000000, 1000000000000000000000000000000000000000, -1000000000000000000000000000000000000000)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-5.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-5.html new file mode 100644 index 0000000000..c2ac0b94d2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-5.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgb-clamp-5 + + + + +

2d.fillStyle.parse.rgb-clamp-5

+

+ +

Assumes colors are clamped to [0,255]. + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-5.worker.js new file mode 100644 index 0000000000..ac2692ec4b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-clamp-5.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgb-clamp-5 +// Description: +// Note:

Assumes colors are clamped to [0,255]. + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgb(-10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000, -10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-eof.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-eof.html new file mode 100644 index 0000000000..2979d7da98 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-eof.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgb-eof + + + + +

2d.fillStyle.parse.rgb-eof

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-eof.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-eof.worker.js new file mode 100644 index 0000000000..997df7b03f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-eof.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgb-eof +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgb(0, 255, 0'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-num.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-num.html new file mode 100644 index 0000000000..67ba77f3e3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-num.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgb-num + + + + +

2d.fillStyle.parse.rgb-num

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-num.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-num.worker.js new file mode 100644 index 0000000000..1d54b1f189 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-num.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgb-num +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgb(0,255,0)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-percent.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-percent.html new file mode 100644 index 0000000000..8fe3be55ed --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-percent.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgb-percent + + + + +

2d.fillStyle.parse.rgb-percent

+

+ +

CSS3 Color says "The integer value 255 corresponds to 100%". (In particular, it is not 254...) + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-percent.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-percent.worker.js new file mode 100644 index 0000000000..824376083e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgb-percent.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgb-percent +// Description: +// Note:

CSS3 Color says "The integer value 255 corresponds to 100%". (In particular, it is not 254...) + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgb(0% ,100% ,0%)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-1.html new file mode 100644 index 0000000000..af3acb95e9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgba-clamp-1 + + + + +

2d.fillStyle.parse.rgba-clamp-1

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-1.worker.js new file mode 100644 index 0000000000..e3a5bf56ea --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgba-clamp-1 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgba(0, 255, 0, -2)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-2.html new file mode 100644 index 0000000000..32ee979894 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgba-clamp-2 + + + + +

2d.fillStyle.parse.rgba-clamp-2

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-2.worker.js new file mode 100644 index 0000000000..612c40b675 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-clamp-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgba-clamp-2 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgba(0, 255, 0, 2)'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-eof.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-eof.html new file mode 100644 index 0000000000..baa42cde18 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-eof.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgba-eof + + + + +

2d.fillStyle.parse.rgba-eof

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-eof.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-eof.worker.js new file mode 100644 index 0000000000..73e0b4fd43 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-eof.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgba-eof +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgba(0, 255, 0, 1'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-1.html new file mode 100644 index 0000000000..eaa83e1801 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgba-num-1 + + + + +

2d.fillStyle.parse.rgba-num-1

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-1.worker.js new file mode 100644 index 0000000000..bb1a97fbe7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgba-num-1 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgba( 0 , 255 , 0 , .499 )'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,127); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-2.html new file mode 100644 index 0000000000..47bf3ddced --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgba-num-2 + + + + +

2d.fillStyle.parse.rgba-num-2

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-2.worker.js new file mode 100644 index 0000000000..5629ca5cb2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-num-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgba-num-2 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-percent.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-percent.html new file mode 100644 index 0000000000..068befd9b4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-percent.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgba-percent + + + + +

2d.fillStyle.parse.rgba-percent

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-percent.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-percent.worker.js new file mode 100644 index 0000000000..6d90415325 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-percent.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgba-percent +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-1.html new file mode 100644 index 0000000000..0e58836e5d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgba-solid-1 + + + + +

2d.fillStyle.parse.rgba-solid-1

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-1.worker.js new file mode 100644 index 0000000000..cddedb7d59 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgba-solid-1 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgba( 0 , 255 , 0 , 1 )'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-2.html new file mode 100644 index 0000000000..8da29eeffb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgba-solid-2 + + + + +

2d.fillStyle.parse.rgba-solid-2

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-2.worker.js new file mode 100644 index 0000000000..126cbb9269 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgba-solid-2 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-3.html new file mode 100644 index 0000000000..e67374c541 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-3.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgba-solid-3 + + + + +

2d.fillStyle.parse.rgba-solid-3

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-3.worker.js new file mode 100644 index 0000000000..d8d1513c90 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-3.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgba-solid-3 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgba( 0 , 255 , 0 , +1 )'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-4.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-4.html new file mode 100644 index 0000000000..777aacea70 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-4.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.rgba-solid-4 + + + + +

2d.fillStyle.parse.rgba-solid-4

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-4.worker.js new file mode 100644 index 0000000000..aa516a2d7f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.rgba-solid-4.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.rgba-solid-4 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'rgba( -0 , 255 , +0 , 1 )'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-1.html new file mode 100644 index 0000000000..8dc6844ae9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.svg-1 + + + + +

2d.fillStyle.parse.svg-1

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-1.worker.js new file mode 100644 index 0000000000..e8660caf6d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.svg-1 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'gray'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 128,128,128,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-2.html new file mode 100644 index 0000000000..2833565006 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.svg-2 + + + + +

2d.fillStyle.parse.svg-2

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-2.worker.js new file mode 100644 index 0000000000..3488200d86 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.svg-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.svg-2 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'grey'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 128,128,128,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.system.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.system.html new file mode 100644 index 0000000000..6e124062b1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.system.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.system + + + + +

2d.fillStyle.parse.system

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.system.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.system.worker.js new file mode 100644 index 0000000000..cf62855af9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.system.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.system +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'ThreeDDarkShadow'; + assert_regexp_match(ctx.fillStyle, /^#(?!(FF0000|ff0000|f00)$)/); // test that it's not red + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-1.html new file mode 100644 index 0000000000..a595d70bc0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.transparent-1 + + + + +

2d.fillStyle.parse.transparent-1

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-1.worker.js new file mode 100644 index 0000000000..7f9a975bc1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.transparent-1 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'transparent'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-2.html new file mode 100644 index 0000000000..0f2a7e0609 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-2.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.fillStyle.parse.transparent-2 + + + + +

2d.fillStyle.parse.transparent-2

+

+ +

+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-2.worker.js new file mode 100644 index 0000000000..794ca926dd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.parse.transparent-2.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.parse.transparent-2 +// Description: +// Note:

+ +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillStyle = 'TrAnSpArEnT'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,0,0,0); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.toStringFunctionCallback.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.toStringFunctionCallback.html new file mode 100644 index 0000000000..3e56bd2b62 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.toStringFunctionCallback.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.fillStyle.toStringFunctionCallback + + + + +

2d.fillStyle.toStringFunctionCallback

+

Passing a function in to ctx.fillStyle or ctx.strokeStyle with a toString callback works as specified

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.toStringFunctionCallback.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.toStringFunctionCallback.worker.js new file mode 100644 index 0000000000..3ae93092b8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.fillStyle.toStringFunctionCallback.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.fillStyle.toStringFunctionCallback +// Description:Passing a function in to ctx.fillStyle or ctx.strokeStyle with a toString callback works as specified +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Passing a function in to ctx.fillStyle or ctx.strokeStyle with a toString callback works as specified"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = { toString: function() { return "#008000"; } }; + _assertSame(ctx.fillStyle, "#008000", "ctx.fillStyle", "\"#008000\""); + ctx.fillStyle = {}; + _assertSame(ctx.fillStyle, "#008000", "ctx.fillStyle", "\"#008000\""); + ctx.fillStyle = 800000; + _assertSame(ctx.fillStyle, "#008000", "ctx.fillStyle", "\"#008000\""); + assert_throws_js(TypeError, function() { ctx.fillStyle = { toString: function() { throw new TypeError; } }; }); + ctx.strokeStyle = { toString: function() { return "#008000"; } }; + _assertSame(ctx.strokeStyle, "#008000", "ctx.strokeStyle", "\"#008000\""); + ctx.strokeStyle = {}; + _assertSame(ctx.strokeStyle, "#008000", "ctx.strokeStyle", "\"#008000\""); + ctx.strokeStyle = 800000; + _assertSame(ctx.strokeStyle, "#008000", "ctx.strokeStyle", "\"#008000\""); + assert_throws_js(TypeError, function() { ctx.strokeStyle = { toString: function() { throw new TypeError; } }; }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.invalid.inputs.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.invalid.inputs.html new file mode 100644 index 0000000000..5ccb19e09c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.invalid.inputs.html @@ -0,0 +1,45 @@ + + +OffscreenCanvas test: 2d.gradient.conic.invalid.inputs + + + + +

2d.gradient.conic.invalid.inputs

+

Conic gradient function with invalid inputs

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.invalid.inputs.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.invalid.inputs.worker.js new file mode 100644 index 0000000000..19b603ea75 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.invalid.inputs.worker.js @@ -0,0 +1,40 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.conic.invalid.inputs +// Description:Conic gradient function with invalid inputs +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Conic gradient function with invalid inputs"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { ctx.createConicGradient(Infinity, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createConicGradient(-Infinity, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createConicGradient(NaN, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createConicGradient(0, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createConicGradient(0, -Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createConicGradient(0, NaN, 1); }); + assert_throws_js(TypeError, function() { ctx.createConicGradient(0, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createConicGradient(0, 0, -Infinity); }); + assert_throws_js(TypeError, function() { ctx.createConicGradient(0, 0, NaN); }); + assert_throws_js(TypeError, function() { ctx.createConicGradient(Infinity, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createConicGradient(Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createConicGradient(Infinity, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createConicGradient(0, Infinity, Infinity); }); + + const g = ctx.createConicGradient(0, 0, 25); + assert_throws_js(TypeError, function() { g.addColorStop(-Infinity, '#f00'); }); + assert_throws_js(TypeError, function() { g.addColorStop(NaN, '#f00'); }); + assert_throws_dom("SYNTAX_ERR", function() { g.addColorStop(0, -Infinity); }); + assert_throws_dom("SYNTAX_ERR", function() { g.addColorStop(0, NaN); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.negative.rotation.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.negative.rotation.html new file mode 100644 index 0000000000..848f1496ea --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.negative.rotation.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.gradient.conic.negative.rotation + + + + +

2d.gradient.conic.negative.rotation

+

Conic gradient with negative rotation

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.negative.rotation.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.negative.rotation.worker.js new file mode 100644 index 0000000000..1f9735ee08 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.negative.rotation.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.conic.negative.rotation +// Description:Conic gradient with negative rotation +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Conic gradient with negative rotation"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const g = ctx.createConicGradient(-Math.PI/2, 50, 25); + // It's red in the upper right region and green on the lower left region + g.addColorStop(0, "#f00"); + g.addColorStop(0.25, "#0f0"); + g.addColorStop(0.50, "#0f0"); + g.addColorStop(0.75, "#f00"); + ctx.fillStyle = g; + ctx.fillRect(0, 0, 100, 50); + _assertPixelApprox(canvas, 25,15, 255,0,0,255, 3); + _assertPixelApprox(canvas, 75,40, 0,255,0,255, 3); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.positive.rotation.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.positive.rotation.html new file mode 100644 index 0000000000..06b593904f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.positive.rotation.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.gradient.conic.positive.rotation + + + + +

2d.gradient.conic.positive.rotation

+

Conic gradient with positive rotation

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.positive.rotation.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.positive.rotation.worker.js new file mode 100644 index 0000000000..45bbf40313 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.conic.positive.rotation.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.conic.positive.rotation +// Description:Conic gradient with positive rotation +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Conic gradient with positive rotation"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const g = ctx.createConicGradient(3*Math.PI/2, 50, 25); + // It's red in the upper right region and green on the lower left region + g.addColorStop(0, "#f00"); + g.addColorStop(0.25, "#0f0"); + g.addColorStop(0.50, "#0f0"); + g.addColorStop(0.75, "#f00"); + ctx.fillStyle = g; + ctx.fillRect(0, 0, 100, 50); + _assertPixelApprox(canvas, 25,15, 255,0,0,255, 3); + _assertPixelApprox(canvas, 75,40, 0,255,0,255, 3); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.empty.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.empty.html new file mode 100644 index 0000000000..bad1ff4767 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.empty.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.gradient.empty + + + + +

2d.gradient.empty

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.empty.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.empty.worker.js new file mode 100644 index 0000000000..225de25823 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.empty.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.empty +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.alpha.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.alpha.html new file mode 100644 index 0000000000..525cb79e03 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.alpha.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.gradient.interpolate.alpha + + + + +

2d.gradient.interpolate.alpha

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.alpha.png b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.alpha.png new file mode 100644 index 0000000000..af5ac0f07d Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.alpha.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.alpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.alpha.worker.js new file mode 100644 index 0000000000..5c2f7e07b6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.alpha.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.interpolate.alpha +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 3); + _assertPixelApprox(canvas, 50,25, 127,127,127,255, 3); + _assertPixelApprox(canvas, 75,25, 63,63,191,255, 3); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.color.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.color.html new file mode 100644 index 0000000000..c742eff2f9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.color.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.gradient.interpolate.color + + + + +

2d.gradient.interpolate.color

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.color.png b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.color.png new file mode 100644 index 0000000000..af5ac0f07d Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.color.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.color.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.color.worker.js new file mode 100644 index 0000000000..6d273b7b43 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.color.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.interpolate.color +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 3); + _assertPixelApprox(canvas, 50,25, 127,127,127,255, 3); + _assertPixelApprox(canvas, 75,25, 63,63,191,255, 3); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.html new file mode 100644 index 0000000000..00575c399a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.gradient.interpolate.coloralpha + + + + +

2d.gradient.interpolate.coloralpha

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.png b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.png new file mode 100644 index 0000000000..552e6ee44b Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.worker.js new file mode 100644 index 0000000000..1462cb59e2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.coloralpha.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.interpolate.coloralpha +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 190,190,65,65, 3); + _assertPixelApprox(canvas, 50,25, 126,126,128,128, 3); + _assertPixelApprox(canvas, 75,25, 62,62,192,192, 3); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.multiple.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.multiple.html new file mode 100644 index 0000000000..3f2594f2cb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.multiple.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.gradient.interpolate.multiple + + + + +

2d.gradient.interpolate.multiple

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.multiple.png b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.multiple.png new file mode 100644 index 0000000000..86122450d3 Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.multiple.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.multiple.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.multiple.worker.js new file mode 100644 index 0000000000..ebfcddca9f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.multiple.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.interpolate.multiple +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 3); + _assertPixelApprox(canvas, 100,25, 0,255,255,255, 3); + _assertPixelApprox(canvas, 150,25, 127,127,255,255, 3); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.outside.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.outside.html new file mode 100644 index 0000000000..02ca008518 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.outside.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.gradient.interpolate.outside + + + + +

2d.gradient.interpolate.outside

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.outside.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.outside.worker.js new file mode 100644 index 0000000000..d6c8961661 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.outside.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.interpolate.outside +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 80,25, 0,255,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html new file mode 100644 index 0000000000..0139da177a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap.html @@ -0,0 +1,52 @@ + + +OffscreenCanvas test: 2d.gradient.interpolate.overlap + + + + +

2d.gradient.interpolate.overlap

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap.png b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap.png new file mode 100644 index 0000000000..5c2bb964e0 Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap.worker.js new file mode 100644 index 0000000000..d404deab26 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap.worker.js @@ -0,0 +1,47 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.interpolate.overlap +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 16); + _assertPixelApprox(canvas, 51,25, 255,255,0,255, 16); + _assertPixelApprox(canvas, 99,25, 0,0,255,255, 16); + _assertPixelApprox(canvas, 101,25, 255,255,0,255, 16); + _assertPixelApprox(canvas, 149,25, 0,0,255,255, 16); + _assertPixelApprox(canvas, 151,25, 255,255,0,255, 16); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap2.html new file mode 100644 index 0000000000..c26c8ecb78 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap2.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.gradient.interpolate.overlap2 + + + + +

2d.gradient.interpolate.overlap2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap2.worker.js new file mode 100644 index 0000000000..3938081cef --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.overlap2.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.interpolate.overlap2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 30,25, 0,255,0,255); + _assertPixel(canvas, 40,25, 0,255,0,255); + _assertPixel(canvas, 60,25, 0,255,0,255); + _assertPixel(canvas, 80,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.solid.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.solid.html new file mode 100644 index 0000000000..dd369ae5e3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.solid.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.gradient.interpolate.solid + + + + +

2d.gradient.interpolate.solid

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.solid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.solid.worker.js new file mode 100644 index 0000000000..387aab0ab7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.solid.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.interpolate.solid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.vertical.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.vertical.html new file mode 100644 index 0000000000..dff5708f05 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.vertical.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.gradient.interpolate.vertical + + + + +

2d.gradient.interpolate.vertical

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.vertical.png b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.vertical.png new file mode 100644 index 0000000000..37d6a00c62 Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.vertical.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.vertical.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.vertical.worker.js new file mode 100644 index 0000000000..61cf9b6d8e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.vertical.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.interpolate.vertical +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 10); + _assertPixelApprox(canvas, 50,25, 127,127,127,255, 5); + _assertPixelApprox(canvas, 50,37, 63,63,191,255, 10); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fill.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fill.html new file mode 100644 index 0000000000..27579fc829 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fill.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.gradient.interpolate.zerosize.fill + + + + +

2d.gradient.interpolate.zerosize.fill

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fill.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fill.worker.js new file mode 100644 index 0000000000..916b1cb977 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fill.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.interpolate.zerosize.fill +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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.rect(0, 0, 100, 50); + ctx.fill(); + _assertPixel(canvas, 40,20, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillRect.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillRect.html new file mode 100644 index 0000000000..9cf2c7350f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillRect.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.gradient.interpolate.zerosize.fillRect + + + + +

2d.gradient.interpolate.zerosize.fillRect

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillRect.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillRect.worker.js new file mode 100644 index 0000000000..607ad85ae7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillRect.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.interpolate.zerosize.fillRect +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 40,20, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillText.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillText.html new file mode 100644 index 0000000000..59f0964461 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillText.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.gradient.interpolate.zerosize.fillText + + + + +

2d.gradient.interpolate.zerosize.fillText

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillText.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillText.worker.js new file mode 100644 index 0000000000..417b564e6d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.fillText.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.interpolate.zerosize.fillText +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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.font = '100px sans-serif'; + ctx.fillText("AA", 0, 50); + _assertGreen(ctx, 100, 50); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.stroke.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.stroke.html new file mode 100644 index 0000000000..562f46796c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.stroke.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.gradient.interpolate.zerosize.stroke + + + + +

2d.gradient.interpolate.zerosize.stroke

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.stroke.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.stroke.worker.js new file mode 100644 index 0000000000..b969be6f85 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.stroke.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.interpolate.zerosize.stroke +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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.strokeStyle = g; + ctx.rect(20, 20, 60, 10); + ctx.stroke(); + _assertPixel(canvas, 19,19, 0,255,0,255); + _assertPixel(canvas, 20,19, 0,255,0,255); + _assertPixel(canvas, 21,19, 0,255,0,255); + _assertPixel(canvas, 19,20, 0,255,0,255); + _assertPixel(canvas, 20,20, 0,255,0,255); + _assertPixel(canvas, 21,20, 0,255,0,255); + _assertPixel(canvas, 19,21, 0,255,0,255); + _assertPixel(canvas, 20,21, 0,255,0,255); + _assertPixel(canvas, 21,21, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeRect.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeRect.html new file mode 100644 index 0000000000..de1e57bbcc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeRect.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.gradient.interpolate.zerosize.strokeRect + + + + +

2d.gradient.interpolate.zerosize.strokeRect

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeRect.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeRect.worker.js new file mode 100644 index 0000000000..b9884d4adf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeRect.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.interpolate.zerosize.strokeRect +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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.strokeStyle = g; + ctx.strokeRect(20, 20, 60, 10); + _assertPixel(canvas, 19,19, 0,255,0,255); + _assertPixel(canvas, 20,19, 0,255,0,255); + _assertPixel(canvas, 21,19, 0,255,0,255); + _assertPixel(canvas, 19,20, 0,255,0,255); + _assertPixel(canvas, 20,20, 0,255,0,255); + _assertPixel(canvas, 21,20, 0,255,0,255); + _assertPixel(canvas, 19,21, 0,255,0,255); + _assertPixel(canvas, 20,21, 0,255,0,255); + _assertPixel(canvas, 21,21, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeText.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeText.html new file mode 100644 index 0000000000..153ec102ac --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeText.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.gradient.interpolate.zerosize.strokeText + + + + +

2d.gradient.interpolate.zerosize.strokeText

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeText.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeText.worker.js new file mode 100644 index 0000000000..f0d7192627 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.interpolate.zerosize.strokeText.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.interpolate.zerosize.strokeText +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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.strokeStyle = g; + ctx.font = '100px sans-serif'; + ctx.strokeText("AA", 0, 50); + _assertGreen(ctx, 100, 50); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.nonfinite.html new file mode 100644 index 0000000000..6c8f8ec38a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.nonfinite.html @@ -0,0 +1,49 @@ + + +OffscreenCanvas test: 2d.gradient.linear.nonfinite + + + + +

2d.gradient.linear.nonfinite

+

createLinearGradient() throws TypeError if arguments are not finite

+ +

Defined in "Web IDL" (draft) + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.nonfinite.worker.js new file mode 100644 index 0000000000..9fd4949d7d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.nonfinite.worker.js @@ -0,0 +1,44 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.linear.nonfinite +// Description:createLinearGradient() throws TypeError if arguments are not finite +// Note:

Defined in "Web IDL" (draft) + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createLinearGradient() throws TypeError if arguments are not finite"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, 0, 1, 0); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(-Infinity, 0, 1, 0); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(NaN, 0, 1, 0); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, Infinity, 1, 0); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, -Infinity, 1, 0); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, NaN, 1, 0); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, Infinity, 0); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, -Infinity, 0); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, NaN, 0); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, 1, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, 1, -Infinity); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, 1, NaN); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, Infinity, 1, 0); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, Infinity, Infinity, 0); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, Infinity, 1, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, 0, Infinity, 0); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, 0, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(Infinity, 0, 1, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, Infinity, Infinity, 0); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, Infinity, 1, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createLinearGradient(0, 0, Infinity, Infinity); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.1.html new file mode 100644 index 0000000000..69fc52cedd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.1.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.gradient.linear.transform.1 + + + + +

2d.gradient.linear.transform.1

+

Linear gradient coordinates are relative to the coordinate space at the time of filling

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.1.worker.js new file mode 100644 index 0000000000..79cdc96da8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.1.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.linear.transform.1 +// Description:Linear gradient coordinates are relative to the coordinate space at the time of filling +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Linear gradient coordinates are relative to the coordinate space at the time of filling"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.2.html new file mode 100644 index 0000000000..5cf27f1d8e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.2.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.gradient.linear.transform.2 + + + + +

2d.gradient.linear.transform.2

+

Linear gradient coordinates are relative to the coordinate space at the time of filling

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.2.worker.js new file mode 100644 index 0000000000..a2b532d1f9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.2.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.linear.transform.2 +// Description:Linear gradient coordinates are relative to the coordinate space at the time of filling +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Linear gradient coordinates are relative to the coordinate space at the time of filling"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.3.html new file mode 100644 index 0000000000..074722a49b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.3.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.gradient.linear.transform.3 + + + + +

2d.gradient.linear.transform.3

+

Linear gradient transforms do not experience broken caching effects

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.3.worker.js new file mode 100644 index 0000000000..77df9495c3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.linear.transform.3.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.linear.transform.3 +// Description:Linear gradient transforms do not experience broken caching effects +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Linear gradient transforms do not experience broken caching effects"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.compare.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.compare.html new file mode 100644 index 0000000000..d923a2f552 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.compare.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.gradient.object.compare + + + + +

2d.gradient.object.compare

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.compare.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.compare.worker.js new file mode 100644 index 0000000000..f6d45d259f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.compare.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.object.compare +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.crosscanvas.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.crosscanvas.html new file mode 100644 index 0000000000..6d229ea3d5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.crosscanvas.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.gradient.object.crosscanvas + + + + +

2d.gradient.object.crosscanvas

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.crosscanvas.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.crosscanvas.worker.js new file mode 100644 index 0000000000..1afebdea1b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.crosscanvas.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.object.crosscanvas +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + var g = new OffscreenCanvas(100, 50).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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidcolor.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidcolor.html new file mode 100644 index 0000000000..3db5afeeb5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidcolor.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.gradient.object.invalidcolor + + + + +

2d.gradient.object.invalidcolor

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidcolor.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidcolor.worker.js new file mode 100644 index 0000000000..33b524fbed --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidcolor.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.object.invalidcolor +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var g = ctx.createLinearGradient(0, 0, 100, 0); + assert_throws_dom("SYNTAX_ERR", function() { g.addColorStop(0, ""); }); + assert_throws_dom("SYNTAX_ERR", function() { g.addColorStop(0, 'rgb(NaN%, NaN%, NaN%)'); }); + assert_throws_dom("SYNTAX_ERR", function() { g.addColorStop(0, 'null'); }); + assert_throws_dom("SYNTAX_ERR", function() { g.addColorStop(0, 'undefined'); }); + assert_throws_dom("SYNTAX_ERR", function() { g.addColorStop(0, null); }); + assert_throws_dom("SYNTAX_ERR", function() { g.addColorStop(0, undefined); }); + + var g = ctx.createRadialGradient(0, 0, 0, 100, 0, 0); + assert_throws_dom("SYNTAX_ERR", function() { g.addColorStop(0, ""); }); + assert_throws_dom("SYNTAX_ERR", function() { g.addColorStop(0, 'rgb(NaN%, NaN%, NaN%)'); }); + assert_throws_dom("SYNTAX_ERR", function() { g.addColorStop(0, 'null'); }); + assert_throws_dom("SYNTAX_ERR", function() { g.addColorStop(0, 'undefined'); }); + assert_throws_dom("SYNTAX_ERR", function() { g.addColorStop(0, null); }); + assert_throws_dom("SYNTAX_ERR", function() { g.addColorStop(0, undefined); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidoffset.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidoffset.html new file mode 100644 index 0000000000..b9f1104254 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidoffset.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.gradient.object.invalidoffset + + + + +

2d.gradient.object.invalidoffset

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidoffset.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidoffset.worker.js new file mode 100644 index 0000000000..80be64235b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.invalidoffset.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.object.invalidoffset +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var g = ctx.createLinearGradient(0, 0, 100, 0); + assert_throws_dom("INDEX_SIZE_ERR", function() { g.addColorStop(-1, '#000'); }); + assert_throws_dom("INDEX_SIZE_ERR", function() { g.addColorStop(2, '#000'); }); + assert_throws_js(TypeError, function() { g.addColorStop(Infinity, '#000'); }); + assert_throws_js(TypeError, function() { g.addColorStop(-Infinity, '#000'); }); + assert_throws_js(TypeError, function() { g.addColorStop(NaN, '#000'); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.return.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.return.html new file mode 100644 index 0000000000..779b941d20 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.return.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.gradient.object.return + + + + +

2d.gradient.object.return

+

createLinearGradient() and createRadialGradient() returns objects implementing CanvasGradient

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.return.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.return.worker.js new file mode 100644 index 0000000000..a279eed4f3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.return.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.object.return +// Description:createLinearGradient() and createRadialGradient() returns objects implementing CanvasGradient +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createLinearGradient() and createRadialGradient() returns objects implementing CanvasGradient"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + self.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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.type.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.type.html new file mode 100644 index 0000000000..aa72183ca5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.type.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.gradient.object.type + + + + +

2d.gradient.object.type

+

window.CanvasGradient exists and has the right properties

+ +

Defined in "Web IDL" (draft) + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.type.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.type.worker.js new file mode 100644 index 0000000000..e0101dfca4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.type.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.object.type +// Description:window.CanvasGradient exists and has the right properties +// Note:

Defined in "Web IDL" (draft) + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("window.CanvasGradient exists and has the right properties"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertDifferent(self.CanvasGradient, undefined, "self.CanvasGradient", "undefined"); + _assertDifferent(self.CanvasGradient.prototype.addColorStop, undefined, "self.CanvasGradient.prototype.addColorStop", "undefined"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.update.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.update.html new file mode 100644 index 0000000000..00c60041e7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.update.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.gradient.object.update + + + + +

2d.gradient.object.update

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.update.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.update.worker.js new file mode 100644 index 0000000000..db79ebfa2f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.object.update.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.object.update +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var g = ctx.createLinearGradient(-100, 0, 200, 0); + g.addColorStop(0, '#f00'); + g.addColorStop(1, '#f00'); + ctx.fillStyle = g; + ctx.fillRect(0, 0, 100, 50); + g.addColorStop(0.1, '#0f0'); + g.addColorStop(0.9, '#0f0'); + ctx.fillRect(0, 0, 100, 50); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.behind.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.behind.html new file mode 100644 index 0000000000..c270a75175 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.behind.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.gradient.radial.cone.behind + + + + +

2d.gradient.radial.cone.behind

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.behind.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.behind.worker.js new file mode 100644 index 0000000000..07ea409ad8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.behind.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.cone.behind +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.beside.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.beside.html new file mode 100644 index 0000000000..89d8757bde --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.beside.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.gradient.radial.cone.beside + + + + +

2d.gradient.radial.cone.beside

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.beside.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.beside.worker.js new file mode 100644 index 0000000000..686721cbc6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.beside.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.cone.beside +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.bottom.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.bottom.html new file mode 100644 index 0000000000..cda6743f66 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.bottom.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.gradient.radial.cone.bottom + + + + +

2d.gradient.radial.cone.bottom

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.bottom.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.bottom.worker.js new file mode 100644 index 0000000000..c96b9c59f2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.bottom.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.cone.bottom +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.cylinder.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.cylinder.html new file mode 100644 index 0000000000..a6f1d67619 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.cylinder.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.gradient.radial.cone.cylinder + + + + +

2d.gradient.radial.cone.cylinder

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.cylinder.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.cylinder.worker.js new file mode 100644 index 0000000000..22e6cb49ce --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.cylinder.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.cone.cylinder +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.front.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.front.html new file mode 100644 index 0000000000..5cda039e94 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.front.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.gradient.radial.cone.front + + + + +

2d.gradient.radial.cone.front

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.front.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.front.worker.js new file mode 100644 index 0000000000..c4e70f53c9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.front.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.cone.front +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape1.html new file mode 100644 index 0000000000..290923b5e5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape1.html @@ -0,0 +1,53 @@ + + +OffscreenCanvas test: 2d.gradient.radial.cone.shape1 + + + + +

2d.gradient.radial.cone.shape1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape1.worker.js new file mode 100644 index 0000000000..d03c0db23c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape1.worker.js @@ -0,0 +1,48 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.cone.shape1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.html new file mode 100644 index 0000000000..edf1909ac1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.html @@ -0,0 +1,53 @@ + + +OffscreenCanvas test: 2d.gradient.radial.cone.shape2 + + + + +

2d.gradient.radial.cone.shape2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.worker.js new file mode 100644 index 0000000000..8788954a3c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.shape2.worker.js @@ -0,0 +1,48 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.cone.shape2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.top.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.top.html new file mode 100644 index 0000000000..9487c8c931 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.top.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.gradient.radial.cone.top + + + + +

2d.gradient.radial.cone.top

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.top.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.top.worker.js new file mode 100644 index 0000000000..6fc834373a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.cone.top.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.cone.top +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.equal.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.equal.html new file mode 100644 index 0000000000..b14b44fe30 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.equal.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.gradient.radial.equal + + + + +

2d.gradient.radial.equal

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.equal.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.equal.worker.js new file mode 100644 index 0000000000..c8e6095805 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.equal.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.equal +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside1.html new file mode 100644 index 0000000000..a55f0a1104 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside1.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.gradient.radial.inside1 + + + + +

2d.gradient.radial.inside1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside1.worker.js new file mode 100644 index 0000000000..5da290a7ce --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside1.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.inside1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside2.html new file mode 100644 index 0000000000..3a7af0658b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside2.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.gradient.radial.inside2 + + + + +

2d.gradient.radial.inside2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside2.worker.js new file mode 100644 index 0000000000..dd49fa3771 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside2.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.inside2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside3.html new file mode 100644 index 0000000000..3a539e6b63 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside3.html @@ -0,0 +1,45 @@ + + +OffscreenCanvas test: 2d.gradient.radial.inside3 + + + + +

2d.gradient.radial.inside3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside3.worker.js new file mode 100644 index 0000000000..0d05bf4d5b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.inside3.worker.js @@ -0,0 +1,40 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.inside3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.negative.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.negative.html new file mode 100644 index 0000000000..b6dcaf175e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.negative.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.gradient.radial.negative + + + + +

2d.gradient.radial.negative

+

createRadialGradient() throws INDEX_SIZE_ERR if either radius is negative

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.negative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.negative.worker.js new file mode 100644 index 0000000000..72ad3f803e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.negative.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.negative +// Description:createRadialGradient() throws INDEX_SIZE_ERR if either radius is negative +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createRadialGradient() throws INDEX_SIZE_ERR if either radius is negative"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.createRadialGradient(0, 0, -0.1, 0, 0, 1); }); + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.createRadialGradient(0, 0, 1, 0, 0, -0.1); }); + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.createRadialGradient(0, 0, -0.1, 0, 0, -0.1); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.nonfinite.html new file mode 100644 index 0000000000..4f068bbda5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.nonfinite.html @@ -0,0 +1,101 @@ + + +OffscreenCanvas test: 2d.gradient.radial.nonfinite + + + + +

2d.gradient.radial.nonfinite

+

createRadialGradient() throws TypeError if arguments are not finite

+ +

Defined in "Web IDL" (draft) + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.nonfinite.worker.js new file mode 100644 index 0000000000..641a341ecc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.nonfinite.worker.js @@ -0,0 +1,96 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.nonfinite +// Description:createRadialGradient() throws TypeError if arguments are not finite +// Note:

Defined in "Web IDL" (draft) + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createRadialGradient() throws TypeError if arguments are not finite"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(-Infinity, 0, 1, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(NaN, 0, 1, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, -Infinity, 1, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, NaN, 1, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, -Infinity, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, NaN, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, Infinity, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, -Infinity, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, NaN, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, -Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, NaN, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, 0, -Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, 0, NaN); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, Infinity, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, Infinity, 0, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, Infinity, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, Infinity, 1, 0, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, Infinity, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, Infinity, 0, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, Infinity, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, 0, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(Infinity, 0, 1, 0, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, Infinity, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, Infinity, 0, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, Infinity, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, 0, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, Infinity, 1, 0, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, Infinity, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, 0, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, Infinity, 0, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, 1); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, Infinity, 0, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createRadialGradient(0, 0, 1, 0, Infinity, Infinity); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside1.html new file mode 100644 index 0000000000..2643c67170 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside1.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.gradient.radial.outside1 + + + + +

2d.gradient.radial.outside1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside1.worker.js new file mode 100644 index 0000000000..52d45093ba --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside1.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.outside1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside2.html new file mode 100644 index 0000000000..423de4491d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside2.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.gradient.radial.outside2 + + + + +

2d.gradient.radial.outside2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside2.worker.js new file mode 100644 index 0000000000..861dcccbe3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside2.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.outside2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside3.html new file mode 100644 index 0000000000..61df3dccfe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside3.html @@ -0,0 +1,45 @@ + + +OffscreenCanvas test: 2d.gradient.radial.outside3 + + + + +

2d.gradient.radial.outside3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside3.worker.js new file mode 100644 index 0000000000..db65ea1b8b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.outside3.worker.js @@ -0,0 +1,40 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.outside3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch1.html new file mode 100644 index 0000000000..86e2af1428 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch1.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.gradient.radial.touch1 + + + + +

2d.gradient.radial.touch1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch1.worker.js new file mode 100644 index 0000000000..dd8d727209 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch1.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.touch1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch2.html new file mode 100644 index 0000000000..b0ff86ad05 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch2.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.gradient.radial.touch2 + + + + +

2d.gradient.radial.touch2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch2.worker.js new file mode 100644 index 0000000000..ad6bc9d897 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch2.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.touch2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch3.html new file mode 100644 index 0000000000..5e085fd998 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch3.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.gradient.radial.touch3 + + + + +

2d.gradient.radial.touch3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch3.worker.js new file mode 100644 index 0000000000..540e9a7ed4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.touch3.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.touch3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 1); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixelApprox(canvas, 50,48, 0,255,0,255, 1); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.1.html new file mode 100644 index 0000000000..517c9e3288 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.1.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.gradient.radial.transform.1 + + + + +

2d.gradient.radial.transform.1

+

Radial gradient coordinates are relative to the coordinate space at the time of filling

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.1.worker.js new file mode 100644 index 0000000000..198dab1fce --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.1.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.transform.1 +// Description:Radial gradient coordinates are relative to the coordinate space at the time of filling +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Radial gradient coordinates are relative to the coordinate space at the time of filling"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.2.html new file mode 100644 index 0000000000..f7f4120a92 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.2.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.gradient.radial.transform.2 + + + + +

2d.gradient.radial.transform.2

+

Radial gradient coordinates are relative to the coordinate space at the time of filling

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.2.worker.js new file mode 100644 index 0000000000..27793b90ab --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.2.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.transform.2 +// Description:Radial gradient coordinates are relative to the coordinate space at the time of filling +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Radial gradient coordinates are relative to the coordinate space at the time of filling"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.3.html new file mode 100644 index 0000000000..e0ac17fa82 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.3.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.gradient.radial.transform.3 + + + + +

2d.gradient.radial.transform.3

+

Radial gradient transforms do not experience broken caching effects

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.3.worker.js new file mode 100644 index 0000000000..1b74d8b4d7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.gradient.radial.transform.3.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.gradient.radial.transform.3 +// Description:Radial gradient transforms do not experience broken caching effects +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Radial gradient transforms do not experience broken caching effects"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.canvas.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.canvas.html new file mode 100644 index 0000000000..f82a259e43 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.canvas.html @@ -0,0 +1,47 @@ + + +OffscreenCanvas test: 2d.pattern.basic.canvas + + + + +

2d.pattern.basic.canvas

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.canvas.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.canvas.worker.js new file mode 100644 index 0000000000..510723f009 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.canvas.worker.js @@ -0,0 +1,42 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.basic.canvas +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + + var canvas2 = new OffscreenCanvas(100, 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 98,25, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 50,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.image.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.image.html new file mode 100644 index 0000000000..ab7b7bbeb5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.image.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.pattern.basic.image + + + + +

2d.pattern.basic.image

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.image.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.image.worker.js new file mode 100644 index 0000000000..14cfcbc993 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.image.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.basic.image +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + var response = await fetch('/images/green.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + var pattern = ctx.createPattern(img, 'no-repeat'); + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 100, 50); + + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.nocontext.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.nocontext.html new file mode 100644 index 0000000000..66e301a002 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.nocontext.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.pattern.basic.nocontext + + + + +

2d.pattern.basic.nocontext

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.nocontext.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.nocontext.worker.js new file mode 100644 index 0000000000..f6c24c82ca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.nocontext.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.basic.nocontext +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var canvas2 = new OffscreenCanvas(100, 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.type.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.type.html new file mode 100644 index 0000000000..1edb4fd227 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.type.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.pattern.basic.type + + + + +

2d.pattern.basic.type

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.type.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.type.worker.js new file mode 100644 index 0000000000..56a8a7d23c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.type.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.basic.type +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertDifferent(self.CanvasPattern, undefined, "self.CanvasPattern", "undefined"); + + self.CanvasPattern.prototype.thisImplementsCanvasPattern = true; + + var response = await fetch('/images/green.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + var pattern = ctx.createPattern(img, 'no-repeat'); + _assert(pattern.thisImplementsCanvasPattern, "pattern.thisImplementsCanvasPattern"); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.zerocanvas.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.zerocanvas.html new file mode 100644 index 0000000000..7100c8313f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.zerocanvas.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.pattern.basic.zerocanvas + + + + +

2d.pattern.basic.zerocanvas

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.zerocanvas.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.zerocanvas.worker.js new file mode 100644 index 0000000000..9bf487cf74 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.basic.zerocanvas.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.basic.zerocanvas +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 0; + canvas.height = 10; + _assertSame(canvas.width, 0, "canvas.width", "0"); + _assertSame(canvas.height, 10, "canvas.height", "10"); + assert_throws_dom("INVALID_STATE_ERR", function() { ctx.createPattern(canvas, 'repeat'); }); + + canvas.width = 10; + canvas.height = 0; + _assertSame(canvas.width, 10, "canvas.width", "10"); + _assertSame(canvas.height, 0, "canvas.height", "0"); + assert_throws_dom("INVALID_STATE_ERR", function() { ctx.createPattern(canvas, 'repeat'); }); + + canvas.width = 0; + canvas.height = 0; + _assertSame(canvas.width, 0, "canvas.width", "0"); + _assertSame(canvas.height, 0, "canvas.height", "0"); + assert_throws_dom("INVALID_STATE_ERR", function() { ctx.createPattern(canvas, 'repeat'); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.crosscanvas.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.crosscanvas.html new file mode 100644 index 0000000000..bdf89021bb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.crosscanvas.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.pattern.crosscanvas + + + + +

2d.pattern.crosscanvas

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.crosscanvas.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.crosscanvas.worker.js new file mode 100644 index 0000000000..d9004fc028 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.crosscanvas.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.crosscanvas +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var response = await fetch('/images/green.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + + var pattern = new OffscreenCanvas(100, 50).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); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.null.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.null.html new file mode 100644 index 0000000000..fbec25862d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.null.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.pattern.image.null + + + + +

2d.pattern.image.null

+

+ +

Defined in "Web IDL" (draft) + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.null.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.null.worker.js new file mode 100644 index 0000000000..a68ddfdbd7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.null.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.image.null +// Description: +// Note:

Defined in "Web IDL" (draft) + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { ctx.createPattern(null, 'repeat'); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.string.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.string.html new file mode 100644 index 0000000000..ff7355d2a4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.string.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.pattern.image.string + + + + +

2d.pattern.image.string

+

+ +

Defined in "Web IDL" (draft) + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.string.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.string.worker.js new file mode 100644 index 0000000000..dc53d82292 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.string.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.image.string +// Description: +// Note:

Defined in "Web IDL" (draft) + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { ctx.createPattern('../images/red.png', 'repeat'); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.undefined.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.undefined.html new file mode 100644 index 0000000000..845f823e7f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.undefined.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.pattern.image.undefined + + + + +

2d.pattern.image.undefined

+

+ +

Defined in "Web IDL" (draft) + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.undefined.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.undefined.worker.js new file mode 100644 index 0000000000..32f5749493 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.image.undefined.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.image.undefined +// Description: +// Note:

Defined in "Web IDL" (draft) + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { ctx.createPattern(undefined, 'repeat'); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas1.html new file mode 100644 index 0000000000..ebeb92c7f5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas1.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.pattern.modify.canvas1 + + + + +

2d.pattern.modify.canvas1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas1.worker.js new file mode 100644 index 0000000000..8e4f9ed447 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas1.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.modify.canvas1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var canvas2 = new OffscreenCanvas(100, 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas2.html new file mode 100644 index 0000000000..042ebba3b7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas2.html @@ -0,0 +1,47 @@ + + +OffscreenCanvas test: 2d.pattern.modify.canvas2 + + + + +

2d.pattern.modify.canvas2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas2.worker.js new file mode 100644 index 0000000000..ed17db8127 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.modify.canvas2.worker.js @@ -0,0 +1,42 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.modify.canvas2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var canvas2 = new OffscreenCanvas(100, 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.html new file mode 100644 index 0000000000..8ab1c8eb40 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.pattern.paint.norepeat.basic + + + + +

2d.pattern.paint.norepeat.basic

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.worker.js new file mode 100644 index 0000000000..9ac4e1605c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.basic.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.norepeat.basic +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + + var response = await fetch('/images/green.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + var pattern = ctx.createPattern(img, 'no-repeat'); + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 100, 50); + + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.html new file mode 100644 index 0000000000..4bdd356df7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.pattern.paint.norepeat.coord1 + + + + +

2d.pattern.paint.norepeat.coord1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.worker.js new file mode 100644 index 0000000000..6c4a1409b7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord1.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.norepeat.coord1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 50, 50); + ctx.fillStyle = '#f00'; + ctx.fillRect(50, 0, 50, 50); + + var response = await fetch('/images/green.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.html new file mode 100644 index 0000000000..b9164ec6a9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.pattern.paint.norepeat.coord2 + + + + +

2d.pattern.paint.norepeat.coord2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.worker.js new file mode 100644 index 0000000000..d2fdd86022 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord2.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.norepeat.coord2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var response = await fetch('/images/green.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.html new file mode 100644 index 0000000000..e2983948c2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.pattern.paint.norepeat.coord3 + + + + +

2d.pattern.paint.norepeat.coord3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.worker.js new file mode 100644 index 0000000000..584a5d6cfd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.coord3.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.norepeat.coord3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + + var response = await fetch('/images/red.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.html new file mode 100644 index 0000000000..43a718d44a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.pattern.paint.norepeat.outside + + + + +

2d.pattern.paint.norepeat.outside

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.worker.js new file mode 100644 index 0000000000..0b5fef95ce --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.norepeat.outside.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.norepeat.outside +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + + var response = await fetch('/images/red.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.canvas.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.canvas.html new file mode 100644 index 0000000000..b63535c706 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.canvas.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.pattern.paint.orientation.canvas + + + + +

2d.pattern.paint.orientation.canvas

+

Canvas patterns do not get flipped when painted

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.canvas.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.canvas.worker.js new file mode 100644 index 0000000000..2fbe52af73 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.canvas.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.orientation.canvas +// Description:Canvas patterns do not get flipped when painted +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Canvas patterns do not get flipped when painted"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + + var canvas2 = new OffscreenCanvas(100, 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.image.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.image.html new file mode 100644 index 0000000000..0b3645981e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.image.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.pattern.paint.orientation.image + + + + +

2d.pattern.paint.orientation.image

+

Image patterns do not get flipped when painted

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.image.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.image.worker.js new file mode 100644 index 0000000000..b303b2d813 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.orientation.image.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.orientation.image +// Description:Image patterns do not get flipped when painted +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + + var response = await fetch('/images/rrgg-256x256.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, "Image patterns do not get flipped when painted"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.html new file mode 100644 index 0000000000..b6647f776e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.pattern.paint.repeat.basic + + + + +

2d.pattern.paint.repeat.basic

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.worker.js new file mode 100644 index 0000000000..37f4c04228 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.basic.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.repeat.basic +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + + var response = await fetch('/images/green-16x16.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + var pattern = ctx.createPattern(img, 'repeat'); + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 100, 50); + + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.html new file mode 100644 index 0000000000..54b24ac705 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.pattern.paint.repeat.coord1 + + + + +

2d.pattern.paint.repeat.coord1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.worker.js new file mode 100644 index 0000000000..efbd1c5846 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord1.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.repeat.coord1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + + var response = await fetch('/images/rgrg-256x256.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.html new file mode 100644 index 0000000000..a77ce2c696 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.pattern.paint.repeat.coord2 + + + + +

2d.pattern.paint.repeat.coord2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.worker.js new file mode 100644 index 0000000000..db707ecb0a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord2.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.repeat.coord2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var response = await fetch('/images/ggrr-256x256.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + var pattern = ctx.createPattern(img, 'repeat'); + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 100, 50); + + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.html new file mode 100644 index 0000000000..10f380fed3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.pattern.paint.repeat.coord3 + + + + +

2d.pattern.paint.repeat.coord3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.worker.js new file mode 100644 index 0000000000..e58cddccfe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.coord3.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.repeat.coord3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var response = await fetch('/images/rgrg-256x256.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.html new file mode 100644 index 0000000000..6558e07c5b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.pattern.paint.repeat.outside + + + + +

2d.pattern.paint.repeat.outside

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.worker.js new file mode 100644 index 0000000000..4a173af0b4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeat.outside.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.repeat.outside +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + + var response = await fetch('/images/green-16x16.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.html new file mode 100644 index 0000000000..494b72cfb9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.pattern.paint.repeatx.basic + + + + +

2d.pattern.paint.repeatx.basic

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.worker.js new file mode 100644 index 0000000000..e776f7a008 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.basic.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.repeatx.basic +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 16); + + var response = await fetch('/images/green-16x16.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + var pattern = ctx.createPattern(img, 'repeat-x'); + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 100, 50); + + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.html new file mode 100644 index 0000000000..6caef0cb1f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.pattern.paint.repeatx.coord1 + + + + +

2d.pattern.paint.repeatx.coord1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.worker.js new file mode 100644 index 0000000000..57c2102cc8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.coord1.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.repeatx.coord1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + + var response = await fetch('/images/red-16x16.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 98,25, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.html new file mode 100644 index 0000000000..b3229c8d87 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.pattern.paint.repeatx.outside + + + + +

2d.pattern.paint.repeatx.outside

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.worker.js new file mode 100644 index 0000000000..e40f6aa207 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeatx.outside.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.repeatx.outside +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + + var response = await fetch('/images/red-16x16.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.html new file mode 100644 index 0000000000..d88f3a0ab6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.pattern.paint.repeaty.basic + + + + +

2d.pattern.paint.repeaty.basic

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.worker.js new file mode 100644 index 0000000000..6a53b5dc4d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.basic.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.repeaty.basic +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 16, 50); + + var response = await fetch('/images/green-16x16.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + var pattern = ctx.createPattern(img, 'repeat-y'); + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 100, 50); + + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.html new file mode 100644 index 0000000000..59bfeb2abf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.pattern.paint.repeaty.coord1 + + + + +

2d.pattern.paint.repeaty.coord1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.worker.js new file mode 100644 index 0000000000..d59abb6e07 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.coord1.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.repeaty.coord1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + + var response = await fetch('/images/red-16x16.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 50,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.html new file mode 100644 index 0000000000..ad2bd3383f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.pattern.paint.repeaty.outside + + + + +

2d.pattern.paint.repeaty.outside

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.worker.js new file mode 100644 index 0000000000..c4feba10ca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.paint.repeaty.outside.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.paint.repeaty.outside +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + + var response = await fetch('/images/red-16x16.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.case.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.case.html new file mode 100644 index 0000000000..377ae3edc4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.case.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.pattern.repeat.case + + + + +

2d.pattern.repeat.case

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.case.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.case.worker.js new file mode 100644 index 0000000000..8073f47ed0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.case.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.repeat.case +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("SYNTAX_ERR", function() { ctx.createPattern(canvas, "Repeat"); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.empty.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.empty.html new file mode 100644 index 0000000000..c2197893d7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.empty.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.pattern.repeat.empty + + + + +

2d.pattern.repeat.empty

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.empty.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.empty.worker.js new file mode 100644 index 0000000000..5aefc0dab3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.empty.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.repeat.empty +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + var response = await fetch('/images/green-1x1.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + var pattern = ctx.createPattern(img, ""); + ctx.fillStyle = pattern; + ctx.fillRect(0, 0, 200, 50); + + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.null.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.null.html new file mode 100644 index 0000000000..d79551a302 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.null.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.pattern.repeat.null + + + + +

2d.pattern.repeat.null

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.null.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.null.worker.js new file mode 100644 index 0000000000..6ab4da9f8e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.null.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.repeat.null +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assert(ctx.createPattern(canvas, null) != null, "ctx.createPattern(canvas, null) != null"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.nullsuffix.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.nullsuffix.html new file mode 100644 index 0000000000..2f4a35dedf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.nullsuffix.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.pattern.repeat.nullsuffix + + + + +

2d.pattern.repeat.nullsuffix

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.nullsuffix.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.nullsuffix.worker.js new file mode 100644 index 0000000000..83e7c62fe5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.nullsuffix.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.repeat.nullsuffix +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("SYNTAX_ERR", function() { ctx.createPattern(canvas, "repeat\0"); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.undefined.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.undefined.html new file mode 100644 index 0000000000..8ddd231985 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.undefined.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.pattern.repeat.undefined + + + + +

2d.pattern.repeat.undefined

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.undefined.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.undefined.worker.js new file mode 100644 index 0000000000..f4f25ae5a2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.undefined.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.repeat.undefined +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("SYNTAX_ERR", function() { ctx.createPattern(canvas, undefined); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognised.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognised.html new file mode 100644 index 0000000000..3a37b46ab7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognised.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.pattern.repeat.unrecognised + + + + +

2d.pattern.repeat.unrecognised

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognised.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognised.worker.js new file mode 100644 index 0000000000..3114dde21a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognised.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.repeat.unrecognised +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("SYNTAX_ERR", function() { ctx.createPattern(canvas, "invalid"); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognisednull.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognisednull.html new file mode 100644 index 0000000000..58fb005d70 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognisednull.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.pattern.repeat.unrecognisednull + + + + +

2d.pattern.repeat.unrecognisednull

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognisednull.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognisednull.worker.js new file mode 100644 index 0000000000..c8d18511f4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.repeat.unrecognisednull.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.repeat.unrecognisednull +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("SYNTAX_ERR", function() { ctx.createPattern(canvas, "null"); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.identity.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.identity.html new file mode 100644 index 0000000000..2d73296395 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.identity.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.pattern.transform.identity + + + + +

2d.pattern.transform.identity

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.identity.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.identity.worker.js new file mode 100644 index 0000000000..a33c771346 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.identity.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.transform.identity +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var canvas2 = new OffscreenCanvas(100, 50); + var pattern = ctx.createPattern(canvas2, 'no-repeat'); + pattern.setTransform(new DOMMatrix()); + + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.infinity.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.infinity.html new file mode 100644 index 0000000000..aa58ad119f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.infinity.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.pattern.transform.infinity + + + + +

2d.pattern.transform.infinity

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.infinity.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.infinity.worker.js new file mode 100644 index 0000000000..999739b848 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.infinity.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.transform.infinity +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var canvas2 = new OffscreenCanvas(100, 50); + var pattern = ctx.createPattern(canvas2, 'no-repeat'); + pattern.setTransform({a: Infinity}); + + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.invalid.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.invalid.html new file mode 100644 index 0000000000..f2420d4a2b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.invalid.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.pattern.transform.invalid + + + + +

2d.pattern.transform.invalid

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.invalid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.invalid.worker.js new file mode 100644 index 0000000000..163951807f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.pattern.transform.invalid.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.pattern.transform.invalid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var canvas2 = new OffscreenCanvas(100, 50); + var pattern = ctx.createPattern(canvas2, 'no-repeat'); + assert_throws_js(TypeError, function() { pattern.setTransform({a: 1, m11: 2}); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.strokeStyle.colormix.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.strokeStyle.colormix.html new file mode 100644 index 0000000000..eba026619a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.strokeStyle.colormix.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.strokeStyle.colormix + + + + +

2d.strokeStyle.colormix

+

color-mix works as color input

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.strokeStyle.default.html b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.strokeStyle.default.html new file mode 100644 index 0000000000..cd7e424374 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.strokeStyle.default.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.strokeStyle.default + + + + +

2d.strokeStyle.default

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.strokeStyle.default.worker.js b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.strokeStyle.default.worker.js new file mode 100644 index 0000000000..9e0ac8be3e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/fill-and-stroke-styles/2d.strokeStyle.default.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.strokeStyle.default +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.strokeStyle, '#000000', "ctx.strokeStyle", "'#000000'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.html new file mode 100644 index 0000000000..d8f14529c5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.filter.canvasFilterObject.blur.exceptions.tentative + + + + +

2d.filter.canvasFilterObject.blur.exceptions.tentative

+

Test exceptions on CanvasFilter() blur.object

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.worker.js new file mode 100644 index 0000000000..9b3fb3c04c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.blur.exceptions.tentative.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.blur.exceptions.tentative +// Description:Test exceptions on CanvasFilter() blur.object +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test exceptions on CanvasFilter() blur.object"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({name: 'gaussianBlur'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({name: 'gaussianBlur', stdDeviation: undefined}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({name: 'gaussianBlur', stdDeviation: 'foo'}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({name: 'gaussianBlur', stdDeviation: [1,2,3]}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({name: 'gaussianBlur', stdDeviation: NaN}); }); + assert_throws_js(TypeError, function() { ctx.filter = new CanvasFilter({name: 'gaussianBlur', stdDeviation: {}}); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.html new file mode 100644 index 0000000000..242094d9f9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.html @@ -0,0 +1,69 @@ + + +OffscreenCanvas test: 2d.filter.canvasFilterObject.colorMatrix.tentative + + + + +

2d.filter.canvasFilterObject.colorMatrix.tentative

+

Test the functionality of ColorMatrix filters in CanvasFilter objects

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.worker.js new file mode 100644 index 0000000000..d214e1d836 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.colorMatrix.tentative.worker.js @@ -0,0 +1,64 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.colorMatrix.tentative +// Description:Test the functionality of ColorMatrix filters in CanvasFilter objects +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test the functionality of ColorMatrix filters in CanvasFilter objects"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'colorMatrix', values: undefined}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'colorMatrix', values: 'foo'}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'colorMatrix', values: null}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'colorMatrix', values: [1, 2, 3]}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'colorMatrix', values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 'a']}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'colorMatrix', values: [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, Infinity]}); }); + ctx.fillStyle = '#f00'; + ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'hueRotate', values: 0}); + ctx.fillRect(0, 0, 100, 50); + _assertPixelApprox(canvas, 10,10, 255,0,0,255, 2); + ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'hueRotate', values: 90}); + ctx.fillRect(0, 0, 100, 50); + _assertPixelApprox(canvas, 10,10, 0,91,0,255, 2); + ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'hueRotate', values: 180}); + ctx.fillRect(0, 0, 100, 50); + _assertPixelApprox(canvas, 10,10, 0,109,109,255, 2); + ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'hueRotate', values: 270}); + ctx.fillRect(0, 0, 100, 50); + _assertPixelApprox(canvas, 10,10, 109,18,255,255, 2); + ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'saturate', values: 0.5}); + ctx.fillRect(0, 0, 100, 50); + _assertPixelApprox(canvas, 10,10, 155,27,27,255, 2); + ctx.clearRect(0, 0, 100, 50); + ctx.filter = new CanvasFilter({name: 'colorMatrix', type: 'luminanceToAlpha'}); + ctx.fillRect(0, 0, 100, 50); + _assertPixelApprox(canvas, 10,10, 0,0,0,54, 2); + ctx.filter = new CanvasFilter({name: 'colorMatrix', values: [ + 0, 0, 0, 0, 0, + 1, 1, 1, 1, 0, + 0, 0, 0, 0, 0, + 0, 0, 0, 1, 0 + ]}); + ctx.fillRect(0, 0, 50, 25); + ctx.fillStyle = '#0f0'; + ctx.fillRect(50, 0, 50, 25); + ctx.fillStyle = '#00f'; + ctx.fillRect(0, 25, 50, 25); + ctx.fillStyle = '#fff'; + ctx.fillRect(50, 25, 50, 25); + _assertPixelApprox(canvas, 10,10, 0,255,0,255, 2); + _assertPixelApprox(canvas, 60,10, 0,255,0,255, 2); + _assertPixelApprox(canvas, 10,30, 0,255,0,255, 2); + _assertPixelApprox(canvas, 60,30, 0,255,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html new file mode 100644 index 0000000000..ff1de6bc9c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.html @@ -0,0 +1,67 @@ + + +OffscreenCanvas test: 2d.filter.canvasFilterObject.componentTransfer.discrete.tentative + + + + +

2d.filter.canvasFilterObject.componentTransfer.discrete.tentative

+

Test pixels on CanvasFilter() componentTransfer with discrete type

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.worker.js new file mode 100644 index 0000000000..0e68f4899f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.discrete.tentative.worker.js @@ -0,0 +1,62 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.componentTransfer.discrete.tentative +// Description:Test pixels on CanvasFilter() componentTransfer with discrete type +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test pixels on CanvasFilter() componentTransfer with discrete type"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // From https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement + function getTransformedValue(C, V) { + // Get the right interval + const n = V.length; + const k = C == 1 ? n - 1 : Math.floor(C * n); + return V[k]; + } + + function getColor(inputColor, tableValues) { + const result = [0, 0, 0]; + for (const i in inputColor) { + const C = inputColor[i]/255; + const Cprime = getTransformedValue(C, tableValues[i]); + result[i] = Math.max(0, Math.min(1, Cprime)) * 255; + } + return result; + } + + tableValuesR = [0, 0, 1, 1]; + tableValuesG = [2, 0, 0.5, 3]; + tableValuesB = [1, -1, 5, 0]; + ctx.filter = new CanvasFilter({name: 'componentTransfer', + funcR: {type: 'discrete', tableValues: tableValuesR}, + funcG: {type: 'discrete', tableValues: tableValuesG}, + funcB: {type: 'discrete', tableValues: tableValuesB}, + }); + + const inputColors = [ + [255, 255, 255], + [0, 0, 0], + [127, 0, 34], + [252, 186, 3], + [50, 68, 87], + ]; + + for (const color of inputColors) { + let outputColor = getColor(color, [tableValuesR, tableValuesG, tableValuesB]); + ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; + ctx.fillRect(0, 0, 10, 10); + _assertPixelApprox(canvas, 5, 5, outputColor[0],outputColor[1],outputColor[2],255, 2); + } + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html new file mode 100644 index 0000000000..64c30fc417 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.html @@ -0,0 +1,58 @@ + + +OffscreenCanvas test: 2d.filter.canvasFilterObject.componentTransfer.gamma.tentative + + + + +

2d.filter.canvasFilterObject.componentTransfer.gamma.tentative

+

Test pixels on CanvasFilter() componentTransfer with gamma type

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.worker.js new file mode 100644 index 0000000000..d59bc699df --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.gamma.tentative.worker.js @@ -0,0 +1,53 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.componentTransfer.gamma.tentative +// Description:Test pixels on CanvasFilter() componentTransfer with gamma type +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test pixels on CanvasFilter() componentTransfer with gamma type"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // From https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement + function getColor(inputColor, amplitude, exponent, offset) { + return [ + Math.max(0, Math.min(1, Math.pow(inputColor[0]/255, exponent[0]) * amplitude[0] + offset[0])) * 255, + Math.max(0, Math.min(1, Math.pow(inputColor[1]/255, exponent[1]) * amplitude[1] + offset[1])) * 255, + Math.max(0, Math.min(1, Math.pow(inputColor[2]/255, exponent[2]) * amplitude[2] + offset[2])) * 255, + ]; + } + + const amplitudes = [2, 1.1, 0.5]; + const exponents = [5, 3, 1]; + const offsets = [0.25, 0, 0.5]; + ctx.filter = new CanvasFilter({name: 'componentTransfer', + funcR: {type: 'gamma', amplitude: amplitudes[0], exponent: exponents[0], offset: offsets[0]}, + funcG: {type: 'gamma', amplitude: amplitudes[1], exponent: exponents[1], offset: offsets[1]}, + funcB: {type: 'gamma', amplitude: amplitudes[2], exponent: exponents[2], offset: offsets[2]}, + }); + + const inputColors = [ + [255, 255, 255], + [0, 0, 0], + [127, 0, 34], + [252, 186, 3], + [50, 68, 87], + ]; + + for (const color of inputColors) { + let outputColor = getColor(color, amplitudes, exponents, offsets); + ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; + ctx.fillRect(0, 0, 10, 10); + _assertPixelApprox(canvas, 5, 5, outputColor[0],outputColor[1],outputColor[2],255, 2); + } + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html new file mode 100644 index 0000000000..e0d628952e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.html @@ -0,0 +1,45 @@ + + +OffscreenCanvas test: 2d.filter.canvasFilterObject.componentTransfer.identity.tentative + + + + +

2d.filter.canvasFilterObject.componentTransfer.identity.tentative

+

Test pixels on CanvasFilter() componentTransfer with identity type

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.worker.js new file mode 100644 index 0000000000..1b714b58ff --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.identity.tentative.worker.js @@ -0,0 +1,40 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.componentTransfer.identity.tentative +// Description:Test pixels on CanvasFilter() componentTransfer with identity type +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test pixels on CanvasFilter() componentTransfer with identity type"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.filter = new CanvasFilter({name: 'componentTransfer', + funcR: {type: 'identity'}, + funcG: {type: 'identity'}, + funcB: {type: 'identity'}, + }); + + const inputColors = [ + [255, 255, 255], + [0, 0, 0], + [127, 0, 34], + [252, 186, 3], + [50, 68, 87], + ]; + + for (const color of inputColors) { + ctx.fillStyle = `rgba(${color[0]}, ${color[1]}, ${color[2]}, 1)`, + ctx.fillRect(0, 0, 10, 10); + _assertPixel(canvas, 5, 5, color[0],color[1],color[2],255); + } + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html new file mode 100644 index 0000000000..adbe557fd9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.html @@ -0,0 +1,57 @@ + + +OffscreenCanvas test: 2d.filter.canvasFilterObject.componentTransfer.linear.tentative + + + + +

2d.filter.canvasFilterObject.componentTransfer.linear.tentative

+

Test pixels on CanvasFilter() componentTransfer with linear type

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.worker.js new file mode 100644 index 0000000000..fb2e01876f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.linear.tentative.worker.js @@ -0,0 +1,52 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.componentTransfer.linear.tentative +// Description:Test pixels on CanvasFilter() componentTransfer with linear type +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test pixels on CanvasFilter() componentTransfer with linear type"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // From https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement + function getColor(inputColor, slopes, intercepts) { + return [ + Math.max(0, Math.min(1, inputColor[0]/255 * slopes[0] + intercepts[0])) * 255, + Math.max(0, Math.min(1, inputColor[1]/255 * slopes[1] + intercepts[1])) * 255, + Math.max(0, Math.min(1, inputColor[2]/255 * slopes[2] + intercepts[2])) * 255, + ]; + } + + const slopes = [0.5, 1.2, -0.2]; + const intercepts = [0.25, 0, 0.5]; + ctx.filter = new CanvasFilter({name: 'componentTransfer', + funcR: {type: 'linear', slope: slopes[0], intercept: intercepts[0]}, + funcG: {type: 'linear', slope: slopes[1], intercept: intercepts[1]}, + funcB: {type: 'linear', slope: slopes[2], intercept: intercepts[2]}, + }); + + const inputColors = [ + [255, 255, 255], + [0, 0, 0], + [127, 0, 34], + [252, 186, 3], + [50, 68, 87], + ]; + + for (const color of inputColors) { + let outputColor = getColor(color, slopes, intercepts); + ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; + ctx.fillRect(0, 0, 10, 10); + _assertPixelApprox(canvas, 5, 5, outputColor[0],outputColor[1],outputColor[2],255, 2); + } + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html new file mode 100644 index 0000000000..47048b68a1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.html @@ -0,0 +1,67 @@ + + +OffscreenCanvas test: 2d.filter.canvasFilterObject.componentTransfer.table.tentative + + + + +

2d.filter.canvasFilterObject.componentTransfer.table.tentative

+

Test pixels on CanvasFilter() componentTransfer with table type

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.worker.js new file mode 100644 index 0000000000..0799e73a58 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.componentTransfer.table.tentative.worker.js @@ -0,0 +1,62 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.componentTransfer.table.tentative +// Description:Test pixels on CanvasFilter() componentTransfer with table type +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test pixels on CanvasFilter() componentTransfer with table type"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // From https://www.w3.org/TR/SVG11/filters.html#feComponentTransferElement + function getTransformedValue(C, V) { + // Get the right interval + const n = V.length - 1; + const k = C == 1 ? n - 1 : Math.floor(C * n); + return V[k] + (C - k/n) * n * (V[k + 1] - V[k]); + } + + function getColor(inputColor, tableValues) { + const result = [0, 0, 0]; + for (const i in inputColor) { + const C = inputColor[i]/255; + const Cprime = getTransformedValue(C, tableValues[i]); + result[i] = Math.max(0, Math.min(1, Cprime)) * 255; + } + return result; + } + + tableValuesR = [0, 0, 1, 1]; + tableValuesG = [2, 0, 0.5, 3]; + tableValuesB = [1, -1, 5, 0]; + ctx.filter = new CanvasFilter({name: 'componentTransfer', + funcR: {type: 'table', tableValues: tableValuesR}, + funcG: {type: 'table', tableValues: tableValuesG}, + funcB: {type: 'table', tableValues: tableValuesB}, + }); + + const inputColors = [ + [255, 255, 255], + [0, 0, 0], + [127, 0, 34], + [252, 186, 3], + [50, 68, 87], + ]; + + for (const color of inputColors) { + let outputColor = getColor(color, [tableValuesR, tableValuesG, tableValuesB]); + ctx.fillStyle = `rgb(${color[0]}, ${color[1]}, ${color[2]})`; + ctx.fillRect(0, 0, 10, 10); + _assertPixelApprox(canvas, 5, 5, outputColor[0],outputColor[1],outputColor[2],255, 2); + } + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html new file mode 100644 index 0000000000..301d11f888 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative + + + + +

2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative

+

Test exceptions on CanvasFilter() convolveMatrix

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.worker.js new file mode 100644 index 0000000000..b4ce4d76b2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.convolveMatrix.exceptions.tentative +// Description:Test exceptions on CanvasFilter() convolveMatrix +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test exceptions on CanvasFilter() convolveMatrix"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix'}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', divisor: 2}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: null}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: 1}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 0], [0]]}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 'a'], [0]]}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 0], 0]}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 0], [0, Infinity]]}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: []}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [1]}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [1, 2, 3, 4]}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[], []]}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1, 2], []]}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[], [1, 2]]}); }); + // This should not throw an error + ctx.filter = new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[]]}); + ctx.filter = new CanvasFilter({name: 'convolveMatrix', kernelMatrix: [[1]]}); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html new file mode 100644 index 0000000000..3e55e97e54 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.html @@ -0,0 +1,124 @@ + + +OffscreenCanvas test: 2d.filter.canvasFilterObject.dropShadow.exceptions.tentative + + + + +

2d.filter.canvasFilterObject.dropShadow.exceptions.tentative

+

Test exceptions on CanvasFilter() dropShadow object

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js new file mode 100644 index 0000000000..bd18524f28 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.exceptions.tentative.worker.js @@ -0,0 +1,119 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.dropShadow.exceptions.tentative +// Description:Test exceptions on CanvasFilter() dropShadow object +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test exceptions on CanvasFilter() dropShadow object"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // dx + _assert(new CanvasFilter({name: 'dropShadow', dx: 10}), "new CanvasFilter({name: 'dropShadow', dx: 10})"); + _assert(new CanvasFilter({name: 'dropShadow', dx: -1}), "new CanvasFilter({name: 'dropShadow', dx: -1})"); + _assert(new CanvasFilter({name: 'dropShadow', dx: 0.5}), "new CanvasFilter({name: 'dropShadow', dx: 0.5})"); + _assert(new CanvasFilter({name: 'dropShadow', dx: null}), "new CanvasFilter({name: 'dropShadow', dx: null})"); + _assert(new CanvasFilter({name: 'dropShadow', dx: true}), "new CanvasFilter({name: 'dropShadow', dx: true})"); + _assert(new CanvasFilter({name: 'dropShadow', dx: false}), "new CanvasFilter({name: 'dropShadow', dx: false})"); + _assert(new CanvasFilter({name: 'dropShadow', dx: []}), "new CanvasFilter({name: 'dropShadow', dx: []})"); + _assert(new CanvasFilter({name: 'dropShadow', dx: [20]}), "new CanvasFilter({name: 'dropShadow', dx: [\""+(20)+"\"]})"); + _assert(new CanvasFilter({name: 'dropShadow', dx: '30'}), "new CanvasFilter({name: 'dropShadow', dx: '30'})"); + // dy + _assert(new CanvasFilter({name: 'dropShadow', dy: 10}), "new CanvasFilter({name: 'dropShadow', dy: 10})"); + _assert(new CanvasFilter({name: 'dropShadow', dy: -1}), "new CanvasFilter({name: 'dropShadow', dy: -1})"); + _assert(new CanvasFilter({name: 'dropShadow', dy: 0.5}), "new CanvasFilter({name: 'dropShadow', dy: 0.5})"); + _assert(new CanvasFilter({name: 'dropShadow', dy: null}), "new CanvasFilter({name: 'dropShadow', dy: null})"); + _assert(new CanvasFilter({name: 'dropShadow', dy: true}), "new CanvasFilter({name: 'dropShadow', dy: true})"); + _assert(new CanvasFilter({name: 'dropShadow', dy: false}), "new CanvasFilter({name: 'dropShadow', dy: false})"); + _assert(new CanvasFilter({name: 'dropShadow', dy: []}), "new CanvasFilter({name: 'dropShadow', dy: []})"); + _assert(new CanvasFilter({name: 'dropShadow', dy: [20]}), "new CanvasFilter({name: 'dropShadow', dy: [\""+(20)+"\"]})"); + _assert(new CanvasFilter({name: 'dropShadow', dy: '30'}), "new CanvasFilter({name: 'dropShadow', dy: '30'})"); + // floodOpacity + _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: 10}), "new CanvasFilter({name: 'dropShadow', floodOpacity: 10})"); + _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: -1}), "new CanvasFilter({name: 'dropShadow', floodOpacity: -1})"); + _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: 0.5}), "new CanvasFilter({name: 'dropShadow', floodOpacity: 0.5})"); + _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: null}), "new CanvasFilter({name: 'dropShadow', floodOpacity: null})"); + _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: true}), "new CanvasFilter({name: 'dropShadow', floodOpacity: true})"); + _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: false}), "new CanvasFilter({name: 'dropShadow', floodOpacity: false})"); + _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: []}), "new CanvasFilter({name: 'dropShadow', floodOpacity: []})"); + _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: [20]}), "new CanvasFilter({name: 'dropShadow', floodOpacity: [\""+(20)+"\"]})"); + _assert(new CanvasFilter({name: 'dropShadow', floodOpacity: '30'}), "new CanvasFilter({name: 'dropShadow', floodOpacity: '30'})"); + // stdDeviation + _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: 10}), "new CanvasFilter({name: 'dropShadow', stdDeviation: 10})"); + _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: -1}), "new CanvasFilter({name: 'dropShadow', stdDeviation: -1})"); + _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: 0.5}), "new CanvasFilter({name: 'dropShadow', stdDeviation: 0.5})"); + _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: null}), "new CanvasFilter({name: 'dropShadow', stdDeviation: null})"); + _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: true}), "new CanvasFilter({name: 'dropShadow', stdDeviation: true})"); + _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: false}), "new CanvasFilter({name: 'dropShadow', stdDeviation: false})"); + _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: []}), "new CanvasFilter({name: 'dropShadow', stdDeviation: []})"); + _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [20]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [\""+(20)+"\"]})"); + _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: '30'}), "new CanvasFilter({name: 'dropShadow', stdDeviation: '30'})"); + _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [10, -1]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [10, -1]})"); + _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [0.5, null]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [0.5, null]})"); + _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [true, false]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [true, false]})"); + _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: [[], [20]]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: [[], [\""+(20)+"\"]]})"); + _assert(new CanvasFilter({name: 'dropShadow', stdDeviation: ['30', ['40']]}), "new CanvasFilter({name: 'dropShadow', stdDeviation: ['30', ['40']]})"); + // floodColor + _assert(new CanvasFilter({name: 'dropShadow', floodColor: 'red'}), "new CanvasFilter({name: 'dropShadow', floodColor: 'red'})"); + _assert(new CanvasFilter({name: 'dropShadow', floodColor: 'canvas'}), "new CanvasFilter({name: 'dropShadow', floodColor: 'canvas'})"); + _assert(new CanvasFilter({name: 'dropShadow', floodColor: 'rgba(4, -3, 0.5, 1)'}), "new CanvasFilter({name: 'dropShadow', floodColor: 'rgba(4, -3, 0.5, 1)'})"); + _assert(new CanvasFilter({name: 'dropShadow', floodColor: '#aabbccdd'}), "new CanvasFilter({name: 'dropShadow', floodColor: '#aabbccdd'})"); + _assert(new CanvasFilter({name: 'dropShadow', floodColor: '#abcd'}), "new CanvasFilter({name: 'dropShadow', floodColor: '#abcd'})"); + + // dx + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: NaN}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: Infinity}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: -Infinity}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: undefined}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: 'test'}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: {}}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dx: [1, 2]}); }); + // dy + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: NaN}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: Infinity}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: -Infinity}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: undefined}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: 'test'}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: {}}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', dy: [1, 2]}); }); + // floodOpacity + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: NaN}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: Infinity}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: -Infinity}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: undefined}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: 'test'}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: {}}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodOpacity: [1, 2]}); }); + // stdDeviation + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: NaN}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: Infinity}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: -Infinity}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: undefined}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: 'test'}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: {}}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, 2, 3]}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, NaN]}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, Infinity]}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, -Infinity]}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, undefined]}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, 'test']}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, {}]}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', stdDeviation: [1, [2, 3]]}); }); + // floodColor + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: 'test'}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: 'rgba(NaN, 3, 2, 1)'}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: 10}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: undefined}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: null}); }); + assert_throws_js(TypeError, function() { new CanvasFilter({name: 'dropShadow', floodColor: NaN}); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative-expected.html new file mode 100644 index 0000000000..86c5710132 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative-expected.html @@ -0,0 +1,57 @@ + + +Canvas test: 2d.filter.canvasFilterObject.dropShadow.tentative +

2d.filter.canvasFilterObject.dropShadow.tentative

+

Test CanvasFilter() dropShadow object.

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html new file mode 100644 index 0000000000..81eb1eae45 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.html @@ -0,0 +1,110 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.dropShadow.tentative +

2d.filter.canvasFilterObject.dropShadow.tentative

+

Test CanvasFilter() dropShadow object.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.w.html new file mode 100644 index 0000000000..fe9087244a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.dropShadow.tentative.w.html @@ -0,0 +1,124 @@ + + + + +Canvas test: 2d.filter.canvasFilterObject.dropShadow.tentative +

2d.filter.canvasFilterObject.dropShadow.tentative

+

Test CanvasFilter() dropShadow object.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic-expected.html new file mode 100644 index 0000000000..f9571f208e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic +

2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.html new file mode 100644 index 0000000000..4417a1917c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic +

2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.w.html new file mode 100644 index 0000000000..d2024ad205 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic +

2d.filter.canvasFilterObject.gaussianBlur.tentative.isotropic

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x-expected.html new file mode 100644 index 0000000000..e76613271f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x +

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.html new file mode 100644 index 0000000000..2ea26359fe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x +

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.w.html new file mode 100644 index 0000000000..fa49ea4682 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x +

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-x

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y-expected.html new file mode 100644 index 0000000000..0f214fca9f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y +

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.html new file mode 100644 index 0000000000..a9783ccb6a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y +

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.w.html new file mode 100644 index 0000000000..ab83f50ea0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y +

2d.filter.canvasFilterObject.gaussianBlur.tentative.mostly-y

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only-expected.html new file mode 100644 index 0000000000..285a641726 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only +

2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.html new file mode 100644 index 0000000000..3028c2a700 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only +

2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.w.html new file mode 100644 index 0000000000..e8482cf3ed --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only +

2d.filter.canvasFilterObject.gaussianBlur.tentative.x-only

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only-expected.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only-expected.html new file mode 100644 index 0000000000..d59945b5da --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only +

2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only

+

Test CanvasFilter() with gaussianBlur.

+ + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.html new file mode 100644 index 0000000000..fca324716b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only +

2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.w.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.w.html new file mode 100644 index 0000000000..50cfb3083a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only +

2d.filter.canvasFilterObject.gaussianBlur.tentative.y-only

+

Test CanvasFilter() with gaussianBlur.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.tentative.html new file mode 100644 index 0000000000..fb99ef7d1f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.tentative.html @@ -0,0 +1,49 @@ + + +OffscreenCanvas test: 2d.filter.canvasFilterObject.tentative + + + + +

2d.filter.canvasFilterObject.tentative

+

Test CanvasFilter() object

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.tentative.worker.js new file mode 100644 index 0000000000..db95e0b006 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.tentative.worker.js @@ -0,0 +1,44 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.tentative +// Description:Test CanvasFilter() object +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test CanvasFilter() object"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assert(ctx.filter == 'none', "ctx.filter == 'none'"); + ctx.filter = 'blur(5px)'; + _assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'"); + ctx.filter = new CanvasFilter({name: 'gaussianBlur', stdDeviation: 5}); + _assert(ctx.filter.toString() == '[object CanvasFilter]', "ctx.filter.toString() == '[object CanvasFilter]'"); + ctx.filter = new CanvasFilter({name: 'gaussianBlur', stdDeviation: [1, 2]}); + _assert(ctx.filter.toString() == '[object CanvasFilter]', "ctx.filter.toString() == '[object CanvasFilter]'"); + ctx.filter = new CanvasFilter([ + {name: 'gaussianBlur', stdDeviation: 5}, + {name: 'gaussianBlur', stdDeviation: 10} + ]); + _assert(ctx.filter.toString() == '[object CanvasFilter]', "ctx.filter.toString() == '[object CanvasFilter]'"); + var canvas2 = new OffscreenCanvas(100, 50); + var ctx2 = canvas2.getContext('2d'); + ctx2.filter = ctx.filter; + _assert(ctx.filter.toString() == '[object CanvasFilter]', "ctx.filter.toString() == '[object CanvasFilter]'"); + ctx.filter = 'blur(5px)'; + _assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'"); + ctx.filter = 'none'; + _assert(ctx.filter == 'none', "ctx.filter == 'none'"); + ctx.filter = new CanvasFilter({name: 'gaussianBlur', stdDeviation: 5}); + ctx.filter = 'this string is not a filter and should do nothing'; + _assert(ctx.filter.toString() == '[object CanvasFilter]', "ctx.filter.toString() == '[object CanvasFilter]'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html new file mode 100644 index 0000000000..040c62a96b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.html @@ -0,0 +1,130 @@ + + +OffscreenCanvas test: 2d.filter.canvasFilterObject.turbulence.inputTypes.tentative + + + + +

2d.filter.canvasFilterObject.turbulence.inputTypes.tentative

+

Test exceptions on CanvasFilter() turbulence object

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.worker.js new file mode 100644 index 0000000000..1a950a9207 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.canvasFilterObject.turbulence.inputTypes.tentative.worker.js @@ -0,0 +1,125 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.canvasFilterObject.turbulence.inputTypes.tentative +// Description:Test exceptions on CanvasFilter() turbulence object +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test exceptions on CanvasFilter() turbulence object"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const errorTestCases = [ + {baseFrequency: {}}, + {baseFrequency: -1}, + {baseFrequency: [0, -1]}, + {baseFrequency: NaN}, + {baseFrequency: Infinity}, + {baseFrequency: undefined}, + {baseFrequency: -Infinity}, + {baseFrequency: 'test'}, + + {numOctaves: {}}, + {numOctaves: -1}, + {numOctaves: NaN}, + {numOctaves: Infinity}, + {numOctaves: undefined}, + {numOctaves: -Infinity}, + {numOctaves: [1, 1]}, + {numOctaves: 'test'}, + + {seed: {}}, + {seed: NaN}, + {seed: Infinity}, + {seed: undefined}, + {seed: -Infinity}, + {seed: [1, 1]}, + {seed: 'test'}, + + {stitchTiles: {}}, + {stitchTiles: NaN}, + {stitchTiles: Infinity}, + {stitchTiles: undefined}, + {stitchTiles: -Infinity}, + {stitchTiles: [1, 1]}, + {stitchTiles: 'test'}, + {stitchTiles: null}, + {stitchTiles: []}, + {stitchTiles: [10]}, + {stitchTiles: 30}, + {stitchTiles: false}, + {stitchTiles: true}, + {stitchTiles: '10'}, + {stitchTiles: -1}, + + {type: {}}, + {type: NaN}, + {type: Infinity}, + {type: undefined}, + {type: -Infinity}, + {type: [1, 1]}, + {type: 'test'}, + {type: null}, + {type: []}, + {type: [10]}, + {type: 30}, + {type: false}, + {type: true}, + {type: '10'}, + {type: -1}, + ] + + // null and [] = 0 when parsed as number + const workingTestCases = [ + {baseFrequency: null}, + {baseFrequency: []}, + {baseFrequency: [10]}, + {baseFrequency: [10, 3]}, + {baseFrequency: 30}, + {baseFrequency: false}, + {baseFrequency: true}, + {baseFrequency: '10'}, + + {numOctaves: null}, + {numOctaves: []}, + {numOctaves: [10]}, + {numOctaves: 30}, + {numOctaves: false}, + {numOctaves: true}, + {numOctaves: '10'}, + + {seed: null}, + {seed: []}, + {seed: [10]}, + {seed: 30}, + {seed: false}, + {seed: true}, + {seed: '10'}, + {seed: -1}, + + {stitchTiles: 'stitch'}, + {stitchTiles: 'noStitch'}, + + {type: 'fractalNoise'}, + {type: 'turbulence'}, + ] + + for (testCase of errorTestCases) { + const filterOptions = {...{name: 'turbulence'}, ...testCase}; + assert_throws_js(TypeError, function() { new CanvasFilter(filterOptions); }); + } + + for (testCase of workingTestCases) { + const filterOptions = {...{name: 'turbulence'}, ...testCase}; + _assert(new CanvasFilter(filterOptions) != null, "new CanvasFilter(filterOptions) != null"); + } + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.value.html b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.value.html new file mode 100644 index 0000000000..5594174cf6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.value.html @@ -0,0 +1,56 @@ + + +OffscreenCanvas test: 2d.filter.value + + + + +

2d.filter.value

+

test if ctx.filter works correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.value.worker.js b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.value.worker.js new file mode 100644 index 0000000000..2308315b63 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/filters/2d.filter.value.worker.js @@ -0,0 +1,51 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.filter.value +// Description:test if ctx.filter works correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("test if ctx.filter works correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assert(ctx.filter == 'none', "ctx.filter == 'none'"); + ctx.filter = 'blur(5px)'; + _assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'"); + ctx.save(); + ctx.filter = 'none'; + _assert(ctx.filter == 'none', "ctx.filter == 'none'"); + ctx.restore(); + _assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'"); + + ctx.filter = 'blur(10)'; + _assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'"); + ctx.filter = 'blur 10px'; + _assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'"); + + ctx.filter = 'inherit'; + _assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'"); + ctx.filter = 'initial'; + _assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'"); + ctx.filter = 'unset'; + _assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'"); + + ctx.filter = ''; + _assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'"); + ctx.filter = null; + _assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'"); + ctx.filter = undefined; + _assert(ctx.filter == 'blur(5px)', "ctx.filter == 'blur(5px)'"); + + ctx.filter = 'blur( 5px)'; + assert_equals(ctx.filter, 'blur( 5px)'); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.isotropic-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.isotropic-expected.html new file mode 100644 index 0000000000..6a6f0f6892 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.isotropic-expected.html @@ -0,0 +1,16 @@ + + +Canvas test: 2d.layer.anisotropic-blur.isotropic +

2d.layer.anisotropic-blur.isotropic

+

Checks that layers allow gaussian blur with separate X and Y components.

+ + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.isotropic.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.isotropic.html new file mode 100644 index 0000000000..d59a4ccf62 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.isotropic.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.layer.anisotropic-blur.isotropic +

2d.layer.anisotropic-blur.isotropic

+

Checks that layers allow gaussian blur with separate X and Y components.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.isotropic.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.isotropic.w.html new file mode 100644 index 0000000000..15961d5c7e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.isotropic.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.layer.anisotropic-blur.isotropic +

2d.layer.anisotropic-blur.isotropic

+

Checks that layers allow gaussian blur with separate X and Y components.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-x-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-x-expected.html new file mode 100644 index 0000000000..b0473f2ff0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-x-expected.html @@ -0,0 +1,16 @@ + + +Canvas test: 2d.layer.anisotropic-blur.mostly-x +

2d.layer.anisotropic-blur.mostly-x

+

Checks that layers allow gaussian blur with separate X and Y components.

+ + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-x.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-x.html new file mode 100644 index 0000000000..c5ad2ee6c5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-x.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.layer.anisotropic-blur.mostly-x +

2d.layer.anisotropic-blur.mostly-x

+

Checks that layers allow gaussian blur with separate X and Y components.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-x.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-x.w.html new file mode 100644 index 0000000000..60f5ac3ebd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-x.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.layer.anisotropic-blur.mostly-x +

2d.layer.anisotropic-blur.mostly-x

+

Checks that layers allow gaussian blur with separate X and Y components.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-y-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-y-expected.html new file mode 100644 index 0000000000..43da016eea --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-y-expected.html @@ -0,0 +1,16 @@ + + +Canvas test: 2d.layer.anisotropic-blur.mostly-y +

2d.layer.anisotropic-blur.mostly-y

+

Checks that layers allow gaussian blur with separate X and Y components.

+ + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-y.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-y.html new file mode 100644 index 0000000000..9545257cfa --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-y.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.layer.anisotropic-blur.mostly-y +

2d.layer.anisotropic-blur.mostly-y

+

Checks that layers allow gaussian blur with separate X and Y components.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-y.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-y.w.html new file mode 100644 index 0000000000..d533ad3187 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.mostly-y.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.layer.anisotropic-blur.mostly-y +

2d.layer.anisotropic-blur.mostly-y

+

Checks that layers allow gaussian blur with separate X and Y components.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.x-only-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.x-only-expected.html new file mode 100644 index 0000000000..0b4d269189 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.x-only-expected.html @@ -0,0 +1,16 @@ + + +Canvas test: 2d.layer.anisotropic-blur.x-only +

2d.layer.anisotropic-blur.x-only

+

Checks that layers allow gaussian blur with separate X and Y components.

+ + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.x-only.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.x-only.html new file mode 100644 index 0000000000..4552ad4433 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.x-only.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.layer.anisotropic-blur.x-only +

2d.layer.anisotropic-blur.x-only

+

Checks that layers allow gaussian blur with separate X and Y components.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.x-only.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.x-only.w.html new file mode 100644 index 0000000000..38abb21cd9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.x-only.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.layer.anisotropic-blur.x-only +

2d.layer.anisotropic-blur.x-only

+

Checks that layers allow gaussian blur with separate X and Y components.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.y-only-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.y-only-expected.html new file mode 100644 index 0000000000..2572386412 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.y-only-expected.html @@ -0,0 +1,16 @@ + + +Canvas test: 2d.layer.anisotropic-blur.y-only +

2d.layer.anisotropic-blur.y-only

+

Checks that layers allow gaussian blur with separate X and Y components.

+ + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.y-only.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.y-only.html new file mode 100644 index 0000000000..87dbcd3708 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.y-only.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.layer.anisotropic-blur.y-only +

2d.layer.anisotropic-blur.y-only

+

Checks that layers allow gaussian blur with separate X and Y components.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.y-only.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.y-only.w.html new file mode 100644 index 0000000000..062328db75 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.anisotropic-blur.y-only.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.layer.anisotropic-blur.y-only +

2d.layer.anisotropic-blur.y-only

+

Checks that layers allow gaussian blur with separate X and Y components.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.beginLayer-options.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.beginLayer-options.html new file mode 100644 index 0000000000..4fb042a1d8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.beginLayer-options.html @@ -0,0 +1,51 @@ + + +OffscreenCanvas test: 2d.layer.beginLayer-options + + + + +

2d.layer.beginLayer-options

+

Checks beginLayer works for different option parameter values

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.beginLayer-options.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.beginLayer-options.worker.js new file mode 100644 index 0000000000..cafbc83f3e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.beginLayer-options.worker.js @@ -0,0 +1,46 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.beginLayer-options +// Description:Checks beginLayer works for different option parameter values +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Checks beginLayer works for different option parameter values"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.beginLayer(); ctx.endLayer(); + ctx.beginLayer(null); ctx.endLayer(); + ctx.beginLayer(undefined); ctx.endLayer(); + ctx.beginLayer([]); ctx.endLayer(); + ctx.beginLayer({}); ctx.endLayer(); + + assert_throws_js(TypeError, function() { ctx.beginLayer(''); }); + assert_throws_js(TypeError, function() { ctx.beginLayer(0); }); + assert_throws_js(TypeError, function() { ctx.beginLayer(1); }); + assert_throws_js(TypeError, function() { ctx.beginLayer(true); }); + assert_throws_js(TypeError, function() { ctx.beginLayer(false); }); + + ctx.beginLayer({filter: null}); ctx.endLayer(); + ctx.beginLayer({filter: undefined}); ctx.endLayer(); + ctx.beginLayer({filter: []}); ctx.endLayer(); + ctx.beginLayer({filter: {}}); ctx.endLayer(); + ctx.beginLayer({filter: {name: "unknown"}}); ctx.endLayer(); + ctx.beginLayer({filter: ''}); ctx.endLayer(); + + // These cases don't throw TypeError since they can be casted to a + // DOMString. + ctx.beginLayer({filter: 0}); ctx.endLayer(); + ctx.beginLayer({filter: 1}); ctx.endLayer(); + ctx.beginLayer({filter: true}); ctx.endLayer(); + ctx.beginLayer({filter: false}); ctx.endLayer(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.no-clipping-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.no-clipping-expected.html new file mode 100644 index 0000000000..6cad180f14 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.no-clipping-expected.html @@ -0,0 +1,36 @@ + + +Canvas test: 2d.layer.blur-from-outside-canvas.no-clipping +

2d.layer.blur-from-outside-canvas.no-clipping

+

Checks blur leaking inside from drawing outside the canvas

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.no-clipping.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.no-clipping.html new file mode 100644 index 0000000000..3cd1c674a1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.no-clipping.html @@ -0,0 +1,31 @@ + + + +Canvas test: 2d.layer.blur-from-outside-canvas.no-clipping +

2d.layer.blur-from-outside-canvas.no-clipping

+

Checks blur leaking inside from drawing outside the canvas

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.no-clipping.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.no-clipping.w.html new file mode 100644 index 0000000000..90b013c077 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.no-clipping.w.html @@ -0,0 +1,45 @@ + + + + +Canvas test: 2d.layer.blur-from-outside-canvas.no-clipping +

2d.layer.blur-from-outside-canvas.no-clipping

+

Checks blur leaking inside from drawing outside the canvas

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.with-clipping-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.with-clipping-expected.html new file mode 100644 index 0000000000..1823f78983 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.with-clipping-expected.html @@ -0,0 +1,38 @@ + + +Canvas test: 2d.layer.blur-from-outside-canvas.with-clipping +

2d.layer.blur-from-outside-canvas.with-clipping

+

Checks blur leaking inside from drawing outside the canvas

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.with-clipping.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.with-clipping.html new file mode 100644 index 0000000000..76477445e5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.with-clipping.html @@ -0,0 +1,33 @@ + + + +Canvas test: 2d.layer.blur-from-outside-canvas.with-clipping +

2d.layer.blur-from-outside-canvas.with-clipping

+

Checks blur leaking inside from drawing outside the canvas

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.with-clipping.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.with-clipping.w.html new file mode 100644 index 0000000000..cf5570c932 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.blur-from-outside-canvas.with-clipping.w.html @@ -0,0 +1,47 @@ + + + + +Canvas test: 2d.layer.blur-from-outside-canvas.with-clipping +

2d.layer.blur-from-outside-canvas.with-clipping

+

Checks blur leaking inside from drawing outside the canvas

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.full-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.full-expected.html new file mode 100644 index 0000000000..5a47f8e118 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.full-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.layer.clearRect.full +

2d.layer.clearRect.full

+

clearRect inside a layer can clear all of the layer content.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.full.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.full.html new file mode 100644 index 0000000000..ec9f453b69 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.full.html @@ -0,0 +1,26 @@ + + + +Canvas test: 2d.layer.clearRect.full +

2d.layer.clearRect.full

+

clearRect inside a layer can clear all of the layer content.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.full.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.full.w.html new file mode 100644 index 0000000000..a6f4021dd5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.full.w.html @@ -0,0 +1,40 @@ + + + + +Canvas test: 2d.layer.clearRect.full +

2d.layer.clearRect.full

+

clearRect inside a layer can clear all of the layer content.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.partial-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.partial-expected.html new file mode 100644 index 0000000000..ac75105cec --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.partial-expected.html @@ -0,0 +1,21 @@ + + +Canvas test: 2d.layer.clearRect.partial +

2d.layer.clearRect.partial

+

clearRect inside a layer can clear a portion of the layer content.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.partial.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.partial.html new file mode 100644 index 0000000000..88509a8a40 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.partial.html @@ -0,0 +1,25 @@ + + + +Canvas test: 2d.layer.clearRect.partial +

2d.layer.clearRect.partial

+

clearRect inside a layer can clear a portion of the layer content.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.partial.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.partial.w.html new file mode 100644 index 0000000000..c6ba41afd7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clearRect.partial.w.html @@ -0,0 +1,39 @@ + + + + +Canvas test: 2d.layer.clearRect.partial +

2d.layer.clearRect.partial

+

clearRect inside a layer can clear a portion of the layer content.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-and-outside-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-and-outside-expected.html new file mode 100644 index 0000000000..14e6d56245 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-and-outside-expected.html @@ -0,0 +1,34 @@ + + +Canvas test: 2d.layer.clip-inside-and-outside +

2d.layer.clip-inside-and-outside

+

Check clipping set inside and outside the layer

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-and-outside.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-and-outside.html new file mode 100644 index 0000000000..03a3aee605 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-and-outside.html @@ -0,0 +1,30 @@ + + + +Canvas test: 2d.layer.clip-inside-and-outside +

2d.layer.clip-inside-and-outside

+

Check clipping set inside and outside the layer

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-and-outside.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-and-outside.w.html new file mode 100644 index 0000000000..71f9fe7db4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-and-outside.w.html @@ -0,0 +1,44 @@ + + + + +Canvas test: 2d.layer.clip-inside-and-outside +

2d.layer.clip-inside-and-outside

+

Check clipping set inside and outside the layer

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-expected.html new file mode 100644 index 0000000000..281fc1d913 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside-expected.html @@ -0,0 +1,26 @@ + + +Canvas test: 2d.layer.clip-inside +

2d.layer.clip-inside

+

Check clipping set inside the layer

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside.html new file mode 100644 index 0000000000..e0c41f21e1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside.html @@ -0,0 +1,26 @@ + + + +Canvas test: 2d.layer.clip-inside +

2d.layer.clip-inside

+

Check clipping set inside the layer

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside.w.html new file mode 100644 index 0000000000..9c4260a8ce --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-inside.w.html @@ -0,0 +1,40 @@ + + + + +Canvas test: 2d.layer.clip-inside +

2d.layer.clip-inside

+

Check clipping set inside the layer

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-outside-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-outside-expected.html new file mode 100644 index 0000000000..1b18c2e8a7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-outside-expected.html @@ -0,0 +1,26 @@ + + +Canvas test: 2d.layer.clip-outside +

2d.layer.clip-outside

+

Check clipping set outside the layer

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-outside.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-outside.html new file mode 100644 index 0000000000..d2d091e96b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-outside.html @@ -0,0 +1,25 @@ + + + +Canvas test: 2d.layer.clip-outside +

2d.layer.clip-outside

+

Check clipping set outside the layer

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-outside.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-outside.w.html new file mode 100644 index 0000000000..aed72db5ab --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.clip-outside.w.html @@ -0,0 +1,39 @@ + + + + +Canvas test: 2d.layer.clip-outside +

2d.layer.clip-outside

+

Check clipping set outside the layer

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.cross-layer-paths-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.cross-layer-paths-expected.html new file mode 100644 index 0000000000..c394ecdfe3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.cross-layer-paths-expected.html @@ -0,0 +1,14 @@ + + +Canvas test: 2d.layer.cross-layer-paths +

2d.layer.cross-layer-paths

+

Checks that path defined in a layer is usable outside.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.cross-layer-paths.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.cross-layer-paths.html new file mode 100644 index 0000000000..f167ae00bd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.cross-layer-paths.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.layer.cross-layer-paths +

2d.layer.cross-layer-paths

+

Checks that path defined in a layer is usable outside.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.cross-layer-paths.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.cross-layer-paths.w.html new file mode 100644 index 0000000000..5b1f7f949c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.cross-layer-paths.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.layer.cross-layer-paths +

2d.layer.cross-layer-paths

+

Checks that path defined in a layer is usable outside.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-and-shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-and-shadow-expected.html new file mode 100644 index 0000000000..85503ae33a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-and-shadow-expected.html @@ -0,0 +1,17 @@ + + +Canvas test: 2d.layer.css-filters.blur-and-shadow +

2d.layer.css-filters.blur-and-shadow

+

Checks that beginLayer works with a CSS filter string as input.

+ + + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-and-shadow.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-and-shadow.html new file mode 100644 index 0000000000..a44ce4707f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-and-shadow.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.layer.css-filters.blur-and-shadow +

2d.layer.css-filters.blur-and-shadow

+

Checks that beginLayer works with a CSS filter string as input.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-and-shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-and-shadow.w.html new file mode 100644 index 0000000000..9413ca6674 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-and-shadow.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.layer.css-filters.blur-and-shadow +

2d.layer.css-filters.blur-and-shadow

+

Checks that beginLayer works with a CSS filter string as input.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-expected.html new file mode 100644 index 0000000000..c6131f6c1e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur-expected.html @@ -0,0 +1,16 @@ + + +Canvas test: 2d.layer.css-filters.blur +

2d.layer.css-filters.blur

+

Checks that beginLayer works with a CSS filter string as input.

+ + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur.html new file mode 100644 index 0000000000..5407ec37ad --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.layer.css-filters.blur +

2d.layer.css-filters.blur

+

Checks that beginLayer works with a CSS filter string as input.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur.w.html new file mode 100644 index 0000000000..35af0e1bfb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.blur.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.layer.css-filters.blur +

2d.layer.css-filters.blur

+

Checks that beginLayer works with a CSS filter string as input.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.shadow-expected.html new file mode 100644 index 0000000000..60f78d8096 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.shadow-expected.html @@ -0,0 +1,16 @@ + + +Canvas test: 2d.layer.css-filters.shadow +

2d.layer.css-filters.shadow

+

Checks that beginLayer works with a CSS filter string as input.

+ + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.shadow.html new file mode 100644 index 0000000000..28d6e6e403 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.shadow.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.layer.css-filters.shadow +

2d.layer.css-filters.shadow

+

Checks that beginLayer works with a CSS filter string as input.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.shadow.w.html new file mode 100644 index 0000000000..98e9d2fbd4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.css-filters.shadow.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.layer.css-filters.shadow +

2d.layer.css-filters.shadow

+

Checks that beginLayer works with a CSS filter string as input.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.exceptions-are-no-op.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.exceptions-are-no-op.html new file mode 100644 index 0000000000..a047c539cf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.exceptions-are-no-op.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.layer.exceptions-are-no-op + + + + +

2d.layer.exceptions-are-no-op

+

Checks that the context state is left unchanged if beginLayer throws.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.exceptions-are-no-op.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.exceptions-are-no-op.worker.js new file mode 100644 index 0000000000..bd1e376084 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.exceptions-are-no-op.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.exceptions-are-no-op +// Description:Checks that the context state is left unchanged if beginLayer throws. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Checks that the context state is left unchanged if beginLayer throws."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // Get `beginLayer` to throw while parsing the filter. + assert_throws_js(TypeError, + () => ctx.beginLayer({filter: {name: 'colorMatrix', + values: 'foo'}})); + // `beginLayer` shouldn't have opened the layer, so `endLayer` should throw. + assert_throws_dom("InvalidStateError", () => ctx.endLayer()); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-filter-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-filter-expected.html new file mode 100644 index 0000000000..88057fc354 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-filter-expected.html @@ -0,0 +1,17 @@ + + +Canvas test: 2d.layer.global-filter +

2d.layer.global-filter

+

Tests that layers ignore the global context filter.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-filter.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-filter.html new file mode 100644 index 0000000000..2388a06a96 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-filter.html @@ -0,0 +1,29 @@ + + + +Canvas test: 2d.layer.global-filter +

2d.layer.global-filter

+

Tests that layers ignore the global context filter.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-filter.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-filter.w.html new file mode 100644 index 0000000000..4c8f92d18a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-filter.w.html @@ -0,0 +1,43 @@ + + + + +Canvas test: 2d.layer.global-filter +

2d.layer.global-filter

+

Tests that layers ignore the global context filter.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha-expected.html new file mode 100644 index 0000000000..0666e3098a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha-expected.html @@ -0,0 +1,31 @@ + + +Canvas test: 2d.layer.global-states.alpha +

2d.layer.global-states.alpha

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending-expected.html new file mode 100644 index 0000000000..8a45027588 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending-expected.html @@ -0,0 +1,32 @@ + + +Canvas test: 2d.layer.global-states.alpha.blending +

2d.layer.global-states.alpha.blending

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.html new file mode 100644 index 0000000000..71414b4b37 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.html @@ -0,0 +1,38 @@ + + + +Canvas test: 2d.layer.global-states.alpha.blending +

2d.layer.global-states.alpha.blending

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.shadow-expected.html new file mode 100644 index 0000000000..f7b633b35f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.shadow-expected.html @@ -0,0 +1,36 @@ + + +Canvas test: 2d.layer.global-states.alpha.blending.shadow +

2d.layer.global-states.alpha.blending.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.shadow.html new file mode 100644 index 0000000000..ed2d2d70af --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.shadow.html @@ -0,0 +1,42 @@ + + + +Canvas test: 2d.layer.global-states.alpha.blending.shadow +

2d.layer.global-states.alpha.blending.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.shadow.w.html new file mode 100644 index 0000000000..1ff3ad8385 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.shadow.w.html @@ -0,0 +1,56 @@ + + + + +Canvas test: 2d.layer.global-states.alpha.blending.shadow +

2d.layer.global-states.alpha.blending.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.w.html new file mode 100644 index 0000000000..618480c813 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.blending.w.html @@ -0,0 +1,52 @@ + + + + +Canvas test: 2d.layer.global-states.alpha.blending +

2d.layer.global-states.alpha.blending

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite-expected.html new file mode 100644 index 0000000000..951049e638 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite-expected.html @@ -0,0 +1,32 @@ + + +Canvas test: 2d.layer.global-states.alpha.composite +

2d.layer.global-states.alpha.composite

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.html new file mode 100644 index 0000000000..94fed5752d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.html @@ -0,0 +1,38 @@ + + + +Canvas test: 2d.layer.global-states.alpha.composite +

2d.layer.global-states.alpha.composite

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.shadow-expected.html new file mode 100644 index 0000000000..0ae93871f5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.shadow-expected.html @@ -0,0 +1,36 @@ + + +Canvas test: 2d.layer.global-states.alpha.composite.shadow +

2d.layer.global-states.alpha.composite.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.shadow.html new file mode 100644 index 0000000000..eb579cdcce --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.shadow.html @@ -0,0 +1,42 @@ + + + +Canvas test: 2d.layer.global-states.alpha.composite.shadow +

2d.layer.global-states.alpha.composite.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.shadow.w.html new file mode 100644 index 0000000000..60e36f4b97 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.shadow.w.html @@ -0,0 +1,56 @@ + + + + +Canvas test: 2d.layer.global-states.alpha.composite.shadow +

2d.layer.global-states.alpha.composite.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.w.html new file mode 100644 index 0000000000..d7d2b7a21e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.composite.w.html @@ -0,0 +1,52 @@ + + + + +Canvas test: 2d.layer.global-states.alpha.composite +

2d.layer.global-states.alpha.composite

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.html new file mode 100644 index 0000000000..63a264e681 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.html @@ -0,0 +1,37 @@ + + + +Canvas test: 2d.layer.global-states.alpha +

2d.layer.global-states.alpha

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.shadow-expected.html new file mode 100644 index 0000000000..6f764c5001 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.shadow-expected.html @@ -0,0 +1,35 @@ + + +Canvas test: 2d.layer.global-states.alpha.shadow +

2d.layer.global-states.alpha.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.shadow.html new file mode 100644 index 0000000000..65a66c977d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.shadow.html @@ -0,0 +1,41 @@ + + + +Canvas test: 2d.layer.global-states.alpha.shadow +

2d.layer.global-states.alpha.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.shadow.w.html new file mode 100644 index 0000000000..f404601e3d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.shadow.w.html @@ -0,0 +1,55 @@ + + + + +Canvas test: 2d.layer.global-states.alpha.shadow +

2d.layer.global-states.alpha.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.w.html new file mode 100644 index 0000000000..694f31e208 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.alpha.w.html @@ -0,0 +1,51 @@ + + + + +Canvas test: 2d.layer.global-states.alpha +

2d.layer.global-states.alpha

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending-expected.html new file mode 100644 index 0000000000..33fdf46a28 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending-expected.html @@ -0,0 +1,31 @@ + + +Canvas test: 2d.layer.global-states.blending +

2d.layer.global-states.blending

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.html new file mode 100644 index 0000000000..6a36bb4ba1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.html @@ -0,0 +1,37 @@ + + + +Canvas test: 2d.layer.global-states.blending +

2d.layer.global-states.blending

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.shadow-expected.html new file mode 100644 index 0000000000..6f969074f9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.shadow-expected.html @@ -0,0 +1,35 @@ + + +Canvas test: 2d.layer.global-states.blending.shadow +

2d.layer.global-states.blending.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.shadow.html new file mode 100644 index 0000000000..2e91f3d2d1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.shadow.html @@ -0,0 +1,41 @@ + + + +Canvas test: 2d.layer.global-states.blending.shadow +

2d.layer.global-states.blending.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.shadow.w.html new file mode 100644 index 0000000000..d8e20d0479 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.shadow.w.html @@ -0,0 +1,55 @@ + + + + +Canvas test: 2d.layer.global-states.blending.shadow +

2d.layer.global-states.blending.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.w.html new file mode 100644 index 0000000000..8964e97713 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.blending.w.html @@ -0,0 +1,51 @@ + + + + +Canvas test: 2d.layer.global-states.blending +

2d.layer.global-states.blending

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite-expected.html new file mode 100644 index 0000000000..ed7669c4cf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite-expected.html @@ -0,0 +1,31 @@ + + +Canvas test: 2d.layer.global-states.composite +

2d.layer.global-states.composite

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.html new file mode 100644 index 0000000000..84fb4b3d95 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.html @@ -0,0 +1,37 @@ + + + +Canvas test: 2d.layer.global-states.composite +

2d.layer.global-states.composite

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.shadow-expected.html new file mode 100644 index 0000000000..b687c27f47 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.shadow-expected.html @@ -0,0 +1,35 @@ + + +Canvas test: 2d.layer.global-states.composite.shadow +

2d.layer.global-states.composite.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.shadow.html new file mode 100644 index 0000000000..1e3ab4d6a0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.shadow.html @@ -0,0 +1,41 @@ + + + +Canvas test: 2d.layer.global-states.composite.shadow +

2d.layer.global-states.composite.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.shadow.w.html new file mode 100644 index 0000000000..7dfb70148b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.shadow.w.html @@ -0,0 +1,55 @@ + + + + +Canvas test: 2d.layer.global-states.composite.shadow +

2d.layer.global-states.composite.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.w.html new file mode 100644 index 0000000000..b695871fcd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.composite.w.html @@ -0,0 +1,51 @@ + + + + +Canvas test: 2d.layer.global-states.composite +

2d.layer.global-states.composite

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha-expected.html new file mode 100644 index 0000000000..f304700feb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha-expected.html @@ -0,0 +1,50 @@ + + +Canvas test: 2d.layer.global-states.filter.alpha +

2d.layer.global-states.filter.alpha

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending-expected.html new file mode 100644 index 0000000000..7c91ce4229 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending-expected.html @@ -0,0 +1,51 @@ + + +Canvas test: 2d.layer.global-states.filter.alpha.blending +

2d.layer.global-states.filter.alpha.blending

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.html new file mode 100644 index 0000000000..be6f962b33 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.html @@ -0,0 +1,41 @@ + + + +Canvas test: 2d.layer.global-states.filter.alpha.blending +

2d.layer.global-states.filter.alpha.blending

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.shadow-expected.html new file mode 100644 index 0000000000..62942ffeae --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.shadow-expected.html @@ -0,0 +1,55 @@ + + +Canvas test: 2d.layer.global-states.filter.alpha.blending.shadow +

2d.layer.global-states.filter.alpha.blending.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.shadow.html new file mode 100644 index 0000000000..62d98d967c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.shadow.html @@ -0,0 +1,45 @@ + + + +Canvas test: 2d.layer.global-states.filter.alpha.blending.shadow +

2d.layer.global-states.filter.alpha.blending.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.shadow.w.html new file mode 100644 index 0000000000..e81efd6b8d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.shadow.w.html @@ -0,0 +1,59 @@ + + + + +Canvas test: 2d.layer.global-states.filter.alpha.blending.shadow +

2d.layer.global-states.filter.alpha.blending.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.w.html new file mode 100644 index 0000000000..2b53ad7c1e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.blending.w.html @@ -0,0 +1,55 @@ + + + + +Canvas test: 2d.layer.global-states.filter.alpha.blending +

2d.layer.global-states.filter.alpha.blending

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite-expected.html new file mode 100644 index 0000000000..8e0d98648e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite-expected.html @@ -0,0 +1,51 @@ + + +Canvas test: 2d.layer.global-states.filter.alpha.composite +

2d.layer.global-states.filter.alpha.composite

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.html new file mode 100644 index 0000000000..087fea88af --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.html @@ -0,0 +1,41 @@ + + + +Canvas test: 2d.layer.global-states.filter.alpha.composite +

2d.layer.global-states.filter.alpha.composite

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.shadow-expected.html new file mode 100644 index 0000000000..a649972546 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.shadow-expected.html @@ -0,0 +1,55 @@ + + +Canvas test: 2d.layer.global-states.filter.alpha.composite.shadow +

2d.layer.global-states.filter.alpha.composite.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.shadow.html new file mode 100644 index 0000000000..d067ff2f5e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.shadow.html @@ -0,0 +1,45 @@ + + + +Canvas test: 2d.layer.global-states.filter.alpha.composite.shadow +

2d.layer.global-states.filter.alpha.composite.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.shadow.w.html new file mode 100644 index 0000000000..39abc78b17 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.shadow.w.html @@ -0,0 +1,59 @@ + + + + +Canvas test: 2d.layer.global-states.filter.alpha.composite.shadow +

2d.layer.global-states.filter.alpha.composite.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.w.html new file mode 100644 index 0000000000..6aa83a3278 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.composite.w.html @@ -0,0 +1,55 @@ + + + + +Canvas test: 2d.layer.global-states.filter.alpha.composite +

2d.layer.global-states.filter.alpha.composite

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.html new file mode 100644 index 0000000000..f1d631c25c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.html @@ -0,0 +1,40 @@ + + + +Canvas test: 2d.layer.global-states.filter.alpha +

2d.layer.global-states.filter.alpha

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow-expected.html new file mode 100644 index 0000000000..169baee29b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow-expected.html @@ -0,0 +1,54 @@ + + +Canvas test: 2d.layer.global-states.filter.alpha.shadow +

2d.layer.global-states.filter.alpha.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.html new file mode 100644 index 0000000000..2548c21181 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.html @@ -0,0 +1,44 @@ + + + +Canvas test: 2d.layer.global-states.filter.alpha.shadow +

2d.layer.global-states.filter.alpha.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.w.html new file mode 100644 index 0000000000..5e1494422e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.shadow.w.html @@ -0,0 +1,58 @@ + + + + +Canvas test: 2d.layer.global-states.filter.alpha.shadow +

2d.layer.global-states.filter.alpha.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.w.html new file mode 100644 index 0000000000..e75d668ad5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.alpha.w.html @@ -0,0 +1,54 @@ + + + + +Canvas test: 2d.layer.global-states.filter.alpha +

2d.layer.global-states.filter.alpha

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending-expected.html new file mode 100644 index 0000000000..f81dcf72dc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending-expected.html @@ -0,0 +1,50 @@ + + +Canvas test: 2d.layer.global-states.filter.blending +

2d.layer.global-states.filter.blending

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.html new file mode 100644 index 0000000000..ce2b046798 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.html @@ -0,0 +1,40 @@ + + + +Canvas test: 2d.layer.global-states.filter.blending +

2d.layer.global-states.filter.blending

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.shadow-expected.html new file mode 100644 index 0000000000..91f3725f8e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.shadow-expected.html @@ -0,0 +1,54 @@ + + +Canvas test: 2d.layer.global-states.filter.blending.shadow +

2d.layer.global-states.filter.blending.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.shadow.html new file mode 100644 index 0000000000..d0d429bee3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.shadow.html @@ -0,0 +1,44 @@ + + + +Canvas test: 2d.layer.global-states.filter.blending.shadow +

2d.layer.global-states.filter.blending.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.shadow.w.html new file mode 100644 index 0000000000..ce432ea74d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.shadow.w.html @@ -0,0 +1,58 @@ + + + + +Canvas test: 2d.layer.global-states.filter.blending.shadow +

2d.layer.global-states.filter.blending.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.w.html new file mode 100644 index 0000000000..bb101cdc0b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.blending.w.html @@ -0,0 +1,54 @@ + + + + +Canvas test: 2d.layer.global-states.filter.blending +

2d.layer.global-states.filter.blending

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite-expected.html new file mode 100644 index 0000000000..97e85a1593 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite-expected.html @@ -0,0 +1,50 @@ + + +Canvas test: 2d.layer.global-states.filter.composite +

2d.layer.global-states.filter.composite

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.html new file mode 100644 index 0000000000..32052a1150 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.html @@ -0,0 +1,40 @@ + + + +Canvas test: 2d.layer.global-states.filter.composite +

2d.layer.global-states.filter.composite

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.shadow-expected.html new file mode 100644 index 0000000000..4716bb2760 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.shadow-expected.html @@ -0,0 +1,54 @@ + + +Canvas test: 2d.layer.global-states.filter.composite.shadow +

2d.layer.global-states.filter.composite.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.shadow.html new file mode 100644 index 0000000000..b5e8b9f843 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.shadow.html @@ -0,0 +1,44 @@ + + + +Canvas test: 2d.layer.global-states.filter.composite.shadow +

2d.layer.global-states.filter.composite.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.shadow.w.html new file mode 100644 index 0000000000..894089d88e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.shadow.w.html @@ -0,0 +1,58 @@ + + + + +Canvas test: 2d.layer.global-states.filter.composite.shadow +

2d.layer.global-states.filter.composite.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.w.html new file mode 100644 index 0000000000..41ccdaf5c0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.composite.w.html @@ -0,0 +1,54 @@ + + + + +Canvas test: 2d.layer.global-states.filter.composite +

2d.layer.global-states.filter.composite

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.no-global-states-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.no-global-states-expected.html new file mode 100644 index 0000000000..e56fe0b360 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.no-global-states-expected.html @@ -0,0 +1,50 @@ + + +Canvas test: 2d.layer.global-states.filter.no-global-states +

2d.layer.global-states.filter.no-global-states

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.no-global-states.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.no-global-states.html new file mode 100644 index 0000000000..3effa3ee9d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.no-global-states.html @@ -0,0 +1,40 @@ + + + +Canvas test: 2d.layer.global-states.filter.no-global-states +

2d.layer.global-states.filter.no-global-states

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.no-global-states.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.no-global-states.w.html new file mode 100644 index 0000000000..ec744d7ffe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.no-global-states.w.html @@ -0,0 +1,54 @@ + + + + +Canvas test: 2d.layer.global-states.filter.no-global-states +

2d.layer.global-states.filter.no-global-states

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.shadow-expected.html new file mode 100644 index 0000000000..13ba2dd4cd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.shadow-expected.html @@ -0,0 +1,53 @@ + + +Canvas test: 2d.layer.global-states.filter.shadow +

2d.layer.global-states.filter.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.shadow.html new file mode 100644 index 0000000000..7bb0ef5e13 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.shadow.html @@ -0,0 +1,43 @@ + + + +Canvas test: 2d.layer.global-states.filter.shadow +

2d.layer.global-states.filter.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.shadow.w.html new file mode 100644 index 0000000000..bc9bd48aad --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.filter.shadow.w.html @@ -0,0 +1,57 @@ + + + + +Canvas test: 2d.layer.global-states.filter.shadow +

2d.layer.global-states.filter.shadow

+

Checks that layers with filters correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.no-global-states-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.no-global-states-expected.html new file mode 100644 index 0000000000..b91a2ae8b5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.no-global-states-expected.html @@ -0,0 +1,31 @@ + + +Canvas test: 2d.layer.global-states.no-global-states +

2d.layer.global-states.no-global-states

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.no-global-states.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.no-global-states.html new file mode 100644 index 0000000000..c8a9815381 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.no-global-states.html @@ -0,0 +1,37 @@ + + + +Canvas test: 2d.layer.global-states.no-global-states +

2d.layer.global-states.no-global-states

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.no-global-states.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.no-global-states.w.html new file mode 100644 index 0000000000..db03a3fd0c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.no-global-states.w.html @@ -0,0 +1,51 @@ + + + + +Canvas test: 2d.layer.global-states.no-global-states +

2d.layer.global-states.no-global-states

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.shadow-expected.html new file mode 100644 index 0000000000..835e9d420a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.shadow-expected.html @@ -0,0 +1,34 @@ + + +Canvas test: 2d.layer.global-states.shadow +

2d.layer.global-states.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.shadow.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.shadow.html new file mode 100644 index 0000000000..ad60e87fb1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.shadow.html @@ -0,0 +1,40 @@ + + + +Canvas test: 2d.layer.global-states.shadow +

2d.layer.global-states.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.shadow.w.html new file mode 100644 index 0000000000..1fc35fd33a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.global-states.shadow.w.html @@ -0,0 +1,54 @@ + + + + +Canvas test: 2d.layer.global-states.shadow +

2d.layer.global-states.shadow

+

Checks that layers correctly use global render states.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-reset-endLayer.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-reset-endLayer.html new file mode 100644 index 0000000000..c0b11aa611 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-reset-endLayer.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.layer.invalid-calls.beginLayer-reset-endLayer + + + + +

2d.layer.invalid-calls.beginLayer-reset-endLayer

+

Raises exception on beginLayer() + reset() + endLayer().

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-reset-endLayer.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-reset-endLayer.worker.js new file mode 100644 index 0000000000..1c147d6f34 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-reset-endLayer.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.invalid-calls.beginLayer-reset-endLayer +// Description:Raises exception on beginLayer() + reset() + endLayer(). +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Raises exception on beginLayer() + reset() + endLayer()."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("INVALID_STATE_ERR", function() { + ctx.beginLayer(); + ctx.reset(); + ctx.endLayer(); + }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-restore.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-restore.html new file mode 100644 index 0000000000..022532b329 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-restore.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.layer.invalid-calls.beginLayer-restore + + + + +

2d.layer.invalid-calls.beginLayer-restore

+

Raises exception on beginLayer() + restore().

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-restore.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-restore.worker.js new file mode 100644 index 0000000000..1aa86635e6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-restore.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.invalid-calls.beginLayer-restore +// Description:Raises exception on beginLayer() + restore(). +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Raises exception on beginLayer() + restore()."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("INVALID_STATE_ERR", function() { + ctx.beginLayer(); + ctx.restore(); + }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-save-endLayer.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-save-endLayer.html new file mode 100644 index 0000000000..26dd0eee4b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-save-endLayer.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.layer.invalid-calls.beginLayer-save-endLayer + + + + +

2d.layer.invalid-calls.beginLayer-save-endLayer

+

Raises exception on beginLayer() + save() + endLayer().

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-save-endLayer.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-save-endLayer.worker.js new file mode 100644 index 0000000000..613921c67c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.beginLayer-save-endLayer.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.invalid-calls.beginLayer-save-endLayer +// Description:Raises exception on beginLayer() + save() + endLayer(). +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Raises exception on beginLayer() + save() + endLayer()."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("INVALID_STATE_ERR", function() { + ctx.beginLayer(); + ctx.save(); + ctx.endLayer(); + }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.endLayer.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.endLayer.html new file mode 100644 index 0000000000..440249980a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.endLayer.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.layer.invalid-calls.endLayer + + + + +

2d.layer.invalid-calls.endLayer

+

Raises exception on lone endLayer calls.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.endLayer.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.endLayer.worker.js new file mode 100644 index 0000000000..b2ba231b9c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.endLayer.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.invalid-calls.endLayer +// Description:Raises exception on lone endLayer calls. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Raises exception on lone endLayer calls."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("INVALID_STATE_ERR", function() { + ctx.endLayer(); + }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-beginLayer-restore.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-beginLayer-restore.html new file mode 100644 index 0000000000..c2b09961ac --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-beginLayer-restore.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.layer.invalid-calls.save-beginLayer-restore + + + + +

2d.layer.invalid-calls.save-beginLayer-restore

+

Raises exception on save() + beginLayer() + restore().

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-beginLayer-restore.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-beginLayer-restore.worker.js new file mode 100644 index 0000000000..d155379fcb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-beginLayer-restore.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.invalid-calls.save-beginLayer-restore +// Description:Raises exception on save() + beginLayer() + restore(). +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Raises exception on save() + beginLayer() + restore()."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("INVALID_STATE_ERR", function() { + ctx.save(); + ctx.beginLayer(); + ctx.restore(); + }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-endLayer.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-endLayer.html new file mode 100644 index 0000000000..01b62d1e85 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-endLayer.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.layer.invalid-calls.save-endLayer + + + + +

2d.layer.invalid-calls.save-endLayer

+

Raises exception on save() + endLayer().

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-endLayer.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-endLayer.worker.js new file mode 100644 index 0000000000..353c1b00cd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.invalid-calls.save-endLayer.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.invalid-calls.save-endLayer +// Description:Raises exception on save() + endLayer(). +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Raises exception on save() + endLayer()."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("INVALID_STATE_ERR", function() { + ctx.save(); + ctx.endLayer(); + }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.html new file mode 100644 index 0000000000..867553b45e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.html @@ -0,0 +1,57 @@ + + +OffscreenCanvas test: 2d.layer.layer-rendering-state-reset-in-layer + + + + +

2d.layer.layer-rendering-state-reset-in-layer

+

Tests that layers ignore the global context filter.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.worker.js new file mode 100644 index 0000000000..5c2bb73e8f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.layer-rendering-state-reset-in-layer.worker.js @@ -0,0 +1,52 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.layer-rendering-state-reset-in-layer +// Description:Tests that layers ignore the global context filter. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Tests that layers ignore the global context filter."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.globalAlpha = 0.5; + ctx.globalCompositeOperation = 'xor'; + ctx.shadowColor = '#0000ff'; + ctx.shadowOffsetX = 10; + ctx.shadowOffsetY = 20; + ctx.shadowBlur = 30; + + _assertSame(ctx.globalAlpha, 0.5, "ctx.globalAlpha", "0.5"); + _assertSame(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + _assertSame(ctx.shadowColor, '#0000ff', "ctx.shadowColor", "'#0000ff'"); + _assertSame(ctx.shadowOffsetX, 10, "ctx.shadowOffsetX", "10"); + _assertSame(ctx.shadowOffsetY, 20, "ctx.shadowOffsetY", "20"); + _assertSame(ctx.shadowBlur, 30, "ctx.shadowBlur", "30"); + + ctx.beginLayer(); + + _assertSame(ctx.globalAlpha, 1.0, "ctx.globalAlpha", "1.0"); + _assertSame(ctx.globalCompositeOperation, 'source-over', "ctx.globalCompositeOperation", "'source-over'"); + _assertSame(ctx.shadowColor, 'rgba(0, 0, 0, 0)', "ctx.shadowColor", "'rgba(0, 0, 0, 0)'"); + _assertSame(ctx.shadowOffsetX, 0, "ctx.shadowOffsetX", "0"); + _assertSame(ctx.shadowOffsetY, 0, "ctx.shadowOffsetY", "0"); + _assertSame(ctx.shadowBlur, 0, "ctx.shadowBlur", "0"); + + ctx.endLayer(); + + _assertSame(ctx.globalAlpha, 0.5, "ctx.globalAlpha", "0.5"); + _assertSame(ctx.globalCompositeOperation, 'xor', "ctx.globalCompositeOperation", "'xor'"); + _assertSame(ctx.shadowColor, '#0000ff', "ctx.shadowColor", "'#0000ff'"); + _assertSame(ctx.shadowOffsetX, 10, "ctx.shadowOffsetX", "10"); + _assertSame(ctx.shadowOffsetY, 20, "ctx.shadowOffsetY", "20"); + _assertSame(ctx.shadowBlur, 30, "ctx.shadowBlur", "30"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.convertToBlob.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.convertToBlob.html new file mode 100644 index 0000000000..0b3854c31d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.convertToBlob.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.layer.malformed-operations-with-promises.convertToBlob + + + + +

2d.layer.malformed-operations-with-promises.convertToBlob

+

Check that exceptions are thrown for operations that are malformed while layers are open.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.convertToBlob.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.convertToBlob.worker.js new file mode 100644 index 0000000000..be0f4f2cde --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.convertToBlob.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.malformed-operations-with-promises.convertToBlob +// Description:Check that exceptions are thrown for operations that are malformed while layers are open. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(200, 200); + var ctx = canvas.getContext('2d'); + + // Shouldn't throw on its own. + await canvas.convertToBlob(); + // Make sure the exception isn't caused by calling the function twice. + await canvas.convertToBlob(); + // Calling again inside a layer should throw. + ctx.beginLayer(); + await promise_rejects_dom(t, 'InvalidStateError', canvas.convertToBlob()); + t.done(); +}, "Check that exceptions are thrown for operations that are malformed while layers are open."); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.createImageBitmap.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.createImageBitmap.html new file mode 100644 index 0000000000..085554d9f5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.createImageBitmap.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.layer.malformed-operations-with-promises.createImageBitmap + + + + +

2d.layer.malformed-operations-with-promises.createImageBitmap

+

Check that exceptions are thrown for operations that are malformed while layers are open.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.createImageBitmap.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.createImageBitmap.worker.js new file mode 100644 index 0000000000..b286b7a9e7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations-with-promises.createImageBitmap.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.malformed-operations-with-promises.createImageBitmap +// Description:Check that exceptions are thrown for operations that are malformed while layers are open. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(200, 200); + var ctx = canvas.getContext('2d'); + + // Shouldn't throw on its own. + await createImageBitmap(canvas); + // Make sure the exception isn't caused by calling the function twice. + await createImageBitmap(canvas); + // Calling again inside a layer should throw. + ctx.beginLayer(); + await promise_rejects_dom(t, 'InvalidStateError', createImageBitmap(canvas)); + t.done(); +}, "Check that exceptions are thrown for operations that are malformed while layers are open."); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.createPattern.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.createPattern.html new file mode 100644 index 0000000000..a206e64ceb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.createPattern.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.layer.malformed-operations.createPattern + + + + +

2d.layer.malformed-operations.createPattern

+

Check that exceptions are thrown for operations that are malformed while layers are open.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.createPattern.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.createPattern.worker.js new file mode 100644 index 0000000000..bcb42cba87 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.createPattern.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.malformed-operations.createPattern +// Description:Check that exceptions are thrown for operations that are malformed while layers are open. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Check that exceptions are thrown for operations that are malformed while layers are open."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(200, 200); + var ctx = canvas.getContext('2d'); + + // Shouldn't throw on its own. + ctx.createPattern(canvas, 'repeat'); + // Make sure the exception isn't caused by calling the function twice. + ctx.createPattern(canvas, 'repeat'); + // Calling again inside a layer should throw. + ctx.beginLayer(); + assert_throws_dom("InvalidStateError", + () => ctx.createPattern(canvas, 'repeat')); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.drawImage.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.drawImage.html new file mode 100644 index 0000000000..e6a9872100 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.drawImage.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.layer.malformed-operations.drawImage + + + + +

2d.layer.malformed-operations.drawImage

+

Check that exceptions are thrown for operations that are malformed while layers are open.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.drawImage.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.drawImage.worker.js new file mode 100644 index 0000000000..b66cdee62e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.drawImage.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.malformed-operations.drawImage +// Description:Check that exceptions are thrown for operations that are malformed while layers are open. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Check that exceptions are thrown for operations that are malformed while layers are open."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(200, 200); + var ctx = canvas.getContext('2d'); + + const canvas2 = new OffscreenCanvas(200, 200); + const ctx2 = canvas2.getContext('2d'); + // Shouldn't throw on its own. + ctx2.drawImage(canvas, 0, 0); + // Make sure the exception isn't caused by calling the function twice. + ctx2.drawImage(canvas, 0, 0); + // Calling again inside a layer should throw. + ctx.beginLayer(); + assert_throws_dom("InvalidStateError", + () => ctx2.drawImage(canvas, 0, 0)); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.getImageData.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.getImageData.html new file mode 100644 index 0000000000..87bc8c6ede --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.getImageData.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.layer.malformed-operations.getImageData + + + + +

2d.layer.malformed-operations.getImageData

+

Check that exceptions are thrown for operations that are malformed while layers are open.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.getImageData.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.getImageData.worker.js new file mode 100644 index 0000000000..6a1a16fccb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.getImageData.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.malformed-operations.getImageData +// Description:Check that exceptions are thrown for operations that are malformed while layers are open. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Check that exceptions are thrown for operations that are malformed while layers are open."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(200, 200); + var ctx = canvas.getContext('2d'); + + // Shouldn't throw on its own. + ctx.getImageData(0, 0, 200, 200); + // Make sure the exception isn't caused by calling the function twice. + ctx.getImageData(0, 0, 200, 200); + // Calling again inside a layer should throw. + ctx.beginLayer(); + assert_throws_dom("InvalidStateError", + () => ctx.getImageData(0, 0, 200, 200)); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.putImageData.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.putImageData.html new file mode 100644 index 0000000000..e8059076bb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.putImageData.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.layer.malformed-operations.putImageData + + + + +

2d.layer.malformed-operations.putImageData

+

Check that exceptions are thrown for operations that are malformed while layers are open.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.putImageData.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.putImageData.worker.js new file mode 100644 index 0000000000..8810c3a73c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.putImageData.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.malformed-operations.putImageData +// Description:Check that exceptions are thrown for operations that are malformed while layers are open. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Check that exceptions are thrown for operations that are malformed while layers are open."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(200, 200); + var ctx = canvas.getContext('2d'); + + const canvas2 = new OffscreenCanvas(200, 200); + const ctx2 = canvas2.getContext('2d') + const data = ctx2.getImageData(0, 0, 1, 1); + // Shouldn't throw on its own. + ctx.putImageData(data, 0, 0); + // Make sure the exception isn't caused by calling the function twice. + ctx.putImageData(data, 0, 0); + // Calling again inside a layer should throw. + ctx.beginLayer(); + assert_throws_dom("InvalidStateError", + () => ctx.putImageData(data, 0, 0)); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.transferToImageBitmap.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.transferToImageBitmap.html new file mode 100644 index 0000000000..79c216421f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.transferToImageBitmap.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.layer.malformed-operations.transferToImageBitmap + + + + +

2d.layer.malformed-operations.transferToImageBitmap

+

Check that exceptions are thrown for operations that are malformed while layers are open.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.transferToImageBitmap.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.transferToImageBitmap.worker.js new file mode 100644 index 0000000000..be0b43665a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.malformed-operations.transferToImageBitmap.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.malformed-operations.transferToImageBitmap +// Description:Check that exceptions are thrown for operations that are malformed while layers are open. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Check that exceptions are thrown for operations that are malformed while layers are open."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(200, 200); + var ctx = canvas.getContext('2d'); + + // Shouldn't throw on its own. + canvas.transferToImageBitmap(); + // Make sure the exception isn't caused by calling the function twice. + canvas.transferToImageBitmap(); + // Calling again inside a layer should throw. + ctx.beginLayer(); + assert_throws_dom("InvalidStateError", + () => canvas.transferToImageBitmap()); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-expected.html new file mode 100644 index 0000000000..65525d4d6a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-expected.html @@ -0,0 +1,37 @@ + + +Canvas test: 2d.layer.nested +

2d.layer.nested

+

Tests nested canvas layers.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-filters-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-filters-expected.html new file mode 100644 index 0000000000..8b53e2dc76 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-filters-expected.html @@ -0,0 +1,28 @@ + + +Canvas test: 2d.layer.nested-filters +

2d.layer.nested-filters

+

Checks that nested layers work properly when both apply filters.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-filters.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-filters.html new file mode 100644 index 0000000000..adf99bacbe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-filters.html @@ -0,0 +1,36 @@ + + + +Canvas test: 2d.layer.nested-filters +

2d.layer.nested-filters

+

Checks that nested layers work properly when both apply filters.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-filters.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-filters.w.html new file mode 100644 index 0000000000..0616fecfd9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested-filters.w.html @@ -0,0 +1,50 @@ + + + + +Canvas test: 2d.layer.nested-filters +

2d.layer.nested-filters

+

Checks that nested layers work properly when both apply filters.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested.html new file mode 100644 index 0000000000..9e5b7d5826 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested.html @@ -0,0 +1,39 @@ + + + +Canvas test: 2d.layer.nested +

2d.layer.nested

+

Tests nested canvas layers.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested.w.html new file mode 100644 index 0000000000..99e7390609 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.nested.w.html @@ -0,0 +1,53 @@ + + + + +Canvas test: 2d.layer.nested +

2d.layer.nested

+

Tests nested canvas layers.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.opaque-canvas-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.opaque-canvas-expected.html new file mode 100644 index 0000000000..89c85de1e5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.opaque-canvas-expected.html @@ -0,0 +1,34 @@ + + +Canvas test: 2d.layer.opaque-canvas +

2d.layer.opaque-canvas

+

Checks that layer blending works inside opaque canvas

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.opaque-canvas.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.opaque-canvas.html new file mode 100644 index 0000000000..f9759abebe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.opaque-canvas.html @@ -0,0 +1,36 @@ + + + +Canvas test: 2d.layer.opaque-canvas +

2d.layer.opaque-canvas

+

Checks that layer blending works inside opaque canvas

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.opaque-canvas.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.opaque-canvas.w.html new file mode 100644 index 0000000000..ff5ec19418 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.opaque-canvas.w.html @@ -0,0 +1,50 @@ + + + + +Canvas test: 2d.layer.opaque-canvas +

2d.layer.opaque-canvas

+

Checks that layer blending works inside opaque canvas

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.reset-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.reset-expected.html new file mode 100644 index 0000000000..93131dca9c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.reset-expected.html @@ -0,0 +1,14 @@ + + +Canvas test: 2d.layer.reset +

2d.layer.reset

+

Checks that reset discards any pending layers.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.reset.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.reset.html new file mode 100644 index 0000000000..3254c0a048 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.reset.html @@ -0,0 +1,38 @@ + + + +Canvas test: 2d.layer.reset +

2d.layer.reset

+

Checks that reset discards any pending layers.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.reset.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.reset.w.html new file mode 100644 index 0000000000..09bd6451bd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.reset.w.html @@ -0,0 +1,52 @@ + + + + +Canvas test: 2d.layer.reset +

2d.layer.reset

+

Checks that reset discards any pending layers.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.restore-style-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.restore-style-expected.html new file mode 100644 index 0000000000..1d0ac3558d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.restore-style-expected.html @@ -0,0 +1,24 @@ + + +Canvas test: 2d.layer.restore-style +

2d.layer.restore-style

+

Test that ensure layers restores style values upon endLayer.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.restore-style.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.restore-style.html new file mode 100644 index 0000000000..a3593cd2a8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.restore-style.html @@ -0,0 +1,28 @@ + + + + +Canvas test: 2d.layer.restore-style +

2d.layer.restore-style

+

Test that ensure layers restores style values upon endLayer.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.restore-style.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.restore-style.w.html new file mode 100644 index 0000000000..a66fc2bc59 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.restore-style.w.html @@ -0,0 +1,42 @@ + + + + + +Canvas test: 2d.layer.restore-style +

2d.layer.restore-style

+

Test that ensure layers restores style values upon endLayer.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.several-complex-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.several-complex-expected.html new file mode 100644 index 0000000000..ef46f69e2a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.several-complex-expected.html @@ -0,0 +1,35 @@ + + +Canvas test: 2d.layer.several-complex +

2d.layer.several-complex

+

Test to ensure beginlayer works for filter, alpha and shadow, even with consecutive layers.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.several-complex.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.several-complex.html new file mode 100644 index 0000000000..e30f1d2fa0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.several-complex.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.layer.several-complex +

2d.layer.several-complex

+

Test to ensure beginlayer works for filter, alpha and shadow, even with consecutive layers.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.several-complex.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.several-complex.w.html new file mode 100644 index 0000000000..e00de63507 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.several-complex.w.html @@ -0,0 +1,51 @@ + + + + + +Canvas test: 2d.layer.several-complex +

2d.layer.several-complex

+

Test to ensure beginlayer works for filter, alpha and shadow, even with consecutive layers.

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-expected.html new file mode 100644 index 0000000000..cc10684a9b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-expected.html @@ -0,0 +1,19 @@ + + +Canvas test: 2d.layer.shadow-from-outside-canvas.long-distance +

2d.layer.shadow-from-outside-canvas.long-distance

+

Checks shadow produced by object drawn outside the canvas

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-with-clipping-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-with-clipping-expected.html new file mode 100644 index 0000000000..377dd55ef6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-with-clipping-expected.html @@ -0,0 +1,21 @@ + + +Canvas test: 2d.layer.shadow-from-outside-canvas.long-distance-with-clipping +

2d.layer.shadow-from-outside-canvas.long-distance-with-clipping

+

Checks shadow produced by object drawn outside the canvas

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-with-clipping.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-with-clipping.html new file mode 100644 index 0000000000..98262f53b6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-with-clipping.html @@ -0,0 +1,33 @@ + + + +Canvas test: 2d.layer.shadow-from-outside-canvas.long-distance-with-clipping +

2d.layer.shadow-from-outside-canvas.long-distance-with-clipping

+

Checks shadow produced by object drawn outside the canvas

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-with-clipping.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-with-clipping.w.html new file mode 100644 index 0000000000..90b4332f94 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance-with-clipping.w.html @@ -0,0 +1,47 @@ + + + + +Canvas test: 2d.layer.shadow-from-outside-canvas.long-distance-with-clipping +

2d.layer.shadow-from-outside-canvas.long-distance-with-clipping

+

Checks shadow produced by object drawn outside the canvas

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance.html new file mode 100644 index 0000000000..eea9b5dc25 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance.html @@ -0,0 +1,31 @@ + + + +Canvas test: 2d.layer.shadow-from-outside-canvas.long-distance +

2d.layer.shadow-from-outside-canvas.long-distance

+

Checks shadow produced by object drawn outside the canvas

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance.w.html new file mode 100644 index 0000000000..e4422558cf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.long-distance.w.html @@ -0,0 +1,45 @@ + + + + +Canvas test: 2d.layer.shadow-from-outside-canvas.long-distance +

2d.layer.shadow-from-outside-canvas.long-distance

+

Checks shadow produced by object drawn outside the canvas

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-expected.html new file mode 100644 index 0000000000..8980708dd1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-expected.html @@ -0,0 +1,19 @@ + + +Canvas test: 2d.layer.shadow-from-outside-canvas.short-distance +

2d.layer.shadow-from-outside-canvas.short-distance

+

Checks shadow produced by object drawn outside the canvas

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-with-clipping-expected.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-with-clipping-expected.html new file mode 100644 index 0000000000..024fc8c9a4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-with-clipping-expected.html @@ -0,0 +1,21 @@ + + +Canvas test: 2d.layer.shadow-from-outside-canvas.short-distance-with-clipping +

2d.layer.shadow-from-outside-canvas.short-distance-with-clipping

+

Checks shadow produced by object drawn outside the canvas

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-with-clipping.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-with-clipping.html new file mode 100644 index 0000000000..d5f5b0c8ff --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-with-clipping.html @@ -0,0 +1,33 @@ + + + +Canvas test: 2d.layer.shadow-from-outside-canvas.short-distance-with-clipping +

2d.layer.shadow-from-outside-canvas.short-distance-with-clipping

+

Checks shadow produced by object drawn outside the canvas

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-with-clipping.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-with-clipping.w.html new file mode 100644 index 0000000000..acbf09edec --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance-with-clipping.w.html @@ -0,0 +1,47 @@ + + + + +Canvas test: 2d.layer.shadow-from-outside-canvas.short-distance-with-clipping +

2d.layer.shadow-from-outside-canvas.short-distance-with-clipping

+

Checks shadow produced by object drawn outside the canvas

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance.html new file mode 100644 index 0000000000..a1c4689f7e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance.html @@ -0,0 +1,31 @@ + + + +Canvas test: 2d.layer.shadow-from-outside-canvas.short-distance +

2d.layer.shadow-from-outside-canvas.short-distance

+

Checks shadow produced by object drawn outside the canvas

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance.w.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance.w.html new file mode 100644 index 0000000000..2e39091f3d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.shadow-from-outside-canvas.short-distance.w.html @@ -0,0 +1,45 @@ + + + + +Canvas test: 2d.layer.shadow-from-outside-canvas.short-distance +

2d.layer.shadow-from-outside-canvas.short-distance

+

Checks shadow produced by object drawn outside the canvas

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-endLayer.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-endLayer.html new file mode 100644 index 0000000000..0a6e195ca8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-endLayer.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.layer.valid-calls.beginLayer-endLayer + + + + +

2d.layer.valid-calls.beginLayer-endLayer

+

No exception raised on beginLayer() + endLayer().

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-endLayer.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-endLayer.worker.js new file mode 100644 index 0000000000..a10bcd98b7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-endLayer.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.valid-calls.beginLayer-endLayer +// Description:No exception raised on beginLayer() + endLayer(). +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("No exception raised on beginLayer() + endLayer()."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.beginLayer(); + ctx.save(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-save.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-save.html new file mode 100644 index 0000000000..12abcc5270 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-save.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.layer.valid-calls.beginLayer-save + + + + +

2d.layer.valid-calls.beginLayer-save

+

No exception raised on beginLayer() + save().

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-save.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-save.worker.js new file mode 100644 index 0000000000..03fbeeb4f4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer-save.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.valid-calls.beginLayer-save +// Description:No exception raised on beginLayer() + save(). +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("No exception raised on beginLayer() + save()."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.beginLayer(); + ctx.save(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer.html new file mode 100644 index 0000000000..2178138e8d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.layer.valid-calls.beginLayer + + + + +

2d.layer.valid-calls.beginLayer

+

No exception raised on lone beginLayer() calls.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer.worker.js new file mode 100644 index 0000000000..e64be136d7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.beginLayer.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.valid-calls.beginLayer +// Description:No exception raised on lone beginLayer() calls. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("No exception raised on lone beginLayer() calls."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.beginLayer(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.restore.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.restore.html new file mode 100644 index 0000000000..156dd5abbd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.restore.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.layer.valid-calls.restore + + + + +

2d.layer.valid-calls.restore

+

No exception raised on lone restore() calls.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.restore.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.restore.worker.js new file mode 100644 index 0000000000..7417d12abe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.restore.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.valid-calls.restore +// Description:No exception raised on lone restore() calls. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("No exception raised on lone restore() calls."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.restore(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save-beginLayer.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save-beginLayer.html new file mode 100644 index 0000000000..afe735764e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save-beginLayer.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.layer.valid-calls.save-beginLayer + + + + +

2d.layer.valid-calls.save-beginLayer

+

No exception raised on save() + beginLayer().

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save-beginLayer.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save-beginLayer.worker.js new file mode 100644 index 0000000000..773ba77a15 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save-beginLayer.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.valid-calls.save-beginLayer +// Description:No exception raised on save() + beginLayer(). +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("No exception raised on save() + beginLayer()."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.save(); + ctx.beginLayer(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save.html new file mode 100644 index 0000000000..2b2de23bb8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.layer.valid-calls.save + + + + +

2d.layer.valid-calls.save

+

No exception raised on lone save() calls.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save.worker.js new file mode 100644 index 0000000000..5bbf0386fe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.valid-calls.save +// Description:No exception raised on lone save() calls. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("No exception raised on lone save() calls."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.save(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_reset_restore.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_reset_restore.html new file mode 100644 index 0000000000..ec5aa6455e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_reset_restore.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.layer.valid-calls.save_reset_restore + + + + +

2d.layer.valid-calls.save_reset_restore

+

No exception raised on save() + reset() + restore().

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_reset_restore.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_reset_restore.worker.js new file mode 100644 index 0000000000..3636c94357 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_reset_restore.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.valid-calls.save_reset_restore +// Description:No exception raised on save() + reset() + restore(). +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("No exception raised on save() + reset() + restore()."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.save(); + ctx.reset(); + ctx.restore(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_restore.html b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_restore.html new file mode 100644 index 0000000000..1682bca91c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_restore.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.layer.valid-calls.save_restore + + + + +

2d.layer.valid-calls.save_restore

+

No exception raised on save() + restore().

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_restore.worker.js b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_restore.worker.js new file mode 100644 index 0000000000..8607722df7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/layers/2d.layer.valid-calls.save_restore.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.layer.valid-calls.save_restore +// Description:No exception raised on save() + restore(). +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("No exception raised on save() + restore()."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.save(); + ctx.restore(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.butt.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.butt.html new file mode 100644 index 0000000000..145e145cb4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.butt.html @@ -0,0 +1,61 @@ + + +OffscreenCanvas test: 2d.line.cap.butt + + + + +

2d.line.cap.butt

+

lineCap 'butt' is rendered correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.butt.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.butt.worker.js new file mode 100644 index 0000000000..127393790c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.butt.worker.js @@ -0,0 +1,56 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.cap.butt +// Description:lineCap 'butt' is rendered correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("lineCap 'butt' is rendered correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 25,15, 0,255,0,255); + _assertPixel(canvas, 25,16, 0,255,0,255); + _assertPixel(canvas, 25,34, 0,255,0,255); + _assertPixel(canvas, 25,35, 0,255,0,255); + _assertPixel(canvas, 25,36, 0,255,0,255); + + _assertPixel(canvas, 75,14, 0,255,0,255); + _assertPixel(canvas, 75,15, 0,255,0,255); + _assertPixel(canvas, 75,16, 0,255,0,255); + _assertPixel(canvas, 75,34, 0,255,0,255); + _assertPixel(canvas, 75,35, 0,255,0,255); + _assertPixel(canvas, 75,36, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.closed.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.closed.html new file mode 100644 index 0000000000..edddeb08e7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.closed.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.line.cap.closed + + + + +

2d.line.cap.closed

+

Line caps are not drawn at the corners of an unclosed rectangle

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.closed.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.closed.worker.js new file mode 100644 index 0000000000..b8357316e4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.closed.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.cap.closed +// Description:Line caps are not drawn at the corners of an unclosed rectangle +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Line caps are not drawn at the corners of an unclosed rectangle"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 48,1, 0,255,0,255); + _assertPixel(canvas, 48,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.invalid.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.invalid.html new file mode 100644 index 0000000000..2054bbc515 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.invalid.html @@ -0,0 +1,52 @@ + + +OffscreenCanvas test: 2d.line.cap.invalid + + + + +

2d.line.cap.invalid

+

Setting lineCap to invalid values is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.invalid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.invalid.worker.js new file mode 100644 index 0000000000..813ceb7f66 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.invalid.worker.js @@ -0,0 +1,47 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.cap.invalid +// Description:Setting lineCap to invalid values is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting lineCap to invalid values is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.open.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.open.html new file mode 100644 index 0000000000..f26fbc686c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.open.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.line.cap.open + + + + +

2d.line.cap.open

+

Line caps are drawn at the corners of an unclosed rectangle

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.open.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.open.worker.js new file mode 100644 index 0000000000..169010ac2a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.open.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.cap.open +// Description:Line caps are drawn at the corners of an unclosed rectangle +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Line caps are drawn at the corners of an unclosed rectangle"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 48,1, 0,255,0,255); + _assertPixel(canvas, 48,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.round.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.round.html new file mode 100644 index 0000000000..31f5ba5423 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.round.html @@ -0,0 +1,77 @@ + + +OffscreenCanvas test: 2d.line.cap.round + + + + +

2d.line.cap.round

+

lineCap 'round' is rendered correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.round.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.round.worker.js new file mode 100644 index 0000000000..a8d9c1b92f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.round.worker.js @@ -0,0 +1,72 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.cap.round +// Description:lineCap 'round' is rendered correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("lineCap 'round' is rendered correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 25,6, 0,255,0,255); + _assertPixel(canvas, 32,6, 0,255,0,255); + _assertPixel(canvas, 17,43, 0,255,0,255); + _assertPixel(canvas, 25,43, 0,255,0,255); + _assertPixel(canvas, 32,43, 0,255,0,255); + + _assertPixel(canvas, 67,6, 0,255,0,255); + _assertPixel(canvas, 75,6, 0,255,0,255); + _assertPixel(canvas, 82,6, 0,255,0,255); + _assertPixel(canvas, 67,43, 0,255,0,255); + _assertPixel(canvas, 75,43, 0,255,0,255); + _assertPixel(canvas, 82,43, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.square.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.square.html new file mode 100644 index 0000000000..0d2988877d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.square.html @@ -0,0 +1,61 @@ + + +OffscreenCanvas test: 2d.line.cap.square + + + + +

2d.line.cap.square

+

lineCap 'square' is rendered correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.square.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.square.worker.js new file mode 100644 index 0000000000..6776e9891b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.square.worker.js @@ -0,0 +1,56 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.cap.square +// Description:lineCap 'square' is rendered correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("lineCap 'square' is rendered correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 25,5, 0,255,0,255); + _assertPixel(canvas, 25,6, 0,255,0,255); + _assertPixel(canvas, 25,44, 0,255,0,255); + _assertPixel(canvas, 25,45, 0,255,0,255); + _assertPixel(canvas, 25,46, 0,255,0,255); + + _assertPixel(canvas, 75,4, 0,255,0,255); + _assertPixel(canvas, 75,5, 0,255,0,255); + _assertPixel(canvas, 75,6, 0,255,0,255); + _assertPixel(canvas, 75,44, 0,255,0,255); + _assertPixel(canvas, 75,45, 0,255,0,255); + _assertPixel(canvas, 75,46, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.valid.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.valid.html new file mode 100644 index 0000000000..6334891f56 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.valid.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.line.cap.valid + + + + +

2d.line.cap.valid

+

Setting lineCap to valid values works

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.valid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.valid.worker.js new file mode 100644 index 0000000000..0010fd61dd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cap.valid.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.cap.valid +// Description:Setting lineCap to valid values works +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting lineCap to valid values works"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cross.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cross.html new file mode 100644 index 0000000000..83e2a758fd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cross.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.line.cross + + + + +

2d.line.cross

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cross.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cross.worker.js new file mode 100644 index 0000000000..5dc95c25f1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.cross.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.cross +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 48,1, 0,255,0,255); + _assertPixel(canvas, 48,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.defaults.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.defaults.html new file mode 100644 index 0000000000..7f50257288 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.defaults.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.line.defaults + + + + +

2d.line.defaults

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.defaults.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.defaults.worker.js new file mode 100644 index 0000000000..1a59b81027 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.defaults.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.defaults +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.fill.noop.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.fill.noop.html new file mode 100644 index 0000000000..0d1aa4be30 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.fill.noop.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.line.fill.noop + + + + +

2d.line.fill.noop

+

Filling a line draws nothing

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.fill.noop.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.fill.noop.worker.js new file mode 100644 index 0000000000..e3e8c14b3f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.fill.noop.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.fill.noop +// Description:Filling a line draws nothing +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Filling a line draws nothing"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.fillStyle = '#f00'; + ctx.lineWidth = 20; + ctx.beginPath(); + ctx.moveTo(10, 20); + ctx.lineTo(90, 30); + ctx.fill(); + _assertPixel(canvas, 50,24, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 50,26, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.invalid.strokestyle.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.invalid.strokestyle.html new file mode 100644 index 0000000000..fa67e3b3f8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.invalid.strokestyle.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.line.invalid.strokestyle + + + + +

2d.line.invalid.strokestyle

+

Verify correct behavior of canvas on an invalid strokeStyle()

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.invalid.strokestyle.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.invalid.strokestyle.worker.js new file mode 100644 index 0000000000..5726b1835a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.invalid.strokestyle.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.invalid.strokestyle +// Description:Verify correct behavior of canvas on an invalid strokeStyle() +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify correct behavior of canvas on an invalid strokeStyle()"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.strokeStyle = 'rgb(0, 255, 0)'; + ctx.strokeStyle = 'nonsense'; + ctx.lineWidth = 200; + ctx.moveTo(0,100); + ctx.lineTo(200,100); + ctx.stroke(); + var imageData = ctx.getImageData(0, 0, 200, 200); + var imgdata = imageData.data; + _assert(imgdata[4] == 0, "imgdata[\""+(4)+"\"] == 0"); + _assert(imgdata[5] == 255, "imgdata[\""+(5)+"\"] == 255"); + _assert(imgdata[6] == 0, "imgdata[\""+(6)+"\"] == 0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.bevel.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.bevel.html new file mode 100644 index 0000000000..70e3896281 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.bevel.html @@ -0,0 +1,80 @@ + + +OffscreenCanvas test: 2d.line.join.bevel + + + + +

2d.line.join.bevel

+

lineJoin 'bevel' is rendered correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.bevel.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.bevel.worker.js new file mode 100644 index 0000000000..efd884debe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.bevel.worker.js @@ -0,0 +1,75 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.join.bevel +// Description:lineJoin 'bevel' is rendered correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("lineJoin 'bevel' is rendered correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 34,15, 0,255,0,255); + _assertPixel(canvas, 35,15, 0,255,0,255); + _assertPixel(canvas, 36,15, 0,255,0,255); + _assertPixel(canvas, 36,14, 0,255,0,255); + + _assertPixel(canvas, 84,16, 0,255,0,255); + _assertPixel(canvas, 84,15, 0,255,0,255); + _assertPixel(canvas, 85,15, 0,255,0,255); + _assertPixel(canvas, 86,15, 0,255,0,255); + _assertPixel(canvas, 86,14, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.closed.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.closed.html new file mode 100644 index 0000000000..60650adeb3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.closed.html @@ -0,0 +1,45 @@ + + +OffscreenCanvas test: 2d.line.join.closed + + + + +

2d.line.join.closed

+

Line joins are drawn at the corner of a closed rectangle

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.closed.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.closed.worker.js new file mode 100644 index 0000000000..4882311961 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.closed.worker.js @@ -0,0 +1,40 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.join.closed +// Description:Line joins are drawn at the corner of a closed rectangle +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Line joins are drawn at the corner of a closed rectangle"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 48,1, 0,255,0,255); + _assertPixel(canvas, 48,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.invalid.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.invalid.html new file mode 100644 index 0000000000..be1f7e393e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.invalid.html @@ -0,0 +1,52 @@ + + +OffscreenCanvas test: 2d.line.join.invalid + + + + +

2d.line.join.invalid

+

Setting lineJoin to invalid values is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.invalid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.invalid.worker.js new file mode 100644 index 0000000000..aa5a35c0c5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.invalid.worker.js @@ -0,0 +1,47 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.join.invalid +// Description:Setting lineJoin to invalid values is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting lineJoin to invalid values is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.miter.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.miter.html new file mode 100644 index 0000000000..c26e883c40 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.miter.html @@ -0,0 +1,71 @@ + + +OffscreenCanvas test: 2d.line.join.miter + + + + +

2d.line.join.miter

+

lineJoin 'miter' is rendered correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.miter.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.miter.worker.js new file mode 100644 index 0000000000..7b70000100 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.miter.worker.js @@ -0,0 +1,66 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.join.miter +// Description:lineJoin 'miter' is rendered correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("lineJoin 'miter' is rendered correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 39,11, 0,255,0,255); + _assertPixel(canvas, 40,10, 0,255,0,255); + _assertPixel(canvas, 41,9, 0,255,0,255); + _assertPixel(canvas, 42,8, 0,255,0,255); + + _assertPixel(canvas, 88,12, 0,255,0,255); + _assertPixel(canvas, 89,11, 0,255,0,255); + _assertPixel(canvas, 90,10, 0,255,0,255); + _assertPixel(canvas, 91,9, 0,255,0,255); + _assertPixel(canvas, 92,8, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.open.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.open.html new file mode 100644 index 0000000000..d801e5c367 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.open.html @@ -0,0 +1,45 @@ + + +OffscreenCanvas test: 2d.line.join.open + + + + +

2d.line.join.open

+

Line joins are not drawn at the corner of an unclosed rectangle

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.open.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.open.worker.js new file mode 100644 index 0000000000..2a1242436d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.open.worker.js @@ -0,0 +1,40 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.join.open +// Description:Line joins are not drawn at the corner of an unclosed rectangle +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Line joins are not drawn at the corner of an unclosed rectangle"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 48,1, 0,255,0,255); + _assertPixel(canvas, 48,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.parallel.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.parallel.html new file mode 100644 index 0000000000..0826406b9d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.parallel.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.line.join.parallel + + + + +

2d.line.join.parallel

+

Line joins are drawn at 180-degree joins

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.parallel.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.parallel.worker.js new file mode 100644 index 0000000000..f5b67dc5a2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.parallel.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.join.parallel +// Description:Line joins are drawn at 180-degree joins +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Line joins are drawn at 180-degree joins"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 48,1, 0,255,0,255); + _assertPixel(canvas, 48,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.round.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.round.html new file mode 100644 index 0000000000..70f6a8e517 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.round.html @@ -0,0 +1,78 @@ + + +OffscreenCanvas test: 2d.line.join.round + + + + +

2d.line.join.round

+

lineJoin 'round' is rendered correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.round.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.round.worker.js new file mode 100644 index 0000000000..33b135d604 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.round.worker.js @@ -0,0 +1,73 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.join.round +// Description:lineJoin 'round' is rendered correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("lineJoin 'round' is rendered correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 36,13, 0,255,0,255); + _assertPixel(canvas, 37,13, 0,255,0,255); + _assertPixel(canvas, 38,13, 0,255,0,255); + _assertPixel(canvas, 38,12, 0,255,0,255); + + _assertPixel(canvas, 86,14, 0,255,0,255); + _assertPixel(canvas, 86,13, 0,255,0,255); + _assertPixel(canvas, 87,13, 0,255,0,255); + _assertPixel(canvas, 88,13, 0,255,0,255); + _assertPixel(canvas, 88,12, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.valid.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.valid.html new file mode 100644 index 0000000000..3b3935d1f7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.valid.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.line.join.valid + + + + +

2d.line.join.valid

+

Setting lineJoin to valid values works

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.valid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.valid.worker.js new file mode 100644 index 0000000000..d1bdfd8845 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.join.valid.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.join.valid +// Description:Setting lineJoin to valid values works +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting lineJoin to valid values works"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.acute.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.acute.html new file mode 100644 index 0000000000..587062ed12 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.acute.html @@ -0,0 +1,52 @@ + + +OffscreenCanvas test: 2d.line.miter.acute + + + + +

2d.line.miter.acute

+

Miter joins are drawn correctly with acute angles

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.acute.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.acute.worker.js new file mode 100644 index 0000000000..0ab5c9050c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.acute.worker.js @@ -0,0 +1,47 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.miter.acute +// Description:Miter joins are drawn correctly with acute angles +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Miter joins are drawn correctly with acute angles"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 48,1, 0,255,0,255); + _assertPixel(canvas, 48,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.exceeded.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.exceeded.html new file mode 100644 index 0000000000..1ae5c55aef --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.exceeded.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.line.miter.exceeded + + + + +

2d.line.miter.exceeded

+

Miter joins are not drawn when the miter limit is exceeded

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.exceeded.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.exceeded.worker.js new file mode 100644 index 0000000000..41c4716c88 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.exceeded.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.miter.exceeded +// Description:Miter joins are not drawn when the miter limit is exceeded +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Miter joins are not drawn when the miter limit is exceeded"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 48,1, 0,255,0,255); + _assertPixel(canvas, 48,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.invalid.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.invalid.html new file mode 100644 index 0000000000..eacd95b811 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.invalid.html @@ -0,0 +1,60 @@ + + +OffscreenCanvas test: 2d.line.miter.invalid + + + + +

2d.line.miter.invalid

+

Setting miterLimit to invalid values is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.invalid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.invalid.worker.js new file mode 100644 index 0000000000..62f250670c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.invalid.worker.js @@ -0,0 +1,55 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.miter.invalid +// Description:Setting miterLimit to invalid values is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting miterLimit to invalid values is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + + ctx.miterLimit = 1.5; + ctx.miterLimit = 'string'; + _assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + + ctx.miterLimit = 1.5; + ctx.miterLimit = true; + _assertSame(ctx.miterLimit, 1, "ctx.miterLimit", "1"); + + ctx.miterLimit = 1.5; + ctx.miterLimit = false; + _assertSame(ctx.miterLimit, 1.5, "ctx.miterLimit", "1.5"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.lineedge.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.lineedge.html new file mode 100644 index 0000000000..bad3cedc0e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.lineedge.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.line.miter.lineedge + + + + +

2d.line.miter.lineedge

+

Miter joins are not drawn when the miter limit is exceeded at the corners of a zero-height rectangle

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.lineedge.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.lineedge.worker.js new file mode 100644 index 0000000000..2b61bc8975 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.lineedge.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.miter.lineedge +// Description:Miter joins are not drawn when the miter limit is exceeded at the corners of a zero-height rectangle +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Miter joins are not drawn when the miter limit is exceeded at the corners of a zero-height rectangle"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 48,1, 0,255,0,255); + _assertPixel(canvas, 48,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.obtuse.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.obtuse.html new file mode 100644 index 0000000000..efab533fba --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.obtuse.html @@ -0,0 +1,52 @@ + + +OffscreenCanvas test: 2d.line.miter.obtuse + + + + +

2d.line.miter.obtuse

+

Miter joins are drawn correctly with obtuse angles

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.obtuse.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.obtuse.worker.js new file mode 100644 index 0000000000..42b1cd37b1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.obtuse.worker.js @@ -0,0 +1,47 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.miter.obtuse +// Description:Miter joins are drawn correctly with obtuse angles +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Miter joins are drawn correctly with obtuse angles"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 48,1, 0,255,0,255); + _assertPixel(canvas, 48,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.rightangle.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.rightangle.html new file mode 100644 index 0000000000..5bb4e63230 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.rightangle.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.line.miter.rightangle + + + + +

2d.line.miter.rightangle

+

Miter joins are not drawn when the miter limit is exceeded, on exact right angles

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.rightangle.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.rightangle.worker.js new file mode 100644 index 0000000000..42e995deed --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.rightangle.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.miter.rightangle +// Description:Miter joins are not drawn when the miter limit is exceeded, on exact right angles +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Miter joins are not drawn when the miter limit is exceeded, on exact right angles"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 48,1, 0,255,0,255); + _assertPixel(canvas, 48,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.valid.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.valid.html new file mode 100644 index 0000000000..3c569ea655 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.valid.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.line.miter.valid + + + + +

2d.line.miter.valid

+

Setting miterLimit to valid values works

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.valid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.valid.worker.js new file mode 100644 index 0000000000..cb0548abd0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.valid.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.miter.valid +// Description:Setting miterLimit to valid values works +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting miterLimit to valid values works"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.within.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.within.html new file mode 100644 index 0000000000..da87cf4a29 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.within.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.line.miter.within + + + + +

2d.line.miter.within

+

Miter joins are drawn when the miter limit is not quite exceeded

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.within.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.within.worker.js new file mode 100644 index 0000000000..1d9aacb817 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.miter.within.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.miter.within +// Description:Miter joins are drawn when the miter limit is not quite exceeded +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Miter joins are drawn when the miter limit is not quite exceeded"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 48,1, 0,255,0,255); + _assertPixel(canvas, 48,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.union.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.union.html new file mode 100644 index 0000000000..d3d13ece09 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.union.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.line.union + + + + +

2d.line.union

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.union.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.union.worker.js new file mode 100644 index 0000000000..f2c7b2c4ce --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.union.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.union +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 25,1, 0,255,0,255); + _assertPixel(canvas, 48,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 25,1, 0,255,0,255); + _assertPixel(canvas, 48,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.basic.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.basic.html new file mode 100644 index 0000000000..88e38294bf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.basic.html @@ -0,0 +1,63 @@ + + +OffscreenCanvas test: 2d.line.width.basic + + + + +

2d.line.width.basic

+

lineWidth determines the width of line strokes

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.basic.worker.js new file mode 100644 index 0000000000..012d9b11bd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.basic.worker.js @@ -0,0 +1,58 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.width.basic +// Description:lineWidth determines the width of line strokes +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("lineWidth determines the width of line strokes"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 15,25, 0,255,0,255); + _assertPixel(canvas, 16,25, 0,255,0,255); + _assertPixel(canvas, 25,25, 0,255,0,255); + _assertPixel(canvas, 34,25, 0,255,0,255); + _assertPixel(canvas, 35,25, 0,255,0,255); + _assertPixel(canvas, 36,25, 0,255,0,255); + + _assertPixel(canvas, 64,25, 0,255,0,255); + _assertPixel(canvas, 65,25, 0,255,0,255); + _assertPixel(canvas, 66,25, 0,255,0,255); + _assertPixel(canvas, 75,25, 0,255,0,255); + _assertPixel(canvas, 84,25, 0,255,0,255); + _assertPixel(canvas, 85,25, 0,255,0,255); + _assertPixel(canvas, 86,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.invalid.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.invalid.html new file mode 100644 index 0000000000..481a316822 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.invalid.html @@ -0,0 +1,60 @@ + + +OffscreenCanvas test: 2d.line.width.invalid + + + + +

2d.line.width.invalid

+

Setting lineWidth to invalid values is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.invalid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.invalid.worker.js new file mode 100644 index 0000000000..3a10cb48e8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.invalid.worker.js @@ -0,0 +1,55 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.width.invalid +// Description:Setting lineWidth to invalid values is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting lineWidth to invalid values is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + + ctx.lineWidth = 1.5; + ctx.lineWidth = 'string'; + _assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + + ctx.lineWidth = 1.5; + ctx.lineWidth = true; + _assertSame(ctx.lineWidth, 1, "ctx.lineWidth", "1"); + + ctx.lineWidth = 1.5; + ctx.lineWidth = false; + _assertSame(ctx.lineWidth, 1.5, "ctx.lineWidth", "1.5"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.scaledefault.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.scaledefault.html new file mode 100644 index 0000000000..9ac77a9c49 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.scaledefault.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.line.width.scaledefault + + + + +

2d.line.width.scaledefault

+

Default lineWidth strokes are affected by scale transformations

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.scaledefault.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.scaledefault.worker.js new file mode 100644 index 0000000000..8d8089476b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.scaledefault.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.width.scaledefault +// Description:Default lineWidth strokes are affected by scale transformations +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Default lineWidth strokes are affected by scale transformations"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 75,25, 0,255,0,255); + _assertPixel(canvas, 50,5, 0,255,0,255); + _assertPixel(canvas, 50,45, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.transformed.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.transformed.html new file mode 100644 index 0000000000..ea8f285dc4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.transformed.html @@ -0,0 +1,69 @@ + + +OffscreenCanvas test: 2d.line.width.transformed + + + + +

2d.line.width.transformed

+

Line stroke widths are affected by scale transformations

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.transformed.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.transformed.worker.js new file mode 100644 index 0000000000..67fc0a29bd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.transformed.worker.js @@ -0,0 +1,64 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.width.transformed +// Description:Line stroke widths are affected by scale transformations +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Line stroke widths are affected by scale transformations"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 15,25, 0,255,0,255); + _assertPixel(canvas, 16,25, 0,255,0,255); + _assertPixel(canvas, 25,25, 0,255,0,255); + _assertPixel(canvas, 34,25, 0,255,0,255); + _assertPixel(canvas, 35,25, 0,255,0,255); + _assertPixel(canvas, 36,25, 0,255,0,255); + + _assertPixel(canvas, 64,25, 0,255,0,255); + _assertPixel(canvas, 65,25, 0,255,0,255); + _assertPixel(canvas, 66,25, 0,255,0,255); + _assertPixel(canvas, 75,25, 0,255,0,255); + _assertPixel(canvas, 84,25, 0,255,0,255); + _assertPixel(canvas, 85,25, 0,255,0,255); + _assertPixel(canvas, 86,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.valid.html b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.valid.html new file mode 100644 index 0000000000..813433da3f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.valid.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.line.width.valid + + + + +

2d.line.width.valid

+

Setting lineWidth to valid values works

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.valid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.valid.worker.js new file mode 100644 index 0000000000..195575f7de --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/line-styles/2d.line.width.valid.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.line.width.valid +// Description:Setting lineWidth to valid values works +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Setting lineWidth to valid values works"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/convert-to-blob/offscreencanvas.convert.to.blob.html b/testing/web-platform/tests/html/canvas/offscreen/manual/convert-to-blob/offscreencanvas.convert.to.blob.html new file mode 100644 index 0000000000..1cc0e5bffd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/convert-to-blob/offscreencanvas.convert.to.blob.html @@ -0,0 +1,165 @@ + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/convert-to-blob/offscreencanvas.convert.to.blob.w.html b/testing/web-platform/tests/html/canvas/offscreen/manual/convert-to-blob/offscreencanvas.convert.to.blob.w.html new file mode 100644 index 0000000000..5c1fa4cf40 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/convert-to-blob/offscreencanvas.convert.to.blob.w.html @@ -0,0 +1,337 @@ + + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/draw-generic-family/2d.text.draw.generic.family.html b/testing/web-platform/tests/html/canvas/offscreen/manual/draw-generic-family/2d.text.draw.generic.family.html new file mode 100644 index 0000000000..a5fd7ab066 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/draw-generic-family/2d.text.draw.generic.family.html @@ -0,0 +1,49 @@ + +OffscreenCanvas test: 2d.text.draw.generic.family + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/draw-generic-family/2d.text.draw.generic.family.w.html b/testing/web-platform/tests/html/canvas/offscreen/manual/draw-generic-family/2d.text.draw.generic.family.w.html new file mode 100644 index 0000000000..7a88c032ad --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/draw-generic-family/2d.text.draw.generic.family.w.html @@ -0,0 +1,52 @@ + +OffscreenCanvas test: 2d.text.draw.generic.family.w + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/filter/offscreencanvas.filter.html b/testing/web-platform/tests/html/canvas/offscreen/manual/filter/offscreencanvas.filter.html new file mode 100644 index 0000000000..25691983f1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/filter/offscreencanvas.filter.html @@ -0,0 +1,27 @@ + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/filter/offscreencanvas.filter.js b/testing/web-platform/tests/html/canvas/offscreen/manual/filter/offscreencanvas.filter.js new file mode 100644 index 0000000000..cb2e245803 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/filter/offscreencanvas.filter.js @@ -0,0 +1,48 @@ +var getRegularContextForFilter = function(filter, pattern) { + var c = document.createElement("canvas"); + c.width = c.height = 80; + var ctx = c.getContext('2d'); + ctx.filter = filter; + ctx.drawImage(pattern, 5, 5); + ctx.drawImage(pattern, 25, 25); + ctx.drawImage(pattern, 45, 45); + return ctx; +}; + +var matchImageDataResults = function(offscreenImage, regularImage, filter) { + assert_array_equals(offscreenImage, regularImage, + "The image data generated by filter " + + filter + + " should be the same for both OffscreenCanvas and regular canvas"); +}; + +var createPatternCanvas = function() { + var patternCanvas = document.createElement('canvas'); + patternCanvas.width = 20; + patternCanvas.height = 20; + var patternCtx = patternCanvas.getContext('2d'); + patternCtx.fillStyle = '#A00'; + patternCtx.fillRect(0, 0, 10, 10); + patternCtx.fillStyle = '#0A0'; + patternCtx.fillRect(10, 0, 10, 10); + patternCtx.fillStyle = '#00A'; + patternCtx.fillRect(0, 10, 10, 10); + patternCtx.fillStyle = "#AA0"; + patternCtx.fillRect(10, 10, 10, 10); + return patternCanvas; +}; + +var filters = [ "none" , + "blur(10px)" , + "brightness(40%)" , + "contrast(20%)" , + "drop-shadow(0 0 5px green)" , + "grayscale(100%)" , + "invert(100%)" , + "opacity(50%)" , + "saturate(20%)" , + "sepia(100%)" , + "sepia(1) hue-rotate(200deg)", + "url(#url)" ]; + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/filter/offscreencanvas.filter.w.html b/testing/web-platform/tests/html/canvas/offscreen/manual/filter/offscreencanvas.filter.w.html new file mode 100644 index 0000000000..d6ed915b53 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/filter/offscreencanvas.filter.w.html @@ -0,0 +1,54 @@ + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/image-smoothing/image.smoothing.html b/testing/web-platform/tests/html/canvas/offscreen/manual/image-smoothing/image.smoothing.html new file mode 100644 index 0000000000..a78524c51d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/image-smoothing/image.smoothing.html @@ -0,0 +1,128 @@ + + +OffscreenCanvasRenderingContext2D imageSmoothingEnabled test + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/image-smoothing/image.smoothing.worker.js b/testing/web-platform/tests/html/canvas/offscreen/manual/image-smoothing/image.smoothing.worker.js new file mode 100644 index 0000000000..4c37e84b1f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/image-smoothing/image.smoothing.worker.js @@ -0,0 +1,126 @@ +// spec link: https://html.spec.whatwg.org/#the-offscreen-2d-rendering-context + +importScripts("/resources/testharness.js"); + +function createTestImage() { + var image = new OffscreenCanvas(100, 50); + var imgctx = image.getContext('2d'); + imgctx.fillStyle = "#F00"; + imgctx.fillRect(0, 0, 2, 2); + imgctx.fillStyle = "#0F0"; + imgctx.fillRect(0, 0, 1, 1); + return image; +} + +test(function() { + var offscreenCanvas = new OffscreenCanvas(100, 50); + var ctx = offscreenCanvas.getContext('2d'); + assert_true(ctx.imageSmoothingEnabled); +}, "When the context is created, imageSmoothingEnabled must be set to true."); + +test(function() { + var offscreenCanvas = new OffscreenCanvas(100, 50); + var ctx = offscreenCanvas.getContext('2d'); + ctx.imageSmoothingEnabled = false; + assert_false(ctx.imageSmoothingEnabled); +}, "On getting imageSmoothingEnabled, the user agent must return the last value it was set to."); + +test(function() { + var offscreenCanvas = new OffscreenCanvas(100, 50); + var ctx = offscreenCanvas.getContext('2d'); + var image = createTestImage(); + ctx.scale(10, 10); + ctx.drawImage(image, 0, 0); + var pixels = ctx.getImageData(9, 9, 1, 1).data; + assert_not_equals(pixels[0], 0); + assert_not_equals(pixels[1], 255); +}, "Test that image smoothing is actually on by default."); + +test(function() { + var offscreenCanvas = new OffscreenCanvas(100, 50); + var ctx = offscreenCanvas.getContext('2d'); + ctx.imageSmoothingEnabled = true; + var image = createTestImage(); + ctx.scale(10, 10); + ctx.drawImage(image, 0, 0); + var pixels = ctx.getImageData(9, 9, 1, 1).data; + assert_not_equals(pixels[0], 0); + assert_not_equals(pixels[1], 255); +}, "Test that image smoothing works when imageSmoothingEnabled is set to true"); + +test(function() { + var offscreenCanvas = new OffscreenCanvas(100, 50); + var ctx = offscreenCanvas.getContext('2d'); + var image = createTestImage(); + ctx.imageSmoothingEnabled = false; + ctx.scale(10, 10); + ctx.drawImage(image, 0, 0); + var pixels = ctx.getImageData(9, 9, 1, 1).data; + assert_array_equals(pixels, [0, 255, 0, 255]); +}, "Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with drawImage()."); + +test(function() { + var offscreenCanvas = new OffscreenCanvas(100, 50); + var ctx = offscreenCanvas.getContext('2d'); + var image = createTestImage(); + ctx.imageSmoothingEnabled = false; + ctx.scale(10, 10); + ctx.fillStyle = ctx.createPattern(image, 'repeat'); + ctx.fillRect(0, 0, 10, 10); + var pixels = ctx.getImageData(9, 9, 1, 1).data; + assert_array_equals(pixels, [0, 255, 0, 255]); +}, "Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with fillRect and createPattern()."); + +test(function() { + var offscreenCanvas = new OffscreenCanvas(100, 50); + var ctx = offscreenCanvas.getContext('2d'); + var image = createTestImage(); + ctx.imageSmoothingEnabled = false; + ctx.fillStyle = ctx.createPattern(image, 'repeat'); + ctx.scale(10, 10); + ctx.rect(0, 0, 10, 10); + ctx.fill(); + var pixels = ctx.getImageData(9, 9, 1, 1).data; + assert_array_equals(pixels, [0, 255, 0, 255]); +}, "Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with fill() and createPattern()."); + +test(function() { + var offscreenCanvas = new OffscreenCanvas(100, 50); + var ctx = offscreenCanvas.getContext('2d'); + var image = createTestImage(); + ctx.strokeStyle = ctx.createPattern(image, 'repeat'); + ctx.lineWidth = 5; + ctx.imageSmoothingEnabled = false; + ctx.scale(10, 10); + ctx.beginPath(); + ctx.moveTo(0, 0); + ctx.lineTo(10, 10); + ctx.stroke(); + var pixels = ctx.getImageData(9, 9, 1, 1).data; + assert_array_equals(pixels, [0, 255, 0, 255]); +}, "Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) works with stroke() and createPattern()."); + +test(function() { + var repaints = 5; + var offscreenCanvas = new OffscreenCanvas(100, 50); + var ctx = offscreenCanvas.getContext('2d'); + + function draw() { + ctx.clearRect(0, 0, 10, 10); + ctx.setTransform(1, 0, 0, 1, 0, 0); + var image = createTestImage(); + ctx.imageSmoothingEnabled = false; + ctx.scale(10, 10); + ctx.drawImage(image, 0, 0); + var pixels = ctx.getImageData(9, 9, 1, 1).data; + assert_array_equals(pixels, [0, 255, 0, 255]); + } + + while (repaints > 0) { + draw(); + repaints = repaints - 1; + } + +}, "Test that imageSmoothingEnabled = false (nearest-neighbor interpolation) still works after repaints."); + +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-layers-expected.html b/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-layers-expected.html new file mode 100644 index 0000000000..873869ea72 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-layers-expected.html @@ -0,0 +1,14 @@ + +Canvas test: unclosed-layers +

unclosed-layers

+

Check that unclosed layers aren't rendered.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-layers.html b/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-layers.html new file mode 100644 index 0000000000..4fee600d6c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-layers.html @@ -0,0 +1,33 @@ + + + +Canvas test: unclosed-layers +

unclosed-layers

+

Check that unclosed layers aren't rendered.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-layers.w.html b/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-layers.w.html new file mode 100644 index 0000000000..a0014bb597 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-layers.w.html @@ -0,0 +1,48 @@ + + + +Canvas test: unclosed-layers +

unclosed-layers

+

Check that unclosed layers aren't rendered.

+ +

FAIL (fallback content)

+
+ + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-nested-layers-expected.html b/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-nested-layers-expected.html new file mode 100644 index 0000000000..8557441f7e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-nested-layers-expected.html @@ -0,0 +1,14 @@ + +Canvas test: unclosed-nested-layers +

unclosed-nested-layers

+

Check that unclosed nested layers aren't rendered.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-nested-layers.html b/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-nested-layers.html new file mode 100644 index 0000000000..c6925beb74 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-nested-layers.html @@ -0,0 +1,39 @@ + + + +Canvas test: unclosed-nested-layers +

unclosed-nested-layers

+

Check that unclosed nested layers aren't rendered.

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-nested-layers.w.html b/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-nested-layers.w.html new file mode 100644 index 0000000000..1a1dc54052 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/layers/unclosed-nested-layers.w.html @@ -0,0 +1,54 @@ + + + +Canvas test: unclosed-nested-layers +

unclosed-nested-layers

+

Check that unclosed nested layers aren't rendered.

+ +

FAIL (fallback content)

+
+ + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas-worker-font-load-crash.html b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas-worker-font-load-crash.html new file mode 100644 index 0000000000..1baf7847de --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas-worker-font-load-crash.html @@ -0,0 +1,19 @@ + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.html b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.html new file mode 100644 index 0000000000..a2ad1dcc7e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.html @@ -0,0 +1,51 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.worker.js b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.worker.js new file mode 100644 index 0000000000..72cfb728f0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.constructor.worker.js @@ -0,0 +1,45 @@ +// spec link: https://html.spec.whatwg.org/#dom-offscreencanvas + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t1 = async_test("Test that calling OffscreenCanvas's constructor generates correct width and height."); +t1.step(function() { + var offscreenCanvas = new OffscreenCanvas(100, 50); + assert_equals(offscreenCanvas.width, 100); + assert_equals(offscreenCanvas.height, 50); + + offscreenCanvas.width = 50; + offscreenCanvas.height = 100; + assert_equals(offscreenCanvas.width, 50); + assert_equals(offscreenCanvas.height, 100); + t1.done(); +}); + +var t2 = async_test("Test that OffscreenCanvas constructor handles invalid arguments correctly in a worker"); +t2.step(function() { + var offscreenCanvas1 = new OffscreenCanvas(1, 1); + + offscreenCanvas1.width = null; + offscreenCanvas1.height = null; + assert_equals(offscreenCanvas1.width, 0); + assert_equals(offscreenCanvas1.height, 0); + + assert_throws_js(TypeError, function() { new OffscreenCanvas(-1, -1); }); + + var offscreenCanvas2 = new OffscreenCanvas(null, null); + assert_equals(offscreenCanvas2.width, 0); + assert_equals(offscreenCanvas2.height, 0); + + assert_throws_js(TypeError, function() { offscreenCanvas2.width = -1; }); + assert_throws_js(TypeError, function() { offscreenCanvas2.height = -1; }); + + var obj = {Name: "John Doe", Age: 30}; + assert_throws_js(TypeError, function() { offscreenCanvas2.width = obj; }); + assert_throws_js(TypeError, function() { offscreenCanvas2.height = obj; }); + assert_throws_js(TypeError, function() { new OffscreenCanvas(obj, obj); }); + t2.done(); +}); + +done(); + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.getcontext.html b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.getcontext.html new file mode 100644 index 0000000000..51c167ddca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.getcontext.html @@ -0,0 +1,80 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.getcontext.worker.js b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.getcontext.worker.js new file mode 100644 index 0000000000..c413791f61 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.getcontext.worker.js @@ -0,0 +1,77 @@ +// spec link: https://html.spec.whatwg.org/#dom-offscreencanvas-getcontext + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +test(function() { + var offscreenCanvas = new OffscreenCanvas(1, 1); + assert_throws_js(TypeError, function() { offscreenCanvas.getContext('3d'); }); +}, "Test that getContext with un-supported string throws a TypeError."); + +test(function() { + var offscreenCanvas1 = new OffscreenCanvas(1, 1); + var ctx1 = offscreenCanvas1.getContext('2d'); + assert_true(ctx1 instanceof OffscreenCanvasRenderingContext2D); + + var offscreenCanvas2 = new OffscreenCanvas(1, 1); + var ctx2 = offscreenCanvas2.getContext('webgl'); + assert_true(ctx2 instanceof WebGLRenderingContext); + + var offscreenCanvas3 = new OffscreenCanvas(1, 1); + var ctx3 = offscreenCanvas3.getContext('webgl2'); + assert_true(ctx3 instanceof WebGL2RenderingContext); +}, "Test that getContext with supported string returns correct results"); + +test(function() { + var offscreenCanvas1 = new OffscreenCanvas(1, 1); + var ctx1 = offscreenCanvas1.getContext('2d'); + var ctx2 = offscreenCanvas1.getContext('webgl'); + assert_equals(ctx2, null); + + var offscreenCanvas2 = new OffscreenCanvas(1, 1); + var ctx3 = offscreenCanvas2.getContext('webgl'); + var ctx4 = offscreenCanvas2.getContext('2d'); + assert_equals(ctx4, null); +}, "Test that getContext twice with different context type returns null the second time"); + +test(function() { + var offscreenCanvas = new OffscreenCanvas(1, 2); + var ctx = offscreenCanvas.getContext('2d'); + var dstCanvas = ctx.canvas; + assert_equals(dstCanvas.width, 1); + assert_equals(dstCanvas.height, 2); +}, "Test that 2dcontext.canvas should return the original OffscreenCanvas"); + +test(function() { + var offscreenCanvas = new OffscreenCanvas(1, 2); + var ctx = offscreenCanvas.getContext('webgl'); + var dstCanvas = ctx.canvas; + assert_equals(dstCanvas.width, 1); + assert_equals(dstCanvas.height, 2); +}, "Test that webglcontext.canvas should return the original OffscreenCanvas"); + +test(function() { + var offscreenCanvas = new OffscreenCanvas(10, 10); + var ctx = offscreenCanvas.getContext('2d', {alpha: false}); + ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; + ctx.fillRect(0, 0, 10, 10); + _assertPixelApprox(offscreenCanvas, 5,5, 0,127,0,255, 2); +}, "Test that OffscreenCanvasRenderingContext2D with alpha disabled makes the OffscreenCanvas opaque"); + +test(function() { + var offscreenCanvas = new OffscreenCanvas(10, 10); + var ctx = offscreenCanvas.getContext('2d', {alpha: true}); + ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; + ctx.fillRect(0, 0, 10, 10); + _assertPixelApprox(offscreenCanvas, 5,5, 0,255,0,127, 2); +}, "Test that OffscreenCanvasRenderingContext2D with alpha enabled preserves the alpha"); + +test(function() { + var offscreenCanvas = new OffscreenCanvas(10, 10); + var ctx = offscreenCanvas.getContext('2d'); + ctx.fillStyle = 'rgba(0, 255, 0, 0.5)'; + ctx.fillRect(0, 0, 10, 10); + _assertPixelApprox(offscreenCanvas, 5,5, 0,255,0,127, 2); +}, "Test that 'alpha' context creation attribute is true by default"); + +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.resize.html b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.resize.html new file mode 100644 index 0000000000..3ff0eea153 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.resize.html @@ -0,0 +1,240 @@ + +Test resizing an OffscreenCanvas with a 2d context + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.lowlatency.nocrash.html b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.lowlatency.nocrash.html new file mode 100644 index 0000000000..1960841564 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.lowlatency.nocrash.html @@ -0,0 +1,12 @@ +Transfer Low-Latency Canvas + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.html b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.html new file mode 100644 index 0000000000..6e1adf9591 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.html @@ -0,0 +1,112 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.nocrash.html b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.nocrash.html new file mode 100644 index 0000000000..09a388ed35 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.nocrash.html @@ -0,0 +1,16 @@ + + +

Tests that an ImageBitmap in Offscreen without content does not crash.

+ + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.w.html b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.w.html new file mode 100644 index 0000000000..b51ce0efa2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfer.to.imagebitmap.w.html @@ -0,0 +1,201 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfercontrol.to.offscreen.html b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfercontrol.to.offscreen.html new file mode 100644 index 0000000000..fea375b2ad --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfercontrol.to.offscreen.html @@ -0,0 +1,34 @@ + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfercontrol.to.offscreen.w.html b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfercontrol.to.offscreen.w.html new file mode 100644 index 0000000000..1347e7b50b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transfercontrol.to.offscreen.w.html @@ -0,0 +1,76 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transferrable.html b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transferrable.html new file mode 100644 index 0000000000..76796034e9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transferrable.html @@ -0,0 +1,83 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transferrable.w.html b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transferrable.w.html new file mode 100644 index 0000000000..38f981e8f0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/the-offscreen-canvas/offscreencanvas.transferrable.w.html @@ -0,0 +1,142 @@ + + + + + + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/transformations/2d.transformation.getTransform.html b/testing/web-platform/tests/html/canvas/offscreen/manual/transformations/2d.transformation.getTransform.html new file mode 100644 index 0000000000..b3b70ac208 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/transformations/2d.transformation.getTransform.html @@ -0,0 +1,40 @@ + + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/manual/wide-gamut-canvas/2d.color.space.p3.convertToBlobp3.canvas.html b/testing/web-platform/tests/html/canvas/offscreen/manual/wide-gamut-canvas/2d.color.space.p3.convertToBlobp3.canvas.html new file mode 100644 index 0000000000..9fc63a9f49 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/manual/wide-gamut-canvas/2d.color.space.p3.convertToBlobp3.canvas.html @@ -0,0 +1,50 @@ + +OffscreenCanvas test: 2d.color.space.p3.convertToBlob.p3.canvas + + + + +

2d.color.space.p3.convertToBlob.p3.canvas

+

test if toblob returns p3 data from p3 color space canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.1.html new file mode 100644 index 0000000000..bdd2c7a65f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.1.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.arc.angle.1 + + + + +

2d.path.arc.angle.1

+

arc() draws pi/2 .. -pi anticlockwise correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.1.worker.js new file mode 100644 index 0000000000..1b6a534c23 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.1.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.angle.1 +// Description:arc() draws pi/2 .. -pi anticlockwise correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() draws pi/2 .. -pi anticlockwise correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.2.html new file mode 100644 index 0000000000..c92e83abd7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.2.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.arc.angle.2 + + + + +

2d.path.arc.angle.2

+

arc() draws -3pi/2 .. -pi anticlockwise correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.2.worker.js new file mode 100644 index 0000000000..25598c959d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.2.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.angle.2 +// Description:arc() draws -3pi/2 .. -pi anticlockwise correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() draws -3pi/2 .. -pi anticlockwise correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.3.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.3.html new file mode 100644 index 0000000000..86170ac8c5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.3.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.arc.angle.3 + + + + +

2d.path.arc.angle.3

+

arc() wraps angles mod 2pi when anticlockwise and end > start+2pi

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.3.worker.js new file mode 100644 index 0000000000..6841041d78 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.3.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.angle.3 +// Description:arc() wraps angles mod 2pi when anticlockwise and end > start+2pi +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() wraps angles mod 2pi when anticlockwise and end > start+2pi"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.4.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.4.html new file mode 100644 index 0000000000..e694b99f70 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.4.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.path.arc.angle.4 + + + + +

2d.path.arc.angle.4

+

arc() draws a full circle when clockwise and end > start+2pi

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.4.worker.js new file mode 100644 index 0000000000..502175165f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.4.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.angle.4 +// Description:arc() draws a full circle when clockwise and end > start+2pi +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() draws a full circle when clockwise and end > start+2pi"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.5.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.5.html new file mode 100644 index 0000000000..7f0d9af19f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.5.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.arc.angle.5 + + + + +

2d.path.arc.angle.5

+

arc() wraps angles mod 2pi when clockwise and start > end+2pi

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.5.worker.js new file mode 100644 index 0000000000..aa2320a92a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.5.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.angle.5 +// Description:arc() wraps angles mod 2pi when clockwise and start > end+2pi +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() wraps angles mod 2pi when clockwise and start > end+2pi"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.6.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.6.html new file mode 100644 index 0000000000..64cf6daeef --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.6.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.path.arc.angle.6 + + + + +

2d.path.arc.angle.6

+

arc() draws a full circle when anticlockwise and start > end+2pi

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.6.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.6.worker.js new file mode 100644 index 0000000000..929db397d3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.angle.6.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.angle.6 +// Description:arc() draws a full circle when anticlockwise and start > end+2pi +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() draws a full circle when anticlockwise and start > end+2pi"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.default.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.default.html new file mode 100644 index 0000000000..ee42c04085 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.default.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.arc.default + + + + +

2d.path.arc.default

+

arc() with missing last argument defaults to clockwise

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.default.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.default.worker.js new file mode 100644 index 0000000000..da74713e4a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.default.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.default +// Description:arc() with missing last argument defaults to clockwise +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() with missing last argument defaults to clockwise"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, Math.PI/2); + ctx.fill(); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.empty.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.empty.html new file mode 100644 index 0000000000..25414647b2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.empty.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.arc.empty + + + + +

2d.path.arc.empty

+

arc() with an empty path does not draw a straight line to the start point

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.empty.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.empty.worker.js new file mode 100644 index 0000000000..9b1fbb1a38 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.empty.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.empty +// Description:arc() with an empty path does not draw a straight line to the start point +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() with an empty path does not draw a straight line to the start point"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.end.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.end.html new file mode 100644 index 0000000000..b8459053f2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.end.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.path.arc.end + + + + +

2d.path.arc.end

+

arc() adds the end point of the arc to the subpath

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.end.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.end.worker.js new file mode 100644 index 0000000000..963640a273 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.end.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.end +// Description:arc() adds the end point of the arc to the subpath +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() adds the end point of the arc to the subpath"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.negative.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.negative.html new file mode 100644 index 0000000000..6c81b9e0de --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.negative.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.path.arc.negative + + + + +

2d.path.arc.negative

+

arc() with negative radius throws INDEX_SIZE_ERR

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.negative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.negative.worker.js new file mode 100644 index 0000000000..b48eb98474 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.negative.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.negative +// Description:arc() with negative radius throws INDEX_SIZE_ERR +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() with negative radius throws INDEX_SIZE_ERR"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.arc(0, 0, -1, 0, 0, true); }); + var path = new Path2D(); + assert_throws_dom("INDEX_SIZE_ERR", function() { path.arc(10, 10, -5, 0, 1, false); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonempty.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonempty.html new file mode 100644 index 0000000000..4d9ebe6d87 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonempty.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.arc.nonempty + + + + +

2d.path.arc.nonempty

+

arc() with a non-empty path does draw a straight line to the start point

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonempty.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonempty.worker.js new file mode 100644 index 0000000000..af6b4c9853 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonempty.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.nonempty +// Description:arc() with a non-empty path does draw a straight line to the start point +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() with a non-empty path does draw a straight line to the start point"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonfinite.html new file mode 100644 index 0000000000..b347a1e27a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonfinite.html @@ -0,0 +1,77 @@ + + +OffscreenCanvas test: 2d.path.arc.nonfinite + + + + +

2d.path.arc.nonfinite

+

arc() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonfinite.worker.js new file mode 100644 index 0000000000..50ff560e34 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.nonfinite.worker.js @@ -0,0 +1,72 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.nonfinite +// Description:arc() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.moveTo(0, 0); + ctx.lineTo(100, 0); + ctx.arc(Infinity, 0, 50, 0, 2*Math.PI, true); + ctx.arc(-Infinity, 0, 50, 0, 2*Math.PI, true); + ctx.arc(NaN, 0, 50, 0, 2*Math.PI, true); + ctx.arc(0, Infinity, 50, 0, 2*Math.PI, true); + ctx.arc(0, -Infinity, 50, 0, 2*Math.PI, true); + ctx.arc(0, NaN, 50, 0, 2*Math.PI, true); + ctx.arc(0, 0, Infinity, 0, 2*Math.PI, true); + ctx.arc(0, 0, -Infinity, 0, 2*Math.PI, true); + ctx.arc(0, 0, NaN, 0, 2*Math.PI, true); + ctx.arc(0, 0, 50, Infinity, 2*Math.PI, true); + ctx.arc(0, 0, 50, -Infinity, 2*Math.PI, true); + ctx.arc(0, 0, 50, NaN, 2*Math.PI, true); + ctx.arc(0, 0, 50, 0, Infinity, true); + ctx.arc(0, 0, 50, 0, -Infinity, true); + ctx.arc(0, 0, 50, 0, NaN, true); + ctx.arc(Infinity, Infinity, 50, 0, 2*Math.PI, true); + ctx.arc(Infinity, Infinity, Infinity, 0, 2*Math.PI, true); + ctx.arc(Infinity, Infinity, Infinity, Infinity, 2*Math.PI, true); + ctx.arc(Infinity, Infinity, Infinity, Infinity, Infinity, true); + ctx.arc(Infinity, Infinity, Infinity, 0, Infinity, true); + ctx.arc(Infinity, Infinity, 50, Infinity, 2*Math.PI, true); + ctx.arc(Infinity, Infinity, 50, Infinity, Infinity, true); + ctx.arc(Infinity, Infinity, 50, 0, Infinity, true); + ctx.arc(Infinity, 0, Infinity, 0, 2*Math.PI, true); + ctx.arc(Infinity, 0, Infinity, Infinity, 2*Math.PI, true); + ctx.arc(Infinity, 0, Infinity, Infinity, Infinity, true); + ctx.arc(Infinity, 0, Infinity, 0, Infinity, true); + ctx.arc(Infinity, 0, 50, Infinity, 2*Math.PI, true); + ctx.arc(Infinity, 0, 50, Infinity, Infinity, true); + ctx.arc(Infinity, 0, 50, 0, Infinity, true); + ctx.arc(0, Infinity, Infinity, 0, 2*Math.PI, true); + ctx.arc(0, Infinity, Infinity, Infinity, 2*Math.PI, true); + ctx.arc(0, Infinity, Infinity, Infinity, Infinity, true); + ctx.arc(0, Infinity, Infinity, 0, Infinity, true); + ctx.arc(0, Infinity, 50, Infinity, 2*Math.PI, true); + ctx.arc(0, Infinity, 50, Infinity, Infinity, true); + ctx.arc(0, Infinity, 50, 0, Infinity, true); + ctx.arc(0, 0, Infinity, Infinity, 2*Math.PI, true); + ctx.arc(0, 0, Infinity, Infinity, Infinity, true); + ctx.arc(0, 0, Infinity, 0, Infinity, true); + ctx.arc(0, 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); + _assertPixel(canvas, 90,45, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.1.html new file mode 100644 index 0000000000..bf8a6f1f91 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.1.html @@ -0,0 +1,54 @@ + + +OffscreenCanvas test: 2d.path.arc.scale.1 + + + + +

2d.path.arc.scale.1

+

Non-uniformly scaled arcs are the right shape

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.1.worker.js new file mode 100644 index 0000000000..5d9619a920 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.1.worker.js @@ -0,0 +1,49 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.scale.1 +// Description:Non-uniformly scaled arcs are the right shape +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Non-uniformly scaled arcs are the right shape"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,0, 0,255,0,255); + _assertPixel(canvas, 99,0, 0,255,0,255); + _assertPixel(canvas, 0,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 99,25, 0,255,0,255); + _assertPixel(canvas, 0,49, 0,255,0,255); + _assertPixel(canvas, 50,49, 0,255,0,255); + _assertPixel(canvas, 99,49, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.2.html new file mode 100644 index 0000000000..95376882cd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.2.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.path.arc.scale.2 + + + + +

2d.path.arc.scale.2

+

Highly scaled arcs are the right shape

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.2.worker.js new file mode 100644 index 0000000000..c655dad30f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.scale.2.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.scale.2 +// Description:Highly scaled arcs are the right shape +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Highly scaled arcs are the right shape"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 98,25, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 50,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.1.html new file mode 100644 index 0000000000..624b307af7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.1.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.path.arc.selfintersect.1 + + + + +

2d.path.arc.selfintersect.1

+

arc() with lineWidth > 2*radius is drawn sensibly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.1.worker.js new file mode 100644 index 0000000000..6c77dbd5b1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.1.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.selfintersect.1 +// Description:arc() with lineWidth > 2*radius is drawn sensibly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() with lineWidth > 2*radius is drawn sensibly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.2.html new file mode 100644 index 0000000000..b49aa2437a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.2.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.arc.selfintersect.2 + + + + +

2d.path.arc.selfintersect.2

+

arc() with lineWidth > 2*radius is drawn sensibly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.2.worker.js new file mode 100644 index 0000000000..2bbdacd46d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.selfintersect.2.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.selfintersect.2 +// Description:arc() with lineWidth > 2*radius is drawn sensibly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() with lineWidth > 2*radius is drawn sensibly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 90,10, 0,255,0,255); + _assertPixel(canvas, 97,1, 0,255,0,255); + _assertPixel(canvas, 97,2, 0,255,0,255); + _assertPixel(canvas, 97,3, 0,255,0,255); + _assertPixel(canvas, 2,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.1.html new file mode 100644 index 0000000000..ceb3cb380c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.1.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.path.arc.shape.1 + + + + +

2d.path.arc.shape.1

+

arc() from 0 to pi does not draw anything in the wrong half

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.1.worker.js new file mode 100644 index 0000000000..e1058ae96d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.1.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.shape.1 +// Description:arc() from 0 to pi does not draw anything in the wrong half +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() from 0 to pi does not draw anything in the wrong half"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 20,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.2.html new file mode 100644 index 0000000000..a39fd03947 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.2.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.path.arc.shape.2 + + + + +

2d.path.arc.shape.2

+

arc() from 0 to pi draws stuff in the right half

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.2.worker.js new file mode 100644 index 0000000000..d444d9b04e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.2.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.shape.2 +// Description:arc() from 0 to pi draws stuff in the right half +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() from 0 to pi draws stuff in the right half"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 20,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.3.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.3.html new file mode 100644 index 0000000000..853814aef2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.3.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.path.arc.shape.3 + + + + +

2d.path.arc.shape.3

+

arc() from 0 to -pi/2 does not draw anything in the wrong quadrant

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.3.worker.js new file mode 100644 index 0000000000..b8008e778b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.3.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.shape.3 +// Description:arc() from 0 to -pi/2 does not draw anything in the wrong quadrant +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() from 0 to -pi/2 does not draw anything in the wrong quadrant"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.4.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.4.html new file mode 100644 index 0000000000..e6221947df --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.4.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.path.arc.shape.4 + + + + +

2d.path.arc.shape.4

+

arc() from 0 to -pi/2 draws stuff in the right quadrant

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.4.worker.js new file mode 100644 index 0000000000..9174641c20 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.4.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.shape.4 +// Description:arc() from 0 to -pi/2 draws stuff in the right quadrant +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() from 0 to -pi/2 draws stuff in the right quadrant"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.5.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.5.html new file mode 100644 index 0000000000..968a1c58c0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.5.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.path.arc.shape.5 + + + + +

2d.path.arc.shape.5

+

arc() from 0 to 5pi does not draw crazy things

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.5.worker.js new file mode 100644 index 0000000000..7f40e4341a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.shape.5.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.shape.5 +// Description:arc() from 0 to 5pi does not draw crazy things +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() from 0 to 5pi does not draw crazy things"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.1.html new file mode 100644 index 0000000000..ced1207a9b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.1.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.arc.twopie.1 + + + + +

2d.path.arc.twopie.1

+

arc() draws nothing when end = start + 2pi-e and anticlockwise

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.1.worker.js new file mode 100644 index 0000000000..e9abf086e0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.1.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.twopie.1 +// Description:arc() draws nothing when end = start + 2pi-e and anticlockwise +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() draws nothing when end = start + 2pi-e and anticlockwise"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.2.html new file mode 100644 index 0000000000..4948b10f2f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.2.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.arc.twopie.2 + + + + +

2d.path.arc.twopie.2

+

arc() draws a full circle when end = start + 2pi-e and clockwise

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.2.worker.js new file mode 100644 index 0000000000..5e9c51e5e3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.2.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.twopie.2 +// Description:arc() draws a full circle when end = start + 2pi-e and clockwise +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() draws a full circle when end = start + 2pi-e and clockwise"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.3.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.3.html new file mode 100644 index 0000000000..c4036fc06e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.3.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.arc.twopie.3 + + + + +

2d.path.arc.twopie.3

+

arc() draws a full circle when end = start + 2pi+e and anticlockwise

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.3.worker.js new file mode 100644 index 0000000000..ad72fbd0af --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.3.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.twopie.3 +// Description:arc() draws a full circle when end = start + 2pi+e and anticlockwise +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() draws a full circle when end = start + 2pi+e and anticlockwise"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.4.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.4.html new file mode 100644 index 0000000000..392f00e652 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.4.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.arc.twopie.4 + + + + +

2d.path.arc.twopie.4

+

arc() draws nothing when end = start + 2pi+e and clockwise

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.4.worker.js new file mode 100644 index 0000000000..15d799209c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.4.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.twopie.4 +// Description:arc() draws nothing when end = start + 2pi+e and clockwise +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() draws nothing when end = start + 2pi+e and clockwise"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.5.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.5.html new file mode 100644 index 0000000000..17c66c527c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.5.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.arc.twopie.5 + + + + +

2d.path.arc.twopie.5

+

arc() draws correctly when start = 2 and end = start + 2pi+e and clockwise

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.5.worker.js new file mode 100644 index 0000000000..8fa29d5a97 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.5.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.twopie.5 +// Description:arc() draws correctly when start = 2 and end = start + 2pi+e and clockwise +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() draws correctly when start = 2 and end = start + 2pi+e and clockwise"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#fff'; + ctx.fillRect(0, 0, 100, 50); + ctx.fillStyle = '#000'; + ctx.beginPath(); + ctx.moveTo(50, 25); + ctx.arc(50, 25, 50, 2, 2 + 2*Math.PI, false); + ctx.closePath(); + ctx.fill(); + _assertPixel(canvas, 95,25, 0,0,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.6.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.6.html new file mode 100644 index 0000000000..befec82704 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.6.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.arc.twopie.6 + + + + +

2d.path.arc.twopie.6

+

arc() draws correctly when start = 5 and end = start + 2pi+e and clockwise

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.6.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.6.worker.js new file mode 100644 index 0000000000..546cbce33c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.twopie.6.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.twopie.6 +// Description:arc() draws correctly when start = 5 and end = start + 2pi+e and clockwise +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() draws correctly when start = 5 and end = start + 2pi+e and clockwise"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#fff'; + ctx.fillRect(0, 0, 100, 50); + ctx.fillStyle = '#000'; + ctx.beginPath(); + ctx.moveTo(50, 25); + ctx.arc(50, 25, 50, 5, 5 + 2*Math.PI, false); + ctx.closePath(); + ctx.fill(); + _assertPixel(canvas, 5,25, 0,0,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.1.html new file mode 100644 index 0000000000..5757ab3ddf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.1.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.arc.zero.1 + + + + +

2d.path.arc.zero.1

+

arc() draws nothing when startAngle = endAngle and anticlockwise

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.1.worker.js new file mode 100644 index 0000000000..5a6d35f691 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.1.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.zero.1 +// Description:arc() draws nothing when startAngle = endAngle and anticlockwise +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() draws nothing when startAngle = endAngle and anticlockwise"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.2.html new file mode 100644 index 0000000000..69f8472443 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.2.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.arc.zero.2 + + + + +

2d.path.arc.zero.2

+

arc() draws nothing when startAngle = endAngle and clockwise

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.2.worker.js new file mode 100644 index 0000000000..a285462fc0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zero.2.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.zero.2 +// Description:arc() draws nothing when startAngle = endAngle and clockwise +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() draws nothing when startAngle = endAngle and clockwise"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zeroradius.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zeroradius.html new file mode 100644 index 0000000000..7303b7dc1c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zeroradius.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.arc.zeroradius + + + + +

2d.path.arc.zeroradius

+

arc() with zero radius draws a line to the start point

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zeroradius.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zeroradius.worker.js new file mode 100644 index 0000000000..183acc1bbb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arc.zeroradius.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arc.zeroradius +// Description:arc() with zero radius draws a line to the start point +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arc() with zero radius draws a line to the start point"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.1.html new file mode 100644 index 0000000000..e7558d628f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.1.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.path.arcTo.coincide.1 + + + + +

2d.path.arcTo.coincide.1

+

arcTo() has no effect if P0 = P1

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.1.worker.js new file mode 100644 index 0000000000..80a74c6d91 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.1.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.coincide.1 +// Description:arcTo() has no effect if P0 = P1 +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arcTo() has no effect if P0 = P1"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 50,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.2.html new file mode 100644 index 0000000000..18ac31524d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.2.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.path.arcTo.coincide.2 + + + + +

2d.path.arcTo.coincide.2

+

arcTo() draws a straight line to P1 if P1 = P2

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.2.worker.js new file mode 100644 index 0000000000..a35ffe6977 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.coincide.2.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.coincide.2 +// Description:arcTo() draws a straight line to P1 if P1 = P2 +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arcTo() draws a straight line to P1 if P1 = P2"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.1.html new file mode 100644 index 0000000000..b9bcc7b238 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.1.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.path.arcTo.collinear.1 + + + + +

2d.path.arcTo.collinear.1

+

arcTo() with all points on a line, and P1 between P0/P2, draws a straight line to P1

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.1.worker.js new file mode 100644 index 0000000000..a814b1af07 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.1.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.collinear.1 +// Description:arcTo() with all points on a line, and P1 between P0/P2, draws a straight line to P1 +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arcTo() with all points on a line, and P1 between P0/P2, draws a straight line to P1"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.2.html new file mode 100644 index 0000000000..f51a7af206 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.2.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.path.arcTo.collinear.2 + + + + +

2d.path.arcTo.collinear.2

+

arcTo() with all points on a line, and P2 between P0/P1, draws a straight line to P1

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.2.worker.js new file mode 100644 index 0000000000..ba9a75ed4e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.2.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.collinear.2 +// Description:arcTo() with all points on a line, and P2 between P0/P1, draws a straight line to P1 +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arcTo() with all points on a line, and P2 between P0/P1, draws a straight line to P1"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.3.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.3.html new file mode 100644 index 0000000000..568d0f8f2b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.3.html @@ -0,0 +1,48 @@ + + +OffscreenCanvas test: 2d.path.arcTo.collinear.3 + + + + +

2d.path.arcTo.collinear.3

+

arcTo() with all points on a line, and P0 between P1/P2, draws a straight line to P1

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.3.worker.js new file mode 100644 index 0000000000..8087909cb7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.collinear.3.worker.js @@ -0,0 +1,43 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.collinear.3 +// Description:arcTo() with all points on a line, and P0 between P1/P2, draws a straight line to P1 +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arcTo() with all points on a line, and P0 between P1/P2, draws a straight line to P1"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.1.html new file mode 100644 index 0000000000..ec1bd0399d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.1.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.arcTo.ensuresubpath.1 + + + + +

2d.path.arcTo.ensuresubpath.1

+

If there is no subpath, the first control point is added (and nothing is drawn up to it)

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.1.worker.js new file mode 100644 index 0000000000..74d71b6253 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.1.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.ensuresubpath.1 +// Description:If there is no subpath, the first control point is added (and nothing is drawn up to it) +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("If there is no subpath, the first control point is added (and nothing is drawn up to it)"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.2.html new file mode 100644 index 0000000000..60ee458524 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.2.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.arcTo.ensuresubpath.2 + + + + +

2d.path.arcTo.ensuresubpath.2

+

If there is no subpath, the first control point is added

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.2.worker.js new file mode 100644 index 0000000000..76790925af --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.ensuresubpath.2.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.ensuresubpath.2 +// Description:If there is no subpath, the first control point is added +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("If there is no subpath, the first control point is added"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.negative.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.negative.html new file mode 100644 index 0000000000..c35e293a6f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.negative.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.path.arcTo.negative + + + + +

2d.path.arcTo.negative

+

arcTo() with negative radius throws an exception

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.negative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.negative.worker.js new file mode 100644 index 0000000000..104e7a6387 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.negative.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.negative +// Description:arcTo() with negative radius throws an exception +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arcTo() with negative radius throws an exception"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.arcTo(0, 0, 0, 0, -1); }); + var path = new Path2D(); + assert_throws_dom("INDEX_SIZE_ERR", function() { path.arcTo(10, 10, 20, 20, -5); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.nonfinite.html new file mode 100644 index 0000000000..9d2256d79c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.nonfinite.html @@ -0,0 +1,75 @@ + + +OffscreenCanvas test: 2d.path.arcTo.nonfinite + + + + +

2d.path.arcTo.nonfinite

+

arcTo() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.nonfinite.worker.js new file mode 100644 index 0000000000..1d2c913cfe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.nonfinite.worker.js @@ -0,0 +1,70 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.nonfinite +// Description:arcTo() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arcTo() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 90,45, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.scale.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.scale.html new file mode 100644 index 0000000000..26dfa640ff --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.scale.html @@ -0,0 +1,47 @@ + + +OffscreenCanvas test: 2d.path.arcTo.scale + + + + +

2d.path.arcTo.scale

+

arcTo scales the curve, not just the control points

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.scale.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.scale.worker.js new file mode 100644 index 0000000000..dc41e6d92d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.scale.worker.js @@ -0,0 +1,42 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.scale +// Description:arcTo scales the curve, not just the control points +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arcTo scales the curve, not just the control points"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,0, 0,255,0,255); + _assertPixel(canvas, 99,0, 0,255,0,255); + _assertPixel(canvas, 0,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 99,25, 0,255,0,255); + _assertPixel(canvas, 0,49, 0,255,0,255); + _assertPixel(canvas, 50,49, 0,255,0,255); + _assertPixel(canvas, 99,49, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve1.html new file mode 100644 index 0000000000..f7d10dd61a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve1.html @@ -0,0 +1,60 @@ + + +OffscreenCanvas test: 2d.path.arcTo.shape.curve1 + + + + +

2d.path.arcTo.shape.curve1

+

arcTo() curves in the right kind of shape

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve1.worker.js new file mode 100644 index 0000000000..c7e61ab576 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve1.worker.js @@ -0,0 +1,55 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.shape.curve1 +// Description:arcTo() curves in the right kind of shape +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arcTo() curves in the right kind of shape"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 55,19, 0,255,0,255); + _assertPixel(canvas, 55,20, 0,255,0,255); + _assertPixel(canvas, 55,21, 0,255,0,255); + _assertPixel(canvas, 64,22, 0,255,0,255); + _assertPixel(canvas, 65,21, 0,255,0,255); + _assertPixel(canvas, 72,28, 0,255,0,255); + _assertPixel(canvas, 73,27, 0,255,0,255); + _assertPixel(canvas, 78,36, 0,255,0,255); + _assertPixel(canvas, 79,35, 0,255,0,255); + _assertPixel(canvas, 80,44, 0,255,0,255); + _assertPixel(canvas, 80,45, 0,255,0,255); + _assertPixel(canvas, 80,46, 0,255,0,255); + _assertPixel(canvas, 65,45, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve2.html new file mode 100644 index 0000000000..1a023322b2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve2.html @@ -0,0 +1,59 @@ + + +OffscreenCanvas test: 2d.path.arcTo.shape.curve2 + + + + +

2d.path.arcTo.shape.curve2

+

arcTo() curves in the right kind of shape

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve2.worker.js new file mode 100644 index 0000000000..f00e506f30 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.curve2.worker.js @@ -0,0 +1,54 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.shape.curve2 +// Description:arcTo() curves in the right kind of shape +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arcTo() curves in the right kind of shape"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 55,19, 0,255,0,255); + _assertPixel(canvas, 55,20, 0,255,0,255); + _assertPixel(canvas, 55,21, 0,255,0,255); + _assertPixel(canvas, 64,22, 0,255,0,255); + _assertPixel(canvas, 65,21, 0,255,0,255); + _assertPixel(canvas, 72,28, 0,255,0,255); + _assertPixel(canvas, 73,27, 0,255,0,255); + _assertPixel(canvas, 78,36, 0,255,0,255); + _assertPixel(canvas, 79,35, 0,255,0,255); + _assertPixel(canvas, 80,44, 0,255,0,255); + _assertPixel(canvas, 80,45, 0,255,0,255); + _assertPixel(canvas, 80,46, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.end.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.end.html new file mode 100644 index 0000000000..3f8af61215 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.end.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.path.arcTo.shape.end + + + + +

2d.path.arcTo.shape.end

+

arcTo() does not draw anything from P1 to P2

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.end.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.end.worker.js new file mode 100644 index 0000000000..20cc956a44 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.end.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.shape.end +// Description:arcTo() does not draw anything from P1 to P2 +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arcTo() does not draw anything from P1 to P2"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.start.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.start.html new file mode 100644 index 0000000000..a426a19d8a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.start.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.path.arcTo.shape.start + + + + +

2d.path.arcTo.shape.start

+

arcTo() draws a straight line from P0 to P1

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.start.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.start.worker.js new file mode 100644 index 0000000000..cebf27a821 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.shape.start.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.shape.start +// Description:arcTo() draws a straight line from P0 to P1 +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arcTo() draws a straight line from P0 to P1"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.transformation.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.transformation.html new file mode 100644 index 0000000000..842210138a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.transformation.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.path.arcTo.transformation + + + + +

2d.path.arcTo.transformation

+

arcTo joins up to the last subpath point correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.transformation.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.transformation.worker.js new file mode 100644 index 0000000000..585a500079 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.transformation.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.transformation +// Description:arcTo joins up to the last subpath point correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arcTo joins up to the last subpath point correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,0, 0,255,0,255); + _assertPixel(canvas, 99,0, 0,255,0,255); + _assertPixel(canvas, 0,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 99,25, 0,255,0,255); + _assertPixel(canvas, 0,49, 0,255,0,255); + _assertPixel(canvas, 50,49, 0,255,0,255); + _assertPixel(canvas, 99,49, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.1.html new file mode 100644 index 0000000000..a367385551 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.1.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.path.arcTo.zero.1 + + + + +

2d.path.arcTo.zero.1

+

arcTo() with zero radius draws a straight line from P0 to P1

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.1.worker.js new file mode 100644 index 0000000000..8f6d979a55 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.1.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.zero.1 +// Description:arcTo() with zero radius draws a straight line from P0 to P1 +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arcTo() with zero radius draws a straight line from P0 to P1"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.2.html new file mode 100644 index 0000000000..87ab4e13de --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.2.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.path.arcTo.zero.2 + + + + +

2d.path.arcTo.zero.2

+

arcTo() with zero radius draws a straight line from P0 to P1, even when all points are collinear

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.2.worker.js new file mode 100644 index 0000000000..0a45976325 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.arcTo.zero.2.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.arcTo.zero.2 +// Description:arcTo() with zero radius draws a straight line from P0 to P1, even when all points are collinear +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("arcTo() with zero radius draws a straight line from P0 to P1, even when all points are collinear"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.beginPath.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.beginPath.html new file mode 100644 index 0000000000..b2043d604d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.beginPath.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.path.beginPath + + + + +

2d.path.beginPath

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.beginPath.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.beginPath.worker.js new file mode 100644 index 0000000000..35a4acc84d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.beginPath.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.beginPath +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.basic.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.basic.html new file mode 100644 index 0000000000..099919060b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.basic.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.bezierCurveTo.basic + + + + +

2d.path.bezierCurveTo.basic

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.basic.worker.js new file mode 100644 index 0000000000..e7c86a08f9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.basic.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.bezierCurveTo.basic +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.1.html new file mode 100644 index 0000000000..6a11d1bfbb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.1.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.bezierCurveTo.ensuresubpath.1 + + + + +

2d.path.bezierCurveTo.ensuresubpath.1

+

If there is no subpath, the first control point is added (and nothing is drawn up to it)

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.1.worker.js new file mode 100644 index 0000000000..d6ef6f3f1b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.1.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.bezierCurveTo.ensuresubpath.1 +// Description:If there is no subpath, the first control point is added (and nothing is drawn up to it) +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("If there is no subpath, the first control point is added (and nothing is drawn up to it)"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 95,45, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.2.html new file mode 100644 index 0000000000..d2afd19f66 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.2.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.bezierCurveTo.ensuresubpath.2 + + + + +

2d.path.bezierCurveTo.ensuresubpath.2

+

If there is no subpath, the first control point is added

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.2.worker.js new file mode 100644 index 0000000000..6860e60f4a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.ensuresubpath.2.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.bezierCurveTo.ensuresubpath.2 +// Description:If there is no subpath, the first control point is added +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("If there is no subpath, the first control point is added"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 5,45, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.nonfinite.html new file mode 100644 index 0000000000..b49e2f43f3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.nonfinite.html @@ -0,0 +1,109 @@ + + +OffscreenCanvas test: 2d.path.bezierCurveTo.nonfinite + + + + +

2d.path.bezierCurveTo.nonfinite

+

bezierCurveTo() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.nonfinite.worker.js new file mode 100644 index 0000000000..7eaf278f6c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.nonfinite.worker.js @@ -0,0 +1,104 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.bezierCurveTo.nonfinite +// Description:bezierCurveTo() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("bezierCurveTo() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 90,45, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.scaled.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.scaled.html new file mode 100644 index 0000000000..10a085e9de --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.scaled.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.path.bezierCurveTo.scaled + + + + +

2d.path.bezierCurveTo.scaled

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.scaled.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.scaled.worker.js new file mode 100644 index 0000000000..5098fe83eb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.scaled.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.bezierCurveTo.scaled +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.shape.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.shape.html new file mode 100644 index 0000000000..fc6b9273e0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.shape.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.path.bezierCurveTo.shape + + + + +

2d.path.bezierCurveTo.shape

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.shape.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.shape.worker.js new file mode 100644 index 0000000000..58f601c5d5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.bezierCurveTo.shape.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.bezierCurveTo.shape +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.1.html new file mode 100644 index 0000000000..e90be3d73f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.1.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.path.clip.basic.1 + + + + +

2d.path.clip.basic.1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.1.worker.js new file mode 100644 index 0000000000..708608e1e0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.1.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.clip.basic.1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.2.html new file mode 100644 index 0000000000..6426ba2d83 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.2.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.path.clip.basic.2 + + + + +

2d.path.clip.basic.2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.2.worker.js new file mode 100644 index 0000000000..1ec28b6205 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.basic.2.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.clip.basic.2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.empty.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.empty.html new file mode 100644 index 0000000000..30e0d6cba4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.empty.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.path.clip.empty + + + + +

2d.path.clip.empty

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.empty.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.empty.worker.js new file mode 100644 index 0000000000..3f91a7e2e7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.empty.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.clip.empty +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.intersect.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.intersect.html new file mode 100644 index 0000000000..94607f6d92 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.intersect.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.path.clip.intersect + + + + +

2d.path.clip.intersect

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.intersect.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.intersect.worker.js new file mode 100644 index 0000000000..8c0fcb68bd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.intersect.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.clip.intersect +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.unaffected.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.unaffected.html new file mode 100644 index 0000000000..e9b69282af --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.unaffected.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.clip.unaffected + + + + +

2d.path.clip.unaffected

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.unaffected.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.unaffected.worker.js new file mode 100644 index 0000000000..d65a421d33 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.unaffected.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.clip.unaffected +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.1.html new file mode 100644 index 0000000000..2fd7c1abbf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.1.html @@ -0,0 +1,45 @@ + + +OffscreenCanvas test: 2d.path.clip.winding.1 + + + + +

2d.path.clip.winding.1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.1.worker.js new file mode 100644 index 0000000000..aa89fd55c3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.1.worker.js @@ -0,0 +1,40 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.clip.winding.1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.2.html new file mode 100644 index 0000000000..eed064f84e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.2.html @@ -0,0 +1,49 @@ + + +OffscreenCanvas test: 2d.path.clip.winding.2 + + + + +

2d.path.clip.winding.2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.2.worker.js new file mode 100644 index 0000000000..5c9cac6bb6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.clip.winding.2.worker.js @@ -0,0 +1,44 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.clip.winding.2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.empty.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.empty.html new file mode 100644 index 0000000000..c7596a8f1c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.empty.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.path.closePath.empty + + + + +

2d.path.closePath.empty

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.empty.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.empty.worker.js new file mode 100644 index 0000000000..c9a4030e68 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.empty.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.closePath.empty +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.closePath(); + ctx.fillStyle = '#f00'; + ctx.fill(); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.newline.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.newline.html new file mode 100644 index 0000000000..771f3d3ca0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.newline.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.path.closePath.newline + + + + +

2d.path.closePath.newline

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.newline.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.newline.worker.js new file mode 100644 index 0000000000..4dff932086 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.newline.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.closePath.newline +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.nextpoint.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.nextpoint.html new file mode 100644 index 0000000000..3dffdeaf5b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.nextpoint.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.path.closePath.nextpoint + + + + +

2d.path.closePath.nextpoint

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.nextpoint.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.nextpoint.worker.js new file mode 100644 index 0000000000..86d931b671 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.closePath.nextpoint.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.closePath.nextpoint +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.ellipse.basics.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.ellipse.basics.html new file mode 100644 index 0000000000..d664c45593 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.ellipse.basics.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.path.ellipse.basics + + + + +

2d.path.ellipse.basics

+

Verify canvas throws error when drawing ellipse with negative radii.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.ellipse.basics.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.ellipse.basics.worker.js new file mode 100644 index 0000000000..60f3e9a673 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.ellipse.basics.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.ellipse.basics +// Description:Verify canvas throws error when drawing ellipse with negative radii. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify canvas throws error when drawing ellipse with negative radii."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.ellipse(10, 10, 10, 5, 0, 0, 1, false); + ctx.ellipse(10, 10, 10, 0, 0, 0, 1, false); + ctx.ellipse(10, 10, -0, 5, 0, 0, 1, false); + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.ellipse(10, 10, -2, 5, 0, 0, 1, false); }); + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.ellipse(10, 10, 0, -1.5, 0, 0, 1, false); }); + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.ellipse(10, 10, -2, -5, 0, 0, 1, false); }); + ctx.ellipse(80, 0, 10, 4294967277, Math.PI / -84, -Math.PI / 2147483436, false); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.basic.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.basic.html new file mode 100644 index 0000000000..6f8fd51de7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.basic.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.path.fill.closed.basic + + + + +

2d.path.fill.closed.basic

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.basic.worker.js new file mode 100644 index 0000000000..9dad73b579 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.basic.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.fill.closed.basic +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.unaffected.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.unaffected.html new file mode 100644 index 0000000000..706e38d176 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.unaffected.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.path.fill.closed.unaffected + + + + +

2d.path.fill.closed.unaffected

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.unaffected.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.unaffected.worker.js new file mode 100644 index 0000000000..b6d7982866 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.closed.unaffected.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.fill.closed.unaffected +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 10,40, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.overlap.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.overlap.html new file mode 100644 index 0000000000..da936fab57 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.overlap.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.path.fill.overlap + + + + +

2d.path.fill.overlap

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.overlap.png b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.overlap.png new file mode 100644 index 0000000000..e2a35d48d4 Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.overlap.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.overlap.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.overlap.worker.js new file mode 100644 index 0000000000..8f30cc7af2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.overlap.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.fill.overlap +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 1); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.add.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.add.html new file mode 100644 index 0000000000..40845a4a77 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.add.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.fill.winding.add + + + + +

2d.path.fill.winding.add

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.add.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.add.worker.js new file mode 100644 index 0000000000..cdbfc7f3a4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.add.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.fill.winding.add +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.1.html new file mode 100644 index 0000000000..e0f9c838b1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.1.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.fill.winding.subtract.1 + + + + +

2d.path.fill.winding.subtract.1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.1.worker.js new file mode 100644 index 0000000000..3d6a1660de --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.1.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.fill.winding.subtract.1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.2.html new file mode 100644 index 0000000000..c7de03ae08 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.2.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.path.fill.winding.subtract.2 + + + + +

2d.path.fill.winding.subtract.2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.2.worker.js new file mode 100644 index 0000000000..0e8b4c79a5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.2.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.fill.winding.subtract.2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.3.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.3.html new file mode 100644 index 0000000000..3d12380357 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.3.html @@ -0,0 +1,47 @@ + + +OffscreenCanvas test: 2d.path.fill.winding.subtract.3 + + + + +

2d.path.fill.winding.subtract.3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.3.worker.js new file mode 100644 index 0000000000..6c9f07c76a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.fill.winding.subtract.3.worker.js @@ -0,0 +1,42 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.fill.winding.subtract.3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.initial.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.initial.html new file mode 100644 index 0000000000..e2e02f5142 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.initial.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.path.initial + + + + +

2d.path.initial

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.initial.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.initial.worker.js new file mode 100644 index 0000000000..de1a935032 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.initial.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.initial +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.closePath(); + ctx.fillStyle = '#f00'; + ctx.fill(); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.arc.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.arc.html new file mode 100644 index 0000000000..ccffcd7d76 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.arc.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.arc + + + + +

2d.path.isPointInPath.arc

+

isPointInPath() works on arcs

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.arc.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.arc.worker.js new file mode 100644 index 0000000000..13510b744f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.arc.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.arc +// Description:isPointInPath() works on arcs +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() works on arcs"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.1.html new file mode 100644 index 0000000000..7b9673a812 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.1.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.basic.1 + + + + +

2d.path.isPointInPath.basic.1

+

isPointInPath() detects whether the point is inside the path

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.1.worker.js new file mode 100644 index 0000000000..f51900ea6b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.1.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.basic.1 +// Description:isPointInPath() detects whether the point is inside the path +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() detects whether the point is inside the path"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.2.html new file mode 100644 index 0000000000..3710dd185d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.2.html @@ -0,0 +1,29 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.basic.2 + + + + +

2d.path.isPointInPath.basic.2

+

isPointInPath() detects whether the point is inside the path

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.2.worker.js new file mode 100644 index 0000000000..6024a0dc39 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.2.worker.js @@ -0,0 +1,24 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.basic.2 +// Description:isPointInPath() detects whether the point is inside the path +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() detects whether the point is inside the path"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.html new file mode 100644 index 0000000000..21cf448de2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.html @@ -0,0 +1,66 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.basic + + + + +

2d.path.isPointInPath.basic

+

Verify the winding rule in isPointInPath works for for rect path.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.worker.js new file mode 100644 index 0000000000..3e2a95c15e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.basic.worker.js @@ -0,0 +1,61 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.basic +// Description:Verify the winding rule in isPointInPath works for for rect path. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify the winding rule in isPointInPath works for for rect path."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 200; + canvas.height = 200; + + // Testing default isPointInPath + ctx.beginPath(); + ctx.rect(0, 0, 100, 100); + ctx.rect(25, 25, 50, 50); + _assertSame(ctx.isPointInPath(50, 50), true, "ctx.isPointInPath(50, 50)", "true"); + _assertSame(ctx.isPointInPath(NaN, 50), false, "ctx.isPointInPath(NaN, 50)", "false"); + _assertSame(ctx.isPointInPath(50, NaN), false, "ctx.isPointInPath(50, NaN)", "false"); + + // Testing nonzero isPointInPath + ctx.beginPath(); + ctx.rect(0, 0, 100, 100); + ctx.rect(25, 25, 50, 50); + _assertSame(ctx.isPointInPath(50, 50, 'nonzero'), true, "ctx.isPointInPath(50, 50, 'nonzero')", "true"); + + // Testing evenodd isPointInPath + ctx.beginPath(); + ctx.rect(0, 0, 100, 100); + ctx.rect(25, 25, 50, 50); + _assertSame(ctx.isPointInPath(50, 50, 'evenodd'), false, "ctx.isPointInPath(50, 50, 'evenodd')", "false"); + + // Testing extremely large scale + ctx.save(); + ctx.scale(Number.MAX_VALUE, Number.MAX_VALUE); + ctx.beginPath(); + ctx.rect(-10, -10, 20, 20); + _assertSame(ctx.isPointInPath(0, 0, 'nonzero'), true, "ctx.isPointInPath(0, 0, 'nonzero')", "true"); + _assertSame(ctx.isPointInPath(0, 0, 'evenodd'), true, "ctx.isPointInPath(0, 0, 'evenodd')", "true"); + ctx.restore(); + + // Check with non-invertible ctm. + ctx.save(); + ctx.scale(0, 0); + ctx.beginPath(); + ctx.rect(-10, -10, 20, 20); + _assertSame(ctx.isPointInPath(0, 0, 'nonzero'), false, "ctx.isPointInPath(0, 0, 'nonzero')", "false"); + _assertSame(ctx.isPointInPath(0, 0, 'evenodd'), false, "ctx.isPointInPath(0, 0, 'evenodd')", "false"); + ctx.restore(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bezier.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bezier.html new file mode 100644 index 0000000000..d348110305 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bezier.html @@ -0,0 +1,48 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.bezier + + + + +

2d.path.isPointInPath.bezier

+

isPointInPath() works on Bezier curves

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bezier.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bezier.worker.js new file mode 100644 index 0000000000..894fe5da31 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bezier.worker.js @@ -0,0 +1,43 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.bezier +// Description:isPointInPath() works on Bezier curves +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() works on Bezier curves"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.moveTo(25, 25); + ctx.bezierCurveTo(50, -50, 50, 100, 75, 25); + _assertSame(ctx.isPointInPath(25, 20), false, "ctx.isPointInPath(25, 20)", "false"); + _assertSame(ctx.isPointInPath(25, 30), false, "ctx.isPointInPath(25, 30)", "false"); + _assertSame(ctx.isPointInPath(30, 20), true, "ctx.isPointInPath(30, 20)", "true"); + _assertSame(ctx.isPointInPath(30, 30), false, "ctx.isPointInPath(30, 30)", "false"); + _assertSame(ctx.isPointInPath(40, 2), false, "ctx.isPointInPath(40, 2)", "false"); + _assertSame(ctx.isPointInPath(40, 20), true, "ctx.isPointInPath(40, 20)", "true"); + _assertSame(ctx.isPointInPath(40, 30), false, "ctx.isPointInPath(40, 30)", "false"); + _assertSame(ctx.isPointInPath(40, 47), false, "ctx.isPointInPath(40, 47)", "false"); + _assertSame(ctx.isPointInPath(45, 20), true, "ctx.isPointInPath(45, 20)", "true"); + _assertSame(ctx.isPointInPath(45, 30), false, "ctx.isPointInPath(45, 30)", "false"); + _assertSame(ctx.isPointInPath(55, 20), false, "ctx.isPointInPath(55, 20)", "false"); + _assertSame(ctx.isPointInPath(55, 30), true, "ctx.isPointInPath(55, 30)", "true"); + _assertSame(ctx.isPointInPath(60, 2), false, "ctx.isPointInPath(60, 2)", "false"); + _assertSame(ctx.isPointInPath(60, 20), false, "ctx.isPointInPath(60, 20)", "false"); + _assertSame(ctx.isPointInPath(60, 30), true, "ctx.isPointInPath(60, 30)", "true"); + _assertSame(ctx.isPointInPath(60, 47), false, "ctx.isPointInPath(60, 47)", "false"); + _assertSame(ctx.isPointInPath(70, 20), false, "ctx.isPointInPath(70, 20)", "false"); + _assertSame(ctx.isPointInPath(70, 30), true, "ctx.isPointInPath(70, 30)", "true"); + _assertSame(ctx.isPointInPath(75, 20), false, "ctx.isPointInPath(75, 20)", "false"); + _assertSame(ctx.isPointInPath(75, 30), false, "ctx.isPointInPath(75, 30)", "false"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bigarc.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bigarc.html new file mode 100644 index 0000000000..fcb4ca8827 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bigarc.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.bigarc + + + + +

2d.path.isPointInPath.bigarc

+

isPointInPath() works on unclosed arcs larger than 2pi

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bigarc.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bigarc.worker.js new file mode 100644 index 0000000000..40233790c8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.bigarc.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.bigarc +// Description:isPointInPath() works on unclosed arcs larger than 2pi +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() works on unclosed arcs larger than 2pi"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.edge.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.edge.html new file mode 100644 index 0000000000..aa367b4e56 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.edge.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.edge + + + + +

2d.path.isPointInPath.edge

+

isPointInPath() counts points on the path as being inside

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.edge.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.edge.worker.js new file mode 100644 index 0000000000..3918a6fe83 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.edge.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.edge +// Description:isPointInPath() counts points on the path as being inside +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() counts points on the path as being inside"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.empty.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.empty.html new file mode 100644 index 0000000000..d2ebf1e7e1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.empty.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.empty + + + + +

2d.path.isPointInPath.empty

+

isPointInPath() works when there is no path

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.empty.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.empty.worker.js new file mode 100644 index 0000000000..319836dcb5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.empty.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.empty +// Description:isPointInPath() works when there is no path +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() works when there is no path"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.isPointInPath(0, 0), false, "ctx.isPointInPath(0, 0)", "false"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.nonfinite.html new file mode 100644 index 0000000000..ef12d057ed --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.nonfinite.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.nonfinite + + + + +

2d.path.isPointInPath.nonfinite

+

isPointInPath() returns false for non-finite arguments

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.nonfinite.worker.js new file mode 100644 index 0000000000..dfa6eec766 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.nonfinite.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.nonfinite +// Description:isPointInPath() returns false for non-finite arguments +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() returns false for non-finite arguments"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.outside.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.outside.html new file mode 100644 index 0000000000..ce2ab819dd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.outside.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.outside + + + + +

2d.path.isPointInPath.outside

+

isPointInPath() works on paths outside the canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.outside.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.outside.worker.js new file mode 100644 index 0000000000..d4db12ef37 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.outside.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.outside +// Description:isPointInPath() works on paths outside the canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() works on paths outside the canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.subpath.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.subpath.html new file mode 100644 index 0000000000..c4abd92764 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.subpath.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.subpath + + + + +

2d.path.isPointInPath.subpath

+

isPointInPath() uses the current path, not just the subpath

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.subpath.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.subpath.worker.js new file mode 100644 index 0000000000..82df3b7c70 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.subpath.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.subpath +// Description:isPointInPath() uses the current path, not just the subpath +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() uses the current path, not just the subpath"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.1.html new file mode 100644 index 0000000000..bccaa842e5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.1.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.transform.1 + + + + +

2d.path.isPointInPath.transform.1

+

isPointInPath() handles transformations correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.1.worker.js new file mode 100644 index 0000000000..0774fd0d62 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.1.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.transform.1 +// Description:isPointInPath() handles transformations correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() handles transformations correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.2.html new file mode 100644 index 0000000000..1e587c1d8a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.2.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.transform.2 + + + + +

2d.path.isPointInPath.transform.2

+

isPointInPath() handles transformations correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.2.worker.js new file mode 100644 index 0000000000..ff4c42c450 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.2.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.transform.2 +// Description:isPointInPath() handles transformations correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() handles transformations correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.3.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.3.html new file mode 100644 index 0000000000..826d7e23c9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.3.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.transform.3 + + + + +

2d.path.isPointInPath.transform.3

+

isPointInPath() handles transformations correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.3.worker.js new file mode 100644 index 0000000000..f6750e9109 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.3.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.transform.3 +// Description:isPointInPath() handles transformations correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() handles transformations correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.4.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.4.html new file mode 100644 index 0000000000..97792d6889 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.4.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.transform.4 + + + + +

2d.path.isPointInPath.transform.4

+

isPointInPath() handles transformations correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.4.worker.js new file mode 100644 index 0000000000..f43a8a3d1e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.transform.4.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.transform.4 +// Description:isPointInPath() handles transformations correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() handles transformations correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.translate(50, 0); + ctx.rect(50, 0, 20, 20); + ctx.translate(0, 50); + _assertSame(ctx.isPointInPath(60, 10), false, "ctx.isPointInPath(60, 10)", "false"); + _assertSame(ctx.isPointInPath(110, 10), true, "ctx.isPointInPath(110, 10)", "true"); + _assertSame(ctx.isPointInPath(110, 60), false, "ctx.isPointInPath(110, 60)", "false"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.unclosed.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.unclosed.html new file mode 100644 index 0000000000..3920c7de4b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.unclosed.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.unclosed + + + + +

2d.path.isPointInPath.unclosed

+

isPointInPath() works on unclosed subpaths

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.unclosed.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.unclosed.worker.js new file mode 100644 index 0000000000..7b5ffc4a79 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.unclosed.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.unclosed +// Description:isPointInPath() works on unclosed subpaths +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() works on unclosed subpaths"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.winding.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.winding.html new file mode 100644 index 0000000000..b2741a5069 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.winding.html @@ -0,0 +1,47 @@ + + +OffscreenCanvas test: 2d.path.isPointInPath.winding + + + + +

2d.path.isPointInPath.winding

+

isPointInPath() uses the non-zero winding number rule

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.winding.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.winding.worker.js new file mode 100644 index 0000000000..094bc05910 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInPath.winding.worker.js @@ -0,0 +1,42 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInPath.winding +// Description:isPointInPath() uses the non-zero winding number rule +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInPath() uses the non-zero winding number rule"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.basic.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.basic.html new file mode 100644 index 0000000000..95f7fd721d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.basic.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.path.isPointInStroke.basic + + + + +

2d.path.isPointInStroke.basic

+

detects whether point is in the area contained by the stroke of the path

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.basic.worker.js new file mode 100644 index 0000000000..844f0ef154 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.basic.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInStroke.basic +// Description:detects whether point is in the area contained by the stroke of the path +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("detects whether point is in the area contained by the stroke of the path"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + +var canvas = new OffscreenCanvas(100, 50); +var ctx = canvas.getContext('2d'); + +ctx.strokeStyle = '#0f0'; +ctx.beginPath(); +ctx.rect(0, 0, 20, 20); +_assertSame(ctx.isPointInStroke(0, 0), true, "ctx.isPointInStroke(0, 0)", "true"); +_assertSame(ctx.isPointInStroke(30, 10), false, "ctx.isPointInStroke(30, 10)", "false"); + +var path = new Path2D(); +path.rect(20, 20, 100, 100); +_assertSame(ctx.isPointInStroke(path, 20, 20), true, "ctx.isPointInStroke(path, 20, 20)", "true"); +_assertSame(ctx.isPointInStroke(path, 120, 20), true, "ctx.isPointInStroke(path, 120, 20)", "true"); +t.done(); + +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.scaleddashes.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.scaleddashes.html new file mode 100644 index 0000000000..1ed13b32de --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.scaleddashes.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.path.isPointInStroke.scaleddashes + + + + +

2d.path.isPointInStroke.scaleddashes

+

isPointInStroke() should return correct results on dashed paths at high scale factors

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.scaleddashes.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.scaleddashes.worker.js new file mode 100644 index 0000000000..240905308e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInStroke.scaleddashes.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInStroke.scaleddashes +// Description:isPointInStroke() should return correct results on dashed paths at high scale factors +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("isPointInStroke() should return correct results on dashed paths at high scale factors"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var scale = 20; + ctx.setLineDash([10, 21.4159]); // dash from t=0 to t=10 along the circle + ctx.scale(scale, scale); + ctx.ellipse(6, 10, 5, 5, 0, 2*Math.PI, false); + ctx.stroke(); + + // hit-test the beginning of the dash (t=0) + _assertSame(ctx.isPointInStroke(11*scale, 10*scale), true, "ctx.isPointInStroke(11*scale, 10*scale)", "true"); + // hit-test the middle of the dash (t=5) + _assertSame(ctx.isPointInStroke(8.70*scale, 14.21*scale), true, "ctx.isPointInStroke(8.70*scale, 14.21*scale)", "true"); + // hit-test the end of the dash (t=9.8) + _assertSame(ctx.isPointInStroke(4.10*scale, 14.63*scale), true, "ctx.isPointInStroke(4.10*scale, 14.63*scale)", "true"); + // hit-test past the end of the dash (t=10.2) + _assertSame(ctx.isPointInStroke(3.74*scale, 14.46*scale), false, "ctx.isPointInStroke(3.74*scale, 14.46*scale)", "false"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.invalid.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.invalid.html new file mode 100644 index 0000000000..0b4c635fc8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.invalid.html @@ -0,0 +1,51 @@ + + +OffscreenCanvas test: 2d.path.isPointInpath.invalid + + + + +

2d.path.isPointInpath.invalid

+

Verify isPointInPath throws exceptions with invalid inputs.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.invalid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.invalid.worker.js new file mode 100644 index 0000000000..f09eeb7526 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.invalid.worker.js @@ -0,0 +1,46 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInpath.invalid +// Description:Verify isPointInPath throws exceptions with invalid inputs. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify isPointInPath throws exceptions with invalid inputs."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 200; + canvas.height = 200; + path = new Path2D(); + path.rect(0, 0, 100, 100); + path.rect(25, 25, 50, 50); + // Testing invalid enumeration isPointInPath (w/ and w/o Path object'); + assert_throws_js(TypeError, function() { ctx.isPointInPath(path, 50, 50, 'gazonk'); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath(50, 50, 'gazonk'); }); + + // Testing invalid type isPointInPath with Path object'); + assert_throws_js(TypeError, function() { ctx.isPointInPath(null, 50, 50); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath(null, 50, 50, 'nonzero'); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath(null, 50, 50, 'evenodd'); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath(null, 50, 50, null); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath(path, 50, 50, null); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath(undefined, 50, 50); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath(undefined, 50, 50, 'nonzero'); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath(undefined, 50, 50, 'evenodd'); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath(undefined, 50, 50, undefined); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath([], 50, 50); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath([], 50, 50, 'nonzero'); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath([], 50, 50, 'evenodd'); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath({}, 50, 50); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath({}, 50, 50, 'nonzero'); }); + assert_throws_js(TypeError, function() { ctx.isPointInPath({}, 50, 50, 'evenodd'); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.multi.path.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.multi.path.html new file mode 100644 index 0000000000..945855231b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.multi.path.html @@ -0,0 +1,49 @@ + + +OffscreenCanvas test: 2d.path.isPointInpath.multi.path + + + + +

2d.path.isPointInpath.multi.path

+

Verify the winding rule in isPointInPath works for path object.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.multi.path.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.multi.path.worker.js new file mode 100644 index 0000000000..d3d4e60747 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.isPointInpath.multi.path.worker.js @@ -0,0 +1,44 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.isPointInpath.multi.path +// Description:Verify the winding rule in isPointInPath works for path object. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify the winding rule in isPointInPath works for path object."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + canvas.width = 200; + canvas.height = 200; + + // Testing default isPointInPath with Path object'); + path = new Path2D(); + path.rect(0, 0, 100, 100); + path.rect(25, 25, 50, 50); + _assertSame(ctx.isPointInPath(path, 50, 50), true, "ctx.isPointInPath(path, 50, 50)", "true"); + _assertSame(ctx.isPointInPath(path, 50, 50, undefined), true, "ctx.isPointInPath(path, 50, 50, undefined)", "true"); + _assertSame(ctx.isPointInPath(path, NaN, 50), false, "ctx.isPointInPath(path, NaN, 50)", "false"); + _assertSame(ctx.isPointInPath(path, 50, NaN), false, "ctx.isPointInPath(path, 50, NaN)", "false"); + + // Testing nonzero isPointInPath with Path object'); + path = new Path2D(); + path.rect(0, 0, 100, 100); + path.rect(25, 25, 50, 50); + _assertSame(ctx.isPointInPath(path, 50, 50, 'nonzero'), true, "ctx.isPointInPath(path, 50, 50, 'nonzero')", "true"); + + // Testing evenodd isPointInPath with Path object'); + path = new Path2D(); + path.rect(0, 0, 100, 100); + path.rect(25, 25, 50, 50); + assert_false(ctx.isPointInPath(path, 50, 50, 'evenodd')); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.basic.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.basic.html new file mode 100644 index 0000000000..e0bc64617f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.basic.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.lineTo.basic + + + + +

2d.path.lineTo.basic

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.basic.worker.js new file mode 100644 index 0000000000..6e02a1f149 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.basic.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.lineTo.basic +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.1.html new file mode 100644 index 0000000000..2561a2f555 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.1.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.lineTo.ensuresubpath.1 + + + + +

2d.path.lineTo.ensuresubpath.1

+

If there is no subpath, the point is added and nothing is drawn

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.1.worker.js new file mode 100644 index 0000000000..ae4d85735e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.1.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.lineTo.ensuresubpath.1 +// Description:If there is no subpath, the point is added and nothing is drawn +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("If there is no subpath, the point is added and nothing is drawn"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.2.html new file mode 100644 index 0000000000..9ca14a1393 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.2.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.lineTo.ensuresubpath.2 + + + + +

2d.path.lineTo.ensuresubpath.2

+

If there is no subpath, the point is added and used for subsequent drawing

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.2.worker.js new file mode 100644 index 0000000000..b6af21235f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.ensuresubpath.2.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.lineTo.ensuresubpath.2 +// Description:If there is no subpath, the point is added and used for subsequent drawing +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("If there is no subpath, the point is added and used for subsequent drawing"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nextpoint.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nextpoint.html new file mode 100644 index 0000000000..a649d3a86d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nextpoint.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.path.lineTo.nextpoint + + + + +

2d.path.lineTo.nextpoint

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nextpoint.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nextpoint.worker.js new file mode 100644 index 0000000000..9e4e24a06d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nextpoint.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.lineTo.nextpoint +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.details.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.details.html new file mode 100644 index 0000000000..35bc80d336 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.details.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.path.lineTo.nonfinite.details + + + + +

2d.path.lineTo.nonfinite.details

+

lineTo() with Infinity/NaN for first arg still converts the second arg

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.details.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.details.worker.js new file mode 100644 index 0000000000..5052c74b94 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.details.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.lineTo.nonfinite.details +// Description:lineTo() with Infinity/NaN for first arg still converts the second arg +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("lineTo() with Infinity/NaN for first arg still converts the second arg"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + for (var arg1 of [Infinity, -Infinity, NaN]) { + var converted = false; + ctx.lineTo(arg1, { valueOf: function() { converted = true; return 0; } }); + _assert(converted, "converted"); + } + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.html new file mode 100644 index 0000000000..5a144dd7f6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.path.lineTo.nonfinite + + + + +

2d.path.lineTo.nonfinite

+

lineTo() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.worker.js new file mode 100644 index 0000000000..82921b7cd9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.lineTo.nonfinite.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.lineTo.nonfinite +// Description:lineTo() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("lineTo() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 90,45, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.basic.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.basic.html new file mode 100644 index 0000000000..f9777c6ca8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.basic.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.path.moveTo.basic + + + + +

2d.path.moveTo.basic

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.basic.worker.js new file mode 100644 index 0000000000..0b1df374b6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.basic.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.moveTo.basic +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.multiple.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.multiple.html new file mode 100644 index 0000000000..0b56cbbfef --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.multiple.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.path.moveTo.multiple + + + + +

2d.path.moveTo.multiple

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.multiple.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.multiple.worker.js new file mode 100644 index 0000000000..9f49ea8a1b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.multiple.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.moveTo.multiple +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.newsubpath.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.newsubpath.html new file mode 100644 index 0000000000..c2594c006e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.newsubpath.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.path.moveTo.newsubpath + + + + +

2d.path.moveTo.newsubpath

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.newsubpath.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.newsubpath.worker.js new file mode 100644 index 0000000000..e3c9c8529d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.newsubpath.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.moveTo.newsubpath +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.nonfinite.html new file mode 100644 index 0000000000..ea3eb34c76 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.nonfinite.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.path.moveTo.nonfinite + + + + +

2d.path.moveTo.nonfinite

+

moveTo() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.nonfinite.worker.js new file mode 100644 index 0000000000..97e2bd72e3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.moveTo.nonfinite.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.moveTo.nonfinite +// Description:moveTo() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("moveTo() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.basic.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.basic.html new file mode 100644 index 0000000000..4d14ce5585 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.basic.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.quadraticCurveTo.basic + + + + +

2d.path.quadraticCurveTo.basic

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.basic.worker.js new file mode 100644 index 0000000000..161e5f1a65 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.basic.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.quadraticCurveTo.basic +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.1.html new file mode 100644 index 0000000000..3e916f00c7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.1.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.quadraticCurveTo.ensuresubpath.1 + + + + +

2d.path.quadraticCurveTo.ensuresubpath.1

+

If there is no subpath, the first control point is added (and nothing is drawn up to it)

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.1.worker.js new file mode 100644 index 0000000000..95dcf2bed1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.1.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.quadraticCurveTo.ensuresubpath.1 +// Description:If there is no subpath, the first control point is added (and nothing is drawn up to it) +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("If there is no subpath, the first control point is added (and nothing is drawn up to it)"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 95,45, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.2.html new file mode 100644 index 0000000000..2fb05a2658 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.2.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.quadraticCurveTo.ensuresubpath.2 + + + + +

2d.path.quadraticCurveTo.ensuresubpath.2

+

If there is no subpath, the first control point is added

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.2.worker.js new file mode 100644 index 0000000000..4beaf9dae2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.ensuresubpath.2.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.quadraticCurveTo.ensuresubpath.2 +// Description:If there is no subpath, the first control point is added +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("If there is no subpath, the first control point is added"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 5,45, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.nonfinite.html new file mode 100644 index 0000000000..ee4f333a08 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.nonfinite.html @@ -0,0 +1,57 @@ + + +OffscreenCanvas test: 2d.path.quadraticCurveTo.nonfinite + + + + +

2d.path.quadraticCurveTo.nonfinite

+

quadraticCurveTo() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.nonfinite.worker.js new file mode 100644 index 0000000000..a61eb9a8ca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.nonfinite.worker.js @@ -0,0 +1,52 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.quadraticCurveTo.nonfinite +// Description:quadraticCurveTo() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("quadraticCurveTo() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 90,45, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.scaled.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.scaled.html new file mode 100644 index 0000000000..92c9377d6f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.scaled.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.path.quadraticCurveTo.scaled + + + + +

2d.path.quadraticCurveTo.scaled

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.scaled.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.scaled.worker.js new file mode 100644 index 0000000000..04fd6e904d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.scaled.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.quadraticCurveTo.scaled +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.shape.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.shape.html new file mode 100644 index 0000000000..ea42d669cb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.shape.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.path.quadraticCurveTo.shape + + + + +

2d.path.quadraticCurveTo.shape

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.shape.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.shape.worker.js new file mode 100644 index 0000000000..9f2afea09d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.quadraticCurveTo.shape.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.quadraticCurveTo.shape +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.basic.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.basic.html new file mode 100644 index 0000000000..e8d874709d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.basic.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.path.rect.basic + + + + +

2d.path.rect.basic

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.basic.worker.js new file mode 100644 index 0000000000..c8eb3838f9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.basic.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.rect.basic +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.closed.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.closed.html new file mode 100644 index 0000000000..6f61874390 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.closed.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.rect.closed + + + + +

2d.path.rect.closed

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.closed.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.closed.worker.js new file mode 100644 index 0000000000..f40868730b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.closed.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.rect.closed +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.1.html new file mode 100644 index 0000000000..e4d5ece132 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.1.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.rect.end.1 + + + + +

2d.path.rect.end.1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.1.worker.js new file mode 100644 index 0000000000..fcf9d0526f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.1.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.rect.end.1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.2.html new file mode 100644 index 0000000000..d6bad78abb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.2.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.path.rect.end.2 + + + + +

2d.path.rect.end.2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.2.worker.js new file mode 100644 index 0000000000..84c1b71d71 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.end.2.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.rect.end.2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.negative.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.negative.html new file mode 100644 index 0000000000..730e2e887a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.negative.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.path.rect.negative + + + + +

2d.path.rect.negative

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.negative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.negative.worker.js new file mode 100644 index 0000000000..44449e85e2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.negative.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.rect.negative +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,12, 0,255,0,255); + _assertPixel(canvas, 25,37, 0,255,0,255); + _assertPixel(canvas, 75,37, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.newsubpath.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.newsubpath.html new file mode 100644 index 0000000000..05b972e045 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.newsubpath.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.path.rect.newsubpath + + + + +

2d.path.rect.newsubpath

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.newsubpath.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.newsubpath.worker.js new file mode 100644 index 0000000000..bdf4a926c1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.newsubpath.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.rect.newsubpath +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.nonfinite.html new file mode 100644 index 0000000000..16d76aaf18 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.nonfinite.html @@ -0,0 +1,57 @@ + + +OffscreenCanvas test: 2d.path.rect.nonfinite + + + + +

2d.path.rect.nonfinite

+

rect() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.nonfinite.worker.js new file mode 100644 index 0000000000..307a5ec08f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.nonfinite.worker.js @@ -0,0 +1,52 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.rect.nonfinite +// Description:rect() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("rect() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 90,45, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.selfintersect.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.selfintersect.html new file mode 100644 index 0000000000..af97fa6d38 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.selfintersect.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.rect.selfintersect + + + + +

2d.path.rect.selfintersect

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.selfintersect.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.selfintersect.worker.js new file mode 100644 index 0000000000..495d016e80 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.selfintersect.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.rect.selfintersect +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.winding.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.winding.html new file mode 100644 index 0000000000..a7f79c5223 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.winding.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.path.rect.winding + + + + +

2d.path.rect.winding

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.winding.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.winding.worker.js new file mode 100644 index 0000000000..45ff0427e1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.winding.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.rect.winding +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,12, 0,255,0,255); + _assertPixel(canvas, 25,37, 0,255,0,255); + _assertPixel(canvas, 75,37, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.1.html new file mode 100644 index 0000000000..45dac2079d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.1.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.rect.zero.1 + + + + +

2d.path.rect.zero.1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.1.worker.js new file mode 100644 index 0000000000..de6fb58c8a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.1.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.rect.zero.1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.2.html new file mode 100644 index 0000000000..0386ea06e7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.2.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.rect.zero.2 + + + + +

2d.path.rect.zero.2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.2.worker.js new file mode 100644 index 0000000000..8e323d2dd0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.2.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.rect.zero.2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.3.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.3.html new file mode 100644 index 0000000000..1299040929 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.3.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.rect.zero.3 + + + + +

2d.path.rect.zero.3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.3.worker.js new file mode 100644 index 0000000000..5e6f490c73 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.3.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.rect.zero.3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.4.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.4.html new file mode 100644 index 0000000000..93da1300de --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.4.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.rect.zero.4 + + + + +

2d.path.rect.zero.4

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.4.worker.js new file mode 100644 index 0000000000..e19da3b917 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.4.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.rect.zero.4 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.5.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.5.html new file mode 100644 index 0000000000..45a7f03813 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.5.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.rect.zero.5 + + + + +

2d.path.rect.zero.5

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.5.worker.js new file mode 100644 index 0000000000..d39a741573 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.5.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.rect.zero.5 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.6.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.6.html new file mode 100644 index 0000000000..ac74e20660 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.6.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.path.rect.zero.6 + + + + +

2d.path.rect.zero.6

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.6.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.6.worker.js new file mode 100644 index 0000000000..a567359c30 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.rect.zero.6.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.rect.zero.6 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.html new file mode 100644 index 0000000000..f7e80a0119 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.html @@ -0,0 +1,55 @@ + + +OffscreenCanvas test: 2d.path.roundrect.1.radius.dompoint + + + + +

2d.path.roundrect.1.radius.dompoint

+

Verify that when one radius is given to roundRect(), specified as a DOMPoint, it applies to all corners.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.single argument.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.single argument.html new file mode 100644 index 0000000000..4ea78c32d1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.single argument.html @@ -0,0 +1,55 @@ + + +OffscreenCanvas test: 2d.path.roundrect.1.radius.dompoint.single argument + + + + +

2d.path.roundrect.1.radius.dompoint.single argument

+

Verify that when one radius is given to roundRect() as a non-array argument, specified as a DOMPoint, it applies to all corners.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.single argument.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.single argument.worker.js new file mode 100644 index 0000000000..b93d88e89c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.single argument.worker.js @@ -0,0 +1,50 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.1.radius.dompoint.single argument +// Description:Verify that when one radius is given to roundRect() as a non-array argument, specified as a DOMPoint, it applies to all corners. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when one radius is given to roundRect() as a non-array argument, specified as a DOMPoint, it applies to all corners."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, new DOMPoint(40, 20)); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-left corner + _assertPixel(canvas, 20,1, 255,0,0,255); + _assertPixel(canvas, 41,1, 0,255,0,255); + _assertPixel(canvas, 1,10, 255,0,0,255); + _assertPixel(canvas, 1,21, 0,255,0,255); + + // top-right corner + _assertPixel(canvas, 79,1, 255,0,0,255); + _assertPixel(canvas, 58,1, 0,255,0,255); + _assertPixel(canvas, 98,10, 255,0,0,255); + _assertPixel(canvas, 98,21, 0,255,0,255); + + // bottom-right corner + _assertPixel(canvas, 79,48, 255,0,0,255); + _assertPixel(canvas, 58,48, 0,255,0,255); + _assertPixel(canvas, 98,39, 255,0,0,255); + _assertPixel(canvas, 98,28, 0,255,0,255); + + // bottom-left corner + _assertPixel(canvas, 20,48, 255,0,0,255); + _assertPixel(canvas, 41,48, 0,255,0,255); + _assertPixel(canvas, 1,39, 255,0,0,255); + _assertPixel(canvas, 1,28, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.worker.js new file mode 100644 index 0000000000..06d787437e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompoint.worker.js @@ -0,0 +1,50 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.1.radius.dompoint +// Description:Verify that when one radius is given to roundRect(), specified as a DOMPoint, it applies to all corners. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when one radius is given to roundRect(), specified as a DOMPoint, it applies to all corners."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [new DOMPoint(40, 20)]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-left corner + _assertPixel(canvas, 20,1, 255,0,0,255); + _assertPixel(canvas, 41,1, 0,255,0,255); + _assertPixel(canvas, 1,10, 255,0,0,255); + _assertPixel(canvas, 1,21, 0,255,0,255); + + // top-right corner + _assertPixel(canvas, 79,1, 255,0,0,255); + _assertPixel(canvas, 58,1, 0,255,0,255); + _assertPixel(canvas, 98,10, 255,0,0,255); + _assertPixel(canvas, 98,21, 0,255,0,255); + + // bottom-right corner + _assertPixel(canvas, 79,48, 255,0,0,255); + _assertPixel(canvas, 58,48, 0,255,0,255); + _assertPixel(canvas, 98,39, 255,0,0,255); + _assertPixel(canvas, 98,28, 0,255,0,255); + + // bottom-left corner + _assertPixel(canvas, 20,48, 255,0,0,255); + _assertPixel(canvas, 41,48, 0,255,0,255); + _assertPixel(canvas, 1,39, 255,0,0,255); + _assertPixel(canvas, 1,28, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.html new file mode 100644 index 0000000000..97084a446f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.html @@ -0,0 +1,55 @@ + + +OffscreenCanvas test: 2d.path.roundrect.1.radius.dompointinit + + + + +

2d.path.roundrect.1.radius.dompointinit

+

Verify that when one radius is given to roundRect(), specified as a DOMPointInit, applies to all corners.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.single.argument.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.single.argument.html new file mode 100644 index 0000000000..10c5c14cff --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.single.argument.html @@ -0,0 +1,55 @@ + + +OffscreenCanvas test: 2d.path.roundrect.1.radius.dompointinit.single.argument + + + + +

2d.path.roundrect.1.radius.dompointinit.single.argument

+

Verify that when one radius is given to roundRect() as a non-array argument, specified as a DOMPointInit, applies to all corners.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.single.argument.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.single.argument.worker.js new file mode 100644 index 0000000000..a62370677b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.single.argument.worker.js @@ -0,0 +1,50 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.1.radius.dompointinit.single.argument +// Description:Verify that when one radius is given to roundRect() as a non-array argument, specified as a DOMPointInit, applies to all corners. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when one radius is given to roundRect() as a non-array argument, specified as a DOMPointInit, applies to all corners."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, {x: 40, y: 20}); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-left corner + _assertPixel(canvas, 20,1, 255,0,0,255); + _assertPixel(canvas, 41,1, 0,255,0,255); + _assertPixel(canvas, 1,10, 255,0,0,255); + _assertPixel(canvas, 1,21, 0,255,0,255); + + // top-right corner + _assertPixel(canvas, 79,1, 255,0,0,255); + _assertPixel(canvas, 58,1, 0,255,0,255); + _assertPixel(canvas, 98,10, 255,0,0,255); + _assertPixel(canvas, 98,21, 0,255,0,255); + + // bottom-right corner + _assertPixel(canvas, 79,48, 255,0,0,255); + _assertPixel(canvas, 58,48, 0,255,0,255); + _assertPixel(canvas, 98,39, 255,0,0,255); + _assertPixel(canvas, 98,28, 0,255,0,255); + + // bottom-left corner + _assertPixel(canvas, 20,48, 255,0,0,255); + _assertPixel(canvas, 41,48, 0,255,0,255); + _assertPixel(canvas, 1,39, 255,0,0,255); + _assertPixel(canvas, 1,28, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.worker.js new file mode 100644 index 0000000000..56c8e1fcef --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.dompointinit.worker.js @@ -0,0 +1,50 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.1.radius.dompointinit +// Description:Verify that when one radius is given to roundRect(), specified as a DOMPointInit, applies to all corners. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when one radius is given to roundRect(), specified as a DOMPointInit, applies to all corners."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-left corner + _assertPixel(canvas, 20,1, 255,0,0,255); + _assertPixel(canvas, 41,1, 0,255,0,255); + _assertPixel(canvas, 1,10, 255,0,0,255); + _assertPixel(canvas, 1,21, 0,255,0,255); + + // top-right corner + _assertPixel(canvas, 79,1, 255,0,0,255); + _assertPixel(canvas, 58,1, 0,255,0,255); + _assertPixel(canvas, 98,10, 255,0,0,255); + _assertPixel(canvas, 98,21, 0,255,0,255); + + // bottom-right corner + _assertPixel(canvas, 79,48, 255,0,0,255); + _assertPixel(canvas, 58,48, 0,255,0,255); + _assertPixel(canvas, 98,39, 255,0,0,255); + _assertPixel(canvas, 98,28, 0,255,0,255); + + // bottom-left corner + _assertPixel(canvas, 20,48, 255,0,0,255); + _assertPixel(canvas, 41,48, 0,255,0,255); + _assertPixel(canvas, 1,39, 255,0,0,255); + _assertPixel(canvas, 1,28, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.html new file mode 100644 index 0000000000..33574eeaa0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.roundrect.1.radius.double + + + + +

2d.path.roundrect.1.radius.double

+

Verify that when one radius is given to roundRect(), specified as a double, it applies to all corners.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.single.argument.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.single.argument.html new file mode 100644 index 0000000000..b2c826ff38 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.single.argument.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.roundrect.1.radius.double.single.argument + + + + +

2d.path.roundrect.1.radius.double.single.argument

+

Verify that when one radius is given to roundRect() as a non-array argument, specified as a double, it applies to all corners.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.single.argument.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.single.argument.worker.js new file mode 100644 index 0000000000..04350e81aa --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.single.argument.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.1.radius.double.single.argument +// Description:Verify that when one radius is given to roundRect() as a non-array argument, specified as a double, it applies to all corners. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when one radius is given to roundRect() as a non-array argument, specified as a double, it applies to all corners."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, 20); + ctx.fillStyle = '#0f0'; + ctx.fill(); + _assertPixel(canvas, 1,1, 255,0,0,255); + _assertPixel(canvas, 98,1, 255,0,0,255); + _assertPixel(canvas, 98,48, 255,0,0,255); + _assertPixel(canvas, 1,48, 255,0,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.worker.js new file mode 100644 index 0000000000..ef9da08d61 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.1.radius.double.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.1.radius.double +// Description:Verify that when one radius is given to roundRect(), specified as a double, it applies to all corners. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when one radius is given to roundRect(), specified as a double, it applies to all corners."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [20]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + _assertPixel(canvas, 1,1, 255,0,0,255); + _assertPixel(canvas, 98,1, 255,0,0,255); + _assertPixel(canvas, 98,48, 255,0,0,255); + _assertPixel(canvas, 1,48, 255,0,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompoint.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompoint.html new file mode 100644 index 0000000000..7f67c42ed4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompoint.html @@ -0,0 +1,47 @@ + + +OffscreenCanvas test: 2d.path.roundrect.2.radii.1.dompoint + + + + +

2d.path.roundrect.2.radii.1.dompoint

+

Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left and bottom-right corners.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompoint.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompoint.worker.js new file mode 100644 index 0000000000..5d0387d0d1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompoint.worker.js @@ -0,0 +1,42 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.2.radii.1.dompoint +// Description:Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left and bottom-right corners. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left and bottom-right corners."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [new DOMPoint(40, 20), 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-left corner + _assertPixel(canvas, 20,1, 255,0,0,255); + _assertPixel(canvas, 41,1, 0,255,0,255); + _assertPixel(canvas, 1,10, 255,0,0,255); + _assertPixel(canvas, 1,21, 0,255,0,255); + + // bottom-right corner + _assertPixel(canvas, 79,48, 255,0,0,255); + _assertPixel(canvas, 58,48, 0,255,0,255); + _assertPixel(canvas, 98,39, 255,0,0,255); + _assertPixel(canvas, 98,28, 0,255,0,255); + + // other corners + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html new file mode 100644 index 0000000000..2ac0347d96 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.html @@ -0,0 +1,47 @@ + + +OffscreenCanvas test: 2d.path.roundrect.2.radii.1.dompointinit + + + + +

2d.path.roundrect.2.radii.1.dompointinit

+

Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left and bottom-right corners.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.worker.js new file mode 100644 index 0000000000..240a36e846 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.dompointinit.worker.js @@ -0,0 +1,42 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.2.radii.1.dompointinit +// Description:Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left and bottom-right corners. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when two radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left and bottom-right corners."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-left corner + _assertPixel(canvas, 20,1, 255,0,0,255); + _assertPixel(canvas, 41,1, 0,255,0,255); + _assertPixel(canvas, 1,10, 255,0,0,255); + _assertPixel(canvas, 1,21, 0,255,0,255); + + // bottom-right corner + _assertPixel(canvas, 79,48, 255,0,0,255); + _assertPixel(canvas, 58,48, 0,255,0,255); + _assertPixel(canvas, 98,39, 255,0,0,255); + _assertPixel(canvas, 98,28, 0,255,0,255); + + // other corners + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.double.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.double.html new file mode 100644 index 0000000000..791e59ee7e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.double.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.roundrect.2.radii.1.double + + + + +

2d.path.roundrect.2.radii.1.double

+

Verify that when two radii are given to roundRect(), the first radius, specified as a double, applies to the top-left and bottom-right corners.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.double.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.double.worker.js new file mode 100644 index 0000000000..0fc351c3d6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.1.double.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.2.radii.1.double +// Description:Verify that when two radii are given to roundRect(), the first radius, specified as a double, applies to the top-left and bottom-right corners. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when two radii are given to roundRect(), the first radius, specified as a double, applies to the top-left and bottom-right corners."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [20, 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + _assertPixel(canvas, 1,1, 255,0,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 255,0,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompoint.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompoint.html new file mode 100644 index 0000000000..d0b085e170 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompoint.html @@ -0,0 +1,47 @@ + + +OffscreenCanvas test: 2d.path.roundrect.2.radii.2.dompoint + + + + +

2d.path.roundrect.2.radii.2.dompoint

+

Verify that when two radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottom-left corners.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompoint.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompoint.worker.js new file mode 100644 index 0000000000..4c6bb06bdb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompoint.worker.js @@ -0,0 +1,42 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.2.radii.2.dompoint +// Description:Verify that when two radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottom-left corners. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when two radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottom-left corners."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, new DOMPoint(40, 20)]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-right corner + _assertPixel(canvas, 79,1, 255,0,0,255); + _assertPixel(canvas, 58,1, 0,255,0,255); + _assertPixel(canvas, 98,10, 255,0,0,255); + _assertPixel(canvas, 98,21, 0,255,0,255); + + // bottom-left corner + _assertPixel(canvas, 20,48, 255,0,0,255); + _assertPixel(canvas, 41,48, 0,255,0,255); + _assertPixel(canvas, 1,39, 255,0,0,255); + _assertPixel(canvas, 1,28, 0,255,0,255); + + // other corners + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html new file mode 100644 index 0000000000..380dd26997 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.html @@ -0,0 +1,47 @@ + + +OffscreenCanvas test: 2d.path.roundrect.2.radii.2.dompointinit + + + + +

2d.path.roundrect.2.radii.2.dompointinit

+

Verify that when two radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right and bottom-left corners.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.worker.js new file mode 100644 index 0000000000..e8cdd2c015 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.dompointinit.worker.js @@ -0,0 +1,42 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.2.radii.2.dompointinit +// Description:Verify that when two radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right and bottom-left corners. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when two radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right and bottom-left corners."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-right corner + _assertPixel(canvas, 79,1, 255,0,0,255); + _assertPixel(canvas, 58,1, 0,255,0,255); + _assertPixel(canvas, 98,10, 255,0,0,255); + _assertPixel(canvas, 98,21, 0,255,0,255); + + // bottom-left corner + _assertPixel(canvas, 20,48, 255,0,0,255); + _assertPixel(canvas, 41,48, 0,255,0,255); + _assertPixel(canvas, 1,39, 255,0,0,255); + _assertPixel(canvas, 1,28, 0,255,0,255); + + // other corners + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.double.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.double.html new file mode 100644 index 0000000000..b7b25727b9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.double.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.roundrect.2.radii.2.double + + + + +

2d.path.roundrect.2.radii.2.double

+

Verify that when two radii are given to roundRect(), the second radius, specified as a double, applies to the top-right and bottom-left corners.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.double.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.double.worker.js new file mode 100644 index 0000000000..756328682d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.2.radii.2.double.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.2.radii.2.double +// Description:Verify that when two radii are given to roundRect(), the second radius, specified as a double, applies to the top-right and bottom-left corners. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when two radii are given to roundRect(), the second radius, specified as a double, applies to the top-right and bottom-left corners."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, 20]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 255,0,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 255,0,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompoint.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompoint.html new file mode 100644 index 0000000000..b7f3e53261 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompoint.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.3.radii.1.dompoint + + + + +

2d.path.roundrect.3.radii.1.dompoint

+

Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompoint.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompoint.worker.js new file mode 100644 index 0000000000..9ac4d731c3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompoint.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.3.radii.1.dompoint +// Description:Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [new DOMPoint(40, 20), 0, 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-left corner + _assertPixel(canvas, 20,1, 255,0,0,255); + _assertPixel(canvas, 41,1, 0,255,0,255); + _assertPixel(canvas, 1,10, 255,0,0,255); + _assertPixel(canvas, 1,21, 0,255,0,255); + + // other corners + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html new file mode 100644 index 0000000000..93f89159b1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.3.radii.1.dompointinit + + + + +

2d.path.roundrect.3.radii.1.dompointinit

+

Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.worker.js new file mode 100644 index 0000000000..9d00729ce9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.dompointinit.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.3.radii.1.dompointinit +// Description:Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when three radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0, 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-left corner + _assertPixel(canvas, 20,1, 255,0,0,255); + _assertPixel(canvas, 41,1, 0,255,0,255); + _assertPixel(canvas, 1,10, 255,0,0,255); + _assertPixel(canvas, 1,21, 0,255,0,255); + + // other corners + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.double.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.double.html new file mode 100644 index 0000000000..976458bc5f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.double.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.roundrect.3.radii.1.double + + + + +

2d.path.roundrect.3.radii.1.double

+

Verify that when three radii are given to roundRect(), the first radius, specified as a double, applies to the top-left corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.double.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.double.worker.js new file mode 100644 index 0000000000..c4e1c4fc03 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.1.double.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.3.radii.1.double +// Description:Verify that when three radii are given to roundRect(), the first radius, specified as a double, applies to the top-left corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when three radii are given to roundRect(), the first radius, specified as a double, applies to the top-left corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [20, 0, 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + _assertPixel(canvas, 1,1, 255,0,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompoint.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompoint.html new file mode 100644 index 0000000000..1a89c28d15 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompoint.html @@ -0,0 +1,47 @@ + + +OffscreenCanvas test: 2d.path.roundrect.3.radii.2.dompoint + + + + +

2d.path.roundrect.3.radii.2.dompoint

+

Verify that when three radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottom-left corners.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompoint.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompoint.worker.js new file mode 100644 index 0000000000..4e4df3a601 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompoint.worker.js @@ -0,0 +1,42 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.3.radii.2.dompoint +// Description:Verify that when three radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottom-left corners. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when three radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottom-left corners."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, new DOMPoint(40, 20), 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-right corner + _assertPixel(canvas, 79,1, 255,0,0,255); + _assertPixel(canvas, 58,1, 0,255,0,255); + _assertPixel(canvas, 98,10, 255,0,0,255); + _assertPixel(canvas, 98,21, 0,255,0,255); + + // bottom-left corner + _assertPixel(canvas, 20,48, 255,0,0,255); + _assertPixel(canvas, 41,48, 0,255,0,255); + _assertPixel(canvas, 1,39, 255,0,0,255); + _assertPixel(canvas, 1,28, 0,255,0,255); + + // other corners + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html new file mode 100644 index 0000000000..82ceb6a7bc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.html @@ -0,0 +1,47 @@ + + +OffscreenCanvas test: 2d.path.roundrect.3.radii.2.dompointinit + + + + +

2d.path.roundrect.3.radii.2.dompointinit

+

Verify that when three radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottom-left corners.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.worker.js new file mode 100644 index 0000000000..1333e2386d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.dompointinit.worker.js @@ -0,0 +1,42 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.3.radii.2.dompointinit +// Description:Verify that when three radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottom-left corners. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when three radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right and bottom-left corners."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}, 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-right corner + _assertPixel(canvas, 79,1, 255,0,0,255); + _assertPixel(canvas, 58,1, 0,255,0,255); + _assertPixel(canvas, 98,10, 255,0,0,255); + _assertPixel(canvas, 98,21, 0,255,0,255); + + // bottom-left corner + _assertPixel(canvas, 20,48, 255,0,0,255); + _assertPixel(canvas, 41,48, 0,255,0,255); + _assertPixel(canvas, 1,39, 255,0,0,255); + _assertPixel(canvas, 1,28, 0,255,0,255); + + // other corners + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.double.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.double.html new file mode 100644 index 0000000000..b466956d58 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.double.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.roundrect.3.radii.2.double + + + + +

2d.path.roundrect.3.radii.2.double

+

Verify that when three radii are given to roundRect(), the second radius, specified as a double, applies to the top-right and bottom-left corners.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.double.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.double.worker.js new file mode 100644 index 0000000000..027dbae52a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.2.double.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.3.radii.2.double +// Description:Verify that when three radii are given to roundRect(), the second radius, specified as a double, applies to the top-right and bottom-left corners. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when three radii are given to roundRect(), the second radius, specified as a double, applies to the top-right and bottom-left corners."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, 20, 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 255,0,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 255,0,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompoint.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompoint.html new file mode 100644 index 0000000000..897aeb2685 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompoint.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.3.radii.3.dompoint + + + + +

2d.path.roundrect.3.radii.3.dompoint

+

Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPoint, applies to the bottom-right corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompoint.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompoint.worker.js new file mode 100644 index 0000000000..8a80623fc9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompoint.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.3.radii.3.dompoint +// Description:Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPoint, applies to the bottom-right corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPoint, applies to the bottom-right corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, 0, new DOMPoint(40, 20)]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // bottom-right corner + _assertPixel(canvas, 79,48, 255,0,0,255); + _assertPixel(canvas, 58,48, 0,255,0,255); + _assertPixel(canvas, 98,39, 255,0,0,255); + _assertPixel(canvas, 98,28, 0,255,0,255); + + // other corners + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html new file mode 100644 index 0000000000..e1e055cb64 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.3.radii.3.dompointinit + + + + +

2d.path.roundrect.3.radii.3.dompointinit

+

Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.worker.js new file mode 100644 index 0000000000..d3b188dd7f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.dompointinit.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.3.radii.3.dompointinit +// Description:Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when three radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, 0, {x: 40, y: 20}]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // bottom-right corner + _assertPixel(canvas, 79,48, 255,0,0,255); + _assertPixel(canvas, 58,48, 0,255,0,255); + _assertPixel(canvas, 98,39, 255,0,0,255); + _assertPixel(canvas, 98,28, 0,255,0,255); + + // other corners + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.double.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.double.html new file mode 100644 index 0000000000..a0e0553364 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.double.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.roundrect.3.radii.3.double + + + + +

2d.path.roundrect.3.radii.3.double

+

Verify that when three radii are given to roundRect(), the third radius, specified as a double, applies to the bottom-right corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.double.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.double.worker.js new file mode 100644 index 0000000000..177e7c5f6d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.3.radii.3.double.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.3.radii.3.double +// Description:Verify that when three radii are given to roundRect(), the third radius, specified as a double, applies to the bottom-right corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when three radii are given to roundRect(), the third radius, specified as a double, applies to the bottom-right corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, 0, 20]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 255,0,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompoint.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompoint.html new file mode 100644 index 0000000000..72e8d6ce33 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompoint.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.1.dompoint + + + + +

2d.path.roundrect.4.radii.1.dompoint

+

Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompoint.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompoint.worker.js new file mode 100644 index 0000000000..f27f696f1c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompoint.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.1.dompoint +// Description:Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPoint, applies to the top-left corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [new DOMPoint(40, 20), 0, 0, 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-left corner + _assertPixel(canvas, 20,1, 255,0,0,255); + _assertPixel(canvas, 41,1, 0,255,0,255); + _assertPixel(canvas, 1,10, 255,0,0,255); + _assertPixel(canvas, 1,21, 0,255,0,255); + + // other corners + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html new file mode 100644 index 0000000000..df6bb11e02 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.1.dompointinit + + + + +

2d.path.roundrect.4.radii.1.dompointinit

+

Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.worker.js new file mode 100644 index 0000000000..2f9d2eb30f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.dompointinit.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.1.dompointinit +// Description:Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when four radii are given to roundRect(), the first radius, specified as a DOMPointInit, applies to the top-left corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [{x: 40, y: 20}, 0, 0, 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-left corner + _assertPixel(canvas, 20,1, 255,0,0,255); + _assertPixel(canvas, 41,1, 0,255,0,255); + _assertPixel(canvas, 1,10, 255,0,0,255); + _assertPixel(canvas, 1,21, 0,255,0,255); + + // other corners + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.double.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.double.html new file mode 100644 index 0000000000..b669a7bb6a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.double.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.1.double + + + + +

2d.path.roundrect.4.radii.1.double

+

Verify that when four radii are given to roundRect(), the first radius, specified as a double, applies to the top-left corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.double.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.double.worker.js new file mode 100644 index 0000000000..9658a39cfb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.1.double.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.1.double +// Description:Verify that when four radii are given to roundRect(), the first radius, specified as a double, applies to the top-left corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when four radii are given to roundRect(), the first radius, specified as a double, applies to the top-left corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [20, 0, 0, 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + _assertPixel(canvas, 1,1, 255,0,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompoint.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompoint.html new file mode 100644 index 0000000000..b387d88990 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompoint.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.2.dompoint + + + + +

2d.path.roundrect.4.radii.2.dompoint

+

Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompoint.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompoint.worker.js new file mode 100644 index 0000000000..83d3f66b3c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompoint.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.2.dompoint +// Description:Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPoint, applies to the top-right corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, new DOMPoint(40, 20), 0, 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-right corner + _assertPixel(canvas, 79,1, 255,0,0,255); + _assertPixel(canvas, 58,1, 0,255,0,255); + _assertPixel(canvas, 98,10, 255,0,0,255); + _assertPixel(canvas, 98,21, 0,255,0,255); + + // other corners + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html new file mode 100644 index 0000000000..76719124e2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.2.dompointinit + + + + +

2d.path.roundrect.4.radii.2.dompointinit

+

Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.worker.js new file mode 100644 index 0000000000..21766040b4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.dompointinit.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.2.dompointinit +// Description:Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when four radii are given to roundRect(), the second radius, specified as a DOMPointInit, applies to the top-right corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, {x: 40, y: 20}, 0, 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // top-right corner + _assertPixel(canvas, 79,1, 255,0,0,255); + _assertPixel(canvas, 58,1, 0,255,0,255); + _assertPixel(canvas, 98,10, 255,0,0,255); + _assertPixel(canvas, 98,21, 0,255,0,255); + + // other corners + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.double.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.double.html new file mode 100644 index 0000000000..001cb8429c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.double.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.2.double + + + + +

2d.path.roundrect.4.radii.2.double

+

Verify that when four radii are given to roundRect(), the second radius, specified as a double, applies to the top-right corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.double.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.double.worker.js new file mode 100644 index 0000000000..b9935a1bd9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.2.double.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.2.double +// Description:Verify that when four radii are given to roundRect(), the second radius, specified as a double, applies to the top-right corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when four radii are given to roundRect(), the second radius, specified as a double, applies to the top-right corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, 20, 0, 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 255,0,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompoint.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompoint.html new file mode 100644 index 0000000000..5c8c686086 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompoint.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.3.dompoint + + + + +

2d.path.roundrect.4.radii.3.dompoint

+

Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPoint, applies to the bottom-right corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompoint.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompoint.worker.js new file mode 100644 index 0000000000..819b1a3986 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompoint.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.3.dompoint +// Description:Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPoint, applies to the bottom-right corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPoint, applies to the bottom-right corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, 0, new DOMPoint(40, 20), 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // bottom-right corner + _assertPixel(canvas, 79,48, 255,0,0,255); + _assertPixel(canvas, 58,48, 0,255,0,255); + _assertPixel(canvas, 98,39, 255,0,0,255); + _assertPixel(canvas, 98,28, 0,255,0,255); + + // other corners + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html new file mode 100644 index 0000000000..1b94b7d7ed --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.3.dompointinit + + + + +

2d.path.roundrect.4.radii.3.dompointinit

+

Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.worker.js new file mode 100644 index 0000000000..e4bd04aa29 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.dompointinit.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.3.dompointinit +// Description:Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when four radii are given to roundRect(), the third radius, specified as a DOMPointInit, applies to the bottom-right corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, 0, {x: 40, y: 20}, 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // bottom-right corner + _assertPixel(canvas, 79,48, 255,0,0,255); + _assertPixel(canvas, 58,48, 0,255,0,255); + _assertPixel(canvas, 98,39, 255,0,0,255); + _assertPixel(canvas, 98,28, 0,255,0,255); + + // other corners + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.double.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.double.html new file mode 100644 index 0000000000..2a76d2b7b1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.double.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.3.double + + + + +

2d.path.roundrect.4.radii.3.double

+

Verify that when four radii are given to roundRect(), the third radius, specified as a double, applies to the bottom-right corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.double.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.double.worker.js new file mode 100644 index 0000000000..ada627b469 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.3.double.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.3.double +// Description:Verify that when four radii are given to roundRect(), the third radius, specified as a double, applies to the bottom-right corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when four radii are given to roundRect(), the third radius, specified as a double, applies to the bottom-right corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, 0, 20, 0]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 255,0,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompoint.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompoint.html new file mode 100644 index 0000000000..ce86e45e8b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompoint.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.4.dompoint + + + + +

2d.path.roundrect.4.radii.4.dompoint

+

Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPoint, applies to the bottom-left corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompoint.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompoint.worker.js new file mode 100644 index 0000000000..770291c6f9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompoint.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.4.dompoint +// Description:Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPoint, applies to the bottom-left corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPoint, applies to the bottom-left corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, 0, 0, new DOMPoint(40, 20)]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // bottom-left corner + _assertPixel(canvas, 20,48, 255,0,0,255); + _assertPixel(canvas, 41,48, 0,255,0,255); + _assertPixel(canvas, 1,39, 255,0,0,255); + _assertPixel(canvas, 1,28, 0,255,0,255); + + // other corners + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html new file mode 100644 index 0000000000..f0ec6c3b99 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.4.dompointinit + + + + +

2d.path.roundrect.4.radii.4.dompointinit

+

Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPointInit, applies to the bottom-left corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.worker.js new file mode 100644 index 0000000000..48310c6a30 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.dompointinit.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.4.dompointinit +// Description:Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPointInit, applies to the bottom-left corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when four radii are given to roundRect(), the fourth radius, specified as a DOMPointInit, applies to the bottom-left corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, 0, 0, {x: 40, y: 20}]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + + // bottom-left corner + _assertPixel(canvas, 20,48, 255,0,0,255); + _assertPixel(canvas, 41,48, 0,255,0,255); + _assertPixel(canvas, 1,39, 255,0,0,255); + _assertPixel(canvas, 1,28, 0,255,0,255); + + // other corners + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.double.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.double.html new file mode 100644 index 0000000000..6940622cf0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.double.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.path.roundrect.4.radii.4.double + + + + +

2d.path.roundrect.4.radii.4.double

+

Verify that when four radii are given to roundRect(), the fourth radius, specified as a double, applies to the bottom-left corner.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.double.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.double.worker.js new file mode 100644 index 0000000000..e97ebd98ff --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.4.radii.4.double.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.4.radii.4.double +// Description:Verify that when four radii are given to roundRect(), the fourth radius, specified as a double, applies to the bottom-left corner. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify that when four radii are given to roundRect(), the fourth radius, specified as a double, applies to the bottom-left corner."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [0, 0, 0, 20]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + _assertPixel(canvas, 1,48, 255,0,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.badinput.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.badinput.html new file mode 100644 index 0000000000..97b322971c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.badinput.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.roundrect.badinput + + + + +

2d.path.roundrect.badinput

+

roundRect() throws or does not throw errors given the strange inputs.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.badinput.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.badinput.worker.js new file mode 100644 index 0000000000..461dee89ad --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.badinput.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.badinput +// Description:roundRect() throws or does not throw errors given the strange inputs. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("roundRect() throws or does not throw errors given the strange inputs."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.roundRect(0, 0, 100, 100, { foo: "bar" }); //=> DOMPointInit + ctx.roundRect(0, 0, 100, 100, undefined); //=> "missing" -> 0 + ctx.roundRect(0, 0, 100, 100, [[]]); //=> « DOMPointInit » + ctx.roundRect(0, 0, 100, 100, [[25]]); //=> « DOMPointInit » + ctx.roundRect(0, 0, 100, 100, [undefined]); //=> « DOMPointInit » + assert_throws_js(TypeError, function() { ctx.roundRect(0, 0, 100, 100, 0n); }); + assert_throws_js(TypeError, function() { ctx.roundRect(0, 0, 100, 100, { x: 0n }); }); + assert_throws_js(TypeError, function() { ctx.roundRect(0, 0, 100, 100, [{ x: 0n }]); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.closed.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.closed.html new file mode 100644 index 0000000000..7407ead9cf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.closed.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.roundrect.closed + + + + +

2d.path.roundrect.closed

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.closed.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.closed.worker.js new file mode 100644 index 0000000000..5a9530a683 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.closed.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.closed +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.strokeStyle = '#0f0'; + ctx.lineWidth = 200; + ctx.lineJoin = 'miter'; + ctx.roundRect(100, 50, 100, 100, [0]); + ctx.stroke(); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.1.html new file mode 100644 index 0000000000..d73b82bee4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.1.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.roundrect.end.1 + + + + +

2d.path.roundrect.end.1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.1.worker.js new file mode 100644 index 0000000000..9428df5bbd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.1.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.end.1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.strokeStyle = '#0f0'; + ctx.lineWidth = 100; + ctx.roundRect(200, 100, 400, 1000, [0]); + ctx.lineTo(-2000, -1000); + ctx.stroke(); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.2.html new file mode 100644 index 0000000000..ce9b44ead1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.2.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.path.roundrect.end.2 + + + + +

2d.path.roundrect.end.2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.2.worker.js new file mode 100644 index 0000000000..28f1ca1787 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.2.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.end.2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.strokeStyle = '#0f0'; + ctx.lineWidth = 450; + ctx.lineCap = 'round'; + ctx.lineJoin = 'bevel'; + ctx.roundRect(150, 150, 2000, 2000, [0]); + ctx.lineTo(160, 160); + ctx.stroke(); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.3.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.3.html new file mode 100644 index 0000000000..72183ecd05 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.3.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.path.roundrect.end.3 + + + + +

2d.path.roundrect.end.3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.3.worker.js new file mode 100644 index 0000000000..57cb328cfa --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.3.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.end.3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.strokeStyle = '#0f0'; + ctx.lineWidth = 100; + ctx.roundRect(101, 51, 2000, 2000, [500, 500, 500, 500]); + ctx.lineTo(-1, -1); + ctx.stroke(); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.4.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.4.html new file mode 100644 index 0000000000..c4fdee5958 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.4.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.path.roundrect.end.4 + + + + +

2d.path.roundrect.end.4

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.4.worker.js new file mode 100644 index 0000000000..a97a37d157 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.end.4.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.end.4 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 10; + ctx.roundRect(-1, -1, 2000, 2000, [1000, 1000, 1000, 1000]); + ctx.lineTo(-150, -150); + ctx.stroke(); + _assertPixel(canvas, 1,1, 0,255,0,255); + _assertPixel(canvas, 98,1, 0,255,0,255); + _assertPixel(canvas, 1,48, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.negative.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.negative.html new file mode 100644 index 0000000000..aa83657244 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.negative.html @@ -0,0 +1,45 @@ + + +OffscreenCanvas test: 2d.path.roundrect.negative + + + + +

2d.path.roundrect.negative

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.negative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.negative.worker.js new file mode 100644 index 0000000000..14459238ed --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.negative.worker.js @@ -0,0 +1,40 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.negative +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.beginPath(); + ctx.fillStyle = '#0f0'; + ctx.roundRect(0, 0, 50, 25, [10, 0, 0, 0]); + ctx.roundRect(100, 0, -50, 25, [10, 0, 0, 0]); + ctx.roundRect(0, 50, 50, -25, [10, 0, 0, 0]); + ctx.roundRect(100, 50, -50, -25, [10, 0, 0, 0]); + ctx.fill(); + // All rects drawn + _assertPixel(canvas, 25,12, 0,255,0,255); + _assertPixel(canvas, 75,12, 0,255,0,255); + _assertPixel(canvas, 25,37, 0,255,0,255); + _assertPixel(canvas, 75,37, 0,255,0,255); + // Correct corners are rounded. + _assertPixel(canvas, 1,1, 255,0,0,255); + _assertPixel(canvas, 98,1, 255,0,0,255); + _assertPixel(canvas, 1,48, 255,0,0,255); + _assertPixel(canvas, 98,48, 255,0,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.newsubpath.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.newsubpath.html new file mode 100644 index 0000000000..3ad7e5bb5b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.newsubpath.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.path.roundrect.newsubpath + + + + +

2d.path.roundrect.newsubpath

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.newsubpath.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.newsubpath.worker.js new file mode 100644 index 0000000000..757327c60d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.newsubpath.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.newsubpath +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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.roundRect(200, 25, 1, 1, [0]); + ctx.stroke(); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.nonfinite.html new file mode 100644 index 0000000000..adddc7b9b8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.nonfinite.html @@ -0,0 +1,116 @@ + + +OffscreenCanvas test: 2d.path.roundrect.nonfinite + + + + +

2d.path.roundrect.nonfinite

+

roundRect() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.nonfinite.worker.js new file mode 100644 index 0000000000..d6d44d6ffe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.nonfinite.worker.js @@ -0,0 +1,111 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.nonfinite +// Description:roundRect() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("roundRect() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50) + ctx.moveTo(0, 0); + ctx.lineTo(100, 0); + ctx.roundRect(Infinity, 50, 1, 1, [0]); + ctx.roundRect(-Infinity, 50, 1, 1, [0]); + ctx.roundRect(NaN, 50, 1, 1, [0]); + ctx.roundRect(0, Infinity, 1, 1, [0]); + ctx.roundRect(0, -Infinity, 1, 1, [0]); + ctx.roundRect(0, NaN, 1, 1, [0]); + ctx.roundRect(0, 50, Infinity, 1, [0]); + ctx.roundRect(0, 50, -Infinity, 1, [0]); + ctx.roundRect(0, 50, NaN, 1, [0]); + ctx.roundRect(0, 50, 1, Infinity, [0]); + ctx.roundRect(0, 50, 1, -Infinity, [0]); + ctx.roundRect(0, 50, 1, NaN, [0]); + ctx.roundRect(0, 50, 1, 1, [Infinity]); + ctx.roundRect(0, 50, 1, 1, [-Infinity]); + ctx.roundRect(0, 50, 1, 1, [NaN]); + ctx.roundRect(0, 50, 1, 1, [Infinity,0]); + ctx.roundRect(0, 50, 1, 1, [-Infinity,0]); + ctx.roundRect(0, 50, 1, 1, [NaN,0]); + ctx.roundRect(0, 50, 1, 1, [0,Infinity]); + ctx.roundRect(0, 50, 1, 1, [0,-Infinity]); + ctx.roundRect(0, 50, 1, 1, [0,NaN]); + ctx.roundRect(0, 50, 1, 1, [Infinity,0,0]); + ctx.roundRect(0, 50, 1, 1, [-Infinity,0,0]); + ctx.roundRect(0, 50, 1, 1, [NaN,0,0]); + ctx.roundRect(0, 50, 1, 1, [0,Infinity,0]); + ctx.roundRect(0, 50, 1, 1, [0,-Infinity,0]); + ctx.roundRect(0, 50, 1, 1, [0,NaN,0]); + ctx.roundRect(0, 50, 1, 1, [0,0,Infinity]); + ctx.roundRect(0, 50, 1, 1, [0,0,-Infinity]); + ctx.roundRect(0, 50, 1, 1, [0,0,NaN]); + ctx.roundRect(0, 50, 1, 1, [Infinity,0,0,0]); + ctx.roundRect(0, 50, 1, 1, [-Infinity,0,0,0]); + ctx.roundRect(0, 50, 1, 1, [NaN,0,0,0]); + ctx.roundRect(0, 50, 1, 1, [0,Infinity,0,0]); + ctx.roundRect(0, 50, 1, 1, [0,-Infinity,0,0]); + ctx.roundRect(0, 50, 1, 1, [0,NaN,0,0]); + ctx.roundRect(0, 50, 1, 1, [0,0,Infinity,0]); + ctx.roundRect(0, 50, 1, 1, [0,0,-Infinity,0]); + ctx.roundRect(0, 50, 1, 1, [0,0,NaN,0]); + ctx.roundRect(0, 50, 1, 1, [0,0,0,Infinity]); + ctx.roundRect(0, 50, 1, 1, [0,0,0,-Infinity]); + ctx.roundRect(0, 50, 1, 1, [0,0,0,NaN]); + ctx.roundRect(Infinity, Infinity, 1, 1, [0]); + ctx.roundRect(Infinity, Infinity, Infinity, 1, [0]); + ctx.roundRect(Infinity, Infinity, Infinity, Infinity, [0]); + ctx.roundRect(Infinity, Infinity, Infinity, Infinity, [Infinity]); + ctx.roundRect(Infinity, Infinity, Infinity, 1, [Infinity]); + ctx.roundRect(Infinity, Infinity, 1, Infinity, [0]); + ctx.roundRect(Infinity, Infinity, 1, Infinity, [Infinity]); + ctx.roundRect(Infinity, Infinity, 1, 1, [Infinity]); + ctx.roundRect(Infinity, 50, Infinity, 1, [0]); + ctx.roundRect(Infinity, 50, Infinity, Infinity, [0]); + ctx.roundRect(Infinity, 50, Infinity, Infinity, [Infinity]); + ctx.roundRect(Infinity, 50, Infinity, 1, [Infinity]); + ctx.roundRect(Infinity, 50, 1, Infinity, [0]); + ctx.roundRect(Infinity, 50, 1, Infinity, [Infinity]); + ctx.roundRect(Infinity, 50, 1, 1, [Infinity]); + ctx.roundRect(0, Infinity, Infinity, 1, [0]); + ctx.roundRect(0, Infinity, Infinity, Infinity, [0]); + ctx.roundRect(0, Infinity, Infinity, Infinity, [Infinity]); + ctx.roundRect(0, Infinity, Infinity, 1, [Infinity]); + ctx.roundRect(0, Infinity, 1, Infinity, [0]); + ctx.roundRect(0, Infinity, 1, Infinity, [Infinity]); + ctx.roundRect(0, Infinity, 1, 1, [Infinity]); + ctx.roundRect(0, 50, Infinity, Infinity, [0]); + ctx.roundRect(0, 50, Infinity, Infinity, [Infinity]); + ctx.roundRect(0, 50, Infinity, 1, [Infinity]); + ctx.roundRect(0, 50, 1, Infinity, [Infinity]); + ctx.roundRect(0, 0, 100, 100, [new DOMPoint(10, Infinity)]); + ctx.roundRect(0, 0, 100, 100, [new DOMPoint(10, -Infinity)]); + ctx.roundRect(0, 0, 100, 100, [new DOMPoint(10, NaN)]); + ctx.roundRect(0, 0, 100, 100, [new DOMPoint(Infinity, 10)]); + ctx.roundRect(0, 0, 100, 100, [new DOMPoint(-Infinity, 10)]); + ctx.roundRect(0, 0, 100, 100, [new DOMPoint(NaN, 10)]); + ctx.roundRect(0, 0, 100, 100, [{x: 10, y: Infinity}]); + ctx.roundRect(0, 0, 100, 100, [{x: 10, y: -Infinity}]); + ctx.roundRect(0, 0, 100, 100, [{x: 10, y: NaN}]); + ctx.roundRect(0, 0, 100, 100, [{x: Infinity, y: 10}]); + ctx.roundRect(0, 0, 100, 100, [{x: -Infinity, y: 10}]); + ctx.roundRect(0, 0, 100, 100, [{x: NaN, y: 10}]); + ctx.lineTo(100, 50); + ctx.lineTo(0, 50); + ctx.fillStyle = '#0f0'; + ctx.fill(); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 90,45, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.1.html new file mode 100644 index 0000000000..db4d871f9f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.1.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.path.roundrect.radius.intersecting.1 + + + + +

2d.path.roundrect.radius.intersecting.1

+

Check that roundRects with intersecting corner arcs are rendered correctly.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.1.worker.js new file mode 100644 index 0000000000..27076dbe21 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.1.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.radius.intersecting.1 +// Description:Check that roundRects with intersecting corner arcs are rendered correctly. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Check that roundRects with intersecting corner arcs are rendered correctly."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [40, 40, 40, 40]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + _assertPixel(canvas, 2,25, 0,255,0,255); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 50,48, 0,255,0,255); + _assertPixel(canvas, 97,25, 0,255,0,255); + _assertPixel(canvas, 1,1, 255,0,0,255); + _assertPixel(canvas, 98,1, 255,0,0,255); + _assertPixel(canvas, 1,48, 255,0,0,255); + _assertPixel(canvas, 98,48, 255,0,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.2.html new file mode 100644 index 0000000000..985942ca36 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.2.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.path.roundrect.radius.intersecting.2 + + + + +

2d.path.roundrect.radius.intersecting.2

+

Check that roundRects with intersecting corner arcs are rendered correctly.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.2.worker.js new file mode 100644 index 0000000000..5b6de579ae --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.intersecting.2.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.radius.intersecting.2 +// Description:Check that roundRects with intersecting corner arcs are rendered correctly. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Check that roundRects with intersecting corner arcs are rendered correctly."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(0, 0, 100, 50, [1000, 1000, 1000, 1000]); + ctx.fillStyle = '#0f0'; + ctx.fill(); + _assertPixel(canvas, 2,25, 0,255,0,255); + _assertPixel(canvas, 50,1, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 50,48, 0,255,0,255); + _assertPixel(canvas, 97,25, 0,255,0,255); + _assertPixel(canvas, 1,1, 255,0,0,255); + _assertPixel(canvas, 98,1, 255,0,0,255); + _assertPixel(canvas, 1,48, 255,0,0,255); + _assertPixel(canvas, 98,48, 255,0,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.negative.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.negative.html new file mode 100644 index 0000000000..60a7bebd24 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.negative.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.path.roundrect.radius.negative + + + + +

2d.path.roundrect.radius.negative

+

roundRect() with negative radius throws an exception

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.negative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.negative.worker.js new file mode 100644 index 0000000000..554a1ac078 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.negative.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.radius.negative +// Description:roundRect() with negative radius throws an exception +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("roundRect() with negative radius throws an exception"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(RangeError, () => { ctx.roundRect(0, 0, 0, 0, [-1])}); + assert_throws_js(RangeError, () => { ctx.roundRect(0, 0, 0, 0, [1, -1])}); + assert_throws_js(RangeError, () => { ctx.roundRect(0, 0, 0, 0, [new DOMPoint(-1, 1), 1])}); + assert_throws_js(RangeError, () => { ctx.roundRect(0, 0, 0, 0, [new DOMPoint(1, -1)])}); + assert_throws_js(RangeError, () => { ctx.roundRect(0, 0, 0, 0, [{x: -1, y: 1}, 1])}); + assert_throws_js(RangeError, () => { ctx.roundRect(0, 0, 0, 0, [{x: 1, y: -1}])}); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.noargument.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.noargument.html new file mode 100644 index 0000000000..26a69afad0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.noargument.html @@ -0,0 +1,50 @@ + + +OffscreenCanvas test: 2d.path.roundrect.radius.noargument + + + + +

2d.path.roundrect.radius.noargument

+

Check that roundRect draws a rectangle when no radii are provided.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.noargument.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.noargument.worker.js new file mode 100644 index 0000000000..1f6227786b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.noargument.worker.js @@ -0,0 +1,45 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.radius.noargument +// Description:Check that roundRect draws a rectangle when no radii are provided. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Check that roundRect draws a rectangle when no radii are provided."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.roundRect(10, 10, 80, 30); + ctx.fillStyle = '#0f0'; + ctx.fill(); + // upper left corner (10, 10) + _assertPixel(canvas, 10,9, 255,0,0,255); + _assertPixel(canvas, 9,10, 255,0,0,255); + _assertPixel(canvas, 10,10, 0,255,0,255); + + // upper right corner (89, 10) + _assertPixel(canvas, 90,10, 255,0,0,255); + _assertPixel(canvas, 89,9, 255,0,0,255); + _assertPixel(canvas, 89,10, 0,255,0,255); + + // lower right corner (89, 39) + _assertPixel(canvas, 89,40, 255,0,0,255); + _assertPixel(canvas, 90,39, 255,0,0,255); + _assertPixel(canvas, 89,39, 0,255,0,255); + + // lower left corner (10, 30) + _assertPixel(canvas, 9,39, 255,0,0,255); + _assertPixel(canvas, 10,40, 255,0,0,255); + _assertPixel(canvas, 10,39, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.none.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.none.html new file mode 100644 index 0000000000..763113e438 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.none.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.path.roundrect.radius.none + + + + +

2d.path.roundrect.radius.none

+

Check that roundRect throws an RangeError if radii is an empty array.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.none.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.none.worker.js new file mode 100644 index 0000000000..fefd1b4dd3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.none.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.radius.none +// Description:Check that roundRect throws an RangeError if radii is an empty array. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Check that roundRect throws an RangeError if radii is an empty array."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(RangeError, () => { ctx.roundRect(0, 0, 100, 50, [])}); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.toomany.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.toomany.html new file mode 100644 index 0000000000..ce330875fb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.toomany.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.path.roundrect.radius.toomany + + + + +

2d.path.roundrect.radius.toomany

+

Check that roundRect throws an IndeSizeError if radii has more than four items.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.toomany.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.toomany.worker.js new file mode 100644 index 0000000000..e1250afac7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.radius.toomany.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.radius.toomany +// Description:Check that roundRect throws an IndeSizeError if radii has more than four items. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Check that roundRect throws an IndeSizeError if radii has more than four items."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(RangeError, () => { ctx.roundRect(0, 0, 100, 50, [0, 0, 0, 0, 0])}); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.selfintersect.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.selfintersect.html new file mode 100644 index 0000000000..15ee6f4958 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.selfintersect.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.roundrect.selfintersect + + + + +

2d.path.roundrect.selfintersect

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.selfintersect.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.selfintersect.worker.js new file mode 100644 index 0000000000..91741110fc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.selfintersect.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.selfintersect +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.roundRect(0, 0, 100, 50, [0]); + ctx.strokeStyle = '#0f0'; + ctx.lineWidth = 90; + ctx.beginPath(); + ctx.roundRect(45, 20, 10, 10, [0]); + ctx.stroke(); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.winding.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.winding.html new file mode 100644 index 0000000000..47ecd777dc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.winding.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.path.roundrect.winding + + + + +

2d.path.roundrect.winding

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.winding.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.winding.worker.js new file mode 100644 index 0000000000..737e99f373 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.winding.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.winding +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.beginPath(); + ctx.fillStyle = '#f00'; + ctx.roundRect(0, 0, 50, 50, [0]); + ctx.roundRect(100, 50, -50, -50, [0]); + ctx.roundRect(0, 25, 100, -25, [0]); + ctx.roundRect(100, 25, -100, 25, [0]); + ctx.fill(); + _assertPixel(canvas, 25,12, 0,255,0,255); + _assertPixel(canvas, 75,12, 0,255,0,255); + _assertPixel(canvas, 25,37, 0,255,0,255); + _assertPixel(canvas, 75,37, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.1.html new file mode 100644 index 0000000000..772339dcc6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.1.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.roundrect.zero.1 + + + + +

2d.path.roundrect.zero.1

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.1.worker.js new file mode 100644 index 0000000000..afcaa20769 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.1.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.zero.1 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.strokeStyle = '#0f0'; + ctx.lineWidth = 100; + ctx.beginPath(); + ctx.roundRect(0, 50, 100, 0, [0]); + ctx.stroke(); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.2.html new file mode 100644 index 0000000000..2aad5aad41 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.2.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.roundrect.zero.2 + + + + +

2d.path.roundrect.zero.2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.2.worker.js new file mode 100644 index 0000000000..dec178bd20 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.2.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.zero.2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.strokeStyle = '#0f0'; + ctx.lineWidth = 100; + ctx.beginPath(); + ctx.roundRect(50, -100, 0, 250, [0]); + ctx.stroke(); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.3.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.3.html new file mode 100644 index 0000000000..485384aaff --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.3.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.roundrect.zero.3 + + + + +

2d.path.roundrect.zero.3

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.3.worker.js new file mode 100644 index 0000000000..88adb5c437 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.3.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.zero.3 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 100; + ctx.beginPath(); + ctx.roundRect(50, 25, 0, 0, [0]); + ctx.stroke(); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.4.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.4.html new file mode 100644 index 0000000000..dfd4821a84 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.4.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.roundrect.zero.4 + + + + +

2d.path.roundrect.zero.4

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.4.worker.js new file mode 100644 index 0000000000..fe8cc149c5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.4.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.zero.4 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.strokeStyle = '#0f0'; + ctx.lineWidth = 50; + ctx.roundRect(100, 25, 0, 0, [0]); + ctx.lineTo(0, 25); + ctx.stroke(); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.5.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.5.html new file mode 100644 index 0000000000..931a737e3b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.5.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.path.roundrect.zero.5 + + + + +

2d.path.roundrect.zero.5

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.5.worker.js new file mode 100644 index 0000000000..1fd61246a9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.5.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.zero.5 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.strokeStyle = '#f00'; + ctx.lineWidth = 50; + ctx.moveTo(0, 0); + ctx.roundRect(100, 25, 0, 0, [0]); + ctx.stroke(); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.6.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.6.html new file mode 100644 index 0000000000..25ed23d329 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.6.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.path.roundrect.zero.6 + + + + +

2d.path.roundrect.zero.6

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.6.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.6.worker.js new file mode 100644 index 0000000000..c4b6fba5b0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.roundrect.zero.6.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.roundrect.zero.6 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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.roundRect(100, 25, 1000, 0, [0]); + ctx.stroke(); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.empty.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.empty.html new file mode 100644 index 0000000000..29a95da20d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.empty.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.path.stroke.empty + + + + +

2d.path.stroke.empty

+

Empty subpaths are not stroked

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.empty.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.empty.worker.js new file mode 100644 index 0000000000..56ee68f185 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.empty.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.stroke.empty +// Description:Empty subpaths are not stroked +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Empty subpaths are not stroked"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.overlap.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.overlap.html new file mode 100644 index 0000000000..c3847464bb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.overlap.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.path.stroke.overlap + + + + +

2d.path.stroke.overlap

+

Stroked subpaths are combined before being drawn

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.overlap.png b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.overlap.png new file mode 100644 index 0000000000..e2a35d48d4 Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.overlap.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.overlap.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.overlap.worker.js new file mode 100644 index 0000000000..0e59d3bfc0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.overlap.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.stroke.overlap +// Description:Stroked subpaths are combined before being drawn +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Stroked subpaths are combined before being drawn"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 1); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.html new file mode 100644 index 0000000000..40a73b85fb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.html @@ -0,0 +1,45 @@ + + +OffscreenCanvas test: 2d.path.stroke.prune.arc + + + + +

2d.path.stroke.prune.arc

+

Zero-length line segments from arcTo and arc are removed before stroking

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.worker.js new file mode 100644 index 0000000000..880e8146ba --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.arc.worker.js @@ -0,0 +1,40 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.stroke.prune.arc +// Description:Zero-length line segments from arcTo and arc are removed before stroking +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Zero-length line segments from arcTo and arc are removed before stroking"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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(60, 25); + ctx.arc(50, 25, 10, 0, 0, false); + ctx.stroke(); + + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.html new file mode 100644 index 0000000000..2a3b40068d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.path.stroke.prune.closed + + + + +

2d.path.stroke.prune.closed

+

Zero-length line segments from closed paths are removed before stroking

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.worker.js new file mode 100644 index 0000000000..e1d271bf6a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.closed.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.stroke.prune.closed +// Description:Zero-length line segments from closed paths are removed before stroking +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Zero-length line segments from closed paths are removed before stroking"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.corner.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.corner.html new file mode 100644 index 0000000000..45db65d6d1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.corner.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.path.stroke.prune.corner + + + + +

2d.path.stroke.prune.corner

+

Zero-length line segments are removed before stroking with miters

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.corner.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.corner.worker.js new file mode 100644 index 0000000000..fff4ba19e9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.corner.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.stroke.prune.corner +// Description:Zero-length line segments are removed before stroking with miters +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Zero-length line segments are removed before stroking with miters"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.html new file mode 100644 index 0000000000..946395f1c1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.html @@ -0,0 +1,45 @@ + + +OffscreenCanvas test: 2d.path.stroke.prune.curve + + + + +

2d.path.stroke.prune.curve

+

Zero-length line segments from quadraticCurveTo and bezierCurveTo are removed before stroking

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.worker.js new file mode 100644 index 0000000000..ed960fdbe7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.curve.worker.js @@ -0,0 +1,40 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.stroke.prune.curve +// Description:Zero-length line segments from quadraticCurveTo and bezierCurveTo are removed before stroking +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Zero-length line segments from quadraticCurveTo and bezierCurveTo are removed before stroking"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.html new file mode 100644 index 0000000000..1f0a892455 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.path.stroke.prune.line + + + + +

2d.path.stroke.prune.line

+

Zero-length line segments from lineTo are removed before stroking

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.worker.js new file mode 100644 index 0000000000..a00e73bcbb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.line.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.stroke.prune.line +// Description:Zero-length line segments from lineTo are removed before stroking +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Zero-length line segments from lineTo are removed before stroking"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.html new file mode 100644 index 0000000000..ffce538d91 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.path.stroke.prune.rect + + + + +

2d.path.stroke.prune.rect

+

Zero-length line segments from rect and strokeRect are removed before stroking

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.worker.js new file mode 100644 index 0000000000..87bb533ff9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.prune.rect.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.stroke.prune.rect +// Description:Zero-length line segments from rect and strokeRect are removed before stroking +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Zero-length line segments from rect and strokeRect are removed before stroking"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale1.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale1.html new file mode 100644 index 0000000000..47639065d3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale1.html @@ -0,0 +1,54 @@ + + +OffscreenCanvas test: 2d.path.stroke.scale1 + + + + +

2d.path.stroke.scale1

+

Stroke line widths are scaled by the current transformation matrix

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale1.worker.js new file mode 100644 index 0000000000..3725fdf6e8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale1.worker.js @@ -0,0 +1,49 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.stroke.scale1 +// Description:Stroke line widths are scaled by the current transformation matrix +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Stroke line widths are scaled by the current transformation matrix"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,0, 0,255,0,255); + _assertPixel(canvas, 99,0, 0,255,0,255); + _assertPixel(canvas, 0,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 99,25, 0,255,0,255); + _assertPixel(canvas, 0,49, 0,255,0,255); + _assertPixel(canvas, 50,49, 0,255,0,255); + _assertPixel(canvas, 99,49, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale2.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale2.html new file mode 100644 index 0000000000..447a6dfadc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale2.html @@ -0,0 +1,56 @@ + + +OffscreenCanvas test: 2d.path.stroke.scale2 + + + + +

2d.path.stroke.scale2

+

Stroke line widths are scaled by the current transformation matrix

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale2.worker.js new file mode 100644 index 0000000000..5223de7816 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.scale2.worker.js @@ -0,0 +1,51 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.stroke.scale2 +// Description:Stroke line widths are scaled by the current transformation matrix +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Stroke line widths are scaled by the current transformation matrix"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,0, 0,255,0,255); + _assertPixel(canvas, 99,0, 0,255,0,255); + _assertPixel(canvas, 0,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 99,25, 0,255,0,255); + _assertPixel(canvas, 0,49, 0,255,0,255); + _assertPixel(canvas, 50,49, 0,255,0,255); + _assertPixel(canvas, 99,49, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.skew.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.skew.html new file mode 100644 index 0000000000..1fb118b122 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.skew.html @@ -0,0 +1,70 @@ + + +OffscreenCanvas test: 2d.path.stroke.skew + + + + +

2d.path.stroke.skew

+

Strokes lines are skewed by the current transformation matrix

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.skew.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.skew.worker.js new file mode 100644 index 0000000000..e65b796d06 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.skew.worker.js @@ -0,0 +1,65 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.stroke.skew +// Description:Strokes lines are skewed by the current transformation matrix +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Strokes lines are skewed by the current transformation matrix"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,0, 0,255,0,255); + _assertPixel(canvas, 99,0, 0,255,0,255); + _assertPixel(canvas, 0,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 99,25, 0,255,0,255); + _assertPixel(canvas, 0,49, 0,255,0,255); + _assertPixel(canvas, 50,49, 0,255,0,255); + _assertPixel(canvas, 99,49, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.unaffected.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.unaffected.html new file mode 100644 index 0000000000..3fc9cfad88 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.unaffected.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.stroke.unaffected + + + + +

2d.path.stroke.unaffected

+

Stroking does not start a new path or subpath

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.unaffected.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.unaffected.worker.js new file mode 100644 index 0000000000..d9df1ada94 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.unaffected.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.stroke.unaffected +// Description:Stroking does not start a new path or subpath +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Stroking does not start a new path or subpath"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.union.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.union.html new file mode 100644 index 0000000000..6b980acff2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.union.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.path.stroke.union + + + + +

2d.path.stroke.union

+

Strokes in opposite directions are unioned, not subtracted

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.union.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.union.worker.js new file mode 100644 index 0000000000..3b05feec03 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.stroke.union.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.stroke.union +// Description:Strokes in opposite directions are unioned, not subtracted +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Strokes in opposite directions are unioned, not subtracted"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.basic.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.basic.html new file mode 100644 index 0000000000..27f00aae03 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.basic.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.path.transformation.basic + + + + +

2d.path.transformation.basic

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.basic.worker.js new file mode 100644 index 0000000000..3ae4c876d5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.basic.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.transformation.basic +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.changing.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.changing.html new file mode 100644 index 0000000000..786a5cf589 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.changing.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.path.transformation.changing + + + + +

2d.path.transformation.changing

+

Transformations are applied while building paths, not when drawing

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.changing.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.changing.worker.js new file mode 100644 index 0000000000..2d8993c685 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.changing.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.transformation.changing +// Description:Transformations are applied while building paths, not when drawing +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Transformations are applied while building paths, not when drawing"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.multiple.html b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.multiple.html new file mode 100644 index 0000000000..636491bb0e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.multiple.html @@ -0,0 +1,47 @@ + + +OffscreenCanvas test: 2d.path.transformation.multiple + + + + +

2d.path.transformation.multiple

+

Transformations are applied while building paths, not when drawing

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.multiple.worker.js b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.multiple.worker.js new file mode 100644 index 0000000000..a9fb37d0de --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/path-objects/2d.path.transformation.multiple.worker.js @@ -0,0 +1,42 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.path.transformation.multiple +// Description:Transformations are applied while building paths, not when drawing +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Transformations are applied while building paths, not when drawing"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.basic.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.basic.html new file mode 100644 index 0000000000..f6932386df --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.basic.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.imageData.create1.basic + + + + +

2d.imageData.create1.basic

+

createImageData(imgdata) exists and returns something

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.basic.worker.js new file mode 100644 index 0000000000..30f3ed21b1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.basic.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.create1.basic +// Description:createImageData(imgdata) exists and returns something +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createImageData(imgdata) exists and returns something"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertDifferent(ctx.createImageData(ctx.createImageData(1, 1)), null, "ctx.createImageData(ctx.createImageData(1, 1))", "null"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.initial.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.initial.html new file mode 100644 index 0000000000..627b09b8bd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.initial.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.imageData.create1.initial + + + + +

2d.imageData.create1.initial

+

createImageData(imgdata) returns transparent black data of the right size

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.initial.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.initial.worker.js new file mode 100644 index 0000000000..da0856a487 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.initial.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.create1.initial +// Description:createImageData(imgdata) returns transparent black data of the right size +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createImageData(imgdata) returns transparent black data of the right size"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + var imgdata1 = ctx.getImageData(0, 0, 10, 20); + var imgdata2 = ctx.createImageData(imgdata1); + _assertSame(imgdata2.data.length, imgdata1.data.length, "imgdata2.data.length", "imgdata1.data.length"); + _assertSame(imgdata2.width, imgdata1.width, "imgdata2.width", "imgdata1.width"); + _assertSame(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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.zero.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.zero.html new file mode 100644 index 0000000000..b5a95172b6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.zero.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.imageData.create1.zero + + + + +

2d.imageData.create1.zero

+

createImageData(null) throws TypeError

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.zero.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.zero.worker.js new file mode 100644 index 0000000000..1eabd9ebf3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create1.zero.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.create1.zero +// Description:createImageData(null) throws TypeError +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createImageData(null) throws TypeError"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { ctx.createImageData(null); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.basic.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.basic.html new file mode 100644 index 0000000000..7c265f5209 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.basic.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.imageData.create2.basic + + + + +

2d.imageData.create2.basic

+

createImageData(sw, sh) exists and returns something

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.basic.worker.js new file mode 100644 index 0000000000..26ca82929c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.basic.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.create2.basic +// Description:createImageData(sw, sh) exists and returns something +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createImageData(sw, sh) exists and returns something"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertDifferent(ctx.createImageData(1, 1), null, "ctx.createImageData(1, 1)", "null"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.double.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.double.html new file mode 100644 index 0000000000..ca54641a30 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.double.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.imageData.create2.double + + + + +

2d.imageData.create2.double

+

createImageData(w, h) double is converted to long

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.double.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.double.worker.js new file mode 100644 index 0000000000..2f3416d0f0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.double.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.create2.double +// Description:createImageData(w, h) double is converted to long +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createImageData(w, h) double is converted to long"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var imgdata1 = ctx.createImageData(10.01, 10.99); + var imgdata2 = ctx.createImageData(-10.01, -10.99); + _assertSame(imgdata1.width, 10, "imgdata1.width", "10"); + _assertSame(imgdata1.height, 10, "imgdata1.height", "10"); + _assertSame(imgdata2.width, 10, "imgdata2.width", "10"); + _assertSame(imgdata2.height, 10, "imgdata2.height", "10"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.initial.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.initial.html new file mode 100644 index 0000000000..566a9a30db --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.initial.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.imageData.create2.initial + + + + +

2d.imageData.create2.initial

+

createImageData(sw, sh) returns transparent black data of the right size

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.initial.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.initial.worker.js new file mode 100644 index 0000000000..472e1dfd2e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.initial.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.create2.initial +// Description:createImageData(sw, sh) returns transparent black data of the right size +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createImageData(sw, sh) returns transparent black data of the right size"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var imgdata = ctx.createImageData(10, 20); + _assertSame(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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.large.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.large.html new file mode 100644 index 0000000000..75b8f737fd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.large.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.imageData.create2.large + + + + +

2d.imageData.create2.large

+

createImageData(sw, sh) works for sizes much larger than the canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.large.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.large.worker.js new file mode 100644 index 0000000000..e2b85bfb69 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.large.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.create2.large +// Description:createImageData(sw, sh) works for sizes much larger than the canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createImageData(sw, sh) works for sizes much larger than the canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var imgdata = ctx.createImageData(1000, 2000); + _assertSame(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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.negative.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.negative.html new file mode 100644 index 0000000000..b41153c282 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.negative.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.imageData.create2.negative + + + + +

2d.imageData.create2.negative

+

createImageData(sw, sh) takes the absolute magnitude of the size arguments

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.negative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.negative.worker.js new file mode 100644 index 0000000000..62ed60e102 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.negative.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.create2.negative +// Description:createImageData(sw, sh) takes the absolute magnitude of the size arguments +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createImageData(sw, sh) takes the absolute magnitude of the size arguments"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var imgdata1 = ctx.createImageData(10, 20); + var imgdata2 = ctx.createImageData(-10, 20); + var imgdata3 = ctx.createImageData(10, -20); + var imgdata4 = ctx.createImageData(-10, -20); + _assertSame(imgdata1.data.length, imgdata2.data.length, "imgdata1.data.length", "imgdata2.data.length"); + _assertSame(imgdata2.data.length, imgdata3.data.length, "imgdata2.data.length", "imgdata3.data.length"); + _assertSame(imgdata3.data.length, imgdata4.data.length, "imgdata3.data.length", "imgdata4.data.length"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.nonfinite.html new file mode 100644 index 0000000000..dd6f6d8350 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.nonfinite.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.imageData.create2.nonfinite + + + + +

2d.imageData.create2.nonfinite

+

createImageData() throws TypeError if arguments are not finite

+ +

Defined in "Web IDL" (draft) + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.nonfinite.worker.js new file mode 100644 index 0000000000..18825588bb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.nonfinite.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.create2.nonfinite +// Description:createImageData() throws TypeError if arguments are not finite +// Note:

Defined in "Web IDL" (draft) + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createImageData() throws TypeError if arguments are not finite"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { ctx.createImageData(Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.createImageData(-Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.createImageData(NaN, 10); }); + assert_throws_js(TypeError, function() { ctx.createImageData(10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.createImageData(10, -Infinity); }); + assert_throws_js(TypeError, function() { ctx.createImageData(10, NaN); }); + assert_throws_js(TypeError, function() { ctx.createImageData(Infinity, Infinity); }); + var posinfobj = { valueOf: function() { return Infinity; } }, + neginfobj = { valueOf: function() { return -Infinity; } }, + nanobj = { valueOf: function() { return -Infinity; } }; + assert_throws_js(TypeError, function() { ctx.createImageData(posinfobj, 10); }); + assert_throws_js(TypeError, function() { ctx.createImageData(neginfobj, 10); }); + assert_throws_js(TypeError, function() { ctx.createImageData(nanobj, 10); }); + assert_throws_js(TypeError, function() { ctx.createImageData(10, posinfobj); }); + assert_throws_js(TypeError, function() { ctx.createImageData(10, neginfobj); }); + assert_throws_js(TypeError, function() { ctx.createImageData(10, nanobj); }); + assert_throws_js(TypeError, function() { ctx.createImageData(posinfobj, posinfobj); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.round.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.round.html new file mode 100644 index 0000000000..0ecb2fb686 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.round.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.imageData.create2.round + + + + +

2d.imageData.create2.round

+

createImageData(w, h) is rounded the same as getImageData(0, 0, w, h)

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.round.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.round.worker.js new file mode 100644 index 0000000000..b416a02bf2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.round.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.create2.round +// Description:createImageData(w, h) is rounded the same as getImageData(0, 0, w, h) +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createImageData(w, h) is rounded the same as getImageData(0, 0, w, h)"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var imgdata1 = ctx.createImageData(10.01, 10.99); + var imgdata2 = ctx.getImageData(0, 0, 10.01, 10.99); + _assertSame(imgdata1.width, imgdata2.width, "imgdata1.width", "imgdata2.width"); + _assertSame(imgdata1.height, imgdata2.height, "imgdata1.height", "imgdata2.height"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.zero.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.zero.html new file mode 100644 index 0000000000..2f7082a7f0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.zero.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.imageData.create2.zero + + + + +

2d.imageData.create2.zero

+

createImageData(sw, sh) throws INDEX_SIZE_ERR if size is zero

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.zero.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.zero.worker.js new file mode 100644 index 0000000000..7f57c33898 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.create2.zero.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.create2.zero +// Description:createImageData(sw, sh) throws INDEX_SIZE_ERR if size is zero +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createImageData(sw, sh) throws INDEX_SIZE_ERR if size is zero"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.createImageData(10, 0); }); + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.createImageData(0, 10); }); + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.createImageData(0, 0); }); + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.createImageData(0.99, 10); }); + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.createImageData(10, 0.1); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.basic.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.basic.html new file mode 100644 index 0000000000..d810e64e38 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.basic.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.imageData.get.basic + + + + +

2d.imageData.get.basic

+

getImageData() exists and returns something

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.basic.worker.js new file mode 100644 index 0000000000..f28268be17 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.basic.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.basic +// Description:getImageData() exists and returns something +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getImageData() exists and returns something"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertDifferent(ctx.getImageData(0, 0, 100, 50), null, "ctx.getImageData(0, 0, 100, 50)", "null"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.clamp.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.clamp.html new file mode 100644 index 0000000000..825d00a5c4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.clamp.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.imageData.get.clamp + + + + +

2d.imageData.get.clamp

+

getImageData() clamps colors to the range [0, 255]

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.clamp.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.clamp.worker.js new file mode 100644 index 0000000000..fb4e76584a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.clamp.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.clamp +// Description:getImageData() clamps colors to the range [0, 255] +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getImageData() clamps colors to the range [0, 255]"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.double.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.double.html new file mode 100644 index 0000000000..64fc7c7c12 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.double.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.imageData.get.double + + + + +

2d.imageData.get.double

+

createImageData(w, h) double is converted to long

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.double.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.double.worker.js new file mode 100644 index 0000000000..316dce7f80 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.double.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.double +// Description:createImageData(w, h) double is converted to long +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("createImageData(w, h) double is converted to long"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var imgdata1 = ctx.getImageData(0, 0, 10.01, 10.99); + var imgdata2 = ctx.getImageData(0, 0, -10.01, -10.99); + _assertSame(imgdata1.width, 10, "imgdata1.width", "10"); + _assertSame(imgdata1.height, 10, "imgdata1.height", "10"); + _assertSame(imgdata2.width, 10, "imgdata2.width", "10"); + _assertSame(imgdata2.height, 10, "imgdata2.height", "10"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.invalid.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.invalid.html new file mode 100644 index 0000000000..dfc5d106ee --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.invalid.html @@ -0,0 +1,45 @@ + + +OffscreenCanvas test: 2d.imageData.get.invalid + + + + +

2d.imageData.get.invalid

+

Verify getImageData() behavior in invalid cases.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.invalid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.invalid.worker.js new file mode 100644 index 0000000000..5206899b6a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.invalid.worker.js @@ -0,0 +1,40 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.invalid +// Description:Verify getImageData() behavior in invalid cases. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Verify getImageData() behavior in invalid cases."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + imageData = ctx.getImageData(0,0,2,2); + var testValues = [NaN, true, false, "\"garbage\"", "-1", + "0", "1", "2", Infinity, -Infinity, + -5, -0.5, 0, 0.5, 5, + 5.4, 255, 256, null, undefined]; + var testResults = [0, 1, 0, 0, 0, + 0, 1, 2, 255, 0, + 0, 0, 0, 0, 5, + 5, 255, 255, 0, 0]; + for (var i = 0; i < testValues.length; i++) { + imageData.data[0] = testValues[i]; + _assert(imageData.data[0] == testResults[i], "imageData.data[\""+(0)+"\"] == testResults[\""+(i)+"\"]"); + } + imageData.data['foo']='garbage'; + _assert(imageData.data['foo'] == 'garbage', "imageData.data['foo'] == 'garbage'"); + imageData.data[-1]='garbage'; + _assert(imageData.data[-1] == undefined, "imageData.data[-1] == undefined"); + imageData.data[17]='garbage'; + _assert(imageData.data[17] == undefined, "imageData.data[\""+(17)+"\"] == undefined"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.large.crash.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.large.crash.html new file mode 100644 index 0000000000..3e05c3c92b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.large.crash.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.imageData.get.large.crash + + + + +

2d.imageData.get.large.crash

+

Test that canvas crash when image data cannot be allocated.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.large.crash.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.large.crash.worker.js new file mode 100644 index 0000000000..62c1771dba --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.large.crash.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.large.crash +// Description:Test that canvas crash when image data cannot be allocated. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test that canvas crash when image data cannot be allocated."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { ctx.getImageData(10, 0xffffffff, 2147483647, 10); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.length.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.length.html new file mode 100644 index 0000000000..47b5fcd166 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.length.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.imageData.get.length + + + + +

2d.imageData.get.length

+

getImageData() returns a correctly-sized Uint8ClampedArray

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.length.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.length.worker.js new file mode 100644 index 0000000000..74ed6015f0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.length.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.length +// Description:getImageData() returns a correctly-sized Uint8ClampedArray +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getImageData() returns a correctly-sized Uint8ClampedArray"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var imgdata = ctx.getImageData(0, 0, 10, 10); + _assertSame(imgdata.data.length, imgdata.width*imgdata.height*4, "imgdata.data.length", "imgdata.width*imgdata.height*4"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonfinite.html new file mode 100644 index 0000000000..62cad61848 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonfinite.html @@ -0,0 +1,75 @@ + + +OffscreenCanvas test: 2d.imageData.get.nonfinite + + + + +

2d.imageData.get.nonfinite

+

getImageData() throws TypeError if arguments are not finite

+ +

Defined in "Web IDL" (draft) + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonfinite.worker.js new file mode 100644 index 0000000000..98b4913a13 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonfinite.worker.js @@ -0,0 +1,70 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.nonfinite +// Description:getImageData() throws TypeError if arguments are not finite +// Note:

Defined in "Web IDL" (draft) + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getImageData() throws TypeError if arguments are not finite"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(-Infinity, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(NaN, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, Infinity, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, -Infinity, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, NaN, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, -Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, NaN, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, 10, -Infinity); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, 10, NaN); }); + assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, Infinity, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, Infinity, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, Infinity, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, 10, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, 10, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.getImageData(Infinity, 10, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, Infinity, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, Infinity, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, Infinity, Infinity); }); + var posinfobj = { valueOf: function() { return Infinity; } }, + neginfobj = { valueOf: function() { return -Infinity; } }, + nanobj = { valueOf: function() { return -Infinity; } }; + assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(neginfobj, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(nanobj, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, posinfobj, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, neginfobj, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, nanobj, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, posinfobj, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, neginfobj, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, nanobj, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, 10, posinfobj); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, 10, neginfobj); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, 10, nanobj); }); + assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, posinfobj, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, posinfobj, posinfobj, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, posinfobj, posinfobj, posinfobj); }); + assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, posinfobj, 10, posinfobj); }); + assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, 10, posinfobj, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, 10, posinfobj, posinfobj); }); + assert_throws_js(TypeError, function() { ctx.getImageData(posinfobj, 10, 10, posinfobj); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, posinfobj, posinfobj, 10); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, posinfobj, posinfobj, posinfobj); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, posinfobj, 10, posinfobj); }); + assert_throws_js(TypeError, function() { ctx.getImageData(10, 10, posinfobj, posinfobj); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonpremul.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonpremul.html new file mode 100644 index 0000000000..3a97d9dc05 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonpremul.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.imageData.get.nonpremul + + + + +

2d.imageData.get.nonpremul

+

getImageData() returns non-premultiplied colors

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonpremul.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonpremul.worker.js new file mode 100644 index 0000000000..1a8da5efb0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.nonpremul.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.nonpremul +// Description:getImageData() returns non-premultiplied colors +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getImageData() returns non-premultiplied colors"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.alpha.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.alpha.html new file mode 100644 index 0000000000..04eb67902f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.alpha.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.imageData.get.order.alpha + + + + +

2d.imageData.get.order.alpha

+

getImageData() returns A in the fourth component

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.alpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.alpha.worker.js new file mode 100644 index 0000000000..4338436a6d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.alpha.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.order.alpha +// Description:getImageData() returns A in the fourth component +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getImageData() returns A in the fourth component"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.cols.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.cols.html new file mode 100644 index 0000000000..f5b315c60a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.cols.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.imageData.get.order.cols + + + + +

2d.imageData.get.order.cols

+

getImageData() returns leftmost columns first

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.cols.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.cols.worker.js new file mode 100644 index 0000000000..6a070e2516 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.cols.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.order.cols +// Description:getImageData() returns leftmost columns first +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getImageData() returns leftmost columns first"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rgb.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rgb.html new file mode 100644 index 0000000000..661b437fb1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rgb.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.imageData.get.order.rgb + + + + +

2d.imageData.get.order.rgb

+

getImageData() returns R then G then B

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rgb.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rgb.worker.js new file mode 100644 index 0000000000..4e5974f9f8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rgb.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.order.rgb +// Description:getImageData() returns R then G then B +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getImageData() returns R then G then B"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rows.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rows.html new file mode 100644 index 0000000000..6d8ee2eba5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rows.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.imageData.get.order.rows + + + + +

2d.imageData.get.order.rows

+

getImageData() returns topmost rows first

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rows.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rows.worker.js new file mode 100644 index 0000000000..1d3226a503 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.order.rows.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.order.rows +// Description:getImageData() returns topmost rows first +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getImageData() returns topmost rows first"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.range.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.range.html new file mode 100644 index 0000000000..8db1a42ca1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.range.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.imageData.get.range + + + + +

2d.imageData.get.range

+

getImageData() returns values in the range [0, 255]

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.range.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.range.worker.js new file mode 100644 index 0000000000..2e962beeae --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.range.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.range +// Description:getImageData() returns values in the range [0, 255] +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getImageData() returns values in the range [0, 255]"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.rounding.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.rounding.html new file mode 100644 index 0000000000..f939ba82df --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.rounding.html @@ -0,0 +1,45 @@ + + +OffscreenCanvas test: 2d.imageData.get.rounding + + + + +

2d.imageData.get.rounding

+

Test the handling of non-integer source coordinates in getImageData().

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.rounding.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.rounding.worker.js new file mode 100644 index 0000000000..b2cd08ade2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.rounding.worker.js @@ -0,0 +1,40 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.rounding +// Description:Test the handling of non-integer source coordinates in getImageData(). +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Test the handling of non-integer source coordinates in getImageData()."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + function testDimensions(sx, sy, sw, sh, width, height) + { + imageData = ctx.getImageData(sx, sy, sw, sh); + _assert(imageData.width == width, "imageData.width == width"); + _assert(imageData.height == height, "imageData.height == height"); + } + + testDimensions(0, 0, 20, 10, 20, 10); + + testDimensions(.1, .2, 20, 10, 20, 10); + testDimensions(.9, .8, 20, 10, 20, 10); + + testDimensions(0, 0, 20.9, 10.9, 20, 10); + testDimensions(0, 0, 20.1, 10.1, 20, 10); + + testDimensions(-1, -1, 20, 10, 20, 10); + + testDimensions(-1.1, 0, 20, 10, 20, 10); + testDimensions(-1.9, 0, 20, 10, 20, 10); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.negative.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.negative.html new file mode 100644 index 0000000000..a4b9c7e41c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.negative.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.imageData.get.source.negative + + + + +

2d.imageData.get.source.negative

+

getImageData() works with negative width and height, and returns top-to-bottom left-to-right

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.negative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.negative.worker.js new file mode 100644 index 0000000000..62929918ec --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.negative.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.source.negative +// Description:getImageData() works with negative width and height, and returns top-to-bottom left-to-right +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getImageData() works with negative width and height, and returns top-to-bottom left-to-right"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.outside.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.outside.html new file mode 100644 index 0000000000..ca11da80d5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.outside.html @@ -0,0 +1,86 @@ + + +OffscreenCanvas test: 2d.imageData.get.source.outside + + + + +

2d.imageData.get.source.outside

+

getImageData() returns transparent black outside the canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.outside.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.outside.worker.js new file mode 100644 index 0000000000..35fa83d668 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.outside.worker.js @@ -0,0 +1,81 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.source.outside +// Description:getImageData() returns transparent black outside the canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getImageData() returns transparent black outside the canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + + var imgdata5 = ctx.getImageData(100, 10, 1, 1); + _assertSame(imgdata5.data[0], 0, "imgdata5.data[\""+(0)+"\"]", "0"); + _assertSame(imgdata5.data[1], 0, "imgdata5.data[\""+(1)+"\"]", "0"); + _assertSame(imgdata5.data[2], 0, "imgdata5.data[\""+(2)+"\"]", "0"); + _assertSame(imgdata5.data[3], 0, "imgdata5.data[\""+(3)+"\"]", "0"); + + var imgdata6 = ctx.getImageData(0, 10, 1, 1); + _assertSame(imgdata6.data[0], 0, "imgdata6.data[\""+(0)+"\"]", "0"); + _assertSame(imgdata6.data[1], 136, "imgdata6.data[\""+(1)+"\"]", "136"); + _assertSame(imgdata6.data[2], 255, "imgdata6.data[\""+(2)+"\"]", "255"); + _assertSame(imgdata6.data[3], 255, "imgdata6.data[\""+(3)+"\"]", "255"); + + var imgdata7 = ctx.getImageData(-10, 10, 20, 20); + _assertSame(imgdata7.data[ 0*4+0], 0, "imgdata7.data[ 0*4+0]", "0"); + _assertSame(imgdata7.data[ 0*4+1], 0, "imgdata7.data[ 0*4+1]", "0"); + _assertSame(imgdata7.data[ 0*4+2], 0, "imgdata7.data[ 0*4+2]", "0"); + _assertSame(imgdata7.data[ 0*4+3], 0, "imgdata7.data[ 0*4+3]", "0"); + _assertSame(imgdata7.data[ 9*4+0], 0, "imgdata7.data[ 9*4+0]", "0"); + _assertSame(imgdata7.data[ 9*4+1], 0, "imgdata7.data[ 9*4+1]", "0"); + _assertSame(imgdata7.data[ 9*4+2], 0, "imgdata7.data[ 9*4+2]", "0"); + _assertSame(imgdata7.data[ 9*4+3], 0, "imgdata7.data[ 9*4+3]", "0"); + _assertSame(imgdata7.data[10*4+0], 0, "imgdata7.data[10*4+0]", "0"); + _assertSame(imgdata7.data[10*4+1], 136, "imgdata7.data[10*4+1]", "136"); + _assertSame(imgdata7.data[10*4+2], 255, "imgdata7.data[10*4+2]", "255"); + _assertSame(imgdata7.data[10*4+3], 255, "imgdata7.data[10*4+3]", "255"); + _assertSame(imgdata7.data[19*4+0], 0, "imgdata7.data[19*4+0]", "0"); + _assertSame(imgdata7.data[19*4+1], 136, "imgdata7.data[19*4+1]", "136"); + _assertSame(imgdata7.data[19*4+2], 255, "imgdata7.data[19*4+2]", "255"); + _assertSame(imgdata7.data[19*4+3], 255, "imgdata7.data[19*4+3]", "255"); + _assertSame(imgdata7.data[20*4+0], 0, "imgdata7.data[20*4+0]", "0"); + _assertSame(imgdata7.data[20*4+1], 0, "imgdata7.data[20*4+1]", "0"); + _assertSame(imgdata7.data[20*4+2], 0, "imgdata7.data[20*4+2]", "0"); + _assertSame(imgdata7.data[20*4+3], 0, "imgdata7.data[20*4+3]", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.size.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.size.html new file mode 100644 index 0000000000..6cb848a718 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.size.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.imageData.get.source.size + + + + +

2d.imageData.get.source.size

+

getImageData() returns bigger ImageData for bigger source rectangle

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.size.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.size.worker.js new file mode 100644 index 0000000000..e54d75b97a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.source.size.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.source.size +// Description:getImageData() returns bigger ImageData for bigger source rectangle +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getImageData() returns bigger ImageData for bigger source rectangle"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.unaffected.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.unaffected.html new file mode 100644 index 0000000000..66a0b80fd7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.unaffected.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.imageData.get.unaffected + + + + +

2d.imageData.get.unaffected

+

getImageData() is not affected by context state

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.unaffected.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.unaffected.worker.js new file mode 100644 index 0000000000..8bf0dddb06 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.unaffected.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.unaffected +// Description:getImageData() is not affected by context state +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getImageData() is not affected by context state"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.zero.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.zero.html new file mode 100644 index 0000000000..042a8bc5f5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.zero.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.imageData.get.zero + + + + +

2d.imageData.get.zero

+

getImageData() throws INDEX_SIZE_ERR if size is zero

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.zero.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.zero.worker.js new file mode 100644 index 0000000000..ed31030d3c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.get.zero.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.get.zero +// Description:getImageData() throws INDEX_SIZE_ERR if size is zero +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("getImageData() throws INDEX_SIZE_ERR if size is zero"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.getImageData(1, 1, 10, 0); }); + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.getImageData(1, 1, 0, 10); }); + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.getImageData(1, 1, 0, 0); }); + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.getImageData(1, 1, 0.1, 10); }); + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.getImageData(1, 1, 10, 0.99); }); + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.getImageData(1, 1, -0.1, 10); }); + assert_throws_dom("INDEX_SIZE_ERR", function() { ctx.getImageData(1, 1, 10, -0.99); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.clamp.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.clamp.html new file mode 100644 index 0000000000..aa6073eedf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.clamp.html @@ -0,0 +1,55 @@ + + +OffscreenCanvas test: 2d.imageData.object.clamp + + + + +

2d.imageData.object.clamp

+

ImageData.data clamps numbers to [0, 255]

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.clamp.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.clamp.worker.js new file mode 100644 index 0000000000..260198fe2f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.clamp.worker.js @@ -0,0 +1,50 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.object.clamp +// Description:ImageData.data clamps numbers to [0, 255] +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("ImageData.data clamps numbers to [0, 255]"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var imgdata = ctx.getImageData(0, 0, 10, 10); + + imgdata.data[0] = 100; + imgdata.data[0] = 300; + _assertSame(imgdata.data[0], 255, "imgdata.data[\""+(0)+"\"]", "255"); + imgdata.data[0] = 100; + imgdata.data[0] = -100; + _assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); + + imgdata.data[0] = 100; + imgdata.data[0] = 200+Math.pow(2, 32); + _assertSame(imgdata.data[0], 255, "imgdata.data[\""+(0)+"\"]", "255"); + imgdata.data[0] = 100; + imgdata.data[0] = -200-Math.pow(2, 32); + _assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); + + imgdata.data[0] = 100; + imgdata.data[0] = Math.pow(10, 39); + _assertSame(imgdata.data[0], 255, "imgdata.data[\""+(0)+"\"]", "255"); + imgdata.data[0] = 100; + imgdata.data[0] = -Math.pow(10, 39); + _assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); + + imgdata.data[0] = 100; + imgdata.data[0] = -Infinity; + _assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); + imgdata.data[0] = 100; + imgdata.data[0] = Infinity; + _assertSame(imgdata.data[0], 255, "imgdata.data[\""+(0)+"\"]", "255"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.nan.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.nan.html new file mode 100644 index 0000000000..af692a7f9f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.nan.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.imageData.object.nan + + + + +

2d.imageData.object.nan

+

ImageData.data converts NaN to 0

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.nan.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.nan.worker.js new file mode 100644 index 0000000000..4ebfedb1e8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.nan.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.object.nan +// Description:ImageData.data converts NaN to 0 +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("ImageData.data converts NaN to 0"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.properties.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.properties.html new file mode 100644 index 0000000000..68a6f63868 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.properties.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.imageData.object.properties + + + + +

2d.imageData.object.properties

+

ImageData objects have the right properties

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.properties.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.properties.worker.js new file mode 100644 index 0000000000..e428e0d4fc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.properties.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.object.properties +// Description:ImageData objects have the right properties +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("ImageData objects have the right properties"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var imgdata = ctx.getImageData(0, 0, 10, 10); + _assertSame(typeof(imgdata.width), 'number', "typeof(imgdata.width)", "'number'"); + _assertSame(typeof(imgdata.height), 'number', "typeof(imgdata.height)", "'number'"); + _assertSame(typeof(imgdata.data), 'object', "typeof(imgdata.data)", "'object'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.readonly.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.readonly.html new file mode 100644 index 0000000000..2ab5f47f64 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.readonly.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.imageData.object.readonly + + + + +

2d.imageData.object.readonly

+

ImageData objects properties are read-only

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.readonly.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.readonly.worker.js new file mode 100644 index 0000000000..d02f0f319a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.readonly.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.object.readonly +// Description:ImageData objects properties are read-only +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("ImageData objects properties are read-only"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.round.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.round.html new file mode 100644 index 0000000000..fbde0cd940 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.round.html @@ -0,0 +1,55 @@ + + +OffscreenCanvas test: 2d.imageData.object.round + + + + +

2d.imageData.object.round

+

ImageData.data rounds numbers with round-to-zero

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.round.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.round.worker.js new file mode 100644 index 0000000000..8ef3c02793 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.round.worker.js @@ -0,0 +1,50 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.object.round +// Description:ImageData.data rounds numbers with round-to-zero +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("ImageData.data rounds numbers with round-to-zero"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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], 1, "imgdata.data[\""+(0)+"\"]", "1"); + 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], 254, "imgdata.data[\""+(0)+"\"]", "254"); + imgdata.data[0] = 254.5; + _assertSame(imgdata.data[0], 254, "imgdata.data[\""+(0)+"\"]", "254"); + imgdata.data[0] = 256.5; + _assertSame(imgdata.data[0], 255, "imgdata.data[\""+(0)+"\"]", "255"); + imgdata.data[0] = -0.5; + _assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); + imgdata.data[0] = -1.5; + _assertSame(imgdata.data[0], 0, "imgdata.data[\""+(0)+"\"]", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.set.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.set.html new file mode 100644 index 0000000000..27ed5a3504 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.set.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.imageData.object.set + + + + +

2d.imageData.object.set

+

ImageData.data can be modified

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.set.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.set.worker.js new file mode 100644 index 0000000000..f9b755f7e2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.set.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.object.set +// Description:ImageData.data can be modified +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("ImageData.data can be modified"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.string.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.string.html new file mode 100644 index 0000000000..a437c475a5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.string.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.imageData.object.string + + + + +

2d.imageData.object.string

+

ImageData.data converts strings to numbers with ToNumber

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.string.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.string.worker.js new file mode 100644 index 0000000000..84cff6a48c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.string.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.object.string +// Description:ImageData.data converts strings to numbers with ToNumber +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("ImageData.data converts strings to numbers with ToNumber"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.undefined.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.undefined.html new file mode 100644 index 0000000000..81462339e9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.undefined.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.imageData.object.undefined + + + + +

2d.imageData.object.undefined

+

ImageData.data converts undefined to 0

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.undefined.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.undefined.worker.js new file mode 100644 index 0000000000..825f8c102f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.object.undefined.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.object.undefined +// Description:ImageData.data converts undefined to 0 +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("ImageData.data converts undefined to 0"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.alpha.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.alpha.html new file mode 100644 index 0000000000..dcd2d92ab1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.alpha.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.imageData.put.alpha + + + + +

2d.imageData.put.alpha

+

putImageData() puts non-solid image data correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.alpha.png b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.alpha.png new file mode 100644 index 0000000000..5428c65524 Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.alpha.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.alpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.alpha.worker.js new file mode 100644 index 0000000000..25d8047189 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.alpha.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.alpha +// Description:putImageData() puts non-solid image data correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() puts non-solid image data correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.basic.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.basic.html new file mode 100644 index 0000000000..257e0330d5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.basic.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.imageData.put.basic + + + + +

2d.imageData.put.basic

+

putImageData() puts image data from getImageData() onto the canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.basic.worker.js new file mode 100644 index 0000000000..6a68ffa792 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.basic.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.basic +// Description:putImageData() puts image data from getImageData() onto the canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() puts image data from getImageData() onto the canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.clip.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.clip.html new file mode 100644 index 0000000000..648ded588c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.clip.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.imageData.put.clip + + + + +

2d.imageData.put.clip

+

putImageData() is not affected by clipping regions

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.clip.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.clip.worker.js new file mode 100644 index 0000000000..b665edbb33 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.clip.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.clip +// Description:putImageData() is not affected by clipping regions +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() is not affected by clipping regions"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.created.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.created.html new file mode 100644 index 0000000000..08f35117dd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.created.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.imageData.put.created + + + + +

2d.imageData.put.created

+

putImageData() puts image data from createImageData() onto the canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.created.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.created.worker.js new file mode 100644 index 0000000000..f249efb4bb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.created.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.created +// Description:putImageData() puts image data from createImageData() onto the canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() puts image data from createImageData() onto the canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.cross.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.cross.html new file mode 100644 index 0000000000..cddd0451a4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.cross.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.imageData.put.cross + + + + +

2d.imageData.put.cross

+

putImageData() accepts image data got from a different canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.cross.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.cross.worker.js new file mode 100644 index 0000000000..0ec4ed142f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.cross.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.cross +// Description:putImageData() accepts image data got from a different canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() accepts image data got from a different canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var offscreenCanvas2 = new OffscreenCanvas(100, 50); + var ctx2 = offscreenCanvas2.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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.negative.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.negative.html new file mode 100644 index 0000000000..cea4d0d477 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.negative.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.imageData.put.dirty.negative + + + + +

2d.imageData.put.dirty.negative

+

putImageData() handles negative-sized dirty rectangles correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.negative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.negative.worker.js new file mode 100644 index 0000000000..0a7af64049 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.negative.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.dirty.negative +// Description:putImageData() handles negative-sized dirty rectangles correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() handles negative-sized dirty rectangles correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + _assertPixelApprox(canvas, 35,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 65,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 50,15, 0,255,0,255, 2); + _assertPixelApprox(canvas, 50,45, 0,255,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.outside.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.outside.html new file mode 100644 index 0000000000..7b67ef2253 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.outside.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.imageData.put.dirty.outside + + + + +

2d.imageData.put.dirty.outside

+

putImageData() handles dirty rectangles outside the canvas correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.outside.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.outside.worker.js new file mode 100644 index 0000000000..87b88a09f4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.outside.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.dirty.outside +// Description:putImageData() handles dirty rectangles outside the canvas correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() handles dirty rectangles outside the canvas correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + _assertPixelApprox(canvas, 98,15, 0,255,0,255, 2); + _assertPixelApprox(canvas, 98,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 98,45, 0,255,0,255, 2); + _assertPixelApprox(canvas, 1,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 1,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 1,45, 0,255,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect1.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect1.html new file mode 100644 index 0000000000..9f571427a8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect1.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.imageData.put.dirty.rect1 + + + + +

2d.imageData.put.dirty.rect1

+

putImageData() only modifies areas inside the dirty rectangle, using width and height

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect1.worker.js new file mode 100644 index 0000000000..6feea9556d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect1.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.dirty.rect1 +// Description:putImageData() only modifies areas inside the dirty rectangle, using width and height +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() only modifies areas inside the dirty rectangle, using width and height"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + _assertPixelApprox(canvas, 35,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 65,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 50,15, 0,255,0,255, 2); + _assertPixelApprox(canvas, 50,45, 0,255,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect2.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect2.html new file mode 100644 index 0000000000..997c1136a1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect2.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.imageData.put.dirty.rect2 + + + + +

2d.imageData.put.dirty.rect2

+

putImageData() only modifies areas inside the dirty rectangle, using x and y

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect2.worker.js new file mode 100644 index 0000000000..752a3cdf1e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.rect2.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.dirty.rect2 +// Description:putImageData() only modifies areas inside the dirty rectangle, using x and y +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() only modifies areas inside the dirty rectangle, using x and y"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + _assertPixelApprox(canvas, 35,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 65,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 50,15, 0,255,0,255, 2); + _assertPixelApprox(canvas, 50,45, 0,255,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.zero.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.zero.html new file mode 100644 index 0000000000..fb90a017e1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.zero.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.imageData.put.dirty.zero + + + + +

2d.imageData.put.dirty.zero

+

putImageData() with zero-sized dirty rectangle puts nothing

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.zero.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.zero.worker.js new file mode 100644 index 0000000000..2fa474c07f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.dirty.zero.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.dirty.zero +// Description:putImageData() with zero-sized dirty rectangle puts nothing +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() with zero-sized dirty rectangle puts nothing"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.modified.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.modified.html new file mode 100644 index 0000000000..337701aaf5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.modified.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.imageData.put.modified + + + + +

2d.imageData.put.modified

+

putImageData() puts modified image data correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.modified.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.modified.worker.js new file mode 100644 index 0000000000..846a9dbc2d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.modified.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.modified +// Description:putImageData() puts modified image data correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() puts modified image data correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.nonfinite.html new file mode 100644 index 0000000000..eb61d38e9e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.nonfinite.html @@ -0,0 +1,109 @@ + + +OffscreenCanvas test: 2d.imageData.put.nonfinite + + + + +

2d.imageData.put.nonfinite

+

putImageData() throws TypeError if arguments are not finite

+ +

Defined in "Web IDL" (draft) + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.nonfinite.worker.js new file mode 100644 index 0000000000..479ad69467 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.nonfinite.worker.js @@ -0,0 +1,104 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.nonfinite +// Description:putImageData() throws TypeError if arguments are not finite +// Note:

Defined in "Web IDL" (draft) + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() throws TypeError if arguments are not finite"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var imgdata = ctx.getImageData(0, 0, 10, 10); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, -Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, NaN, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, -Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, NaN); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, -Infinity, 10, 10, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, NaN, 10, 10, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, -Infinity, 10, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, NaN, 10, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, -Infinity, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, NaN, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, -Infinity, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, NaN, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, 10, -Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, 10, NaN, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, 10, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, 10, 10, -Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, 10, 10, NaN); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, Infinity, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, Infinity, 10, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, Infinity, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, Infinity, 10, 10, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, Infinity, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, Infinity, 10, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, Infinity, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, 10, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, Infinity, 10, 10, 10, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, Infinity, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, Infinity, 10, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, Infinity, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, 10, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, Infinity, 10, 10, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, Infinity, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, 10, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, Infinity, 10, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, 10); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, Infinity, Infinity, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, Infinity, 10, Infinity); }); + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 10, 10, 10, 10, Infinity, Infinity); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.null.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.null.html new file mode 100644 index 0000000000..89fe06686d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.null.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.imageData.put.null + + + + +

2d.imageData.put.null

+

putImageData() with null imagedata throws TypeError

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.null.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.null.worker.js new file mode 100644 index 0000000000..2f021b638e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.null.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.null +// Description:putImageData() with null imagedata throws TypeError +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() with null imagedata throws TypeError"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + assert_throws_js(TypeError, function() { ctx.putImageData(null, 0, 0); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.path.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.path.html new file mode 100644 index 0000000000..6c32376006 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.path.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.imageData.put.path + + + + +

2d.imageData.put.path

+

putImageData() does not affect the current path

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.path.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.path.worker.js new file mode 100644 index 0000000000..66781a922d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.path.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.path +// Description:putImageData() does not affect the current path +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() does not affect the current path"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unaffected.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unaffected.html new file mode 100644 index 0000000000..3d3e99b135 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unaffected.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.imageData.put.unaffected + + + + +

2d.imageData.put.unaffected

+

putImageData() is not affected by context state

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unaffected.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unaffected.worker.js new file mode 100644 index 0000000000..75adb865ef --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unaffected.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.unaffected +// Description:putImageData() is not affected by context state +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() is not affected by context state"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unchanged.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unchanged.html new file mode 100644 index 0000000000..d78fa4e035 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unchanged.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.imageData.put.unchanged + + + + +

2d.imageData.put.unchanged

+

putImageData(getImageData(...), ...) has no effect

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unchanged.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unchanged.worker.js new file mode 100644 index 0000000000..5e9362fab2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.unchanged.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.unchanged +// Description:putImageData(getImageData(...), ...) has no effect +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData(getImageData(...), ...) has no effect"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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)+"\"]"); + } + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.wrongtype.html b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.wrongtype.html new file mode 100644 index 0000000000..1488e7b111 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.wrongtype.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.imageData.put.wrongtype + + + + +

2d.imageData.put.wrongtype

+

putImageData() does not accept non-ImageData objects

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.wrongtype.worker.js b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.wrongtype.worker.js new file mode 100644 index 0000000000..bf4d6dfedf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/pixel-manipulation/2d.imageData.put.wrongtype.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.imageData.put.wrongtype +// Description:putImageData() does not accept non-ImageData objects +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("putImageData() does not accept non-ImageData objects"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var imgdata = { width: 1, height: 1, data: [255, 0, 0, 255] }; + assert_throws_js(TypeError, function() { ctx.putImageData(imgdata, 0, 0); }); + assert_throws_js(TypeError, function() { ctx.putImageData("cheese", 0, 0); }); + assert_throws_js(TypeError, function() { ctx.putImageData(42, 0, 0); }); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.basic.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.basic.html new file mode 100644 index 0000000000..7396ca120a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.basic.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.reset.basic + + + + +

2d.reset.basic

+

reset clears to transparent black

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.basic.worker.js new file mode 100644 index 0000000000..180bffbfac --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.basic.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.basic +// Description:reset clears to transparent black +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("reset clears to transparent black"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height); + ctx.reset(); + _assertPixel(canvas, 0,0, 0,0,0,0); + _assertPixel(canvas, 50,25, 0,0,0,0); + _assertPixel(canvas, 25,50, 0,0,0,0); + _assertPixel(canvas, 100,50, 0,0,0,0); + _assertPixel(canvas, 0,50, 0,0,0,0); + _assertPixel(canvas, 100,0, 0,0,0,0); + t.done(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow-expected.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow-expected.html new file mode 100644 index 0000000000..182f7e40cd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow-expected.html @@ -0,0 +1,14 @@ + + +Canvas test: 2d.reset.render.drop_shadow +

2d.reset.render.drop_shadow

+

check that drop shadows are correctly rendered after reset

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow.html new file mode 100644 index 0000000000..e6decd1687 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow.html @@ -0,0 +1,25 @@ + + + +Canvas test: 2d.reset.render.drop_shadow +

2d.reset.render.drop_shadow

+

check that drop shadows are correctly rendered after reset

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow.w.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow.w.html new file mode 100644 index 0000000000..0ceba2f91d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.drop_shadow.w.html @@ -0,0 +1,39 @@ + + + + +Canvas test: 2d.reset.render.drop_shadow +

2d.reset.render.drop_shadow

+

check that drop shadows are correctly rendered after reset

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation-expected.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation-expected.html new file mode 100644 index 0000000000..1f9d247634 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.reset.render.global_composite_operation +

2d.reset.render.global_composite_operation

+

check that canvas correctly renders rectangles with the default global composite operation after reset

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation.html new file mode 100644 index 0000000000..4ddcc8d8f0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation.html @@ -0,0 +1,23 @@ + + + +Canvas test: 2d.reset.render.global_composite_operation +

2d.reset.render.global_composite_operation

+

check that canvas correctly renders rectangles with the default global composite operation after reset

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation.w.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation.w.html new file mode 100644 index 0000000000..6df07a47e2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.global_composite_operation.w.html @@ -0,0 +1,37 @@ + + + + +Canvas test: 2d.reset.render.global_composite_operation +

2d.reset.render.global_composite_operation

+

check that canvas correctly renders rectangles with the default global composite operation after reset

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line-expected.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line-expected.html new file mode 100644 index 0000000000..dcd648d8c3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line-expected.html @@ -0,0 +1,19 @@ + + +Canvas test: 2d.reset.render.line +

2d.reset.render.line

+

check that lines are correctly rendered after reset

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line.html new file mode 100644 index 0000000000..0e478cbf9d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line.html @@ -0,0 +1,31 @@ + + + +Canvas test: 2d.reset.render.line +

2d.reset.render.line

+

check that lines are correctly rendered after reset

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line.w.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line.w.html new file mode 100644 index 0000000000..e85f155b32 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.line.w.html @@ -0,0 +1,45 @@ + + + + +Canvas test: 2d.reset.render.line +

2d.reset.render.line

+

check that lines are correctly rendered after reset

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc-expected.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc-expected.html new file mode 100644 index 0000000000..c359e6b42e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.reset.render.misc +

2d.reset.render.misc

+

check that canvas correctly renders rectangles after reset (states not covered by other tests)

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc.html new file mode 100644 index 0000000000..b471327d98 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc.html @@ -0,0 +1,26 @@ + + + +Canvas test: 2d.reset.render.misc +

2d.reset.render.misc

+

check that canvas correctly renders rectangles after reset (states not covered by other tests)

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc.w.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc.w.html new file mode 100644 index 0000000000..eef646df66 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.misc.w.html @@ -0,0 +1,40 @@ + + + + +Canvas test: 2d.reset.render.misc +

2d.reset.render.misc

+

check that canvas correctly renders rectangles after reset (states not covered by other tests)

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit-expected.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit-expected.html new file mode 100644 index 0000000000..c91f485c53 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit-expected.html @@ -0,0 +1,22 @@ + + +Canvas test: 2d.reset.render.miter_limit +

2d.reset.render.miter_limit

+

check that the lines are correctly rendered with the default miter limit after reset

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit.html new file mode 100644 index 0000000000..c00284bbc2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit.html @@ -0,0 +1,30 @@ + + + +Canvas test: 2d.reset.render.miter_limit +

2d.reset.render.miter_limit

+

check that the lines are correctly rendered with the default miter limit after reset

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit.w.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit.w.html new file mode 100644 index 0000000000..1f98606b55 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.miter_limit.w.html @@ -0,0 +1,44 @@ + + + + +Canvas test: 2d.reset.render.miter_limit +

2d.reset.render.miter_limit

+

check that the lines are correctly rendered with the default miter limit after reset

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text-expected.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text-expected.html new file mode 100644 index 0000000000..7221483b02 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text-expected.html @@ -0,0 +1,14 @@ + + +Canvas test: 2d.reset.render.text +

2d.reset.render.text

+

check that text is correctly rendered after reset

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text.html new file mode 100644 index 0000000000..31e35db71c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text.html @@ -0,0 +1,31 @@ + + + +Canvas test: 2d.reset.render.text +

2d.reset.render.text

+

check that text is correctly rendered after reset

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text.w.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text.w.html new file mode 100644 index 0000000000..6ddfd9fd9d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.render.text.w.html @@ -0,0 +1,45 @@ + + + + +Canvas test: 2d.reset.render.text +

2d.reset.render.text

+

check that text is correctly rendered after reset

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip-expected.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip-expected.html new file mode 100644 index 0000000000..974b37fab4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip-expected.html @@ -0,0 +1,14 @@ + + +Canvas test: 2d.reset.state.clip +

2d.reset.state.clip

+

check that the clip is reset

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip.html new file mode 100644 index 0000000000..2f53da7a49 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip.html @@ -0,0 +1,26 @@ + + + +Canvas test: 2d.reset.state.clip +

2d.reset.state.clip

+

check that the clip is reset

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip.w.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip.w.html new file mode 100644 index 0000000000..ec4bdf5b23 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.clip.w.html @@ -0,0 +1,40 @@ + + + + +Canvas test: 2d.reset.state.clip +

2d.reset.state.clip

+

check that the clip is reset

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.direction.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.direction.html new file mode 100644 index 0000000000..f2dc299e97 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.direction.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.direction + + + + +

2d.reset.state.direction

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.direction.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.direction.worker.js new file mode 100644 index 0000000000..3d6b835050 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.direction.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.direction +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.direction; + + ctx.direction = 'rtl'; + _assert(ctx.direction == 'rtl', "ctx.direction == 'rtl'"); + + ctx.reset(); + _assert(ctx.direction == default_value, "ctx.direction == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.fill_style.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.fill_style.html new file mode 100644 index 0000000000..1fdd2b773a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.fill_style.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.fill_style + + + + +

2d.reset.state.fill_style

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.fill_style.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.fill_style.worker.js new file mode 100644 index 0000000000..c574824b0a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.fill_style.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.fill_style +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.fillStyle; + + ctx.fillStyle = '#ffffff'; + _assert(ctx.fillStyle == '#ffffff', "ctx.fillStyle == '#ffffff'"); + + ctx.reset(); + _assert(ctx.fillStyle == default_value, "ctx.fillStyle == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.filter.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.filter.html new file mode 100644 index 0000000000..af898c7dd1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.filter.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.filter + + + + +

2d.reset.state.filter

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.filter.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.filter.worker.js new file mode 100644 index 0000000000..f781a9fa34 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.filter.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.filter +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.filter; + + ctx.filter = 'blur(10px)'; + _assert(ctx.filter == 'blur(10px)', "ctx.filter == 'blur(10px)'"); + + ctx.reset(); + _assert(ctx.filter == default_value, "ctx.filter == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font.html new file mode 100644 index 0000000000..69bbf3261e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.font + + + + +

2d.reset.state.font

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font.worker.js new file mode 100644 index 0000000000..ea6f4cc184 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.font +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.font; + + ctx.font = '16px sans-serif'; + _assert(ctx.font == '16px sans-serif', "ctx.font == '16px sans-serif'"); + + ctx.reset(); + _assert(ctx.font == default_value, "ctx.font == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_kerning.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_kerning.html new file mode 100644 index 0000000000..27954486c0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_kerning.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.font_kerning + + + + +

2d.reset.state.font_kerning

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_kerning.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_kerning.worker.js new file mode 100644 index 0000000000..1c21249b9c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_kerning.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.font_kerning +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.fontKerning; + + ctx.fontKerning = 'normal'; + _assert(ctx.fontKerning == 'normal', "ctx.fontKerning == 'normal'"); + + ctx.reset(); + _assert(ctx.fontKerning == default_value, "ctx.fontKerning == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_stretch.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_stretch.html new file mode 100644 index 0000000000..b1e2217320 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_stretch.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.font_stretch + + + + +

2d.reset.state.font_stretch

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_stretch.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_stretch.worker.js new file mode 100644 index 0000000000..71bb6aff48 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_stretch.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.font_stretch +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.fontStretch; + + ctx.fontStretch = 'ultra-condensed'; + _assert(ctx.fontStretch == 'ultra-condensed', "ctx.fontStretch == 'ultra-condensed'"); + + ctx.reset(); + _assert(ctx.fontStretch == default_value, "ctx.fontStretch == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_variant_caps.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_variant_caps.html new file mode 100644 index 0000000000..7d0518c021 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_variant_caps.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.font_variant_caps + + + + +

2d.reset.state.font_variant_caps

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_variant_caps.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_variant_caps.worker.js new file mode 100644 index 0000000000..e89a8bda42 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.font_variant_caps.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.font_variant_caps +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.fontVariantCaps; + + ctx.fontVariantCaps = 'unicase'; + _assert(ctx.fontVariantCaps == 'unicase', "ctx.fontVariantCaps == 'unicase'"); + + ctx.reset(); + _assert(ctx.fontVariantCaps == default_value, "ctx.fontVariantCaps == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_alpha.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_alpha.html new file mode 100644 index 0000000000..fe87aedf84 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_alpha.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.global_alpha + + + + +

2d.reset.state.global_alpha

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_alpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_alpha.worker.js new file mode 100644 index 0000000000..518a8cbb46 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_alpha.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.global_alpha +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.globalAlpha; + + ctx.globalAlpha = 0.5; + _assert(ctx.globalAlpha == 0.5, "ctx.globalAlpha == 0.5"); + + ctx.reset(); + _assert(ctx.globalAlpha == default_value, "ctx.globalAlpha == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_composite_operation.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_composite_operation.html new file mode 100644 index 0000000000..647349c94a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_composite_operation.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.global_composite_operation + + + + +

2d.reset.state.global_composite_operation

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_composite_operation.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_composite_operation.worker.js new file mode 100644 index 0000000000..c94f15b232 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.global_composite_operation.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.global_composite_operation +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.globalCompositeOperation; + + ctx.globalCompositeOperation = 'destination-over'; + _assert(ctx.globalCompositeOperation == 'destination-over', "ctx.globalCompositeOperation == 'destination-over'"); + + ctx.reset(); + _assert(ctx.globalCompositeOperation == default_value, "ctx.globalCompositeOperation == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_enabled.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_enabled.html new file mode 100644 index 0000000000..c0b7f29aca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_enabled.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.image_smoothing_enabled + + + + +

2d.reset.state.image_smoothing_enabled

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_enabled.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_enabled.worker.js new file mode 100644 index 0000000000..7010fb899c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_enabled.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.image_smoothing_enabled +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.imageSmoothingEnabled; + + ctx.imageSmoothingEnabled = false; + _assert(ctx.imageSmoothingEnabled == false, "ctx.imageSmoothingEnabled == false"); + + ctx.reset(); + _assert(ctx.imageSmoothingEnabled == default_value, "ctx.imageSmoothingEnabled == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_quality.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_quality.html new file mode 100644 index 0000000000..12a6367ff9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_quality.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.image_smoothing_quality + + + + +

2d.reset.state.image_smoothing_quality

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_quality.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_quality.worker.js new file mode 100644 index 0000000000..7429666691 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.image_smoothing_quality.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.image_smoothing_quality +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.imageSmoothingQuality; + + ctx.imageSmoothingQuality = 'high'; + _assert(ctx.imageSmoothingQuality == 'high', "ctx.imageSmoothingQuality == 'high'"); + + ctx.reset(); + _assert(ctx.imageSmoothingQuality == default_value, "ctx.imageSmoothingQuality == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.letter_spacing.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.letter_spacing.html new file mode 100644 index 0000000000..addb0c62ad --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.letter_spacing.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.letter_spacing + + + + +

2d.reset.state.letter_spacing

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.letter_spacing.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.letter_spacing.worker.js new file mode 100644 index 0000000000..e0dfae0a8e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.letter_spacing.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.letter_spacing +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.letterSpacing; + + ctx.letterSpacing = '12px'; + _assert(ctx.letterSpacing == '12px', "ctx.letterSpacing == '12px'"); + + ctx.reset(); + _assert(ctx.letterSpacing == default_value, "ctx.letterSpacing == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_cap.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_cap.html new file mode 100644 index 0000000000..9b528b3448 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_cap.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.line_cap + + + + +

2d.reset.state.line_cap

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_cap.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_cap.worker.js new file mode 100644 index 0000000000..c3a94f2cbb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_cap.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.line_cap +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.lineCap; + + ctx.lineCap = 'square'; + _assert(ctx.lineCap == 'square', "ctx.lineCap == 'square'"); + + ctx.reset(); + _assert(ctx.lineCap == default_value, "ctx.lineCap == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash.html new file mode 100644 index 0000000000..fd4edf58cf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.reset.state.line_dash + + + + +

2d.reset.state.line_dash

+

check that the line dash is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash.worker.js new file mode 100644 index 0000000000..841475d876 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.line_dash +// Description:check that the line dash is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the line dash is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.setLineDash([1, 2]); + + ctx.reset(); + _assert(ctx.getLineDash().length == 0, "ctx.getLineDash().length == 0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash_offset.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash_offset.html new file mode 100644 index 0000000000..475db49f82 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash_offset.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.line_dash_offset + + + + +

2d.reset.state.line_dash_offset

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash_offset.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash_offset.worker.js new file mode 100644 index 0000000000..5e0d8dd47c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_dash_offset.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.line_dash_offset +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.lineDashOffset; + + ctx.lineDashOffset = 1.0; + _assert(ctx.lineDashOffset == 1.0, "ctx.lineDashOffset == 1.0"); + + ctx.reset(); + _assert(ctx.lineDashOffset == default_value, "ctx.lineDashOffset == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_join.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_join.html new file mode 100644 index 0000000000..793c1d9bc4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_join.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.line_join + + + + +

2d.reset.state.line_join

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_join.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_join.worker.js new file mode 100644 index 0000000000..9d5e76757b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_join.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.line_join +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.lineJoin; + + ctx.lineJoin = 'bevel'; + _assert(ctx.lineJoin == 'bevel', "ctx.lineJoin == 'bevel'"); + + ctx.reset(); + _assert(ctx.lineJoin == default_value, "ctx.lineJoin == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_width.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_width.html new file mode 100644 index 0000000000..8cdf45f700 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_width.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.line_width + + + + +

2d.reset.state.line_width

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_width.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_width.worker.js new file mode 100644 index 0000000000..1e28f93d66 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.line_width.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.line_width +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.lineWidth; + + ctx.lineWidth = 1; + _assert(ctx.lineWidth == 1, "ctx.lineWidth == 1"); + + ctx.reset(); + _assert(ctx.lineWidth == default_value, "ctx.lineWidth == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.miter_limit.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.miter_limit.html new file mode 100644 index 0000000000..7f47f9a6be --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.miter_limit.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.miter_limit + + + + +

2d.reset.state.miter_limit

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.miter_limit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.miter_limit.worker.js new file mode 100644 index 0000000000..3945a662d4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.miter_limit.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.miter_limit +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.miterLimit; + + ctx.miterLimit = 1.0; + _assert(ctx.miterLimit == 1.0, "ctx.miterLimit == 1.0"); + + ctx.reset(); + _assert(ctx.miterLimit == default_value, "ctx.miterLimit == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_blur.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_blur.html new file mode 100644 index 0000000000..e7075ce102 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_blur.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.shadow_blur + + + + +

2d.reset.state.shadow_blur

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_blur.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_blur.worker.js new file mode 100644 index 0000000000..d82933169d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_blur.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.shadow_blur +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.shadowBlur; + + ctx.shadowBlur = 10.0; + _assert(ctx.shadowBlur == 10.0, "ctx.shadowBlur == 10.0"); + + ctx.reset(); + _assert(ctx.shadowBlur == default_value, "ctx.shadowBlur == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_color.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_color.html new file mode 100644 index 0000000000..ad928acf46 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_color.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.shadow_color + + + + +

2d.reset.state.shadow_color

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_color.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_color.worker.js new file mode 100644 index 0000000000..6ad1e83be2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_color.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.shadow_color +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.shadowColor; + + ctx.shadowColor = '#ff0000'; + _assert(ctx.shadowColor == '#ff0000', "ctx.shadowColor == '#ff0000'"); + + ctx.reset(); + _assert(ctx.shadowColor == default_value, "ctx.shadowColor == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_x.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_x.html new file mode 100644 index 0000000000..e3742e4dbc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_x.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.shadow_offset_x + + + + +

2d.reset.state.shadow_offset_x

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_x.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_x.worker.js new file mode 100644 index 0000000000..4247820a4d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_x.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.shadow_offset_x +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.shadowOffsetX; + + ctx.shadowOffsetX = 10.0; + _assert(ctx.shadowOffsetX == 10.0, "ctx.shadowOffsetX == 10.0"); + + ctx.reset(); + _assert(ctx.shadowOffsetX == default_value, "ctx.shadowOffsetX == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_y.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_y.html new file mode 100644 index 0000000000..64901ef492 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_y.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.shadow_offset_y + + + + +

2d.reset.state.shadow_offset_y

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_y.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_y.worker.js new file mode 100644 index 0000000000..0c1926ebca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.shadow_offset_y.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.shadow_offset_y +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.shadowOffsetY; + + ctx.shadowOffsetY = 10.0; + _assert(ctx.shadowOffsetY == 10.0, "ctx.shadowOffsetY == 10.0"); + + ctx.reset(); + _assert(ctx.shadowOffsetY == default_value, "ctx.shadowOffsetY == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.stroke_style.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.stroke_style.html new file mode 100644 index 0000000000..79803b2828 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.stroke_style.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.stroke_style + + + + +

2d.reset.state.stroke_style

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.stroke_style.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.stroke_style.worker.js new file mode 100644 index 0000000000..99e1eaaed5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.stroke_style.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.stroke_style +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.strokeStyle; + + ctx.strokeStyle = '#ffffff'; + _assert(ctx.strokeStyle == '#ffffff', "ctx.strokeStyle == '#ffffff'"); + + ctx.reset(); + _assert(ctx.strokeStyle == default_value, "ctx.strokeStyle == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_align.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_align.html new file mode 100644 index 0000000000..c1a33d6f3d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_align.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.text_align + + + + +

2d.reset.state.text_align

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_align.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_align.worker.js new file mode 100644 index 0000000000..087d3195e4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_align.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.text_align +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.textAlign; + + ctx.textAlign = 'end'; + _assert(ctx.textAlign == 'end', "ctx.textAlign == 'end'"); + + ctx.reset(); + _assert(ctx.textAlign == default_value, "ctx.textAlign == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_baseline.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_baseline.html new file mode 100644 index 0000000000..acb56e4a00 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_baseline.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.text_baseline + + + + +

2d.reset.state.text_baseline

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_baseline.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_baseline.worker.js new file mode 100644 index 0000000000..9a171326cb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_baseline.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.text_baseline +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.textBaseline; + + ctx.textBaseline = 'middle'; + _assert(ctx.textBaseline == 'middle', "ctx.textBaseline == 'middle'"); + + ctx.reset(); + _assert(ctx.textBaseline == default_value, "ctx.textBaseline == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_rendering.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_rendering.html new file mode 100644 index 0000000000..174dbb3801 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_rendering.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.text_rendering + + + + +

2d.reset.state.text_rendering

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_rendering.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_rendering.worker.js new file mode 100644 index 0000000000..df4cea1044 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.text_rendering.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.text_rendering +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.textRendering; + + ctx.textRendering = 'geometricPrecision'; + _assert(ctx.textRendering == 'geometricPrecision', "ctx.textRendering == 'geometricPrecision'"); + + ctx.reset(); + _assert(ctx.textRendering == default_value, "ctx.textRendering == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.transformation_matrix.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.transformation_matrix.html new file mode 100644 index 0000000000..c30e459b30 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.transformation_matrix.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.reset.state.transformation_matrix + + + + +

2d.reset.state.transformation_matrix

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.transformation_matrix.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.transformation_matrix.worker.js new file mode 100644 index 0000000000..2ae105c20e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.transformation_matrix.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.transformation_matrix +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.scale(2, 2); + + ctx.reset(); + _assert(ctx.getTransform().isIdentity, "ctx.getTransform().isIdentity"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.word_spacing.html b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.word_spacing.html new file mode 100644 index 0000000000..470db2cf98 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.word_spacing.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.reset.state.word_spacing + + + + +

2d.reset.state.word_spacing

+

check that the state is reset

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.word_spacing.worker.js b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.word_spacing.worker.js new file mode 100644 index 0000000000..9e8c717f78 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/reset/2d.reset.state.word_spacing.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.reset.state.word_spacing +// Description:check that the state is reset +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("check that the state is reset"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + const default_value = ctx.wordSpacing; + + ctx.wordSpacing = '12px'; + _assert(ctx.wordSpacing == '12px', "ctx.wordSpacing == '12px'"); + + ctx.reset(); + _assert(ctx.wordSpacing == default_value, "ctx.wordSpacing == default_value"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/set-proprietary-font-names-001-crash.html b/testing/web-platform/tests/html/canvas/offscreen/set-proprietary-font-names-001-crash.html new file mode 100644 index 0000000000..dfa661655e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/set-proprietary-font-names-001-crash.html @@ -0,0 +1,13 @@ + +Setting font of offscreen + + + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.1.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.1.html new file mode 100644 index 0000000000..765cf41b21 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.1.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.shadow.alpha.1 + + + + +

2d.shadow.alpha.1

+

Shadow color alpha components are used

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.1.worker.js new file mode 100644 index 0000000000..869aa017e7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.1.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.alpha.1 +// Description:Shadow color alpha components are used +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadow color alpha components are used"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 4); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.2.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.2.html new file mode 100644 index 0000000000..be2209608f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.2.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.shadow.alpha.2 + + + + +

2d.shadow.alpha.2

+

Shadow color alpha components are used

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.2.png b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.2.png new file mode 100644 index 0000000000..8764e89b37 Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.2.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.2.worker.js new file mode 100644 index 0000000000..dce91f2e4d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.2.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.alpha.2 +// Description:Shadow color alpha components are used +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadow color alpha components are used"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.3.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.3.html new file mode 100644 index 0000000000..7239b3cea7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.3.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.shadow.alpha.3 + + + + +

2d.shadow.alpha.3

+

Shadows are affected by globalAlpha

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.3.png b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.3.png new file mode 100644 index 0000000000..8764e89b37 Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.3.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.3.worker.js new file mode 100644 index 0000000000..93fc665ced --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.3.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.alpha.3 +// Description:Shadows are affected by globalAlpha +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are affected by globalAlpha"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.4.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.4.html new file mode 100644 index 0000000000..468db2a716 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.4.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.shadow.alpha.4 + + + + +

2d.shadow.alpha.4

+

Shadows with alpha components are correctly affected by globalAlpha

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.4.png b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.4.png new file mode 100644 index 0000000000..8764e89b37 Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.4.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.4.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.4.worker.js new file mode 100644 index 0000000000..2be63d3eff --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.4.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.alpha.4 +// Description:Shadows with alpha components are correctly affected by globalAlpha +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows with alpha components are correctly affected by globalAlpha"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.5.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.5.html new file mode 100644 index 0000000000..92ac9717f2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.5.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.shadow.alpha.5 + + + + +

2d.shadow.alpha.5

+

Shadows of shapes with alpha components are drawn correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.5.png b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.5.png new file mode 100644 index 0000000000..8764e89b37 Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.5.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.5.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.5.worker.js new file mode 100644 index 0000000000..016616ac8c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.alpha.5.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.alpha.5 +// Description:Shadows of shapes with alpha components are drawn correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows of shapes with alpha components are drawn correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.initial.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.initial.html new file mode 100644 index 0000000000..21225883df --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.initial.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.shadow.attributes.shadowBlur.initial + + + + +

2d.shadow.attributes.shadowBlur.initial

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.initial.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.initial.worker.js new file mode 100644 index 0000000000..7643f0edfa --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.initial.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.attributes.shadowBlur.initial +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.shadowBlur, 0, "ctx.shadowBlur", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.invalid.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.invalid.html new file mode 100644 index 0000000000..51d1a4a804 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.invalid.html @@ -0,0 +1,53 @@ + + +OffscreenCanvas test: 2d.shadow.attributes.shadowBlur.invalid + + + + +

2d.shadow.attributes.shadowBlur.invalid

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.invalid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.invalid.worker.js new file mode 100644 index 0000000000..2e3a28b789 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.invalid.worker.js @@ -0,0 +1,48 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.attributes.shadowBlur.invalid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + + ctx.shadowBlur = 1; + ctx.shadowBlur = 'string'; + _assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + + ctx.shadowBlur = 1; + ctx.shadowBlur = true; + _assertSame(ctx.shadowBlur, 1, "ctx.shadowBlur", "1"); + + ctx.shadowBlur = 1; + ctx.shadowBlur = false; + _assertSame(ctx.shadowBlur, 0, "ctx.shadowBlur", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.valid.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.valid.html new file mode 100644 index 0000000000..06495f6c31 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.valid.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.shadow.attributes.shadowBlur.valid + + + + +

2d.shadow.attributes.shadowBlur.valid

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.valid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.valid.worker.js new file mode 100644 index 0000000000..d0292edaec --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowBlur.valid.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.attributes.shadowBlur.valid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.initial.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.initial.html new file mode 100644 index 0000000000..92a8bd1500 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.initial.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.shadow.attributes.shadowColor.initial + + + + +

2d.shadow.attributes.shadowColor.initial

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.initial.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.initial.worker.js new file mode 100644 index 0000000000..8b1ec38d7f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.initial.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.attributes.shadowColor.initial +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.shadowColor, 'rgba(0, 0, 0, 0)', "ctx.shadowColor", "'rgba(0, 0, 0, 0)'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.invalid.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.invalid.html new file mode 100644 index 0000000000..ac1d9e7333 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.invalid.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.shadow.attributes.shadowColor.invalid + + + + +

2d.shadow.attributes.shadowColor.invalid

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.invalid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.invalid.worker.js new file mode 100644 index 0000000000..c962f2508d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.invalid.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.attributes.shadowColor.invalid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.valid.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.valid.html new file mode 100644 index 0000000000..340f11f54f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.valid.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.shadow.attributes.shadowColor.valid + + + + +

2d.shadow.attributes.shadowColor.valid

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.valid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.valid.worker.js new file mode 100644 index 0000000000..6d7eb0504d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowColor.valid.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.attributes.shadowColor.valid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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)', "ctx.shadowColor", "'rgba(0, 255, 0, 0)'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.initial.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.initial.html new file mode 100644 index 0000000000..52be5ad532 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.initial.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.shadow.attributes.shadowOffset.initial + + + + +

2d.shadow.attributes.shadowOffset.initial

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.initial.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.initial.worker.js new file mode 100644 index 0000000000..b7b399b371 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.initial.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.attributes.shadowOffset.initial +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.shadowOffsetX, 0, "ctx.shadowOffsetX", "0"); + _assertSame(ctx.shadowOffsetY, 0, "ctx.shadowOffsetY", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.invalid.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.invalid.html new file mode 100644 index 0000000000..d789284b0a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.invalid.html @@ -0,0 +1,67 @@ + + +OffscreenCanvas test: 2d.shadow.attributes.shadowOffset.invalid + + + + +

2d.shadow.attributes.shadowOffset.invalid

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.invalid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.invalid.worker.js new file mode 100644 index 0000000000..9eb89cd581 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.invalid.worker.js @@ -0,0 +1,62 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.attributes.shadowOffset.invalid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + + ctx.shadowOffsetX = 1; + ctx.shadowOffsetY = 2; + ctx.shadowOffsetX = 'string'; + ctx.shadowOffsetY = 'string'; + _assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1"); + _assertSame(ctx.shadowOffsetY, 2, "ctx.shadowOffsetY", "2"); + + ctx.shadowOffsetX = 1; + ctx.shadowOffsetY = 2; + ctx.shadowOffsetX = true; + ctx.shadowOffsetY = true; + _assertSame(ctx.shadowOffsetX, 1, "ctx.shadowOffsetX", "1"); + _assertSame(ctx.shadowOffsetY, 1, "ctx.shadowOffsetY", "1"); + + ctx.shadowOffsetX = 1; + ctx.shadowOffsetY = 2; + ctx.shadowOffsetX = false; + ctx.shadowOffsetY = false; + _assertSame(ctx.shadowOffsetX, 0, "ctx.shadowOffsetX", "0"); + _assertSame(ctx.shadowOffsetY, 0, "ctx.shadowOffsetY", "0"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.valid.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.valid.html new file mode 100644 index 0000000000..82f5f0118d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.valid.html @@ -0,0 +1,50 @@ + + +OffscreenCanvas test: 2d.shadow.attributes.shadowOffset.valid + + + + +

2d.shadow.attributes.shadowOffset.valid

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.valid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.valid.worker.js new file mode 100644 index 0000000000..5881c5bca5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.attributes.shadowOffset.valid.worker.js @@ -0,0 +1,45 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.attributes.shadowOffset.valid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.high-manual.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.high-manual.html new file mode 100644 index 0000000000..46c5032448 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.high-manual.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.shadow.blur.high + + + + +

2d.shadow.blur.high

+

Shadows look correct for large blurs

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.high-manual.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.high-manual.worker.js new file mode 100644 index 0000000000..8bd06da381 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.high-manual.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.blur.high +// Description:Shadows look correct for large blurs +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows look correct for large blurs"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#ff0'; + ctx.fillRect(0, 0, 100, 50); + ctx.shadowColor = '#00f'; + ctx.shadowOffsetY = 0; + ctx.shadowBlur = 100; + ctx.fillRect(-200, -200, 200, 400); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.high.png b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.high.png new file mode 100644 index 0000000000..743640b79f Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.high.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.low-manual.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.low-manual.html new file mode 100644 index 0000000000..19a42a683c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.low-manual.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.shadow.blur.low + + + + +

2d.shadow.blur.low

+

Shadows look correct for small blurs

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.low-manual.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.low-manual.worker.js new file mode 100644 index 0000000000..67bc8c424e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.low-manual.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.blur.low +// Description:Shadows look correct for small blurs +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows look correct for small blurs"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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(); + } + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.low.png b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.low.png new file mode 100644 index 0000000000..99fb651c21 Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.blur.low.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.alpha.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.alpha.html new file mode 100644 index 0000000000..cae4235e8c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.alpha.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.shadow.canvas.alpha + + + + +

2d.shadow.canvas.alpha

+

Shadows are drawn correctly for partially-transparent canvases

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.alpha.png b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.alpha.png new file mode 100644 index 0000000000..8764e89b37 Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.alpha.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.alpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.alpha.worker.js new file mode 100644 index 0000000000..0fa74a2070 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.alpha.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.canvas.alpha +// Description:Shadows are drawn correctly for partially-transparent canvases +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are drawn correctly for partially-transparent canvases"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var canvas2 = new OffscreenCanvas(100, 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.basic.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.basic.html new file mode 100644 index 0000000000..f5784e914f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.basic.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.shadow.canvas.basic + + + + +

2d.shadow.canvas.basic

+

Shadows are drawn for canvases

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.basic.worker.js new file mode 100644 index 0000000000..6a2d916a75 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.basic.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.canvas.basic +// Description:Shadows are drawn for canvases +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are drawn for canvases"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var canvas2 = new OffscreenCanvas(100, 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.1.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.1.html new file mode 100644 index 0000000000..62b3f83272 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.1.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.shadow.canvas.transparent.1 + + + + +

2d.shadow.canvas.transparent.1

+

Shadows are not drawn for transparent canvases

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.1.worker.js new file mode 100644 index 0000000000..1b02897d62 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.1.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.canvas.transparent.1 +// Description:Shadows are not drawn for transparent canvases +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are not drawn for transparent canvases"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var canvas2 = new OffscreenCanvas(100, 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.2.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.2.html new file mode 100644 index 0000000000..0f80453523 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.2.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.shadow.canvas.transparent.2 + + + + +

2d.shadow.canvas.transparent.2

+

Shadows are not drawn for transparent parts of canvases

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.2.worker.js new file mode 100644 index 0000000000..6e468e28e0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.canvas.transparent.2.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.canvas.transparent.2 +// Description:Shadows are not drawn for transparent parts of canvases +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are not drawn for transparent parts of canvases"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var canvas2 = new OffscreenCanvas(100, 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); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.1.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.1.html new file mode 100644 index 0000000000..4df101d513 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.1.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.shadow.clip.1 + + + + +

2d.shadow.clip.1

+

Shadows of clipped shapes are still drawn within the clipping region

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.1.worker.js new file mode 100644 index 0000000000..6b05ceb226 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.1.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.clip.1 +// Description:Shadows of clipped shapes are still drawn within the clipping region +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows of clipped shapes are still drawn within the clipping region"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.2.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.2.html new file mode 100644 index 0000000000..6a09ea53f3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.2.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.shadow.clip.2 + + + + +

2d.shadow.clip.2

+

Shadows are not drawn outside the clipping region

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.2.worker.js new file mode 100644 index 0000000000..4cdfcfdcfc --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.2.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.clip.2 +// Description:Shadows are not drawn outside the clipping region +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are not drawn outside the clipping region"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.3.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.3.html new file mode 100644 index 0000000000..d1732e9f5b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.3.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.shadow.clip.3 + + + + +

2d.shadow.clip.3

+

Shadows of clipped shapes are still drawn within the clipping region

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.3.worker.js new file mode 100644 index 0000000000..6f8b79d1fe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.clip.3.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.clip.3 +// Description:Shadows of clipped shapes are still drawn within the clipping region +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows of clipped shapes are still drawn within the clipping region"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.1.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.1.html new file mode 100644 index 0000000000..d6014fbd45 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.1.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.shadow.composite.1 + + + + +

2d.shadow.composite.1

+

Shadows are drawn using globalCompositeOperation

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.1.worker.js new file mode 100644 index 0000000000..28637706e1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.1.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.composite.1 +// Description:Shadows are drawn using globalCompositeOperation +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are drawn using globalCompositeOperation"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.2.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.2.html new file mode 100644 index 0000000000..87f2e3ba0f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.2.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.shadow.composite.2 + + + + +

2d.shadow.composite.2

+

Shadows are drawn using globalCompositeOperation

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.2.worker.js new file mode 100644 index 0000000000..a144446ec5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.2.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.composite.2 +// Description:Shadows are drawn using globalCompositeOperation +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are drawn using globalCompositeOperation"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.3.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.3.html new file mode 100644 index 0000000000..f3cafa983a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.3.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.shadow.composite.3 + + + + +

2d.shadow.composite.3

+

Areas outside shadows are drawn correctly with destination-out

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.3.worker.js new file mode 100644 index 0000000000..ba29487eea --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.composite.3.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.composite.3 +// Description:Areas outside shadows are drawn correctly with destination-out +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Areas outside shadows are drawn correctly with destination-out"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.blur.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.blur.html new file mode 100644 index 0000000000..a25be8ebcf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.blur.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.shadow.enable.blur + + + + +

2d.shadow.enable.blur

+

Shadows are drawn if shadowBlur is set

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.blur.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.blur.worker.js new file mode 100644 index 0000000000..859ae8b612 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.blur.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.enable.blur +// Description:Shadows are drawn if shadowBlur is set +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are drawn if shadowBlur is set"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.1.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.1.html new file mode 100644 index 0000000000..de85b7366b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.shadow.enable.off.1 + + + + +

2d.shadow.enable.off.1

+

Shadows are not drawn when only shadowColor is set

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.1.worker.js new file mode 100644 index 0000000000..7ccd1351fe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.1.worker.js @@ -0,0 +1,25 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.enable.off.1 +// Description:Shadows are not drawn when only shadowColor is set +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are not drawn when only shadowColor is set"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.shadowColor = '#f00'; + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.2.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.2.html new file mode 100644 index 0000000000..a57cb66aff --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.2.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.shadow.enable.off.2 + + + + +

2d.shadow.enable.off.2

+

Shadows are not drawn when only shadowColor is set

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.2.worker.js new file mode 100644 index 0000000000..e068a7ab54 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.off.2.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.enable.off.2 +// Description:Shadows are not drawn when only shadowColor is set +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are not drawn when only shadowColor is set"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.globalCompositeOperation = 'destination-atop'; + ctx.shadowColor = '#f00'; + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.x.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.x.html new file mode 100644 index 0000000000..70b0a84dcf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.x.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.shadow.enable.x + + + + +

2d.shadow.enable.x

+

Shadows are drawn if shadowOffsetX is set

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.x.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.x.worker.js new file mode 100644 index 0000000000..975c621ffa --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.x.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.enable.x +// Description:Shadows are drawn if shadowOffsetX is set +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are drawn if shadowOffsetX is set"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.y.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.y.html new file mode 100644 index 0000000000..df8bcc2ba2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.y.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.shadow.enable.y + + + + +

2d.shadow.enable.y

+

Shadows are drawn if shadowOffsetY is set

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.y.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.y.worker.js new file mode 100644 index 0000000000..1dae1000a3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.enable.y.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.enable.y +// Description:Shadows are drawn if shadowOffsetY is set +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are drawn if shadowOffsetY is set"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.alpha.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.alpha.html new file mode 100644 index 0000000000..199dd6c3fa --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.alpha.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.shadow.gradient.alpha + + + + +

2d.shadow.gradient.alpha

+

Shadows are drawn correctly for partially-transparent gradient fills

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.alpha.png b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.alpha.png new file mode 100644 index 0000000000..8764e89b37 Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.alpha.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.alpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.alpha.worker.js new file mode 100644 index 0000000000..0f9a6449c4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.alpha.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.gradient.alpha +// Description:Shadows are drawn correctly for partially-transparent gradient fills +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are drawn correctly for partially-transparent gradient fills"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.basic.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.basic.html new file mode 100644 index 0000000000..6746f03f3d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.basic.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.shadow.gradient.basic + + + + +

2d.shadow.gradient.basic

+

Shadows are drawn for gradient fills

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.basic.worker.js new file mode 100644 index 0000000000..068b48bb6f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.basic.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.gradient.basic +// Description:Shadows are drawn for gradient fills +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are drawn for gradient fills"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.1.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.1.html new file mode 100644 index 0000000000..7e7309e976 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.1.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.shadow.gradient.transparent.1 + + + + +

2d.shadow.gradient.transparent.1

+

Shadows are not drawn for transparent gradient fills

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.1.worker.js new file mode 100644 index 0000000000..1102848ecb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.1.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.gradient.transparent.1 +// Description:Shadows are not drawn for transparent gradient fills +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are not drawn for transparent gradient fills"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.2.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.2.html new file mode 100644 index 0000000000..8259eb9ae5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.2.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.shadow.gradient.transparent.2 + + + + +

2d.shadow.gradient.transparent.2

+

Shadows are not drawn for transparent parts of gradient fills

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.2.worker.js new file mode 100644 index 0000000000..5fcf4ee93d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.gradient.transparent.2.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.gradient.transparent.2 +// Description:Shadows are not drawn for transparent parts of gradient fills +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are not drawn for transparent parts of gradient fills"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.html new file mode 100644 index 0000000000..f7f797fd0b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.shadow.image.alpha + + + + +

2d.shadow.image.alpha

+

Shadows are drawn correctly for partially-transparent images

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.png b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.png new file mode 100644 index 0000000000..8764e89b37 Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.worker.js new file mode 100644 index 0000000000..827bd2ce65 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.alpha.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.image.alpha +// Description:Shadows are drawn correctly for partially-transparent images +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.shadowOffsetY = 50; + ctx.shadowColor = '#00f'; + var response = await fetch('/images/transparent50.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + ctx.drawImage(img, 0, -50); + + _assertPixelApprox(canvas, 50,25, 127,0,127,255, 2); + t.done(); +}, "Shadows are drawn correctly for partially-transparent images"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.basic.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.basic.html new file mode 100644 index 0000000000..5b959fdd92 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.basic.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.shadow.image.basic + + + + +

2d.shadow.image.basic

+

Shadows are drawn for images

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.basic.worker.js new file mode 100644 index 0000000000..2d02232c68 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.basic.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.image.basic +// Description:Shadows are drawn for images +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.shadowColor = '#0f0'; + ctx.shadowOffsetY = 50; + var response = await fetch('/images/red.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + ctx.drawImage(img, 0, -50); + + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}, "Shadows are drawn for images"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.scale.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.scale.html new file mode 100644 index 0000000000..7e2536c052 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.scale.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.shadow.image.scale + + + + +

2d.shadow.image.scale

+

Shadows are drawn correctly for scaled images

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.scale.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.scale.worker.js new file mode 100644 index 0000000000..2c10381f98 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.scale.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.image.scale +// Description:Shadows are drawn correctly for scaled images +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.shadowOffsetY = 50; + ctx.shadowColor = '#0f0'; + var response = await fetch('/images/redtransparent.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + ctx.drawImage(img, 0, 0, 100, 50, -10, -50, 240, 50); + + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + t.done(); +}, "Shadows are drawn correctly for scaled images"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.section.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.section.html new file mode 100644 index 0000000000..7744ee153b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.section.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.shadow.image.section + + + + +

2d.shadow.image.section

+

Shadows are not drawn for areas outside image source rectangles

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.section.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.section.worker.js new file mode 100644 index 0000000000..94affdfb6a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.section.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.image.section +// Description:Shadows are not drawn for areas outside image source rectangles +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.shadowOffsetY = 50; + ctx.shadowColor = '#f00'; + var response = await fetch('/images/redtransparent.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + ctx.drawImage(img, 50, 0, 50, 50, 0, -50, 50, 50); + + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 50,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + t.done(); +}, "Shadows are not drawn for areas outside image source rectangles"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.1.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.1.html new file mode 100644 index 0000000000..30db23ce76 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.1.html @@ -0,0 +1,30 @@ + + +OffscreenCanvas test: 2d.shadow.image.transparent.1 + + + + +

2d.shadow.image.transparent.1

+

Shadows are not drawn for transparent images

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.1.worker.js new file mode 100644 index 0000000000..c5421d7042 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.1.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.image.transparent.1 +// Description:Shadows are not drawn for transparent images +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 100, 50); + ctx.shadowColor = '#f00'; + ctx.shadowOffsetY = 50; + var response = await fetch('/images/transparent.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + ctx.drawImage(img, 0, -50); + + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}, "Shadows are not drawn for transparent images"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.2.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.2.html new file mode 100644 index 0000000000..9b3b206a26 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.2.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.shadow.image.transparent.2 + + + + +

2d.shadow.image.transparent.2

+

Shadows are not drawn for transparent parts of images

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.2.worker.js new file mode 100644 index 0000000000..071c584fa8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.image.transparent.2.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.image.transparent.2 +// Description:Shadows are not drawn for transparent parts of images +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#0f0'; + ctx.fillRect(0, 0, 50, 50); + ctx.fillStyle = '#f00'; + ctx.fillRect(50, 0, 50, 50); + ctx.shadowOffsetY = 50; + ctx.shadowColor = '#0f0'; + var response = await fetch('/images/redtransparent.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + ctx.drawImage(img, 50, -50); + ctx.shadowColor = '#f00'; + ctx.drawImage(img, -50, -50); + + _assertPixel(canvas, 25,25, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}, "Shadows are not drawn for transparent parts of images"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeX.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeX.html new file mode 100644 index 0000000000..cc0d1adb97 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeX.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.shadow.offset.negativeX + + + + +

2d.shadow.offset.negativeX

+

Shadows can be offset with negative x

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeX.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeX.worker.js new file mode 100644 index 0000000000..14c709a2a0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeX.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.offset.negativeX +// Description:Shadows can be offset with negative x +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows can be offset with negative x"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeY.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeY.html new file mode 100644 index 0000000000..82094cf2f9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeY.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.shadow.offset.negativeY + + + + +

2d.shadow.offset.negativeY

+

Shadows can be offset with negative y

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeY.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeY.worker.js new file mode 100644 index 0000000000..036c6154cb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.negativeY.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.offset.negativeY +// Description:Shadows can be offset with negative y +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows can be offset with negative y"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,37, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveX.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveX.html new file mode 100644 index 0000000000..7094e98ecf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveX.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.shadow.offset.positiveX + + + + +

2d.shadow.offset.positiveX

+

Shadows can be offset with positive x

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveX.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveX.worker.js new file mode 100644 index 0000000000..176aca45f4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveX.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.offset.positiveX +// Description:Shadows can be offset with positive x +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows can be offset with positive x"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveY.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveY.html new file mode 100644 index 0000000000..75e9b0affa --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveY.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.shadow.offset.positiveY + + + + +

2d.shadow.offset.positiveY

+

Shadows can be offset with positive y

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveY.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveY.worker.js new file mode 100644 index 0000000000..6b4d0c6a21 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.offset.positiveY.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.offset.positiveY +// Description:Shadows can be offset with positive y +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows can be offset with positive y"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,37, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.outside.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.outside.html new file mode 100644 index 0000000000..498051465b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.outside.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.shadow.outside + + + + +

2d.shadow.outside

+

Shadows of shapes outside the visible area can be offset onto the visible area

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.outside.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.outside.worker.js new file mode 100644 index 0000000000..d2a071f474 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.outside.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.outside +// Description:Shadows of shapes outside the visible area can be offset onto the visible area +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows of shapes outside the visible area can be offset onto the visible area"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 87,25, 0,255,0,255); + _assertPixel(canvas, 50,12, 0,255,0,255); + _assertPixel(canvas, 50,37, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.html new file mode 100644 index 0000000000..c45654f999 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.shadow.pattern.alpha + + + + +

2d.shadow.pattern.alpha

+

Shadows are drawn correctly for partially-transparent fill patterns

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.png b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.png new file mode 100644 index 0000000000..8764e89b37 Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.worker.js new file mode 100644 index 0000000000..41a826a158 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.alpha.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.pattern.alpha +// Description:Shadows are drawn correctly for partially-transparent fill patterns +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var response = await fetch('/images/transparent50.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + var pattern = ctx.createPattern(img, '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, 2); + t.done(); +}, "Shadows are drawn correctly for partially-transparent fill patterns"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.basic.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.basic.html new file mode 100644 index 0000000000..4e372c0932 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.basic.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.shadow.pattern.basic + + + + +

2d.shadow.pattern.basic

+

Shadows are drawn for fill patterns

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.basic.worker.js new file mode 100644 index 0000000000..7a8f7e8479 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.basic.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.pattern.basic +// Description:Shadows are drawn for fill patterns +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var response = await fetch('/images/red.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + var pattern = ctx.createPattern(img, '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); + t.done(); +}, "Shadows are drawn for fill patterns"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.1.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.1.html new file mode 100644 index 0000000000..72fa7b29f8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.1.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.shadow.pattern.transparent.1 + + + + +

2d.shadow.pattern.transparent.1

+

Shadows are not drawn for transparent fill patterns

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.1.worker.js new file mode 100644 index 0000000000..8414db6d08 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.1.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.pattern.transparent.1 +// Description:Shadows are not drawn for transparent fill patterns +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var response = await fetch('/images/transparent.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + var pattern = ctx.createPattern(img, '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); + t.done(); +}, "Shadows are not drawn for transparent fill patterns"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.2.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.2.html new file mode 100644 index 0000000000..6ad8ece009 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.2.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.shadow.pattern.transparent.2 + + + + +

2d.shadow.pattern.transparent.2

+

Shadows are not drawn for transparent parts of fill patterns

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.2.worker.js new file mode 100644 index 0000000000..726a42d6cd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.pattern.transparent.2.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.pattern.transparent.2 +// Description:Shadows are not drawn for transparent parts of fill patterns +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var response = await fetch('/images/redtransparent.png') + var blob = await response.blob(); + var img = await createImageBitmap(blob); + var pattern = ctx.createPattern(img, '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); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}, "Shadows are not drawn for transparent parts of fill patterns"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.basic.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.basic.html new file mode 100644 index 0000000000..c569865a60 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.basic.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.shadow.stroke.basic + + + + +

2d.shadow.stroke.basic

+

Shadows are drawn for strokes

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.basic.worker.js new file mode 100644 index 0000000000..9d7d0ec321 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.basic.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.stroke.basic +// Description:Shadows are drawn for strokes +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are drawn for strokes"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 98,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.1.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.1.html new file mode 100644 index 0000000000..b170f88cf6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.1.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.shadow.stroke.cap.1 + + + + +

2d.shadow.stroke.cap.1

+

Shadows are not drawn for areas outside stroke caps

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.1.worker.js new file mode 100644 index 0000000000..582915d28b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.1.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.stroke.cap.1 +// Description:Shadows are not drawn for areas outside stroke caps +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are not drawn for areas outside stroke caps"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 98,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.2.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.2.html new file mode 100644 index 0000000000..8bbb016bd5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.2.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.shadow.stroke.cap.2 + + + + +

2d.shadow.stroke.cap.2

+

Shadows are drawn for stroke caps

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.2.worker.js new file mode 100644 index 0000000000..13108bec9e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.cap.2.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.stroke.cap.2 +// Description:Shadows are drawn for stroke caps +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are drawn for stroke caps"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 98,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.1.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.1.html new file mode 100644 index 0000000000..f0ef2d250e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.1.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.shadow.stroke.join.1 + + + + +

2d.shadow.stroke.join.1

+

Shadows are not drawn for areas outside stroke joins

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.1.worker.js new file mode 100644 index 0000000000..0cc1b5f196 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.1.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.stroke.join.1 +// Description:Shadows are not drawn for areas outside stroke joins +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are not drawn for areas outside stroke joins"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 48,48, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.2.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.2.html new file mode 100644 index 0000000000..f2800aa19a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.2.html @@ -0,0 +1,45 @@ + + +OffscreenCanvas test: 2d.shadow.stroke.join.2 + + + + +

2d.shadow.stroke.join.2

+

Shadows are drawn for stroke joins

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.2.worker.js new file mode 100644 index 0000000000..925f65a28e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.2.worker.js @@ -0,0 +1,40 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.stroke.join.2 +// Description:Shadows are drawn for stroke joins +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are drawn for stroke joins"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 48,48, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.3.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.3.html new file mode 100644 index 0000000000..390e6a8048 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.3.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.shadow.stroke.join.3 + + + + +

2d.shadow.stroke.join.3

+

Shadows are drawn for stroke joins respecting miter limit

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.3.worker.js new file mode 100644 index 0000000000..827a6d6662 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.stroke.join.3.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.stroke.join.3 +// Description:Shadows are drawn for stroke joins respecting miter limit +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows are drawn for stroke joins respecting miter limit"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 48,48, 0,255,0,255); + _assertPixel(canvas, 50,25, 0,255,0,255); + _assertPixel(canvas, 98,48, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.1.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.1.html new file mode 100644 index 0000000000..23946b20a5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.1.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.shadow.transform.1 + + + + +

2d.shadow.transform.1

+

Shadows take account of transformations

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.1.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.1.worker.js new file mode 100644 index 0000000000..6ac8da4c97 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.1.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.transform.1 +// Description:Shadows take account of transformations +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadows take account of transformations"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.2.html b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.2.html new file mode 100644 index 0000000000..edcd20bdca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.2.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.shadow.transform.2 + + + + +

2d.shadow.transform.2

+

Shadow offsets are not affected by transformations

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.2.worker.js new file mode 100644 index 0000000000..e9e745a2ab --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/shadows/2d.shadow.transform.2.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.shadow.transform.2 +// Description:Shadow offsets are not affected by transformations +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Shadow offsets are not affected by transformations"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.default.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.default.html new file mode 100644 index 0000000000..7af2c772f0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.default.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.text.align.default + + + + +

2d.text.align.default

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.default.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.default.worker.js new file mode 100644 index 0000000000..adee16c062 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.default.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.align.default +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.textAlign, 'start', "ctx.textAlign", "'start'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.invalid.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.invalid.html new file mode 100644 index 0000000000..a7679d656e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.invalid.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.text.align.invalid + + + + +

2d.text.align.invalid

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.invalid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.invalid.worker.js new file mode 100644 index 0000000000..dfd4c66256 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.invalid.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.align.invalid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.valid.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.valid.html new file mode 100644 index 0000000000..eef6b29633 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.valid.html @@ -0,0 +1,40 @@ + + +OffscreenCanvas test: 2d.text.align.valid + + + + +

2d.text.align.valid

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.valid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.valid.worker.js new file mode 100644 index 0000000000..767d6425e7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.align.valid.worker.js @@ -0,0 +1,35 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.align.valid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.default.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.default.html new file mode 100644 index 0000000000..525a02ff9b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.default.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.text.baseline.default + + + + +

2d.text.baseline.default

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.default.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.default.worker.js new file mode 100644 index 0000000000..667adb8c51 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.default.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.baseline.default +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.textBaseline, 'alphabetic', "ctx.textBaseline", "'alphabetic'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.invalid.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.invalid.html new file mode 100644 index 0000000000..f30fad63b5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.invalid.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.text.baseline.invalid + + + + +

2d.text.baseline.invalid

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.invalid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.invalid.worker.js new file mode 100644 index 0000000000..4310f81fba --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.invalid.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.baseline.invalid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.valid.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.valid.html new file mode 100644 index 0000000000..9ff843c19f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.valid.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.text.baseline.valid + + + + +

2d.text.baseline.valid

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.valid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.valid.worker.js new file mode 100644 index 0000000000..2f422f58a8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.baseline.valid.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.baseline.valid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.center.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.center.html new file mode 100644 index 0000000000..0f7a2f4a02 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.center.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.text.draw.align.center + + + + +

2d.text.draw.align.center

+

textAlign center is the center of the em squares (not the bounding box)

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.center.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.center.worker.js new file mode 100644 index 0000000000..44f093cdac --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.center.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.align.center +// Description:textAlign center is the center of the em squares (not the bounding box) +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 5,45, 0,255,0,255, 2); + _assertPixelApprox(canvas, 95,45, 0,255,0,255, 2); + t.done(); +}, "textAlign center is the center of the em squares (not the bounding box)"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.ltr.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.ltr.html new file mode 100644 index 0000000000..a9e6dfe901 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.ltr.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.text.draw.align.end.ltr + + + + +

2d.text.draw.align.end.ltr

+

textAlign end with ltr is the right edge

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.ltr.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.ltr.worker.js new file mode 100644 index 0000000000..4bd0f5a314 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.ltr.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.align.end.ltr +// Description:textAlign end with ltr is the right edge +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + ctx.direction = 'ltr'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 5,45, 0,255,0,255, 2); + _assertPixelApprox(canvas, 95,45, 0,255,0,255, 2); + t.done(); +}, "textAlign end with ltr is the right edge"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.rtl.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.rtl.html new file mode 100644 index 0000000000..b0d0b66a9c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.rtl.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.text.draw.align.end.rtl + + + + +

2d.text.draw.align.end.rtl

+

textAlign end with rtl is the left edge

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.rtl.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.rtl.worker.js new file mode 100644 index 0000000000..b3e62d8538 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.end.rtl.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.align.end.rtl +// Description:textAlign end with rtl is the left edge +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + ctx.direction = 'rtl'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 5,45, 0,255,0,255, 2); + _assertPixelApprox(canvas, 95,45, 0,255,0,255, 2); + t.done(); +}, "textAlign end with rtl is the left edge"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.left.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.left.html new file mode 100644 index 0000000000..563596d757 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.left.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.text.draw.align.left + + + + +

2d.text.draw.align.left

+

textAlign left is the left of the first em square (not the bounding box)

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.left.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.left.worker.js new file mode 100644 index 0000000000..c7dc0bed42 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.left.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.align.left +// Description:textAlign left is the left of the first em square (not the bounding box) +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 5,45, 0,255,0,255, 2); + _assertPixelApprox(canvas, 95,45, 0,255,0,255, 2); + t.done(); +}, "textAlign left is the left of the first em square (not the bounding box)"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.right.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.right.html new file mode 100644 index 0000000000..227a8f981f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.right.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.text.draw.align.right + + + + +

2d.text.draw.align.right

+

textAlign right is the right of the last em square (not the bounding box)

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.right.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.right.worker.js new file mode 100644 index 0000000000..58fe85e0b7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.right.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.align.right +// Description:textAlign right is the right of the last em square (not the bounding box) +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 5,45, 0,255,0,255, 2); + _assertPixelApprox(canvas, 95,45, 0,255,0,255, 2); + t.done(); +}, "textAlign right is the right of the last em square (not the bounding box)"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.ltr.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.ltr.html new file mode 100644 index 0000000000..bd7e69451d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.ltr.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.text.draw.align.start.ltr + + + + +

2d.text.draw.align.start.ltr

+

textAlign start with ltr is the left edge

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.ltr.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.ltr.worker.js new file mode 100644 index 0000000000..c0793d9af6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.ltr.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.align.start.ltr +// Description:textAlign start with ltr is the left edge +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + ctx.direction = 'ltr'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 5,45, 0,255,0,255, 2); + _assertPixelApprox(canvas, 95,45, 0,255,0,255, 2); + t.done(); +}, "textAlign start with ltr is the left edge"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.rtl.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.rtl.html new file mode 100644 index 0000000000..cadc8a4644 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.rtl.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.text.draw.align.start.rtl + + + + +

2d.text.draw.align.start.rtl

+

textAlign start with rtl is the right edge

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.rtl.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.rtl.worker.js new file mode 100644 index 0000000000..ed706c287a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.align.start.rtl.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.align.start.rtl +// Description:textAlign start with rtl is the right edge +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + ctx.direction = 'rtl'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 5,45, 0,255,0,255, 2); + _assertPixelApprox(canvas, 95,45, 0,255,0,255, 2); + t.done(); +}, "textAlign start with rtl is the right edge"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.alphabetic.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.alphabetic.html new file mode 100644 index 0000000000..ff72b3219d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.alphabetic.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.text.draw.baseline.alphabetic + + + + +

2d.text.draw.baseline.alphabetic

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.alphabetic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.alphabetic.worker.js new file mode 100644 index 0000000000..a98a5863d9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.alphabetic.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.baseline.alphabetic +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 5,45, 0,255,0,255, 2); + _assertPixelApprox(canvas, 95,45, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.html new file mode 100644 index 0000000000..f75a94243d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.text.draw.baseline.bottom + + + + +

2d.text.draw.baseline.bottom

+

textBaseline bottom is the bottom of the em square (not the bounding box)

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.worker.js new file mode 100644 index 0000000000..30f60c574b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.bottom.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.baseline.bottom +// Description:textBaseline bottom is the bottom of the em square (not the bounding box) +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 5,45, 0,255,0,255, 2); + _assertPixelApprox(canvas, 95,45, 0,255,0,255, 2); + t.done(); +}, "textBaseline bottom is the bottom of the em square (not the bounding box)"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.hanging.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.hanging.html new file mode 100644 index 0000000000..a29db78385 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.hanging.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.text.draw.baseline.hanging + + + + +

2d.text.draw.baseline.hanging

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.hanging.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.hanging.worker.js new file mode 100644 index 0000000000..638506a279 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.hanging.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.baseline.hanging +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 5,45, 0,255,0,255, 2); + _assertPixelApprox(canvas, 95,45, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.html new file mode 100644 index 0000000000..6bda1b4f30 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.text.draw.baseline.ideographic + + + + +

2d.text.draw.baseline.ideographic

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker.js new file mode 100644 index 0000000000..7c682fb5f1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.ideographic.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.baseline.ideographic +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 5,45, 0,255,0,255, 2); + _assertPixelApprox(canvas, 95,45, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.html new file mode 100644 index 0000000000..b0186e6549 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.text.draw.baseline.middle + + + + +

2d.text.draw.baseline.middle

+

textBaseline middle is the middle of the em square (not the bounding box)

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.worker.js new file mode 100644 index 0000000000..c373ab6c72 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.middle.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.baseline.middle +// Description:textBaseline middle is the middle of the em square (not the bounding box) +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 5,45, 0,255,0,255, 2); + _assertPixelApprox(canvas, 95,45, 0,255,0,255, 2); + t.done(); +}, "textBaseline middle is the middle of the em square (not the bounding box)"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.html new file mode 100644 index 0000000000..163d27dec7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.text.draw.baseline.top + + + + +

2d.text.draw.baseline.top

+

textBaseline top is the top of the em square (not the bounding box)

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.worker.js new file mode 100644 index 0000000000..effc4418c3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.baseline.top.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.baseline.top +// Description:textBaseline top is the top of the em square (not the bounding box) +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 5,45, 0,255,0,255, 2); + _assertPixelApprox(canvas, 95,45, 0,255,0,255, 2); + t.done(); +}, "textBaseline top is the top of the em square (not the bounding box)"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.basic-manual.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.basic-manual.html new file mode 100644 index 0000000000..af1cb9d94a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.basic-manual.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.text.draw.fill.basic + + + + +

2d.text.draw.fill.basic

+

fillText draws filled text

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.basic-manual.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.basic-manual.worker.js new file mode 100644 index 0000000000..ef00236fbb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.basic-manual.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.fill.basic +// Description:fillText draws filled text +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillText draws filled text"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.basic.png b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.basic.png new file mode 100644 index 0000000000..70d7b046cb Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.basic.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.NaN.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.NaN.html new file mode 100644 index 0000000000..8f22b9f093 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.NaN.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.text.draw.fill.maxWidth.NaN + + + + +

2d.text.draw.fill.maxWidth.NaN

+

fillText handles maxWidth correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.NaN.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.NaN.worker.js new file mode 100644 index 0000000000..fd1dff136e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.NaN.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.fill.maxWidth.NaN +// Description:fillText handles maxWidth correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillText handles maxWidth correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, NaN); + _assertGreen(ctx, 100, 50); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.html new file mode 100644 index 0000000000..2dca5a75ef --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.text.draw.fill.maxWidth.bound + + + + +

2d.text.draw.fill.maxWidth.bound

+

fillText handles maxWidth based on line size, not bounding box size

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.worker.js new file mode 100644 index 0000000000..adcb45faaa --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.bound.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.fill.maxWidth.bound +// Description:fillText handles maxWidth based on line size, not bounding box size +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + t.done(); +}, "fillText handles maxWidth based on line size, not bounding box size"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.fontface.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.fontface.html new file mode 100644 index 0000000000..fa7277ed7a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.fontface.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.text.draw.fill.maxWidth.fontface + + + + +

2d.text.draw.fill.maxWidth.fontface

+

fillText works on @font-face fonts

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.fontface.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.fontface.worker.js new file mode 100644 index 0000000000..8df519b7d1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.fontface.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.fill.maxWidth.fontface +// Description:fillText works on @font-face fonts +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + t.done(); +}, "fillText works on @font-face fonts"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.large-manual.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.large-manual.html new file mode 100644 index 0000000000..7a0cf11b39 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.large-manual.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.text.draw.fill.maxWidth.large + + + + +

2d.text.draw.fill.maxWidth.large

+

fillText handles maxWidth correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.large-manual.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.large-manual.worker.js new file mode 100644 index 0000000000..3e200e89ed --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.large-manual.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.fill.maxWidth.large +// Description:fillText handles maxWidth correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillText handles maxWidth correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#000'; + ctx.fillRect(0, 0, 100, 50); + ctx.fillStyle = '#0f0'; + ctx.font = '35px Arial, sans-serif'; + ctx.fillText('PASS', 5, 35, 200); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.large.png b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.large.png new file mode 100644 index 0000000000..70d7b046cb Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.large.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.negative.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.negative.html new file mode 100644 index 0000000000..4411fbfced --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.negative.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.text.draw.fill.maxWidth.negative + + + + +

2d.text.draw.fill.maxWidth.negative

+

fillText handles maxWidth correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.negative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.negative.worker.js new file mode 100644 index 0000000000..50076b524c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.negative.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.fill.maxWidth.negative +// Description:fillText handles maxWidth correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillText handles maxWidth correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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, -1); + _assertGreen(ctx, 100, 50); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.small.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.small.html new file mode 100644 index 0000000000..94988fc92e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.small.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.text.draw.fill.maxWidth.small + + + + +

2d.text.draw.fill.maxWidth.small

+

fillText handles maxWidth correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.small.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.small.worker.js new file mode 100644 index 0000000000..5d5ef4e391 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.small.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.fill.maxWidth.small +// Description:fillText handles maxWidth correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillText handles maxWidth correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertGreen(ctx, 100, 50); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.zero.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.zero.html new file mode 100644 index 0000000000..a789a84dbe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.zero.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.text.draw.fill.maxWidth.zero + + + + +

2d.text.draw.fill.maxWidth.zero

+

fillText handles maxWidth correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.zero.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.zero.worker.js new file mode 100644 index 0000000000..7dea281f98 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.maxWidth.zero.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.fill.maxWidth.zero +// Description:fillText handles maxWidth correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillText handles maxWidth correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertGreen(ctx, 100, 50); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.rtl-manual.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.rtl-manual.html new file mode 100644 index 0000000000..98e329b054 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.rtl-manual.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.text.draw.fill.rtl + + + + +

2d.text.draw.fill.rtl

+

fillText respects Right-To-Left Override characters

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.rtl-manual.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.rtl-manual.worker.js new file mode 100644 index 0000000000..ee24a0450f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.rtl-manual.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.fill.rtl +// Description:fillText respects Right-To-Left Override characters +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillText respects Right-To-Left Override characters"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.rtl.png b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.rtl.png new file mode 100644 index 0000000000..70d7b046cb Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.rtl.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.unaffected.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.unaffected.html new file mode 100644 index 0000000000..7124c6eafd --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.unaffected.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.text.draw.fill.unaffected + + + + +

2d.text.draw.fill.unaffected

+

fillText does not start a new path or subpath

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.unaffected.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.unaffected.worker.js new file mode 100644 index 0000000000..0e250286d4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fill.unaffected.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.fill.unaffected +// Description:fillText does not start a new path or subpath +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("fillText does not start a new path or subpath"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 5,45, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.html new file mode 100644 index 0000000000..5d4f93b4f3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.text.draw.fontface + + + + +

2d.text.draw.fontface

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.notinpage.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.notinpage.html new file mode 100644 index 0000000000..82c9b31e66 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.notinpage.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.text.draw.fontface.notinpage + + + + +

2d.text.draw.fontface.notinpage

+

@font-face fonts should work even if they are not used in the page

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.notinpage.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.notinpage.worker.js new file mode 100644 index 0000000000..628cb39506 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.notinpage.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.fontface.notinpage +// Description:@font-face fonts should work even if they are not used in the page +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '67px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + t.done(); +}, "@font-face fonts should work even if they are not used in the page"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.repeat.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.repeat.html new file mode 100644 index 0000000000..1a6ba78fb9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.repeat.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.text.draw.fontface.repeat + + + + +

2d.text.draw.fontface.repeat

+

Draw with the font immediately, then wait a bit until and draw again. (This crashes some version of WebKit.)

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.repeat.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.repeat.worker.js new file mode 100644 index 0000000000..7567c09558 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.repeat.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.fontface.repeat +// Description:Draw with the font immediately, then wait a bit until and draw again. (This crashes some version of WebKit.) +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.font = '67px CanvasTest'; + ctx.fillStyle = '#0f0'; + ctx.fillText('AA', 0, 50); + + await new Promise(resolve => t.step_timeout(resolve, 500)); + ctx.fillText('AA', 0, 50); + _assertPixelApprox(canvas, 5,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + t.done(); +}, "Draw with the font immediately, then wait a bit until and draw again. (This crashes some version of WebKit.)"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.worker.js new file mode 100644 index 0000000000..02257f0a06 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.fontface.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.fontface +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '67px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 95,5, 0,255,0,255, 2); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + t.done(); +}, ""); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.kern.consistent-manual.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.kern.consistent-manual.html new file mode 100644 index 0000000000..de456a2b96 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.kern.consistent-manual.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.text.draw.kern.consistent + + + + +

2d.text.draw.kern.consistent

+

Stroked and filled text should have exactly the same kerning so it overlaps

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.kern.consistent-manual.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.kern.consistent-manual.worker.js new file mode 100644 index 0000000000..0d1c9470ee --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.kern.consistent-manual.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.kern.consistent +// Description:Stroked and filled text should have exactly the same kerning so it overlaps +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Stroked and filled text should have exactly the same kerning so it overlaps"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.basic.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.basic.html new file mode 100644 index 0000000000..55828fc72c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.basic.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.text.draw.space.basic + + + + +

2d.text.draw.space.basic

+

U+0020 is rendered the correct size (1em wide)

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.basic.worker.js new file mode 100644 index 0000000000..ef09925c55 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.basic.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.space.basic +// Description:U+0020 is rendered the correct size (1em wide) +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + t.done(); +}, "U+0020 is rendered the correct size (1em wide)"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.end.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.end.html new file mode 100644 index 0000000000..f00a187e23 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.end.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.text.draw.space.collapse.end + + + + +

2d.text.draw.space.collapse.end

+

Space characters at the end of a line are NOT collapsed

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.end.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.end.worker.js new file mode 100644 index 0000000000..9a9afa1e74 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.end.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.space.collapse.end +// Description:Space characters at the end of a line are NOT collapsed +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 75,25, 255,0,0,255, 2); + t.done(); +}, "Space characters at the end of a line are NOT collapsed"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.nonspace.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.nonspace.html new file mode 100644 index 0000000000..792abe4deb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.nonspace.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.text.draw.space.collapse.nonspace + + + + +

2d.text.draw.space.collapse.nonspace

+

Non-space characters are not converted to U+0020 and collapsed

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.nonspace.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.nonspace.worker.js new file mode 100644 index 0000000000..a12c2f9a48 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.nonspace.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.space.collapse.nonspace +// Description:Non-space characters are not converted to U+0020 and collapsed +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + 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, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + t.done(); +}, "Non-space characters are not converted to U+0020 and collapsed"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.other.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.other.html new file mode 100644 index 0000000000..83e89270f9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.other.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.text.draw.space.collapse.other + + + + +

2d.text.draw.space.collapse.other

+

Space characters are converted to U+0020, and are NOT collapsed

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.other.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.other.worker.js new file mode 100644 index 0000000000..bbf9e684be --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.other.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.space.collapse.other +// Description:Space characters are converted to U+0020, and are NOT collapsed +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.fillStyle = '#0f0'; + ctx.fillText('E \x09\x0a\x0c\x0d \x09\x0a\x0c\x0dEE', 0, 37.5); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 255,0,0,255, 2); + t.done(); +}, "Space characters are converted to U+0020, and are NOT collapsed"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.space.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.space.html new file mode 100644 index 0000000000..5fc96ffd7d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.space.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.text.draw.space.collapse.space + + + + +

2d.text.draw.space.collapse.space

+

Space characters are converted to U+0020, and are NOT collapsed

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.space.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.space.worker.js new file mode 100644 index 0000000000..e5ab7b67f4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.space.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.space.collapse.space +// Description:Space characters are converted to U+0020, and are NOT collapsed +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.fillStyle = '#0f0'; + ctx.fillText('E EE', 0, 37.5); + _assertPixelApprox(canvas, 25,25, 0,255,0,255, 2); + _assertPixelApprox(canvas, 75,25, 255,0,0,255, 2); + t.done(); +}, "Space characters are converted to U+0020, and are NOT collapsed"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.start.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.start.html new file mode 100644 index 0000000000..c07994360d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.start.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.text.draw.space.collapse.start + + + + +

2d.text.draw.space.collapse.start

+

Space characters at the start of a line are NOT collapsed

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.start.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.start.worker.js new file mode 100644 index 0000000000..20fec7801f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.space.collapse.start.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.space.collapse.start +// Description:Space characters at the start of a line are NOT collapsed +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + ctx.fillStyle = '#0f0'; + ctx.fillText(' EE', 0, 37.5); + _assertPixelApprox(canvas, 25,25, 255,0,0,255, 2); + _assertPixelApprox(canvas, 75,25, 0,255,0,255, 2); + t.done(); +}, "Space characters at the start of a line are NOT collapsed"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.basic-manual.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.basic-manual.html new file mode 100644 index 0000000000..62ac8884cb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.basic-manual.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.text.draw.stroke.basic + + + + +

2d.text.draw.stroke.basic

+

strokeText draws stroked text

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.basic-manual.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.basic-manual.worker.js new file mode 100644 index 0000000000..33d6e32467 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.basic-manual.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.stroke.basic +// Description:strokeText draws stroked text +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("strokeText draws stroked text"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.basic.png b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.basic.png new file mode 100644 index 0000000000..fb3b5b830d Binary files /dev/null and b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.basic.png differ diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.unaffected.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.unaffected.html new file mode 100644 index 0000000000..76afc1b006 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.unaffected.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.text.draw.stroke.unaffected + + + + +

2d.text.draw.stroke.unaffected

+

strokeText does not start a new path or subpath

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.unaffected.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.unaffected.worker.js new file mode 100644 index 0000000000..15c3b61700 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.draw.stroke.unaffected.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.draw.stroke.unaffected +// Description:strokeText does not start a new path or subpath +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("strokeText does not start a new path or subpath"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 5,45, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.absolute.spacing.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.absolute.spacing.html new file mode 100644 index 0000000000..965d451020 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.absolute.spacing.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.absolute.spacing + + + + +

2d.text.drawing.style.absolute.spacing

+

Testing letter spacing and word spacing with absolute length

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.absolute.spacing.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.absolute.spacing.worker.js new file mode 100644 index 0000000000..2b42b3e477 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.absolute.spacing.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.absolute.spacing +// Description:Testing letter spacing and word spacing with absolute length +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Testing letter spacing and word spacing with absolute length"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.letterSpacing, '0px', "ctx.letterSpacing", "'0px'"); + _assertSame(ctx.wordSpacing, '0px', "ctx.wordSpacing", "'0px'"); + + ctx.letterSpacing = '3px'; + _assertSame(ctx.letterSpacing, '3px', "ctx.letterSpacing", "'3px'"); + _assertSame(ctx.wordSpacing, '0px', "ctx.wordSpacing", "'0px'"); + + ctx.wordSpacing = '5px'; + _assertSame(ctx.letterSpacing, '3px', "ctx.letterSpacing", "'3px'"); + _assertSame(ctx.wordSpacing, '5px', "ctx.wordSpacing", "'5px'"); + + ctx.letterSpacing = '-1px'; + ctx.wordSpacing = '-1px'; + _assertSame(ctx.letterSpacing, '-1px', "ctx.letterSpacing", "'-1px'"); + _assertSame(ctx.wordSpacing, '-1px', "ctx.wordSpacing", "'-1px'"); + + ctx.letterSpacing = '1PX'; + ctx.wordSpacing = '10PX'; + _assertSame(ctx.letterSpacing, '1px', "ctx.letterSpacing", "'1px'"); + _assertSame(ctx.wordSpacing, '10px', "ctx.wordSpacing", "'10px'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.font-relative.spacing.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.font-relative.spacing.html new file mode 100644 index 0000000000..a3f0f7133e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.font-relative.spacing.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.font-relative.spacing + + + + +

2d.text.drawing.style.font-relative.spacing

+

Testing letter spacing and word spacing with font-relative length

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.font-relative.spacing.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.font-relative.spacing.worker.js new file mode 100644 index 0000000000..cd653208e8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.font-relative.spacing.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.font-relative.spacing +// Description:Testing letter spacing and word spacing with font-relative length +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Testing letter spacing and word spacing with font-relative length"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.letterSpacing, '0px', "ctx.letterSpacing", "'0px'"); + _assertSame(ctx.wordSpacing, '0px', "ctx.wordSpacing", "'0px'"); + + ctx.letterSpacing = '1EX'; + ctx.wordSpacing = '1EM'; + _assertSame(ctx.letterSpacing, '1ex', "ctx.letterSpacing", "'1ex'"); + _assertSame(ctx.wordSpacing, '1em', "ctx.wordSpacing", "'1em'"); + + ctx.letterSpacing = '1ch'; + ctx.wordSpacing = '1ic'; + _assertSame(ctx.letterSpacing, '1ch', "ctx.letterSpacing", "'1ch'"); + _assertSame(ctx.wordSpacing, '1ic', "ctx.wordSpacing", "'1ic'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.html new file mode 100644 index 0000000000..23f353513b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.fontKerning + + + + +

2d.text.drawing.style.fontKerning

+

Testing basic functionalities of fontKerning for canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.with.uppercase.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.with.uppercase.html new file mode 100644 index 0000000000..7f6b57921e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.with.uppercase.html @@ -0,0 +1,58 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.fontKerning.with.uppercase + + + + +

2d.text.drawing.style.fontKerning.with.uppercase

+

Testing basic functionalities of fontKerning for canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.with.uppercase.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.with.uppercase.worker.js new file mode 100644 index 0000000000..4e0f32c692 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.with.uppercase.worker.js @@ -0,0 +1,53 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.fontKerning.with.uppercase +// Description:Testing basic functionalities of fontKerning for canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Testing basic functionalities of fontKerning for canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.fontKerning, "auto", "ctx.fontKerning", "\"auto\""); + ctx.fontKerning = "Normal"; + _assertSame(ctx.fontKerning, "auto", "ctx.fontKerning", "\"auto\""); + ctx.fontKerning = "normal"; + _assertSame(ctx.fontKerning, "normal", "ctx.fontKerning", "\"normal\""); + ctx.fontKerning = "Auto"; + _assertSame(ctx.fontKerning, "normal", "ctx.fontKerning", "\"normal\""); + ctx.fontKerning = "auto"; + ctx.fontKerning = "noRmal"; + _assertSame(ctx.fontKerning, "auto", "ctx.fontKerning", "\"auto\""); + ctx.fontKerning = "auto"; + ctx.fontKerning = "NoRMal"; + _assertSame(ctx.fontKerning, "auto", "ctx.fontKerning", "\"auto\""); + ctx.fontKerning = "auto"; + ctx.fontKerning = "NORMAL"; + _assertSame(ctx.fontKerning, "auto", "ctx.fontKerning", "\"auto\""); + + ctx.fontKerning = "None"; + _assertSame(ctx.fontKerning, "auto", "ctx.fontKerning", "\"auto\""); + ctx.fontKerning = "none"; + _assertSame(ctx.fontKerning, "none", "ctx.fontKerning", "\"none\""); + ctx.fontKerning = "Auto"; + _assertSame(ctx.fontKerning, "none", "ctx.fontKerning", "\"none\""); + ctx.fontKerning = "auto"; + ctx.fontKerning = "nOne"; + _assertSame(ctx.fontKerning, "auto", "ctx.fontKerning", "\"auto\""); + ctx.fontKerning = "auto"; + ctx.fontKerning = "nonE"; + _assertSame(ctx.fontKerning, "auto", "ctx.fontKerning", "\"auto\""); + ctx.fontKerning = "auto"; + ctx.fontKerning = "NONE"; + _assertSame(ctx.fontKerning, "auto", "ctx.fontKerning", "\"auto\""); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.worker.js new file mode 100644 index 0000000000..ec64214c7f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontKerning.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.fontKerning +// Description:Testing basic functionalities of fontKerning for canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Testing basic functionalities of fontKerning for canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.fontKerning, "auto", "ctx.fontKerning", "\"auto\""); + ctx.fontKerning = "normal"; + _assertSame(ctx.fontKerning, "normal", "ctx.fontKerning", "\"normal\""); + width_normal = ctx.measureText("TAWATAVA").width; + ctx.fontKerning = "none"; + _assertSame(ctx.fontKerning, "none", "ctx.fontKerning", "\"none\""); + width_none = ctx.measureText("TAWATAVA").width; + _assert(width_normal < width_none, "width_normal < width_none"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontStretch.settings.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontStretch.settings.html new file mode 100644 index 0000000000..95405a18a5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontStretch.settings.html @@ -0,0 +1,82 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.fontStretch.settings + + + + +

2d.text.drawing.style.fontStretch.settings

+

Testing value setting of fontStretch in Canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontStretch.settings.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontStretch.settings.worker.js new file mode 100644 index 0000000000..ff10a742b5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontStretch.settings.worker.js @@ -0,0 +1,77 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.fontStretch.settings +// Description:Testing value setting of fontStretch in Canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Testing value setting of fontStretch in Canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // Setting textRendering with lower cases + ctx.fontStretch = "ultra-condensed"; + _assertSame(ctx.fontStretch, "ultra-condensed", "ctx.fontStretch", "\"ultra-condensed\""); + + ctx.fontStretch = "extra-condensed"; + _assertSame(ctx.fontStretch, "extra-condensed", "ctx.fontStretch", "\"extra-condensed\""); + + ctx.fontStretch = "condensed"; + _assertSame(ctx.fontStretch, "condensed", "ctx.fontStretch", "\"condensed\""); + + ctx.fontStretch = "semi-condensed"; + _assertSame(ctx.fontStretch, "semi-condensed", "ctx.fontStretch", "\"semi-condensed\""); + + ctx.fontStretch = "normal"; + _assertSame(ctx.fontStretch, "normal", "ctx.fontStretch", "\"normal\""); + + ctx.fontStretch = "semi-expanded"; + _assertSame(ctx.fontStretch, "semi-expanded", "ctx.fontStretch", "\"semi-expanded\""); + + ctx.fontStretch = "expanded"; + _assertSame(ctx.fontStretch, "expanded", "ctx.fontStretch", "\"expanded\""); + + ctx.fontStretch = "extra-expanded"; + _assertSame(ctx.fontStretch, "extra-expanded", "ctx.fontStretch", "\"extra-expanded\""); + + ctx.fontStretch = "ultra-expanded"; + _assertSame(ctx.fontStretch, "ultra-expanded", "ctx.fontStretch", "\"ultra-expanded\""); + + // Setting fontStretch with lower cases and upper cases word, + // these values should be ignored. + ctx.fontStretch = "ulTra-condensed"; + _assertSame(ctx.fontStretch, "ultra-expanded", "ctx.fontStretch", "\"ultra-expanded\""); + + ctx.fontStretch = "Extra-condensed"; + _assertSame(ctx.fontStretch, "ultra-expanded", "ctx.fontStretch", "\"ultra-expanded\""); + + ctx.fontStretch = "cOndensed"; + _assertSame(ctx.fontStretch, "ultra-expanded", "ctx.fontStretch", "\"ultra-expanded\""); + + ctx.fontStretch = "Semi-Condensed"; + _assertSame(ctx.fontStretch, "ultra-expanded", "ctx.fontStretch", "\"ultra-expanded\""); + + ctx.fontStretch = "normaL"; + _assertSame(ctx.fontStretch, "ultra-expanded", "ctx.fontStretch", "\"ultra-expanded\""); + + ctx.fontStretch = "semi-Expanded"; + _assertSame(ctx.fontStretch, "ultra-expanded", "ctx.fontStretch", "\"ultra-expanded\""); + + ctx.fontStretch = "Expanded"; + _assertSame(ctx.fontStretch, "ultra-expanded", "ctx.fontStretch", "\"ultra-expanded\""); + + ctx.fontStretch = "eXtra-expanded"; + _assertSame(ctx.fontStretch, "ultra-expanded", "ctx.fontStretch", "\"ultra-expanded\""); + + ctx.fontStretch = "abcd"; + _assertSame(ctx.fontStretch, "ultra-expanded", "ctx.fontStretch", "\"ultra-expanded\""); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontVariant.settings.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontVariant.settings.html new file mode 100644 index 0000000000..9756d095ba --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontVariant.settings.html @@ -0,0 +1,79 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.fontVariant.settings + + + + +

2d.text.drawing.style.fontVariant.settings

+

Testing basic functionalities of fontVariant for canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontVariant.settings.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontVariant.settings.worker.js new file mode 100644 index 0000000000..30c78388ae --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.fontVariant.settings.worker.js @@ -0,0 +1,74 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.fontVariant.settings +// Description:Testing basic functionalities of fontVariant for canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Testing basic functionalities of fontVariant for canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // Setting fontVariantCaps with lower cases + _assertSame(ctx.fontVariantCaps, "normal", "ctx.fontVariantCaps", "\"normal\""); + + ctx.fontVariantCaps = "normal"; + _assertSame(ctx.fontVariantCaps, "normal", "ctx.fontVariantCaps", "\"normal\""); + + ctx.fontVariantCaps = "small-caps"; + _assertSame(ctx.fontVariantCaps, "small-caps", "ctx.fontVariantCaps", "\"small-caps\""); + + ctx.fontVariantCaps = "all-small-caps"; + _assertSame(ctx.fontVariantCaps, "all-small-caps", "ctx.fontVariantCaps", "\"all-small-caps\""); + + ctx.fontVariantCaps = "petite-caps"; + _assertSame(ctx.fontVariantCaps, "petite-caps", "ctx.fontVariantCaps", "\"petite-caps\""); + + ctx.fontVariantCaps = "all-petite-caps"; + _assertSame(ctx.fontVariantCaps, "all-petite-caps", "ctx.fontVariantCaps", "\"all-petite-caps\""); + + ctx.fontVariantCaps = "unicase"; + _assertSame(ctx.fontVariantCaps, "unicase", "ctx.fontVariantCaps", "\"unicase\""); + + ctx.fontVariantCaps = "titling-caps"; + _assertSame(ctx.fontVariantCaps, "titling-caps", "ctx.fontVariantCaps", "\"titling-caps\""); + + // Setting fontVariantCaps with mixed-case values is not valid + ctx.fontVariantCaps = "nORmal"; + _assertSame(ctx.fontVariantCaps, "titling-caps", "ctx.fontVariantCaps", "\"titling-caps\""); + + ctx.fontVariantCaps = "normal"; + _assertSame(ctx.fontVariantCaps, "normal", "ctx.fontVariantCaps", "\"normal\""); + + ctx.fontVariantCaps = "smaLL-caps"; + _assertSame(ctx.fontVariantCaps, "normal", "ctx.fontVariantCaps", "\"normal\""); + + ctx.fontVariantCaps = "all-small-CAPS"; + _assertSame(ctx.fontVariantCaps, "normal", "ctx.fontVariantCaps", "\"normal\""); + + ctx.fontVariantCaps = "pEtitE-caps"; + _assertSame(ctx.fontVariantCaps, "normal", "ctx.fontVariantCaps", "\"normal\""); + + ctx.fontVariantCaps = "All-Petite-Caps"; + _assertSame(ctx.fontVariantCaps, "normal", "ctx.fontVariantCaps", "\"normal\""); + + ctx.fontVariantCaps = "uNIcase"; + _assertSame(ctx.fontVariantCaps, "normal", "ctx.fontVariantCaps", "\"normal\""); + + ctx.fontVariantCaps = "titling-CAPS"; + _assertSame(ctx.fontVariantCaps, "normal", "ctx.fontVariantCaps", "\"normal\""); + + // Setting fontVariantCaps with non-existing font variant. + ctx.fontVariantCaps = "titling-caps"; + ctx.fontVariantCaps = "abcd"; + _assertSame(ctx.fontVariantCaps, "titling-caps", "ctx.fontVariantCaps", "\"titling-caps\""); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.invalid.spacing.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.invalid.spacing.html new file mode 100644 index 0000000000..d16b175ad6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.invalid.spacing.html @@ -0,0 +1,43 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.invalid.spacing + + + + +

2d.text.drawing.style.invalid.spacing

+

Testing letter spacing and word spacing with invalid units

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.invalid.spacing.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.invalid.spacing.worker.js new file mode 100644 index 0000000000..06207b2c6c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.invalid.spacing.worker.js @@ -0,0 +1,38 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.invalid.spacing +// Description:Testing letter spacing and word spacing with invalid units +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Testing letter spacing and word spacing with invalid units"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.letterSpacing, '0px', "ctx.letterSpacing", "'0px'"); + _assertSame(ctx.wordSpacing, '0px', "ctx.wordSpacing", "'0px'"); + + function test_word_spacing(value) { + ctx.wordSpacing = value; + ctx.letterSpacing = value; + _assertSame(ctx.wordSpacing, '0px', "ctx.wordSpacing", "'0px'"); + _assertSame(ctx.letterSpacing, '0px', "ctx.letterSpacing", "'0px'"); + } + test_word_spacing('0s'); + test_word_spacing('1min'); + test_word_spacing('1deg'); + test_word_spacing('1pp'); + test_word_spacing('initial'); + test_word_spacing('inherit'); + test_word_spacing('normal'); + test_word_spacing('none'); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.change.font.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.change.font.html new file mode 100644 index 0000000000..f8b453418c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.change.font.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.letterSpacing.change.font + + + + +

2d.text.drawing.style.letterSpacing.change.font

+

Set letter spacing and word spacing to font dependent value and verify it works after font change.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.change.font.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.change.font.worker.js new file mode 100644 index 0000000000..510845c885 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.change.font.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.letterSpacing.change.font +// Description:Set letter spacing and word spacing to font dependent value and verify it works after font change. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Set letter spacing and word spacing to font dependent value and verify it works after font change."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.letterSpacing, '0px', "ctx.letterSpacing", "'0px'"); + _assertSame(ctx.wordSpacing, '0px', "ctx.wordSpacing", "'0px'"); + // Get the width for 'Hello World' at default size, 10px. + var width_normal = ctx.measureText('Hello World').width; + + ctx.letterSpacing = '1em'; + _assertSame(ctx.letterSpacing, '1em', "ctx.letterSpacing", "'1em'"); + // 1em = 10px. Add 10px after each letter in "Hello World", + // makes it 110px longer. + var width_with_spacing = ctx.measureText('Hello World').width; + assert_approx_equals(width_with_spacing, width_normal + 110, 0.1, "letter-spacing error"); + + // Changing font to 20px. Without resetting the spacing, 1em letterSpacing + // is now 20px, so it's suppose to be 220px longer without any letterSpacing set. + ctx.font = '20px serif'; + width_with_spacing = ctx.measureText('Hello World').width; + // Now calculate the reference spacing for "Hello World" with no spacing. + ctx.letterSpacing = '0em'; + width_normal = ctx.measureText('Hello World').width; + assert_approx_equals(width_with_spacing, width_normal + 220, 0.1, "letter-spacing error after font change"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.measure.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.measure.html new file mode 100644 index 0000000000..a565770a16 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.measure.html @@ -0,0 +1,55 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.letterSpacing.measure + + + + +

2d.text.drawing.style.letterSpacing.measure

+

Testing letter spacing with different length units

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.measure.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.measure.worker.js new file mode 100644 index 0000000000..630bf1d486 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.letterSpacing.measure.worker.js @@ -0,0 +1,50 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.letterSpacing.measure +// Description:Testing letter spacing with different length units +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Testing letter spacing with different length units"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.letterSpacing, '0px', "ctx.letterSpacing", "'0px'"); + _assertSame(ctx.wordSpacing, '0px', "ctx.wordSpacing", "'0px'"); + var width_normal = ctx.measureText('Hello World').width; + + function test_letter_spacing(value, difference_spacing, epsilon) { + ctx.letterSpacing = value; + _assertSame(ctx.letterSpacing, value, "ctx.letterSpacing", "value"); + _assertSame(ctx.wordSpacing, '0px', "ctx.wordSpacing", "'0px'"); + width_with_letter_spacing = ctx.measureText('Hello World').width; + assert_approx_equals(width_with_letter_spacing, width_normal + difference_spacing, epsilon, "letter spacing doesn't work."); + } + + // The first value is the letter Spacing to be set, the second value the + // change in length of string 'Hello World', note that there are 11 letters + // in 'hello world', so the length difference is always letterSpacing * 11. + // and the third value is the acceptable differencee for the length change, + // note that unit such as 1cm/1mm doesn't map to an exact pixel value. + test_cases = [['3px', 33, 0.1], + ['5px', 55, 0.1], + ['-2px', -22, 0.1], + ['1em', 110, 0.1], + ['-0.1em', -11, 0.1], + ['1in', 1056, 0.1], + ['-0.1cm', -41.65, 0.2], + ['-0.6mm', -24,95, 0.2]] + + for (const test_case of test_cases) { + test_letter_spacing(test_case[0], test_case[1], test_case[2]); + } + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.direction.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.direction.html new file mode 100644 index 0000000000..6c0b3756d3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.direction.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.measure.direction + + + + +

2d.text.drawing.style.measure.direction

+

Measurement should follow text direction

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.direction.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.direction.worker.js new file mode 100644 index 0000000000..852f372101 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.direction.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.measure.direction +// Description:Measurement should follow text direction +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Measurement should follow text direction"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.direction = "ltr"; + metrics = ctx.measureText('hello'); + _assert(metrics.actualBoundingBoxLeft < metrics.actualBoundingBoxRight, "metrics.actualBoundingBoxLeft < metrics.actualBoundingBoxRight"); + + ctx.direction = "rtl"; + metrics = ctx.measureText('hello'); + _assert(metrics.actualBoundingBoxLeft > metrics.actualBoundingBoxRight, "metrics.actualBoundingBoxLeft > metrics.actualBoundingBoxRight"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.rtl.text.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.rtl.text.html new file mode 100644 index 0000000000..335014cfd6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.rtl.text.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.measure.rtl.text + + + + +

2d.text.drawing.style.measure.rtl.text

+

Measurement should follow canvas direction instead text direction

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.rtl.text.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.rtl.text.worker.js new file mode 100644 index 0000000000..09b0e9b8d0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.rtl.text.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.measure.rtl.text +// Description:Measurement should follow canvas direction instead text direction +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Measurement should follow canvas direction instead text direction"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + metrics = ctx.measureText('اَلْعَرَبِيَّةُ'); + _assert(metrics.actualBoundingBoxLeft < metrics.actualBoundingBoxRight, "metrics.actualBoundingBoxLeft < metrics.actualBoundingBoxRight"); + + metrics = ctx.measureText('hello'); + _assert(metrics.actualBoundingBoxLeft < metrics.actualBoundingBoxRight, "metrics.actualBoundingBoxLeft < metrics.actualBoundingBoxRight"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.textAlign.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.textAlign.html new file mode 100644 index 0000000000..4c1ca193e5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.textAlign.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.measure.textAlign + + + + +

2d.text.drawing.style.measure.textAlign

+

Measurement should be related to textAlignment

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.textAlign.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.textAlign.worker.js new file mode 100644 index 0000000000..bc6f167be5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.measure.textAlign.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.measure.textAlign +// Description:Measurement should be related to textAlignment +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Measurement should be related to textAlignment"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.textAlign = "right"; + metrics = ctx.measureText('hello'); + _assert(metrics.actualBoundingBoxLeft > metrics.actualBoundingBoxRight, "metrics.actualBoundingBoxLeft > metrics.actualBoundingBoxRight"); + + ctx.textAlign = "left" + metrics = ctx.measureText('hello'); + _assert(metrics.actualBoundingBoxLeft < metrics.actualBoundingBoxRight, "metrics.actualBoundingBoxLeft < metrics.actualBoundingBoxRight"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.nonfinite.spacing.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.nonfinite.spacing.html new file mode 100644 index 0000000000..48a592b839 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.nonfinite.spacing.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.nonfinite.spacing + + + + +

2d.text.drawing.style.nonfinite.spacing

+

Testing letter spacing and word spacing with nonfinite inputs

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.nonfinite.spacing.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.nonfinite.spacing.worker.js new file mode 100644 index 0000000000..4cf20b28c0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.nonfinite.spacing.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.nonfinite.spacing +// Description:Testing letter spacing and word spacing with nonfinite inputs +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Testing letter spacing and word spacing with nonfinite inputs"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.letterSpacing, '0px', "ctx.letterSpacing", "'0px'"); + _assertSame(ctx.wordSpacing, '0px', "ctx.wordSpacing", "'0px'"); + + function test_word_spacing(value) { + ctx.wordSpacing = value; + ctx.letterSpacing = value; + _assertSame(ctx.wordSpacing, '0px', "ctx.wordSpacing", "'0px'"); + _assertSame(ctx.letterSpacing, '0px', "ctx.letterSpacing", "'0px'"); + } + test_word_spacing(NaN); + test_word_spacing(Infinity); + test_word_spacing(-Infinity); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.textRendering.settings.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.textRendering.settings.html new file mode 100644 index 0000000000..52b34deaab --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.textRendering.settings.html @@ -0,0 +1,81 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.textRendering.settings + + + + +

2d.text.drawing.style.textRendering.settings

+

Testing basic functionalities of textRendering in Canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.textRendering.settings.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.textRendering.settings.worker.js new file mode 100644 index 0000000000..a4381963f7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.textRendering.settings.worker.js @@ -0,0 +1,76 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.textRendering.settings +// Description:Testing basic functionalities of textRendering in Canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Testing basic functionalities of textRendering in Canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // Setting textRendering with correct case. + _assertSame(ctx.textRendering, "auto", "ctx.textRendering", "\"auto\""); + + ctx.textRendering = "optimizeSpeed"; + _assertSame(ctx.textRendering, "optimizeSpeed", "ctx.textRendering", "\"optimizeSpeed\""); + + ctx.textRendering = "optimizeLegibility"; + _assertSame(ctx.textRendering, "optimizeLegibility", "ctx.textRendering", "\"optimizeLegibility\""); + + ctx.textRendering = "geometricPrecision"; + _assertSame(ctx.textRendering, "geometricPrecision", "ctx.textRendering", "\"geometricPrecision\""); + + ctx.textRendering = "auto"; + _assertSame(ctx.textRendering, "auto", "ctx.textRendering", "\"auto\""); + + // Setting textRendering with incorrect case is ignored. + ctx.textRendering = "OPtimizeSpeed"; + _assertSame(ctx.textRendering, "auto", "ctx.textRendering", "\"auto\""); + + ctx.textRendering = "OPtimizELEgibility"; + _assertSame(ctx.textRendering, "auto", "ctx.textRendering", "\"auto\""); + + ctx.textRendering = "GeometricPrecision"; + _assertSame(ctx.textRendering, "auto", "ctx.textRendering", "\"auto\""); + + ctx.textRendering = "optimizespeed"; + _assertSame(ctx.textRendering, "auto", "ctx.textRendering", "\"auto\""); + + ctx.textRendering = "optimizelegibility"; + _assertSame(ctx.textRendering, "auto", "ctx.textRendering", "\"auto\""); + + ctx.textRendering = "geometricprecision"; + _assertSame(ctx.textRendering, "auto", "ctx.textRendering", "\"auto\""); + + ctx.textRendering = "optimizeLegibility"; + _assertSame(ctx.textRendering, "optimizeLegibility", "ctx.textRendering", "\"optimizeLegibility\""); + + ctx.textRendering = "AUTO"; + _assertSame(ctx.textRendering, "optimizeLegibility", "ctx.textRendering", "\"optimizeLegibility\""); + + ctx.textRendering = "Auto"; + _assertSame(ctx.textRendering, "optimizeLegibility", "ctx.textRendering", "\"optimizeLegibility\""); + + // Setting textRendering with non-existing font variant. + ctx.textRendering = "abcd"; + _assertSame(ctx.textRendering, "optimizeLegibility", "ctx.textRendering", "\"optimizeLegibility\""); + + ctx.textRendering = "normal"; + _assertSame(ctx.textRendering, "optimizeLegibility", "ctx.textRendering", "\"optimizeLegibility\""); + + ctx.textRendering = ""; + _assertSame(ctx.textRendering, "optimizeLegibility", "ctx.textRendering", "\"optimizeLegibility\""); + + ctx.textRendering = "auto"; + _assertSame(ctx.textRendering, "auto", "ctx.textRendering", "\"auto\""); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.change.font.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.change.font.html new file mode 100644 index 0000000000..3df660ea3e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.change.font.html @@ -0,0 +1,46 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.wordSpacing.change.font + + + + +

2d.text.drawing.style.wordSpacing.change.font

+

Set word spacing and word spacing to font dependent value and verify it works after font change.

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.change.font.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.change.font.worker.js new file mode 100644 index 0000000000..e1415ea287 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.change.font.worker.js @@ -0,0 +1,41 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.wordSpacing.change.font +// Description:Set word spacing and word spacing to font dependent value and verify it works after font change. +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Set word spacing and word spacing to font dependent value and verify it works after font change."); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.letterSpacing, '0px', "ctx.letterSpacing", "'0px'"); + _assertSame(ctx.wordSpacing, '0px', "ctx.wordSpacing", "'0px'"); + // Get the width for 'Hello World, again' at default size, 10px. + var width_normal = ctx.measureText('Hello World, again').width; + + ctx.wordSpacing = '1em'; + _assertSame(ctx.wordSpacing, '1em', "ctx.wordSpacing", "'1em'"); + // 1em = 10px. Add 10px after each word in "Hello World, again", + // makes it 20px longer. + var width_with_spacing = ctx.measureText('Hello World, again').width; + _assertSame(width_with_spacing, width_normal + 20, "width_with_spacing", "width_normal + 20"); + + // Changing font to 20px. Without resetting the spacing, 1em wordSpacing + // is now 20px, so it's suppose to be 40px longer without any wordSpacing set. + ctx.font = '20px serif'; + width_with_spacing = ctx.measureText('Hello World, again').width; + // Now calculate the reference spacing for "Hello World, again" with no spacing. + ctx.wordSpacing = '0em'; + width_normal = ctx.measureText('Hello World, again').width; + _assertSame(width_with_spacing, width_normal + 40, "width_with_spacing", "width_normal + 40"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.measure.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.measure.html new file mode 100644 index 0000000000..7a1d867d0f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.measure.html @@ -0,0 +1,55 @@ + + +OffscreenCanvas test: 2d.text.drawing.style.wordSpacing.measure + + + + +

2d.text.drawing.style.wordSpacing.measure

+

Testing word spacing with different length units

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.measure.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.measure.worker.js new file mode 100644 index 0000000000..b7acecb0eb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.drawing.style.wordSpacing.measure.worker.js @@ -0,0 +1,50 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.drawing.style.wordSpacing.measure +// Description:Testing word spacing with different length units +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Testing word spacing with different length units"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.letterSpacing, '0px', "ctx.letterSpacing", "'0px'"); + _assertSame(ctx.wordSpacing, '0px', "ctx.wordSpacing", "'0px'"); + var width_normal = ctx.measureText('Hello World, again').width; + + function test_word_spacing(value, difference_spacing, epsilon) { + ctx.wordSpacing = value; + _assertSame(ctx.letterSpacing, '0px', "ctx.letterSpacing", "'0px'"); + _assertSame(ctx.wordSpacing, value, "ctx.wordSpacing", "value"); + width_with_word_spacing = ctx.measureText('Hello World, again').width; + assert_approx_equals(width_with_word_spacing, width_normal + difference_spacing, epsilon, "word spacing doesn't work."); + } + + // The first value is the word Spacing to be set, the second value the + // change in length of string 'Hello World', note that there are 2 words + // in 'Hello World, again', so the length difference is always wordSpacing * 2. + // and the third value is the acceptable differencee for the length change, + // note that unit such as 1cm/1mm doesn't map to an exact pixel value. + test_cases = [['3px', 6, 0.1], + ['5px', 10, 0.1], + ['-2px', -4, 0.1], + ['1em', 20, 0.1], + ['-0.5em', -10, 0.1], + ['1in', 192, 0.1], + ['-0.1cm', -7.57, 0.2], + ['-0.6mm', -4.54, 0.2]] + + for (const test_case of test_cases) { + test_word_spacing(test_case[0], test_case[1], test_case[2]); + } + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.default.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.default.html new file mode 100644 index 0000000000..59828a5db4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.default.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.text.font.default + + + + +

2d.text.font.default

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.default.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.default.worker.js new file mode 100644 index 0000000000..fa51ffc871 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.default.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.font.default +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + _assertSame(ctx.font, '10px sans-serif', "ctx.font", "'10px sans-serif'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.basic.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.basic.html new file mode 100644 index 0000000000..bb39cc4a3c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.basic.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.text.font.parse.basic + + + + +

2d.text.font.parse.basic

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.basic.worker.js new file mode 100644 index 0000000000..3596aab66b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.basic.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.font.parse.basic +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex.html new file mode 100644 index 0000000000..69453437fe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.text.font.parse.complex + + + + +

2d.text.font.parse.complex

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex.worker.js new file mode 100644 index 0000000000..71d039cfac --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.font.parse.complex +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.font = 'small-caps italic 400 12px/2 Unknown Font, sans-serif'; + _assert(['italic small-caps 12px "Unknown Font", sans-serif', 'italic small-caps 12px Unknown Font, sans-serif'].includes(ctx.font), "['italic small-caps 12px \"Unknown Font\", sans-serif', 'italic small-caps 12px Unknown Font, sans-serif'].includes(ctx.font)"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex2.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex2.html new file mode 100644 index 0000000000..af94ac720a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex2.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.text.font.parse.complex2 + + + + +

2d.text.font.parse.complex2

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex2.worker.js new file mode 100644 index 0000000000..45575f8814 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.complex2.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.font.parse.complex2 +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.font = 'small-caps italic 400 12px/2 "Unknown Font #2", sans-serif'; + _assertSame(ctx.font, 'italic small-caps 12px "Unknown Font #2", sans-serif', "ctx.font", "'italic small-caps 12px \"Unknown Font #2\", sans-serif'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.family.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.family.html new file mode 100644 index 0000000000..989014fb37 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.family.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.text.font.parse.family + + + + +

2d.text.font.parse.family

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.family.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.family.worker.js new file mode 100644 index 0000000000..68aefdd0df --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.family.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.font.parse.family +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.font = '20px cursive,fantasy,monospace,sans-serif,serif,UnquotedFont,"QuotedFont\\\\\\","'; + _assertSame(ctx.font, '20px cursive, fantasy, monospace, sans-serif, serif, UnquotedFont, "QuotedFont\\\\\\","', "ctx.font", "'20px cursive, fantasy, monospace, sans-serif, serif, UnquotedFont, \"QuotedFont\\\\\\\\\\\\\",\"'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.invalid.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.invalid.html new file mode 100644 index 0000000000..8b4fd01d02 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.invalid.html @@ -0,0 +1,72 @@ + + +OffscreenCanvas test: 2d.text.font.parse.invalid + + + + +

2d.text.font.parse.invalid

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.invalid.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.invalid.worker.js new file mode 100644 index 0000000000..31f374579e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.invalid.worker.js @@ -0,0 +1,67 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.font.parse.invalid +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.font = '20px serif'; + _assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + + ctx.font = '20px serif'; + ctx.font = ''; + _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'"); + + ctx.font = '20px serif'; + ctx.font = '10px revert'; + _assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + + ctx.font = '20px serif'; + ctx.font = 'var(--x)'; + _assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + + ctx.font = '20px serif'; + ctx.font = 'var(--x, 10px serif)'; + _assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + + ctx.font = '20px serif'; + ctx.font = '1em serif; background: green; margin: 10px'; + _assertSame(ctx.font, '20px serif', "ctx.font", "'20px serif'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.system.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.system.html new file mode 100644 index 0000000000..79ae6a38e2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.system.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.text.font.parse.system + + + + +

2d.text.font.parse.system

+

System fonts must be computed to explicit values

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.system.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.system.worker.js new file mode 100644 index 0000000000..b965ea763a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.system.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.font.parse.system +// Description:System fonts must be computed to explicit values +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("System fonts must be computed to explicit values"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.font = 'message-box'; + _assertDifferent(ctx.font, 'message-box', "ctx.font", "'message-box'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.tiny.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.tiny.html new file mode 100644 index 0000000000..89f8515967 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.tiny.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.text.font.parse.tiny + + + + +

2d.text.font.parse.tiny

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.tiny.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.tiny.worker.js new file mode 100644 index 0000000000..aba023e336 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.parse.tiny.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.font.parse.tiny +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.font = '1px sans-serif'; + _assertSame(ctx.font, '1px sans-serif', "ctx.font", "'1px sans-serif'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.relative_size.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.relative_size.html new file mode 100644 index 0000000000..a32be3d65c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.relative_size.html @@ -0,0 +1,28 @@ + + +OffscreenCanvas test: 2d.text.font.relative_size + + + + +

2d.text.font.relative_size

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.relative_size.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.relative_size.worker.js new file mode 100644 index 0000000000..9e1247cfe0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.relative_size.worker.js @@ -0,0 +1,23 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.font.relative_size +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.font = '1em sans-serif'; + _assertSame(ctx.font, '10px sans-serif', "ctx.font", "'10px sans-serif'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.weight.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.weight.html new file mode 100644 index 0000000000..cac9c369b5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.weight.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.text.font.weight + + + + +

2d.text.font.weight

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.weight.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.weight.worker.js new file mode 100644 index 0000000000..8f653c3656 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.font.weight.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.font.weight +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.font = 'italic 400 12px serif'; + _assertSame(ctx.font, 'italic 12px serif', "ctx.font", "'italic 12px serif'"); + + ctx.font = 'italic 300 12px serif'; + _assertSame(ctx.font, 'italic 300 12px serif', "ctx.font", "'italic 300 12px serif'"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps1-expected.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps1-expected.html new file mode 100644 index 0000000000..e2cef0d77a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps1-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.text.fontVariantCaps1 +

2d.text.fontVariantCaps1

+

Testing small caps setting in fontVariant

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps1.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps1.html new file mode 100644 index 0000000000..3c216f07da --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps1.html @@ -0,0 +1,21 @@ + + + +Canvas test: 2d.text.fontVariantCaps1 +

2d.text.fontVariantCaps1

+

Testing small caps setting in fontVariant

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps1.w.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps1.w.html new file mode 100644 index 0000000000..4bc1b36e17 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps1.w.html @@ -0,0 +1,35 @@ + + + + +Canvas test: 2d.text.fontVariantCaps1 +

2d.text.fontVariantCaps1

+

Testing small caps setting in fontVariant

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps2-unexpected.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps2-unexpected.html new file mode 100644 index 0000000000..dbcb8abd76 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps2-unexpected.html @@ -0,0 +1,16 @@ + + +HTML OffscreenCanvas reference + + + +
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps2.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps2.html new file mode 100644 index 0000000000..e5bcff1831 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps2.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.text.fontVariantCaps2 + + + + +

2d.text.fontVariantCaps2

+

Testing small caps setting in fontVariant

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps2.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps2.worker.js new file mode 100644 index 0000000000..89f4f48c73 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps2.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.fontVariantCaps2 +// Description:Testing small caps setting in fontVariant +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Testing small caps setting in fontVariant"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.font = "small-caps 32px serif"; + // "mismatch" test, to verify that small-caps does change the rendering. + smallCaps_len = ctx.measureText("Hello World").width; + + ctx.font = "32px serif"; + normalCaps_len = ctx.measureText("Hello World").width; + _assert(smallCaps_len != normalCaps_len, "smallCaps_len != normalCaps_len"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps3-expected.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps3-expected.html new file mode 100644 index 0000000000..cf2d5ae119 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps3-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.text.fontVariantCaps3 +

2d.text.fontVariantCaps3

+

Testing small caps setting in fontVariant

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps3.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps3.html new file mode 100644 index 0000000000..48699a640f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps3.html @@ -0,0 +1,22 @@ + + + +Canvas test: 2d.text.fontVariantCaps3 +

2d.text.fontVariantCaps3

+

Testing small caps setting in fontVariant

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps3.w.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps3.w.html new file mode 100644 index 0000000000..cd5c1db818 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps3.w.html @@ -0,0 +1,36 @@ + + + + +Canvas test: 2d.text.fontVariantCaps3 +

2d.text.fontVariantCaps3

+

Testing small caps setting in fontVariant

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps4-expected.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps4-expected.html new file mode 100644 index 0000000000..3813fd3684 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps4-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.text.fontVariantCaps4 +

2d.text.fontVariantCaps4

+

Testing small caps setting in fontVariant

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps4.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps4.html new file mode 100644 index 0000000000..b1b81b81e2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps4.html @@ -0,0 +1,22 @@ + + + +Canvas test: 2d.text.fontVariantCaps4 +

2d.text.fontVariantCaps4

+

Testing small caps setting in fontVariant

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps4.w.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps4.w.html new file mode 100644 index 0000000000..0bae66fcd4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps4.w.html @@ -0,0 +1,36 @@ + + + + +Canvas test: 2d.text.fontVariantCaps4 +

2d.text.fontVariantCaps4

+

Testing small caps setting in fontVariant

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps5-expected.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps5-expected.html new file mode 100644 index 0000000000..4bda4ec4b5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps5-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.text.fontVariantCaps5 +

2d.text.fontVariantCaps5

+

Testing small caps setting in fontVariant

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps5.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps5.html new file mode 100644 index 0000000000..2a6f7b5f73 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps5.html @@ -0,0 +1,22 @@ + + + +Canvas test: 2d.text.fontVariantCaps5 +

2d.text.fontVariantCaps5

+

Testing small caps setting in fontVariant

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps5.w.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps5.w.html new file mode 100644 index 0000000000..8c59f5b517 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps5.w.html @@ -0,0 +1,36 @@ + + + + +Canvas test: 2d.text.fontVariantCaps5 +

2d.text.fontVariantCaps5

+

Testing small caps setting in fontVariant

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps6-expected.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps6-expected.html new file mode 100644 index 0000000000..af9c736aea --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps6-expected.html @@ -0,0 +1,15 @@ + + +Canvas test: 2d.text.fontVariantCaps6 +

2d.text.fontVariantCaps6

+

Testing small caps setting in fontVariant

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps6.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps6.html new file mode 100644 index 0000000000..c33684d388 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps6.html @@ -0,0 +1,22 @@ + + + +Canvas test: 2d.text.fontVariantCaps6 +

2d.text.fontVariantCaps6

+

Testing small caps setting in fontVariant

+ +

FAIL (fallback content)

+
+ diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps6.w.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps6.w.html new file mode 100644 index 0000000000..47f70d812b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.fontVariantCaps6.w.html @@ -0,0 +1,36 @@ + + + + +Canvas test: 2d.text.fontVariantCaps6 +

2d.text.fontVariantCaps6

+

Testing small caps setting in fontVariant

+ +

FAIL (fallback content)

+
+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.actualBoundingBox.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.actualBoundingBox.html new file mode 100644 index 0000000000..105efc0794 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.actualBoundingBox.html @@ -0,0 +1,50 @@ + + +OffscreenCanvas test: 2d.text.measure.actualBoundingBox + + + + +

2d.text.measure.actualBoundingBox

+

Testing actualBoundingBox

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.actualBoundingBox.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.actualBoundingBox.worker.js new file mode 100644 index 0000000000..c3d18ff878 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.actualBoundingBox.worker.js @@ -0,0 +1,46 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.measure.actualBoundingBox +// Description:Testing actualBoundingBox +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + ctx.direction = 'ltr'; + ctx.align = 'left' + ctx.baseline = 'alphabetic' + // Different platforms may render text slightly different. + // Values that are nominally expected to be zero might actually vary by a + // pixel or so if the UA accounts for antialiasing at glyph edges, so we + // allow a slight deviation. + _assert(Math.abs(ctx.measureText('A').actualBoundingBoxLeft) <= 1, "Math.abs(ctx.measureText('A').actualBoundingBoxLeft) <= 1"); + _assert(ctx.measureText('A').actualBoundingBoxRight >= 50, "ctx.measureText('A').actualBoundingBoxRight >= 50"); + _assert(ctx.measureText('A').actualBoundingBoxAscent >= 35, "ctx.measureText('A').actualBoundingBoxAscent >= 35"); + _assert(Math.abs(ctx.measureText('A').actualBoundingBoxDescent) <= 1, "Math.abs(ctx.measureText('A').actualBoundingBoxDescent) <= 1"); + + _assert(ctx.measureText('D').actualBoundingBoxLeft >= 48, "ctx.measureText('D').actualBoundingBoxLeft >= 48"); + _assert(ctx.measureText('D').actualBoundingBoxLeft <= 52, "ctx.measureText('D').actualBoundingBoxLeft <= 52"); + _assert(ctx.measureText('D').actualBoundingBoxRight >= 75, "ctx.measureText('D').actualBoundingBoxRight >= 75"); + _assert(ctx.measureText('D').actualBoundingBoxRight <= 80, "ctx.measureText('D').actualBoundingBoxRight <= 80"); + _assert(ctx.measureText('D').actualBoundingBoxAscent >= 35, "ctx.measureText('D').actualBoundingBoxAscent >= 35"); + _assert(ctx.measureText('D').actualBoundingBoxAscent <= 40, "ctx.measureText('D').actualBoundingBoxAscent <= 40"); + _assert(ctx.measureText('D').actualBoundingBoxDescent >= 12, "ctx.measureText('D').actualBoundingBoxDescent >= 12"); + _assert(ctx.measureText('D').actualBoundingBoxDescent <= 15, "ctx.measureText('D').actualBoundingBoxDescent <= 15"); + + _assert(Math.abs(ctx.measureText('ABCD').actualBoundingBoxLeft) <= 1, "Math.abs(ctx.measureText('ABCD').actualBoundingBoxLeft) <= 1"); + _assert(ctx.measureText('ABCD').actualBoundingBoxRight >= 200, "ctx.measureText('ABCD').actualBoundingBoxRight >= 200"); + _assert(ctx.measureText('ABCD').actualBoundingBoxAscent >= 85, "ctx.measureText('ABCD').actualBoundingBoxAscent >= 85"); + _assert(ctx.measureText('ABCD').actualBoundingBoxDescent >= 37, "ctx.measureText('ABCD').actualBoundingBoxDescent >= 37"); + t.done(); +}, "Testing actualBoundingBox"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.advances.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.advances.html new file mode 100644 index 0000000000..2eec005cb8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.advances.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.text.measure.advances + + + + +

2d.text.measure.advances

+

Testing width advances

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.advances.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.advances.worker.js new file mode 100644 index 0000000000..4b02f06f2d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.advances.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.measure.advances +// Description:Testing width advances +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + ctx.direction = 'ltr'; + ctx.align = 'left' + // Some platforms may return '-0'. + _assertSame(Math.abs(ctx.measureText('Hello').advances[0]), 0, "Math.abs(ctx.measureText('Hello').advances[\""+(0)+"\"])", "0"); + // Different platforms may render text slightly different. + _assert(ctx.measureText('Hello').advances[1] >= 36, "ctx.measureText('Hello').advances[\""+(1)+"\"] >= 36"); + _assert(ctx.measureText('Hello').advances[2] >= 58, "ctx.measureText('Hello').advances[\""+(2)+"\"] >= 58"); + _assert(ctx.measureText('Hello').advances[3] >= 70, "ctx.measureText('Hello').advances[\""+(3)+"\"] >= 70"); + _assert(ctx.measureText('Hello').advances[4] >= 80, "ctx.measureText('Hello').advances[\""+(4)+"\"] >= 80"); + + var tm = ctx.measureText('Hello'); + _assertSame(ctx.measureText('Hello').advances[0], tm.advances[0], "ctx.measureText('Hello').advances[\""+(0)+"\"]", "tm.advances[\""+(0)+"\"]"); + _assertSame(ctx.measureText('Hello').advances[1], tm.advances[1], "ctx.measureText('Hello').advances[\""+(1)+"\"]", "tm.advances[\""+(1)+"\"]"); + _assertSame(ctx.measureText('Hello').advances[2], tm.advances[2], "ctx.measureText('Hello').advances[\""+(2)+"\"]", "tm.advances[\""+(2)+"\"]"); + _assertSame(ctx.measureText('Hello').advances[3], tm.advances[3], "ctx.measureText('Hello').advances[\""+(3)+"\"]", "tm.advances[\""+(3)+"\"]"); + _assertSame(ctx.measureText('Hello').advances[4], tm.advances[4], "ctx.measureText('Hello').advances[\""+(4)+"\"]", "tm.advances[\""+(4)+"\"]"); + t.done(); +}, "Testing width advances"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.baselines.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.baselines.html new file mode 100644 index 0000000000..9d0cc1268d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.baselines.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.text.measure.baselines + + + + +

2d.text.measure.baselines

+

Testing baselines

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker.js new file mode 100644 index 0000000000..ddb48f4fe0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.baselines.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.measure.baselines +// Description:Testing baselines +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + ctx.direction = 'ltr'; + ctx.align = 'left' + _assertSame(Math.abs(ctx.measureText('A').alphabeticBaseline), 0, "Math.abs(ctx.measureText('A').alphabeticBaseline)", "0"); + _assertSame(ctx.measureText('A').ideographicBaseline, 6.25, "ctx.measureText('A').ideographicBaseline", "6.25"); + _assertSame(ctx.measureText('A').hangingBaseline, 25, "ctx.measureText('A').hangingBaseline", "25"); + + _assertSame(Math.abs(ctx.measureText('ABCD').alphabeticBaseline), 0, "Math.abs(ctx.measureText('ABCD').alphabeticBaseline)", "0"); + _assertSame(ctx.measureText('ABCD').ideographicBaseline, 6.25, "ctx.measureText('ABCD').ideographicBaseline", "6.25"); + _assertSame(ctx.measureText('ABCD').hangingBaseline, 25, "ctx.measureText('ABCD').hangingBaseline", "25"); + t.done(); +}, "Testing baselines"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.html new file mode 100644 index 0000000000..2e2e5dde67 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.text.measure.emHeights-low-ascent + + + + +

2d.text.measure.emHeights-low-ascent

+

Testing emHeights with reduced ascent metric

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker.js new file mode 100644 index 0000000000..09ee787309 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-low-ascent.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.measure.emHeights-low-ascent +// Description:Testing emHeights with reduced ascent metric +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest-ascent256", "url('/fonts/CanvasTest-ascent256.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '40px CanvasTest-ascent256'; + ctx.direction = 'ltr'; + ctx.align = 'left' + _assertSame(ctx.measureText('A').emHeightAscent, 20, "ctx.measureText('A').emHeightAscent", "20"); + _assertSame(ctx.measureText('A').emHeightDescent, 20, "ctx.measureText('A').emHeightDescent", "20"); + _assertSame(ctx.measureText('A').emHeightDescent + ctx.measureText('A').emHeightAscent, 40, "ctx.measureText('A').emHeightDescent + ctx.measureText('A').emHeightAscent", "40"); + + _assertSame(ctx.measureText('ABCD').emHeightAscent, 20, "ctx.measureText('ABCD').emHeightAscent", "20"); + _assertSame(ctx.measureText('ABCD').emHeightDescent, 20, "ctx.measureText('ABCD').emHeightDescent", "20"); + _assertSame(ctx.measureText('ABCD').emHeightDescent + ctx.measureText('ABCD').emHeightAscent, 40, "ctx.measureText('ABCD').emHeightDescent + ctx.measureText('ABCD').emHeightAscent", "40"); + t.done(); +}, "Testing emHeights with reduced ascent metric"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.html new file mode 100644 index 0000000000..e39c08ce82 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.text.measure.emHeights-zero-descent + + + + +

2d.text.measure.emHeights-zero-descent

+

Testing emHeights with zero descent metric

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker.js new file mode 100644 index 0000000000..a2f09782c9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights-zero-descent.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.measure.emHeights-zero-descent +// Description:Testing emHeights with zero descent metric +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest-descent0", "url('/fonts/CanvasTest-descent0.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '40px CanvasTest-descent0'; + ctx.direction = 'ltr'; + ctx.align = 'left' + _assertSame(ctx.measureText('A').emHeightAscent, 40, "ctx.measureText('A').emHeightAscent", "40"); + _assertSame(ctx.measureText('A').emHeightDescent, 0, "ctx.measureText('A').emHeightDescent", "0"); + _assertSame(ctx.measureText('A').emHeightDescent + ctx.measureText('A').emHeightAscent, 40, "ctx.measureText('A').emHeightDescent + ctx.measureText('A').emHeightAscent", "40"); + + _assertSame(ctx.measureText('ABCD').emHeightAscent, 40, "ctx.measureText('ABCD').emHeightAscent", "40"); + _assertSame(ctx.measureText('ABCD').emHeightDescent, 0, "ctx.measureText('ABCD').emHeightDescent", "0"); + _assertSame(ctx.measureText('ABCD').emHeightDescent + ctx.measureText('ABCD').emHeightAscent, 40, "ctx.measureText('ABCD').emHeightDescent + ctx.measureText('ABCD').emHeightAscent", "40"); + t.done(); +}, "Testing emHeights with zero descent metric"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights.html new file mode 100644 index 0000000000..0764279df3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.text.measure.emHeights + + + + +

2d.text.measure.emHeights

+

Testing emHeights

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker.js new file mode 100644 index 0000000000..0385d3d737 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.emHeights.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.measure.emHeights +// Description:Testing emHeights +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '40px CanvasTest'; + ctx.direction = 'ltr'; + ctx.align = 'left' + _assertSame(ctx.measureText('A').emHeightAscent, 30, "ctx.measureText('A').emHeightAscent", "30"); + _assertSame(ctx.measureText('A').emHeightDescent, 10, "ctx.measureText('A').emHeightDescent", "10"); + _assertSame(ctx.measureText('A').emHeightDescent + ctx.measureText('A').emHeightAscent, 40, "ctx.measureText('A').emHeightDescent + ctx.measureText('A').emHeightAscent", "40"); + + _assertSame(ctx.measureText('ABCD').emHeightAscent, 30, "ctx.measureText('ABCD').emHeightAscent", "30"); + _assertSame(ctx.measureText('ABCD').emHeightDescent, 10, "ctx.measureText('ABCD').emHeightDescent", "10"); + _assertSame(ctx.measureText('ABCD').emHeightDescent + ctx.measureText('ABCD').emHeightAscent, 40, "ctx.measureText('ABCD').emHeightDescent + ctx.measureText('ABCD').emHeightAscent", "40"); + t.done(); +}, "Testing emHeights"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.html new file mode 100644 index 0000000000..51eb2c822c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.text.measure.fontBoundingBox-reduced-ascent + + + + +

2d.text.measure.fontBoundingBox-reduced-ascent

+

Testing fontBoundingBox for OffscreenCanvas with reduced ascent metric

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker.js new file mode 100644 index 0000000000..dea67ff8f6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-reduced-ascent.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.measure.fontBoundingBox-reduced-ascent +// Description:Testing fontBoundingBox for OffscreenCanvas with reduced ascent metric +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest-ascent256", "url('/fonts/CanvasTest-ascent256.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '40px CanvasTest-ascent256'; + ctx.direction = 'ltr'; + ctx.align = 'left' + _assertSame(ctx.measureText('A').fontBoundingBoxAscent, 10, "ctx.measureText('A').fontBoundingBoxAscent", "10"); + _assertSame(ctx.measureText('A').fontBoundingBoxDescent, 10, "ctx.measureText('A').fontBoundingBoxDescent", "10"); + + _assertSame(ctx.measureText('ABCD').fontBoundingBoxAscent, 10, "ctx.measureText('ABCD').fontBoundingBoxAscent", "10"); + _assertSame(ctx.measureText('ABCD').fontBoundingBoxDescent, 10, "ctx.measureText('ABCD').fontBoundingBoxDescent", "10"); + t.done(); +}, "Testing fontBoundingBox for OffscreenCanvas with reduced ascent metric"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.html new file mode 100644 index 0000000000..ea65e58b5c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.text.measure.fontBoundingBox-zero-descent + + + + +

2d.text.measure.fontBoundingBox-zero-descent

+

Testing fontBoundingBox for OffscreenCanvas with zero descent metric

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker.js new file mode 100644 index 0000000000..99a886d015 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox-zero-descent.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.measure.fontBoundingBox-zero-descent +// Description:Testing fontBoundingBox for OffscreenCanvas with zero descent metric +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest-descent0", "url('/fonts/CanvasTest-descent0.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '40px CanvasTest-descent0'; + ctx.direction = 'ltr'; + ctx.align = 'left' + _assertSame(ctx.measureText('A').fontBoundingBoxAscent, 30, "ctx.measureText('A').fontBoundingBoxAscent", "30"); + _assertSame(ctx.measureText('A').fontBoundingBoxDescent, 0, "ctx.measureText('A').fontBoundingBoxDescent", "0"); + + _assertSame(ctx.measureText('ABCD').fontBoundingBoxAscent, 30, "ctx.measureText('ABCD').fontBoundingBoxAscent", "30"); + _assertSame(ctx.measureText('ABCD').fontBoundingBoxDescent, 0, "ctx.measureText('ABCD').fontBoundingBoxDescent", "0"); + t.done(); +}, "Testing fontBoundingBox for OffscreenCanvas with zero descent metric"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.ahem.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.ahem.html new file mode 100644 index 0000000000..cb8b0c558d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.ahem.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.text.measure.fontBoundingBox.ahem + + + + +

2d.text.measure.fontBoundingBox.ahem

+

Testing fontBoundingBox for font ahem

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.ahem.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.ahem.worker.js new file mode 100644 index 0000000000..255bcd108a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.ahem.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.measure.fontBoundingBox.ahem +// Description:Testing fontBoundingBox for font ahem +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("Ahem", "url('/fonts/Ahem.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px Ahem'; + ctx.direction = 'ltr'; + ctx.align = 'left' + _assertSame(ctx.measureText('A').fontBoundingBoxAscent, 40, "ctx.measureText('A').fontBoundingBoxAscent", "40"); + _assertSame(ctx.measureText('A').fontBoundingBoxDescent, 10, "ctx.measureText('A').fontBoundingBoxDescent", "10"); + _assertSame(ctx.measureText('ABCD').fontBoundingBoxAscent, 40, "ctx.measureText('ABCD').fontBoundingBoxAscent", "40"); + _assertSame(ctx.measureText('ABCD').fontBoundingBoxDescent, 10, "ctx.measureText('ABCD').fontBoundingBoxDescent", "10"); + t.done(); +}, "Testing fontBoundingBox for font ahem"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.html new file mode 100644 index 0000000000..36b11f31d7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.text.measure.fontBoundingBox + + + + +

2d.text.measure.fontBoundingBox

+

Testing fontBoundingBox measurements

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker.js new file mode 100644 index 0000000000..b2cde04c0d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.fontBoundingBox.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.measure.fontBoundingBox +// Description:Testing fontBoundingBox measurements +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '40px CanvasTest'; + ctx.direction = 'ltr'; + ctx.align = 'left' + _assertSame(ctx.measureText('A').fontBoundingBoxAscent, 30, "ctx.measureText('A').fontBoundingBoxAscent", "30"); + _assertSame(ctx.measureText('A').fontBoundingBoxDescent, 10, "ctx.measureText('A').fontBoundingBoxDescent", "10"); + + _assertSame(ctx.measureText('ABCD').fontBoundingBoxAscent, 30, "ctx.measureText('ABCD').fontBoundingBoxAscent", "30"); + _assertSame(ctx.measureText('ABCD').fontBoundingBoxDescent, 10, "ctx.measureText('ABCD').fontBoundingBoxDescent", "10"); + t.done(); +}, "Testing fontBoundingBox measurements"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.basic.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.basic.html new file mode 100644 index 0000000000..fea1904083 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.basic.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.text.measure.width.basic + + + + +

2d.text.measure.width.basic

+

The width of character is same as font used

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.basic.worker.js new file mode 100644 index 0000000000..866ad8b3c5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.basic.worker.js @@ -0,0 +1,27 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.measure.width.basic +// Description:The width of character is same as font used +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + 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"); + t.done(); +}, "The width of character is same as font used"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.empty.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.empty.html new file mode 100644 index 0000000000..11bd029433 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.empty.html @@ -0,0 +1,26 @@ + + +OffscreenCanvas test: 2d.text.measure.width.empty + + + + +

2d.text.measure.width.empty

+

The empty string has zero width

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.empty.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.empty.worker.js new file mode 100644 index 0000000000..6fb89c5ba7 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.empty.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.measure.width.empty +// Description:The empty string has zero width +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + _assertSame(ctx.measureText("").width, 0, "ctx.measureText(\"\").width", "0"); + t.done(); +}, "The empty string has zero width"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.space.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.space.html new file mode 100644 index 0000000000..38d5084298 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.space.html @@ -0,0 +1,32 @@ + + +OffscreenCanvas test: 2d.text.measure.width.space + + + + +

2d.text.measure.width.space

+

Space characters are converted to U+0020 and NOT collapsed

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.space.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.space.worker.js new file mode 100644 index 0000000000..d832feec5f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.measure.width.space.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.measure.width.space +// Description:Space characters are converted to U+0020 and NOT collapsed +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +promise_test(async t => { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var f = new FontFace("CanvasTest", "url('/fonts/CanvasTest.ttf')"); + f.load(); + self.fonts.add(f); + await self.fonts.ready; + ctx.font = '50px CanvasTest'; + _assertSame(ctx.measureText('A B').width, 150, "ctx.measureText('A B').width", "150"); + _assertSame(ctx.measureText('A B').width, 200, "ctx.measureText('A B').width", "200"); + _assertSame(ctx.measureText('A \x09\x0a\x0c\x0d \x09\x0a\x0c\x0dB').width, 650, "ctx.measureText('A \\x09\\x0a\\x0c\\x0d \\x09\\x0a\\x0c\\x0dB').width", "650"); + _assert(ctx.measureText('A \x0b B').width >= 200, "ctx.measureText('A \\x0b B').width >= 200"); + + _assertSame(ctx.measureText(' AB').width, 150, "ctx.measureText(' AB').width", "150"); + _assertSame(ctx.measureText('AB ').width, 150, "ctx.measureText('AB ').width", "150"); + t.done(); +}, "Space characters are converted to U+0020 and NOT collapsed"); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.setFont.mathFont.html b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.setFont.mathFont.html new file mode 100644 index 0000000000..89d8fe3c7a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.setFont.mathFont.html @@ -0,0 +1,27 @@ + + +OffscreenCanvas test: 2d.text.setFont.mathFont + + + + +

2d.text.setFont.mathFont

+

crbug.com/1212190, make sure offscreencanvas doesn't crash with Math Font

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.setFont.mathFont.worker.js b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.setFont.mathFont.worker.js new file mode 100644 index 0000000000..b756b45dc5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/2d.text.setFont.mathFont.worker.js @@ -0,0 +1,22 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.text.setFont.mathFont +// Description:crbug.com/1212190, make sure offscreencanvas doesn't crash with Math Font +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("crbug.com/1212190, make sure offscreencanvas doesn't crash with Math Font"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.font = "math serif"; + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch-ref.html b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch-ref.html new file mode 100644 index 0000000000..00ecdccad3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch-ref.html @@ -0,0 +1,19 @@ + +Canvas test: 2d.text.fontStretch +

FAIL (fallback content)

+ \ No newline at end of file diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.condensed.html b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.condensed.html new file mode 100644 index 0000000000..0cbd5e3c1f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.condensed.html @@ -0,0 +1,30 @@ + +Canvas test: 2d.text.fontStretch + +

FAIL (fallback content)

+ \ No newline at end of file diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.expanded.html b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.expanded.html new file mode 100644 index 0000000000..5ec853985f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.expanded.html @@ -0,0 +1,30 @@ + +Canvas test: 2d.text.fontStretch + +

FAIL (fallback content)

+ \ No newline at end of file diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.extra-condensed.html b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.extra-condensed.html new file mode 100644 index 0000000000..12843c53b8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.extra-condensed.html @@ -0,0 +1,30 @@ + +Canvas test: 2d.text.fontStretch + +

FAIL (fallback content)

+ \ No newline at end of file diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.extra-expanded.html b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.extra-expanded.html new file mode 100644 index 0000000000..20d801718a --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.extra-expanded.html @@ -0,0 +1,30 @@ + +Canvas test: 2d.text.fontStretch + +

FAIL (fallback content)

+ \ No newline at end of file diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.normal.html b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.normal.html new file mode 100644 index 0000000000..786cb408e1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.normal.html @@ -0,0 +1,33 @@ + +Canvas test: 2d.text.fontStretch + +

FAIL (fallback content)

+ \ No newline at end of file diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.semi-condensed.html b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.semi-condensed.html new file mode 100644 index 0000000000..04bd5a80d0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.semi-condensed.html @@ -0,0 +1,30 @@ + +Canvas test: 2d.text.fontStretch + +

FAIL (fallback content)

+ \ No newline at end of file diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.semi-expanded.html b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.semi-expanded.html new file mode 100644 index 0000000000..d86b730687 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.semi-expanded.html @@ -0,0 +1,30 @@ + +Canvas test: 2d.text.fontStretch + +

FAIL (fallback content)

+ \ No newline at end of file diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.ultra-condensed.html b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.ultra-condensed.html new file mode 100644 index 0000000000..d78f6d0078 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.ultra-condensed.html @@ -0,0 +1,30 @@ + +Canvas test: 2d.text.fontStretch + +

FAIL (fallback content)

+ \ No newline at end of file diff --git a/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.ultra-expanded.html b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.ultra-expanded.html new file mode 100644 index 0000000000..8b8f6f5698 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/text/canvas.2d.fontStretch.ultra-expanded.html @@ -0,0 +1,30 @@ + +Canvas test: 2d.text.fontStretch + +

FAIL (fallback content)

+ \ No newline at end of file diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.bitmap.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.bitmap.html new file mode 100644 index 0000000000..208043fbf6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.bitmap.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.state.saverestore.bitmap + + + + +

2d.state.saverestore.bitmap

+

save()/restore() does not affect the current bitmap

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.bitmap.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.bitmap.worker.js new file mode 100644 index 0000000000..09c7dcca90 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.bitmap.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.bitmap +// Description:save()/restore() does not affect the current bitmap +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() does not affect the current bitmap"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.clip.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.clip.html new file mode 100644 index 0000000000..f4d6b6f6e1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.clip.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.state.saverestore.clip + + + + +

2d.state.saverestore.clip

+

save()/restore() affects the clipping path

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.clip.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.clip.worker.js new file mode 100644 index 0000000000..a7bc0615e5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.clip.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.clip +// Description:save()/restore() affects the clipping path +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() affects the clipping path"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.fillStyle.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.fillStyle.html new file mode 100644 index 0000000000..789e1e8d2b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.fillStyle.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.state.saverestore.fillStyle + + + + +

2d.state.saverestore.fillStyle

+

save()/restore() works for fillStyle

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.fillStyle.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.fillStyle.worker.js new file mode 100644 index 0000000000..46cf6d1daa --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.fillStyle.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.fillStyle +// Description:save()/restore() works for fillStyle +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() works for fillStyle"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // 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(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalAlpha.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalAlpha.html new file mode 100644 index 0000000000..15b59725ab --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalAlpha.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.state.saverestore.globalAlpha + + + + +

2d.state.saverestore.globalAlpha

+

save()/restore() works for globalAlpha

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalAlpha.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalAlpha.worker.js new file mode 100644 index 0000000000..765f8b00a3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalAlpha.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.globalAlpha +// Description:save()/restore() works for globalAlpha +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() works for globalAlpha"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // 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(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalCompositeOperation.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalCompositeOperation.html new file mode 100644 index 0000000000..1efb24aa9b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalCompositeOperation.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.state.saverestore.globalCompositeOperation + + + + +

2d.state.saverestore.globalCompositeOperation

+

save()/restore() works for globalCompositeOperation

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalCompositeOperation.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalCompositeOperation.worker.js new file mode 100644 index 0000000000..cd38d56c51 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.globalCompositeOperation.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.globalCompositeOperation +// Description:save()/restore() works for globalCompositeOperation +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() works for globalCompositeOperation"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // 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(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineCap.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineCap.html new file mode 100644 index 0000000000..5e651d0c7b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineCap.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.state.saverestore.lineCap + + + + +

2d.state.saverestore.lineCap

+

save()/restore() works for lineCap

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineCap.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineCap.worker.js new file mode 100644 index 0000000000..9895b44b00 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineCap.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.lineCap +// Description:save()/restore() works for lineCap +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() works for lineCap"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // 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(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineJoin.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineJoin.html new file mode 100644 index 0000000000..20f53fec50 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineJoin.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.state.saverestore.lineJoin + + + + +

2d.state.saverestore.lineJoin

+

save()/restore() works for lineJoin

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineJoin.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineJoin.worker.js new file mode 100644 index 0000000000..e8c85825f1 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineJoin.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.lineJoin +// Description:save()/restore() works for lineJoin +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() works for lineJoin"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // 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(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineWidth.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineWidth.html new file mode 100644 index 0000000000..e234e3efc2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineWidth.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.state.saverestore.lineWidth + + + + +

2d.state.saverestore.lineWidth

+

save()/restore() works for lineWidth

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineWidth.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineWidth.worker.js new file mode 100644 index 0000000000..997748c377 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.lineWidth.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.lineWidth +// Description:save()/restore() works for lineWidth +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() works for lineWidth"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // 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(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.miterLimit.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.miterLimit.html new file mode 100644 index 0000000000..1df2b2420f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.miterLimit.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.state.saverestore.miterLimit + + + + +

2d.state.saverestore.miterLimit

+

save()/restore() works for miterLimit

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.miterLimit.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.miterLimit.worker.js new file mode 100644 index 0000000000..eb5adffe06 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.miterLimit.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.miterLimit +// Description:save()/restore() works for miterLimit +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() works for miterLimit"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // 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(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.path.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.path.html new file mode 100644 index 0000000000..a86851af68 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.path.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.state.saverestore.path + + + + +

2d.state.saverestore.path

+

save()/restore() does not affect the current path

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.path.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.path.worker.js new file mode 100644 index 0000000000..d174de5a50 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.path.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.path +// Description:save()/restore() does not affect the current path +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() does not affect the current path"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowBlur.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowBlur.html new file mode 100644 index 0000000000..044ee1b4bb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowBlur.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.state.saverestore.shadowBlur + + + + +

2d.state.saverestore.shadowBlur

+

save()/restore() works for shadowBlur

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowBlur.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowBlur.worker.js new file mode 100644 index 0000000000..00cd6f8317 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowBlur.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.shadowBlur +// Description:save()/restore() works for shadowBlur +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() works for shadowBlur"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // 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(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowColor.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowColor.html new file mode 100644 index 0000000000..0e8b4293e0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowColor.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.state.saverestore.shadowColor + + + + +

2d.state.saverestore.shadowColor

+

save()/restore() works for shadowColor

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowColor.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowColor.worker.js new file mode 100644 index 0000000000..13c033f396 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowColor.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.shadowColor +// Description:save()/restore() works for shadowColor +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() works for shadowColor"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // 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(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetX.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetX.html new file mode 100644 index 0000000000..11aa658f3e --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetX.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.state.saverestore.shadowOffsetX + + + + +

2d.state.saverestore.shadowOffsetX

+

save()/restore() works for shadowOffsetX

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetX.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetX.worker.js new file mode 100644 index 0000000000..a6ad922647 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetX.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.shadowOffsetX +// Description:save()/restore() works for shadowOffsetX +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() works for shadowOffsetX"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // 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(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetY.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetY.html new file mode 100644 index 0000000000..c238f0ec94 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetY.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.state.saverestore.shadowOffsetY + + + + +

2d.state.saverestore.shadowOffsetY

+

save()/restore() works for shadowOffsetY

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetY.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetY.worker.js new file mode 100644 index 0000000000..323fcd1434 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.shadowOffsetY.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.shadowOffsetY +// Description:save()/restore() works for shadowOffsetY +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() works for shadowOffsetY"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // 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(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stack.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stack.html new file mode 100644 index 0000000000..4a8750867f --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stack.html @@ -0,0 +1,36 @@ + + +OffscreenCanvas test: 2d.state.saverestore.stack + + + + +

2d.state.saverestore.stack

+

save()/restore() can be nested as a stack

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stack.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stack.worker.js new file mode 100644 index 0000000000..460df4ec83 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stack.worker.js @@ -0,0 +1,31 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.stack +// Description:save()/restore() can be nested as a stack +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() can be nested as a stack"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.lineWidth = 1; + ctx.save(); + ctx.lineWidth = 2; + ctx.save(); + ctx.lineWidth = 3; + _assertSame(ctx.lineWidth, 3, "ctx.lineWidth", "3"); + ctx.restore(); + _assertSame(ctx.lineWidth, 2, "ctx.lineWidth", "2"); + ctx.restore(); + _assertSame(ctx.lineWidth, 1, "ctx.lineWidth", "1"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stackdepth.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stackdepth.html new file mode 100644 index 0000000000..d536155e64 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stackdepth.html @@ -0,0 +1,37 @@ + + +OffscreenCanvas test: 2d.state.saverestore.stackdepth + + + + +

2d.state.saverestore.stackdepth

+

save()/restore() stack depth is not unreasonably limited

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stackdepth.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stackdepth.worker.js new file mode 100644 index 0000000000..c494d9ddf8 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.stackdepth.worker.js @@ -0,0 +1,32 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.stackdepth +// Description:save()/restore() stack depth is not unreasonably limited +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() stack depth is not unreasonably limited"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + var limit = 512; + for (var i = 1; i < limit; ++i) + { + ctx.save(); + ctx.lineWidth = i; + } + for (var i = limit-1; i > 0; --i) + { + _assertSame(ctx.lineWidth, i, "ctx.lineWidth", "i"); + ctx.restore(); + } + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.strokeStyle.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.strokeStyle.html new file mode 100644 index 0000000000..561205acd9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.strokeStyle.html @@ -0,0 +1,41 @@ + + +OffscreenCanvas test: 2d.state.saverestore.strokeStyle + + + + +

2d.state.saverestore.strokeStyle

+

save()/restore() works for strokeStyle

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.strokeStyle.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.strokeStyle.worker.js new file mode 100644 index 0000000000..878a6d68cb --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.strokeStyle.worker.js @@ -0,0 +1,36 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.strokeStyle +// Description:save()/restore() works for strokeStyle +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() works for strokeStyle"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // 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(); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.transformation.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.transformation.html new file mode 100644 index 0000000000..79ecdece53 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.transformation.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.state.saverestore.transformation + + + + +

2d.state.saverestore.transformation

+

save()/restore() affects the current transformation matrix

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.transformation.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.transformation.worker.js new file mode 100644 index 0000000000..1647dfb790 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.transformation.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.transformation +// Description:save()/restore() affects the current transformation matrix +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("save()/restore() affects the current transformation matrix"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.underflow.html b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.underflow.html new file mode 100644 index 0000000000..a6713adde2 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.underflow.html @@ -0,0 +1,31 @@ + + +OffscreenCanvas test: 2d.state.saverestore.underflow + + + + +

2d.state.saverestore.underflow

+

restore() with an empty stack has no effect

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.underflow.worker.js b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.underflow.worker.js new file mode 100644 index 0000000000..8ed4bcbc10 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/the-canvas-state/2d.state.saverestore.underflow.worker.js @@ -0,0 +1,26 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.state.saverestore.underflow +// Description:restore() with an empty stack has no effect +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("restore() with an empty stack has no effect"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + for (var i = 0; i < 16; ++i) + ctx.restore(); + ctx.lineWidth = 0.5; + ctx.restore(); + _assertSame(ctx.lineWidth, 0.5, "ctx.lineWidth", "0.5"); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.order.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.order.html new file mode 100644 index 0000000000..d438c27433 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.order.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.transformation.order + + + + +

2d.transformation.order

+

Transformations are applied in the right order

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.order.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.order.worker.js new file mode 100644 index 0000000000..219cbe8421 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.order.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.order +// Description:Transformations are applied in the right order +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Transformations are applied in the right order"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.direction.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.direction.html new file mode 100644 index 0000000000..fb0f295062 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.direction.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.transformation.rotate.direction + + + + +

2d.transformation.rotate.direction

+

rotate() is clockwise

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.direction.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.direction.worker.js new file mode 100644 index 0000000000..b92b7d8368 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.direction.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.rotate.direction +// Description:rotate() is clockwise +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("rotate() is clockwise"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.nonfinite.html new file mode 100644 index 0000000000..dbde38370d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.nonfinite.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.transformation.rotate.nonfinite + + + + +

2d.transformation.rotate.nonfinite

+

rotate() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.nonfinite.worker.js new file mode 100644 index 0000000000..52b6605e45 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.nonfinite.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.rotate.nonfinite +// Description:rotate() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("rotate() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.radians.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.radians.html new file mode 100644 index 0000000000..28006028ca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.radians.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.transformation.rotate.radians + + + + +

2d.transformation.rotate.radians

+

rotate() uses radians

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.radians.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.radians.worker.js new file mode 100644 index 0000000000..0851691156 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.radians.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.rotate.radians +// Description:rotate() uses radians +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("rotate() uses radians"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrap.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrap.html new file mode 100644 index 0000000000..aea14ceddf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrap.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.transformation.rotate.wrap + + + + +

2d.transformation.rotate.wrap

+

rotate() wraps large positive values correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrap.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrap.worker.js new file mode 100644 index 0000000000..4d0c2f5b5d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrap.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.rotate.wrap +// Description:rotate() wraps large positive values correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("rotate() wraps large positive values correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 98,2, 0,255,0,255); + _assertPixel(canvas, 98,47, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrapnegative.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrapnegative.html new file mode 100644 index 0000000000..7363007a4d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrapnegative.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.transformation.rotate.wrapnegative + + + + +

2d.transformation.rotate.wrapnegative

+

rotate() wraps large negative values correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrapnegative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrapnegative.worker.js new file mode 100644 index 0000000000..932ecf6512 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.wrapnegative.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.rotate.wrapnegative +// Description:rotate() wraps large negative values correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("rotate() wraps large negative values correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 98,2, 0,255,0,255); + _assertPixel(canvas, 98,47, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.zero.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.zero.html new file mode 100644 index 0000000000..965d0e0768 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.zero.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.transformation.rotate.zero + + + + +

2d.transformation.rotate.zero

+

rotate() by 0 does nothing

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.zero.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.zero.worker.js new file mode 100644 index 0000000000..659c9fd7a0 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.rotate.zero.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.rotate.zero +// Description:rotate() by 0 does nothing +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("rotate() by 0 does nothing"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.basic.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.basic.html new file mode 100644 index 0000000000..d4063f7129 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.basic.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.transformation.scale.basic + + + + +

2d.transformation.scale.basic

+

scale() works

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.basic.worker.js new file mode 100644 index 0000000000..5e79daf3f4 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.basic.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.scale.basic +// Description:scale() works +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("scale() works"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.large.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.large.html new file mode 100644 index 0000000000..ae8f954a71 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.large.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.transformation.scale.large + + + + +

2d.transformation.scale.large

+

scale() with large scale factors works

+ +

Not really that large at all, but it hits the limits in Firefox. + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.large.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.large.worker.js new file mode 100644 index 0000000000..6d71627728 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.large.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.scale.large +// Description:scale() with large scale factors works +// Note:

Not really that large at all, but it hits the limits in Firefox. + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("scale() with large scale factors works"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.multiple.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.multiple.html new file mode 100644 index 0000000000..6a899d1dd6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.multiple.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.transformation.scale.multiple + + + + +

2d.transformation.scale.multiple

+

Multiple scale()s combine

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.multiple.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.multiple.worker.js new file mode 100644 index 0000000000..921e95aa72 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.multiple.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.scale.multiple +// Description:Multiple scale()s combine +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("Multiple scale()s combine"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.negative.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.negative.html new file mode 100644 index 0000000000..68c5780332 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.negative.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.transformation.scale.negative + + + + +

2d.transformation.scale.negative

+

scale() with negative scale factors works

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.negative.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.negative.worker.js new file mode 100644 index 0000000000..cb0f01c618 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.negative.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.scale.negative +// Description:scale() with negative scale factors works +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("scale() with negative scale factors works"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + _assertPixel(canvas, 75,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.nonfinite.html new file mode 100644 index 0000000000..5fd95629c9 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.nonfinite.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.transformation.scale.nonfinite + + + + +

2d.transformation.scale.nonfinite

+

scale() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.nonfinite.worker.js new file mode 100644 index 0000000000..35f9c90e71 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.nonfinite.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.scale.nonfinite +// Description:scale() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("scale() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.zero.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.zero.html new file mode 100644 index 0000000000..b4269bd140 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.zero.html @@ -0,0 +1,44 @@ + + +OffscreenCanvas test: 2d.transformation.scale.zero + + + + +

2d.transformation.scale.zero

+

scale() with a scale factor of zero works

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.zero.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.zero.worker.js new file mode 100644 index 0000000000..9e90127cfe --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.scale.zero.worker.js @@ -0,0 +1,39 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.scale.zero +// Description:scale() with a scale factor of zero works +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("scale() with a scale factor of zero works"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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(); + + _assertPixel(canvas, 50,25, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.multiple.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.multiple.html new file mode 100644 index 0000000000..0395c561bf --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.multiple.html @@ -0,0 +1,35 @@ + + +OffscreenCanvas test: 2d.transformation.setTransform.multiple + + + + +

2d.transformation.setTransform.multiple

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.multiple.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.multiple.worker.js new file mode 100644 index 0000000000..e3e6daf878 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.multiple.worker.js @@ -0,0 +1,30 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.setTransform.multiple +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + ctx.fillStyle = '#f00'; + ctx.fillRect(0, 0, 100, 50); + + ctx.setTransform(1/2,0, 0,1/2, 0,0); + ctx.setTransform(); + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.nonfinite.html new file mode 100644 index 0000000000..474b20a10b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.nonfinite.html @@ -0,0 +1,110 @@ + + +OffscreenCanvas test: 2d.transformation.setTransform.nonfinite + + + + +

2d.transformation.setTransform.nonfinite

+

setTransform() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.nonfinite.worker.js new file mode 100644 index 0000000000..d99ea52dea --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.nonfinite.worker.js @@ -0,0 +1,105 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.setTransform.nonfinite +// Description:setTransform() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("setTransform() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.skewed.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.skewed.html new file mode 100644 index 0000000000..2d24d61f4b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.skewed.html @@ -0,0 +1,55 @@ + + +OffscreenCanvas test: 2d.transformation.setTransform.skewed + + + + +

2d.transformation.setTransform.skewed

+

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.skewed.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.skewed.worker.js new file mode 100644 index 0000000000..161f4087e5 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.setTransform.skewed.worker.js @@ -0,0 +1,50 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.setTransform.skewed +// Description: +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test(""); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // 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); + _assertPixel(canvas, 79,11, 0,255,0,255); + _assertPixel(canvas, 21,39, 0,255,0,255); + _assertPixel(canvas, 79,39, 0,255,0,255); + _assertPixel(canvas, 39,19, 0,255,0,255); + _assertPixel(canvas, 61,19, 0,255,0,255); + _assertPixel(canvas, 39,31, 0,255,0,255); + _assertPixel(canvas, 61,31, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.identity.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.identity.html new file mode 100644 index 0000000000..d88b3bc03c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.identity.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.transformation.transform.identity + + + + +

2d.transformation.transform.identity

+

transform() with the identity matrix does nothing

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.identity.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.identity.worker.js new file mode 100644 index 0000000000..67202628c6 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.identity.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.transform.identity +// Description:transform() with the identity matrix does nothing +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("transform() with the identity matrix does nothing"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.multiply.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.multiply.html new file mode 100644 index 0000000000..a7dfbe5f34 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.multiply.html @@ -0,0 +1,34 @@ + + +OffscreenCanvas test: 2d.transformation.transform.multiply + + + + +

2d.transformation.transform.multiply

+

transform() multiplies the CTM

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.multiply.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.multiply.worker.js new file mode 100644 index 0000000000..aa89a7d8ca --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.multiply.worker.js @@ -0,0 +1,29 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.transform.multiply +// Description:transform() multiplies the CTM +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("transform() multiplies the CTM"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.nonfinite.html new file mode 100644 index 0000000000..c4cd459c8b --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.nonfinite.html @@ -0,0 +1,110 @@ + + +OffscreenCanvas test: 2d.transformation.transform.nonfinite + + + + +

2d.transformation.transform.nonfinite

+

transform() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.nonfinite.worker.js new file mode 100644 index 0000000000..c96af44b59 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.nonfinite.worker.js @@ -0,0 +1,105 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.transform.nonfinite +// Description:transform() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("transform() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.skewed.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.skewed.html new file mode 100644 index 0000000000..2f3c0453e3 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.skewed.html @@ -0,0 +1,55 @@ + + +OffscreenCanvas test: 2d.transformation.transform.skewed + + + + +

2d.transformation.transform.skewed

+

transform() with skewy matrix transforms correctly

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.skewed.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.skewed.worker.js new file mode 100644 index 0000000000..c7ebaf9a83 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.transform.skewed.worker.js @@ -0,0 +1,50 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.transform.skewed +// Description:transform() with skewy matrix transforms correctly +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("transform() with skewy matrix transforms correctly"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + // 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); + _assertPixel(canvas, 79,11, 0,255,0,255); + _assertPixel(canvas, 21,39, 0,255,0,255); + _assertPixel(canvas, 79,39, 0,255,0,255); + _assertPixel(canvas, 39,19, 0,255,0,255); + _assertPixel(canvas, 61,19, 0,255,0,255); + _assertPixel(canvas, 39,31, 0,255,0,255); + _assertPixel(canvas, 61,31, 0,255,0,255); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.basic.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.basic.html new file mode 100644 index 0000000000..f68225c077 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.basic.html @@ -0,0 +1,33 @@ + + +OffscreenCanvas test: 2d.transformation.translate.basic + + + + +

2d.transformation.translate.basic

+

translate() works

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.basic.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.basic.worker.js new file mode 100644 index 0000000000..f377ab8a48 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.basic.worker.js @@ -0,0 +1,28 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.translate.basic +// Description:translate() works +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("translate() works"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.nonfinite.html b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.nonfinite.html new file mode 100644 index 0000000000..ebab949b4c --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.nonfinite.html @@ -0,0 +1,42 @@ + + +OffscreenCanvas test: 2d.transformation.translate.nonfinite + + + + +

2d.transformation.translate.nonfinite

+

translate() with Infinity/NaN is ignored

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.nonfinite.worker.js b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.nonfinite.worker.js new file mode 100644 index 0000000000..7ad6fce2ba --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/transformations/2d.transformation.translate.nonfinite.worker.js @@ -0,0 +1,37 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.transformation.translate.nonfinite +// Description:translate() with Infinity/NaN is ignored +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("translate() with Infinity/NaN is ignored"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d'); + + 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); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.p3.html b/testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.p3.html new file mode 100644 index 0000000000..e1391e9010 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.p3.html @@ -0,0 +1,39 @@ + + +OffscreenCanvas test: 2d.color.space.p3.to.p3 + + + + +

2d.color.space.p3.to.p3

+

test getImageData with display-p3 and uint8 from display p3 uint8 canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.p3.worker.js b/testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.p3.worker.js new file mode 100644 index 0000000000..844cd93f81 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.p3.worker.js @@ -0,0 +1,34 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.color.space.p3.to.p3 +// Description:test getImageData with display-p3 and uint8 from display p3 uint8 canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("test getImageData with display-p3 and uint8 from display p3 uint8 canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d', {colorSpace: "display-p3"}); + + var color_style = 'rgb(50, 100, 150)'; + // [0.24304, 0.38818, 0.57227, 1.0] * 255 = [62, 99, 146, 255] + var pixel_expected = [62, 99, 146, 255]; + var epsilon = 2; + ctx.fillStyle = color_style; + ctx.fillRect(0, 0, 10, 10); + + var pixel = ctx.getImageData(5, 5, 1, 1, {colorSpace: "display-p3", storageFormat: "uint8"}).data; + _assertSame(pixel.length, pixel_expected.length, "pixel.length", "pixel_expected.length"); + assert_approx_equals(pixel[0], pixel_expected[0], 2); + assert_approx_equals(pixel[1], pixel_expected[1], 2); + assert_approx_equals(pixel[2], pixel_expected[2], 2); + assert_approx_equals(pixel[3], pixel_expected[3], 2); + t.done(); +}); +done(); diff --git a/testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.srgb.html b/testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.srgb.html new file mode 100644 index 0000000000..0628744421 --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.srgb.html @@ -0,0 +1,38 @@ + + +OffscreenCanvas test: 2d.color.space.p3.to.srgb + + + + +

2d.color.space.p3.to.srgb

+

test getImageData with srsb and uint8 from display p3 uint8 canvas

+ + + diff --git a/testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.srgb.worker.js b/testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.srgb.worker.js new file mode 100644 index 0000000000..619c59076d --- /dev/null +++ b/testing/web-platform/tests/html/canvas/offscreen/wide-gamut-canvas/2d.color.space.p3.to.srgb.worker.js @@ -0,0 +1,33 @@ +// DO NOT EDIT! This test has been generated by /html/canvas/tools/gentest.py. +// OffscreenCanvas test in a worker:2d.color.space.p3.to.srgb +// Description:test getImageData with srsb and uint8 from display p3 uint8 canvas +// Note: + +importScripts("/resources/testharness.js"); +importScripts("/html/canvas/resources/canvas-tests.js"); + +var t = async_test("test getImageData with srsb and uint8 from display p3 uint8 canvas"); +var t_pass = t.done.bind(t); +var t_fail = t.step_func(function(reason) { + throw reason; +}); +t.step(function() { + + var canvas = new OffscreenCanvas(100, 50); + var ctx = canvas.getContext('2d', {colorSpace: "display-p3"}); + + var color_style = 'rgb(50, 100, 150)'; + var pixel_expected = [50, 100, 150, 255]; + var epsilon = 2; + ctx.fillStyle = color_style; + ctx.fillRect(0, 0, 10, 10); + + var pixel = ctx.getImageData(5, 5, 1, 1, {colorSpace: "srgb", storageFormat: "uint8"}).data; + _assertSame(pixel.length, pixel_expected.length, "pixel.length", "pixel_expected.length"); + assert_approx_equals(pixel[0], pixel_expected[0], 2); + assert_approx_equals(pixel[1], pixel_expected[1], 2); + assert_approx_equals(pixel[2], pixel_expected[2], 2); + assert_approx_equals(pixel[3], pixel_expected[3], 2); + t.done(); +}); +done(); -- cgit v1.2.3