Last Comment Bug 360869 - text-anchor='middle' does not work with text content added via certain scripts
: text-anchor='middle' does not work with text content added via certain scripts
Status: RESOLVED FIXED
: fixed1.8.1.1
Product: Core
Classification: Components
Component: SVG (show other bugs)
: 1.8 Branch
: x86 Windows XP
: -- normal (vote)
: ---
Assigned To: tor
: Hixie (not reading bugmail)
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-11-15 21:16 PST by Doug Schepers
Modified: 2006-12-03 13:07 PST (History)
2 users (show)
mbeltzner: blocking1.8.1.1+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
illustrates how text isn't centered... click on red dot to activate (1.67 KB, image/svg+xml)
2006-11-15 21:21 PST, Doug Schepers
no flags Details
branch patch - missing chunk from bug 307155 (1.16 KB, patch)
2006-11-20 13:04 PST, tor
longsonr: review+
roc: superreview+
jaymoz: approval1.8.1.1+
Details | Diff | Review

Description Doug Schepers 2006-11-15 21:16:20 PST
User-Agent:       Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0
Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1) Gecko/20061010 Firefox/2.0

text-anchor='middle' doesn't center text that is added to an element if it is the result of mouse events (rather than load events, for example, oddly enough).  Text that is in place when the document is parsed works fine, as does text added via the same script called onload instead.

Reproducible: Always

Steps to Reproduce:
1. create empty static text element
2. add text via script evoked by click 
3. text is not centered

Actual Results:  
Text is not centered

Expected Results:  
Text should be centered
Comment 1 Doug Schepers 2006-11-15 21:21:43 PST
Created attachment 245733 [details]
illustrates how text isn't centered... click on red dot to activate
Comment 2 Robert Longson 2006-11-16 04:26:56 PST
WFM with latest firefox trunk build. Broken in firefox 2.0 though.
Comment 3 tor 2006-11-20 13:04:57 PST
Created attachment 246072 [details] [diff] [review]
branch patch - missing chunk from bug 307155
Comment 4 tor 2006-11-21 08:25:43 PST
Comment on attachment 246072 [details] [diff] [review]
branch patch - missing chunk from bug 307155

While if writing new code I'd use IsEmpty() and shuffle the code in the method a bit, I figured it was best to keep this as close to the shipping ff1.5 as possible.
Comment 5 tor 2006-11-21 15:43:35 PST
Comment on attachment 246072 [details] [diff] [review]
branch patch - missing chunk from bug 307155

Important fix for a regression between Firefox 1.5 and 2.0.  This same fix has been on the 1.8.0 branch for over a year.
Comment 6 Jay Patel [:jay] 2006-11-22 14:36:15 PST
Comment on attachment 246072 [details] [diff] [review]
branch patch - missing chunk from bug 307155

Approved for 1.8.1 branch, a=jay for drivers.  Please land this asap, thanks!
Comment 7 tor 2006-11-22 17:10:34 PST
Checked in on MOZILLA_1_8_BRANCH.
Comment 8 tor 2006-12-03 13:07:11 PST
*** Bug 362659 has been marked as a duplicate of this bug. ***

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