Closed Bug 805039 Opened 12 years ago Closed 4 years ago

Long tooltips without whitespaces are truncated and not wrapped

Categories

(Core :: Layout, defect, P2)

defect

Tracking

()

VERIFIED FIXED
89 Branch
Tracking Status
firefox41 --- wontfix
firefox-esr68 --- wontfix
firefox-esr78 --- wontfix
firefox75 --- wontfix
firefox76 --- wontfix
firefox77 --- wontfix
firefox78 --- wontfix
firefox87 --- wontfix
firefox88 --- wontfix
firefox89 --- verified

People

(Reporter: FragerZ, Assigned: dholbert)

References

(Blocks 1 open bug, )

Details

(Keywords: helpwanted, regression, testcase, Whiteboard: [bugday-20150624][proton-modals][priority:2c])

Attachments

(8 files)

User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.4 (KHTML, like Gecko) Chrome/22.0.1229.94 Safari/537.4 Steps to reproduce: Create a long tooltip and do not enter whitespace. This can be easily done by creating/editing the title attribute of an element, and then moving the mouse over it. This only happens when the title does not have spaces, and is at least ~80 characters long. Example shown in picture: <a title="This_is_a_very_long_description_which_does_not_have_whitespace.This_is_a_very_long_description_which_does_not_have_whitespace."> This_is_a_very_long_description_which_does_not_have_whitespace.This_is_a_very_long_description_which_does_not_have_whitespace.</a> Actual results: The tootip is truncated after ~80 characters and does not wrap. Expected results: The text should wrap and there should be a margin on the right hand side of the text that is proportional the the margin that exists on the left hand side of the text.
Severity: normal → minor
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows 7 → All
Component: Untriaged → General
The fix for this seems to be as simple as adding tooltip {word-break:break-all} to chrome://global/skin/popup.css To fix it yourself as a user, put the above line in your userChrome.css file.
Hmm, maybe it's not that simple though, because that can cause line wrapping within words even when not necessary. For example: data:text/html,<a title="This_is_the_first_very_very_very_very_long_word. This_is_the_second_very_very_very_very_long_word.">link</a> With 'word-break:break-all' the wrapping happens within the second word, not at the space between the words.
Testcase demonstrating the bug. Firefox 19 and all future versions are affected.
Attachment #717977 - Attachment mime type: text/plain → text/html
Last good nightly: 2007-04-24 First bad nightly: 2007-04-25 This was a real blast from the past. This is from the CVS days so I don't know anything more (the Mercurial web interface doesn't have changesets for those dates). Image attachment demonstrates "good" (using ellipsis to indicate a truncated string) vs a bad build
(In reply to John Volikas from comment #5) > Created attachment 717977 [details] It is truncated on the first and other odd tries, and displayed on the seconds and other even tries (2013-02-24-03-10-53-mozilla-central-firefox-22.0a1.en-US.linux-x86_64, and 20 Beta).
Keywords: regression, testcase
Maybe bug 218223?
I think I've found a proper fix for this problem (or at least, a workaround). Try adding this to your userChrome.css: tooltip > label { word-wrap: break-word; min-width: 1px; } That should make long words wrap onto a new line, keeping the correct margin and border on the right hand side of the tooltip. I got the idea from bug 630864. For some reason, word-wrap:break-word doesn't work in XUL unless you add a minimum width.
Is there going to be a fix provided in latest version of Firefox for this issue?
Attached patch PatchSplinter Review
This patch should fix the bug. It allows tooltip text to break in mid-word if required, so that long words containing no whitespace will wrap onto a new line instead of being truncated.
This is how the testcase appears on a Linux build with the patch applied. The long word is wrapped onto a new line and is fully visible.
Will this patch fix bug 816436?
Assignee: nobody → mjh563
Status: NEW → ASSIGNED
Attachment #751362 - Flags: review?(dao)
(In reply to Scoobidiver from comment #14) > Will this patch fix bug 816436? No.
How do I apply this patch in my source code?
Is this why hovering on https://bugzilla.mozilla.org/show_bug.cgi?id=1126268 shows a truncated tool tip too? Could you please try landing the patch in any case, please?
Flags: needinfo?(mjh563)
¡Hola! Tool tips are no longer truncated for me with Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0 ID:20150624030204 CSet: be81b8d6fae9 Could you please confirm with a build from https://nightly.mozilla.org/ and change the "Status:" field to VERIFIED FIXED at the bottom of the bug accordingly? ¡Gracias! Alex
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Flags: needinfo?(FragerZ)
Resolution: --- → WORKSFORME
Whiteboard: [bugday-20150624]
Attachment #751362 - Flags: review?(dao)
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:41.0) Gecko/20100101 Firefox/41.0 20151014143721 Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:45.0) Gecko/20100101 Firefox/45.0 20151030030236 Reproducible with Firefox 41.0.2 as well as the current Nightly.
Status: RESOLVED → REOPENED
Component: General → Layout
Flags: needinfo?(FragerZ)
Product: Firefox → Core
Hardware: x86_64 → All
Resolution: WORKSFORME → ---
@gingerbread Man, also another scenario is (as mention in 1220230) is if I enter "/n".... not sure if the fix for this bug will fix that as well. Thanks viral
Came across the same issue while using firefox 60.0.2, is there any progress for this issue currently?
Status: REOPENED → NEW

