<?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>217286</bug_id>
          
          <creation_ts>2020-10-03 17:39:31 -0700</creation_ts>
          <short_desc>CSS transform doesn&apos;t override transform attribute on SVG element</short_desc>
          <delta_ts>2022-09-03 11:20:12 -0700</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>WebKit Nightly Build</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter>leewhite128</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>bfulgham</cc>
    
    <cc>dino</cc>
    
    <cc>graouts</cc>
    
    <cc>krit</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>zalan</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1694482</commentid>
    <comment_count>0</comment_count>
    <who name="">leewhite128</who>
    <bug_when>2020-10-03 17:39:31 -0700</bug_when>
    <thetext>User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:81.0) Gecko/20100101 Firefox/81.0

Steps to reproduce:

Have SVG element with transform attribute and CSS transform set. Example: &lt;svg&gt;
&lt;style&gt;
circle {transform: none;}
&lt;/style&gt;
&lt;circle r=&quot;50&quot; transform=&quot;scale(2)&quot;/&gt;
&lt;/svg&gt;

Originally posted here: https://stackoverflow.com/questions/25926007/override-svg-transform-attributes-with-css
Equivalent chromium issue: https://bugs.chromium.org/p/chromium/issues/detail?id=415950

Actual results:

Transform didn&apos;t get set to none.

Expected results:

Transform should have been set to none, that way can easily set transform on multiple SVG elements at once if prefers-reduced-motion is on.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1694575</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2020-10-04 14:25:15 -0700</bug_when>
    <thetext>&lt;rdar://problem/69934881&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1699264</commentid>
    <comment_count>2</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2020-10-19 08:55:12 -0700</bug_when>
    <thetext>I bet this is due to this in SVGGraphicsElement::animatedLocalTransform():

    bool hasSpecifiedTransform = style &amp;&amp; style-&gt;hasTransform();

I don&apos;t think this can tell whether the transform property was set explicitly on the element, it only checks whether there are operations in the StyleTransformData. We need a different call that determines whether the transform property was explicitly set on this element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1699266</commentid>
    <comment_count>3</comment_count>
      <attachid>411749</attachid>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2020-10-19 08:59:41 -0700</bug_when>
    <thetext>Created attachment 411749
Testcase</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1699267</commentid>
    <comment_count>4</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2020-10-19 09:00:14 -0700</bug_when>
    <thetext>The attached test only has the behavior expected by the originator in Chrome. In Firefox and Safari setting `transform: none` in CSS does not affect the element.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1699335</commentid>
    <comment_count>5</comment_count>
    <who name="Antoine Quint">graouts</who>
    <bug_when>2020-10-19 11:34:30 -0700</bug_when>
    <thetext>Actually, if I understand the spec correctly, presentation attributes should be considered during style resolution, per https://www.w3.org/TR/css-transforms-1/#transform-attribute-specificity:

&quot;The participation in the CSS cascade is determined by the specificity of presentation attributes in the SVG specification. According to SVG, user agents conceptually insert a new author style sheet for presentation attributes, which is the first in the author style sheet collection.&quot;

So I think we should always be using what is set in the RenderStyle, assuming the RenderStyle accounts for presentation attributes :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1896048</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-09-03 11:19:59 -0700</bug_when>
    <thetext>I am not sure on web-spec but Safari 15.6.1, Safari Technology Preview 152 and Firefox Nightly 106 are matching each other in test case and showing circle &apos;bigger / larger&apos; in size compared to Chrome Canary 107. Just wanted to share updated testing results. Thanks!</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>411749</attachid>
            <date>2020-10-19 08:59:41 -0700</date>
            <delta_ts>2020-10-19 08:59:41 -0700</delta_ts>
            <desc>Testcase</desc>
            <filename>css-transform-none-override-presentation-attribute.svg</filename>
            <type>image/svg+xml</type>
            <size>145</size>
            <attacher name="Antoine Quint">graouts</attacher>
            
              <data encoding="base64">PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8c3R5bGU+CmNpcmNsZSB7
IHRyYW5zZm9ybTogbm9uZSB9Cjwvc3R5bGU+CjxjaXJjbGUgY3g9IjUwIiBjeT0iNTAiIHI9IjUw
IiB0cmFuc2Zvcm09InNjYWxlKDIpIi8+Cjwvc3ZnPg==
</data>

          </attachment>
      

    </bug>

</bugzilla>