Skip to content

Instantly share code, notes, and snippets.

View esprehn's full-sized avatar

Elliott Sprehn esprehn

View GitHub Profile
<!doctype html>
<title>Firefox Click Event</title>
<a href="http://www.yahoo.com/" onclick="return clickRedirect('google');">Test!</a>
<a href="http://www.google.com/" id="google">Google.com</a>
<script>
/**
* Redirect a click to another element.
*
@esprehn
esprehn / datoken
Created November 8, 2010 00:20
datoken
#!/usr/bin/ruby
# Tool for getting and managing deviantART auth tokens.
#
# Copyright 2009, Elliott Sprehn. (Zeros-Elipticus.deviantart.com)
#
# Licensed under the GPLv3.
# http://www.gnu.org/licenses/quick-guide-gplv3.html
#
# DeviantART Auth Token
# Zeros-Elipticus
# 4-12-2010
require 'net/https'
require 'uri'
# Get a token, optionally asking dA to generate a brand new one
# if reusetoken is false.
#
aptitude dist-upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Reading extended state information
Initializing package states... Done
Building tag database... Done
The following packages are BROKEN:
libapache2-mod-php5 mysql-client-5.1 php5-cgi php5-cli php5-dev php5-gd
php5-pgsql php5-snmp php5-xsl
diff --git a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
index c43a48f..ca14687 100644
--- a/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
+++ b/Source/WebCore/css/CSSComputedStyleDeclaration.cpp
@@ -2743,6 +2743,11 @@ PassRefPtr<CSSValue> CSSComputedStyleDeclaration::getPropertyCSSValue(CSSPropert
case CSSPropertyUnicodeRange:
break;
+ // FIXME: Implement these for getComputedStyle.
+ case CSSPropertyWebkitOverflowAttachmentX:
(function() {
var requestAutocomplete = HTMLFormElement.prototype.requestAutocomplete;
HTMLFormElement.prototype.requestAutocomplete = function() {
var form = this;
return new Promise(function(resolve, reject) {
requestAutocomplete.call(form);
function cleanup() {
form.removeEventListener(onSuccess);
form.removeEventListener(onError);
<polymer-test name="my-widget-tests">
<template>
<my-widget object="{{ object }}"></my-widget>
</template>
<script>
PolymerTest("my-widget-tests", {
setup: function(data) {
// Setup data binding for each test.
data.object = {someValue: 2};
I profiled the starry night benchmark for 4 minutes, below is what I learned. There's a summary at the top, and analysis inline between each section of the trace.
Major take aways from profiling the starry night benchmark:
- Scrollbars are crazy expensive on OS X. We spend a 12.4% of the layout time and 16.5% of the recording time dealing with scrollbars.
- 5.6% of the time is spent starting a base::Timer on OS X to update the preferred size for the green bubble on OS X. Why is base::Timer::Start() so slow?
- updateLayerPositionsAfterLayout strikes again at 14% of the layout costs.
- core layout is extremely fast, it seems we just do "too much stuff" in general.
- Text recording (18% main thread) and rasterization (38% impl thread) are major factors.
- Rastering and clipping rounded rects is still too expensive (21% impl thread).
/*
Sends and observes notifications by broadcasting notify events.
Usage:
<fx-observer for="example" on-notify="{{ handleHashChange }}"></fx-observer>
FxObserver.notify("example", relatedData);
@esprehn
esprehn / README.txt
Last active August 29, 2015 14:27
Fun with FOUC
See the attached test case for an example where Firefox, Chrome/Safari and
old Opera (12) all differ.
1. cd to a directory of files.
2. Run `ruby fouc-server.rb`.
Now the directory will be served on localhost:8000 on your machine,
the directory is also served on localhost:8000/slow and supports a
?delay={seconds} query parameter to cause artificial network delay on that
resource.