Summary: | CanvasRenderingContext2D.setTransfrom() reads only the aliases attributes of DOMMatrix2DInit | ||||||||
---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Kagami Sascha Rosylight <saschanaz> | ||||||
Component: | Canvas | Assignee: | Said Abou-Hallawa <sabouhallawa> | ||||||
Status: | RESOLVED FIXED | ||||||||
Severity: | Normal | CC: | cdumez, commit-queue, dino, esprehn+autocc, ews-watchlist, gyuyoung.kim, sabouhallawa, simon.fraser, webkit-bug-importer | ||||||
Priority: | P2 | Keywords: | InRadar | ||||||
Version: | WebKit Nightly Build | ||||||||
Hardware: | Unspecified | ||||||||
OS: | Linux | ||||||||
Attachments: |
|
Description
Kagami Sascha Rosylight
2019-07-16 20:55:46 PDT
Created attachment 374689 [details]
Patch
Comment on attachment 374689 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=374689&action=review > Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:916 > + setTransform(matrixInit.m11.valueOr(1), matrixInit.m12.valueOr(0), matrixInit.m21.valueOr(0), matrixInit.m22.valueOr(1), matrixInit.m41.valueOr(0), matrixInit.m42.valueOr(0)); Should this be matrixInit.m11.valueOr(matrixInit.a.valueOr(1)) etc? Comment on attachment 374689 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=374689&action=review >> Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:916 >> + setTransform(matrixInit.m11.valueOr(1), matrixInit.m12.valueOr(0), matrixInit.m21.valueOr(0), matrixInit.m22.valueOr(1), matrixInit.m41.valueOr(0), matrixInit.m42.valueOr(0)); > > Should this be matrixInit.m11.valueOr(matrixInit.a.valueOr(1)) etc? Just before this line we call DOMMatrixReadOnly::validateAndFixup(matrixInit) which ensures the m** fields are set if they are not set and the aliases fields are set for example. if (!init.m11) init.m11 = init.a.valueOr(1); So I think I do not need to repeat this code again here. Comment on attachment 374689 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=374689&action=review >>> Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp:916 >>> + setTransform(matrixInit.m11.valueOr(1), matrixInit.m12.valueOr(0), matrixInit.m21.valueOr(0), matrixInit.m22.valueOr(1), matrixInit.m41.valueOr(0), matrixInit.m42.valueOr(0)); >> >> Should this be matrixInit.m11.valueOr(matrixInit.a.valueOr(1)) etc? > > Just before this line we call DOMMatrixReadOnly::validateAndFixup(matrixInit) which ensures the m** fields are set if they are not set and the aliases fields are set for example. > > if (!init.m11) > init.m11 = init.a.valueOr(1); > > So I think I do not need to repeat this code again here. I think I should even use matrixInit.m11.value() since it has been set to a.valueOr(1). Created attachment 374691 [details]
Patch
Comment on attachment 374691 [details] Patch Clearing flags on attachment: 374691 Committed r247735: <https://trac.webkit.org/changeset/247735> All reviewed patches have been landed. Closing bug. |