Certificate window is broken with long text labels

VERIFIED FIXED in mozilla9

Status

Core Graveyard
Security: UI
VERIFIED FIXED
6 years ago
10 months ago

People

(Reporter: flod, Assigned: flod)

Tracking

Trunk
mozilla9

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [inbound])

Attachments

(3 attachments, 1 obsolete attachment)

(Assignee)

Description

6 years ago
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).
(Assignee)

Comment 1

6 years ago
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.
(Assignee)

Comment 2

6 years ago
Created attachment 537423 [details]
Certificate window with the fix

Certificate window with attached patch applied
(Assignee)

Updated

6 years ago
Attachment #537422 - Flags: review?(kaie)
Status: NEW → ASSIGNED
Component: Security → Security: UI
Product: Toolkit → Core
QA Contact: toolkit → ui
(Assignee)

Comment 3

6 years ago
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.

Comment 4

6 years ago
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?
(Assignee)

Comment 5

6 years ago
(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?
(Assignee)

Comment 6

6 years ago
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
(Assignee)

Comment 7

6 years ago
Any chance to make this bug progress? I'd really like to see this issue fixed and I'm open to suggestions ;-)

Comment 8

6 years ago
> -  verified.setAttribute("value", verifystr);
> +  verified.appendChild(document.createTextNode(verifystr));

Can you try this instead:
verified.textContent = verifystr;
(Assignee)

Comment 9

6 years ago
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.
(Assignee)

Comment 10

6 years ago
Created attachment 540539 [details] [diff] [review]
Fix to make long text wrap using textContent
Attachment #537422 - Flags: review?(kaie) → review-
Attachment #537422 - Attachment is obsolete: true
Attachment #540539 - Flags: review?(kaie)
Whiteboard: [has patch for review]
(Assignee)

Comment 11

6 years ago
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 12

6 years ago
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+
(Assignee)

Comment 13

6 years ago
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.
(Assignee)

Updated

6 years ago
Whiteboard: [has patch for review 2 liners] → checkin-needed
(Assignee)

Updated

6 years ago
Keywords: checkin-needed
Whiteboard: checkin-needed
http://hg.mozilla.org/integration/mozilla-inbound/rev/acf10d96fa73
Keywords: checkin-needed
Whiteboard: [inbound]
http://hg.mozilla.org/mozilla-central/rev/acf10d96fa73
Status: ASSIGNED → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla9
(Assignee)

Comment 16

6 years ago
Verified on Gecko/20110819 Firefox/9.0a1 (Snow Leopard, Ubuntu and Win7)
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.