<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>192553</bug_id>
          
          <creation_ts>2018-12-10 03:58:51 -0800</creation_ts>
          <short_desc>SVG transform is not removed properly when a style with a CSS transform becomes inactive</short_desc>
          <delta_ts>2023-02-10 01:48:44 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>SVG</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>macOS 10.14</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>kari.pihkala</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>karlcow</cc>
    
    <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1486535</commentid>
    <comment_count>0</comment_count>
      <attachid>356954</attachid>
    <who name="">kari.pihkala</who>
    <bug_when>2018-12-10 03:58:51 -0800</bug_when>
    <thetext>Created attachment 356954
webkit-transform-bug.svg test case

Transforms for SVG elements are not reset when a style with a CSS transform becomes inactive.

Steps to reproduce:

1. Open https://codepen.io/anon/pen/QzwLyG?editors=1100 (or the attached test case which shows the same test)
2. Move the mouse over the blue box - it is scaled by 2. (using :hover style)
3. Move the mouse out of the blue box - the transform isn&apos;t set back to the initial non-scaled transform.

This works in Firefox 63 and Chrome 71. The blue box returns to the initial non-scaled transform.

The bug doesn&apos;t happen if the initial transform is given as a style in the stylesheet. The bug is visible only when setting the initial transform as an attribute. So, there seems to be something wrong how the transform attribute is handled.

Tested on Safari Technology Preview Release 71 (Safari 12.1, WebKit 14607.1.15). At least Safari 12.0 and 11 have the same bug.

Possibly related bugs (the SVG transform attribute has been promoted to a presentation attribute only recently):

Transforms tracking bug
https://bugs.webkit.org/show_bug.cgi?id=15670

Harmonize HTML &amp; SVG rendering
https://bugs.webkit.org/show_bug.cgi?id=90738

Merge CSS and SVG Transforms according to CSS3 Transforms
https://bugs.webkit.org/show_bug.cgi?id=70025

Master bug: Turn more SVG attributes to presentation attributes
https://bugs.webkit.org/show_bug.cgi?id=135045

Scaled SVG elements are leaving artifacts during animation
https://bugs.webkit.org/show_bug.cgi?id=177524

SVG transitions of transforms are not properly reset after the transition is removed
https://bugs.webkit.org/show_bug.cgi?id=183433</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1486536</commentid>
    <comment_count>1</comment_count>
    <who name="">kari.pihkala</who>
    <bug_when>2018-12-10 04:18:35 -0800</bug_when>
    <thetext>This codepen shows that the opacity, width and height presentation attributes work just fine in a similar situation. So, the issue seems to be specific to the transform attribute and property.

https://codepen.io/anon/pen/WLbeqd?editors=1100</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1486728</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2018-12-10 14:05:40 -0800</bug_when>
    <thetext>&lt;rdar://problem/46607710&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1925556</commentid>
    <comment_count>3</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-01-14 06:17:19 -0800</bug_when>
    <thetext>Attached Test case and test case from Comment 01 seems to work fine in Safari 16.2 and Safari Technology Preview 161 and after leaving mouse out, the blue box return back to initial state.

Appreciate if someone can confirm since I am not able to reproduce this. Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1925723</commentid>
    <comment_count>4</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-01-15 17:47:13 -0800</bug_when>
    <thetext>This is working for me too.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1932586</commentid>
    <comment_count>5</comment_count>
    <who name="">kari.pihkala</who>
    <bug_when>2023-02-10 01:48:44 -0800</bug_when>
    <thetext>This is also working for me now. I tested Safari 16.3. Great!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>356954</attachid>
            <date>2018-12-10 03:58:51 -0800</date>
            <delta_ts>2018-12-10 03:58:51 -0800</delta_ts>
            <desc>webkit-transform-bug.svg test case</desc>
            <filename>webkit-transform-bug.svg</filename>
            <type>image/svg+xml</type>
            <size>391</size>
            <attacher>kari.pihkala</attacher>
            
              <data encoding="base64">PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0iVVRGLTgiIHN0YW5kYWxvbmU9Im5vIj8+Cjxz
dmcgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2aWV3Qm94PSIwIDAgNDAwIDQw
MCI+Cgo8c3R5bGU+CiNyZWN0YW5nbGU6aG92ZXIgeyB0cmFuc2Zvcm06IHRyYW5zbGF0ZSgxMHB4
LCAxMHB4KSBzY2FsZSgyLCAyKTsgfQo8L3N0eWxlPgoKPHJlY3QgaWQ9InJlY3RhbmdsZSIgd2lk
dGg9IjEwIiBoZWlnaHQ9IjEwIiBmaWxsPSIjMDAwMGZmIiB0cmFuc2Zvcm09InRyYW5zbGF0ZSgx
MCwxMCkiLz4KPHJlY3Qgd2lkdGg9IjEwIiBoZWlnaHQ9IjEwIiBzdHJva2U9IiM4MDgwODAiIGZp
bGw9Im5vbmUiIHRyYW5zZm9ybT0idHJhbnNsYXRlKDEwLDEwKSIvPgoKPC9zdmc+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>