Skip to content

Commit

Permalink
Bug 1811645 - avoid an American English colloquialism meaning "nonsen…
Browse files Browse the repository at this point in the history
…se" r=Gijs

Differential Revision: https://phabricator.services.mozilla.com/D175802
  • Loading branch information
mozkeeler committed Apr 20, 2023
1 parent 60eb923 commit 8b2f0ca
Show file tree
Hide file tree
Showing 11 changed files with 32 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ trackResourcePrefix("gre");
trackResourcePrefix("app");

function getBaseUriForChromeUri(chromeUri) {
let chromeFile = chromeUri + "gobbledygooknonexistentfile.reallynothere";
let chromeFile = chromeUri + "nonexistentfile.reallynothere";
let uri = Services.io.newURI(chromeFile);
let fileUri = gChromeReg.convertChromeURL(uri);
return fileUri.resolve(".");
Expand Down
2 changes: 1 addition & 1 deletion browser/base/content/test/static/browser_parsable_css.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ trackResourcePrefix("gre");
trackResourcePrefix("app");

function getBaseUriForChromeUri(chromeUri) {
let chromeFile = chromeUri + "gobbledygooknonexistentfile.reallynothere";
let chromeFile = chromeUri + "nonexistentfile.reallynothere";
let uri = Services.io.newURI(chromeFile);
let fileUri = gChromeReg.convertChromeURL(uri);
return fileUri.resolve(".");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,12 @@ var pairs = [
let supportsNullBytes = AppConstants.platform == "macosx";
// Note that \u000d (\r) is missing here; we test it separately because it
// makes the test sad on Windows.
let gobbledygook =
let nonsense =
"\u000a\u000b\u000c\u000e\u000f\u0010\u0011\u0012\u0013\u0014javascript:foo";
if (supportsNullBytes) {
gobbledygook = "\u0000" + gobbledygook;
nonsense = "\u0000" + nonsense;
}
pairs.push([gobbledygook, "foo"]);
pairs.push([nonsense, "foo"]);

let supportsReturnWithoutNewline =
AppConstants.platform != "win" && AppConstants.platform != "linux";
Expand Down
5 changes: 2 additions & 3 deletions docshell/test/unit/test_URIFixup_search.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,8 @@ var data = [
fixed: "http://user:[email protected]:8080/this/is/a/test.html",
},
{
wrong: "gobbledygook:user:[email protected]:8080/this/is/a/test.html",
fixed:
"http://gobbledygook:user%[email protected]:8080/this/is/a/test.html",
wrong: "nonsense:user:[email protected]:8080/this/is/a/test.html",
fixed: "http://nonsense:user%[email protected]:8080/this/is/a/test.html",
},
{
wrong: "user:@example.com:8080/this/is/a/test.html",
Expand Down
2 changes: 1 addition & 1 deletion intl/l10n/test/test_l10nregistry.js
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ add_task(async function test_missing_file() {
});

add_task(async function test_hasSource() {
equal(l10nReg.hasSource("gobbledygook"), false, "Non-existing source doesn't exist");
equal(l10nReg.hasSource("nonsense"), false, "Non-existing source doesn't exist");
equal(l10nReg.hasSource("app"), false, "hasSource returns true before registering a source");
let oneSource = new L10nFileSource("app", "app", ["en-US"], "/{locale}/");
l10nReg.registerSources([oneSource]);
Expand Down
2 changes: 1 addition & 1 deletion mfbt/Tainting.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Tainted {
// ====================================================================
// ====================================================================
/*
* This section contains non-user-facing C++ gobblygook to support
* This section contains obscure, non-user-facing C++ to support
* variable-argument macros.
*/
#define MOZ_TAINT_GLUE(a, b) a b
Expand Down
13 changes: 13 additions & 0 deletions tools/lint/rejected-words.yml
Original file line number Diff line number Diff line change
Expand Up @@ -329,3 +329,16 @@ avoid-blacklist-and-whitelist:
# Disable for now. Needs some dev to handle this
# avoid-master-and-slave:
# description: "Use words like 'controller', 'worker' instead"
---
avoid-gobbledygook:
description: "American English colloquialism. Use 'nonsense' instead."
level: error
include: ['.']
type: regex
payload: \b(gobbledy)?-?gook
ignore-case: true
exclude:
- extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/orig/en_US-custom.dic
- extensions/spellcheck/locales/en-US/hunspell/dictionary-sources/utf8/en-US-utf8.dic
- extensions/spellcheck/locales/en-US/hunspell/en-US.dic
- tools/lint/rejected-words.yml
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ add_task(async function test_enforce_useful_extension() {
await testLinkWithoutExtension("video/webm", true);
await testLinkWithoutExtension("application/pdf", true);

await testLinkWithoutExtension("application/x-gobbledygook", false);
await testLinkWithoutExtension("application/x-nonsense", false);
await testLinkWithoutExtension("application/octet-stream", false);
await testLinkWithoutExtension("binary/octet-stream", false);
await testLinkWithoutExtension("application/x-msdownload", false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ let types = {
// so it is used here for this test.
js: "application/x-javascript",
binary: "application/octet-stream",
gook: "application/x-gook",
nonsense: "application/x-nonsense",
zip: "application/zip",
json: "application/json",
tar: "application/x-tar",
Expand Down
14 changes: 7 additions & 7 deletions uriloader/exthandler/tests/mochitest/save_filenames.html
Original file line number Diff line number Diff line change
Expand Up @@ -73,16 +73,16 @@
<img id="i18" src="http://localhost:8000/save_filename.sjs?type=png&filename=second%32file%2Eexe" data-filename="second2file.png">

<!-- unknown type with png extension -->
<img id="i19" src="http://localhost:8000/save_filename.sjs?type=gook&filename=gook1.png"
data-nodrag="true" data-unknown="typeonly" data-filename="gook1.png">
<img id="i19" src="http://localhost:8000/save_filename.sjs?type=nonsense&filename=nonsense1.png"
data-nodrag="true" data-unknown="typeonly" data-filename="nonsense1.png">

<!-- unknown type with exe extension -->
<img id="i20" src="http://localhost:8000/save_filename.sjs?type=gook&filename=gook2.exe"
data-nodrag="true" data-unknown="typeonly" data-filename="gook2.exe">
<img id="i20" src="http://localhost:8000/save_filename.sjs?type=nonsense&filename=nonsense2.exe"
data-nodrag="true" data-unknown="typeonly" data-filename="nonsense2.exe">

<!-- unknown type with no extension -->
<img id="i21" src="http://localhost:8000/save_filename.sjs?type=gook&filename=gook3"
data-nodrag="true" data-unknown="typeonly" data-filename="gook3">
<img id="i21" src="http://localhost:8000/save_filename.sjs?type=nonsense&filename=nonsense3"
data-nodrag="true" data-unknown="typeonly" data-filename="nonsense3">

<!-- simple script -->
<script id="i22" src="http://localhost:8000/save_filename.sjs?type=js&filename=script1.js" data-filename="script1.js"></script>
Expand Down Expand Up @@ -290,7 +290,7 @@
data-unknown="true"></object>

<!-- executable with no filename specified and an extension specified within the url -->
<img id="i76" src="http://localhost:8000/executable.exe?type=gook"
<img id="i76" src="http://localhost:8000/executable.exe?type=nonsense"
data-nodrag="true" data-unknown="typeonly" data-filename="executable.exe">

<!-- embedded child html -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ http://creativecommons.org/publicdomain/zero/1.0/ */
add_task(async function test_utf8_extension() {
const mimeService = Cc["@mozilla.org/mime;1"].getService(Ci.nsIMIMEService);
let someMIME = mimeService.getFromTypeAndExtension(
"application/x-gobbledygook",
"application/x-nonsense",
".тест"
);
Assert.stringContains(someMIME.description, "тест");
Expand Down

0 comments on commit 8b2f0ca

Please sign in to comment.