Problem/Motivation
Followup of #2165369: Installation breakpoint quirks
Long words in table cells are not handled well, which results in tables overflowing (see screenshot attached). While there is no unified cross-browser way to handle this, hopefully, we can come up with a css combination that is decent.
Proposed resolution
In Chrome and IE this is acheived with word-break: break-word. However, in FF and Opera this has to be done differently.
Issue screenshot:
Solution with word-break: break-word in Chrome
As an example for issue readers: ThisWordBreaksOnDrupalOrgTooThisWordBreaksOnDrupalOrgTooThisWordBreaksOnDrupalOrgTooThisWordBreaksOnDrupalOrgToo
Remaining tasks
User interface changes
API changes
Original report by @alexrayu
Comment | File | Size | Author |
---|---|---|---|
#19 | 2278507-word-break-in-cells-19.patch | 437 bytes | alexrayu |
#15 | 2278507-word-break-in-cells-15.patch | 436 bytes | alexrayu |
#13 | 2278507-word-break-in-cells-13.patch | 438 bytes | alexrayu |
#11 | snapshot10.png | 136.81 KB | alexrayu |
#10 | snapshot9.png | 91.3 KB | alexrayu |
Comments
Comment #1
alexrayu CreditAttribution: alexrayu commentedComment #2
alexrayu CreditAttribution: alexrayu commentedComment #3
alexrayu CreditAttribution: alexrayu commentedA patch that applied fix for IE and Chrome. There seems to be no good alternative for this for FF. Should we have this work at least for the browser that supports it, for Chrome?
Can we think of an elegant way to do it for FF?
Comment #4
clemens.tolboomComment #5
clemens.tolboomAccording to http://stackoverflow.com/questions/17143614/word-breakbreak-word-not-wor... we could use break-all instead of break-word ... is that a good idea?
[Stock response from Dreditor templates and macros.]
Please update the issue summary by applying the template from http://drupal.org/node/1155816.
Comment #6
alexrayu CreditAttribution: alexrayu commentedBreak-all breaks words even when not needed, rather than long, non-fitting words only.
Comment #7
alexrayu CreditAttribution: alexrayu commentedA sample of what word-break: break-all does. As you see, some other words get cut as well. If there is not working combination to reach the desired effect on FF, I would rather use break-word on Chrome only, where it works well, and leave the sticking out words at FF. I want to see, if there is something that I am missing, and if there is in fact a cure for FF as well.
See the screenshot for break-all in FF with wrong words broken in wrong places.
Comment #8
clemens.tolboomComment #9
clemens.tolboomI've updated the summary by adding a word which break on d.o too.
Fixing this for firefox requires
@alexrayu is that workable?
Comment #10
alexrayu CreditAttribution: alexrayu commented@clemens.tolboom - it does not seem workable (see the attached screenshot). Word-wrap: break-word works in FF, if we set this property to a div container and set explicit width to that div container, then it works. In our case, we have a table cell with a div container in some instances, and we can't always assume divs to be inside table cells.
I have looked though a few dozen threads for how to break words in FF in a smart way, but have not been successful in finding a good alternative for Chrome's word-break: break-word so far.
If we can't find a good solution for FF, would you rather have a fix work in Chrome only, or would you have a smart fix in chrome, and a fix that cuts words with word-break: break-all in FF?
Image: FF, word-break: break-all; word-wrap: break-word;
Comment #11
alexrayu CreditAttribution: alexrayu commentedImage: FF,
word-break: break-all;word-wrap: break-word;Comment #12
LewisNymanHey, thanks for this patch. This is a big improvement. I think it's important to iterate. Let's add the easy fix for chrome and come back to fix other use cases.
I'm not sure if we need the comment, if you feel strongly about having it then it should go above the selector with a blank line above it as per our coding standards.
Comment #13
alexrayu CreditAttribution: alexrayu commentedThe comment is not really needed. Here's a patch without comment.
Comment #15
alexrayu CreditAttribution: alexrayu commentedRe-apply patch.
Comment #16
alexrayu CreditAttribution: alexrayu commentedComment #17
LewisNymanGreat! Thank you.
Comment #18
clemens.tolboomWhere is word-break gone?
In the preceding discussion and patch #3 and #13 @alexrayu used
word-break
while #15 now hadword-wrap
.So please explain this change :)
Comment #19
alexrayu CreditAttribution: alexrayu commentedThe explanation is simple: break-word was the right one! Thanks!
Comment #20
alexrayu CreditAttribution: alexrayu commentedComment #21
lauriiiI tested this and it seems to fix the issue on Chrome and Safari. I think this is RTBC because there's no clean fix for Firefox available.
Comment #22
alexpottCommitted f43fb59 and pushed to 8.x. Thanks!