Bug 143389 - Migrate FontCascade's expansion functions to use StringView iterators
Summary: Migrate FontCascade's expansion functions to use StringView iterators
Status: NEW
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:
 
Reported: 2015-04-03 14:54 PDT by Myles C. Maxfield
Modified: 2015-04-03 18:24 PDT (History)
3 users (show)

See Also:


Attachments
Patch (29.49 KB, patch)
2015-04-03 15:23 PDT, Myles C. Maxfield
darin: review+
Details | Formatted Diff | Diff
Patch for landing (29.63 KB, patch)
2015-04-03 17:39 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-04-03 14:54:57 PDT
Migrate FontCascade's expansion functions to use StringView iterators
Comment 1 Myles C. Maxfield 2015-04-03 15:23:21 PDT
Created attachment 250102 [details]
Patch
Comment 2 Darin Adler 2015-04-03 16:39:29 PDT
Comment on attachment 250102 [details]
Patch

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

Not sure why compilation is failing. Please don’t land until you resolve that!

> Source/WTF/wtf/text/StringView.h:74
> +    // Note that these four iterators do not support double increments or double dereferences.

These four things that follow are not iterators. These are sort of “collections” that you can then call begin/end on to get iterators.

I don’t think the terms “double increments” and “double dereferences” are clear. What you are saying is that these are a certain type of iterator. I believe that what you are saying is that these are input iterators http://en.cppreference.com/w/cpp/concept/InputIterator but further they are even more restricted because you must always dereference and then increment before dereferencing again. I don’t think the phrase “do not support double increments” says that to me.

> Source/WTF/wtf/text/StringView.h:515
> +// Iterators

I don’t think this is a helpful comment, especially since the classes below are not all iterators.

> Source/WTF/wtf/text/StringView.h:516
> +class StringView::CodeUnits {

I suggest putting all the class definitions first, and then all the inline functions later.
Comment 3 Myles C. Maxfield 2015-04-03 17:38:03 PDT
Comment on attachment 250102 [details]
Patch

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

>> Source/WTF/wtf/text/StringView.h:74
>> +    // Note that these four iterators do not support double increments or double dereferences.
> 
> These four things that follow are not iterators. These are sort of “collections” that you can then call begin/end on to get iterators.
> 
> I don’t think the terms “double increments” and “double dereferences” are clear. What you are saying is that these are a certain type of iterator. I believe that what you are saying is that these are input iterators http://en.cppreference.com/w/cpp/concept/InputIterator but further they are even more restricted because you must always dereference and then increment before dereferencing again. I don’t think the phrase “do not support double increments” says that to me.

Done.

>> Source/WTF/wtf/text/StringView.h:515
>> +// Iterators
> 
> I don’t think this is a helpful comment, especially since the classes below are not all iterators.

Done.

>> Source/WTF/wtf/text/StringView.h:516
>> +class StringView::CodeUnits {
> 
> I suggest putting all the class definitions first, and then all the inline functions later.

Done.

Out of curiosity, why is this preferred?
Comment 4 Myles C. Maxfield 2015-04-03 17:39:20 PDT
Created attachment 250111 [details]
Patch for landing
Comment 5 Myles C. Maxfield 2015-04-03 18:24:38 PDT
Looks like this patch regresses Layout/line-layout-simple.html about 0.5%