<commit_before># Random prefs (added by loopdomfuzz.py) to be combined with constant-prefs.js (added by domInteresting.py)

import os
import random
import re

p0 = os.path.dirname(os.path.abspath(__file__))


intPrefs = {
    "ui.caretBlinkTime":                          lambda: 120,
    "font.size.inflation.minTwips":               lambda: 120,
    "font.size.inflation.emPerLine":              lambda: 15,
    "font.size.inflation.lineThreshold":          lambda: random.randrange(0, 400),
    "font.size.inflation.maxRatio":               lambda: random.randrange(0, 400),
    "browser.sessionhistory.max_entries":         lambda: random.randrange(2, 10),
    "browser.sessionhistory.max_total_viewers":   lambda: random.randrange(0, 4),
    "bidi.direction":                             lambda: random.choice([1, 2]),
    "bidi.numeral":                               lambda: random.choice([0, 1, 2, 3, 4]),
    "browser.display.use_document_fonts":         lambda: random.choice([0, 1]),
    "browser.history.maxStateObjectSize":         lambda: random.choice([0, 100, 655360, 655360]),
    "browser.sessionstore.interval":              lambda: random.choice([100, 1000, 15000]),
    "browser.sessionstore.max_tabs_undo":         lambda: random.choice([0, 1, 10]),
    "browser.sessionstore.browser.sessionstore.max_windows_undo": lambda: random.choice([0, 1, 10]),
    "browser.sessionstore.postdata":              lambda: random.choice([0, -1, 1000]),
    "layout.scrollbar.side":                      lambda: random.choice([0, 1, 2, 3]),
    "permissions.default.image":                  lambda: random.choice([1, 2, 3]),
    "accessibility.force_disabled":               lambda: random.choice([-1, 0, 1]),
    "gfx.font_rendering.harfbuzz.scripts":        lambda: random.randrange(0, 0x100), # gfx/thebes/gfxUnicodeProperties.h ShapingType bitfield
    "gfx.hidpi.enabled":                          lambda: random.choice([0, 1, 2]),
    "image.mem.hard_limit_decoded_image_kb":      lambda: random.randrange(0, 66560),
    "dom.max_script_run_time":                    lambda: random.choice([0, 5, 60, 60, 60, 60]), # NB: constant-prefs.js also usually sets it to 60
}

strPrefs = {
    "layout.css.devPixelsPerPx":                  lambda: random.choice(["-1.0", "1.0", "2.0"]), # float prefs are string prefs
    "intl.uidirection.en":                        lambda: "rtl",
    "gfx.canvas.azure.backends":                  lambda: "skia", # cg, direct2d, skia, cairo
}



def chance(p):
    return random.random() < p

def loadBoolPrefs():
    prefs = []
<commit_msg>Pref gfx.font_rendering.harfbuzz.scripts was removed in https://bugzilla.mozilla.org/show_bug.cgi?id=1018034<commit_after># Random prefs (added by loopdomfuzz.py) to be combined with constant-prefs.js (added by domInteresting.py)

import os
import random
import re

p0 = os.path.dirname(os.path.abspath(__file__))


intPrefs = {
    "ui.caretBlinkTime":                          lambda: 120,
    "font.size.inflation.minTwips":               lambda: 120,
    "font.size.inflation.emPerLine":              lambda: 15,
    "font.size.inflation.lineThreshold":          lambda: random.randrange(0, 400),
    "font.size.inflation.maxRatio":               lambda: random.randrange(0, 400),
    "browser.sessionhistory.max_entries":         lambda: random.randrange(2, 10),
    "browser.sessionhistory.max_total_viewers":   lambda: random.randrange(0, 4),
    "bidi.direction":                             lambda: random.choice([1, 2]),
    "bidi.numeral":                               lambda: random.choice([0, 1, 2, 3, 4]),
    "browser.display.use_document_fonts":         lambda: random.choice([0, 1]),
    "browser.history.maxStateObjectSize":         lambda: random.choice([0, 100, 655360, 655360]),
    "browser.sessionstore.interval":              lambda: random.choice([100, 1000, 15000]),
    "browser.sessionstore.max_tabs_undo":         lambda: random.choice([0, 1, 10]),
    "browser.sessionstore.browser.sessionstore.max_windows_undo": lambda: random.choice([0, 1, 10]),
    "browser.sessionstore.postdata":              lambda: random.choice([0, -1, 1000]),
    "layout.scrollbar.side":                      lambda: random.choice([0, 1, 2, 3]),
    "permissions.default.image":                  lambda: random.choice([1, 2, 3]),
    "accessibility.force_disabled":               lambda: random.choice([-1, 0, 1]),
    "gfx.hidpi.enabled":                          lambda: random.choice([0, 1, 2]),
    "image.mem.hard_limit_decoded_image_kb":      lambda: random.randrange(0, 66560),
    "dom.max_script_run_time":                    lambda: random.choice([0, 5, 60, 60, 60, 60]), # NB: constant-prefs.js also usually sets it to 60
}

strPrefs = {
    "layout.css.devPixelsPerPx":                  lambda: random.choice(["-1.0", "1.0", "2.0"]), # float prefs are string prefs
    "intl.uidirection.en":                        lambda: "rtl",
    "gfx.canvas.azure.backends":                  lambda: "skia", # cg, direct2d, skia, cairo
}



def chance(p):
    return random.random() < p

def loadBoolPrefs():
    prefs = []

{'fraction_non_alphanumeric': 0.14548298787641767, 'fraction_numerical': 0.04575674618693782, 'mean_word_length': 2.4444444444444446, 'pattern_counts': {'":': 49, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3601272', 'n_tokens_mistral': 1788, 'n_tokens_neox': 1602, 'n_words': 330}