Bug 143292 - Support forcing expansion opportunities at the beginning and ending of a run
Summary: Support forcing expansion opportunities at the beginning and ending of a run
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Myles C. Maxfield
URL:
Keywords:
Depends on:
Blocks: 142608
  Show dependency treegraph
 
Reported: 2015-03-31 21:31 PDT by Myles C. Maxfield
Modified: 2015-04-01 10:44 PDT (History)
9 users (show)

See Also:


Attachments
Patch (45.95 KB, patch)
2015-03-31 21:41 PDT, Myles C. Maxfield
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Myles C. Maxfield 2015-03-31 21:31:37 PDT
Support forcing expansion opportunities at the beginning and ending of a run
Comment 1 Myles C. Maxfield 2015-03-31 21:41:11 PDT
Created attachment 249888 [details]
Patch
Comment 2 Dave Hyatt 2015-04-01 09:01:56 PDT
Comment on attachment 249888 [details]
Patch

r=me
Comment 3 WebKit Commit Bot 2015-04-01 09:59:09 PDT
Comment on attachment 249888 [details]
Patch

Clearing flags on attachment: 249888

Committed r182236: <http://trac.webkit.org/changeset/182236>
Comment 4 WebKit Commit Bot 2015-04-01 09:59:15 PDT
All reviewed patches have been landed.  Closing bug.
Comment 5 Darin Adler 2015-04-01 10:22:35 PDT
Comment on attachment 249888 [details]
Patch

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

> Source/WebCore/platform/graphics/FontCascade.cpp:1124
> +        if (!stringView.is8Bit() && U16_IS_LEAD(initialCharacter) && stringView.length() > 1 && U16_IS_TRAIL(stringView[1]))

The is8Bit check here is unneeded extra code.

> Source/WebCore/platform/graphics/FontCascade.cpp:1128
> +        if (!stringView.is8Bit() && U16_IS_TRAIL(initialCharacter) && stringView.length() > 1 && U16_IS_LEAD(stringView[stringView.length() - 2]))

The is8Bit check here is unneeded extra code.

> Source/WebCore/platform/graphics/FontCascade.cpp:1143
> +        if (!stringView.is8Bit() && U16_IS_TRAIL(finalCharacter) && stringView.length() > 1 && U16_IS_LEAD(stringView[stringView.length() - 2]))

The is8Bit check here is unneeded extra code.

> Source/WebCore/platform/graphics/FontCascade.cpp:1147
> +        if (!stringView.is8Bit() && U16_IS_LEAD(finalCharacter) && stringView.length() > 1 && U16_IS_TRAIL(stringView[1]))

The is8Bit check here is unneeded extra code.

> Source/WebCore/platform/graphics/FontCascade.h:199
> +    static std::pair<unsigned, bool> expansionOpportunityCount(const StringView&, TextDirection, ExpansionBehavior);

Not sure why you chose pair over tuple here for return value.
Comment 6 Myles C. Maxfield 2015-04-01 10:40:05 PDT
Comment on attachment 249888 [details]
Patch

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

>> Source/WebCore/platform/graphics/FontCascade.cpp:1124
>> +        if (!stringView.is8Bit() && U16_IS_LEAD(initialCharacter) && stringView.length() > 1 && U16_IS_TRAIL(stringView[1]))
> 
> The is8Bit check here is unneeded extra code.

Done.

>> Source/WebCore/platform/graphics/FontCascade.cpp:1128
>> +        if (!stringView.is8Bit() && U16_IS_TRAIL(initialCharacter) && stringView.length() > 1 && U16_IS_LEAD(stringView[stringView.length() - 2]))
> 
> The is8Bit check here is unneeded extra code.

Done.

>> Source/WebCore/platform/graphics/FontCascade.cpp:1143
>> +        if (!stringView.is8Bit() && U16_IS_TRAIL(finalCharacter) && stringView.length() > 1 && U16_IS_LEAD(stringView[stringView.length() - 2]))
> 
> The is8Bit check here is unneeded extra code.

Done.

>> Source/WebCore/platform/graphics/FontCascade.cpp:1147
>> +        if (!stringView.is8Bit() && U16_IS_LEAD(finalCharacter) && stringView.length() > 1 && U16_IS_TRAIL(stringView[1]))
> 
> The is8Bit check here is unneeded extra code.

Done.

>> Source/WebCore/platform/graphics/FontCascade.h:199
>> +    static std::pair<unsigned, bool> expansionOpportunityCount(const StringView&, TextDirection, ExpansionBehavior);
> 
> Not sure why you chose pair over tuple here for return value.

There is no need for a tuple; pairs require exactly two inner types and tuples allow for an arbitrary number. However, I only need two. AFAIK, that's the only relevant difference between pair and tuple.
Comment 7 Myles C. Maxfield 2015-04-01 10:44:14 PDT
Committed r182238: <http://trac.webkit.org/changeset/182238>