Closed Bug 288165 Opened 19 years ago Closed 19 years ago

SVG path: marker-start/-end (auto orient): wrong direction

Categories

(Core :: SVG, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: kohl, Assigned: jwatt)

Details

Attachments

(4 files)

User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050329
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050329

SVG marker-start and marker-end directions for the path tag are partly
interpolated with a direction "before path" and a direction "after path".
This especially when there are curved path elements in the path (e.g. circle)
(directions for the line tag are as expected - just in the direction of the line)

This is against SVG 1.1 specification (W3C SVG 1.1 specification 11.6.2 b) c)
"marker element/orient="auto")

It may also lead to Mozilla crash (see additional information)

Reproducible: Always

Steps to Reproduce:
1.start the appended xml file
2.marker dart should show in the tangent direction
3.

Actual Results:  
direction of marker is interpolated with a direction perhaps before
(marker-start)/after (marker-end) the path.

Expected Results:  
marker start tangentially to the first element in the path,
marker end tangentially to the last element
 

There are cases, in which Mozilla SVG is crashing when making this unexpected
interpolation. Last week build 2005031609 was permanently crashing, just until I
removed an assignment resulting in a 
   node.setAttribute("d","")
(letting the svg:path without d attribute. Comment: path as an empty place
holder for expected lines)

Today I couldn't provoke this reaction, not even with the same build and some of
the  original crash provoking pages.
some different, but maybe somewhat related error messages following
==> SVG
Assignee: general → general
Component: General → SVG
Product: Mozilla Application Suite → Core
QA Contact: general → ian
Version: unspecified → Trunk
Comment on attachment 178935 [details]
xml file showing wrong direction

