Changeset 270126 in webkit
- Timestamp:
- Nov 20, 2020 11:58:40 AM (20 months ago)
- Location:
- trunk
- Files:
-
- 1 added
- 1 deleted
- 5 edited
- 1 moved
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap-expected.txt (modified) (1 diff)
-
LayoutTests/http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap.html (modified) (1 diff)
-
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/canvas/offscreen/drawing-images-to-the-canvas (added)
-
LayoutTests/platform/glib/imported/w3c/web-platform-tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource-expected.txt (moved) (moved from trunk/LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource-expected.txt)
-
LayoutTests/platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource-expected.txt (deleted)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r270124 r270126 1 2020-11-20 Lauro Moura <lmoura@igalia.com> 2 3 canvas: drawImage should not raise IndexSizeError on empty sources 4 https://bugs.webkit.org/show_bug.cgi?id=219068 5 6 Reviewed by Noam Rosenthal. 7 8 Update baselines and tests with new drawImage behavior of not raising IndexSizeError on empty src rects. 9 10 * http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap-expected.txt: Updated with new drawImage behavior 11 * http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap.html: Updated with new drawImage behavior 12 * platform/glib/imported/w3c/web-platform-tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource-expected.txt: Renamed from LayoutTests/platform/wpe/imported/w3c/web-platform-tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource-expected.txt. 13 * platform/gtk/imported/w3c/web-platform-tests/html/canvas/offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource-expected.txt: Removed. 14 1 15 2020-11-20 Truitt Savell <tsavell@apple.com> 2 16 -
trunk/LayoutTests/http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap-expected.txt
r267644 r270126 6 6 PASS drawImage of ImageBitmap from HTMLImageElement with cropping and different non-zero origin 7 7 PASS drawImage throws with InvalidStateError if the ImageBitmap is closed 8 PASS drawImage throws with IndexSizeErrorif the source rectangle of the ImageBitmap is empty8 PASS drawImage does not draw if the source rectangle of the ImageBitmap is empty 9 9 -
trunk/LayoutTests/http/wpt/2dcontext/imagebitmap/drawImage-ImageBitmap.html
r263438 r270126 135 135 }).then(function(imageBitmap) { 136 136 let [canvas, ctx] = create9x9CanvasWith2dContext(); 137 assert_throws_dom("IndexSizeError", function () { 138 ctx.drawImage(imageBitmap, 0, 0, 0, 0, 0, 0, 9, 9); 139 }, "drawImage with an empty source rectangle should fail."); 137 ctx.drawImage(imageBitmap, 0, 0, 0, 0, 0, 0, 9, 9); 138 _assertPixel(canvas, 0,0, 0,0,0,0, "8,8", "0,0,0,0"); 139 _assertPixel(canvas, 4,4, 0,0,0,0, "8,8", "0,0,0,0"); 140 _assertPixel(canvas, 8,8, 0,0,0,0, "8,8", "0,0,0,0"); 140 141 }); 141 }, "drawImage throws with IndexSizeErrorif the source rectangle of the ImageBitmap is empty");142 }, "drawImage does not draw if the source rectangle of the ImageBitmap is empty"); 142 143 })(); 143 144 </script> -
trunk/Source/WebCore/ChangeLog
r270125 r270126 1 2020-11-20 Lauro Moura <lmoura@igalia.com> 2 3 canvas: drawImage should not raise IndexSizeError on empty sources 4 https://bugs.webkit.org/show_bug.cgi?id=219068 5 6 Reviewed by Noam Rosenthal. 7 8 Per 4.12.5.1.14 Drawing images[1] point 5, if the src rect has one of the dimensions zero, return silently. 9 10 [1] https://html.spec.whatwg.org/multipage/canvas.html#drawing-images 11 12 Covered by existing tests and fixes WPT offscreen/drawing-images-to-the-canvas/2d.drawImage.zerosource flakiness 13 14 * html/canvas/CanvasRenderingContext2DBase.cpp: 15 (WebCore::CanvasRenderingContext2DBase::drawImage): Return early instead of raising an exception if the rect is empty. 16 1 17 2020-11-20 Simon Fraser <simon.fraser@apple.com> 2 18 -
trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp
r270102 r270126 1666 1666 return Exception { InvalidStateError }; 1667 1667 1668 if ( !srcRect.width() || !srcRect.height())1669 return Exception { IndexSizeError};1668 if (srcRect.isEmpty()) 1669 return { }; 1670 1670 1671 1671 FloatRect srcBitmapRect = FloatRect(FloatPoint(), FloatSize(imageBitmap.width(), imageBitmap.height()));
Note: See TracChangeset
for help on using the changeset viewer.