This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<title>Radio Clone Test</title> | |
<script type="text/javascript"> | |
/* Example of checked state of a radio input not being retained in a twice-cloned node. | |
Fails in Safari 4.0.5. | |
Passes in 5.1 */ | |
window.onload = function() { | |
var div = document.createElement("div"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Mocks a function with a custom mocked handler for the duration | |
* of the execution of a context function | |
* @param {Object} parent the parent scope of the function being mocked | |
* @param {String} functionName the name of the function being mocked | |
* @param {Function} mockedFunction replacement function to use as the mocked function | |
* @param {Function} context code to execute while function is mocked | |
*/ | |
var mock = function(parent, functionName, mockedFunction, context) { | |
var nativeFunction = parent[functionName]; |