Skip to content

Instantly share code, notes, and snippets.

@ahomu
Created March 16, 2012 07:09
Show Gist options
  • Save ahomu/2048971 to your computer and use it in GitHub Desktop.
Save ahomu/2048971 to your computer and use it in GitHub Desktop.
jQuery(Sizzle)のバグ検証コード
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xml:lang="ja" lang="ja" dir="ltr" xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js" type="text/javascript"></script>
<script type="text/javascript">
$(function() {
var results = document.getElementById('results'),
exprCollection = [
':text', ':input', ':password', ':radio', 'checkbox',
':submit',':image', ':reset', ':button', ':file'
],
i = 0,
expr;
function test(expr) {
if ($(expr) === void 0) {
throw Error(expr);
}
}
function succeed(expr) {
results.innerHTML += '<dt>'+expr+'</dt><dd>succeed</dd>';
}
function failed(expr) {
results.innerHTML += '<dt>'+expr+'</dt><dd>failed</dd>';
}
while(expr = exprCollection[i++]) {
try {
test(expr);
} catch(e) {
failed(expr);
continue;
}
succeed(expr);
}
});
</script>
</head>
<body>
<h1>(´Д`)</h1>
<dl id="results">
</dl>
<iframe width="640" height="360" src="http://www.youtube.com/embed/HiRgU78_g9o" frameborder="0" allowfullscreen></iframe>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment