From 5e2375a3b38687cc15c173bba1fcd566c748664f Mon Sep 17 00:00:00 2001 From: "jinho.bang@samsung.com" Date: Thu, 1 May 2014 09:25:38 +0000 Subject: Remove get/set currentPath in canvas currentPath is not the right way to apply a Path2D object to a context. Main argument is that currentPath creates a copy of the Path2D object. Instead we pass Path2D as argument to fill, stroke and clip now. (The way isn't defined in the w3c specification as well) Intent to Deprecate and Remove: https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/6l01Mv3VND0 BUG=362962 Review URL: https://codereview.chromium.org/226953004 git-svn-id: svn://svn.chromium.org/blink/trunk@173073 bbb929c8-8fbe-4397-9dbb-9b2b20218538 --- .../fast/canvas/script-tests/canvas-path-addpath.js | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-path-addpath.js') diff --git a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-path-addpath.js b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-path-addpath.js index fa583c2..4e8b5db 100644 --- a/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-path-addpath.js +++ b/third_party/WebKit/LayoutTests/fast/canvas/script-tests/canvas-path-addpath.js @@ -12,8 +12,7 @@ p2.rect(0,100,100,100); var m = ctx.currentTransform; p1.addPath(p2, m); ctx.fillStyle = 'yellow'; -ctx.currentPath = p1; -ctx.fill(); +ctx.fill(p1); var imageData = ctx.getImageData(0, 100, 100, 100); var imgdata = imageData.data; shouldBe("imgdata[4]", "255"); @@ -34,8 +33,7 @@ m.c = 0; m.d = 1; m.e = 100; m.f = -100; p3.addPath(p4, m); ctx.fillStyle = 'yellow'; -ctx.currentPath = p3; -ctx.fill(); +ctx.fill(p3); imageData = ctx.getImageData(100, 0, 100, 100); imgdata = imageData.data; shouldBe("imgdata[4]", "255"); @@ -56,8 +54,7 @@ m.c = 0; m.d = 0; m.e = 0; m.f = 0; p5.addPath(p6, m); ctx.fillStyle = 'yellow'; -ctx.currentPath = p5; -ctx.fill(); +ctx.fill(p5); imageData = ctx.getImageData(100, 100, 100, 100); imgdata = imageData.data; shouldNotBe("imgdata[4]", "255"); @@ -77,8 +74,7 @@ p7.addPath(p8, null); shouldThrow("p7.addPath(p8, [])"); shouldThrow("p7.addPath(p8, {})"); ctx.fillStyle = 'red'; -ctx.currentPath = p7; -ctx.fill(); +ctx.fill(p7); imageData = ctx.getImageData(100, 100, 100, 100); imgdata = imageData.data; shouldBe("imgdata[4]", "255"); @@ -95,8 +91,7 @@ var p10 = new Path2D(); p9.rect(0,0,10,10); p10.addPath(p9); ctx.fillStyle = 'red'; -ctx.currentPath = p10; -ctx.fill(); +ctx.fill(p10); imageData = ctx.getImageData(1, 1, 1, 1); imgdata = imageData.data; shouldBe("imgdata[0]", "255"); -- cgit v1.1