Skip to content

Commit dcf6eb7

Browse files
authored
Merge pull request #309 from mozilla/enterprise-main-merge-2025-12-26
Enterprise main-merge 2025-12-26
2 parents 07398f7 + 60c6e77 commit dcf6eb7

File tree

2,346 files changed

+67490
-49192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,346 files changed

+67490
-49192
lines changed

.cargo/config.toml.in

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ git = "https://github.com/franziskuskiefer/cose-rust"
3535
rev = "43c22248d136c8b38fe42ea709d08da6355cf04b"
3636
replace-with = "vendored-sources"
3737

38-
[source."git+https://github.com/gfx-rs/wgpu?rev=9a975b24deb379b31a8a7cb999d2da5f3227a91a"]
38+
[source."git+https://github.com/gfx-rs/wgpu?rev=3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc"]
3939
git = "https://github.com/gfx-rs/wgpu"
40-
rev = "9a975b24deb379b31a8a7cb999d2da5f3227a91a"
40+
rev = "3f02781bb5a0a1fe1922ea36c9bdacf9792abcbc"
4141
replace-with = "vendored-sources"
4242

4343
[source."git+https://github.com/glandium/allocator-api2?rev=ad5f3d56a5a4519eff52af4ff85293431466ef5c"]

.github/workflows/pr-handler.yml

Lines changed: 97 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,97 @@
1+
name: Handle Pull Request
2+
on:
3+
# WARNING: pull_request_target MUST NOT be used if running code under control
4+
# of the source PR [0], as it could risk leaking the GH_TOKENs.
5+
#
6+
# In this case, we do it as the job needs to run within the context of the
7+
# target repo, so it can get a GH_TOKEN which it can use to comment on and
8+
# update the PR.
9+
#
10+
# Crucially, no external code is loaded or run as part of this workflow.
11+
#
12+
# [0] https://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target:~:text=Warning-,Running,websitehttps://docs.github.com/en/actions/reference/workflows-and-actions/events-that-trigger-workflows#pull_request_target:~:text=Warning-,Running,website
13+
#
14+
pull_request_target:
15+
types: [opened, reopened]
16+
17+
18+
env:
19+
ALLOWED_TEAM: lando-github-pilot
20+
ALLOWED_PATHS: |
21+
mobile/android/android-components
22+
mobile/android/fenix
23+
mobile/android/focus-android
24+
25+
GH_REPO: ${{ github.repository }}
26+
PR: ${{ github.event.pull_request.number }}
27+
28+
GH_TOKEN: ${{ github.token }}
29+
30+
jobs:
31+
handle-pr:
32+
runs-on: ubuntu-latest
33+
steps:
34+
35+
# Workflows don't get access to organisation metadata via the GITHUB_TOKEN.
36+
# We use the Lando Web App to obtain a token with sufficient permissions.
37+
- name: Generate a Lando Web token
38+
id: generate-lando-web-token
39+
uses: actions/create-github-app-token@v2
40+
continue-on-error: true
41+
with:
42+
app-id: ${{ vars.LANDO_WEB_APP_ID }}
43+
private-key: ${{ secrets.LANDO_WEB_APP_PRIVATE_KEY }}
44+
permission-members: read
45+
46+
- name: Check team membership
47+
id: team
48+
continue-on-error: true
49+
env:
50+
AUTHOR: ${{ github.actor }}
51+
GH_ORG: ${{ github.repository_owner }}
52+
GH_TOKEN: ${{ steps.generate-lando-web-token.outputs.token }}
53+
run: |
54+
if gh api "/orgs/${GH_ORG}/teams/${ALLOWED_TEAM}/memberships/${AUTHOR}" --silent 2>/dev/null; then
55+
echo "is_member=true" >> $GITHUB_OUTPUT
56+
else
57+
echo "is_member=false" >> $GITHUB_OUTPUT
58+
fi
59+
60+
- name: Check allowed paths
61+
id: paths
62+
continue-on-error: true
63+
if: steps.team.outputs.is_member == 'true'
64+
run: |
65+
PATTERN=$(echo "${ALLOWED_PATHS}" | xargs | tr ' ' '|')
66+
if gh pr view "${PR}" --json files --jq '.files[].path' | grep -vE "^(${PATTERN})"; then
67+
echo "only_allowed=false" >> $GITHUB_OUTPUT
68+
else
69+
echo "only_allowed=true" >> $GITHUB_OUTPUT
70+
fi
71+
72+
- name: Close PR
73+
if: steps.team.outputs.is_member != 'true' || steps.paths.outputs.only_allowed != 'true'
74+
run: |
75+
gh pr close "${PR}" --comment "(Automated Close) Please do not file pull requests here, see https://firefox-source-docs.mozilla.org/contributing/how_to_submit_a_patch.html"
76+
gh pr lock "${PR}"
77+
78+
- name: Add Lando link
79+
if: (steps.team.outputs.is_member == 'true' && steps.paths.outputs.only_allowed == 'true') && github.event.action == 'opened'
80+
env:
81+
#
82+
# Set the following variables at the repository level [0].
83+
# [0] https://docs.github.com/en/actions/how-tos/write-workflows/choose-what-workflows-do/use-variables#defining-configuration-variables-for-multiple-workflows
84+
#
85+
LANDO_BASE_URL: ${{ vars.LANDO_BASE_URL }}
86+
LANDO_REPO: ${{ vars.LANDO_REPO }}
87+
#
88+
# If they are empty, the following will be used to determine sane defaults.
89+
#
90+
DEFAULT_LANDO_BASE_URL: https://lando.moz.tools
91+
TARGET_BRANCH: ${{ github.base_ref }}
92+
run: |
93+
LANDO_BASE_URL="${LANDO_BASE_URL:-${DEFAULT_LANDO_BASE_URL}}"
94+
# We extract the GitHub repo name and target branch to use as
95+
# default LANDO_REPO if unspecified.
96+
LANDO_REPO="${LANDO_REPO:-${GH_REPO/*\//}-${TARGET_BRANCH}}"
97+
gh pr comment "${PR}" --body "[View this pull request in Lando](${LANDO_BASE_URL}/pulls/${LANDO_REPO}/${PR}) to land it once approved."

.prettierignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -689,7 +689,6 @@ dom/tests/mochitest/chrome/test_intlUtils_isAppLocaleRTL.html
689689
dom/tests/mochitest/chrome/test_nodesFromRect.html
690690
dom/tests/mochitest/chrome/test_queryCaretRect.html
691691
dom/tests/mochitest/chrome/test_selectAtPoint.html
692-
dom/tests/mochitest/chrome/test_window_getRegionalPrefsLocales.html
693692
dom/tests/mochitest/chrome/window_focus.xhtml
694693
dom/tests/mochitest/general/file_clonewrapper.html
695694
dom/tests/mochitest/general/file_focusrings.html

.stylelintrc.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -421,6 +421,8 @@ module.exports = {
421421
// Testing does not use design tokens
422422
"testing/**",
423423
// UA Widgets should not use design tokens
424+
"toolkit/themes/shared/colorpicker-common.css",
425+
"toolkit/themes/shared/colorpicker.css",
424426
"toolkit/themes/shared/media/pipToggle.css",
425427
"toolkit/themes/shared/media/videocontrols.css",
426428
"toolkit/content/widgets/datetimebox.css",

CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/mobile/android/android-components @mozilla-firefox/android-reviewers
2+
/mobile/android/fenix @mozilla-firefox/android-reviewers
3+
/mobile/android/focus-android @mozilla-firefox/android-reviewers

Cargo.lock

Lines changed: 25 additions & 38 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

accessible/base/TextLeafRange.cpp

Lines changed: 42 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1084,18 +1084,49 @@ TextLeafPoint TextLeafPoint::FindNextWordStartSameAcc(
10841084
/* static */
10851085
TextLeafPoint TextLeafPoint::GetCaret(Accessible* aAcc) {
10861086
if (LocalAccessible* localAcc = aAcc->AsLocal()) {
1087-
// Use HyperTextAccessible::CaretOffset. Eventually, we'll want to move
1088-
// that code into TextLeafPoint, but existing code depends on it living in
1089-
// HyperTextAccessible (including caret events).
1090-
HyperTextAccessible* ht = HyperTextFor(localAcc);
1091-
if (!ht) {
1092-
return TextLeafPoint();
1093-
}
1094-
int32_t htOffset = ht->CaretOffset();
1095-
if (htOffset == -1) {
1096-
return TextLeafPoint();
1087+
// Use the HyperTextAccessible caret offset. Eventually, we'll want to move
1088+
// that code into TextLeafPoint, but existing code depends on it being based
1089+
// on HyperTextAccessible (including caret events).
1090+
int32_t htOffset = -1;
1091+
// Try the cached caret.
1092+
HyperTextAccessible* ht = SelectionMgr()->AccessibleWithCaret(&htOffset);
1093+
if (ht) {
1094+
MOZ_ASSERT(htOffset != -1);
1095+
} else {
1096+
// There is no cached caret, but there might still be a caret; see bug
1097+
// 1425112.
1098+
ht = HyperTextFor(localAcc);
1099+
if (!ht) {
1100+
return TextLeafPoint();
1101+
}
1102+
// An offset can only refer to a child, but the caret might be in a deeper
1103+
// descendant. Walk to the deepest HyperTextAccessible using CaretOffset.
1104+
bool gotCaret = false;
1105+
for (;;) {
1106+
htOffset = ht->CaretOffset();
1107+
if (htOffset == -1) {
1108+
break;
1109+
}
1110+
// A descendant might return -1 in some cases, but it's okay as long as
1111+
// the call on the outermost HyperTextAccessible succeeds.
1112+
gotCaret = true;
1113+
LocalAccessible* child = ht->GetChildAtOffset(htOffset);
1114+
if (!child) {
1115+
break;
1116+
}
1117+
if (HyperTextAccessible* childHt = child->AsHyperText()) {
1118+
ht = childHt;
1119+
} else {
1120+
break;
1121+
}
1122+
}
1123+
if (!gotCaret) {
1124+
return TextLeafPoint();
1125+
}
10971126
}
1098-
TextLeafPoint point = ht->ToTextLeafPoint(htOffset);
1127+
// As noted above, CaretOffset on a descendant might return -1. Use 0 in
1128+
// that case.
1129+
TextLeafPoint point = ht->ToTextLeafPoint(htOffset == -1 ? 0 : htOffset);
10991130
if (!point) {
11001131
// Bug 1905021: This happens in the wild, but we don't understand why.
11011132
// ToTextLeafPoint should only fail if the HyperText offset is invalid,

accessible/basetypes/HyperTextAccessibleBase.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -640,12 +640,21 @@ int32_t HyperTextAccessibleBase::CaretLineNumber() {
640640
return -1;
641641
}
642642

643-
TextLeafPoint firstPointInThis = TextLeafPoint(Acc(), 0);
644-
int32_t lineNumber = 1;
645-
for (TextLeafPoint line = point; line && firstPointInThis < line;
643+
// Walk forward by line from the start of the container.
644+
TextLeafPoint line = TextLeafPoint(Acc(), 0);
645+
int32_t lineNumber = 0;
646+
for (; line && line < point;
646647
line = line.FindBoundary(nsIAccessibleText::BOUNDARY_LINE_START,
647-
eDirPrevious)) {
648-
lineNumber++;
648+
eDirNext)) {
649+
++lineNumber;
650+
}
651+
// The caret might be right at the start of a line, in which case we should
652+
// increment the line number. We shouldn't do that if the caret is at the end
653+
// of a line or container, though.
654+
if (line == point && !point.mIsEndOfLineInsertionPoint &&
655+
point.mOffset <
656+
static_cast<int32_t>(nsAccUtils::TextLength(point.mAcc))) {
657+
++lineNumber;
649658
}
650659

651660
return lineNumber;

0 commit comments

Comments
 (0)