Changeset 73345 in webkit


Ignore:
Timestamp:
Dec 5, 2010 12:13:17 PM (13 years ago)
Author:
rwlbuis@webkit.org
Message:

2010-12-05 Rob Buis <rwlbuis@gmail.com>

Reviewed by Nikolas Zimmermann.

createSVGTransformFromMatrix(undefined) => NULL ptr
https://bugs.webkit.org/show_bug.cgi?id=49564

Throw TYPE_MISMATCH_ERR when using undefined or null as value for matrix parameter.

  • svg/SVGTransformList.idl:
  • svg/properties/SVGTransformListPropertyTearOff.h: (WebCore::SVGTransformListPropertyTearOff::createSVGTransformFromMatrix):
Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r73341 r73345  
     12010-12-05  Rob Buis  <rwlbuis@gmail.com>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        createSVGTransformFromMatrix(undefined) => NULL ptr
     6        https://bugs.webkit.org/show_bug.cgi?id=49564
     7
     8        Extend existing test to make sure undefined or null as parameter
     9        throw an exception.
     10
     11        * svg/dom/SVGTransformList-expected.txt:
     12        * svg/dom/script-tests/SVGTransformList.js:
     13
    1142010-12-05  Robert Hogan  <robert@webkit.org>
    215
  • trunk/LayoutTests/svg/dom/SVGTransformList-expected.txt

    r71802 r73345  
    1212PASS transform.createSVGTransformFromMatrix(1) threw exception TypeError: Type error.
    1313PASS transform.createSVGTransformFromMatrix(true) threw exception TypeError: Type error.
     14PASS transform.createSVGTransformFromMatrix(undefined) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
     15PASS transform.createSVGTransformFromMatrix(null) threw exception Error: TYPE_MISMATCH_ERR: DOM Exception 17.
    1416PASS successfullyParsed is true
    1517
  • trunk/LayoutTests/svg/dom/script-tests/SVGTransformList.js

    r71802 r73345  
    1313shouldThrow("transform.createSVGTransformFromMatrix(1)");
    1414shouldThrow("transform.createSVGTransformFromMatrix(true)");
     15shouldThrow("transform.createSVGTransformFromMatrix(undefined)");
     16shouldThrow("transform.createSVGTransformFromMatrix(null)");
    1517
    1618successfullyParsed = true;
  • trunk/WebCore/ChangeLog

    r73344 r73345  
     12010-12-05  Rob Buis  <rwlbuis@gmail.com>
     2
     3        Reviewed by Nikolas Zimmermann.
     4
     5        createSVGTransformFromMatrix(undefined) => NULL ptr
     6        https://bugs.webkit.org/show_bug.cgi?id=49564
     7
     8        Throw TYPE_MISMATCH_ERR when using undefined or null as value for matrix parameter.
     9
     10        * svg/SVGTransformList.idl:
     11        * svg/properties/SVGTransformListPropertyTearOff.h:
     12        (WebCore::SVGTransformListPropertyTearOff::createSVGTransformFromMatrix):
     13
    1142010-12-05  Alejandro G. Castro  <alex@igalia.com>
    215
  • trunk/WebCore/svg/SVGTransformList.idl

    r71802 r73345  
    4545            raises(DOMException, SVGException);
    4646
    47         [StrictTypeChecking, RequiresAllArguments=Raise] SVGTransform createSVGTransformFromMatrix(in SVGMatrix matrix);
     47        [StrictTypeChecking, RequiresAllArguments=Raise] SVGTransform createSVGTransformFromMatrix(in SVGMatrix matrix)
     48            raises(DOMException);
     49
    4850        SVGTransform consolidate()
    4951            raises(DOMException);
  • trunk/WebCore/svg/properties/SVGTransformListPropertyTearOff.h

    r73011 r73345  
    3939    }
    4040
    41     PassRefPtr<SVGPropertyTearOff<SVGTransform> > createSVGTransformFromMatrix(SVGPropertyTearOff<SVGMatrix>* matrix)
     41    PassRefPtr<SVGPropertyTearOff<SVGTransform> > createSVGTransformFromMatrix(SVGPropertyTearOff<SVGMatrix>* matrix, ExceptionCode& ec)
    4242    {
    43         ASSERT(matrix);
     43        if (!matrix) {
     44            ec = TYPE_MISMATCH_ERR;
     45            return 0;
     46        }
    4447        SVGTransformList& values = m_animatedProperty->values();
    4548        return SVGPropertyTearOff<SVGTransform>::create(values.createSVGTransformFromMatrix(matrix->propertyReference()));
Note: See TracChangeset for help on using the changeset viewer.