<?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>187428</bug_id>
          
          <creation_ts>2018-07-06 21:26:24 -0700</creation_ts>
          <short_desc>SVGAnimationElement is bloated by members of SVGTests</short_desc>
          <delta_ts>2018-07-06 21:53:57 -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>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Simon Fraser (smfr)">simon.fraser</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>sabouhallawa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1440089</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-07-06 21:26:24 -0700</bug_when>
    <thetext>SVGAnimationElement inherits from SVGTests, which has:
    SVGSynchronizableAnimatedProperty&lt;SVGStringListValues&gt; m_requiredFeatures;
    SVGSynchronizableAnimatedProperty&lt;SVGStringListValues&gt; m_requiredExtensions;
    SVGSynchronizableAnimatedProperty&lt;SVGStringListValues&gt; m_systemLanguage;

I don&apos;t know why we could have inline data members for attributes that are probably unspecified on 99.9% of SVG elements. Also, these attributes are not animatable according to spec, so I don&apos;t know why they have to use SVGSynchronizableAnimatedProperty.

The class layout is very inefficient, because there&apos;s padding between each of these data members;


 19$ $ ./Tools/Scripts/dump-class-layout -c Release WebCore SVGPathElement
  +0 &lt;416&gt; SVGPathElement
  +0 &lt;312&gt;     WebCore::SVGGeometryElement WebCore::SVGGeometryElement
  +0 &lt;304&gt;         WebCore::SVGGraphicsElement WebCore::SVGGraphicsElement
  +0 &lt;160&gt;             WebCore::SVGElement WebCore::SVGElement
  +0 &lt; 96&gt;                 WebCore::StyledElement WebCore::StyledElement
  +0 &lt; 96&gt;                     WebCore::Element WebCore::Element
  +0 &lt; 80&gt;                         WebCore::ContainerNode WebCore::ContainerNode
  +0 &lt; 64&gt;                             WebCore::Node WebCore::Node
  +0 &lt; 16&gt;                                 WebCore::EventTarget WebCore::EventTarget
  +0 &lt;  8&gt;                                    __vtbl_ptr_type * _vptr
  +8 &lt;  8&gt;                                     WebCore::ScriptWrappable WebCore::ScriptWrappable
  +8 &lt;  8&gt;                                         JSC::Weak&lt;WebCore::JSDOMObject&gt; m_wrapper
  +8 &lt;  8&gt;                                           JSC::WeakImpl * m_impl
 +16 &lt;  4&gt;                               int m_refCount
 +20 &lt;  4&gt;                               uint32_t m_nodeFlags
 +24 &lt;  8&gt;                               WebCore::ContainerNode * m_parentNode
 +32 &lt;  8&gt;                               WebCore::TreeScope * m_treeScope
 +40 &lt;  8&gt;                               WebCore::Node * m_previous
 +48 &lt;  8&gt;                               WebCore::Node * m_next
 +56 &lt;  8&gt;                               WebCore::Node::DataUnion m_data
 +64 &lt;  8&gt;                           WebCore::Node * m_firstChild
 +72 &lt;  8&gt;                           WebCore::Node * m_lastChild
 +80 &lt;  8&gt;                         WebCore::QualifiedName m_tagName
 +80 &lt;  8&gt;                             WTF::RefPtr&lt;WebCore::QualifiedName::QualifiedNameImpl, WTF::DumbPtrTraits&lt;WebCore::QualifiedName::QualifiedNameImpl&gt; &gt; m_impl
 +80 &lt;  8&gt;                               WTF::DumbPtrTraits&lt;WebCore::QualifiedName::QualifiedNameImpl&gt;::StorageType m_ptr
 +88 &lt;  8&gt;                         WTF::RefPtr&lt;WebCore::ElementData, WTF::DumbPtrTraits&lt;WebCore::ElementData&gt; &gt; m_elementData
 +88 &lt;  8&gt;                           WTF::DumbPtrTraits&lt;WebCore::ElementData&gt;::StorageType m_ptr
 +96 &lt; 16&gt;                 WebCore::SVGLangSpace WebCore::SVGLangSpace
 +96 &lt;  8&gt;                     WTF::AtomicString m_lang
 +96 &lt;  8&gt;                         WTF::String m_string
 +96 &lt;  8&gt;                             WTF::RefPtr&lt;WTF::StringImpl, WTF::DumbPtrTraits&lt;WTF::StringImpl&gt; &gt; m_impl
 +96 &lt;  8&gt;                               WTF::DumbPtrTraits&lt;WTF::StringImpl&gt;::StorageType m_ptr
