Changeset 128374 in webkit


Ignore:
Timestamp:
Sep 12, 2012 3:43:54 PM (12 years ago)
Author:
abarth@webkit.org
Message:

[v8] document.getCSSCanvasContext doesn't need to be custom
https://bugs.webkit.org/show_bug.cgi?id=96560

Reviewed by Eric Seidel.

Source/WebCore:

Instead of having a special case for toV8(CanvasRenderingContext*)
inlined into this custom function, we should just make the toV8
function itself custom.

Test: fast/canvas/canvas-css-crazy.html

  • UseV8.cmake:
  • WebCore.gypi:
  • bindings/v8/custom/V8DocumentCustom.cpp:
  • dom/Document.idl:
  • html/canvas/CanvasRenderingContext.idl:

LayoutTests:

Test that document.getCSSCanvasContext returns null for a bogus canvas type.

  • fast/canvas/canvas-css-crazy-expected.txt: Added.
  • fast/canvas/canvas-css-crazy.html: Added.
Location:
trunk
Files:
3 added
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r128370 r128374  
     12012-09-12  Adam Barth  <abarth@webkit.org>
     2
     3        [v8] document.getCSSCanvasContext doesn't need to be custom
     4        https://bugs.webkit.org/show_bug.cgi?id=96560
     5
     6        Reviewed by Eric Seidel.
     7
     8        Test that document.getCSSCanvasContext returns null for a bogus canvas type.
     9
     10        * fast/canvas/canvas-css-crazy-expected.txt: Added.
     11        * fast/canvas/canvas-css-crazy.html: Added.
     12
    1132012-09-12  Joshua Bell  <jsbell@chromium.org>
    214
  • trunk/Source/WebCore/ChangeLog

    r128373 r128374  
     12012-09-12  Adam Barth  <abarth@webkit.org>
     2
     3        [v8] document.getCSSCanvasContext doesn't need to be custom
     4        https://bugs.webkit.org/show_bug.cgi?id=96560
     5
     6        Reviewed by Eric Seidel.
     7
     8        Instead of having a special case for toV8(CanvasRenderingContext*)
     9        inlined into this custom function, we should just make the toV8
     10        function itself custom.
     11
     12        Test: fast/canvas/canvas-css-crazy.html
     13
     14        * UseV8.cmake:
     15        * WebCore.gypi:
     16        * bindings/v8/custom/V8DocumentCustom.cpp:
     17        * dom/Document.idl:
     18        * html/canvas/CanvasRenderingContext.idl:
     19
    1202012-09-12  Eric Seidel  <eric@webkit.org>
    221
  • trunk/Source/WebCore/UseV8.cmake

    r128261 r128374  
    8383    bindings/v8/custom/V8CSSValueCustom.cpp
    8484    bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp
     85    bindings/v8/custom/V8CanvasRenderingContextCustom.cpp
    8586    bindings/v8/custom/V8ClipboardCustom.cpp
    8687    bindings/v8/custom/V8ConsoleCustom.cpp
  • trunk/Source/WebCore/WebCore.gypi

    r128223 r128374  
    23522352            'bindings/v8/custom/V8CSSValueCustom.cpp',
    23532353            'bindings/v8/custom/V8CanvasRenderingContext2DCustom.cpp',
     2354            'bindings/v8/custom/V8CanvasRenderingContextCustom.cpp',
    23542355            'bindings/v8/custom/V8ClipboardCustom.cpp',
    23552356            'bindings/v8/custom/V8ConsoleCustom.cpp',
  • trunk/Source/WebCore/bindings/v8/custom/V8DocumentCustom.cpp

    r128159 r128374  
    9696}
    9797
    98 v8::Handle<v8::Value> V8Document::getCSSCanvasContextCallback(const v8::Arguments& args)
    99 {
    100     INC_STATS("DOM.Document.getCSSCanvasContext");
    101     v8::Handle<v8::Object> holder = args.Holder();
    102     Document* imp = V8Document::toNative(holder);
    103     String contextId = toWebCoreString(args[0]);
    104     String name = toWebCoreString(args[1]);
    105     int width = toInt32(args[2]);
    106     int height = toInt32(args[3]);
    107     CanvasRenderingContext* result = imp->getCSSCanvasContext(contextId, name, width, height);
    108     if (!result)
    109         return v8::Undefined();
    110     if (result->is2d())
    111         return toV8(static_cast<CanvasRenderingContext2D*>(result), args.Holder(), args.GetIsolate());
    112 #if ENABLE(WEBGL)
    113     else if (result->is3d())
    114         return toV8(static_cast<WebGLRenderingContext*>(result), args.Holder(), args.GetIsolate());
    115 #endif // ENABLE(WEBGL)
    116     ASSERT_NOT_REACHED();
    117     return v8::Undefined();
    118 }
    119 
    12098v8::Handle<v8::Value> toV8(Document* impl, v8::Handle<v8::Object> creationContext, v8::Isolate* isolate, bool forceNewObject)
    12199{
  • trunk/Source/WebCore/dom/Document.idl

    r126627 r128374  
    238238#if !defined(LANGUAGE_CPP) || !LANGUAGE_CPP
    239239#if !defined(LANGUAGE_OBJECTIVE_C) || !LANGUAGE_OBJECTIVE_C
    240         [V8Custom] DOMObject getCSSCanvasContext(in DOMString contextId, in DOMString name, in long width, in long height);
     240        CanvasRenderingContext getCSSCanvasContext(in DOMString contextId, in DOMString name, in long width, in long height);
    241241#endif
    242242#endif
  • trunk/Source/WebCore/html/canvas/CanvasRenderingContext.idl

    r107553 r128374  
    2929        JSCustomMarkFunction,
    3030        JSGenerateIsReachable,
    31         JSCustomToJSObject
     31        CustomToJSObject
    3232    ] CanvasRenderingContext {
    33 
    3433        readonly attribute HTMLCanvasElement canvas;
    3534    };
    3635
    3736}
    38 
Note: See TracChangeset for help on using the changeset viewer.