Changeset 230398 in webkit


Ignore:
Timestamp:
Apr 9, 2018 3:52:54 AM (6 years ago)
Author:
Carlos Garcia Campos
Message:

Merge r229328 - Change the type of SVGToOTFFontConverter::m_weight to be not a char
https://bugs.webkit.org/show_bug.cgi?id=183339

Reviewed by Alex Christensen.

No new tests because there is no behavior change.

  • svg/SVGToOTFFontConversion.cpp:

(WebCore::SVGToOTFFontConverter::appendOS2Table):
(WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):

Location:
releases/WebKitGTK/webkit-2.20/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • releases/WebKitGTK/webkit-2.20/Source/WebCore/ChangeLog

    r230396 r230398  
     12018-03-06  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Change the type of SVGToOTFFontConverter::m_weight to be not a char
     4        https://bugs.webkit.org/show_bug.cgi?id=183339
     5
     6        Reviewed by Alex Christensen.
     7
     8        No new tests because there is no behavior change.
     9
     10        * svg/SVGToOTFFontConversion.cpp:
     11        (WebCore::SVGToOTFFontConverter::appendOS2Table):
     12        (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
     13
    1142018-03-05  Antti Koivisto  <antti@apple.com>
    215
  • releases/WebKitGTK/webkit-2.20/Source/WebCore/svg/SVGToOTFFontConversion.cpp

    r230394 r230398  
    265265    unsigned m_featureCountGSUB;
    266266    unsigned m_tablesAppendedCount;
    267     char m_weight;
     267    uint8_t m_weight;
    268268    bool m_italic;
    269269    bool m_error { false };
     
    500500    append16(2); // Version
    501501    append16(clampTo<int16_t>(averageAdvance));
    502     append16(clampTo<uint16_t>(m_weight)); // Weight class
     502    append16(m_weight); // Weight class
    503503    append16(5); // Width class
    504504    append16(0); // Protected font
     
    526526                bool ok;
    527527                int value = segment.toInt(&ok);
    528                 if (ok && value >= 0 && value <= 0xFF)
     528                if (ok && value >= std::numeric_limits<uint8_t>::min() && value <= std::numeric_limits<uint8_t>::max())
    529529                    panoseBytes[numPanoseBytes++] = value;
    530530            }
     
    14621462            int value = segment.toInt(ok);
    14631463            if (ok && value >= 0 && value < 1000) {
    1464                 m_weight = (value + 50) / 100;
     1464                m_weight = std::max(std::min((value + 50) / 100, static_cast<int>(std::numeric_limits<uint8_t>::max())), static_cast<int>(std::numeric_limits<uint8_t>::min()));
    14651465                break;
    14661466            }
Note: See TracChangeset for help on using the changeset viewer.