diff --git a/2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.NaN.html b/2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.NaN.html
new file mode 100644
index 00000000000000..28647ac55aabd2
--- /dev/null
+++ b/2dcontext/drawing-text-to-the-canvas/2d.text.draw.fill.maxWidth.NaN.html
@@ -0,0 +1,32 @@
+
+
+
Canvas test: 2d.text.draw.fill.maxWidth.NaN
+
+
+
+
+
+
+2d.text.draw.fill.maxWidth.NaN
+fillText handles maxWidth correctly
+
+
+Actual output:
+
+Expected output:
+
+
+
diff --git a/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colouralpha.html b/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colouralpha.html
index 3e20e6faa3f3b8..ad18881da38b61 100644
--- a/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colouralpha.html
+++ b/2dcontext/fill-and-stroke-styles/2d.gradient.interpolate.colouralpha.html
@@ -24,9 +24,9 @@ 2d.gradient.interpolate.colouralpha
g.addColorStop(1, 'rgba(0,0,255, 1)');
ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50);
-_assertPixelApprox(canvas, 25,25, 191,191,63,63, "25,25", "191,191,63,63", 3);
-_assertPixelApprox(canvas, 50,25, 127,127,127,127, "50,25", "127,127,127,127", 3);
-_assertPixelApprox(canvas, 75,25, 63,63,191,191, "75,25", "63,63,191,191", 3);
+_assertPixelApprox(canvas, 25,25, 190,190,65,65, "25,25", "190,190,65,65", 3);
+_assertPixelApprox(canvas, 50,25, 126,126,128,128, "50,25", "126,126,128,128", 3);
+_assertPixelApprox(canvas, 75,25, 62,62,192,192, "75,25", "62,62,192,192", 3);
});
diff --git a/2dcontext/image-smoothing/imagesmoothing.html b/2dcontext/image-smoothing/imagesmoothing.html
index ccc3110e8e8098..1a86a8f2015aba 100644
--- a/2dcontext/image-smoothing/imagesmoothing.html
+++ b/2dcontext/image-smoothing/imagesmoothing.html
@@ -1,45 +1,119 @@
-
-
- CanvasRenderingContext2D imageSmoothingEnabled test
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+CanvasRenderingContext2D imageSmoothingEnabled test
+
+
+
+
diff --git a/2dcontext/the-canvas-state/2d.state.saverestore.imageSmoothingEnabled.html b/2dcontext/the-canvas-state/2d.state.saverestore.imageSmoothingEnabled.html
new file mode 100644
index 00000000000000..e99be83d5ff281
--- /dev/null
+++ b/2dcontext/the-canvas-state/2d.state.saverestore.imageSmoothingEnabled.html
@@ -0,0 +1,47 @@
+
+
+CanvasRenderingContext2D imageSmoothingEnabled save/restore test
+
+
+
+
diff --git a/2dcontext/tools/gentest.py b/2dcontext/tools/gentest.py
index 500cb4d8bceb60..d1e151f17e0815 100644
--- a/2dcontext/tools/gentest.py
+++ b/2dcontext/tools/gentest.py
@@ -128,18 +128,18 @@ def f(c, start, depth):
doctest.testmod()
sys.exit()
-templates = yaml.load(open('templates.yaml').read())
-name_mapping = yaml.load(open('name2dir.yaml').read())
+templates = yaml.load(open('templates.yaml', "r").read())
+name_mapping = yaml.load(open('name2dir.yaml', "r").read())
spec_assertions = []
-for s in yaml.load(open('spec.yaml').read())['assertions']:
+for s in yaml.load(open('spec.yaml', "r").read())['assertions']:
if 'meta' in s:
eval(compile(s['meta'], '', 'exec'), {}, {'assertions':spec_assertions})
else:
spec_assertions.append(s)
tests = []
-for t in sum([ yaml.load(open(f).read()) for f in ['tests.yaml', 'tests2d.yaml', 'tests2dtext.yaml']], []):
+for t in sum([ yaml.load(open(f, "r").read()) for f in ['tests.yaml', 'tests2d.yaml', 'tests2dtext.yaml']], []):
if 'DISABLED' in t:
continue
if 'meta' in t:
@@ -543,7 +543,7 @@ def write_results():
if not os.path.exists('results.yaml'):
print "Can't find results.yaml"
else:
- for resultset in yaml.load(open('results.yaml').read()):
+ for resultset in yaml.load(open('results.yaml', "r").read()):
#title = "%s (%s)" % (resultset['ua'], resultset['time'])
title = resultset['name']
#assert title not in uas # don't allow repetitions
diff --git a/2dcontext/tools/specextract.py b/2dcontext/tools/specextract.py
index 679bf10e28545b..042c0bd84044fb 100644
--- a/2dcontext/tools/specextract.py
+++ b/2dcontext/tools/specextract.py
@@ -9,7 +9,7 @@
def extract():
parser = html5lib.html5parser.HTMLParser(tree=html5lib.treebuilders.dom.TreeBuilder)
- doc = parser.parse(open('current-work'), encoding='utf-8')
+ doc = parser.parse(open('current-work', "r"), encoding='utf-8')
head = doc.getElementsByTagName('head')[0]
for n in head.childNodes:
diff --git a/2dcontext/tools/tests2d.yaml b/2dcontext/tools/tests2d.yaml
index 4694e98d9af540..546e994fbe978a 100644
--- a/2dcontext/tools/tests2d.yaml
+++ b/2dcontext/tools/tests2d.yaml
@@ -1668,9 +1668,9 @@
g.addColorStop(1, 'rgba(0,0,255, 1)');
ctx.fillStyle = g;
ctx.fillRect(0, 0, 100, 50);
- @assert pixel 25,25 ==~ 191,191,63,63 +/- 3;
- @assert pixel 50,25 ==~ 127,127,127,127 +/- 3;
- @assert pixel 75,25 ==~ 63,63,191,191 +/- 3;
+ @assert pixel 25,25 ==~ 190,190,65,65 +/- 3;
+ @assert pixel 50,25 ==~ 126,126,128,128 +/- 3;
+ @assert pixel 75,25 ==~ 62,62,192,192 +/- 3;
expected: |
size 100 50
g = cairo.LinearGradient(0, 0, 100, 0)
diff --git a/2dcontext/tools/tests2dtext.yaml b/2dcontext/tools/tests2dtext.yaml
index e2358494eede61..96c65265c8d7d9 100644
--- a/2dcontext/tools/tests2dtext.yaml
+++ b/2dcontext/tools/tests2dtext.yaml
@@ -320,6 +320,19 @@
_assertGreen(ctx, 100, 50);
expected: green
+- name: 2d.text.draw.fill.maxWidth.NaN
+ desc: fillText handles maxWidth correctly
+ testing:
+ - 2d.text.draw.maxwidth
+ code: |
+ 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);
+ expected: green
+
- name: 2d.text.draw.stroke.basic
desc: strokeText draws stroked text
manual:
diff --git a/FileAPI/historical.html b/FileAPI/historical.html
index 3ff56a30164b33..a9ae674d457e13 100644
--- a/FileAPI/historical.html
+++ b/FileAPI/historical.html
@@ -36,13 +36,6 @@
assert_false(prefixes[i]+'BlobBuilder' in window, prefixes[i]+'BlobBuilder');
}
}, 'BlobBuilder should not be supported.');
-
- test(function() {
- var reader = new FileReader();
- assert_false('readAsBinaryString' in reader, 'should not be in reader');
- assert_equals(reader.readAsBinaryString, undefined,
- 'should be undefined on getting')
- }, 'FileReader should not support readAsBinaryString');