Changeset 69727 in webkit


Ignore:
Timestamp:
Oct 13, 2010 7:13:10 PM (14 years ago)
Author:
jamesr@google.com
Message:

2010-09-23 James Robinson <jamesr@chromium.org>

Reviewed by Darin Adler.

Canvas: radialGradient with negative radius should throw exception
https://bugs.webkit.org/show_bug.cgi?id=37176

Remove test from skipped lists now that it passes.

  • platform/chromium/test_expectations.txt:
  • platform/gtk/Skipped:
  • platform/mac/Skipped:
  • platform/qt/Skipped:

2010-10-13 James Robinson <jamesr@chromium.org>

Reviewed by Darin Adler.

Throw INDEX_SIZE_ERR exception if createRadialGradient is called with a negative radius
Canvas: radialGradient with negative radius should throw exception
https://bugs.webkit.org/show_bug.cgi?id=37176

This matches the canvas 2d specification, Opera, IE9 beta and our behavior for arc()
and arcTo(). Also fixes some PassRefPtr/RefPtr errors in this file.

Test: canvas/philip/tests/2d.gradient.radial.negative.html

  • html/canvas/CanvasRenderingContext2D.cpp: (WebCore::CanvasRenderingContext2D::createLinearGradient): (WebCore::CanvasRenderingContext2D::createRadialGradient): (WebCore::createEmptyImageData): (WebCore::CanvasRenderingContext2D::measureText):
Location:
trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r69721 r69727  
     12010-09-23  James Robinson  <jamesr@chromium.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Canvas: radialGradient with negative radius should throw exception
     6        https://bugs.webkit.org/show_bug.cgi?id=37176
     7
     8        Remove test from skipped lists now that it passes.
     9
     10        * platform/chromium/test_expectations.txt:
     11        * platform/gtk/Skipped:
     12        * platform/mac/Skipped:
     13        * platform/qt/Skipped:
     14
    1152010-10-13  Jeremy Orlow  <jorlow@chromium.org>
    216
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r69702 r69727  
    25692569BUG45991 : canvas/philip/tests/2d.fillStyle.parse.current.removed.html = TEXT PASS
    25702570BUG45991 : canvas/philip/tests/2d.fillStyle.parse.system.html = TEXT PASS
    2571 BUG45991 : canvas/philip/tests/2d.gradient.radial.negative.html = TEXT PASS
    25722571BUG45991 : canvas/philip/tests/2d.imageData.get.source.negative.html = TEXT PASS
    25732572BUG45991 : canvas/philip/tests/2d.path.rect.winding.html = TEXT PASS
  • trunk/LayoutTests/platform/gtk/Skipped

    r69676 r69727  
    55725572canvas/philip/tests/2d.gradient.radial.inside2.html
    55735573canvas/philip/tests/2d.gradient.radial.inside3.html
    5574 canvas/philip/tests/2d.gradient.radial.negative.html
    55755574canvas/philip/tests/2d.gradient.radial.outside1.html
    55765575canvas/philip/tests/2d.imageData.create1.type.html
  • trunk/LayoutTests/platform/mac/Skipped

    r69654 r69727  
    178178canvas/philip/tests/2d.gradient.radial.inside2.html
    179179canvas/philip/tests/2d.gradient.radial.inside3.html
    180 canvas/philip/tests/2d.gradient.radial.negative.html
    181180canvas/philip/tests/2d.gradient.radial.outside1.html
    182181canvas/philip/tests/2d.imageData.create1.type.html
  • trunk/LayoutTests/platform/qt/Skipped

    r69684 r69727  
    51895189canvas/philip/tests/2d.gradient.radial.cone.shape2.html
    51905190canvas/philip/tests/2d.gradient.radial.cone.top.html
    5191 canvas/philip/tests/2d.gradient.radial.negative.html
    51925191canvas/philip/tests/2d.gradient.radial.touch1.html
    51935192canvas/philip/tests/2d.gradient.radial.touch2.html
  • trunk/WebCore/ChangeLog

    r69726 r69727  
     12010-10-13  James Robinson  <jamesr@chromium.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Throw INDEX_SIZE_ERR exception if createRadialGradient is called with a negative radius
     6        Canvas: radialGradient with negative radius should throw exception
     7        https://bugs.webkit.org/show_bug.cgi?id=37176
     8
     9        This matches the canvas 2d specification, Opera, IE9 beta and our behavior for arc()
     10        and arcTo().  Also fixes some PassRefPtr/RefPtr errors in this file.
     11
     12        Test: canvas/philip/tests/2d.gradient.radial.negative.html
     13
     14        * html/canvas/CanvasRenderingContext2D.cpp:
     15        (WebCore::CanvasRenderingContext2D::createLinearGradient):
     16        (WebCore::CanvasRenderingContext2D::createRadialGradient):
     17        (WebCore::createEmptyImageData):
     18        (WebCore::CanvasRenderingContext2D::measureText):
     19
    1202010-10-13  Fridrich Strba  <fridrich.strba@bluewin.ch>
    221
  • trunk/WebCore/html/canvas/CanvasRenderingContext2D.cpp

    r69619 r69727  
    14031403    }
    14041404
    1405     PassRefPtr<CanvasGradient> gradient = CanvasGradient::create(FloatPoint(x0, y0), FloatPoint(x1, y1));
     1405    RefPtr<CanvasGradient> gradient = CanvasGradient::create(FloatPoint(x0, y0), FloatPoint(x1, y1));
    14061406    prepareGradientForDashboard(gradient.get());
    1407     return gradient;
     1407    return gradient.release();
    14081408}
    14091409
     
    14141414        return 0;
    14151415    }
    1416     PassRefPtr<CanvasGradient> gradient =  CanvasGradient::create(FloatPoint(x0, y0), r0, FloatPoint(x1, y1), r1);
     1416
     1417    if (r0 < 0 || r1 < 0) {
     1418        ec = INDEX_SIZE_ERR;
     1419        return 0;
     1420    }
     1421
     1422    RefPtr<CanvasGradient> gradient = CanvasGradient::create(FloatPoint(x0, y0), r0, FloatPoint(x1, y1), r1);
    14171423    prepareGradientForDashboard(gradient.get());
    1418     return gradient;
     1424    return gradient.release();
    14191425}
    14201426
     
    15141520    RefPtr<ImageData> data = ImageData::create(size.width(), size.height());
    15151521    memset(data->data()->data()->data(), 0, data->data()->data()->length());
    1516     return data.get();
     1522    return data.release();
    15171523}
    15181524
     
    17331739#endif
    17341740
    1735     return metrics;
     1741    return metrics.release();
    17361742}
    17371743
Note: See TracChangeset for help on using the changeset viewer.