Title: [195164] trunk/Source/WebCore
Revision
195164
Author
[email protected]
Date
2016-01-16 00:25:27 -0800 (Sat, 16 Jan 2016)

Log Message

Tiny cleanup in FontFaceComparator
https://bugs.webkit.org/show_bug.cgi?id=153044

Reviewed by Zalan Bujtas.

This is a follow-up patch to r194923.

No new tests because there is no behavior change.

* css/CSSFontSelector.cpp:
(WebCore::FontFaceComparator::FontFaceComparator):
(WebCore::FontFaceComparator::operator()):

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (195163 => 195164)


--- trunk/Source/WebCore/ChangeLog	2016-01-16 03:57:27 UTC (rev 195163)
+++ trunk/Source/WebCore/ChangeLog	2016-01-16 08:25:27 UTC (rev 195164)
@@ -1,3 +1,18 @@
+2016-01-16  Myles C. Maxfield  <[email protected]>
+
+        Tiny cleanup in FontFaceComparator
+        https://bugs.webkit.org/show_bug.cgi?id=153044
+
+        Reviewed by Zalan Bujtas.
+
+        This is a follow-up patch to r194923.
+
+        No new tests because there is no behavior change.
+
+        * css/CSSFontSelector.cpp:
+        (WebCore::FontFaceComparator::FontFaceComparator):
+        (WebCore::FontFaceComparator::operator()):
+
 2016-01-15  Jiewen Tan  <[email protected]>
 
         FrameLoaderClient::didReceiveServerRedirectForProvisionalLoadForFrame() is never called when loading a main resource from the memory cache

Modified: trunk/Source/WebCore/css/CSSFontSelector.cpp (195163 => 195164)


--- trunk/Source/WebCore/css/CSSFontSelector.cpp	2016-01-16 03:57:27 UTC (rev 195163)
+++ trunk/Source/WebCore/css/CSSFontSelector.cpp	2016-01-16 08:25:27 UTC (rev 195164)
@@ -396,6 +396,7 @@
     FontFaceComparator(FontTraitsMask desiredTraitsMaskForComparison)
         : m_desiredTraitsMaskForComparison(desiredTraitsMaskForComparison)
     {
+        ASSERT_WITH_SECURITY_IMPLICATION(m_desiredTraitsMaskForComparison & FontWeightMask);
     }
 
     bool operator()(const CSSFontFace& first, const CSSFontFace& second)
@@ -444,13 +445,8 @@
         };
 
         unsigned ruleSetIndex = 0;
-        unsigned w = FontWeight100Bit;
-        while (!(m_desiredTraitsMaskForComparison & (1 << w))) {
-            w++;
-            ruleSetIndex++;
-        }
+        for (; !(m_desiredTraitsMaskForComparison & (1 << (FontWeight100Bit + ruleSetIndex))); ruleSetIndex++) { }
 
-        ASSERT_WITH_SECURITY_IMPLICATION(ruleSetIndex < fallbackRuleSets);
         const FontTraitsMask* weightFallbackRule = weightFallbackRuleSets[ruleSetIndex];
         for (unsigned i = 0; i < rulesPerSet; ++i) {
             if (secondTraitsMask & weightFallbackRule[i])
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to