Changeset 60980 in webkit
- Timestamp:
- Jun 10, 2010 4:05:23 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r60979 r60980 1 2010-06-10 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r60979. 4 http://trac.webkit.org/changeset/60979 5 https://bugs.webkit.org/show_bug.cgi?id=40450 6 7 Broke build on Leopard (Requested by kbr_google on #webkit). 8 9 * fast/canvas/webgl/script-tests/texImageTest.js: 10 * fast/canvas/webgl/texImageTest-expected.txt: 11 1 12 2010-06-10 Kenneth Russell <kbr@google.com> 2 13 -
trunk/LayoutTests/fast/canvas/webgl/script-tests/texImageTest.js
r60979 r60980 20 20 shouldThrow("context.texSubImage2D(context.TEXTURE_2D)"); 21 21 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, null)"); 22 // FIXME: The following test fails on JSC: https://bugs.webkit.org/show_bug.cgi?id=38024 22 23 shouldThrow("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0)"); 23 24 shouldThrow("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNSIGNED_BYTE, 0)"); -
trunk/LayoutTests/fast/canvas/webgl/texImageTest-expected.txt
r60979 r60980 3 3 On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". 4 4 5 PASS context.texImage2D(context.TEXTURE_2D) threw exception TypeError: Typeerror.5 PASS context.texImage2D(context.TEXTURE_2D) threw exception SyntaxError: Syntax error. 6 6 PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 64, 64, 0, context.RGBA, context.UNSIGNED_BYTE, null) is undefined. 7 PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, context.RGBA, context.UNSIGNED_BYTE, 0) threw exception TypeError: Typeerror.7 PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, context.RGBA, context.UNSIGNED_BYTE, 0) threw exception SyntaxError: Syntax error. 8 8 PASS context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 2, 2, 0, context.RGBA, context.UNSIGNED_BYTE, array) is undefined. 9 9 PASS context.texImage2D(context.TEXTURE_2D, 0, imageData, true) is undefined. … … 11 11 PASS context.texImage2D(context.TEXTURE_2D, 0, canvas2d, false) is undefined. 12 12 PASS context.texImage2D(context.TEXTURE_2D, 0, video, true, false) is undefined. 13 PASS context.texSubImage2D(context.TEXTURE_2D) threw exception TypeError: Typeerror.13 PASS context.texSubImage2D(context.TEXTURE_2D) threw exception SyntaxError: Syntax error. 14 14 PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, null) is undefined. 15 PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0) threw exception TypeError: Type error.16 PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNSIGNED_BYTE, 0) threw exception TypeError: Typeerror.15 FAIL context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.RGBA, context.UNSIGNED_BYTE, 0) should throw an exception. Was undefined. 16 PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNSIGNED_BYTE, 0) threw exception SyntaxError: Syntax error. 17 17 PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, imageData, false) is undefined. 18 18 PASS context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, image) is undefined. -
trunk/WebCore/ChangeLog
r60979 r60980 1 2010-06-10 Sheriff Bot <webkit.review.bot@gmail.com> 2 3 Unreviewed, rolling out r60979. 4 http://trac.webkit.org/changeset/60979 5 https://bugs.webkit.org/show_bug.cgi?id=40450 6 7 Broke build on Leopard (Requested by kbr_google on #webkit). 8 9 * bindings/js/JSWebGLRenderingContextCustom.cpp: 10 (WebCore::JSWebGLRenderingContext::bufferData): 11 (WebCore::JSWebGLRenderingContext::bufferSubData): 12 (WebCore::JSWebGLRenderingContext::texImage2D): 13 (WebCore::JSWebGLRenderingContext::texSubImage2D): 14 * bindings/scripts/CodeGeneratorJS.pm: 15 * html/HTMLCanvasElement.idl: 16 * html/HTMLImageElement.idl: 17 * html/HTMLVideoElement.idl: 18 * html/canvas/WebGLRenderingContext.idl: 19 1 20 2010-06-10 Kenneth Russell <kbr@google.com> 2 21 -
trunk/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
r60979 r60980 67 67 68 68 namespace WebCore { 69 70 JSValue JSWebGLRenderingContext::bufferData(JSC::ExecState* exec) 71 { 72 if (exec->argumentCount() != 3) 73 return throwSyntaxError(exec); 74 75 unsigned target = exec->argument(0).toInt32(exec); 76 unsigned usage = exec->argument(2).toInt32(exec); 77 ExceptionCode ec = 0; 78 79 // If argument 1 is a number, we are initializing this buffer to that size 80 if (!exec->argument(1).isObject()) { 81 unsigned int count = exec->argument(1).toInt32(exec); 82 static_cast<WebGLRenderingContext*>(impl())->bufferData(target, count, usage, ec); 83 } else { 84 ArrayBufferView* array = toArrayBufferView(exec->argument(1)); 85 static_cast<WebGLRenderingContext*>(impl())->bufferData(target, array, usage, ec); 86 } 87 88 setDOMException(exec, ec); 89 return jsUndefined(); 90 } 91 92 JSValue JSWebGLRenderingContext::bufferSubData(JSC::ExecState* exec) 93 { 94 if (exec->argumentCount() != 3) 95 return throwSyntaxError(exec); 96 97 unsigned target = exec->argument(0).toInt32(exec); 98 unsigned offset = exec->argument(1).toInt32(exec); 99 ExceptionCode ec = 0; 100 101 ArrayBufferView* array = toArrayBufferView(exec->argument(2)); 102 103 static_cast<WebGLRenderingContext*>(impl())->bufferSubData(target, offset, array, ec); 104 105 setDOMException(exec, ec); 106 return jsUndefined(); 107 } 69 108 70 109 static JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, const WebGLGetInfo& info) … … 273 312 } 274 313 314 // void texImage2D(in GLenum target, in GLint level, in GLenum internalformat, in GLsizei width, in GLsizei height, in GLint border, in GLenum format, in GLenum type, in ArrayBufferView pixels); 315 // void texImage2D(in GLenum target, in GLint level, in ImageData pixels, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha); 316 // void texImage2D(in GLenum target, in GLint level, in HTMLImageElement image, [Optional] in GLboolean flipY, [Optional] in premultiplyAlpha); 317 // void texImage2D(in GLenum target, in GLint level, in HTMLCanvasElement canvas, [Optional] in GLboolean flipY, [Optional] in premultiplyAlpha); 318 // void texImage2D(in GLenum target, in GLint level, in HTMLVideoElement video, [Optional] in GLboolean flipY, [Optional] in premultiplyAlpha); 319 JSValue JSWebGLRenderingContext::texImage2D(ExecState* exec) 320 { 321 if (exec->argumentCount() < 3 || exec->argumentCount() > 9) 322 return throwSyntaxError(exec); 323 324 ExceptionCode ec = 0; 325 326 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl()); 327 unsigned target = exec->argument(0).toInt32(exec); 328 if (exec->hadException()) 329 return jsUndefined(); 330 331 unsigned level = exec->argument(1).toInt32(exec); 332 if (exec->hadException()) 333 return jsUndefined(); 334 335 JSObject* o = 0; 336 337 if (exec->argumentCount() <= 5) { 338 // This is one of the last 4 forms. Param 2 can be ImageData or <img>, <canvas> or <video> element. 339 JSValue value = exec->argument(2); 340 341 if (!value.isObject()) 342 return throwTypeError(exec); 343 344 o = asObject(value); 345 346 bool flipY = exec->argument(3).toBoolean(exec); 347 bool premultiplyAlpha = exec->argument(4).toBoolean(exec); 348 349 if (o->inherits(&JSImageData::s_info)) { 350 ImageData* data = static_cast<ImageData*>(static_cast<JSImageData*>(o)->impl()); 351 context->texImage2D(target, level, data, flipY, premultiplyAlpha, ec); 352 } else if (o->inherits(&JSHTMLImageElement::s_info)) { 353 HTMLImageElement* element = static_cast<HTMLImageElement*>(static_cast<JSHTMLImageElement*>(o)->impl()); 354 context->texImage2D(target, level, element, flipY, premultiplyAlpha, ec); 355 } else if (o->inherits(&JSHTMLCanvasElement::s_info)) { 356 HTMLCanvasElement* element = static_cast<HTMLCanvasElement*>(static_cast<JSHTMLCanvasElement*>(o)->impl()); 357 context->texImage2D(target, level, element, flipY, premultiplyAlpha, ec); 358 #if ENABLE(VIDEO) 359 } else if (o->inherits(&JSHTMLVideoElement::s_info)) { 360 HTMLVideoElement* element = static_cast<HTMLVideoElement*>(static_cast<JSHTMLVideoElement*>(o)->impl()); 361 context->texImage2D(target, level, element, flipY, premultiplyAlpha, ec); 362 #endif 363 } else 364 ec = TYPE_MISMATCH_ERR; 365 } else { 366 if (exec->argumentCount() != 9) 367 return throwSyntaxError(exec); 368 369 // This must be the ArrayBufferView case 370 unsigned internalformat = exec->argument(2).toInt32(exec); 371 if (exec->hadException()) 372 return jsUndefined(); 373 374 unsigned width = exec->argument(3).toInt32(exec); 375 if (exec->hadException()) 376 return jsUndefined(); 377 378 unsigned height = exec->argument(4).toInt32(exec); 379 if (exec->hadException()) 380 return jsUndefined(); 381 382 unsigned border = exec->argument(5).toInt32(exec); 383 if (exec->hadException()) 384 return jsUndefined(); 385 386 unsigned format = exec->argument(6).toInt32(exec); 387 if (exec->hadException()) 388 return jsUndefined(); 389 390 unsigned type = exec->argument(7).toInt32(exec); 391 if (exec->hadException()) 392 return jsUndefined(); 393 394 JSValue value = exec->argument(8); 395 396 // For this case passing 0 (for a null array) is allowed 397 if (value.isNull()) 398 context->texImage2D(target, level, internalformat, width, height, border, format, type, 0, ec); 399 else if (value.isObject()) { 400 o = asObject(value); 401 402 if (o->inherits(&JSArrayBufferView::s_info)) { 403 // FIXME: Need to check to make sure ArrayBufferView is a Int8Array or Int16Array, 404 // depending on the passed type parameter. 405 ArrayBufferView* obj = static_cast<ArrayBufferView*>(static_cast<JSArrayBufferView*>(o)->impl()); 406 context->texImage2D(target, level, internalformat, width, height, border, format, type, obj, ec); 407 } else 408 return throwTypeError(exec); 409 } else 410 return throwTypeError(exec); 411 } 412 413 setDOMException(exec, ec); 414 return jsUndefined(); 415 } 416 417 // void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset, in GLsizei width, in GLsizei height, in GLenum format, in GLenum type, in ArrayBufferView pixels); 418 // void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset, in ImageData pixels, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha); 419 // void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset, in HTMLImageElement image, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha); 420 // void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset, in HTMLCanvasElement canvas, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha); 421 // void texSubImage2D(in GLenum target, in GLint level, in GLint xoffset, in GLint yoffset, in HTMLVideoElement video, [Optional] GLboolean flipY, [Optional] in premultiplyAlpha); 422 JSValue JSWebGLRenderingContext::texSubImage2D(ExecState* exec) 423 { 424 if (exec->argumentCount() < 5 || exec->argumentCount() > 9) 425 return throwSyntaxError(exec); 426 427 ExceptionCode ec = 0; 428 429 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl()); 430 unsigned target = exec->argument(0).toInt32(exec); 431 if (exec->hadException()) 432 return jsUndefined(); 433 434 unsigned level = exec->argument(1).toInt32(exec); 435 if (exec->hadException()) 436 return jsUndefined(); 437 438 unsigned xoff = exec->argument(2).toInt32(exec); 439 if (exec->hadException()) 440 return jsUndefined(); 441 442 unsigned yoff = exec->argument(3).toInt32(exec); 443 if (exec->hadException()) 444 return jsUndefined(); 445 446 JSObject* o = 0; 447 448 if (exec->argumentCount() <= 7) { 449 // This is one of the last 4 forms. Param 4 can be <img>, <canvas> or <video> element, of the format param. 450 JSValue value = exec->argument(4); 451 452 if (!value.isObject()) 453 return throwSyntaxError(exec); 454 455 o = asObject(value); 456 457 bool flipY = exec->argument(5).toBoolean(exec); 458 bool premultiplyAlpha = exec->argument(6).toBoolean(exec); 459 460 if (o->inherits(&JSImageData::s_info)) { 461 ImageData* data = static_cast<ImageData*>(static_cast<JSImageData*>(o)->impl()); 462 context->texSubImage2D(target, level, xoff, yoff, data, flipY, premultiplyAlpha, ec); 463 } else if (o->inherits(&JSHTMLImageElement::s_info)) { 464 HTMLImageElement* element = static_cast<HTMLImageElement*>(static_cast<JSHTMLImageElement*>(o)->impl()); 465 context->texSubImage2D(target, level, xoff, yoff, element, flipY, premultiplyAlpha, ec); 466 } else if (o->inherits(&JSHTMLCanvasElement::s_info)) { 467 HTMLCanvasElement* element = static_cast<HTMLCanvasElement*>(static_cast<JSHTMLCanvasElement*>(o)->impl()); 468 context->texSubImage2D(target, level, xoff, yoff, element, flipY, premultiplyAlpha, ec); 469 #if ENABLE(VIDEO) 470 } else if (o->inherits(&JSHTMLVideoElement::s_info)) { 471 HTMLVideoElement* element = static_cast<HTMLVideoElement*>(static_cast<JSHTMLVideoElement*>(o)->impl()); 472 context->texSubImage2D(target, level, xoff, yoff, element, flipY, premultiplyAlpha, ec); 473 #endif 474 } else 475 ec = TYPE_MISMATCH_ERR; 476 } else { 477 // This must be the ArrayBufferView form 478 if (exec->argumentCount() != 9) 479 return throwSyntaxError(exec); 480 481 unsigned width = exec->argument(4).toInt32(exec); 482 if (exec->hadException()) 483 return jsUndefined(); 484 485 unsigned height = exec->argument(5).toInt32(exec); 486 if (exec->hadException()) 487 return jsUndefined(); 488 489 unsigned format = exec->argument(6).toInt32(exec); 490 if (exec->hadException()) 491 return jsUndefined(); 492 493 unsigned type = exec->argument(7).toInt32(exec); 494 if (exec->hadException()) 495 return jsUndefined(); 496 497 JSValue value = exec->argument(8); 498 if (!value.isObject()) 499 context->texSubImage2D(target, level, xoff, yoff, width, height, format, type, 0, ec); 500 else { 501 o = asObject(value); 502 503 if (o->inherits(&JSArrayBufferView::s_info)) { 504 ArrayBufferView* obj = static_cast<ArrayBufferView*>(static_cast<JSArrayBufferView*>(o)->impl()); 505 context->texSubImage2D(target, level, xoff, yoff, width, height, format, type, obj, ec); 506 } else 507 return throwTypeError(exec); 508 } 509 } 510 511 setDOMException(exec, ec); 512 return jsUndefined(); 513 } 514 275 515 template<typename T, size_t inlineCapacity> 276 516 bool toVector(JSC::ExecState* exec, JSC::JSValue value, Vector<T, inlineCapacity>& vector) -
trunk/WebCore/bindings/scripts/CodeGeneratorJS.pm
r60979 r60980 1116 1116 # be converted to a string via .toString). 1117 1117 push(@andExpression, "(${value}.isNull() || ${value}.isUndefined() || ${value}.isString() || ${value}.isObject())") if $codeGenerator->IsStringType($type); 1118 push(@andExpression, "(${value}.isNull() || ${value}.isObject() &&asObject(${value})->inherits(&JS${type}::s_info))") unless IsNativeType($type);1118 push(@andExpression, "(${value}.isNull() || asObject(${value})->inherits(&JS${type}::s_info))") unless IsNativeType($type); 1119 1119 1120 1120 $parameterIndex++; … … 1787 1787 # Append a number to an overloaded method's name to make it unique: 1788 1788 $functionName = $functionName . $function->{overloadIndex}; 1789 # Make this function static to avoid compiler warnings, since we1790 # don't generate a prototype for it in the header.1791 push(@implContent, "static ");1792 1789 } 1793 1790 -
trunk/WebCore/html/HTMLCanvasElement.idl
r60979 r60980 28 28 29 29 interface [ 30 CustomMarkFunction, 31 GenerateNativeConverter 30 CustomMarkFunction 32 31 ] HTMLCanvasElement : HTMLElement { 33 32 -
trunk/WebCore/html/HTMLImageElement.idl
r60979 r60980 21 21 module html { 22 22 23 interface [ 24 GenerateNativeConverter 25 ] HTMLImageElement : HTMLElement { 23 interface HTMLImageElement : HTMLElement { 26 24 attribute [ConvertNullToNullString, Reflect] DOMString name; 27 25 attribute [ConvertNullToNullString, Reflect] DOMString align; -
trunk/WebCore/html/HTMLVideoElement.idl
r60979 r60980 25 25 26 26 module html { 27 interface [ 28 Conditional=VIDEO, 29 GenerateNativeConverter 30 ] HTMLVideoElement : HTMLMediaElement { 27 interface [Conditional=VIDEO] HTMLVideoElement : HTMLMediaElement { 31 28 attribute unsigned long width; 32 29 attribute unsigned long height; -
trunk/WebCore/html/canvas/WebGLRenderingContext.idl
r60979 r60980 475 475 void blendFuncSeparate(in unsigned long srcRGB, in unsigned long dstRGB, in unsigned long srcAlpha, in unsigned long dstAlpha); 476 476 477 #if defined(V8_BINDING) && V8_BINDING 477 478 void bufferData(in unsigned long target, in ArrayBufferView data, in unsigned long usage) raises (DOMException); 478 479 void bufferData(in unsigned long target, in long size, in unsigned long usage) raises (DOMException); 479 480 void bufferSubData(in unsigned long target, in long offset, in ArrayBufferView data) raises (DOMException); 481 #else 482 // FIXME: Unfork once JSC supports overload generation too. 483 [Custom] void bufferData() raises(DOMException); 484 [Custom] void bufferSubData() raises(DOMException); 485 #endif 480 486 481 487 unsigned long checkFramebufferStatus(in unsigned long target); … … 608 614 609 615 // Supported forms: 616 #if defined(V8_BINDING) && V8_BINDING 610 617 void texImage2D(in unsigned long target, in long level, in unsigned long internalformat, in long width, in long height, 611 618 in long border, in unsigned long format, in unsigned long type, in ArrayBufferView pixels) raises (DOMException); … … 630 637 void texSubImage2D(in unsigned long target, in long level, in long xoffset, in long yoffset, 631 638 in HTMLVideoElement video, in [Optional] boolean flipY, in [Optional] boolean premultiplyAlpha) raises (DOMException); 632 639 #else 640 // FIXME: Unfork once JSC supports overload generation too. 641 [Custom] void texImage2D(); 642 [Custom] void texSubImage2D(); 643 #endif 633 644 void uniform1f(in WebGLUniformLocation location, in float x) raises(DOMException); 634 645 [Custom] void uniform1fv(in WebGLUniformLocation location, in Float32Array v) raises(DOMException);
Note: See TracChangeset
for help on using the changeset viewer.