henry pushed to branch tor-browser-140.0esr-15.0-1 at The Tor Project / Applications / Tor Browser
Commits:
-
cf8b385f
by Henry Wilkes at 2025-07-17T15:08:43+01:00
-
1dcc5d46
by Henry Wilkes at 2025-07-17T15:08:45+01:00
-
cc26b7f2
by Henry Wilkes at 2025-07-17T15:08:47+01:00
-
f2ff56fd
by Henry Wilkes at 2025-07-17T15:08:48+01:00
-
1055f31d
by Henry Wilkes at 2025-07-17T15:08:52+01:00
-
3503b669
by Henry Wilkes at 2025-07-17T15:08:54+01:00
-
81547102
by Henry Wilkes at 2025-07-17T15:08:55+01:00
7 changed files:
- browser/components/onionservices/content/authPreferences.css
- browser/components/rulesets/content/aboutRulesets.css
- browser/components/securitylevel/content/securityLevelPanel.css
- browser/components/securitylevel/content/securityLevelPreferences.css
- browser/components/torpreferences/content/torPreferences.css
- toolkit/components/torconnect/content/aboutTorConnect.css
- + tools/base-browser/missing-css-variables.py
Changes:
| ... | ... | @@ -21,7 +21,7 @@ |
| 21 | 21 | margin-inline-end: 4px;
|
| 22 | 22 | list-style-image: url("chrome://global/skin/icons/warning.svg");
|
| 23 | 23 | -moz-context-properties: fill;
|
| 24 | - fill: var(--in-content-warning-icon-color);
|
|
| 24 | + fill: var(--icon-color-warning);
|
|
| 25 | 25 | }
|
| 26 | 26 | |
| 27 | 27 | /* Make a button appear disabled, whilst still allowing it to keep keyboard
|
| ... | ... | @@ -159,7 +159,7 @@ aside { |
| 159 | 159 | box-sizing: border-box;
|
| 160 | 160 | |
| 161 | 161 | border-inline-end: 1px solid var(--in-content-border-color);
|
| 162 | - background-color: var(--in-content-box-background);
|
|
| 162 | + background-color: var(--background-color-box);
|
|
| 163 | 163 | }
|
| 164 | 164 | |
| 165 | 165 | #ruleset-heading {
|
| ... | ... | @@ -223,7 +223,7 @@ aside { |
| 223 | 223 | }
|
| 224 | 224 | |
| 225 | 225 | #ruleset-list .selected {
|
| 226 | - border-inline-start-color: var(--in-content-accent-color);
|
|
| 226 | + border-inline-start-color: var(--color-accent-primary);
|
|
| 227 | 227 | }
|
| 228 | 228 | |
| 229 | 229 | #ruleset-list .selected.disabled {
|
| ... | ... | @@ -252,7 +252,7 @@ aside { |
| 252 | 252 | #ruleset-jwk-value {
|
| 253 | 253 | padding: 8px;
|
| 254 | 254 | border-radius: 2px;
|
| 255 | - background-color: var(--in-content-box-background);
|
|
| 255 | + background-color: var(--background-color-box);
|
|
| 256 | 256 | font-size: 85%;
|
| 257 | 257 | line-break: anywhere;
|
| 258 | 258 | /* ASCII-only text, so can set line-height. */
|
| ... | ... | @@ -15,7 +15,7 @@ |
| 15 | 15 | background-size: 9em 9em;
|
| 16 | 16 | -moz-context-properties: fill, fill-opacity;
|
| 17 | 17 | fill-opacity: 1;
|
| 18 | - fill: var(--button-bgcolor);
|
|
| 18 | + fill: var(--border-color-card);
|
|
| 19 | 19 | }
|
| 20 | 20 | |
| 21 | 21 | /* NOTE: Use ":dir" instead of ":-moz-locale-dir" when panel switches to HTML. */
|
| ... | ... | @@ -13,7 +13,7 @@ |
| 13 | 13 | width: 24px;
|
| 14 | 14 | height: 24px;
|
| 15 | 15 | -moz-context-properties: fill;
|
| 16 | - fill: var(--in-content-icon-color);
|
|
| 16 | + fill: var(--icon-color);
|
|
| 17 | 17 | margin-block-start: var(--space-xsmall);
|
| 18 | 18 | margin-inline-end: var(--space-large);
|
| 19 | 19 | }
|
| ... | ... | @@ -92,7 +92,7 @@ |
| 92 | 92 | |
| 93 | 93 | #security-level-current {
|
| 94 | 94 | margin-block-start: var(--space-large);
|
| 95 | - background: var(--in-content-box-background);
|
|
| 95 | + background: var(--background-color-box);
|
|
| 96 | 96 | border: 1px solid var(--in-content-box-border-color);
|
| 97 | 97 | border-radius: var(--border-radius-small);
|
| 98 | 98 | padding: var(--space-medium);
|
| ... | ... | @@ -154,7 +154,7 @@ button.spoof-button-disabled { |
| 154 | 154 | }
|
| 155 | 155 | |
| 156 | 156 | .tor-focusable-heading:focus-visible {
|
| 157 | - outline-offset: var(--in-content-focus-outline-offset);
|
|
| 157 | + outline-offset: var(--focus-outline-offset);
|
|
| 158 | 158 | }
|
| 159 | 159 | |
| 160 | 160 | .bridge-status-badge {
|
| ... | ... | @@ -303,7 +303,7 @@ button.spoof-button-disabled { |
| 303 | 303 | width: 16px;
|
| 304 | 304 | height: 16px;
|
| 305 | 305 | -moz-context-properties: fill;
|
| 306 | - fill: var(--in-content-icon-color);
|
|
| 306 | + fill: var(--icon-color);
|
|
| 307 | 307 | }
|
| 308 | 308 | |
| 309 | 309 | .tor-bridges-options-button {
|
| ... | ... | @@ -390,8 +390,8 @@ button.spoof-button-disabled { |
| 390 | 390 | |
| 391 | 391 | #tor-bridges-grid-display .tor-bridges-grid-cell:focus-visible {
|
| 392 | 392 | /* #tor-bridges-grid-display has focus management for its cells. */
|
| 393 | - outline: var(--in-content-focus-outline);
|
|
| 394 | - outline-offset: var(--in-content-focus-outline-offset);
|
|
| 393 | + outline: var(--focus-outline);
|
|
| 394 | + outline-offset: var(--focus-outline-offset);
|
|
| 395 | 395 | }
|
| 396 | 396 | |
| 397 | 397 | .tor-bridges-grid-cell {
|
| ... | ... | @@ -551,7 +551,7 @@ button.spoof-button-disabled { |
| 551 | 551 | justify-self: center;
|
| 552 | 552 | /* fill is the progress, stroke is the empty ring. */
|
| 553 | 553 | -moz-context-properties: fill, stroke;
|
| 554 | - fill: var(--in-content-success-icon-color);
|
|
| 554 | + fill: var(--icon-color-success);
|
|
| 555 | 555 | stroke: var(--in-content-border-color);
|
| 556 | 556 | content: url("chrome://browser/content/torpreferences/lox-progress-ring.svg");
|
| 557 | 557 | }
|
| ... | ... | @@ -568,7 +568,7 @@ button.spoof-button-disabled { |
| 568 | 568 | align-self: center;
|
| 569 | 569 | justify-self: center;
|
| 570 | 570 | -moz-context-properties: fill;
|
| 571 | - fill: var(--in-content-icon-color);
|
|
| 571 | + fill: var(--icon-color);
|
|
| 572 | 572 | }
|
| 573 | 573 | |
| 574 | 574 | #tor-bridges-lox-details .tor-bridges-lox-image-inner {
|
| ... | ... | @@ -617,7 +617,7 @@ button.spoof-button-disabled { |
| 617 | 617 | display: grid;
|
| 618 | 618 | /* fill is the icon color, stroke is the border color. */
|
| 619 | 619 | -moz-context-properties: fill, stroke;
|
| 620 | - fill: var(--in-content-icon-color);
|
|
| 620 | + fill: var(--icon-color);
|
|
| 621 | 621 | }
|
| 622 | 622 | |
| 623 | 623 | .tor-bridges-lox-list-item-bridge::before {
|
| ... | ... | @@ -633,7 +633,7 @@ button.spoof-button-disabled { |
| 633 | 633 | }
|
| 634 | 634 | |
| 635 | 635 | #tor-bridges-lox-unlock-alert .tor-bridges-lox-list-item::before {
|
| 636 | - stroke: var(--in-content-success-icon-color);
|
|
| 636 | + stroke: var(--icon-color-success);
|
|
| 637 | 637 | }
|
| 638 | 638 | |
| 639 | 639 | #tor-bridges-lox-remaining-invites {
|
| ... | ... | @@ -683,7 +683,7 @@ button.spoof-button-disabled { |
| 683 | 683 | width: 16px;
|
| 684 | 684 | height: 16px;
|
| 685 | 685 | -moz-context-properties: fill;
|
| 686 | - fill: var(--in-content-icon-color);
|
|
| 686 | + fill: var(--icon-color);
|
|
| 687 | 687 | }
|
| 688 | 688 | |
| 689 | 689 | #tor-bridges-provider-icon-telegram {
|
| ... | ... | @@ -925,7 +925,7 @@ hbox#torPreferences-requestBridge-incorrectCaptchaHbox { |
| 925 | 925 | image#torPreferences-requestBridge-errorIcon {
|
| 926 | 926 | list-style-image: url("chrome://global/skin/icons/warning.svg");
|
| 927 | 927 | -moz-context-properties: fill;
|
| 928 | - fill: var(--in-content-warning-icon-color);
|
|
| 928 | + fill: var(--icon-color-warning);
|
|
| 929 | 929 | }
|
| 930 | 930 | |
| 931 | 931 | groupbox#torPreferences-bridges-group textarea {
|
| ... | ... | @@ -1030,8 +1030,8 @@ groupbox#torPreferences-bridges-group textarea { |
| 1030 | 1030 | }
|
| 1031 | 1031 | |
| 1032 | 1032 | #user-provide-bridge-grid-display:focus-visible {
|
| 1033 | - outline: var(--in-content-focus-outline);
|
|
| 1034 | - outline-offset: var(--in-content-focus-outline-offset);
|
|
| 1033 | + outline: var(--focus-outline);
|
|
| 1034 | + outline-offset: var(--focus-outline-offset);
|
|
| 1035 | 1035 | }
|
| 1036 | 1036 | |
| 1037 | 1037 | /* Connection settings dialog */
|
| ... | ... | @@ -5,11 +5,6 @@ |
| 5 | 5 | @import url("chrome://global/skin/tor-colors.css");
|
| 6 | 6 | @import url("chrome://global/skin/onion-pattern.css");
|
| 7 | 7 | |
| 8 | -:root {
|
|
| 9 | - --onion-opacity: 1;
|
|
| 10 | - --onion-color: var(--card-outline-color);
|
|
| 11 | -}
|
|
| 12 | - |
|
| 13 | 8 | html {
|
| 14 | 9 | width: 100%;
|
| 15 | 10 | height: 100%;
|
| ... | ... | @@ -45,12 +40,12 @@ body:not(.loaded) { |
| 45 | 40 | }
|
| 46 | 41 | |
| 47 | 42 | .breadcrumb-item:hover {
|
| 48 | - color: var(--in-content-accent-color);
|
|
| 43 | + color: var(--color-accent-primary);
|
|
| 49 | 44 | background-color: var(--in-content-button-background-hover);
|
| 50 | 45 | }
|
| 51 | 46 | |
| 52 | 47 | .breadcrumb-item:active {
|
| 53 | - color: var(--in-content-accent-color-active);
|
|
| 48 | + color: var(--color-accent-primary-active);
|
|
| 54 | 49 | background-color: var(--in-content-button-background-active);
|
| 55 | 50 | }
|
| 56 | 51 | |
| ... | ... | @@ -73,7 +68,7 @@ body:not(.loaded) { |
| 73 | 68 | }
|
| 74 | 69 | |
| 75 | 70 | .breadcrumb-item.active {
|
| 76 | - color: var(--in-content-accent-color);
|
|
| 71 | + color: var(--color-accent-primary);
|
|
| 77 | 72 | }
|
| 78 | 73 | |
| 79 | 74 | .breadcrumb-item.disabled, .breadcrumb-item.disabled:hover, .breadcrumb-item.disabled:active {
|
| ... | ... | @@ -268,9 +263,9 @@ body.aboutTorConnect { |
| 268 | 263 | body.aboutTorConnect .title {
|
| 269 | 264 | background-image: url("chrome://global/content/torconnect/tor-connect.svg");
|
| 270 | 265 | -moz-context-properties: stroke, fill, fill-opacity;
|
| 271 | - fill-opacity: var(--onion-opacity);
|
|
| 272 | - fill: var(--onion-color);
|
|
| 273 | - stroke: var(--onion-color);
|
|
| 266 | + fill-opacity: 1;
|
|
| 267 | + fill: var(--icon-color);
|
|
| 268 | + stroke: var(--icon-color);
|
|
| 274 | 269 | /* Make sure there is no padding between the title and #breadcrumbs. */
|
| 275 | 270 | padding-block-start: 0;
|
| 276 | 271 | }
|
| ... | ... | @@ -285,7 +280,7 @@ body.aboutTorConnect .title:is(.assist, .final) { |
| 285 | 280 | |
| 286 | 281 | body.aboutTorConnect .title.location {
|
| 287 | 282 | background-image: url("chrome://global/content/torconnect/connection-location.svg");
|
| 288 | - stroke: var(--in-content-warning-icon-color);
|
|
| 283 | + stroke: var(--icon-color-warning);
|
|
| 289 | 284 | }
|
| 290 | 285 | |
| 291 | 286 | /* Android-specific CSS, to be removed when we use only the native UI. */
|
| ... | ... | @@ -301,13 +296,12 @@ body.aboutTorConnect .title.location { |
| 301 | 296 | }
|
| 302 | 297 | |
| 303 | 298 | body.android {
|
| 304 | - --onion-color: var(--android-dark-text-primary);
|
|
| 305 | 299 | width: 100%;
|
| 306 | 300 | height: 100%;
|
| 307 | 301 | box-sizing: border-box;
|
| 308 | 302 | margin: 0;
|
| 309 | 303 | padding: 0 24px !important;
|
| 310 | - color: var(--onion-color);
|
|
| 304 | + color: var(--android-dark-text-primary);
|
|
| 311 | 305 | background: linear-gradient(194deg, #692E9D -0.93%, #393270 48.91%);
|
| 312 | 306 | font: menu;
|
| 313 | 307 | font-size: 14px;
|
| 1 | +"""
|
|
| 2 | +Simple tool for checking for missing CSS declarations.
|
|
| 3 | + |
|
| 4 | +Should be run from the root directory and passed a single CSS file path to
|
|
| 5 | +check the variables for.
|
|
| 6 | + |
|
| 7 | +Missing variables will be printed to stdout, if any. Variables are considered
|
|
| 8 | +missing if they are not declared in the same file or in one of the expected
|
|
| 9 | +CSS files. CSS variables that are declared in javascript an unexpected CSS file
|
|
| 10 | +will not be found.
|
|
| 11 | + |
|
| 12 | +Exits with 0 if no variables are missing. Otherwise exits with 1.
|
|
| 13 | +"""
|
|
| 14 | + |
|
| 15 | +import re
|
|
| 16 | +import sys
|
|
| 17 | +from pathlib import Path
|
|
| 18 | + |
|
| 19 | +declare_dirs = [
|
|
| 20 | + Path("browser/branding"),
|
|
| 21 | + Path("browser/themes"),
|
|
| 22 | + Path("toolkit/themes"),
|
|
| 23 | +]
|
|
| 24 | + |
|
| 25 | +var_dec_regex = re.compile(r"^\s*(?P<name>--[\w_-]+)\s*:")
|
|
| 26 | +var_use_regex = re.compile(r":.*(?P<name>--[\w_-]+)")
|
|
| 27 | + |
|
| 28 | + |
|
| 29 | +def remove_vars_in_file(var_set: set[str], file_path: Path) -> bool:
|
|
| 30 | + """
|
|
| 31 | + Checks the CSS file for declarations of the given variables and removes
|
|
| 32 | + them.
|
|
| 33 | + |
|
| 34 | + :param var_set: The set of CSS variables to check and remove.
|
|
| 35 | + :param file_path: The path to a CSS file to check within.
|
|
| 36 | + :returns: Whether the variable set is now empty.
|
|
| 37 | + """
|
|
| 38 | + with file_path.open() as file:
|
|
| 39 | + for line in file:
|
|
| 40 | + var_dec_match = var_dec_regex.match(line)
|
|
| 41 | + if not var_dec_match:
|
|
| 42 | + continue
|
|
| 43 | + var_name = var_dec_match.group("name")
|
|
| 44 | + if var_name in var_set:
|
|
| 45 | + print(f"{var_name} declared in {file_path}", file=sys.stderr)
|
|
| 46 | + var_set.remove(var_name)
|
|
| 47 | + if not var_set:
|
|
| 48 | + return True
|
|
| 49 | + return False
|
|
| 50 | + |
|
| 51 | + |
|
| 52 | +def find_missing(file_path: Path) -> set[str]:
|
|
| 53 | + """
|
|
| 54 | + Search for CSS variables in the CSS file and check whether any are missing
|
|
| 55 | + known declarations.
|
|
| 56 | + |
|
| 57 | + :param file_path: The path of the CSS file to check.
|
|
| 58 | + :returns: The names of the missing variables.
|
|
| 59 | + """
|
|
| 60 | + used_vars: set[str] = set()
|
|
| 61 | + |
|
| 62 | + with open(file_path) as file:
|
|
| 63 | + for line in file:
|
|
| 64 | + for match in var_use_regex.finditer(line):
|
|
| 65 | + used_vars.add(match.group("name"))
|
|
| 66 | + |
|
| 67 | + if not used_vars:
|
|
| 68 | + print("No CSS variables found", file=sys.stderr)
|
|
| 69 | + return used_vars
|
|
| 70 | + |
|
| 71 | + # Remove any CSS variables that are declared within the same file.
|
|
| 72 | + if remove_vars_in_file(used_vars, file_path):
|
|
| 73 | + return used_vars
|
|
| 74 | + |
|
| 75 | + # And remove any that are in the expected declaration files.
|
|
| 76 | + for top_dir in declare_dirs:
|
|
| 77 | + for css_file_path in top_dir.rglob("*.css"):
|
|
| 78 | + if remove_vars_in_file(used_vars, css_file_path):
|
|
| 79 | + return used_vars
|
|
| 80 | + |
|
| 81 | + return used_vars
|
|
| 82 | + |
|
| 83 | + |
|
| 84 | +missing_vars = find_missing(Path(sys.argv[1]))
|
|
| 85 | +for var_name in missing_vars:
|
|
| 86 | + print(var_name)
|
|
| 87 | + |
|
| 88 | +sys.exit(1 if missing_vars else 0) |