icecat: add release icecat-140.10.1-1gnu1 for ecne

This commit is contained in:
Ark74 2026-05-04 16:58:41 -06:00
parent a5f93cb214
commit ff85d7c623
1256 changed files with 63469 additions and 24141 deletions

View file

@ -520,11 +520,12 @@ RefPtr<ClientOpPromise> ClientSource::Focus(const ClientFocusArgs& aArgs) {
return ClientOpPromise::CreateAndReject(rv, __func__);
}
nsCOMPtr<nsPIDOMWindowOuter> outer;
nsPIDOMWindowInner* inner = GetInnerWindow();
nsCOMPtr<nsPIDOMWindowInner> inner = GetInnerWindow();
nsIDocShell* docshell = nullptr;
if (inner) {
outer = inner->GetOuterWindow();
} else {
nsIDocShell* docshell = GetDocShell();
docshell = GetDocShell();
if (docshell) {
outer = docshell->GetWindow();
}
@ -537,9 +538,48 @@ RefPtr<ClientOpPromise> ClientSource::Focus(const ClientFocusArgs& aArgs) {
}
MOZ_ASSERT(NS_IsMainThread());
// Inlined from `ClientSource::SnapshotWindowState()`:
// Should not be necessary after bug 543435. Clean this up in bug 2025284.
if (docshell) {
// Force the creation of the initial document if it does not yet exist.
if (!docshell->GetDocument()) {
CopyableErrorResult rv;
rv.ThrowInvalidStateError("No document available.");
return ClientOpPromise::CreateAndReject(rv, __func__);
}
inner = GetInnerWindow();
}
nsFocusManager::FocusWindow(outer, aArgs.callerType());
Result<ClientState, ErrorResult> state = SnapshotState();
Result<ClientState, ErrorResult> state =
[&]() -> Result<ClientState, ErrorResult> {
if (!inner) {
// Inlined from `ClientSource::SnapshotWindowState()`:
return ClientState(ClientWindowState(VisibilityState::Hidden, TimeStamp(),
StorageAccess::eDeny, false));
}
if (inner->GetClientSource() == this) {
// The pointer comparison assumes that an inner window
// cannot gain a new ClientSource other than this same
// `ClientSource` having moved from a docshell owner to an
// inner window owner gained via `outer`, so we don't need to worry
// about a newly-allocated ClientSource occupying the same
// memory as the one pointed to by `this`. That is, in the case
// of the pointers being unequal, `inner->GetClientSource()`
// returns `nullptr` and `this` is an invalid pointer.
// Per [expr.eq], it's not UB to compare a pointer to a deleted
// object, since no pointer comparisons are UB anymore. The
// case about pointer-past-end for a different object being
// _unspecified_ behavior does not apply here.
return SnapshotState();
}
ErrorResult rv;
rv.ThrowInvalidStateError("Client destroyed during focus");
return Err(std::move(rv));
}();
if (state.isErr()) {
return ClientOpPromise::CreateAndReject(
CopyableErrorResult(state.unwrapErr()), __func__);