Changeset 155137 in webkit


Ignore:
Timestamp:
Sep 5, 2013 11:58:07 AM (11 years ago)
Author:
dino@apple.com
Message:

Rename supportsContext to probablySupportsContext
https://bugs.webkit.org/show_bug.cgi?id=120716
<rdar://problem/14914499>

Reviewed by Antoine Quint.

As decided in: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-September/040680.html

Source/WebCore:

  • bindings/js/JSHTMLCanvasElementCustom.cpp:

(WebCore::JSHTMLCanvasElement::probablySupportsContext):

  • html/HTMLCanvasElement.cpp:

(WebCore::HTMLCanvasElement::probablySupportsContext):

  • html/HTMLCanvasElement.h:
  • html/HTMLCanvasElement.idl:

LayoutTests:

  • fast/canvas/webgl/canvas-supports-context-expected.txt:
  • fast/canvas/webgl/canvas-supports-context.html:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r155132 r155137  
     12013-09-04  Dean Jackson  <dino@apple.com>
     2
     3        Rename supportsContext to probablySupportsContext
     4        https://bugs.webkit.org/show_bug.cgi?id=120716
     5        <rdar://problem/14914499>
     6
     7        Reviewed by Antoine Quint.
     8
     9        As decided in: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-September/040680.html
     10
     11        * fast/canvas/webgl/canvas-supports-context-expected.txt:
     12        * fast/canvas/webgl/canvas-supports-context.html:
     13
    1142013-09-05  Joseph Pecoraro  <pecoraro@apple.com>
    215
  • trunk/LayoutTests/fast/canvas/webgl/canvas-supports-context-expected.txt

    r151298 r155137  
    1 This test ensures WebGL implementations interact correctly with the canvas tag's supportContext function, that getContext and supportsContext are implemented consistently with one another, and that malformed parameters to supportsContext are handled correctly.
     1This test ensures WebGL implementations interact correctly with the canvas tag's probablySupportsContext function, that getContext and probablySupportsContext are implemented consistently with one another, and that malformed parameters to probablySupportsContext are handled correctly.
    22
    33On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
    44
    55
    6 Canvas.supportsContext('2d')
     6Canvas.probablySupportsContext('2d')
    77
    8 PASS supportsContext('2d') is consistent with getContext('2d')
    9 PASS supportsContext('2d') returns true
     8PASS probablySupportsContext('2d') is consistent with getContext('2d')
     9PASS probablySupportsContext('2d') returns true
    1010PASS getContext('2d') returns true (context exists)
    11 Testing getContext and supportsContext('2d') after a context is created
    12 PASS supportsContext('2d') returns true
    13 PASS supportsContext('webkit-3d') returns false
     11Testing getContext and probablySupportsContext('2d') after a context is created
     12PASS probablySupportsContext('2d') returns true
     13PASS probablySupportsContext('webkit-3d') returns false
    1414PASS webkit-3d context does not exist
    1515
    1616WebGL disabled
    1717
    18 Canvas.supportsContext('webkit-3d')
     18Canvas.probablySupportsContext('webkit-3d')
    1919
    20 PASS supportsContext('webkit-3d') is consistent with getContext('webkit-3d')
    21 FAIL supportsContext('webkit-3d') returns false
     20PASS probablySupportsContext('webkit-3d') is consistent with getContext('webkit-3d')
     21FAIL probablySupportsContext('webkit-3d') returns false
    2222FAIL getContext('webkit-3d') returns false (context does not exist)
    2323
    24 Canvas.supportsContext('experimental-webgl')
     24Canvas.probablySupportsContext('experimental-webgl')
    2525
    26 PASS supportsContext('experimental-webgl') is consistent with getContext('experimental-webgl')
    27 FAIL supportsContext('experimental-webgl') returns false
     26PASS probablySupportsContext('experimental-webgl') is consistent with getContext('experimental-webgl')
     27FAIL probablySupportsContext('experimental-webgl') returns false
    2828FAIL getContext('experimental-webgl') returns false (context does not exist)
    2929
    30 Canvas.supportsContext('moz-webgl')
     30Canvas.probablySupportsContext('moz-webgl')
    3131
    32 PASS supportsContext('moz-webgl') is consistent with getContext('moz-webgl')
    33 FAIL supportsContext('moz-webgl') returns false
     32PASS probablySupportsContext('moz-webgl') is consistent with getContext('moz-webgl')
     33FAIL probablySupportsContext('moz-webgl') returns false
    3434FAIL getContext('moz-webgl') returns false (context does not exist)
    3535
    3636WebGL enabled
    3737
    38 Canvas.supportsContext('webkit-3d')
     38Canvas.probablySupportsContext('webkit-3d')
    3939
    40 PASS supportsContext('webkit-3d') is consistent with getContext('webkit-3d')
    41 PASS supportsContext('webkit-3d') returns true
     40PASS probablySupportsContext('webkit-3d') is consistent with getContext('webkit-3d')
     41PASS probablySupportsContext('webkit-3d') returns true
    4242PASS getContext('webkit-3d') returns true (context exists)
    43 Testing getContext and supportsContext('webkit-3d') after a context is created
    44 PASS supportsContext('webkit-3d') returns true
    45 PASS supportsContext('2d') returns false
     43Testing getContext and probablySupportsContext('webkit-3d') after a context is created
     44PASS probablySupportsContext('webkit-3d') returns true
     45PASS probablySupportsContext('2d') returns false
    4646PASS 2d context does not exist
    4747
    48 Canvas.supportsContext('experimental-webgl')
     48Canvas.probablySupportsContext('experimental-webgl')
    4949
    50 PASS supportsContext('experimental-webgl') is consistent with getContext('experimental-webgl')
    51 PASS supportsContext('experimental-webgl') returns true
     50PASS probablySupportsContext('experimental-webgl') is consistent with getContext('experimental-webgl')
     51PASS probablySupportsContext('experimental-webgl') returns true
    5252PASS getContext('experimental-webgl') returns true (context exists)
    53 Testing getContext and supportsContext('experimental-webgl') after a context is created
    54 PASS supportsContext('experimental-webgl') returns true
    55 PASS supportsContext('2d') returns false
     53Testing getContext and probablySupportsContext('experimental-webgl') after a context is created
     54PASS probablySupportsContext('experimental-webgl') returns true
     55PASS probablySupportsContext('2d') returns false
    5656PASS 2d context does not exist
    5757
    58 Canvas.supportsContext('moz-webgl')
     58Canvas.probablySupportsContext('moz-webgl')
    5959
    60 PASS supportsContext('moz-webgl') is consistent with getContext('moz-webgl')
    61 FAIL supportsContext('moz-webgl') returns false
     60PASS probablySupportsContext('moz-webgl') is consistent with getContext('moz-webgl')
     61FAIL probablySupportsContext('moz-webgl') returns false
    6262FAIL getContext('moz-webgl') returns false (context does not exist)
    6363
    64 Testing malformed attributes that cause supportsContext and getContext to be undefined
     64Testing malformed attributes that cause probablySupportsContext and getContext to be undefined
    6565
    66 canvas.supportsContext('webkit-3d' ,{ get alpha() { throw 'Test alpha Error'; } })
     66canvas.probablySupportsContext('webkit-3d' ,{ get alpha() { throw 'Test alpha Error'; } })
    6767
    6868PASS supports is undefined
    6969PASS context is undefined
    70 PASS supportsContext('webkit-3d' ,{ get alpha() { throw 'Test alpha Error'; } }) is consistent with getContext('webkit-3d' ,{ get alpha() { throw 'Test alpha Error'; } })
    71 FAIL supportsContext('webkit-3d' ,{ get alpha() { throw 'Test alpha Error'; } }) returns false
     70PASS probablySupportsContext('webkit-3d' ,{ get alpha() { throw 'Test alpha Error'; } }) is consistent with getContext('webkit-3d' ,{ get alpha() { throw 'Test alpha Error'; } })
     71FAIL probablySupportsContext('webkit-3d' ,{ get alpha() { throw 'Test alpha Error'; } }) returns false
    7272FAIL getContext('webkit-3d' ,{ get alpha() { throw 'Test alpha Error'; } }) returns false (context does not exist)
    7373
    74 canvas.supportsContext('webkit-3d' ,{ get depth() { throw 'Test depth Error'; } })
     74canvas.probablySupportsContext('webkit-3d' ,{ get depth() { throw 'Test depth Error'; } })
    7575
    7676PASS supports is undefined
    7777PASS context is undefined
    78 PASS supportsContext('webkit-3d' ,{ get depth() { throw 'Test depth Error'; } }) is consistent with getContext('webkit-3d' ,{ get depth() { throw 'Test depth Error'; } })
    79 FAIL supportsContext('webkit-3d' ,{ get depth() { throw 'Test depth Error'; } }) returns false
     78PASS probablySupportsContext('webkit-3d' ,{ get depth() { throw 'Test depth Error'; } }) is consistent with getContext('webkit-3d' ,{ get depth() { throw 'Test depth Error'; } })
     79FAIL probablySupportsContext('webkit-3d' ,{ get depth() { throw 'Test depth Error'; } }) returns false
    8080FAIL getContext('webkit-3d' ,{ get depth() { throw 'Test depth Error'; } }) returns false (context does not exist)
    8181
    82 canvas.supportsContext('webkit-3d' ,{ get stencil() { throw 'Test stencil Error'; } })
     82canvas.probablySupportsContext('webkit-3d' ,{ get stencil() { throw 'Test stencil Error'; } })
    8383
    8484PASS supports is undefined
    8585PASS context is undefined
    86 PASS supportsContext('webkit-3d' ,{ get stencil() { throw 'Test stencil Error'; } }) is consistent with getContext('webkit-3d' ,{ get stencil() { throw 'Test stencil Error'; } })
    87 FAIL supportsContext('webkit-3d' ,{ get stencil() { throw 'Test stencil Error'; } }) returns false
     86PASS probablySupportsContext('webkit-3d' ,{ get stencil() { throw 'Test stencil Error'; } }) is consistent with getContext('webkit-3d' ,{ get stencil() { throw 'Test stencil Error'; } })
     87FAIL probablySupportsContext('webkit-3d' ,{ get stencil() { throw 'Test stencil Error'; } }) returns false
    8888FAIL getContext('webkit-3d' ,{ get stencil() { throw 'Test stencil Error'; } }) returns false (context does not exist)
    8989
    90 canvas.supportsContext('webkit-3d' ,{ get antialias() { throw 'Test antialias Error'; } })
     90canvas.probablySupportsContext('webkit-3d' ,{ get antialias() { throw 'Test antialias Error'; } })
    9191
    9292PASS supports is undefined
    9393PASS context is undefined
    94 PASS supportsContext('webkit-3d' ,{ get antialias() { throw 'Test antialias Error'; } }) is consistent with getContext('webkit-3d' ,{ get antialias() { throw 'Test antialias Error'; } })
    95 FAIL supportsContext('webkit-3d' ,{ get antialias() { throw 'Test antialias Error'; } }) returns false
     94PASS probablySupportsContext('webkit-3d' ,{ get antialias() { throw 'Test antialias Error'; } }) is consistent with getContext('webkit-3d' ,{ get antialias() { throw 'Test antialias Error'; } })
     95FAIL probablySupportsContext('webkit-3d' ,{ get antialias() { throw 'Test antialias Error'; } }) returns false
    9696FAIL getContext('webkit-3d' ,{ get antialias() { throw 'Test antialias Error'; } }) returns false (context does not exist)
    9797
    98 canvas.supportsContext('webkit-3d' ,{ get premultipliedAlpha() { throw 'Test premultipliedAlpha Error'; } })
     98canvas.probablySupportsContext('webkit-3d' ,{ get premultipliedAlpha() { throw 'Test premultipliedAlpha Error'; } })
    9999
    100100PASS supports is undefined
    101101PASS context is undefined
    102 PASS supportsContext('webkit-3d' ,{ get premultipliedAlpha() { throw 'Test premultipliedAlpha Error'; } }) is consistent with getContext('webkit-3d' ,{ get premultipliedAlpha() { throw 'Test premultipliedAlpha Error'; } })
    103 FAIL supportsContext('webkit-3d' ,{ get premultipliedAlpha() { throw 'Test premultipliedAlpha Error'; } }) returns false
     102PASS probablySupportsContext('webkit-3d' ,{ get premultipliedAlpha() { throw 'Test premultipliedAlpha Error'; } }) is consistent with getContext('webkit-3d' ,{ get premultipliedAlpha() { throw 'Test premultipliedAlpha Error'; } })
     103FAIL probablySupportsContext('webkit-3d' ,{ get premultipliedAlpha() { throw 'Test premultipliedAlpha Error'; } }) returns false
    104104FAIL getContext('webkit-3d' ,{ get premultipliedAlpha() { throw 'Test premultipliedAlpha Error'; } }) returns false (context does not exist)
    105105
    106 canvas.supportsContext('webkit-3d' ,{ get preserveDrawingBUffer() { throw 'Test preserveDrawingBuffer Error'; } })
     106canvas.probablySupportsContext('webkit-3d' ,{ get preserveDrawingBUffer() { throw 'Test preserveDrawingBuffer Error'; } })
    107107
    108108PASS supports is undefined
    109109PASS context is undefined
    110 PASS supportsContext('webkit-3d' ,{ get preserveDrawingBUffer() { throw 'Test preserveDrawingBuffer Error'; } }) is consistent with getContext('webkit-3d' ,{ get preserveDrawingBUffer() { throw 'Test preserveDrawingBuffer Error'; } })
    111 FAIL supportsContext('webkit-3d' ,{ get preserveDrawingBUffer() { throw 'Test preserveDrawingBuffer Error'; } }) returns false
     110PASS probablySupportsContext('webkit-3d' ,{ get preserveDrawingBUffer() { throw 'Test preserveDrawingBuffer Error'; } }) is consistent with getContext('webkit-3d' ,{ get preserveDrawingBUffer() { throw 'Test preserveDrawingBuffer Error'; } })
     111FAIL probablySupportsContext('webkit-3d' ,{ get preserveDrawingBUffer() { throw 'Test preserveDrawingBuffer Error'; } }) returns false
    112112FAIL getContext('webkit-3d' ,{ get preserveDrawingBUffer() { throw 'Test preserveDrawingBuffer Error'; } }) returns false (context does not exist)
    113113
    114 Testing how supportsContext handles no parameters
    115 PASS document.createElement('canvas').supportsContext() is false
     114Testing how probablySupportsContext handles no parameters
     115PASS document.createElement('canvas').probablySupportsContext() is false
    116116
    117117PASS successfullyParsed is true
  • trunk/LayoutTests/fast/canvas/webgl/canvas-supports-context.html

    r151298 r155137  
    11<html>
    22<head>
    3 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    4 <title>WebGL Canvas supportsContext Tests</title>
     3<title>WebGL Canvas probablySupportsContext Tests</title>
    54<script src="../../js/resources/js-test-pre.js"></script>
    65</head>
     
    1716{
    1817    if (context && !supports)
    19         testFailed(type_of_context + " context exists yet canvas.supportsContext(" + args_str + ") returns false");
     18        testFailed(type_of_context + " context exists yet canvas.probablySupportsContext(" + args_str + ") returns false");
    2019    else
    21         testPassed("supportsContext(" + args_str + ") is consistent with getContext(" + args_str + ")");
     20        testPassed("probablySupportsContext(" + args_str + ") is consistent with getContext(" + args_str + ")");
    2221
    2322    if (supports)
    24         testPassed("supportsContext(" + args_str + ") returns true");
     23        testPassed("probablySupportsContext(" + args_str + ") returns true");
    2524    else
    26         testFailed("supportsContext(" + args_str + ") returns false");
     25        testFailed("probablySupportsContext(" + args_str + ") returns false");
    2726
    2827    if (context) {
     
    4746function test_post_creation(canvas, type_of_context)
    4847{
    49     debug("Testing getContext and supportsContext('" + type_of_context + "') after a context is created");
     48    debug("Testing getContext and probablySupportsContext('" + type_of_context + "') after a context is created");
    5049
    51     if (canvas.supportsContext(type_of_context))
    52         testPassed("supportsContext('" + type_of_context + "') returns true");
     50    if (canvas.probablySupportsContext(type_of_context))
     51        testPassed("probablySupportsContext('" + type_of_context + "') returns true");
    5352    else
    54         testFailed("supportsContext('" + type_of_context + "') returns false");
     53        testFailed("probablySupportsContext('" + type_of_context + "') returns false");
    5554
    5655    var other_type = other_type_of_context(type_of_context);
     
    6160    }
    6261
    63     if (!canvas.supportsContext(other_type))
    64         testPassed("supportsContext('" + other_type + "') returns false");
     62    if (!canvas.probablySupportsContext(other_type))
     63        testPassed("probablySupportsContext('" + other_type + "') returns false");
    6564    else
    66         testFailed("supportsContext('" + other_type + "') returns true");
     65        testFailed("probablySupportsContext('" + other_type + "') returns true");
    6766
    6867    if (!canvas.getContext(other_type))
     
    7675{
    7776    debug("");
    78     debug("Canvas.supportsContext('" + type_of_context + "')");
     77    debug("Canvas.probablySupportsContext('" + type_of_context + "')");
    7978    debug("");
    8079
    8180    var canvas = document.createElement("canvas");
    82     var supports = canvas.supportsContext(type_of_context);
     81    var supports = canvas.probablySupportsContext(type_of_context);
    8382    var context = canvas.getContext(type_of_context);
    8483
     
    9291
    9392    debug("");
    94     debug("canvas.supportsContext('" + type_of_context + "' ," + attrs_str + ")");
     93    debug("canvas.probablySupportsContext('" + type_of_context + "' ," + attrs_str + ")");
    9594    debug("");
    9695
     
    9897    var supports;
    9998    try {
    100         supports = canvas.supportsContext(type_of_context, attrs);
     99        supports = canvas.probablySupportsContext(type_of_context, attrs);
    101100    } catch (e) { } finally {
    102101        if (typeof(supports) == typeof(undefined))
     
    122121function run_tests()
    123122{
    124     description("This test ensures WebGL implementations interact correctly with the canvas tag's supportContext function, that getContext and supportsContext are implemented consistently with one another, and that malformed parameters to supportsContext are handled correctly.");
     123    description("This test ensures WebGL implementations interact correctly with the canvas tag's probablySupportsContext function, that getContext and probablySupportsContext are implemented consistently with one another, and that malformed parameters to probablySupportsContext are handled correctly.");
    125124
    126125    check_context(type2d);
     
    143142
    144143    debug("");
    145     debug("Testing malformed attributes that cause supportsContext and getContext to be undefined");
     144    debug("Testing malformed attributes that cause probablySupportsContext and getContext to be undefined");
    146145
    147146    malformed_attrs({ get alpha() { throw 'Test alpha Error'; } },
     
    159158
    160159    debug("");
    161     debug("Testing how supportsContext handles no parameters");
    162     shouldBeFalse("document.createElement('canvas').supportsContext()");
     160    debug("Testing how probablySupportsContext handles no parameters");
     161    shouldBeFalse("document.createElement('canvas').probablySupportsContext()");
    163162
    164163    debug("");
  • trunk/Source/WebCore/ChangeLog

    r155136 r155137  
     12013-09-04  Dean Jackson  <dino@apple.com>
     2
     3        Rename supportsContext to probablySupportsContext
     4        https://bugs.webkit.org/show_bug.cgi?id=120716
     5        <rdar://problem/14914499>
     6
     7        Reviewed by Antoine Quint.
     8
     9        As decided in: http://lists.whatwg.org/htdig.cgi/whatwg-whatwg.org/2013-September/040680.html
     10
     11        * bindings/js/JSHTMLCanvasElementCustom.cpp:
     12        (WebCore::JSHTMLCanvasElement::probablySupportsContext):
     13        * html/HTMLCanvasElement.cpp:
     14        (WebCore::HTMLCanvasElement::probablySupportsContext):
     15        * html/HTMLCanvasElement.h:
     16        * html/HTMLCanvasElement.idl:
     17
    1182013-09-05  Joseph Pecoraro  <pecoraro@apple.com>
    219
  • trunk/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp

    r154877 r155137  
    100100}
    101101
    102 JSValue JSHTMLCanvasElement::supportsContext(ExecState* exec)
     102JSValue JSHTMLCanvasElement::probablySupportsContext(ExecState* exec)
    103103{
    104104    HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(impl());
     
    118118#endif
    119119   
    120     return jsBoolean(canvas->supportsContext(contextId, attrs.get()));
     120    return jsBoolean(canvas->probablySupportsContext(contextId, attrs.get()));
    121121}
    122122
  • trunk/Source/WebCore/html/HTMLCanvasElement.cpp

    r154877 r155137  
    236236}
    237237   
    238 bool HTMLCanvasElement::supportsContext(const String& type, CanvasContextAttributes*)
     238bool HTMLCanvasElement::probablySupportsContext(const String& type, CanvasContextAttributes*)
    239239{
    240240    // FIXME: Provide implementation that accounts for attributes. Bugzilla bug 117093
  • trunk/Source/WebCore/html/HTMLCanvasElement.h

    r154965 r155137  
    9393
    9494    CanvasRenderingContext* getContext(const String&, CanvasContextAttributes* attributes = 0);
    95     bool supportsContext(const String&, CanvasContextAttributes* = 0);
     95    bool probablySupportsContext(const String&, CanvasContextAttributes* = 0);
    9696    static bool is2dType(const String&);
    9797#if ENABLE(WEBGL)
  • trunk/Source/WebCore/html/HTMLCanvasElement.idl

    r151336 r155137  
    3838    // The custom binding is needed to handle context creation attributes.
    3939    [Custom] any getContext([Default=Undefined] optional DOMString contextId);
    40     [Custom] any supportsContext([Default=Undefined] optional DOMString contextId);
     40    [Custom] any probablySupportsContext([Default=Undefined] optional DOMString contextId);
    4141#endif
    4242#endif
Note: See TracChangeset for help on using the changeset viewer.