RESOLVED FIXED 172140
Migrate Font constructor from bools to enums
https://bugs.webkit.org/show_bug.cgi?id=172140
Summary Migrate Font constructor from bools to enums
Myles C. Maxfield
Reported 2017-05-15 16:33:45 PDT
Migrate Font constructor from bools to enums
Attachments
Patch (25.17 KB, patch)
2017-05-15 16:43 PDT, Myles C. Maxfield
no flags
Patch (20.39 KB, patch)
2017-05-15 17:09 PDT, Myles C. Maxfield
no flags
Myles C. Maxfield
Comment 1 2017-05-15 16:43:33 PDT
Tim Horton
Comment 2 2017-05-15 16:46:22 PDT
Comment on attachment 310183 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=310183&action=review > Source/WebCore/platform/graphics/Font.h:137 > + OrientationFallback isTextOrientationFallback() const { return m_orientationFallback ? OrientationFallback::Fallback : OrientationFallback::NoFallback; } Ditto, I don't love this. > Source/WebCore/platform/graphics/Font.h:185 > + Interstitial isInterstitial() const { return m_interstitial ? Interstitial::Yes : Interstitial::No; } If this is an "is", it should probably return a bool?
Simon Fraser (smfr)
Comment 3 2017-05-15 17:00:30 PDT
Comment on attachment 310183 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=310183&action=review > Source/WebCore/platform/graphics/Font.h:90 > + enum class Origin { > + Remote, > + Local > + }; > + enum class Interstitial { > + Yes, > + No > + }; > + enum class OrientationFallback { > + Fallback, > + NoFallback > + }; Could these all be in an OptionSet?
Myles C. Maxfield
Comment 4 2017-05-15 17:09:55 PDT
Tim Horton
Comment 5 2017-05-15 17:11:37 PDT
Comment on attachment 310191 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=310191&action=review > Source/WebCore/platform/graphics/Font.h:308 > + unsigned m_origin : 1; // Whether or not we are custom font loaded via @font-face > + unsigned m_isInterstitial : 1; // Whether or not this custom font is the last resort placeholder for a loading font These could totally be your enum if you wanted. But this is much better.
WebKit Commit Bot
Comment 6 2017-05-15 18:37:46 PDT
Comment on attachment 310191 [details] Patch Clearing flags on attachment: 310191 Committed r216896: <http://trac.webkit.org/changeset/216896>
WebKit Commit Bot
Comment 7 2017-05-15 18:37:48 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.