⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 284853 in webkit


Ignore:
Timestamp:
Oct 25, 2021, 6:44:38 PM (5 years ago)
Author:
commit-queue@webkit.org
Message:

Fix issue for transform-origin in SVG
https://bugs.webkit.org/show_bug.cgi?id=232189

Patch by Nikolaos Mouchtaris <Nikos Mouchtaris> on 2021-10-25
Reviewed by Simon Fraser.

LayoutTests/imported/w3c:

  • web-platform-tests/svg/styling/render/transform-origin-not-explicit-style-ref.svg: Added.
  • web-platform-tests/svg/styling/render/transform-origin-not-explicit-style.svg: Added.

Source/WebCore:

Add temp fix to use previously ignored transform-origin in SVGGraphicsElement::animatedLocalTransform
if not explicitly set in style. Proper fix to come: https://bugs.webkit.org/show_bug.cgi?id=232128.

Tests: imported/w3c/web-platform-tests/svg/styling/render/transform-origin-not-explicit-style-ref.svg

imported/w3c/web-platform-tests/svg/styling/render/transform-origin-not-explicit-style.svg

  • svg/SVGGraphicsElement.cpp:

(WebCore::SVGGraphicsElement::animatedLocalTransform const):

Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/imported/w3c/ChangeLog

    r284821 r284853  
     12021-10-25  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
     2
     3        Fix issue for transform-origin in SVG
     4        https://bugs.webkit.org/show_bug.cgi?id=232189
     5
     6        Reviewed by Simon Fraser.
     7
     8        * web-platform-tests/svg/styling/render/transform-origin-not-explicit-style-ref.svg: Added.
     9        * web-platform-tests/svg/styling/render/transform-origin-not-explicit-style.svg: Added.
     10
    1112021-10-25  Chris Dumez  <cdumez@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r284844 r284853  
     12021-10-25  Nikolaos Mouchtaris  <nmouchtaris@apple.com>
     2
     3        Fix issue for transform-origin in SVG
     4        https://bugs.webkit.org/show_bug.cgi?id=232189
     5
     6        Reviewed by Simon Fraser.
     7
     8        Add temp fix to use previously ignored transform-origin in SVGGraphicsElement::animatedLocalTransform
     9        if not explicitly set in style. Proper fix to come: https://bugs.webkit.org/show_bug.cgi?id=232128.
     10
     11        Tests: imported/w3c/web-platform-tests/svg/styling/render/transform-origin-not-explicit-style-ref.svg
     12               imported/w3c/web-platform-tests/svg/styling/render/transform-origin-not-explicit-style.svg
     13
     14        * svg/SVGGraphicsElement.cpp:
     15        (WebCore::SVGGraphicsElement::animatedLocalTransform const):
     16
    1172021-10-25  Chris Fleizach  <cfleizach@apple.com>
    218
  • trunk/Source/WebCore/svg/SVGGraphicsElement.cpp

    r282379 r284853  
    100100
    101101    // If we didn't have the CSS "transform" property set, we must account for the "transform" attribute.
    102     if (!hasSpecifiedTransform)
     102    if (!hasSpecifiedTransform && style) {
     103        auto boundingBox = SVGRenderSupport::transformReferenceBox(*renderer(), *this, *style);
     104        auto t = floatPointForLengthPoint(style->transformOriginXY(), boundingBox.size());
     105        matrix.translate(t);
    103106        matrix *= transform().concatenate();
     107        matrix.translate(-t.x(), -t.y());
     108    }
    104109
    105110    if (m_supplementalTransform)
Note: See TracChangeset for help on using the changeset viewer.