Closed Bug 649266 Opened 9 years ago Closed 8 years ago

Certificate window is broken with long text labels


(Core Graveyard :: Security: UI, defect)

Not set


(Not tracked)



(Reporter: flod, Assigned: flod)


(Whiteboard: [inbound])


(3 files, 1 obsolete file)

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, some other locales should have the same problem (e.g. sl, pt-BR, gd).
Attached patch Fix to make long text wrap (obsolete) — Splinter Review
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.
Certificate window with attached patch applied
Component: Security → Security: UI
Product: Toolkit → Core
QA Contact: toolkit → ui
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.
Assignee: nobody → francesco.lodolo
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.
Attachment #537422 - Flags: review?(kaie) → review-
Attachment #537422 - Attachment is obsolete: true
Attachment #540539 - Flags: review?(kaie)
Whiteboard: [has patch for review]
Sorry for the bugspam, but is there any chance to get the last patch reviewed?
Whiteboard: [has patch for review] → [has patch for review 2 liners]
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
Attachment #540539 - Flags: review?(kaie) → review+
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.
Whiteboard: [has patch for review 2 liners] → checkin-needed
Keywords: checkin-needed
Whiteboard: checkin-needed
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla9
Verified on Gecko/20110819 Firefox/9.0a1 (Snow Leopard, Ubuntu and Win7)
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.