Changeset 181888 in webkit
- Timestamp:
- Mar 23, 2015 11:47:40 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 10 added
- 9 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r181886 r181888 1 2015-03-23 Yoav Weiss <yoav@yoav.ws> 2 3 Update empty image canvas tests and fix a related bug 4 https://bugs.webkit.org/show_bug.cgi?id=142694 5 6 Reviewed by Chris Dumez. 7 8 Tests below imported from https://github.com/w3c/web-platform-tests/tree/master/2dcontext/drawing-images-to-the-canvas 9 * canvas/philip/tests/2d.drawImage.incomplete-expected.txt: Removed. 10 * canvas/philip/tests/2d.drawImage.incomplete.emptysrc-expected.txt: Added. 11 * canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html: Added. 12 * canvas/philip/tests/2d.drawImage.incomplete.html: Removed. 13 * canvas/philip/tests/2d.drawImage.incomplete.nosrc-expected.txt: Added. 14 * canvas/philip/tests/2d.drawImage.incomplete.nosrc.html: Added. 15 * canvas/philip/tests/2d.drawImage.incomplete.removedsrc-expected.txt: Added. 16 * canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html: Added. 17 18 Tests below imported from https://github.com/w3c/web-platform-tests/tree/master/2dcontext/fill-and-stroke-styles 19 * canvas/philip/tests/2d.pattern.image.incomplete-expected.txt: Removed. 20 * canvas/philip/tests/2d.pattern.image.incomplete.empty-expected.txt: Removed. 21 * canvas/philip/tests/2d.pattern.image.incomplete.empty.html: Removed. 22 * canvas/philip/tests/2d.pattern.image.incomplete.emptysrc-expected.txt: Added. 23 * canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html: Added. 24 * canvas/philip/tests/2d.pattern.image.incomplete.html: Removed. 25 * canvas/philip/tests/2d.pattern.image.incomplete.omitted-expected.txt: Removed. 26 * canvas/philip/tests/2d.pattern.image.incomplete.omitted.html: Removed. 27 * canvas/philip/tests/2d.pattern.image.incomplete.removedsrc-expected.txt: Added. 28 This test currently fails and will be fixed in https://bugs.webkit.org/show_bug.cgi?id=142677 29 * canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html: Added. 30 31 Test below imported from https://chromium.googlesource.com/chromium/blink/+/master/LayoutTests/fast/canvas/ 32 * fast/canvas/canvas-empty-image-pattern.html: Aligned with spec/Chrome. 33 * fast/canvas/canvas-empty-image-pattern-expected.txt: Aligned with spec/Chrome. 34 * TestExpectations: Added 2d.pattern.image.incomplete.removedsrc.html as an expected failure. 35 1 36 2015-03-23 Filip Pizlo <fpizlo@apple.com> 2 37 -
trunk/LayoutTests/TestExpectations
r181783 r181888 494 494 # contentfiltering/block-after-add-data.html times out unexpectedly 495 495 webkit.org/b/142894 contentfiltering/block-after-add-data.html [ Skip ] 496 webkit.org/b/142677 canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html [ Failure ] -
trunk/LayoutTests/fast/canvas/canvas-empty-image-pattern-expected.txt
r168400 r181888 1 CONSOLE MESSAGE: line 9: InvalidStateError: DOM Exception 11: An attempt was made to use an object that is not, or is no longer, usable. 1 TEST PASSED 2 2 -
trunk/LayoutTests/fast/canvas/canvas-empty-image-pattern.html
r120683 r181888 1 1 <!DOCTYPE HTML> 2 2 <title>Canvas test: filling a pattern with an empty image should not crash.</title> 3 <div id="console"></div> 3 4 <canvas id="canvas" class="output" width="100" height="100"><p class="fallback">FAIL (fallback content)</p></canvas> 4 5 <script> … … 7 8 8 9 var canvas = document.getElementById("canvas").getContext("2d"); 9 canvas.fillStyle = canvas.createPattern(new Image, "repeat") 10 canvas.fillRect(0,0,1,1) 10 var pattern = canvas.createPattern(new Image, "repeat") 11 if (pattern) 12 document.getElementById("console").innerHTML = "TEST FAILED"; 13 else 14 document.getElementById("console").innerHTML = "TEST PASSED"; 11 15 </script> -
trunk/Source/WebCore/ChangeLog
r181883 r181888 1 2015-03-23 Yoav Weiss <yoav@yoav.ws> 2 3 Update empty image canvas tests and fix a related bug 4 https://bugs.webkit.org/show_bug.cgi?id=142694 5 6 Reviewed by Chris Dumez. 7 8 During the work on https://bugs.webkit.org/show_bug.cgi?id=142677 9 we encountered an issue with canvas tests related to empty image handling 10 when drawn or used as a pattern. After updating these tests, an issue with 11 pattern handling was encountered. 12 13 The spec, as well as Chrome's implementation, say that when an empty image 14 is used as a pattern, createPattern should return null. See 15 https://html.spec.whatwg.org/multipage/scripting.html#fill-and-stroke-styles:check-the-usability-of-the-image-argument 16 Instead, createPattern returned an exception in this case. 17 This patch fixes that and makes sure that it returns a null when image loading hasn't started. 18 19 Tests: canvas/philip/tests/2d.drawImage.incomplete.emptysrc.html 20 canvas/philip/tests/2d.drawImage.incomplete.nosrc.html 21 canvas/philip/tests/2d.drawImage.incomplete.removedsrc.html 22 canvas/philip/tests/2d.pattern.image.incomplete.emptysrc.html 23 canvas/philip/tests/2d.pattern.image.incomplete.removedsrc.html 24 25 * html/canvas/CanvasRenderingContext2D.cpp: 26 (WebCore::CanvasRenderingContext2D::createPattern): Return "null" if image is not fully decodeable. 27 1 28 2015-03-23 Alex Christensen <achristensen@webkit.org> 2 29 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r180839 r181888 1752 1752 return nullptr; 1753 1753 1754 if (!image->complete()) 1754 CachedImage* cachedImage = image->cachedImage(); 1755 // If the image loading hasn't started or the image is not complete, it is not fully decodable. 1756 if (!cachedImage || !image->complete()) 1755 1757 return nullptr; 1756 1758 1757 CachedImage* cachedImage = image->cachedImage(); 1758 if (!cachedImage || cachedImage->status() == CachedResource::LoadError) { 1759 if (cachedImage->status() == CachedResource::LoadError) { 1759 1760 ec = INVALID_STATE_ERR; 1760 1761 return nullptr;
Note: See TracChangeset
for help on using the changeset viewer.