diff options
author | mrowe@apple.com <mrowe@apple.com@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2008-09-03 06:01:15 +0000 |
---|---|---|
committer | mrowe@apple.com <mrowe@apple.com@bbb929c8-8fbe-4397-9dbb-9b2b20218538> | 2008-09-03 06:01:15 +0000 |
commit | 5fee3f743d12d7ff71505f47541849f61c2ab559 (patch) | |
tree | e45d1b6dcde6b1ba078f4dd99fd4787bcfe656c2 /third_party/WebKit/LayoutTests/fast/canvas/canvas-invalid-strokestyle.js | |
parent | 4a2595e84e3f9c28c7f16f610298481f13c97f6a (diff) | |
download | chromium_src-5fee3f743d12d7ff71505f47541849f61c2ab559.zip chromium_src-5fee3f743d12d7ff71505f47541849f61c2ab559.tar.gz chromium_src-5fee3f743d12d7ff71505f47541849f61c2ab559.tar.bz2 |
2008-09-02 Dirk Schulze <vbs85@gmx.de>
Reviewed by Darin Adler.
Fallback on invalid fill or stroke styles in Canvas was
transparent black. Changed it to last valid style.
Canvas fillStyle() and strokeStyle() needs fallback
https://bugs.webkit.org/show_bug.cgi?id=20474
Tests: fast/canvas/canvas-invalid-fillstyle.html
fast/canvas/canvas-invalid-strokestyle.html
* html/CanvasStyle.cpp:
(WebCore::CanvasStyle::applyStrokeColor):
(WebCore::CanvasStyle::applyFillColor):
2008-09-02 Dirk Schulze <vbs85@gmx.de>
Reviewed by Darin Adler.
Tests for https://bugs.webkit.org/show_bug.cgi?id=20474
Tests behaviour on invalid fillStyle() or strokeStyle() in canvas.
* fast/canvas/canvas-invalid-fillstyle-expected.txt: Added.
* fast/canvas/canvas-invalid-fillstyle.html: Added.
* fast/canvas/canvas-invalid-fillstyle.js: Added.
* fast/canvas/canvas-invalid-strokestyle-expected.txt: Added.
* fast/canvas/canvas-invalid-strokestyle.html: Added.
* fast/canvas/canvas-invalid-strokestyle.js: Added.
git-svn-id: svn://svn.chromium.org/blink/trunk@36044 bbb929c8-8fbe-4397-9dbb-9b2b20218538
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/canvas/canvas-invalid-strokestyle.js')
-rw-r--r-- | third_party/WebKit/LayoutTests/fast/canvas/canvas-invalid-strokestyle.js | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-invalid-strokestyle.js b/third_party/WebKit/LayoutTests/fast/canvas/canvas-invalid-strokestyle.js new file mode 100644 index 0000000..a45b010 --- /dev/null +++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-invalid-strokestyle.js @@ -0,0 +1,15 @@ +description("Series of tests to ensure correct behaviour on an invalid strokeStyle()"); +var ctx = document.getElementById('canvas').getContext('2d'); +ctx.strokeStyle = 'rgb(0, 255, 0)'; +ctx.strokeStyle = 'nonsense'; +ctx.lineWidth = 200; +ctx.moveTo(0,100); +ctx.lineTo(200,100); +ctx.stroke(); +var imageData = ctx.getImageData(0, 0, 200, 200); +var imgdata = imageData.data; +shouldBe("imgdata[4]", "0"); +shouldBe("imgdata[5]", "255"); +shouldBe("imgdata[6]", "0"); + +var successfullyParsed = true; |