Changeset 156243 in webkit
- Timestamp:
- Sep 22, 2013 12:11:10 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/accessibility/accessibility-node-memory-management.html
r155274 r156243 3 3 <body> 4 4 <script src="../resources/js-test-pre.js"></script> 5 6 5 <canvas id="canvas" tabindex="-1"></canvas> 7 8 6 <div id="console"></div> 9 7 <script> 8 9 var jsTestIsAsync = true; 10 10 11 description("This test makes sure that AccessibilityNodeObjects are properly detached when the node they point to is deleted."); 11 12 12 13 if (window.testRunner && window.accessibilityController) { 13 window.testRunner.dumpAsText();14 testRunner.dumpAsText(); 14 15 15 16 // Create an ordinary button on the page, focus it and get its accessibility role. … … 17 18 document.body.appendChild(button); 18 19 button.focus(); 19 window.axElement = accessibilityController.focusedElement;20 window.expectedButtonRole = axElement.role;20 axElement = accessibilityController.focusedElement; 21 expectedButtonRole = axElement.role; 21 22 22 // Now remove the nodefrom the tree and get the role of the detached accessibility object.23 // Now remove the button from the tree and get the role of the detached accessibility object. 23 24 document.body.removeChild(button); 24 window.expectedDetachedRole = axElement.role;25 expectedDetachedRole = axElement.role; 25 26 shouldBeTrue("expectedButtonRole != expectedDetachedRole"); 26 27 … … 32 33 canvas.appendChild(button); 33 34 34 // Note: focusing the button and using that to get its accessibility object creates an extra35 // Note: Focusing the button and using that to get its accessibility object creates an extra 35 36 // reference to the button and it won't get deleted when we want it to. So instead we focus the 36 37 // canvas and get its first child. 37 38 canvas.focus(); 38 window.axElement = accessibilityController.focusedElement.childAtIndex(0);39 axElement = accessibilityController.focusedElement.childAtIndex(0); 39 40 40 window.canvasButtonRole = axElement.role;41 canvasButtonRole = axElement.role; 41 42 shouldBe("canvasButtonRole", "expectedButtonRole"); 42 43 43 // Now delete the node.44 // Now delete the last reference to the button. 44 45 canvas.removeChild(button); 45 46 })(); 46 47 47 // Explicitly run garbage collection now; since there are no more references to the button, 48 // the node will be destroyed. 48 setTimeout("finishTest()", 0); 49 } 50 51 function finishTest() 52 { 53 // Explicitly run garbage collection now. Since there are no more references to the button, 54 // it will be destroyed. 49 55 gc(); 50 56 51 57 // Ensure that the accessibility object is detached by checking its role. 52 window.detachedCanvasButtonRole = axElement.role;58 detachedCanvasButtonRole = axElement.role; 53 59 shouldBe("detachedCanvasButtonRole", "expectedDetachedRole"); 60 61 finishJSTest(); 54 62 } 55 63 -
trunk/Source/WebCore/ChangeLog
r156241 r156243 1 2013-09-21 Darin Adler <darin@apple.com> 2 3 Fix too-strict type error exceptions introduced in WebGL bindings 4 https://bugs.webkit.org/show_bug.cgi?id=121759 5 6 Reviewed by Alexey Proskuryakov. 7 8 * bindings/js/JSWebGLRenderingContextCustom.cpp: 9 (WebCore::JSWebGLRenderingContext::getAttachedShaders): Allow undefined 10 or null without throwing type error. 11 (WebCore::JSWebGLRenderingContext::getProgramParameter): Ditto. 12 (WebCore::JSWebGLRenderingContext::getUniform): Ditto. 13 (WebCore::dataFunctionf): Ditto. 14 (WebCore::dataFunctioni): Ditto. 15 (WebCore::dataFunctionMatrix): Ditto. 16 1 17 2013-09-21 Sam Weinig <sam@webkit.org> 2 18 -
trunk/Source/WebCore/bindings/js/JSWebGLRenderingContextCustom.cpp
r156240 r156243 248 248 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl()); 249 249 WebGLProgram* program = toWebGLProgram(exec->uncheckedArgument(0)); 250 if (!program )250 if (!program && !exec->uncheckedArgument(0).isUndefinedOrNull()) 251 251 return throwTypeError(exec); 252 252 Vector<RefPtr<WebGLShader> > shaders; … … 332 332 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl()); 333 333 WebGLProgram* program = toWebGLProgram(exec->uncheckedArgument(0)); 334 if (!program )334 if (!program && !exec->uncheckedArgument(0).isUndefinedOrNull()) 335 335 return throwTypeError(exec); 336 336 unsigned pname = exec->uncheckedArgument(1).toInt32(exec); … … 396 396 WebGLRenderingContext* context = static_cast<WebGLRenderingContext*>(impl()); 397 397 WebGLProgram* program = toWebGLProgram(exec->uncheckedArgument(0)); 398 if (!program )398 if (!program && !exec->uncheckedArgument(0).isUndefinedOrNull()) 399 399 return throwTypeError(exec); 400 400 WebGLUniformLocation* location = toWebGLUniformLocation(exec->uncheckedArgument(1)); 401 if (!location )401 if (!location && !exec->uncheckedArgument(1).isUndefinedOrNull()) 402 402 return throwTypeError(exec); 403 403 WebGLGetInfo info = context->getUniform(program, location, ec); … … 470 470 if (functionForUniform(f)) { 471 471 location = toWebGLUniformLocation(exec->uncheckedArgument(0)); 472 if (!location )472 if (!location && !exec->uncheckedArgument(0).isUndefinedOrNull()) 473 473 return throwTypeError(exec); 474 474 } else … … 556 556 557 557 WebGLUniformLocation* location = toWebGLUniformLocation(exec->uncheckedArgument(0)); 558 if (!location )558 if (!location && !exec->uncheckedArgument(0).isUndefinedOrNull()) 559 559 return throwTypeError(exec); 560 560 … … 616 616 617 617 WebGLUniformLocation* location = toWebGLUniformLocation(exec->uncheckedArgument(0)); 618 if (!location )618 if (!location && !exec->uncheckedArgument(0).isUndefinedOrNull()) 619 619 return throwTypeError(exec); 620 620
Note: See TracChangeset
for help on using the changeset viewer.