Is there any resolution to this bug?

¡Hola Roma!

Unfortunately not yet.

The issue still reproduces on today's Firefox Nightly with the test case attached to this bug.

I've set the bug flags accordingly FWIW.

¡Gracias!
Alex

Severity: minor → S3

(In reply to alex_mayorga from comment #26)

¡Hola Roma!

Unfortunately not yet.

The issue still reproduces on today's Firefox Nightly with the test case attached to this bug.

I've set the bug flags accordingly FWIW.

¡Gracias!
Alex

Thanks for the reply ..!

We should try to resurrect this patch. It's breaking the tooltip of origin titles in in-content modal dialogs in proton.

Assignee: mjh563 → nobody
Flags: needinfo?(mjh563)
Keywords: helpwanted
Whiteboard: [bugday-20150624] → [bugday-20150624][proton-modals]
Priority: -- → P2
Whiteboard: [bugday-20150624][proton-modals] → [bugday-20150624][proton-modals][priority:2c]
Flags: needinfo?(dholbert)

The original testcase loads fine for me right now, but that's just because my monitor is wide enough for the whole thing to fit just fine on a single line.

Here's a version of the testcase with a much larger tooltip, whose last stretch of characters is "zzzzz". Expected results here would be for the "zzzz" to be visible (e.g. via linewrapping) or for the clipped characters to be gracefully ellipsized somehow. Actual results are that it gets clipped right now (somewhere around "dddddeeeee" for me).

Assignee: nobody → dholbert
Status: NEW → ASSIGNED

I posted a rebased version of the patch. It seems to work. (And its included automated testcase seems to work, too -- it fails without the functional part of the patch, and it passes with it.)

Here's a screenshot of "testcase 2" with the patch, showing the correct/expected behavior, I think.

I also tried a testcase with a bunch of kinda-long words, to be sure we didn't end up wrapping midword unnecessarily, and that worked fine as well. I verified that we'll wrap entire words (instead of e.g. laying out as many characters as possible and breaking at arbitrary midword points).

Flags: needinfo?(dholbert)

Try run looks good, I think (seems like just known-intermittent failures, and I don't see the new test failing anywhere).

Since we're in a soft-freeze as of earlier today, I'll hold off to land this until after the merge on Monday. (Gijs, let me know if there's any reason that we might need to uplift this to 89beta; I don't have a good understanding of what the proton impact is here & what if anything that means for 89.)

(In reply to Daniel Holbert [:dholbert] from comment #34)

Try run looks good, I think (seems like just known-intermittent failures, and I don't see the new test failing anywhere).

Since we're in a soft-freeze as of earlier today, I'll hold off to land this until after the merge on Monday. (Gijs, let me know if there's any reason that we might need to uplift this to 89beta; I don't have a good understanding of what the proton impact is here & what if anything that means for 89.)

I think given this is a CSS only patch (plus a test), and is therefore pretty low-risk, it would be nice to land it today, or if you prefer to wait, uplift to beta for proton. It's proton-relevant in that we use tooltips for long domains in dialog titles (where subdomains will get elided in order to show the toplevel domain), and if the tooltip then truncates at the end (toplevel domain instead of subdomain) that would be unfortunate. Does that help?

Flags: needinfo?(dholbert)

Sure, makes sense. I've triggered lando; should be landing soon.

Flags: needinfo?(dholbert)
Pushed by dholbert@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/360f79d7cb6d Let tooltips break in mid-word if required, so they don't get truncated. r=Gijs
Status: ASSIGNED → RESOLVED
Closed: 9 years ago4 years ago
Resolution: --- → FIXED
Target Milestone: --- → 89 Branch

Reproduced the initial issue with an affected build, Firefox 89.0a1 (20210410214333).
Verified fixed with 89.0b10 on Windows 10x64, macOS 11.3.1 and Ubuntu 18.04. The tooltips are displayed as expected using the attached test cases.

Status: RESOLVED → VERIFIED
Flags: qe-verify+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: