Skip to content

Instantly share code, notes, and snippets.

View zbraniecki's full-sized avatar

Zibi Braniecki zbraniecki

View GitHub Profile
@zbraniecki
zbraniecki / add_likely_subtags.cpp
Last active September 19, 2019 17:06
Performance of ICU Locale parsing vs. unic-locale proposal
#include <stdio.h>
#include <chrono>
#include <vector>
#include <cstring>
#include "unicode/uloc.h"
std::vector<std::string> ids;
ids.push_back("en-US");
ids.push_back("en-GB");
@zbraniecki
zbraniecki / DOMOverlays rev2 perf
Last active April 12, 2019 23:56
DOMOverlays perf
{
const {DOMLocalization} = ChromeUtils.import("resource://gre/modules/DOMLocalization.jsm");
let count = 10000;
let l10n = {
value: `Click on <img data-l10n-name="picture"/> to go to <a data-l10n-name="link"/>the website</a>.`
};
let elems = [];
for(let i = 0; i < count; i++) {
let elem = document.createElement("description");
let frag = MozXULElement.parseXULToFragment(`<img src="logo.png" data-l10n-name="picture"/><a href="www.mozilla.org" data-l10n-name="link"></a>`);
diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -1337,7 +1337,8 @@ Document::Document(const char* aContentT
mThrowOnDynamicMarkupInsertionCounter(0),
mIgnoreOpensDuringUnloadCounter(0),
mDocLWTheme(Doc_Theme_Uninitialized),
- mSavedResolution(1.0f) {
+ mSavedResolution(1.0f),
+ mPendingInitialTranslation(false) {
@zbraniecki
zbraniecki / perf.diff
Created January 11, 2019 19:13
Block Layout Perf Diff
diff --git a/dom/base/Document.cpp b/dom/base/Document.cpp
--- a/dom/base/Document.cpp
+++ b/dom/base/Document.cpp
@@ -1343,7 +1343,8 @@ Document::Document(const char* aContentT
mThrowOnDynamicMarkupInsertionCounter(0),
mIgnoreOpensDuringUnloadCounter(0),
mDocLWTheme(Doc_Theme_Uninitialized),
- mSavedResolution(1.0f) {
+ mSavedResolution(1.0f),
+ mPendingInitialTranslation(false) {
@zbraniecki
zbraniecki / cloc-intl-locale.diff
Last active November 27, 2018 20:00
Code diff between Firefox 51 and Firefox 65
github.com/AlDanial/cloc v 1.80 T=0.23 s (4.3 files/s, 4.3 lines/s)
-------------------------------------------------------------------------------
Language files blank comment code
-------------------------------------------------------------------------------
C++
same 1 7 13 86
modified 2 0 2 83
added 16 442 284 2789
removed 15 453 453 2318
JavaScript
{
"do-not-track-description": "Send websites a “Do Not Track” signal that you don’t want to be tracked",
"do-not-track-learn-more": "Learn more",
"do-not-track-option-default": {
"attrs": {
"label": "Only when using Tracking Protection"
}
},
"do-not-track-option-default-content-blocking": {
"attrs": {
▶ /usr/bin/cargo build --build-plan -Z unstable-options --release --frozen --manifest-path /home/zbraniecki/projects/mozilla-unified/js/src/rust/Cargo.toml --lib --target=x86_64-unknown-linux-gnu
Updating git repository `https://github.com/servo/serde`
error: failed to resolve patches for `https://github.com/rust-lang/crates.io-index`
Caused by:
failed to load source for a dependency on `serde_derive`
Caused by:
Unable to update https://github.com/servo/serde?branch=deserialize_from_enums8#c4457d80
~/projects/mozilla-unified central ⍉
▶ ./mach build
Build configuration changed. Regenerating backend.
0:00.37 /home/zbraniecki/projects/mozilla-unified/obj-x86_64-pc-linux-gnu-opt/_virtualenvs/init/bin/python /home/zbraniecki/projects/mozilla-unified/obj-x86_64-pc-linux-gnu-opt/config.status
Reticulating splines...
0:00.76 File already read. Skipping: /home/zbraniecki/projects/mozilla-unified/security/pkix/moz.build
0:01.80 File already read. Skipping: /home/zbraniecki/projects/mozilla-unified/gfx/angle/targets/angle_common/moz.build
0:07.82 /usr/bin/cargo build --build-plan -Z unstable-options --release --frozen --manifest-path /home/zbraniecki/projects/mozilla-unified/js/src/rust/Cargo.toml --lib --target=x86_64-unknown-linux-gnu
Traceback (most recent call last):
File "/home/zbraniecki/projects/mozilla-unified/obj-x86_64-pc-linux-gnu-opt/config.status", line 1297, in <module>
{
"type": "main",
"id": "2b63fdad-5039-406a-8ead-19a69bb88d9f",
"creationDate": "2018-09-21T00:22:15.807Z",
"version": 4,
"application": {
"architecture": "x86-64",
"buildId": "20180913100107",
"name": "Firefox",
"version": "64.0a1",
diff --git a/toolkit/components/extensions/Extension.jsm b/toolkit/components/extensions/Extension.jsm
--- a/toolkit/components/extensions/Extension.jsm
+++ b/toolkit/components/extensions/Extension.jsm
@@ -2007,6 +2007,11 @@ class Langpack extends ExtensionData {
}
async startup(reason) {
+ if (reason === "APP_STARTUP" && AppConstants.platform === "XP_WIN") {
+ if (!(await OS.File.exists(this.rootURI))) {
+ return false;