Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 340841

Summary: Button text unexpectedly wraps in Firefox 4 on some machines
Product: [RT] RAP Reporter: Tim Buschtoens <tbuschto>
Component: RWTAssignee: Project Inbox <rap-inbox>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: P3 CC: tbuschto
Version: 1.4   
Target Milestone: 1.4 M7   
Hardware: All   
OS: All   
Whiteboard:

Description Tim Buschtoens CLA 2011-03-24 07:05:31 EDT
On some machines the div containing the text of the buttons are sometimes too small so that the text wraps. For some reason this is only reproducable on certain machines. We tested others with very similar configuration, but the glitch did not show up.
Comment 1 Tim Buschtoens CLA 2011-03-24 07:13:39 EDT
The reason is that the computeTextSize function returns smaller values (in our test case 72, compared to 74 on the other machine), even with exactly the same font and string. The function uses scrollWidth/scrollHeight, wich only returns whole numbers. Using getBoundingClientRect() returns 72.25 (still 74 on the other machine). When rounding that up with Math.ceil, the text does not wrap anymore. For now using getBoundingClientRect() and Math.ceil solves the issue and works fine on all browser.
Comment 2 Tim Buschtoens CLA 2011-03-24 07:27:48 EDT
Fixed in CVS HEAD.

Since there was one red js-test in IE9, i implented the alternative computation method only for gecko browser.