Bug 861938. Make the CanvasWindingRule arguments be treated as missing if undefined is passed in. r=smaug

This commit is contained in:
Boris Zbarsky 2013-06-05 20:51:22 -04:00
Родитель c9eca87821
Коммит 0c908271f1
3 изменённых файлов: 38 добавлений и 3 удалений

Просмотреть файл

@ -111,6 +111,7 @@ MOCHITEST_FILES = \
test_drawImage_document_domain.html \
test_mozDashOffset.html \
file_drawImage_document_domain.html \
test_windingRuleUndefined.html \
$(NULL)
ifneq (1_Linux,$(MOZ_SUITE)_$(OS_ARCH))

Просмотреть файл

@ -0,0 +1,34 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=861938
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 861938</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=861938">Mozilla Bug 861938</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
<script type="application/javascript">
/** Test for Bug 861938 **/
try {
var canvas = document.createElement("canvas");
canvas.getContext('2d').fill(undefined);
ok(true, "Should be able to pass undefined to fill()");
} catch(e) {
ok(false, "Should be able to pass undefined to fill()");
}
</script>
</body>
</html>

Просмотреть файл

@ -76,7 +76,7 @@ interface CanvasRenderingContext2D {
// path API (see also CanvasPathMethods)
void beginPath();
void fill(optional CanvasWindingRule winding = "nonzero");
void fill([TreatUndefinedAs=Missing] optional CanvasWindingRule winding = "nonzero");
// NOT IMPLEMENTED void fill(Path path);
void stroke();
// NOT IMPLEMENTED void stroke(Path path);
@ -86,10 +86,10 @@ interface CanvasRenderingContext2D {
// NOT IMPLEMENTED boolean drawCustomFocusRing(Path path, Element element);
// NOT IMPLEMENTED void scrollPathIntoView();
// NOT IMPLEMENTED void scrollPathIntoView(Path path);
void clip(optional CanvasWindingRule winding = "nonzero");
void clip([TreatUndefinedAs=Missing] optional CanvasWindingRule winding = "nonzero");
// NOT IMPLEMENTED void clip(Path path);
// NOT IMPLEMENTED void resetClip();
boolean isPointInPath(unrestricted double x, unrestricted double y, optional CanvasWindingRule winding = "nonzero");
boolean isPointInPath(unrestricted double x, unrestricted double y, [TreatUndefinedAs=Missing] optional CanvasWindingRule winding = "nonzero");
// NOT IMPLEMENTED boolean isPointInPath(Path path, unrestricted double x, unrestricted double y);
boolean isPointInStroke(double x, double y);