[Webkit-unassigned] [Bug 63894] New: Incorrect text wrap

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jul 4 02:07:56 PDT 2011


https://bugs.webkit.org/show_bug.cgi?id=63894

           Summary: Incorrect text wrap
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: All
        OS/Version: All
            Status: UNCONFIRMED
          Severity: Normal
          Priority: P2
         Component: WebCore Misc.
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: hgneng at gmail.com


Hello,

Here is the test code to reproduce the problem:
<html><body><div style='width:2px;border:solid 1px red'><span>0</span><span>汉1</span></div></body></html>

In theory, the text should be wrapped before "&#27721". But Webkit wrap it after "&#27721".

I think the problem lies in function nextBreakablePosition in webcore/rendering/break_lines.cpp. nextBreakablePosition will never return index of 0, which it will break at least after the first character. However, it will not break at the end of an inline element, which may be because it is not certain that whether next character is  

In function nextBreakablePosition, the initial value of lastCh is 0 if it's at the beginning of a RenderText.
    UChar lastCh = pos > 0 ? str[pos - 1] : 0;

I think passing the last character as an argument of this function will solve this problem. We can update the last character in RenderBlock::findNextLineBreak

What do you think?

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list