Bug 250662 - CreatePattern for zero height image should return null
Summary: CreatePattern for zero height image should return null
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: Safari Technology Preview
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Anne van Kesteren
URL:
Keywords: BrowserCompat, InRadar, WPTImpact
Depends on:
Blocks:
 
Reported: 2023-01-15 19:27 PST by Karl Dubost
Modified: 2023-08-27 01:47 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Karl Dubost 2023-01-15 19:27:52 PST
The first two steps of createPattern(img, repetition)

> 1. Let usability be the result of checking the usability of image.
> 2. If usability is bad, then return null.https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createpattern-dev

The usability of the image is assessed as: 

> If image has an intrinsic width or intrinsic height (or both) equal to zero, then return bad.
https://html.spec.whatwg.org/multipage/canvas.html#check-the-usability-of-the-image-argument


The WPT test fails in Safari TP 161 while it pass in both firefox and chrome.
http://wpt.live/html/canvas/element/fill-and-stroke-styles/2d.pattern.image.zeroheight.html
https://wpt.fyi/results/html/canvas/element/fill-and-stroke-styles/2d.pattern.image.zeroheight.html

The code currently doesn't check the height of the image.
https://searchfox.org/wubkat/rev/18e40f7108b3aa25f33242319e32278e08e25e44/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp#1984-2015
Comment 1 Radar WebKit Bug Importer 2023-01-15 19:28:03 PST
<rdar://problem/104285727>
Comment 2 Anne van Kesteren 2023-08-26 09:39:24 PDT
Pull request: https://github.com/WebKit/WebKit/pull/17107
Comment 3 EWS 2023-08-27 01:47:15 PDT
Committed 267334@main (94656d3143fa): <https://commits.webkit.org/267334@main>

Reviewed commits have been landed. Closing PR #17107 and removing active labels.