RESOLVED FIXED 180340
Improve FontSelectionAlgorithm, including moving from IntegerHasher to Hasher
https://bugs.webkit.org/show_bug.cgi?id=180340
Summary Improve FontSelectionAlgorithm, including moving from IntegerHasher to Hasher
Darin Adler
Reported 2017-12-03 15:57:36 PST
Improve FontSelectionAlgorithm, including moving from IntegerHasher to Hasher
Attachments
Patch (37.10 KB, patch)
2017-12-06 20:01 PST, Darin Adler
no flags
Patch (37.11 KB, patch)
2017-12-08 08:58 PST, Darin Adler
no flags
Archive of layout-test-results from ews106 for mac-elcapitan-wk2 (2.57 MB, application/zip)
2017-12-08 10:26 PST, EWS Watchlist
no flags
Patch (37.25 KB, patch)
2017-12-09 14:36 PST, Darin Adler
no flags
Patch (37.27 KB, patch)
2017-12-11 01:23 PST, Darin Adler
no flags
Patch (37.29 KB, patch)
2017-12-11 01:25 PST, Darin Adler
no flags
Patch (37.31 KB, patch)
2017-12-11 09:12 PST, Darin Adler
no flags
Patch (37.41 KB, patch)
2017-12-11 09:13 PST, Darin Adler
no flags
Patch (37.41 KB, patch)
2017-12-11 19:21 PST, Darin Adler
no flags
Darin Adler
Comment 1 2017-12-06 20:01:24 PST Comment hidden (obsolete)
EWS Watchlist
Comment 2 2017-12-06 20:03:29 PST Comment hidden (obsolete)
Darin Adler
Comment 3 2017-12-08 08:58:36 PST Comment hidden (obsolete)
EWS Watchlist
Comment 4 2017-12-08 10:26:14 PST Comment hidden (obsolete)
EWS Watchlist
Comment 5 2017-12-08 10:26:17 PST Comment hidden (obsolete)
Darin Adler
Comment 6 2017-12-09 14:33:41 PST
The mac-wk2 test failure looks like service worker and storage process problems unrelated to this patch.
Darin Adler
Comment 7 2017-12-09 14:36:30 PST
Darin Adler
Comment 8 2017-12-09 15:43:32 PST
OK, this time tests passed on all bots. Ready for review.
Daniel Bates
Comment 9 2017-12-09 18:50:52 PST
Comment on attachment 328917 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=328917&action=review > Source/WebCore/platform/graphics/FontSelectionAlgorithm.h:46 > + FontSelectionValue() { } This is minor. I prefer using = default. Although there is not much benefit here, I prefer using = default for consistency and because the defaulted default ccnstructor is considered a trivial constructor and allows the type to be aggregate initialized. > Source/WebCore/platform/graphics/FontSelectionAlgorithm.h:98 > + static const FontSelectionValue result(std::numeric_limits<BackingType>::max(), RawTag::RawTag); No love for uniform initializer syntax?
Darin Adler
Comment 10 2017-12-09 23:56:59 PST
Comment on attachment 328917 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=328917&action=review >> Source/WebCore/platform/graphics/FontSelectionAlgorithm.h:46 >> + FontSelectionValue() { } > > This is minor. I prefer using = default. Although there is not much benefit here, I prefer using = default for consistency and because the defaulted default ccnstructor is considered a trivial constructor and allows the type to be aggregate initialized. I used brace here to work around a bug in some compilers; otherwise I get a warning below in the normalItalicValue function. It warns that I am defining a constant object with no initialization in a class using the default constructor. I could try to find a workaround in the normalItalicValue function instead, perhaps passing a zero will make it work better. >> Source/WebCore/platform/graphics/FontSelectionAlgorithm.h:98 >> + static const FontSelectionValue result(std::numeric_limits<BackingType>::max(), RawTag::RawTag); > > No love for uniform initializer syntax? I’ll try switching to that. In this case there might be a problem because RawTag takes an int and the value of expression is a short.
Daniel Bates
Comment 11 2017-12-10 00:34:14 PST
Comment on attachment 328917 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=328917&action=review I like this patch, including the improved naming, comments and use of “using “ to make this code more readable and hackable. >>> Source/WebCore/platform/graphics/FontSelectionAlgorithm.h:98 >>> + static const FontSelectionValue result(std::numeric_limits<BackingType>::max(), RawTag::RawTag); >> >> No love for uniform initializer syntax? > > I’ll try switching to that. In this case there might be a problem because RawTag takes an int and the value of expression is a short. If we made RawTag a regular enum as opposed to an enum class then we could drop the enum class name qualifier :/ > Source/WebCore/platform/graphics/FontSelectionAlgorithm.h:334 > + // FIXME: This name is no so great. Move this into the add function below no => not
Darin Adler
Comment 12 2017-12-11 01:23:29 PST
Darin Adler
Comment 13 2017-12-11 01:25:21 PST
Darin Adler
Comment 14 2017-12-11 09:12:39 PST
Darin Adler
Comment 15 2017-12-11 09:13:14 PST
Darin Adler
Comment 16 2017-12-11 19:21:21 PST
Darin Adler
Comment 17 2017-12-11 19:50:14 PST
Radar WebKit Bug Importer
Comment 18 2017-12-11 19:51:46 PST
Ms2ger (he/him; ⌚ UTC+1/+2)
Comment 19 2017-12-12 03:08:42 PST
Note You need to log in before you can comment on or make changes to this bug.