Skip to content
  • ch.dumez@samsung.com's avatar
    EnforceRange doesn't enforce range of a short · f025915b
    ch.dumez@samsung.com authored
    https://bugs.webkit.org/show_bug.cgi?id=123661
    
    Reviewed by Alexey Proskuryakov.
    
    Source/WebCore:
    
    Handle Web IDL short / unsigned short types as per the
    specification:
    - http://www.w3.org/TR/WebIDL/#es-short
    - http://www.w3.org/TR/WebIDL/#es-unsigned-short
    
    Specifically, we used to treat short / unsigned short as 32bit
    integers, which was wrong. We now properly handle them as 16bit
    integers.
    
    No new tests, added test cases to js/dom/webidl-type-mapping.html.
    
    * WebCore.exp.in:
    * bindings/js/JSDOMBinding.cpp:
    (WebCore::toSmallerInt):
    (WebCore::toSmallerUInt):
    (WebCore::toInt8):
    (WebCore::toUInt8):
    (WebCore::toInt16):
    (WebCore::toUInt16):
    * bindings/js/JSDOMBinding.h:
    * bindings/scripts/CodeGeneratorJS.pm:
    (JSValueToNative):
    * bindings/scripts/test/JS/JSTestObj.cpp:
    (WebCore::setJSTestObjShortAttr):
    (WebCore::setJSTestObjUnsignedShortAttr):
    * testing/TypeConversions.h:
    (WebCore::TypeConversions::testShort):
    (WebCore::TypeConversions::setTestShort):
    (WebCore::TypeConversions::testEnforceRangeShort):
    (WebCore::TypeConversions::setTestEnforceRangeShort):
    (WebCore::TypeConversions::testUnsignedShort):
    (WebCore::TypeConversions::setTestUnsignedShort):
    (WebCore::TypeConversions::testEnforceRangeUnsignedShort):
    (WebCore::TypeConversions::setTestEnforceRangeUnsignedShort):
    * testing/TypeConversions.idl:
    
    Source/WebKit:
    
    Export symbols to fix Windows build.
    
    * WebKit.vcxproj/WebKitExportGenerator/WebKitExports.def.in:
    
    LayoutTests:
    
    Extend js/dom/webidl-type-mapping.html layout test to validate
    Web IDL type mapping for short / unsigned short.
    
    * js/dom/webidl-type-mapping-expected.txt:
    * js/dom/webidl-type-mapping.html:
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@158521 268f45cc-cd09-0410-ab3c-d52691b4dbfc
    f025915b