auto merge of #5016 : jdm/servo/canvas-for-svg, r=jdm

the tiger.

Rebased from #4623.
This commit is contained in:
bors-servo 2015-02-22 20:33:45 -07:00
commit 2e1adb3fa6
28 changed files with 419 additions and 181 deletions

View file

@ -53,7 +53,9 @@ var ecmaGlobals = [
var interfaceNamesInGlobalScope = [
"Attr",
"Blob",
"CanvasGradient",
"CanvasRenderingContext2D",
"CanvasPattern",
"CharacterData",
"CSSStyleDeclaration",
"DOMRect",

View file

@ -249,3 +249,4 @@ fragment=top != ../html/acid2.html acid2_ref.html
== text_overflow_basic_a.html text_overflow_basic_ref.html
== text_align_complex_a.html text_align_complex_ref.html
== percentage_height_root.html percentage_height_root_ref.html
== canvas_transform_a.html canvas_transform_ref.html

View file

@ -0,0 +1,26 @@
<html>
<head>
<style>
html, body {
margin: 0;
}
</style>
</head>
<body>
<canvas id=c width=400 height=300></canvas>
<script>
var canvas = document.getElementById('c');
var ctx = canvas.getContext('2d');
ctx.scale(3, 3);
ctx.fillStyle = 'rgb(255, 0, 0)';
ctx.beginPath();
ctx.moveTo(10, 10);
ctx.bezierCurveTo(10, 10, 20, 10, 20, 10);
ctx.bezierCurveTo(20, 10, 20, 20, 20, 20);
ctx.bezierCurveTo(20, 20, 10, 20, 10, 20);
ctx.closePath();
ctx.fill();
</script>
</body>
</html>

View file

@ -0,0 +1,21 @@
<html>
<head>
<style>
html, body {
margin: 0;
}
section {
position: absolute;
background: rgb(255, 0, 0);
width: 30px;
height: 30px;
top: 30px;
left: 30px;
}
</style>
</head>
<body>
<section></section>
</body>
</html>

View file

@ -6975,21 +6975,9 @@
[CanvasRenderingContext2D interface: attribute currentTransform]
expected: FAIL
[CanvasRenderingContext2D interface: operation scale(unrestricted double,unrestricted double)]
expected: FAIL
[CanvasRenderingContext2D interface: operation rotate(unrestricted double)]
expected: FAIL
[CanvasRenderingContext2D interface: operation translate(unrestricted double,unrestricted double)]
expected: FAIL
[CanvasRenderingContext2D interface: operation transform(unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double)]
expected: FAIL
[CanvasRenderingContext2D interface: operation setTransform(unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double)]
expected: FAIL
[CanvasRenderingContext2D interface: operation resetTransform()]
expected: FAIL
@ -7002,12 +6990,6 @@
[CanvasRenderingContext2D interface: attribute imageSmoothingEnabled]
expected: FAIL
[CanvasRenderingContext2D interface: attribute strokeStyle]
expected: FAIL
[CanvasRenderingContext2D interface: attribute fillStyle]
expected: FAIL
[CanvasRenderingContext2D interface: operation createLinearGradient(double,double,double,double)]
expected: FAIL
@ -7029,15 +7011,9 @@
[CanvasRenderingContext2D interface: attribute shadowColor]
expected: FAIL
[CanvasRenderingContext2D interface: operation beginPath()]
expected: FAIL
[CanvasRenderingContext2D interface: operation fill(CanvasFillRule)]
expected: FAIL
[CanvasRenderingContext2D interface: operation fill(Path2D,CanvasFillRule)]
expected: FAIL
[CanvasRenderingContext2D interface: operation stroke()]
expected: FAIL
@ -7146,21 +7122,12 @@
[CanvasRenderingContext2D interface: attribute direction]
expected: FAIL
[CanvasRenderingContext2D interface: operation closePath()]
expected: FAIL
[CanvasRenderingContext2D interface: operation moveTo(unrestricted double,unrestricted double)]
expected: FAIL
[CanvasRenderingContext2D interface: operation lineTo(unrestricted double,unrestricted double)]
expected: FAIL
[CanvasRenderingContext2D interface: operation quadraticCurveTo(unrestricted double,unrestricted double,unrestricted double,unrestricted double)]
expected: FAIL
[CanvasRenderingContext2D interface: operation bezierCurveTo(unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double)]
expected: FAIL
[CanvasRenderingContext2D interface: operation arcTo(unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double)]
expected: FAIL
@ -7194,36 +7161,12 @@
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "currentTransform" with the proper type (6)]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "scale" with the proper type (7)]
expected: FAIL
[CanvasRenderingContext2D interface: calling scale(unrestricted double,unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "rotate" with the proper type (8)]
expected: FAIL
[CanvasRenderingContext2D interface: calling rotate(unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "translate" with the proper type (9)]
expected: FAIL
[CanvasRenderingContext2D interface: calling translate(unrestricted double,unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "transform" with the proper type (10)]
expected: FAIL
[CanvasRenderingContext2D interface: calling transform(unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "setTransform" with the proper type (11)]
expected: FAIL
[CanvasRenderingContext2D interface: calling setTransform(unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "resetTransform" with the proper type (12)]
expected: FAIL
@ -7272,18 +7215,6 @@
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "shadowColor" with the proper type (24)]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "beginPath" with the proper type (28)]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "fill" with the proper type (29)]
expected: FAIL
[CanvasRenderingContext2D interface: calling fill(CanvasFillRule) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "fill" with the proper type (30)]
expected: FAIL
[CanvasRenderingContext2D interface: calling fill(Path2D,CanvasFillRule) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError]
expected: FAIL
@ -7452,15 +7383,6 @@
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "direction" with the proper type (69)]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "closePath" with the proper type (70)]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "moveTo" with the proper type (71)]
expected: FAIL
[CanvasRenderingContext2D interface: calling moveTo(unrestricted double,unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "lineTo" with the proper type (72)]
expected: FAIL
@ -7473,12 +7395,6 @@
[CanvasRenderingContext2D interface: calling quadraticCurveTo(unrestricted double,unrestricted double,unrestricted double,unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "bezierCurveTo" with the proper type (74)]
expected: FAIL
[CanvasRenderingContext2D interface: calling bezierCurveTo(unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError]
expected: FAIL
[CanvasRenderingContext2D interface: document.createElement("canvas").getContext("2d") must inherit property "arcTo" with the proper type (75)]
expected: FAIL
@ -7509,33 +7425,15 @@
[CanvasRenderingContext2D interface: calling ellipse(unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,unrestricted double,boolean) on document.createElement("canvas").getContext("2d") with too few arguments must throw TypeError]
expected: FAIL
[CanvasGradient interface: existence and properties of interface object]
expected: FAIL
[CanvasGradient interface object length]
expected: FAIL
[CanvasGradient interface: existence and properties of interface prototype object]
expected: FAIL
[CanvasGradient interface: existence and properties of interface prototype object\'s "constructor" property]
expected: FAIL
[CanvasGradient interface: operation addColorStop(double,DOMString)]
expected: FAIL
[CanvasPattern interface: existence and properties of interface object]
expected: FAIL
[CanvasPattern interface object length]
expected: FAIL
[CanvasPattern interface: existence and properties of interface prototype object]
expected: FAIL
[CanvasPattern interface: existence and properties of interface prototype object\'s "constructor" property]
expected: FAIL
[CanvasPattern interface: operation setTransform(SVGMatrix)]
expected: FAIL

View file

@ -1,5 +0,0 @@
[2d.getcontext.shared.html]
type: testharness
[getContext(\'2d\') returns objects which share canvas state]
expected: FAIL

View file

@ -1,5 +0,0 @@
[2d.type.extend.html]
type: testharness
[Interface methods can be added]
expected: FAIL

View file

@ -1,5 +0,0 @@
[2d.type.prototype.html]
type: testharness
[window.CanvasRenderingContext2D.prototype are not [[Writable\]\] and not [[Configurable\]\], and its methods are [[Configurable\]\].]
expected: FAIL

View file

@ -1,5 +0,0 @@
[2d.type.replace.html]
type: testharness
[Interface methods can be overridden]
expected: FAIL

View file

@ -1,5 +0,0 @@
[initial.reset.different.html]
type: testharness
[Changing size resets canvas to transparent black]
expected: FAIL

View file

@ -1,5 +0,0 @@
[initial.reset.same.html]
type: testharness
[Setting size (not changing the value) resets canvas to transparent black]
expected: FAIL

View file

@ -1,5 +0,0 @@
[initial.reset.transform.html]
type: testharness
[Resetting the canvas state resets the current transformation matrix]
expected: FAIL

View file

@ -21,12 +21,6 @@
[The DrawingStyle interface object should be exposed.]
expected: FAIL
[The CanvasGradient interface object should be exposed.]
expected: FAIL
[The CanvasPattern interface object should be exposed.]
expected: FAIL
[The Path interface object should be exposed.]
expected: FAIL