Changeset 155137 in webkit
- Timestamp:
- Sep 5, 2013 11:58:07 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r155132 r155137 1 2013-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 1 14 2013-09-05 Joseph Pecoraro <pecoraro@apple.com> 2 15 -
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.1 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. 2 2 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 5 6 Canvas. supportsContext('2d')6 Canvas.probablySupportsContext('2d') 7 7 8 PASS supportsContext('2d') is consistent with getContext('2d')9 PASS supportsContext('2d') returns true8 PASS probablySupportsContext('2d') is consistent with getContext('2d') 9 PASS probablySupportsContext('2d') returns true 10 10 PASS getContext('2d') returns true (context exists) 11 Testing getContext and supportsContext('2d') after a context is created12 PASS supportsContext('2d') returns true13 PASS supportsContext('webkit-3d') returns false11 Testing getContext and probablySupportsContext('2d') after a context is created 12 PASS probablySupportsContext('2d') returns true 13 PASS probablySupportsContext('webkit-3d') returns false 14 14 PASS webkit-3d context does not exist 15 15 16 16 WebGL disabled 17 17 18 Canvas. supportsContext('webkit-3d')18 Canvas.probablySupportsContext('webkit-3d') 19 19 20 PASS supportsContext('webkit-3d') is consistent with getContext('webkit-3d')21 FAIL supportsContext('webkit-3d') returns false20 PASS probablySupportsContext('webkit-3d') is consistent with getContext('webkit-3d') 21 FAIL probablySupportsContext('webkit-3d') returns false 22 22 FAIL getContext('webkit-3d') returns false (context does not exist) 23 23 24 Canvas. supportsContext('experimental-webgl')24 Canvas.probablySupportsContext('experimental-webgl') 25 25 26 PASS supportsContext('experimental-webgl') is consistent with getContext('experimental-webgl')27 FAIL supportsContext('experimental-webgl') returns false26 PASS probablySupportsContext('experimental-webgl') is consistent with getContext('experimental-webgl') 27 FAIL probablySupportsContext('experimental-webgl') returns false 28 28 FAIL getContext('experimental-webgl') returns false (context does not exist) 29 29 30 Canvas. supportsContext('moz-webgl')30 Canvas.probablySupportsContext('moz-webgl') 31 31 32 PASS supportsContext('moz-webgl') is consistent with getContext('moz-webgl')33 FAIL supportsContext('moz-webgl') returns false32 PASS probablySupportsContext('moz-webgl') is consistent with getContext('moz-webgl') 33 FAIL probablySupportsContext('moz-webgl') returns false 34 34 FAIL getContext('moz-webgl') returns false (context does not exist) 35 35 36 36 WebGL enabled 37 37 38 Canvas. supportsContext('webkit-3d')38 Canvas.probablySupportsContext('webkit-3d') 39 39 40 PASS supportsContext('webkit-3d') is consistent with getContext('webkit-3d')41 PASS supportsContext('webkit-3d') returns true40 PASS probablySupportsContext('webkit-3d') is consistent with getContext('webkit-3d') 41 PASS probablySupportsContext('webkit-3d') returns true 42 42 PASS getContext('webkit-3d') returns true (context exists) 43 Testing getContext and supportsContext('webkit-3d') after a context is created44 PASS supportsContext('webkit-3d') returns true45 PASS supportsContext('2d') returns false43 Testing getContext and probablySupportsContext('webkit-3d') after a context is created 44 PASS probablySupportsContext('webkit-3d') returns true 45 PASS probablySupportsContext('2d') returns false 46 46 PASS 2d context does not exist 47 47 48 Canvas. supportsContext('experimental-webgl')48 Canvas.probablySupportsContext('experimental-webgl') 49 49 50 PASS supportsContext('experimental-webgl') is consistent with getContext('experimental-webgl')51 PASS supportsContext('experimental-webgl') returns true50 PASS probablySupportsContext('experimental-webgl') is consistent with getContext('experimental-webgl') 51 PASS probablySupportsContext('experimental-webgl') returns true 52 52 PASS getContext('experimental-webgl') returns true (context exists) 53 Testing getContext and supportsContext('experimental-webgl') after a context is created54 PASS supportsContext('experimental-webgl') returns true55 PASS supportsContext('2d') returns false53 Testing getContext and probablySupportsContext('experimental-webgl') after a context is created 54 PASS probablySupportsContext('experimental-webgl') returns true 55 PASS probablySupportsContext('2d') returns false 56 56 PASS 2d context does not exist 57 57 58 Canvas. supportsContext('moz-webgl')58 Canvas.probablySupportsContext('moz-webgl') 59 59 60 PASS supportsContext('moz-webgl') is consistent with getContext('moz-webgl')61 FAIL supportsContext('moz-webgl') returns false60 PASS probablySupportsContext('moz-webgl') is consistent with getContext('moz-webgl') 61 FAIL probablySupportsContext('moz-webgl') returns false 62 62 FAIL getContext('moz-webgl') returns false (context does not exist) 63 63 64 Testing malformed attributes that cause supportsContext and getContext to be undefined64 Testing malformed attributes that cause probablySupportsContext and getContext to be undefined 65 65 66 canvas. supportsContext('webkit-3d' ,{ get alpha() { throw 'Test alpha Error'; } })66 canvas.probablySupportsContext('webkit-3d' ,{ get alpha() { throw 'Test alpha Error'; } }) 67 67 68 68 PASS supports is undefined 69 69 PASS 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 false70 PASS probablySupportsContext('webkit-3d' ,{ get alpha() { throw 'Test alpha Error'; } }) is consistent with getContext('webkit-3d' ,{ get alpha() { throw 'Test alpha Error'; } }) 71 FAIL probablySupportsContext('webkit-3d' ,{ get alpha() { throw 'Test alpha Error'; } }) returns false 72 72 FAIL getContext('webkit-3d' ,{ get alpha() { throw 'Test alpha Error'; } }) returns false (context does not exist) 73 73 74 canvas. supportsContext('webkit-3d' ,{ get depth() { throw 'Test depth Error'; } })74 canvas.probablySupportsContext('webkit-3d' ,{ get depth() { throw 'Test depth Error'; } }) 75 75 76 76 PASS supports is undefined 77 77 PASS 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 false78 PASS probablySupportsContext('webkit-3d' ,{ get depth() { throw 'Test depth Error'; } }) is consistent with getContext('webkit-3d' ,{ get depth() { throw 'Test depth Error'; } }) 79 FAIL probablySupportsContext('webkit-3d' ,{ get depth() { throw 'Test depth Error'; } }) returns false 80 80 FAIL getContext('webkit-3d' ,{ get depth() { throw 'Test depth Error'; } }) returns false (context does not exist) 81 81 82 canvas. supportsContext('webkit-3d' ,{ get stencil() { throw 'Test stencil Error'; } })82 canvas.probablySupportsContext('webkit-3d' ,{ get stencil() { throw 'Test stencil Error'; } }) 83 83 84 84 PASS supports is undefined 85 85 PASS 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 false86 PASS probablySupportsContext('webkit-3d' ,{ get stencil() { throw 'Test stencil Error'; } }) is consistent with getContext('webkit-3d' ,{ get stencil() { throw 'Test stencil Error'; } }) 87 FAIL probablySupportsContext('webkit-3d' ,{ get stencil() { throw 'Test stencil Error'; } }) returns false 88 88 FAIL getContext('webkit-3d' ,{ get stencil() { throw 'Test stencil Error'; } }) returns false (context does not exist) 89 89 90 canvas. supportsContext('webkit-3d' ,{ get antialias() { throw 'Test antialias Error'; } })90 canvas.probablySupportsContext('webkit-3d' ,{ get antialias() { throw 'Test antialias Error'; } }) 91 91 92 92 PASS supports is undefined 93 93 PASS 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 false94 PASS probablySupportsContext('webkit-3d' ,{ get antialias() { throw 'Test antialias Error'; } }) is consistent with getContext('webkit-3d' ,{ get antialias() { throw 'Test antialias Error'; } }) 95 FAIL probablySupportsContext('webkit-3d' ,{ get antialias() { throw 'Test antialias Error'; } }) returns false 96 96 FAIL getContext('webkit-3d' ,{ get antialias() { throw 'Test antialias Error'; } }) returns false (context does not exist) 97 97 98 canvas. supportsContext('webkit-3d' ,{ get premultipliedAlpha() { throw 'Test premultipliedAlpha Error'; } })98 canvas.probablySupportsContext('webkit-3d' ,{ get premultipliedAlpha() { throw 'Test premultipliedAlpha Error'; } }) 99 99 100 100 PASS supports is undefined 101 101 PASS 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 false102 PASS probablySupportsContext('webkit-3d' ,{ get premultipliedAlpha() { throw 'Test premultipliedAlpha Error'; } }) is consistent with getContext('webkit-3d' ,{ get premultipliedAlpha() { throw 'Test premultipliedAlpha Error'; } }) 103 FAIL probablySupportsContext('webkit-3d' ,{ get premultipliedAlpha() { throw 'Test premultipliedAlpha Error'; } }) returns false 104 104 FAIL getContext('webkit-3d' ,{ get premultipliedAlpha() { throw 'Test premultipliedAlpha Error'; } }) returns false (context does not exist) 105 105 106 canvas. supportsContext('webkit-3d' ,{ get preserveDrawingBUffer() { throw 'Test preserveDrawingBuffer Error'; } })106 canvas.probablySupportsContext('webkit-3d' ,{ get preserveDrawingBUffer() { throw 'Test preserveDrawingBuffer Error'; } }) 107 107 108 108 PASS supports is undefined 109 109 PASS 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 false110 PASS probablySupportsContext('webkit-3d' ,{ get preserveDrawingBUffer() { throw 'Test preserveDrawingBuffer Error'; } }) is consistent with getContext('webkit-3d' ,{ get preserveDrawingBUffer() { throw 'Test preserveDrawingBuffer Error'; } }) 111 FAIL probablySupportsContext('webkit-3d' ,{ get preserveDrawingBUffer() { throw 'Test preserveDrawingBuffer Error'; } }) returns false 112 112 FAIL getContext('webkit-3d' ,{ get preserveDrawingBUffer() { throw 'Test preserveDrawingBuffer Error'; } }) returns false (context does not exist) 113 113 114 Testing how supportsContext handles no parameters115 PASS document.createElement('canvas'). supportsContext() is false114 Testing how probablySupportsContext handles no parameters 115 PASS document.createElement('canvas').probablySupportsContext() is false 116 116 117 117 PASS successfullyParsed is true -
trunk/LayoutTests/fast/canvas/webgl/canvas-supports-context.html
r151298 r155137 1 1 <html> 2 2 <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> 5 4 <script src="../../js/resources/js-test-pre.js"></script> 6 5 </head> … … 17 16 { 18 17 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"); 20 19 else 21 testPassed(" supportsContext(" + args_str + ") is consistent with getContext(" + args_str + ")");20 testPassed("probablySupportsContext(" + args_str + ") is consistent with getContext(" + args_str + ")"); 22 21 23 22 if (supports) 24 testPassed(" supportsContext(" + args_str + ") returns true");23 testPassed("probablySupportsContext(" + args_str + ") returns true"); 25 24 else 26 testFailed(" supportsContext(" + args_str + ") returns false");25 testFailed("probablySupportsContext(" + args_str + ") returns false"); 27 26 28 27 if (context) { … … 47 46 function test_post_creation(canvas, type_of_context) 48 47 { 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"); 50 49 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"); 53 52 else 54 testFailed(" supportsContext('" + type_of_context + "') returns false");53 testFailed("probablySupportsContext('" + type_of_context + "') returns false"); 55 54 56 55 var other_type = other_type_of_context(type_of_context); … … 61 60 } 62 61 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"); 65 64 else 66 testFailed(" supportsContext('" + other_type + "') returns true");65 testFailed("probablySupportsContext('" + other_type + "') returns true"); 67 66 68 67 if (!canvas.getContext(other_type)) … … 76 75 { 77 76 debug(""); 78 debug("Canvas. supportsContext('" + type_of_context + "')");77 debug("Canvas.probablySupportsContext('" + type_of_context + "')"); 79 78 debug(""); 80 79 81 80 var canvas = document.createElement("canvas"); 82 var supports = canvas. supportsContext(type_of_context);81 var supports = canvas.probablySupportsContext(type_of_context); 83 82 var context = canvas.getContext(type_of_context); 84 83 … … 92 91 93 92 debug(""); 94 debug("canvas. supportsContext('" + type_of_context + "' ," + attrs_str + ")");93 debug("canvas.probablySupportsContext('" + type_of_context + "' ," + attrs_str + ")"); 95 94 debug(""); 96 95 … … 98 97 var supports; 99 98 try { 100 supports = canvas. supportsContext(type_of_context, attrs);99 supports = canvas.probablySupportsContext(type_of_context, attrs); 101 100 } catch (e) { } finally { 102 101 if (typeof(supports) == typeof(undefined)) … … 122 121 function run_tests() 123 122 { 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."); 125 124 126 125 check_context(type2d); … … 143 142 144 143 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"); 146 145 147 146 malformed_attrs({ get alpha() { throw 'Test alpha Error'; } }, … … 159 158 160 159 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()"); 163 162 164 163 debug(""); -
trunk/Source/WebCore/ChangeLog
r155136 r155137 1 2013-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 1 18 2013-09-05 Joseph Pecoraro <pecoraro@apple.com> 2 19 -
trunk/Source/WebCore/bindings/js/JSHTMLCanvasElementCustom.cpp
r154877 r155137 100 100 } 101 101 102 JSValue JSHTMLCanvasElement:: supportsContext(ExecState* exec)102 JSValue JSHTMLCanvasElement::probablySupportsContext(ExecState* exec) 103 103 { 104 104 HTMLCanvasElement* canvas = static_cast<HTMLCanvasElement*>(impl()); … … 118 118 #endif 119 119 120 return jsBoolean(canvas-> supportsContext(contextId, attrs.get()));120 return jsBoolean(canvas->probablySupportsContext(contextId, attrs.get())); 121 121 } 122 122 -
trunk/Source/WebCore/html/HTMLCanvasElement.cpp
r154877 r155137 236 236 } 237 237 238 bool HTMLCanvasElement:: supportsContext(const String& type, CanvasContextAttributes*)238 bool HTMLCanvasElement::probablySupportsContext(const String& type, CanvasContextAttributes*) 239 239 { 240 240 // FIXME: Provide implementation that accounts for attributes. Bugzilla bug 117093 -
trunk/Source/WebCore/html/HTMLCanvasElement.h
r154965 r155137 93 93 94 94 CanvasRenderingContext* getContext(const String&, CanvasContextAttributes* attributes = 0); 95 bool supportsContext(const String&, CanvasContextAttributes* = 0);95 bool probablySupportsContext(const String&, CanvasContextAttributes* = 0); 96 96 static bool is2dType(const String&); 97 97 #if ENABLE(WEBGL) -
trunk/Source/WebCore/html/HTMLCanvasElement.idl
r151336 r155137 38 38 // The custom binding is needed to handle context creation attributes. 39 39 [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); 41 41 #endif 42 42 #endif
Note: See TracChangeset
for help on using the changeset viewer.