<?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>12064</bug_id>
          
          <creation_ts>2007-01-01 18:52:35 -0800</creation_ts>
          <short_desc>Need function for manual style-resolution for things like gradient stops</short_desc>
          <delta_ts>2007-08-21 14:34:28 -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>420+</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Eric Seidel (no email)">eric</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>38206</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2007-01-01 18:52:35 -0800</bug_when>
    <thetext>Need function for manual style-resolution for things like gradient stops

Vector&lt;SVGGradientStop&gt; SVGGradientElement::buildStops() const
    // FIXME: Manual style resolution is a hack
    RenderStyle* gradientStyle = const_cast&lt;SVGGradientElement*&gt;(this)-&gt;styleForRenderer(parent()-&gt;renderer());


Gradient stops must inherit style via CSS.  The WebCore render tree is optimized not to bother computing styles for any node which does not have a renderer.  Furthermore, if anynode does not have a renderer, none of its ancestors do either.  Thus nodes like &lt;defs&gt; cause style resolution trouble.

In these cases, there should be a special function styleForResolution() (or better named), which can be used by SVG element which need to resolve style across &quot;holes&quot; in the render tree (as are to be expected by things such as &lt;defs&gt; &lt;*Gradient&gt; and possibly eventually &lt;pattern&gt;.

Right now the current solution for gradients breaks when gradients are inside &lt;defs&gt; (I think).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38175</commentid>
    <comment_count>1</comment_count>
    <who name="Dave Hyatt">hyatt</who>
    <bug_when>2007-01-01 18:56:14 -0800</bug_when>
    <thetext>We should chat about this at some point.  I don&apos;t think you need a new function necessarily.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>38106</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2007-01-01 18:58:29 -0800</bug_when>
    <thetext>I&apos;m not sure I&apos;m able to come up with a test case to demonstrate this.   This one seems to work fine in TOT:

&lt;svg xmlns=&quot;http://www.w3.org/2000/svg&quot; style=&apos;color: green&apos;&gt;
    &lt;defs&gt;
        &lt;linearGradient id=&apos;gradient&apos; x2=&apos;5&apos;&gt;
            &lt;stop offset=&apos;0&apos; stop-color=&apos;currentColor&apos; /&gt;
            &lt;stop offset=&apos;1&apos; stop-color=&apos;red&apos; /&gt;
        &lt;/linearGradient&gt;
    &lt;/defs&gt;
    &lt;rect fill=&quot;url(#gradient)&quot; width=&apos;100px&apos; height=&apos;100px&apos; /&gt;
&lt;/svg&gt;

I still think a function do use to do this more cleanly would be nice.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>34844</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2007-01-15 01:49:33 -0800</bug_when>
    <thetext>An alternative way to fix all this is to actually make gradient stops have real renderers with real styles, such as suggested in:
http://bugs.webkit.org/show_bug.cgi?id=12193

This would also require &lt;defs&gt; to have a renderer, as mentioned in:
http://bugs.webkit.org/show_bug.cgi?id=12207
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>7808</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2007-06-12 10:29:25 -0700</bug_when>
    <thetext>*** Bug 12545 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1757</commentid>
    <comment_count>5</comment_count>
    <who name="Nikolas Zimmermann">zimmermann</who>
    <bug_when>2007-08-21 14:34:28 -0700</bug_when>
    <thetext>Landed in r25175.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>