Changeset 195164 in webkit


Ignore:
Timestamp:
Jan 16, 2016 12:25:27 AM (8 years ago)
Author:
mmaxfield@apple.com
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()):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r195162 r195164  
     12016-01-16  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Tiny cleanup in FontFaceComparator
     4        https://bugs.webkit.org/show_bug.cgi?id=153044
     5
     6        Reviewed by Zalan Bujtas.
     7
     8        This is a follow-up patch to r194923.
     9
     10        No new tests because there is no behavior change.
     11
     12        * css/CSSFontSelector.cpp:
     13        (WebCore::FontFaceComparator::FontFaceComparator):
     14        (WebCore::FontFaceComparator::operator()):
     15
    1162016-01-15  Jiewen Tan  <jiewen_tan@apple.com>
    217
  • trunk/Source/WebCore/css/CSSFontSelector.cpp

    r194923 r195164  
    397397        : m_desiredTraitsMaskForComparison(desiredTraitsMaskForComparison)
    398398    {
     399        ASSERT_WITH_SECURITY_IMPLICATION(m_desiredTraitsMaskForComparison & FontWeightMask);
    399400    }
    400401
     
    445446
    446447        unsigned ruleSetIndex = 0;
    447         unsigned w = FontWeight100Bit;
    448         while (!(m_desiredTraitsMaskForComparison & (1 << w))) {
    449             w++;
    450             ruleSetIndex++;
    451         }
    452 
    453         ASSERT_WITH_SECURITY_IMPLICATION(ruleSetIndex < fallbackRuleSets);
     448        for (; !(m_desiredTraitsMaskForComparison & (1 << (FontWeight100Bit + ruleSetIndex))); ruleSetIndex++) { }
     449
    454450        const FontTraitsMask* weightFallbackRule = weightFallbackRuleSets[ruleSetIndex];
    455451        for (unsigned i = 0; i < rulesPerSet; ++i) {
Note: See TracChangeset for help on using the changeset viewer.