<?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>109665</bug_id>
          
          <creation_ts>2013-02-12 22:32:33 -0800</creation_ts>
          <short_desc>Stroked patterns paint even when object bounding box is empty</short_desc>
          <delta_ts>2022-07-15 16:02:16 -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>528+ (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="Philip Rogers">pdr</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>fmalita</cc>
    
    <cc>schenney</cc>
    
    <cc>zimmermann</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>831648</commentid>
    <comment_count>0</comment_count>
      <attachid>188015</attachid>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2013-02-12 22:32:33 -0800</bug_when>
    <thetext>Created attachment 188015
Testcase

Patterns do not paint for stroked, horizontal lines, but do paint for almost-horizontal lines.

Note: to reproduce you will need to disable your cache.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>831673</commentid>
    <comment_count>1</comment_count>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2013-02-12 23:35:15 -0800</bug_when>
    <thetext>We partially follow the spec here. The pattern should not paint for horizontal lines:
&quot;Keyword objectBoundingBox should not be used when the geometry of the applicable element has no width or no height, such as the case of a horizontal or vertical line, even when the line has actual thickness when viewed due to having a non-zero stroke width since stroke width is ignored for bounding box calculations. When the geometry of the applicable element has no width or height and objectBoundingBox is specified, then the given effect (e.g., a gradient or a filter) will be ignored.&quot;

We are in error when we _do_ show the pattern for horizontal lines! Something is inconsistent because reloading several times makes the pattern show up.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>831678</commentid>
    <comment_count>2</comment_count>
      <attachid>188022</attachid>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2013-02-12 23:39:33 -0800</bug_when>
    <thetext>Created attachment 188022
Updated testcase - we should not paint horizontal lines.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>832348</commentid>
    <comment_count>3</comment_count>
    <who name="Florin Malita">fmalita</who>
    <bug_when>2013-02-13 14:31:39 -0800</bug_when>
    <thetext>I think I see the problem.

The empty object bounding box logic kicks in only when patternUnits == SVG_UNIT_TYPE_OBJECTBOUNDINGBOX:

    if (m_attributes.patternUnits() == SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX &amp;&amp; objectBoundingBox.isEmpty())
        return false;

But we are making this decision before updating patternUnits from the element, so we&apos;re always seeing SVG_UNIT_TYPE_OBJECTBOUNDINGBOX on the first pass! Later, when the second line gets painted, the pattern attributes get collected and patternUnits is updated to the specified SVG_UNIT_TYPE_USERSPACEONUSE. Then on subsequent repaints the empty bounding box logic no longer kicks in because attributes are up to date.

I&apos;ll get a patch up tomorrow.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>832400</commentid>
    <comment_count>4</comment_count>
    <who name="Stephen Chenney">schenney</who>
    <bug_when>2013-02-13 15:09:58 -0800</bug_when>
    <thetext>Whoa. Slow down folks. The spec is clearly bogus in this regard. It makes no sense at all to suddenly stop drawing a pattern stroke on a line just because it goes horizontal or vertical. The line itself isn&apos;t changing, so if it&apos;s of zero area when it is in one orientation then it has zero area in any other. And in this context it&apos;s area that matters, not the oriented bounding box.

Just ignore the spec and draw the patterned line when horizontal or vertical.

If you prefer, consider what would happen when the line is animated. If you&apos;re rotating a line you don&apos;t want it to disappear as it passes through horizontal and vertical.

As an aside, the &quot;how would this animate&quot; is an excellent way of deciding what to do with zero-size cases.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>832403</commentid>
    <comment_count>5</comment_count>
    <who name="Philip Rogers">pdr</who>
    <bug_when>2013-02-13 15:14:05 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; Whoa. Slow down folks. The spec is clearly bogus in this regard. It makes no sense at all to suddenly stop drawing a pattern stroke on a line just because it goes horizontal or vertical. The line itself isn&apos;t changing, so if it&apos;s of zero area when it is in one orientation then it has zero area in any other. And in this context it&apos;s area that matters, not the oriented bounding box.
&gt; 
&gt; Just ignore the spec and draw the patterned line when horizontal or vertical.
&gt; 
&gt; If you prefer, consider what would happen when the line is animated. If you&apos;re rotating a line you don&apos;t want it to disappear as it passes through horizontal and vertical.
&gt; 
&gt; As an aside, the &quot;how would this animate&quot; is an excellent way of deciding what to do with zero-size cases.

Fmalita is fixing the bug so we at least do what we expect we do. In parallel I&apos;ve emailed www-svg to fix the root issue: http://lists.w3.org/Archives/Public/www-svg/2013Feb/0037.html

On IRC they seem amenable, so I have high hopes :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>832408</commentid>
    <comment_count>6</comment_count>
    <who name="Florin Malita">fmalita</who>
    <bug_when>2013-02-13 15:20:59 -0800</bug_when>
    <thetext>I&apos;ll open a separate bug to track the inconsistent drawing of userSpaceOnUse patterns and leave this one to deal with the inconsistent objectBoundingBox spec :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>832411</commentid>
    <comment_count>7</comment_count>
    <who name="Stephen Chenney">schenney</who>
    <bug_when>2013-02-13 15:31:37 -0800</bug_when>
    <thetext>To be succinct: Think of the users, not the spec. Do what users would expect, particularly for some edge case like this where I can&apos;t see anyone depending on the alternate behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1884352</commentid>
    <comment_count>8</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-07-15 16:02:16 -0700</bug_when>
    <thetext>Safari, Firefox, and Chrome all display horizontal lines. I&apos;m not sure there is a bug here.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="0"
              isprivate="0"
          >
            <attachid>188015</attachid>
            <date>2013-02-12 22:32:33 -0800</date>
            <delta_ts>2013-02-12 23:39:33 -0800</delta_ts>
            <desc>Testcase</desc>
            <filename>boundingboxstroke.svg</filename>
            <type>image/svg+xml</type>
            <size>563</size>
            <attacher name="Philip Rogers">pdr</attacher>
            
              <data encoding="base64">PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRw
Oi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyB2ZXJzaW9uPScxLjEnPg0KPGRlZnM+DQogIDxwYXR0
ZXJuIGlkPSdwJyBoZWlnaHQ9JzEwJyB3aWR0aD0nMTAnIHBhdHRlcm5Vbml0cz0ndXNlclNwYWNl
T25Vc2UnID4NCiAgICA8cmVjdCBoZWlnaHQ9JzEwJyB3aWR0aD0nMTAnIGZpbGw9J2dyZWVuJyAv
Pg0KICA8L3BhdHRlcm4+DQo8L2RlZnM+DQoNCjx0ZXh0IHg9IjAiIHk9IjIwIj5CZWxvdyB5b3Ug
c2hvdWxkIHNlZSBhIGhvcml6b250YWwgbGluZTo8L3RleHQ+DQo8bGluZSB4MT0nMCcgeTE9JzQw
JyB4Mj0nMjAwJyB5Mj0nNDAnIHN0cm9rZS13aWR0aD0nMjAnIHN0cm9rZT0ndXJsKCNwKScgLz4N
Cg0KPHRleHQgeD0iMCIgeT0iMTAwIj5CZWxvdyB5b3Ugc2hvdWxkIHNlZSBhbiBhbG1vc3QtaG9y
aXpvbnRhbCBsaW5lOjwvdGV4dD4NCjxsaW5lIHgxPScwJyB5MT0nMTIwJyB4Mj0nMjAwJyB5Mj0n
MTIxJyBzdHJva2Utd2lkdGg9JzIwJyBzdHJva2U9J3VybCgjcCknIC8+DQo8L3N2Zz4=
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>188022</attachid>
            <date>2013-02-12 23:39:33 -0800</date>
            <delta_ts>2013-02-12 23:39:33 -0800</delta_ts>
            <desc>Updated testcase - we should not paint horizontal lines.</desc>
            <filename>boundingboxstroke.svg</filename>
            <type>image/svg+xml</type>
            <size>627</size>
            <attacher name="Philip Rogers">pdr</attacher>
            
              <data encoding="base64">PHN2ZyBwYXR0ZXJuVW5pdHM9J3VzZXJTcGFjZU9uVXNlJyB4bWxucz0naHR0cDovL3d3dy53My5v
cmcvMjAwMC9zdmcnIHhtbG5zOnhsaW5rPSdodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rJyB2
ZXJzaW9uPScxLjEnPg0KPGRlZnM+DQogIDxwYXR0ZXJuIGlkPSdwJyBoZWlnaHQ9JzEwJyB3aWR0
aD0nMTAnIHBhdHRlcm5Vbml0cz0ndXNlclNwYWNlT25Vc2UnID4NCiAgICA8cmVjdCBoZWlnaHQ9
JzEwJyB3aWR0aD0nMTAnIGZpbGw9J2dyZWVuJyBzdHJva2Utd2lkdGg9JzEnIHN0cm9rZT0nYmx1
ZScvPg0KICA8L3BhdHRlcm4+DQo8L2RlZnM+DQoNCjx0ZXh0IHg9IjAiIHk9IjIwIj5CZWxvdyB5
b3Ugc2hvdWxkIG5vdCBzZWUgYSBob3Jpem9udGFsIGxpbmU6PC90ZXh0Pg0KPGxpbmUgeDE9JzAn
IHkxPSc0MCcgeDI9JzIwMCcgeTI9JzQwJyBzdHJva2Utd2lkdGg9JzIwJyBzdHJva2U9J3VybCgj
cCknIC8+DQoNCjx0ZXh0IHg9IjAiIHk9IjEwMCI+QmVsb3cgeW91IHNob3VsZCBzZWUgYW4gYWxt
b3N0LWhvcml6b250YWwgbGluZTo8L3RleHQ+DQo8bGluZSB4MT0nMCcgeTE9JzEyMCcgeDI9JzIw
MCcgeTI9JzEyMScgc3Ryb2tlLXdpZHRoPScyMCcgc3Ryb2tlPSd1cmwoI3ApJyAvPg0KPC9zdmc+
</data>

          </attachment>
      

    </bug>

</bugzilla>