Looks more like a CSS file to me.
Very sorry ... this time the correct attachment file (I hope so!!!)
    (sorry, the last one was a css file in the same dir, and Auto detect had
also seen an XML file - ask Bill Gates why he was delivering wrong content
under the correct file name :-(  - bugzilla and/or XP were very busy, so I
couldn't fully confirm the data sent)
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>

<!DOCTYPE xhtml PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd" [ 
]>

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- xhtml xmlns="http://www.w3.org/1999/xhtml"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xlink="http://www.w3.org/1999/xlink" -->
  <head>
  <title>marker start error</title>
  </head>
  <body>
 
	<svg:svg id="Pic" viewBox="0 0 600 300"> 
	   <svg:defs>
	   <svg:style type="text/css">
	     *	   { margin: 0 !important; padding: 0 !important;
border-collapse: collapse !important; background-color: transparent; fill:
none; pointer-events: visibleStroke; } 

	     #Pic { width: 900px; height: 600px; position: fixed; top: 0; left:
0; cursor: crosshair; background-color: white; pointer-events: all; }

	     marker { fill: currentColor; fill-opacity: 1; stroke:
currentColor; color: #CCCCCC; } 
	     .arrowHead, .ctrlPoint { width: 40px; height: 20px; stroke:
currentColor;  fill-opacity: 1; fill: currentColor; }

	     path.m,  line.m   { marker-start: url(#MdartA);  marker-end:
url(#MdartZ); orient:auto; } /* fill:green; */

	     .m, .ms, .mt, .m3D, .mh, .ml, .mx, .my, .mb, .mR, .msR, .mtR, .Dm,
.Dmt, .Dms { z-index: 21; stroke: currentColor; opacity: 1; stroke-width: 1px
!important; font-size : 10pt; font-weight: 100; color: #CCCCCC; }

	     line , rect , path { stroke: #A0C0EF; stroke-width : 2px; }

	     .pfeil:before , line.h , line.test, line.test:before { /*
':before' not evaluated! */
		 content: url(#Triangle);
		 fill-opacity: 1; color: red; stroke: #FFCC00 !important;
	       }
	   </svg:style>

	      <svg:marker id="MdartZ" viewBox="0 0 20 20" refX="20" refY="10"
orient="auto" markerWidth="10" markerHeight="10">
		<svg:path d="M20 20L20 0M0 5L20 10L0 15z" class="arrowHead"/>
	      </svg:marker>
	      <svg:marker id="MdartA" viewBox="0 0 20 20" refX="0" refY="10"
orient="auto" markerWidth="10" markerHeight="10">
		<svg:path d="M0 20L0 0M0 10L20 15L20 5z" class="arrowHead"/>
		<svg:line x0="M0 20L0 0M0 10L20 15L20 5z" class="arrowHead"/>
	      </svg:marker>

	   </svg:defs>
<svg:path d="M139.98 142.36A73.63 73.63 256.63307 1 0 188.55 147.47" class="m"
style="stroke:blue; color:red;"/>
<svg:line x1="200" y1="10" x2="100" y2="100" class="m" style="stroke:blue;
color:green;"/>
<svg:path d="M100.98 110.36L170.63 70.63L20.6 70" class="m"/>
<svg:path d="M239.98 242.36A173.63 173.63 256.63307 1 0 288.55 247.47L200 100"
class="m" style="stroke:blue; color:red;"/>

	</svg:svg>

  </body>
</html>
Whyever - it seems to be impossible to send this XML file as an XML file.
Please use the XML source in the comment! (It would be best to correct and/or
reduce the wrong attachements!)
Comment on attachment 183021 [details]
XML file showing the error - comment is a 100%-copy

<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>

<!DOCTYPE xhtml PUBLIC "-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN"
"http://www.w3.org/2002/04/xhtml-math-svg/xhtml-math-svg.dtd" [ 
]>

<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xlink="http://www.w3.org/1999/xlink">
<!-- xhtml xmlns="http://www.w3.org/1999/xhtml"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xlink="http://www.w3.org/1999/xlink" -->
  <head>
  <title>marker start error</title>
  </head>
  <body>

	<svg:svg id="Pic" viewBox="0 0 600 300"> 
	   <svg:defs>
	   <svg:style type="text/css">
	     *	   { margin: 0 !important; padding: 0 !important;
border-collapse: collapse !important; background-color: transparent; fill:
none; pointer-events: visibleStroke; } 

	     #Pic { width: 900px; height: 600px; position: fixed; top: 0; left:
0; cursor: crosshair; background-color: white; pointer-events: all; }

	     marker { fill: currentColor; fill-opacity: 1; stroke:
currentColor; color: #CCCCCC; } 
	     .arrowHead, .ctrlPoint { width: 40px; height: 20px; stroke:
currentColor;  fill-opacity: 1; fill: currentColor; }

	     path.m,  line.m   { marker-start: url(#MdartA);  marker-end:
url(#MdartZ); orient:auto; } /* fill:green; */

	     .m, .ms, .mt, .m3D, .mh, .ml, .mx, .my, .mb, .mR, .msR, .mtR, .Dm,
.Dmt, .Dms { z-index: 21; stroke: currentColor; opacity: 1; stroke-width: 1px
!important; font-size : 10pt; font-weight: 100; color: #CCCCCC; }

	     line , rect , path { stroke: #A0C0EF; stroke-width : 2px; }

	     .pfeil:before , line.h , line.test, line.test:before { /*
':before' not evaluated! */
		 content: url(#Triangle);
		 fill-opacity: 1; color: red; stroke: #FFCC00 !important;
	       }
	   </svg:style>

	      <svg:marker id="MdartZ" viewBox="0 0 20 20" refX="20" refY="10"
orient="auto" markerWidth="10" markerHeight="10">
		<svg:path d="M20 20L20 0M0 5L20 10L0 15z" class="arrowHead"/>
	      </svg:marker>
	      <svg:marker id="MdartA" viewBox="0 0 20 20" refX="0" refY="10"
orient="auto" markerWidth="10" markerHeight="10">
		<svg:path d="M0 20L0 0M0 10L20 15L20 5z" class="arrowHead"/>
		<svg:line x0="M0 20L0 0M0 10L20 15L20 5z" class="arrowHead"/>
	      </svg:marker>

	   </svg:defs>
<svg:path d="M139.98 142.36A73.63 73.63 256.63307 1 0 188.55 147.47" class="m"
style="stroke:blue; color:red;"/>
<svg:line x1="200" y1="10" x2="100" y2="100" class="m" style="stroke:blue;
color:green;"/>
<svg:path d="M100.98 110.36L170.63 70.63L20.6 70" class="m"/>
<svg:path d="M239.98 242.36A173.63 173.63 256.63307 1 0 288.55 247.47L200 100"
class="m" style="stroke:blue; color:red;"/>

	</svg:svg>

  </body>
</html>
(In reply to comment #3)
> (From update of attachment 178935 [details] [edit])
> Looks more like a CSS file to me.
> 

Edit (Attachment) followed by "Edit Attachment As Comment" will show the
complete XML file.
I've today sent an error message for Bugzilla for that
I've sent error message #294634 for bugzilla, but very surprisingly it was sent
back as "expected behavior of bugzilla"!!!

In fact, they are saying, it would only be the wrong display of the browser on
maintainers side(!), here Jonathan Watt, and in such a case I(!) should expect
and interpret this crazy reaction.
You, Jonathan Watt, should have seen the real source behind the unexpected part,
and I should have seen the cause for that  :-(  :-(  :-(=)

Incredibly!!!
Every reporter of an error message should have an inside view deep enough to
expect and interpret the weaknesses of bugzilla, and send the messages in a
manner that they will reach the developers screen uncorrupted?!
That's of course even too much to expect for developers!

It has taken some hours to fulfill maintainers wish to send only one short
attachment reproducing the error. I understand this wish - I was maintainer and
developer.
It's my interest to get error corrections, and so I did it.
I'll can't do that never again under such circumstances.
Too frustrating. Too time consuming.

Indeed: error messaging shouldn't set up the main problem.
(In reply to comment #3)
> (From update of attachment 178935 [details] [edit])
> Looks more like a CSS file to me.
> 

Using of one of the actual nightly builds of Mozilla SVG for browsing in this
database will show the evaluated SVG picture, when looking for all of the
attachments.

Sorry - in my evilst dreams I also didn't think about using a nightly build to
browse in this database, and at least I would have used the error provoking one.
Only for Bugzilla experts this is the obvious way ...
I have a patch for this.
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: PC → All
Attached patch patchSplinter Review
Assignee: general → jonathan.watt
Status: NEW → ASSIGNED
Attachment #187806 - Flags: review?(tor)
Attachment #187806 - Flags: review?(tor) → review+
Attachment #187806 - Flags: approval1.8b3?
Comment on attachment 187806 [details] [diff] [review]
patch

a=bsmedberg for 6/30 only
Attachment #187806 - Flags: approval1.8b3? → approval1.8b3+
Marking fixed.

Checking in mozilla/layout/svg/base/src/nsSVGPathFrame.cpp;
/cvsroot/mozilla/layout/svg/base/src/nsSVGPathFrame.cpp,v  <--  nsSVGPathFrame.cpp
new revision: 1.26; previous revision: 1.25
done
Status: ASSIGNED → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: