Comment 10 for bug 301054

Revision history for this message
In , Will Martin (public-atuan) wrote :

(In reply to comment #9)

> This seems far too ugly to me, can we not default the textbox to 2 lines? This
> would leave a much smaller white space on short urls but when you stretch the
> box full screen width on long urls you should be able to view 99.9% of them.

That won't help. The availability of vertical space (ie lines) is not the problem. The problem is that there is no white space in the URL where it can wrap to a second line.

Just for kicks, I just created a version of metaData.xul with this line:

<textbox readonly="true" rows="2" id="link-url-text"/>

Then I created a link with a really long URL and took a look. There was no ugly whitespace under the link text, but the URL was still cut off, because it didn't wrap. (See screenshot: 2 rows.)

I also created a version using a DESCRIPTION element instead of a TEXTBOX element. (See screenshot: description.) It makes the dialog's width vary according to the URL's width, but still doesn't solve the problem of chopped-off-chunks in really long ones.

I think I've figured out how to handle this. What we need to do is alter the JavaScript that populates the dialog so that it checks the length of the string. In the event of a string longer than, say, 25 characters, then the script can set the MULTILINE attribute to true for that particular textbox. Otherwise, we'll leave it false. That will make the data available for long URLs, but prevent the extra ugly whitespace from showing up in short URLs. Unfortunately, the JavaScript for this is considerably more complicated than the XUL. I'll have to study it for a while to figure out what it does and how.