+104 &lt;  8&gt;                     WTF::AtomicString m_space
+104 &lt;  8&gt;                         WTF::String m_string
+104 &lt;  8&gt;                             WTF::RefPtr&lt;WTF::StringImpl, WTF::DumbPtrTraits&lt;WTF::StringImpl&gt; &gt; m_impl
+104 &lt;  8&gt;                               WTF::DumbPtrTraits&lt;WTF::StringImpl&gt;::StorageType m_ptr
+112 &lt;  8&gt;                 std::__1::unique_ptr&lt;WebCore::SVGElementRareData, std::__1::default_delete&lt;WebCore::SVGElementRareData&gt; &gt; m_svgRareData
+112 &lt;  8&gt;                     std::__1::__compressed_pair&lt;WebCore::SVGElementRareData *, std::__1::default_delete&lt;WebCore::SVGElementRareData&gt; &gt; __ptr_
+112 &lt;  8&gt;                         std::__1::__compressed_pair_elem&lt;WebCore::SVGElementRareData *, 0, false&gt; std::__1::__compressed_pair_elem&lt;WebCore::SVGElementRareData *, 0, false&gt;
+112 &lt;  8&gt;                           WebCore::SVGElementRareData * __value_
+112 &lt;  1&gt;                         std::__1::__compressed_pair_elem&lt;std::__1::default_delete&lt;WebCore::SVGElementRareData&gt;, 1, true&gt; std::__1::__compressed_pair_elem&lt;std::__1::default_delete&lt;WebCore::SVGElementRareData&gt;, 1, true&gt;
+112 &lt;  1&gt;                             std::__1::default_delete&lt;WebCore::SVGElementRareData&gt; std::__1::default_delete&lt;WebCore::SVGElementRareData&gt;
+120 &lt; 24&gt;                 WTF::HashSet&lt;WebCore::SVGElement *, WTF::PtrHash&lt;WebCore::SVGElement *&gt;, WTF::HashTraits&lt;WebCore::SVGElement *&gt; &gt; m_elementsWithRelativeLengths
+120 &lt; 24&gt;                     WTF::HashSet&lt;WebCore::SVGElement *, WTF::PtrHash&lt;WebCore::SVGElement *&gt;, WTF::HashTraits&lt;WebCore::SVGElement *&gt; &gt;::HashTableType m_impl
+120 &lt;  8&gt;                       WTF::HashTable&lt;WebCore::SVGElement *, WebCore::SVGElement *, WTF::IdentityExtractor, WTF::PtrHash&lt;WebCore::SVGElement *&gt;, WTF::HashTraits&lt;WebCore::SVGElement *&gt;, WTF::HashTraits&lt;WebCore::SVGElement *&gt; &gt;::ValueType * m_table
+128 &lt;  4&gt;                       unsigned int m_tableSize
+132 &lt;  4&gt;                       unsigned int m_tableSizeMask
+136 &lt;  4&gt;                       unsigned int m_keyCount
+140 &lt;  4&gt;                       unsigned int m_deletedCount
+144 &lt; 16&gt;                 WebCore::SVGSynchronizableAnimatedProperty&lt;WTF::String&gt; m_className
+144 &lt;  8&gt;                     WTF::String value
+144 &lt;  8&gt;                         WTF::RefPtr&lt;WTF::StringImpl, WTF::DumbPtrTraits&lt;WTF::StringImpl&gt; &gt; m_impl
+144 &lt;  8&gt;                           WTF::DumbPtrTraits&lt;WTF::StringImpl&gt;::StorageType m_ptr
+152 &lt;  1&gt;                   bool shouldSynchronize : 1
+152 &lt;  1&gt;                   bool isValid : 1
+153 &lt;  7&gt;           &lt;PADDING: 7 bytes&gt;
+160 &lt;  8&gt;             WebCore::SVGTransformable WebCore::SVGTransformable
+160 &lt;  8&gt;                 WebCore::SVGLocatable WebCore::SVGLocatable
+160 &lt;  8&gt;                    __vtbl_ptr_type * _vptr
+168 &lt; 96&gt;             WebCore::SVGTests WebCore::SVGTests
+168 &lt; 32&gt;                 WebCore::SVGSynchronizableAnimatedProperty&lt;WebCore::SVGStringListValues&gt; m_requiredFeatures
+168 &lt; 24&gt;                     WebCore::SVGStringListValues value
+168 &lt; 16&gt;                         WTF::Vector&lt;WTF::String, 0, WTF::CrashOnOverflow, 16&gt; WTF::Vector&lt;WTF::String, 0, WTF::CrashOnOverflow, 16&gt;
+168 &lt; 16&gt;                             WTF::VectorBuffer&lt;WTF::String, 0&gt; WTF::VectorBuffer&lt;WTF::String, 0&gt;
+168 &lt; 16&gt;                                 WTF::VectorBufferBase&lt;WTF::String&gt; WTF::VectorBufferBase&lt;WTF::String&gt;
+168 &lt;  8&gt;                                   WTF::String * m_buffer
+176 &lt;  4&gt;                                   unsigned int m_capacity
+180 &lt;  4&gt;                                   unsigned int m_size
+184 &lt;  8&gt;                       const WebCore::QualifiedName &amp; m_attributeName
+192 &lt;  1&gt;                   bool shouldSynchronize : 1
+192 &lt;  1&gt;                   bool isValid : 1
+361 &lt;  7&gt;               &lt;PADDING: 7 bytes&gt;
+200 &lt; 32&gt;                 WebCore::SVGSynchronizableAnimatedProperty&lt;WebCore::SVGStringListValues&gt; m_requiredExtensions
+200 &lt; 24&gt;                     WebCore::SVGStringListValues value
+200 &lt; 16&gt;                         WTF::Vector&lt;WTF::String, 0, WTF::CrashOnOverflow, 16&gt; WTF::Vector&lt;WTF::String, 0, WTF::CrashOnOverflow, 16&gt;
+200 &lt; 16&gt;                             WTF::VectorBuffer&lt;WTF::String, 0&gt; WTF::VectorBuffer&lt;WTF::String, 0&gt;
+200 &lt; 16&gt;                                 WTF::VectorBufferBase&lt;WTF::String&gt; WTF::VectorBufferBase&lt;WTF::String&gt;
+200 &lt;  8&gt;                                   WTF::String * m_buffer
+208 &lt;  4&gt;                                   unsigned int m_capacity
+212 &lt;  4&gt;                                   unsigned int m_size
+216 &lt;  8&gt;                       const WebCore::QualifiedName &amp; m_attributeName
+224 &lt;  1&gt;                   bool shouldSynchronize : 1
+224 &lt;  1&gt;                   bool isValid : 1
+393 &lt;  7&gt;               &lt;PADDING: 7 bytes&gt;
+232 &lt; 32&gt;                 WebCore::SVGSynchronizableAnimatedProperty&lt;WebCore::SVGStringListValues&gt; m_systemLanguage
+232 &lt; 24&gt;                     WebCore::SVGStringListValues value
+232 &lt; 16&gt;                         WTF::Vector&lt;WTF::String, 0, WTF::CrashOnOverflow, 16&gt; WTF::Vector&lt;WTF::String, 0, WTF::CrashOnOverflow, 16&gt;
+232 &lt; 16&gt;                             WTF::VectorBuffer&lt;WTF::String, 0&gt; WTF::VectorBuffer&lt;WTF::String, 0&gt;
+232 &lt; 16&gt;                                 WTF::VectorBufferBase&lt;WTF::String&gt; WTF::VectorBufferBase&lt;WTF::String&gt;
+232 &lt;  8&gt;                                   WTF::String * m_buffer
+240 &lt;  4&gt;                                   unsigned int m_capacity
+244 &lt;  4&gt;                                   unsigned int m_size
+248 &lt;  8&gt;                       const WebCore::QualifiedName &amp; m_attributeName
+256 &lt;  1&gt;                   bool shouldSynchronize : 1
+256 &lt;  1&gt;                   bool isValid : 1
+257 &lt;  7&gt;           &lt;PADDING: 7 bytes&gt;
+264 &lt; 24&gt;             WebCore::SVGSynchronizableAnimatedProperty&lt;WebCore::SVGTransformListValues&gt; m_transform
+264 &lt; 16&gt;                 WebCore::SVGTransformListValues value
+264 &lt; 16&gt;                     WTF::Vector&lt;WebCore::SVGTransformValue, 0, WTF::CrashOnOverflow, 2&gt; WTF::Vector&lt;WebCore::SVGTransformValue, 0, WTF::CrashOnOverflow, 2&gt;
+264 &lt; 16&gt;                         WTF::VectorBuffer&lt;WebCore::SVGTransformValue, 0&gt; WTF::VectorBuffer&lt;WebCore::SVGTransformValue, 0&gt;
+264 &lt; 16&gt;                             WTF::VectorBufferBase&lt;WebCore::SVGTransformValue&gt; WTF::VectorBufferBase&lt;WebCore::SVGTransformValue&gt;
+264 &lt;  8&gt;                               WebCore::SVGTransformValue * m_buffer
+272 &lt;  4&gt;                               unsigned int m_capacity
+276 &lt;  4&gt;                               unsigned int m_size
+280 &lt;  1&gt;               bool shouldSynchronize : 1
+280 &lt;  1&gt;               bool isValid : 1
+281 &lt;  7&gt;           &lt;PADDING: 7 bytes&gt;
+288 &lt;  8&gt;             std::__1::unique_ptr&lt;WebCore::AffineTransform, std::__1::default_delete&lt;WebCore::AffineTransform&gt; &gt; m_supplementalTransform
+288 &lt;  8&gt;                 std::__1::__compressed_pair&lt;WebCore::AffineTransform *, std::__1::default_delete&lt;WebCore::AffineTransform&gt; &gt; __ptr_
+288 &lt;  8&gt;                     std::__1::__compressed_pair_elem&lt;WebCore::AffineTransform *, 0, false&gt; std::__1::__compressed_pair_elem&lt;WebCore::AffineTransform *, 0, false&gt;
+288 &lt;  8&gt;                       WebCore::AffineTransform * __value_
+288 &lt;  1&gt;                     std::__1::__compressed_pair_elem&lt;std::__1::default_delete&lt;WebCore::AffineTransform&gt;, 1, true&gt; std::__1::__compressed_pair_elem&lt;std::__1::default_delete&lt;WebCore::AffineTransform&gt;, 1, true&gt;
+288 &lt;  1&gt;                         std::__1::default_delete&lt;WebCore::AffineTransform&gt; std::__1::default_delete&lt;WebCore::AffineTransform&gt;
+296 &lt;  1&gt;           bool m_shouldIsolateBlending
+297 &lt;  3&gt;       &lt;PADDING: 3 bytes&gt;
+300 &lt;  8&gt;         WebCore::SVGSynchronizableAnimatedProperty&lt;float&gt; m_pathLength
+300 &lt;  4&gt;           float value
+304 &lt;  1&gt;           bool shouldSynchronize : 1
+304 &lt;  1&gt;           bool isValid : 1
+305 &lt;  7&gt;   &lt;PADDING: 7 bytes&gt;
+312 &lt;  8&gt;     WebCore::SVGExternalResourcesRequired WebCore::SVGExternalResourcesRequired
+312 &lt;  8&gt;        __vtbl_ptr_type * _vptr
+320 &lt;  8&gt;     WTF::CanMakeWeakPtr&lt;WebCore::SVGPathElement&gt; WTF::CanMakeWeakPtr&lt;WebCore::SVGPathElement&gt;
+320 &lt;  8&gt;         WTF::WeakPtrFactory&lt;WebCore::SVGPathElement&gt; m_weakFactory
+320 &lt;  8&gt;             WTF::RefPtr&lt;WTF::WeakReference&lt;WebCore::SVGPathElement&gt;, WTF::DumbPtrTraits&lt;WTF::WeakReference&lt;WebCore::SVGPathElement&gt; &gt; &gt; m_ref
+320 &lt;  8&gt;               WTF::DumbPtrTraits&lt;WTF::WeakReference&lt;WebCore::SVGPathElement&gt; &gt;::StorageType m_ptr
+328 &lt;  8&gt;     WebCore::SVGSynchronizableAnimatedProperty&lt;float&gt; m_pathLength
+328 &lt;  4&gt;       float value
+332 &lt;  1&gt;       bool shouldSynchronize : 1
+332 &lt;  1&gt;       bool isValid : 1
+333 &lt;  3&gt;   &lt;PADDING: 3 bytes&gt;
+336 &lt;  2&gt;     WebCore::SVGSynchronizableAnimatedProperty&lt;bool&gt; m_externalResourcesRequired
+336 &lt;  1&gt;       bool value
+337 &lt;  1&gt;       bool shouldSynchronize : 1
+337 &lt;  1&gt;       bool isValid : 1
+338 &lt;  6&gt;   &lt;PADDING: 6 bytes&gt;
+344 &lt; 16&gt;     WebCore::SVGPathByteStream m_pathByteStream
+344 &lt; 16&gt;         WebCore::SVGPathByteStream::Data m_data
+344 &lt; 16&gt;             WTF::VectorBuffer&lt;unsigned char, 0&gt; WTF::VectorBuffer&lt;unsigned char, 0&gt;
+344 &lt; 16&gt;                 WTF::VectorBufferBase&lt;unsigned char&gt; WTF::VectorBufferBase&lt;unsigned char&gt;
+344 &lt;  8&gt;                   unsigned char * m_buffer
+352 &lt;  4&gt;                   unsigned int m_capacity
+356 &lt;  4&gt;                   unsigned int m_size
+360 &lt; 16&gt;     std::optional&lt;WebCore::Path&gt; m_cachedPath
+360 &lt; 16&gt;         std::OptionalBase&lt;WebCore::Path&gt; std::OptionalBase&lt;WebCore::Path&gt;
+360 &lt;  1&gt;           bool init_
+721 &lt;  7&gt;           &lt;PADDING: 7 bytes&gt;
+368 &lt;  8&gt;           std::storage_t&lt;WebCore::Path&gt; storage_
+376 &lt; 32&gt;     WebCore::SVGSynchronizableAnimatedProperty&lt;WebCore::SVGPathSegListValues&gt; m_pathSegList
+376 &lt; 24&gt;         WebCore::SVGPathSegListValues value
+376 &lt; 16&gt;             WTF::Vector&lt;WTF::RefPtr&lt;WebCore::SVGPathSeg, WTF::DumbPtrTraits&lt;WebCore::SVGPathSeg&gt; &gt;, 0, WTF::CrashOnOverflow, 16&gt; WTF::Vector&lt;WTF::RefPtr&lt;WebCore::SVGPathSeg, WTF::DumbPtrTraits&lt;WebCore::SVGPathSeg&gt; &gt;, 0, WTF::CrashOnOverflow, 16&gt;
+376 &lt; 16&gt;                 WTF::VectorBuffer&lt;WTF::RefPtr&lt;WebCore::SVGPathSeg, WTF::DumbPtrTraits&lt;WebCore::SVGPathSeg&gt; &gt;, 0&gt; WTF::VectorBuffer&lt;WTF::RefPtr&lt;WebCore::SVGPathSeg, WTF::DumbPtrTraits&lt;WebCore::SVGPathSeg&gt; &gt;, 0&gt;
+376 &lt; 16&gt;                     WTF::VectorBufferBase&lt;WTF::RefPtr&lt;WebCore::SVGPathSeg, WTF::DumbPtrTraits&lt;WebCore::SVGPathSeg&gt; &gt; &gt; WTF::VectorBufferBase&lt;WTF::RefPtr&lt;WebCore::SVGPathSeg, WTF::DumbPtrTraits&lt;WebCore::SVGPathSeg&gt; &gt; &gt;
+376 &lt;  8&gt;                       WTF::RefPtr&lt;WebCore::SVGPathSeg, WTF::DumbPtrTraits&lt;WebCore::SVGPathSeg&gt; &gt; * m_buffer
+384 &lt;  4&gt;                       unsigned int m_capacity
+388 &lt;  4&gt;                       unsigned int m_size
+392 &lt;  4&gt;           WebCore::SVGPathSegRole m_role
+772 &lt;  4&gt;       &lt;PADDING: 4 bytes&gt;
+400 &lt;  1&gt;       bool shouldSynchronize : 1
+400 &lt;  1&gt;       bool isValid : 1
+401 &lt;  7&gt;   &lt;PADDING: 7 bytes&gt;
+408 &lt;  1&gt;   bool m_isAnimValObserved
+409 &lt;  7&gt;   &lt;PADDING: 7 bytes&gt;
Total byte size: 416
Total pad bytes: 79
Padding percentage: 18.99 %</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1440090</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2018-07-06 21:27:18 -0700</bug_when>
    <thetext>On nytimes.com, there are 1227 SVGPathElements, which use a total of 510432 bytes, so this adds up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1440100</commentid>
    <comment_count>2</comment_count>
    <who name="Said Abou-Hallawa">sabouhallawa</who>
    <bug_when>2018-07-06 21:53:57 -0700</bug_when>
    <thetext>I changed the types of the SVGTests members to be non animatable to comply withe the specs in the code refactoring patch https://bugs.webkit.org/show_bug.cgi?id=186751.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>