Last Comment Bug 299376 - i want to uses attribute "dy" or "dx" to tspan in language svg for deer park
: i want to uses attribute "dy" or "dx" to tspan in language svg for deer park
Status: RESOLVED FIXED
: fixed1.8
Product: Core
Classification: Components
Component: SVG (show other bugs)
: Trunk
: x86 Windows XP
: -- normal (vote)
: ---
Assigned To: tor
: Hixie (not reading bugmail)
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-07-01 07:33 PDT by kouejou
Modified: 2005-10-03 14:10 PDT (History)
4 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
in example exécution (3.46 KB, image/svg+xml)
2005-07-01 07:54 PDT, kouejou
no flags Details
testcase (575 bytes, image/svg+xml)
2005-07-02 06:30 PDT, Holger Will
no flags Details
testcase (519 bytes, image/svg+xml)
2005-07-02 06:38 PDT, Holger Will
no flags Details
dy not properly working on tspan (519 bytes, image/svg+xml)
2005-09-15 01:28 PDT, Andreas Neumann
no flags Details
don't assume that both x and y are absolute (4.91 KB, patch)
2005-10-02 12:20 PDT, tor
alex: review+
asa: approval1.8b5+
Details | Diff | Review

Description kouejou 2005-07-01 07:33:22 PDT
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050531 Firefox/1.0+
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8b2) Gecko/20050531 Firefox/1.0+

var oIntitule=this.oSvg.createElementNS("http://www.w3.org/2000/svg", "text");
		
		//oIntitule.setAttribute("x",x);
	
		oIntitule.setAttribute("y",y);
		oIntitule.setAttribute("id","texte");
		oIntitule.style.setProperty("font-family","Verdana","important");
		oIntitule.style.setProperty("fill","black","important");
		oIntitule.style.setProperty("font-size",this.GetHeight(14)+"px","important");
				
		for(var j=4; j<oTabIntitule.length;j++){
	
			var oValeur=this.oSvg.createElementNS("http://www.w3.org/2000/svg", "tspan");
			oValeur.setAttribute("x",x);
			oValeur.setAttribute("dy",this.GetHeight(20));
			this.GetY(this.iY,true);
			var oValIntitule=this.oSvg.createTextNode(oTabIntitule[j]+":"+oTabValeur[j]);
			oValeur.appendChild(oValIntitule);
			oIntitule.appendChild(oValeur);
		}
		
	
	this.oContainer.appendChild(oIntitule);

Reproducible: Didn't try

Steps to Reproduce:

Actual Results:  
text1:5text2:6text3:6

Expected Results:  
text1:5
text2:6
text3:7

i use the dear park natif svg i want to write the text in align on coordonnees dy
it not possible about the tspan is all implemented in the navigator deer park.

i wait your answer
Comment 1 Jaime Mitchell (use bugmail@jaimem.org.uk for email) 2005-07-01 07:35:53 PDT
Please could you attach a test case that demonstrates this.
Comment 2 kouejou 2005-07-01 07:54:57 PDT
Created attachment 187938 [details]
in example exécution 

this file work with IE	adobe viewer but not work in firefox natif svg dear
park alpha 1
Comment 3 tor 2005-07-01 10:48:43 PDT
Your testcase seems to have annotations not in comments, which causes our XML
parser to throw it out.
Comment 4 Holger Will 2005-07-02 06:30:20 PDT
Created attachment 188024 [details]
testcase

the left part of the image shows the bug, the right side shows the expected
behavior. it seems if you use "dy" and "x" at the same time, the context of
"dy" is set back to the parent instead of being the previous sibbling.
i think there was another bug about this, but i cant find it.
Comment 5 Holger Will 2005-07-02 06:38:22 PDT
Created attachment 188025 [details]
testcase

oh the comments on the last testcase where misleading, new testcase without
comments.
Comment 6 Holger Will 2005-08-10 11:48:38 PDT
bug#282029 is probably a dublicat of this bug,

additional comment for the corrected testcase:

using dy works correctly, but using a combination of x and dy causes the dy
being interpreted relative to the parent text element, not the previous tspan
element.
the left side of the testcase should look like the right side.
this is very important for multiline text. as foreignObject is disable by
default, this is the only way to set multiline text !
Comment 7 Andreas Neumann 2005-09-15 01:28:04 PDT
Created attachment 196135 [details]
dy not properly working on tspan

It seems like dy does not work on the third or subsequent line. It only works
on the second tspan element. If one uses absolute y attributes it seems to
work, as indicated in the right text example. But it would be much more elegant
to be able to correctly use the dy-attribute.
Comment 8 Kris 2005-09-18 13:36:01 PDT
(In reply to comment #7)
> Created an attachment (id=196135) [edit]
> dy not properly working on tspan
> 
> It seems like dy does not work on the third or subsequent line. It only works
> on the second tspan element. If one uses absolute y attributes it seems to
> work, as indicated in the right text example. But it would be much more elegant
> to be able to correctly use the dy-attribute.

I can confirm this on my site
http://www.kisai.org/preview/index.html

http://www.kisai.org/preview/composite2.svg uses dy instead of absolute y , all
the text winds up on the same line where as
http://www.kisai.org/preview/composite1.svg uses absolute y, and shows up on the
correct lines.

As a side note, is text-align:center (css) valid for SVG? 
Comment 9 Kris 2005-09-18 13:39:45 PDT
(In reply to comment #8)
> 
> I can confirm this on my site
> http://www.kisai.org/preview/index.html
> 
> http://www.kisai.org/preview/composite2.svg uses dy instead of absolute y , all
> the text winds up on the same line where as
> http://www.kisai.org/preview/composite1.svg uses absolute y, and shows up on the
> correct lines.
> 
> As a side note, is text-align:center (css) valid for SVG? 

I wrote the SVG using Inkscape, so there are other tags in the SVG that appear
to be metadata, but all the same dy appears to get ignored completely.
Comment 10 tor 2005-10-02 12:20:54 PDT
Created attachment 198244 [details] [diff] [review]
don't assume that both x and y are absolute
Comment 11 Alex Fritze 2005-10-02 13:27:32 PDT
Comment on attachment 198244 [details] [diff] [review]
don't assume that both x and y are absolute

r=afri
Comment 12 tor 2005-10-02 18:21:57 PDT
Checked in on trunk.
Comment 13 tor 2005-10-02 18:23:46 PDT
Comment on attachment 198244 [details] [diff] [review]
don't assume that both x and y are absolute

High visibility specification compliance bug that we've been getting reports
about.	Some risk.
Comment 14 Asa Dotzler [:asa] 2005-10-03 10:50:35 PDT
Comment on attachment 198244 [details] [diff] [review]
don't assume that both x and y are absolute

last day for non-critical changes.
Comment 15 tor 2005-10-03 14:10:55 PDT
Checked in on branch.

Note You need to log in before you can comment on or make changes to this bug.