Bug 300518

Summary: Wrapping long lines in 'pre-wrap' mode breaks before the space character, instead of after
Product: [Applications] konqueror Reporter: Graeme Hewson <bugs>
Component: khtmlAssignee: Konqueror Bugs <konqueror-bugs-null>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: andrew.crouthamel, cfeck
Priority: NOR    
Version First Reported In: 4.8.3   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Graeme Hewson 2012-05-23 18:35:18 UTC
When wrapping a long line of text, Konqueror adds a space to the beginning of each displayed line of text after the first displayed line.

For instance, in the Description in bug 50000, the paragraph after the greeting is one long line. In my browser, with a particular width, this is displayed as (using U+0180 to represent space):

when I try to ...
ƀenter correct ...
ƀ(the wrong one) ...

This happens only with KHTML and not with WebKit. (To reproduce, after switching browser engine in Configure/General, it's necessary to refresh the page.)
Comment 1 Christoph Feck 2012-05-23 21:02:47 UTC
I see that as a feature. When marking the text and copying it, the space that "separates" the lines is not lost.
Comment 2 Christoph Feck 2012-05-23 21:05:56 UTC
Actually, this is a CSS feature, and this site has adopted it. It does not happen everywhere.
Comment 3 Graeme Hewson 2012-05-23 22:04:36 UTC
Is it a bug in WebKit, then, that it doesn't conform to CSS?
Comment 4 Christoph Feck 2012-05-23 22:52:31 UTC
The CSS attribute to look for is "white-space: pre-wrap".

The W3C CSS TR says "If a space (U+0020) at the beginning of a line has 'white-space' set to 'normal', 'nowrap', or 'pre-line', it is removed." In other words, it is not removed for 'pre-wrap'. The line break, however, should not be before the space, but after it. Again quoting the CSS TR: "However, for 'pre-wrap', a line breaking opportunity exists at the end of the [spaces] sequence."

So it is wrong in KHTML.

http://www.w3.org/TR/CSS21/text.html#propdef-white-space
Comment 5 Andrew Crouthamel 2018-11-09 00:55:11 UTC
Dear Bug Submitter,

This bug has been stagnant for a long time. Could you help us out and re-test if the bug is valid in the latest version? I am setting the status to NEEDSINFO pending your response, please change the Status back to REPORTED when you respond.

Thank you for helping us make KDE software even better for everyone!
Comment 6 Graeme Hewson 2018-11-09 14:19:51 UTC
The bug is still present in Konqueror 5.0.97.

However, I no longer use KHTML (in fact, I'm surprised to find it's still supported).
Comment 7 Andrew Crouthamel 2018-11-10 01:27:12 UTC
Thanks for the update!
Comment 8 Christoph Cullmann 2024-05-06 18:39:27 UTC
Dear user,

KHTML (and KJS) was a long time more or less unmaintained and got removed in KF6.

Please migrate to use a QWebEngine based HTML component.

We will do no further fixes or improvements to the KF5 branches of these components beside important security fixes.

For security issues, please see:

https://kde.org/info/security/

Sorry that we did not fix this issue during the life-time of KHTML.

Greetings
Christoph Cullmann