Created attachment 525337 [details] Broken certificate window This is happening with the Italian build of Firefox 4 (verified on Mac and Windows): if the first label is too long, the text doesn't wrap and the controls are displayed partially (see also the almost missing button in the bottom right corner). Another issue is that this windows can't be resized. From a quick check on mxr.mozilla.org, some other locales should have the same problem (e.g. sl, pt-BR, gd).
Created attachment 537422 [details] [diff] [review] Fix to make long text wrap Since nobody is working on this and localized builds are still broken, I tried the DIY way. I'm not a programmer, so I need some help to understand if I'm doing things right. My understanding after browsing MDC for a couple of hours is that text set as value in a label doesn't wrap, while it wraps if set as a text child node. In this case I think that adding a child node without checking if there are already other nodes is fine.
Created attachment 537423 [details] Certificate window with the fix Certificate window with attached patch applied
I forgot one thing: if this works and it can be considered a low risk change, it would be great to land it also on other branches, not only on mozilla-central. Other languages are probably at the limit (for example sl), some (pt-BR, gd) have strings longer than Italian.
I would expect that you remove unnecessary xul elements. With your patch, the <label class="header" id="verified"/> is no longer used. I understand you use the "verified" node as the insertion point. Can you use a neighbourhood node as the insertion point, and remove the verified element?
(In reply to comment #4) > I would expect that you remove unnecessary xul elements. > With your patch, the <label class="header" id="verified"/> is no longer used. The label is used as parent of the text node (and AFAIK that's the only way to make long text wraps). My understanding is that, if I remove that element from the XUL file, I should still create it at run-time and this wouldn't be a better solution. Am I missing something?
I made a couple of tests. If I attach the text node to the parent vbox, text is displayed differently (normal vs bold) and in the same way of usages. The only solution I found to display the text in the same way is to recreate the same XUL structure (text node appended to a label with a class="header"). If you think that's the best solution I can provide an updated patch.
Any chance to make this bug progress? I'd really like to see this issue fixed and I'm open to suggestions ;-)
> - verified.setAttribute("value", verifystr); > + verified.appendChild(document.createTextNode(verifystr)); Can you try this instead: verified.textContent = verifystr;
Yep, .textContent works fine (text wraps and is displayed with bold font). Attaching a new patch in case that's a good solution to speed things up.
Sorry for the bugspam, but is there any chance to get the last patch reviewed?
Comment on attachment 540539 [details] [diff] [review] Fix to make long text wrap using textContent I don't know XUL well enough to say if this code is correct. If you are confident this works cross platform, r=kaie
Thanks Kai, I don't think this kind of property is platform specific. Anyway I'll test all platforms as soon as the fix land on mozilla-central.
Verified on Gecko/20110819 Firefox/9.0a1 (Snow Leopard, Ubuntu and Win7)