[ TeamCity Enterprise Version 5.0 EAP (build 10626) ]
[ Mozilla Firefox 3.0.14 (build 02842) ]
There are four pictures in attachments where border colors identify the following elements:
red -> 'dialog' jsp tag (dialog.tag)
blue -> 'modalDialogBody' div nested to 'dialog' jsp tag and contains custom tag body used by calling page
yellow -> 'testConnectionStatus' div (editSettings.jsp)
magenta -> 'testConnectionDetails' div (editSettings.jsp)
This incorrect imaging of connection details div (leaving parent div boundary) takes place because of 'width: 30em;' setting in style 'testConnectionDetails' (forms.css) that is used inside of testConnection.js file. Results might be seen at the picture.
You can remove constant width value for 'testConnectionDetails' css style and you'll see that details error message won't leave restriction of its outer parent bounding box. But then there will be one more trouble. As you change whitespace (0x20) character to symbol, Firefox doesn't wrap text in div but adds horizontal scroll bar.
At this picture you could see correctly control size and text wrapping. Replacing white space ("replace(/ /g, ' ');") was commented.
This picture like the previous one exactly. But white spaces were changed to character hexadecimal code 0x000C (one of specified 'white spaces' from http://www.w3.org/TR/html401/struct/text.html#h-9.1) if you wouldn't like that ordinary code 0x20 would be used.