Changeset 192787 in webkit


Ignore:
Timestamp:
Nov 29, 2015 10:47:08 AM (8 years ago)
Author:
Simon Fraser
Message:

Use SVGTransform::SVGTransformType instead of an unsigned short
https://bugs.webkit.org/show_bug.cgi?id=151637

Reviewed by Brady Eidson.

Make 'type' more strongly typed.

  • svg/SVGTransformable.cpp:

(WebCore::SVGTransformable::parseTransformValue):
(WebCore::parseAndSkipType):
(WebCore::SVGTransformable::parseTransformType):
(WebCore::SVGTransformable::parseTransformAttribute):

  • svg/SVGTransformable.h:
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r192783 r192787  
     12015-11-29  Simon Fraser  <simon.fraser@apple.com>
     2
     3        Use SVGTransform::SVGTransformType instead of an unsigned short
     4        https://bugs.webkit.org/show_bug.cgi?id=151637
     5
     6        Reviewed by Brady Eidson.
     7
     8        Make 'type' more strongly typed.
     9
     10        * svg/SVGTransformable.cpp:
     11        (WebCore::SVGTransformable::parseTransformValue):
     12        (WebCore::parseAndSkipType):
     13        (WebCore::SVGTransformable::parseTransformType):
     14        (WebCore::SVGTransformable::parseTransformAttribute):
     15        * svg/SVGTransformable.h:
     16
    1172015-11-27  Brady Eidson  <beidson@apple.com>
    218
  • trunk/Source/WebCore/svg/SVGTransformable.cpp

    r165848 r192787  
    9494}
    9595
    96 bool SVGTransformable::parseTransformValue(unsigned type, const UChar*& ptr, const UChar* end, SVGTransform& transform)
     96bool SVGTransformable::parseTransformValue(SVGTransform::SVGTransformType type, const UChar*& ptr, const UChar* end, SVGTransform& transform)
    9797{
    9898    if (type == SVGTransform::SVG_TRANSFORM_UNKNOWN)
     
    105105
    106106    switch (type) {
     107    case SVGTransform::SVG_TRANSFORM_UNKNOWN:
     108        ASSERT_NOT_REACHED();
     109        break;
    107110    case SVGTransform::SVG_TRANSFORM_SKEWX:
    108111        transform.setSkewX(values[0]);
     
    144147static const UChar matrixDesc[] =  {'m', 'a', 't', 'r', 'i', 'x'};
    145148
    146 static inline bool parseAndSkipType(const UChar*& currTransform, const UChar* end, unsigned short& type)
     149static inline bool parseAndSkipType(const UChar*& currTransform, const UChar* end, SVGTransform::SVGTransformType& type)
    147150{
    148151    if (currTransform >= end)
     
    172175SVGTransform::SVGTransformType SVGTransformable::parseTransformType(const String& typeString)
    173176{
    174     unsigned short type = SVGTransform::SVG_TRANSFORM_UNKNOWN;
     177    SVGTransform::SVGTransformType type = SVGTransform::SVG_TRANSFORM_UNKNOWN;
    175178    auto upconvertedCharacters = StringView(typeString).upconvertedCharacters();
    176179    const UChar* characters = upconvertedCharacters;
     
    187190    while (currTransform < end) {
    188191        delimParsed = false;
    189         unsigned short type = SVGTransform::SVG_TRANSFORM_UNKNOWN;
     192        SVGTransform::SVGTransformType type = SVGTransform::SVG_TRANSFORM_UNKNOWN;
    190193        skipOptionalSVGSpaces(currTransform, end);
    191194
  • trunk/Source/WebCore/svg/SVGTransformable.h

    r163440 r192787  
    4141
    4242    static bool parseTransformAttribute(SVGTransformList&, const UChar*& ptr, const UChar* end, TransformParsingMode mode = ClearList);
    43     static bool parseTransformValue(unsigned type, const UChar*& ptr, const UChar* end, SVGTransform&);
     43    static bool parseTransformValue(SVGTransform::SVGTransformType, const UChar*& ptr, const UChar* end, SVGTransform&);
    4444    static SVGTransform::SVGTransformType parseTransformType(const String&);
    4545
Note: See TracChangeset for help on using the changeset viewer.