Skip to content

Instantly share code, notes, and snippets.

@neonux
neonux / texImage2D-for-chrome.patch
Created May 24, 2011 12:38
[PATCH] Do not perform image read access check when running in privileged context.
commit 85cfc6e739b07e5b4dcc161475f1f777fb2a8fd3
Author: Cedric Vivier <[email protected]>
Date: Tue May 24 19:33:49 2011 +0700
Do not perform image read access check when we running in privileged context.
---
content/canvas/src/WebGLContextGL.cpp | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/content/canvas/src/WebGLContextGL.cpp b/content/canvas/src/WebGLContextGL.cpp
@neonux
neonux / gist:994788
Created May 27, 2011 07:14
Enforcing depth/stencil:false through DEPTH_TEST/STENCIL_TEST
== in bindFramebuffer(framebuffer) ==
if (framebuffer == this.DEFAULT_FRAMEBUFFER) {
if (!this.contextAttributes.stencil && this.stencilTestEnabled) {
// An implementation must make sure no side-effect is possible when
// stencil buffer was not explicitly requested by the application.
glDisable(STENCIL_TEST);
}
} else if (this.boundFramebuffer == this.DEFAULT_FRAMEBUFFER && this.stencilTestDirty) {
// Currently bound framebuffer is default, now binding to another framebuffer
@neonux
neonux / gist:998746
Created May 30, 2011 11:18
When things go wrong.
Events: 7K
┌─────────────────────────────────────────────────────────────────────────┤ Event: cycles ├──────────────────────────────────────────────────────────────────────────┐
│ 4.50% firefox-bin libxul.so [.] nsAttrAndChildArray::IndexOfChild(nsINode*) const ↑│
│ 1.76% firefox-bin libxul.so [.] XPCWrappedNative::CallMethod(XPCCallContext&, XPCWrappedNative::CallMode) ▮│
│ 1.52% firefox-bin 7fcc41d3b1d9 [.] 0x007fcc41d3b1d9 ▒│
│ 1.38% firefox-bin libxul.so [.] js::PropertyTable::search(long, bool) ▒│
│ 1.36% fir
/* first call */
listElement.children.length // => 0
listElement.appendChild(newListItemElement);
listElement.children.length // => 0 (still!??)
/* second call (async, not within the same execution context) */
listElement.children.length // => 1 (cool! the item above got actually appended)
@neonux
neonux / gist:1028947
Created June 16, 2011 09:32
It could be funny if...
let AddonsMgrListener = {
get addonBar() document.getElementById("addon-bar"),
get statusBar() document.getElementById("status-bar"),
getAddonBarItemCount: function() {
// Take into account the contents of the status bar shim for the count.
var itemCount = this.statusBar.childNodes.length;
var defaultOrNoninteractive = this.addonBar.getAttribute("defaultset")
.split(",")
.concat(["separator", "spacer", "spring"]);
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<window id="popup-window"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="FOO"
windowtype="popup"
width="640" height="480"
persist="screenX screenY width height sizemode">
<browser flex="1" src="http://google.com/"/>
</window>
function coverage(aDump)
{
return [];
}
function aggregate(aOriginalStats, aNewStats, aUpdate)
{
// aUpdate(aScript, aLine) is called for every line that changed since aOriginalStats
}
@neonux
neonux / gist:1220322
Created September 15, 2011 20:06
dumps before and after calling foo()
=== BEFORE FOO() ===
--- SCRIPT :0 ---
loc counts x line op
----- ---------------- ---- --
main:
00000:0/0/0/0/0/0 x 0 stop
--- END SCRIPT :0 ---
--- SCRIPT :0 ---
loc counts x line op
@neonux
neonux / gist:1235815
Created September 22, 2011 19:42
enabled & import fixes
diff --git a/browser/devtools/styleeditor/test/browser_styleeditor_enabled.js b/browser/devtools/styleeditor/test/browser_styleeditor_enabled.js
index f32bf22..4d5b9e3 100644
--- a/browser/devtools/styleeditor/test/browser_styleeditor_enabled.js
+++ b/browser/devtools/styleeditor/test/browser_styleeditor_enabled.js
@@ -10,11 +10,14 @@ function test()
{
waitForExplicitFinish();
+ let count = 0;
addTabAndLaunchStyleEditorChromeWhenLoaded(function (aChrome) {
diff --git a/browser/devtools/styleeditor/StyleEditorChrome.jsm b/browser/devtools/styleeditor/StyleEditorChrome.jsm
index f8eb4b9..dbff59d 100644
--- a/browser/devtools/styleeditor/StyleEditorChrome.jsm
+++ b/browser/devtools/styleeditor/StyleEditorChrome.jsm
@@ -402,6 +402,7 @@ StyleEditorChrome.prototype = {
data: {
editor: aEditor
},
+ disableAnimations: this._alwaysDisableAnimations,
ordinal: aEditor.styleSheetIndex,