Index: LayoutTests/fast/canvas/script-tests/canvas-isPointInPath-winding.js |
diff --git a/LayoutTests/fast/canvas/script-tests/canvas-isPointInPath-winding.js b/LayoutTests/fast/canvas/script-tests/canvas-isPointInPath-winding.js |
index 30d0a46d65d8d0611587f19446c9c67b4fd4fd7f..a9f0d50d38eea4be07f5404435abaa07a64a977c 100644 |
--- a/LayoutTests/fast/canvas/script-tests/canvas-isPointInPath-winding.js |
+++ b/LayoutTests/fast/canvas/script-tests/canvas-isPointInPath-winding.js |
@@ -1,24 +1,17 @@ |
description("Series of tests to ensure correct results of the winding rule in isPointInPath."); |
- |
var tmpimg = document.createElement('canvas'); |
tmpimg.width = 200; |
tmpimg.height = 200; |
ctx = tmpimg.getContext('2d'); |
-// Create the image for blending test with images. |
-var img = document.createElement('canvas'); |
-img.width = 100; |
-img.height = 100; |
-var imgCtx = img.getContext('2d'); |
- |
// Execute test. |
function prepareTestScenario() { |
debug('Testing default isPointInPath'); |
ctx.beginPath(); |
ctx.rect(0, 0, 100, 100); |
ctx.rect(25, 25, 50, 50); |
- shouldBeTrue("ctx.isPointInPath(50, 50)"); |
+ shouldBeTrue("ctx.isPointInPath(50, 50)"); |
debug(''); |
debug('Testing nonzero isPointInPath'); |
@@ -32,7 +25,31 @@ function prepareTestScenario() { |
ctx.beginPath(); |
ctx.rect(0, 0, 100, 100); |
ctx.rect(25, 25, 50, 50); |
- shouldBeFalse("ctx.isPointInPath(50, 50, 'evenodd')"); |
+ shouldBeFalse("ctx.isPointInPath(50, 50, 'evenodd')"); |
+ debug(''); |
+ |
+ // reset path in context |
+ ctx.beginPath(); |
+ |
+ debug('Testing default isPointInPath with Path object'); |
+ path = new Path(); |
+ path.rect(0, 0, 100, 100); |
+ path.rect(25, 25, 50, 50); |
+ shouldBeTrue("ctx.isPointInPath(path, 50, 50)"); |
+ debug(''); |
+ |
+ debug('Testing nonzero isPointInPath with Path object'); |
+ path = new Path(); |
+ path.rect(0, 0, 100, 100); |
+ path.rect(25, 25, 50, 50); |
+ shouldBeTrue("ctx.isPointInPath(path, 50, 50, 'nonzero')"); |
+ debug(''); |
+ |
+ debug('Testing evenodd isPointInPath with Path object'); |
+ path = new Path(); |
+ path.rect(0, 0, 100, 100); |
+ path.rect(25, 25, 50, 50); |
+ shouldBeFalse("ctx.isPointInPath(path, 50, 50, 'evenodd')"); |
debug(''); |
} |