Changeset 247735 in webkit


Ignore:
Timestamp:
Jul 23, 2019 1:39:25 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

CanvasRenderingContext2D.setTransfrom() reads only the aliases attributes of DOMMatrix2DInit
https://bugs.webkit.org/show_bug.cgi?id=199850

Patch by Said Abou-Hallawa <sabouhallawa@apple.com> on 2019-07-23
Reviewed by Simon Fraser.

Source/WebCore:

The validateAndFixup step of DOMMatrix2DInit sets the matrix attributes
(m fields) from the aliases attributes (a, b, c, d, e, f) if the former
ones do not exist and the later ones exist. See
https://www.w3.org/TR/geometry-1/#dommatrixinit-dictionary and
DOMMatrixReadOnly::validateAndFixup(DOMMatrix2DInit& init).

Since CanvasRenderingContext2DBase::setTransform() validates and fixes
the input DOMMatrix2DInit, it should rely on matrix attributes.

Test: fast/canvas/setTransfrom-aliases-transform.html

  • html/canvas/CanvasRenderingContext2DBase.cpp:

(WebCore::CanvasRenderingContext2DBase::setTransform):

LayoutTests:

  • fast/canvas/setTransfrom-aliases-transform-expected.html: Added.
  • fast/canvas/setTransfrom-aliases-transform.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r247730 r247735  
     12019-07-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        CanvasRenderingContext2D.setTransfrom() reads only the aliases attributes of DOMMatrix2DInit
     4        https://bugs.webkit.org/show_bug.cgi?id=199850
     5
     6        Reviewed by Simon Fraser.
     7
     8        * fast/canvas/setTransfrom-aliases-transform-expected.html: Added.
     9        * fast/canvas/setTransfrom-aliases-transform.html: Added.
     10
    1112019-07-23  Tim Horton  <timothy_horton@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r247734 r247735  
     12019-07-23  Said Abou-Hallawa  <sabouhallawa@apple.com>
     2
     3        CanvasRenderingContext2D.setTransfrom() reads only the aliases attributes of DOMMatrix2DInit
     4        https://bugs.webkit.org/show_bug.cgi?id=199850
     5
     6        Reviewed by Simon Fraser.
     7
     8        The validateAndFixup step of DOMMatrix2DInit sets the matrix attributes
     9        (m** fields) from the aliases attributes (a, b, c, d, e, f) if the former
     10        ones do not exist and the later ones exist. See
     11        https://www.w3.org/TR/geometry-1/#dommatrixinit-dictionary and
     12        DOMMatrixReadOnly::validateAndFixup(DOMMatrix2DInit& init).
     13
     14        Since CanvasRenderingContext2DBase::setTransform() validates and fixes
     15        the input DOMMatrix2DInit, it should rely on matrix attributes.
     16
     17        Test: fast/canvas/setTransfrom-aliases-transform.html
     18
     19        * html/canvas/CanvasRenderingContext2DBase.cpp:
     20        (WebCore::CanvasRenderingContext2DBase::setTransform):
     21
    1222019-07-23  Tim Horton  <timothy_horton@apple.com>
    223
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext2DBase.cpp

    r246285 r247735  
    914914        return checkValid.releaseException();
    915915
    916     setTransform(matrixInit.a.valueOr(1), matrixInit.b.valueOr(0), matrixInit.c.valueOr(0), matrixInit.d.valueOr(1), matrixInit.e.valueOr(0), matrixInit.f.valueOr(0));
     916    setTransform(matrixInit.m11.value(), matrixInit.m12.value(), matrixInit.m21.value(), matrixInit.m22.value(), matrixInit.m41.value(), matrixInit.m42.value());
    917917    return { };
    918918}
Note: See TracChangeset for help on using the changeset viewer.