Changeset 168400 in webkit
- Timestamp:
- May 6, 2014 7:25:00 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r168390 r168400 1 2014-05-06 Rik Cabanier <cabanier@adobe.com> 2 3 Calling createPattern with a broken image must throw an invalidstate error 4 https://bugs.webkit.org/show_bug.cgi?id=132407 5 6 Reviewed by Darin Adler. 7 8 * canvas/philip/tests/2d.pattern.image.broken-expected.txt: 9 * canvas/philip/tests/2d.pattern.image.broken.html: 10 * canvas/philip/tests/2d.pattern.image.incomplete.empty-expected.txt: 11 * canvas/philip/tests/2d.pattern.image.incomplete.empty.html: 12 * fast/canvas/canvas-empty-image-pattern-expected.txt: 13 * fast/dom/gc-9-expected.txt: 14 * fast/dom/gc-9.html: 15 * platform/mac/canvas/philip/tests/2d.pattern.image.broken-expected.txt: Removed. 16 * platform/mac/canvas/philip/tests/2d.pattern.image.incomplete.empty-expected.txt: Removed. 17 1 18 2014-05-06 Christophe Dumez <ch.dumez@samsung.com> 2 19 -
trunk/LayoutTests/canvas/philip/tests/2d.pattern.image.broken-expected.txt
r71481 r168400 1 1 Passed 2 -
trunk/LayoutTests/canvas/philip/tests/2d.pattern.image.broken.html
r71481 r168400 14 14 15 15 var img = document.getElementById('broken.png'); 16 _assertSame(img.complete, false, "img.complete", "false"); 17 _assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null"); 16 _assertSame(img.complete, true, "img.complete", "true"); 17 var _thrown = undefined; 18 try{ 19 ctx.createPattern(img, 'repeat'); 20 }catch(e) { 21 _thrown = e; 22 } 23 _assert(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError"); 18 24 19 25 20 26 }); 21 27 </script> 22 <img src=" ../images/broken.png" id="broken.png" class="resource">28 <img src="missing.png" id="broken.png" class="resource"> 23 29 -
trunk/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.empty-expected.txt
r71481 r168400 1 1 Passed 2 -
trunk/LayoutTests/canvas/philip/tests/2d.pattern.image.incomplete.empty.html
r71481 r168400 15 15 var img = document.getElementById('green.png'); 16 16 img.src = ""; 17 _assertSame(ctx.createPattern(img, 'repeat'), null, "ctx.createPattern(img, 'repeat')", "null"); 18 17 var _thrown = undefined; 18 try{ 19 ctx.createPattern(img, 'repeat'); 20 }catch(e) { 21 _thrown = e; 22 } 23 _assert(_thrown && _thrown.name == "InvalidStateError" && _thrown.code == DOMException.INVALID_STATE_ERR, "should throw InvalidStateError"); 19 24 20 25 }); -
trunk/LayoutTests/fast/canvas/canvas-empty-image-pattern-expected.txt
r82521 r168400 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 2 -
trunk/LayoutTests/fast/dom/gc-9-expected.txt
r112038 r168400 13 13 PASS: document.getElementsByTagName('canvas')[0].getContext('2d').myCustomProperty should be 1 and is. 14 14 PASS: document.getElementsByTagName('canvas')[0].getContext('2d').createLinearGradient(0, 0, 0, 0).myCustomProperty should be undefined and is. 15 PASS: document.getElementsByTagName('canvas')[0].getContext('2d').createPattern(new Image(), 'no-repeat').myCustomProperty should be undefined and is.16 15 PASS: document.getElementsByTagName('select')[0].options.myCustomProperty should be 1 and is. 17 16 PASS: document.body.childNodes.myCustomProperty should be 1 and is. … … 49 48 PASS: document.getElementsByTagName('canvas')[0].getContext('2d').myCustomProperty should be 1 and is. 50 49 PASS: document.getElementsByTagName('canvas')[0].getContext('2d').createLinearGradient(0, 0, 0, 0).myCustomProperty should be undefined and is. 51 PASS: document.getElementsByTagName('canvas')[0].getContext('2d').createPattern(new Image(), 'no-repeat').myCustomProperty should be undefined and is.52 50 PASS: document.getElementsByTagName('select')[0].options.myCustomProperty should be 1 and is. 53 51 PASS: document.body.childNodes.myCustomProperty should be 1 and is. -
trunk/LayoutTests/fast/dom/gc-9.html
r120792 r168400 122 122 [ "document.getElementsByTagName('canvas')[0].getContext('2d')", "allow custom" ], // CanvasRenderingContext2D 123 123 [ "document.getElementsByTagName('canvas')[0].getContext('2d').createLinearGradient(0, 0, 0, 0)" ], // CanvasGradient 124 [ "document.getElementsByTagName('canvas')[0].getContext('2d').createPattern(new Image(), 'no-repeat')" ], // CanvasPattern125 124 [ "document.getElementsByTagName('select')[0].options", "allow custom" ], 126 125 [ "document.body.childNodes", "allow custom" ], -
trunk/Source/WebCore/ChangeLog
r168399 r168400 1 2014-05-06 Rik Cabanier <cabanier@adobe.com> 2 3 Calling createPattern with a broken image must throw an invalidstate error 4 https://bugs.webkit.org/show_bug.cgi?id=132407 5 6 Reviewed by Darin Adler. 7 8 Updated createPattern so it throws an invalidState exception 9 if you pass it an image that is in the broken state. 10 11 Tests: 12 * canvas/philip/tests/2d.pattern.image.broken.html: 13 * canvas/philip/tests/2d.pattern.image.incomplete.empty.html: 14 * fast/canvas/canvas-empty-image-pattern.html: 15 16 * html/canvas/CanvasRenderingContext2D.cpp: 17 (WebCore::CanvasRenderingContext2D::createPattern): 18 1 19 2014-05-06 Jer Noble <jer.noble@apple.com> 2 20 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2D.cpp
r168092 r168400 1754 1754 1755 1755 CachedImage* cachedImage = image->cachedImage(); 1756 if (!cachedImage || !image->cachedImage()->imageForRenderer(image->renderer())) 1756 if (!cachedImage || cachedImage->status() == CachedResource::LoadError) { 1757 ec = INVALID_STATE_ERR; 1758 return 0; 1759 } 1760 1761 if (!image->cachedImage()->imageForRenderer(image->renderer())) 1757 1762 return CanvasPattern::create(Image::nullImage(), repeatX, repeatY, true); 1758 1763
Note: See TracChangeset
for help on using the changeset viewer.