Bug 222774 - Canvas: drawImage should normalize srcRect before checking if it's empty
Summary: Canvas: drawImage should normalize srcRect before checking if it's empty
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Canvas (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Lauro Moura
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-04 19:09 PST by Lauro Moura
Modified: 2021-03-05 15:07 PST (History)
11 users (show)

See Also:


Attachments
Patch (2.39 KB, patch)
2021-03-04 19:12 PST, Lauro Moura
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Lauro Moura 2021-03-04 19:09:56 PST
Canvas: drawImage should normalize srcRect before checking if it's empty
Comment 1 Lauro Moura 2021-03-04 19:12:55 PST
Created attachment 422321 [details]
Patch
Comment 2 EWS 2021-03-05 09:30:28 PST
commit-queue failed to commit attachment 422321 [details] to WebKit repository. To retry, please set cq+ flag again.
Comment 3 EWS 2021-03-05 10:41:36 PST
commit-queue failed to commit attachment 422321 [details] to WebKit repository. To retry, please set cq+ flag again.
Comment 4 EWS 2021-03-05 11:26:52 PST
Committed r273986: <https://commits.webkit.org/r273986>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 422321 [details].
Comment 5 Radar WebKit Bug Importer 2021-03-05 11:27:13 PST
<rdar://problem/75103972>
Comment 6 Darin Adler 2021-03-05 15:07:51 PST
Comment on attachment 422321 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=422321&action=review

> Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:1697
> +    if (!srcBitmapRect.contains(normalizedSrcRect) || !dstRect.width() || !dstRect.height())

Is the rendering correct in all the cases below when srcRect gets normalized? Noting that the code below uses srcRect not normalizedSrcRect.