Skip to content

Instantly share code, notes, and snippets.

@sdesai
sdesai / repaint-during-iOS-scroll
Last active December 11, 2015 14:28
Interrupt and repaint on iOS scroll
<!DOCTYPE html>
<html>
<head>
<style>
.box {
width:100px;
height:100px;
background-color:red;
position:absolute;
top:0px;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Testing</title>
<style>
#container {
border:1px solid;
padding:2px;
width: 400px;
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"><html>
<head>
<title>Test Named Fields</title>
</head>
<body>
<p><button id="btn" name="namedButton">A Named Button</button></p>
<p><input type="text" id="txt" name="namedText"> A Named Text Field</p>
</body>
</html>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><!-- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> --><!-- <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> --><htmL>
<head>
<title>Foo</title>
</head>
<body>
<iframe class="foo" frameborder="0" title="Widget Stacking Shim" src="javascript:false"></iframe>
</body>
</html>
@sdesai
sdesai / gist:3759406
Created September 21, 2012 02:15
Fix for onbeforeactivate feature test to support Win8
storechild-lm: yui3 [ie10] $ git show f771c6e6629d3d4ac6cee8408cdb9b373827c432
commit f771c6e6629d3d4ac6cee8408cdb9b373827c432
Author: Satyen Desai <[email protected]>
Date: Thu Sep 20 19:01:29 2012 -0700
Fixed onbeforeactivate feature test so that it works in Win 8 packaged apps.
In Win 8 packaged JS app environments, innerHTML cannot contain inline handlers,
which the feature test was relying on.
@sdesai
sdesai / gist:3703317
Created September 12, 2012 00:41
Basic Repro for IE10 Loader/Get Issue
<!doctype html>
<html>
<head>
<title>YUI Get Tests</title>
</head>
<body>
<script type="text/javascript" src="http://yui.yahooapis.com/3.7.0pr2/build/yui/yui.js"></script>
<script type="text/javascript">
// It's all about mixing 304/200s and JS/CSS
@sdesai
sdesai / gist:3418958
Created August 21, 2012 20:07
arguments.length - big hit in FF?
<!DOCTYPE html>
<html>
<head>
<title>Benchmarks</title>
</head>
<body>
<p><button id="start">Start Benchmarks</button></p>
<p id="d"></p>
Chrome 21 (better)
Old mixFacadeProps
new Base() x 7,181 ops/sec ±4.40% (53 runs sampled)
Fire With Facade Payload - 10 listeners x 43,066 ops/sec ±0.34% (58 runs sampled)
Fire With Facade Payload - 2 listeners x 50,986 ops/sec ±0.36% (57 runs sampled)
New mixFacadeProps
@sdesai
sdesai / gist:3364530
Created August 15, 2012 23:06
Event Perf Benchmarks
Chrome 21
3.6.0
new BaseCore() ±2.63% (52 runs sampled)
new Base() x 4,123 ops/sec ±1.78% (55 runs sampled)
Subscribe + Fire - 10 different events x 93.57 ops/sec ±55.26% (7 runs sampled)
Fire - 10 different events, no listeners x 5,727 ops/sec ±2.12% (54 runs sampled)
Publish - 10 different events x 13,892 ops/sec ±2.13% (56 runs sampled)
EventTarget Construction + Publish(foo) + Subscribe(foo) + Fire(foo) - 10 listeners x 4,654 ops/sec ±1.51% (56 runs sampled)
var page = require('webpage').create(),
url = 'http://localhost/YuiWip/sb/phantomtest.html';
page.open(url, function(status) {
var results = page.evaluate(function() {
return ("ontouchstart" in window);
});
console.log(results);