The default bug view has changed. See this FAQ.

i want to uses attribute "dy" or "dx" to tspan in language svg for deer park

RESOLVED FIXED

Status

()

Core
SVG
RESOLVED FIXED
12 years ago
12 years ago

People

(Reporter: kouejou, Assigned: tor)

Tracking

({fixed1.8})

Trunk
x86
Windows XP
fixed1.8
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(4 attachments, 1 obsolete attachment)

(Reporter)

Description

12 years ago
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
Please could you attach a test case that demonstrates this.
(Reporter)

Comment 2

12 years ago
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
(Assignee)

Updated

12 years ago
Assignee: nobody → general
Component: JavaScript Console → SVG
Product: Firefox → Core
QA Contact: javascript.console → ian
Version: unspecified → Trunk
(Assignee)

Comment 3

12 years ago
Your testcase seems to have annotations not in comments, which causes our XML
parser to throw it out.

Comment 4

12 years ago
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

12 years ago
Created attachment 188025 [details]
testcase

oh the comments on the last testcase where misleading, new testcase without
comments.
Attachment #188024 - Attachment is obsolete: true

Comment 6

12 years ago
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

12 years ago
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

12 years ago
(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

12 years ago
(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.
(Assignee)

Comment 10

12 years ago
Created attachment 198244 [details] [diff] [review]
don't assume that both x and y are absolute
Assignee: general → tor
Status: UNCONFIRMED → ASSIGNED
Attachment #198244 - Flags: review?(alex)

Comment 11

12 years ago
Comment on attachment 198244 [details] [diff] [review]
don't assume that both x and y are absolute

r=afri
Attachment #198244 - Flags: review?(alex) → review+
(Assignee)

Comment 12

12 years ago
Checked in on trunk.
(Assignee)

Comment 13

12 years ago
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.
Attachment #198244 - Flags: approval1.8b5?
(Assignee)

Updated

12 years ago
Status: ASSIGNED → RESOLVED
Last Resolved: 12 years ago
Resolution: --- → FIXED

Comment 14

12 years ago
Comment on attachment 198244 [details] [diff] [review]
don't assume that both x and y are absolute

last day for non-critical changes.
Attachment #198244 - Flags: approval1.8b5? → approval1.8b5+
(Assignee)

Comment 15

12 years ago
Checked in on branch.
Keywords: fixed1.8
You need to log in before you can comment on or make changes to this bug.