Bug 99731 - Add 8-bit path to RenderBlock::handleTrailingSpaces()
Summary: Add 8-bit path to RenderBlock::handleTrailingSpaces()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Michael Saboff
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-10-18 10:06 PDT by Michael Saboff
Modified: 2012-10-18 11:03 PDT (History)
3 users (show)

See Also:


Attachments
Patch (2.65 KB, patch)
2012-10-18 10:13 PDT, Michael Saboff
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Saboff 2012-10-18 10:06:49 PDT
RenderBlock::handleTrailingSpaces() uses the characters() method to look for the range of space characters at the end of a text run.  This should be updated to use characters8() or characters16() as appropriate.
Comment 1 Michael Saboff 2012-10-18 10:13:55 PDT
Created attachment 169430 [details]
Patch
Comment 2 mitz 2012-10-18 10:20:25 PDT
Comment on attachment 169430 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=169430&action=review

> Source/WebCore/rendering/RenderBlockLineLayout.cpp:1030
> +        UChar current = characters[firstSpace - 1];
> +        if (!isCollapsibleSpace(current, lastText))

Have you tried making current a CharacterType and making isCollapsibleSpace() a function template as well?
Comment 3 Michael Saboff 2012-10-18 10:25:15 PDT
(In reply to comment #2)
> (From update of attachment 169430 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=169430&action=review
> 
> > Source/WebCore/rendering/RenderBlockLineLayout.cpp:1030
> > +        UChar current = characters[firstSpace - 1];
> > +        if (!isCollapsibleSpace(current, lastText))
> 
> Have you tried making current a CharacterType and making isCollapsibleSpace() a function template as well?

In most cases I haven't done this.  The implicit conversion from an LChar (unsigned char) to a UChar (unsigned short) is typically a nop.  If you think it is more readable I can make that change.
Comment 4 mitz 2012-10-18 10:27:19 PDT
Comment on attachment 169430 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=169430&action=review

>>> Source/WebCore/rendering/RenderBlockLineLayout.cpp:1030
>>> +        if (!isCollapsibleSpace(current, lastText))
>> 
>> Have you tried making current a CharacterType and making isCollapsibleSpace() a function template as well?
> 
> In most cases I haven't done this.  The implicit conversion from an LChar (unsigned char) to a UChar (unsigned short) is typically a nop.  If you think it is more readable I can make that change.

If it doesn’t change the generated code, then no, I don’t think it’s necessary.
Comment 5 WebKit Review Bot 2012-10-18 11:03:21 PDT
Comment on attachment 169430 [details]
Patch

Clearing flags on attachment: 169430

Committed r131776: <http://trac.webkit.org/changeset/131776>
Comment 6 WebKit Review Bot 2012-10-18 11:03:25 PDT
All reviewed patches have been landed.  Closing bug.