Bug 295788 - Konqueror/webkit adds linebreaks in the middle of short words with word-wrap: break-word;
Summary: Konqueror/webkit adds linebreaks in the middle of short words with word-wrap:...
Status: RESOLVED UPSTREAM
Alias: None
Product: kwebkitpart
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: 1.2.0
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: webkit-devel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-03-11 19:47 UTC by Christian Boltz
Modified: 2012-07-16 14:26 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
minimal testcase (247 bytes, text/html)
2012-03-11 19:59 UTC, Christian Boltz
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christian Boltz 2012-03-11 19:47:56 UTC
I'm using the latest openSUSE RPMs of KDE 4.8.1. The most relevant package for this bugreport is probably kwebkitpart-1.2.0git20111019-29.2.x86_64

Konqueror with webkit does linebreaks in the middle of a word when using "white-space: pre-wrap;" even for short words:

Konqueror with webki
t does hard linebrea
ks for whitespace:pr
e-wrap, only based o
n the number of char
acters in a line.

Needless to say that this makes the text very hard to read.

Expected result: only very long words should be broken into multible lines. Example:
                                                                                                                                                           
Konqueror with
webkit should do
linebreaks only at
word boundaries
(spaces etc.) or
ifsomeoneforgetstoty
peaspace.

This is also the expected behaviour by W3C, see
http://www.w3.org/TR/2011/WD-css3-text-20110215/#word-wrap

Quoting from there: (__highlighting__ added by me)
    break-word
An unbreakable "word" may be broken at an arbitrary point __if there are no otherwise-acceptable break points__ in the line.
Comment 1 Christian Boltz 2012-03-11 19:53:03 UTC
Argh, that's the result of typing a bugreport too fast, later finding out the real reason and not updating the whole text :-/

Please replace all "white-space: pre-wrap" with "word-wrap: break-word" in the bug description. The second and third paragraph should be:

Konqueror with webkit does linebreaks in the middle of a word when using "word-wrap: break-word;" even for short words:

Konqueror with webki
t does hard linebrea
ks for word-wrap: br
eak-word, only based
on the number of cha
racters in a line.
Comment 2 Christian Boltz 2012-03-11 19:59:53 UTC
Created attachment 69512 [details]
minimal testcase
Comment 3 Dawit Alemayehu 2012-07-16 14:26:00 UTC
This is an upstream Webkit issue that affects Chromium as well. Neither Firefox nor KHTML will not do any word wrapping inside a <pre> tag ; as is the case with your minimal test. I dunno if that is a bug as well. Anyhow, there is a similar bug report upstream in Webkit's bug database. See https://bugs.webkit.org/show_bug.cgi?id=38222.