Closed Bug 336801 Opened 14 years ago Closed 12 years ago

SVG text not showing on XBL-ized button

Categories

(Core :: SVG, defect)

x86
Windows XP
defect
Not set

Tracking

()

RESOLVED FIXED

People

(Reporter: aaronr, Unassigned)

References

Details

Attachments

(1 file)

4.71 KB, application/xhtml+xml
Details
In an XBL testcase of mine, I see a problem where svg:text isn't showing on a html button if I set (via script) the textContent of the svg:text.  However if the text is inline and is pulled into the svg:text via the xbl:children, then SVG text will show up on the button.  If I replace svg:svg and svg:text with html spans, then setting the textContent also works.  So the problem probably involves SVG in some way.

Other oddities I've noted: If I set the svg:text textContent after onLoad, it works.  If I change the button display style to be display:block, it also works.
Attached file testcase
This is worksforme in current trunk builds Aaron.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WORKSFORME
(In reply to comment #2)
> This is worksforme in current trunk builds Aaron.
> 

Well, on a build from 11/06, I see just one letter in each of the SVG cases, but in the html case I see all of the text on the button.  So I guess that the svg text is showing, but shouldn't it ALL show?
Can you check on a completely up to date build? I see the problem using 2007-10-18-10-trunk, but not with a current trunk build where I get all the letters.
(In reply to comment #4)
> Can you check on a completely up to date build? I see the problem using
> 2007-10-18-10-trunk, but not with a current trunk build where I get all the
> letters.
> 

You are right.  I pulled a tree from today and built it and can now see all the text.  It isn't centered, but much better than before!
Turns out it was the fix for bug 294086 that made things better here.

Anyway, reopening to deal with the centering issue. If you feel like reducing that testcase some more, Aaron, feel free. ;-)
Status: RESOLVED → REOPENED
Depends on: 294086
Resolution: WORKSFORME → ---
(In reply to comment #6)
> Turns out it was the fix for bug 294086 that made things better here.
> 
> Anyway, reopening to deal with the centering issue. If you feel like reducing
> that testcase some more, Aaron, feel free. ;-)
> 

Don't hold this bug open just for centering.  I thought that the text should be centered (having not looked at the testcase for a while), but tor explained to me that the way I have the svg:text element written the text would be set to the left of the button (since I'm using @x="1").  And I discovered that the reason the second button has text to the right of the button is because I didn't initially set the implicit svg:svg element to be  display:none so it is showing up empty, pushing the text-filled svg element to the right.

So in short, if the only reason you reopened this bug was because I complained about centering, then please disregard what I said and close the bug again.  Thanks.
(In reply to comment #7)
> Don't hold this bug open just for centering.  I thought that the text should be
> centered (having not looked at the testcase for a while), but tor explained to
> me that the way I have the svg:text element written the text would be set to
> the left of the button (since I'm using @x="1").

...using x="1" without text-anchor="middle".

-tor


Okay, yeah, it looks like the testcase just needs fixed up. Thanks Aaron. Closing as fixed by bug 294086 then.
Status: REOPENED → RESOLVED
Closed: 12 years ago12 years ago
Resolution: --- → FIXED
Flags: in-testsuite?
You need to log in before you can comment on or make changes to this bug.