Closed Bug 299376 Opened 20 years ago Closed 20 years ago

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

Categories

(Core :: SVG, defect)

x86
Windows XP
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: kouejou, Assigned: tor)

Details

(Keywords: fixed1.8)

Attachments

(4 files, 1 obsolete file)

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.
Attached image in example exécution
this file work with IE adobe viewer but not work in firefox natif svg dear park alpha 1
Assignee: nobody → general
Component: JavaScript Console → SVG
Product: Firefox → Core
QA Contact: javascript.console → ian
Version: unspecified → Trunk
Your testcase seems to have annotations not in comments, which causes our XML parser to throw it out.
Attached image testcase (obsolete) —
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.
Attached image testcase
oh the comments on the last testcase where misleading, new testcase without comments.
Attachment #188024 - Attachment is obsolete: true
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 !
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.
(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?
(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: general → tor
Status: UNCONFIRMED → ASSIGNED
Attachment #198244 - Flags: review?(alex)
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+
Checked in on trunk.
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?
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
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+
Checked in on branch.
Keywords: fixed1.8
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: