Skip to content

Commit 60ea59e

Browse files
playwright-devopsyury-s
authored andcommitted
chore: bootstrap build #1074
1 parent d140f8c commit 60ea59e

File tree

75 files changed

+6690
-43
lines changed

Some content is hidden

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

75 files changed

+6690
-43
lines changed

accessible/base/NotificationController.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,8 @@ class NotificationController final : public EventQueue,
270270
}
271271
#endif
272272

273+
bool IsUpdatePendingForJugglerAccessibility() { return IsUpdatePending(); }
274+
273275
protected:
274276
virtual ~NotificationController();
275277

accessible/interfaces/nsIAccessibleDocument.idl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,9 @@ interface nsIAccessibleDocument : nsISupports
7272
* Return the child document accessible at the given index.
7373
*/
7474
nsIAccessibleDocument getChildDocumentAt(in unsigned long index);
75+
76+
/**
77+
* Return whether it is updating.
78+
*/
79+
readonly attribute boolean isUpdatePendingForJugglerAccessibility;
7580
};

accessible/xpcom/xpcAccessibleDocument.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,15 @@ xpcAccessibleDocument::GetVirtualCursor(nsIAccessiblePivot** aVirtualCursor) {
143143
return NS_OK;
144144
}
145145

146+
147+
NS_IMETHODIMP
148+
xpcAccessibleDocument::GetIsUpdatePendingForJugglerAccessibility(bool* updating) {
149+
NS_ENSURE_ARG_POINTER(updating);
150+
*updating = Intl()->Controller()->IsUpdatePendingForJugglerAccessibility();
151+
return NS_OK;
152+
}
153+
154+
146155
////////////////////////////////////////////////////////////////////////////////
147156
// xpcAccessibleDocument
148157

accessible/xpcom/xpcAccessibleDocument.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ class xpcAccessibleDocument : public xpcAccessibleHyperText,
4848
nsIAccessibleDocument** aDocument) final;
4949
NS_IMETHOD GetVirtualCursor(nsIAccessiblePivot** aVirtualCursor) final;
5050

51+
NS_IMETHOD GetIsUpdatePendingForJugglerAccessibility(bool* aUpdating) final;
52+
5153
/**
5254
* Return XPCOM wrapper for the internal accessible.
5355
*/

browser/installer/allowed-dupes.mn

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ browser/chrome/browser/res/payments/formautofill/autofillEditForms.js
139139
# Bug 1451050 - Remote settings empty dumps (will be populated with data eventually)
140140
browser/defaults/settings/pinning/pins.json
141141
browser/defaults/settings/main/example.json
142+
# Juggler/marionette files
143+
chrome/juggler/content/content/floating-scrollbars.css
144+
browser/chrome/devtools/skin/floating-scrollbars-responsive-design.css
145+
chrome/juggler/content/server/stream-utils.js
146+
chrome/marionette/content/stream-utils.js
142147
#ifdef MOZ_EME_WIN32_ARTIFACT
143148
gmp-clearkey/0.1/manifest.json
144149
i686/gmp-clearkey/0.1/manifest.json

browser/installer/package-manifest.in

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,11 @@
209209
@RESPATH@/components/marionette.js
210210
#endif
211211

212+
@RESPATH@/chrome/juggler@JAREXT@
213+
@RESPATH@/chrome/juggler.manifest
214+
@RESPATH@/components/juggler.manifest
215+
@RESPATH@/components/juggler.js
216+
212217
#if defined(ENABLE_TESTS) && defined(MOZ_DEBUG)
213218
@RESPATH@/components/TestInterfaceJS.js
214219
@RESPATH@/components/TestInterfaceJS.manifest

devtools/server/socket/websocket-server.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,12 @@ function writeHttpResponse(output, response) {
133133
* Process the WebSocket handshake headers and return the key to be sent in
134134
* Sec-WebSocket-Accept response header.
135135
*/
136-
function processRequest({ requestLine, headers }) {
136+
function processRequest({ requestLine, headers }, expectedPath) {
137137
const [method, path] = requestLine.split(" ");
138138
if (method !== "GET") {
139139
throw new Error("The handshake request must use GET method");
140140
}
141-
142-
if (path !== "/") {
141+
if (path !== expectedPath) {
143142
throw new Error("The handshake request has unknown path");
144143
}
145144

@@ -189,13 +188,13 @@ function computeKey(key) {
189188
/**
190189
* Perform the server part of a WebSocket opening handshake on an incoming connection.
191190
*/
192-
const serverHandshake = async function(input, output) {
191+
const serverHandshake = async function(input, output, expectedPath) {
193192
// Read the request
194193
const request = await readHttpRequest(input);
195194

196195
try {
197196
// Check and extract info from the request
198-
const { acceptKey } = processRequest(request);
197+
const { acceptKey } = processRequest(request, expectedPath);
199198

200199
// Send response headers
201200
await writeHttpResponse(output, [
@@ -217,8 +216,8 @@ const serverHandshake = async function(input, output) {
217216
* Performs the WebSocket handshake and waits for the WebSocket to open.
218217
* Returns Promise with a WebSocket ready to send and receive messages.
219218
*/
220-
const accept = async function(transport, input, output) {
221-
await serverHandshake(input, output);
219+
const accept = async function(transport, input, output, expectedPath) {
220+
await serverHandshake(input, output, expectedPath || "/");
222221

223222
const transportProvider = {
224223
setListener(upgradeListener) {

docshell/base/nsDocShell.cpp

Lines changed: 182 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
# include <unistd.h> // for getpid()
1616
#endif
1717

18+
#if JS_HAS_INTL_API && !MOZ_SYSTEM_ICU
19+
# include "unicode/locid.h"
20+
#endif /* JS_HAS_INTL_API && !MOZ_SYSTEM_ICU */
21+
22+
#include "js/LocaleSensitive.h"
23+
1824
#include "mozilla/ArrayUtils.h"
1925
#include "mozilla/Attributes.h"
2026
#include "mozilla/AutoRestore.h"
@@ -53,6 +59,7 @@
5359
#include "mozilla/dom/ContentFrameMessageManager.h"
5460
#include "mozilla/dom/DocGroup.h"
5561
#include "mozilla/dom/Element.h"
62+
#include "mozilla/dom/Geolocation.h"
5663
#include "mozilla/dom/HTMLAnchorElement.h"
5764
#include "mozilla/dom/PerformanceNavigation.h"
5865
#include "mozilla/dom/PermissionMessageUtils.h"
@@ -71,6 +78,7 @@
7178
#include "mozilla/dom/nsCSPContext.h"
7279
#include "mozilla/dom/LoadURIOptionsBinding.h"
7380
#include "mozilla/dom/JSWindowActorChild.h"
81+
#include "mozilla/dom/WorkerCommon.h"
7482

7583
#include "mozilla/net/DocumentChannel.h"
7684
#include "mozilla/net/DocumentChannelChild.h"
@@ -96,6 +104,7 @@
96104
#include "nsIDocShellTreeItem.h"
97105
#include "nsIDocShellTreeOwner.h"
98106
#include "mozilla/dom/Document.h"
107+
#include "mozilla/dom/Element.h"
99108
#include "nsIDocumentLoaderFactory.h"
100109
#include "nsIDOMWindow.h"
101110
#include "nsIEditingSession.h"
@@ -183,6 +192,7 @@
183192
#include "nsGlobalWindow.h"
184193
#include "nsISearchService.h"
185194
#include "nsJSEnvironment.h"
195+
#include "nsJSUtils.h"
186196
#include "nsNetCID.h"
187197
#include "nsNetUtil.h"
188198
#include "nsObjectLoadingContent.h"
@@ -350,6 +360,10 @@ nsDocShell::nsDocShell(BrowsingContext* aBrowsingContext,
350360
mUseErrorPages(false),
351361
mObserveErrorPages(true),
352362
mCSSErrorReportingEnabled(false),
363+
mFileInputInterceptionEnabled(false),
364+
mBypassCSPEnabled(false),
365+
mOnlineOverride(nsIDocShell::ONLINE_OVERRIDE_NONE),
366+
mColorSchemeOverride(COLOR_SCHEME_OVERRIDE_NONE),
353367
mAllowAuth(mItemType == typeContent),
354368
mAllowKeywordFixup(false),
355369
mIsOffScreenBrowser(false),
@@ -1219,6 +1233,7 @@ bool nsDocShell::SetCurrentURI(nsIURI* aURI, nsIRequest* aRequest,
12191233
isSubFrame = mLSHE->GetIsSubFrame();
12201234
}
12211235

1236+
FireOnFrameLocationChange(this, aRequest, aURI, aLocationFlags);
12221237
if (!isSubFrame && !isRoot) {
12231238
/*
12241239
* We don't want to send OnLocationChange notifications when
@@ -3340,6 +3355,167 @@ nsDocShell::GetMessageManager(ContentFrameMessageManager** aMessageManager) {
33403355
return NS_OK;
33413356
}
33423357

3358+
// =============== Juggler Begin =======================
3359+
3360+
nsDocShell* nsDocShell::GetRootDocShell() {
3361+
nsCOMPtr<nsIDocShellTreeItem> rootAsItem;
3362+
GetInProcessSameTypeRootTreeItem(getter_AddRefs(rootAsItem));
3363+
nsCOMPtr<nsIDocShell> rootShell = do_QueryInterface(rootAsItem);
3364+
return nsDocShell::Cast(rootShell);
3365+
}
3366+
3367+
NS_IMETHODIMP
3368+
nsDocShell::GetBypassCSPEnabled(bool* aEnabled) {
3369+
MOZ_ASSERT(aEnabled);
3370+
*aEnabled = mBypassCSPEnabled;
3371+
return NS_OK;
3372+
}
3373+
3374+
NS_IMETHODIMP
3375+
nsDocShell::SetBypassCSPEnabled(bool aEnabled) {
3376+
mBypassCSPEnabled = aEnabled;
3377+
return NS_OK;
3378+
}
3379+
3380+
bool nsDocShell::IsBypassCSPEnabled() {
3381+
return GetRootDocShell()->mBypassCSPEnabled;
3382+
}
3383+
3384+
NS_IMETHODIMP
3385+
nsDocShell::GetLanguageOverride(nsAString& aLanguageOverride) {
3386+
MOZ_ASSERT(aEnabled);
3387+
aLanguageOverride = GetRootDocShell()->mLanguageOverride;
3388+
return NS_OK;
3389+
}
3390+
3391+
3392+
static void SetIcuLocale(const nsAString& aLanguageOverride) {
3393+
icu::Locale locale(NS_LossyConvertUTF16toASCII(aLanguageOverride).get());
3394+
if (icu::Locale::getDefault() == locale)
3395+
return;
3396+
UErrorCode error_code = U_ZERO_ERROR;
3397+
const char* lang = locale.getLanguage();
3398+
if (lang != nullptr && *lang != '\0') {
3399+
icu::Locale::setDefault(locale, error_code);
3400+
} else {
3401+
fprintf(stderr, "SetIcuLocale Failed to set the ICU default locale to %s\n", NS_LossyConvertUTF16toASCII(aLanguageOverride).get());
3402+
}
3403+
3404+
AutoJSAPI jsapi;
3405+
jsapi.Init();
3406+
JSContext* cx = jsapi.cx();
3407+
JS_ResetDefaultLocale(JS_GetRuntime(cx));
3408+
3409+
ResetDefaultLocaleInAllWorkers();
3410+
}
3411+
3412+
NS_IMETHODIMP
3413+
nsDocShell::SetLanguageOverride(const nsAString& aLanguageOverride) {
3414+
mLanguageOverride = aLanguageOverride;
3415+
SetIcuLocale(aLanguageOverride);
3416+
return NS_OK;
3417+
}
3418+
3419+
NS_IMETHODIMP
3420+
nsDocShell::OverrideTimezone(const nsAString& aTimezoneOverride,
3421+
bool* aSuccess) {
3422+
NS_ENSURE_ARG(aSuccess);
3423+
NS_LossyConvertUTF16toASCII timeZoneId(aTimezoneOverride);
3424+
*aSuccess = nsJSUtils::SetTimeZoneOverride(timeZoneId.get());
3425+
3426+
// Set TZ which affects localtime_s().
3427+
auto setTimeZoneEnv = [](const char* value) {
3428+
#if defined(_WIN32)
3429+
return _putenv_s("TZ", value) == 0;
3430+
#else
3431+
return setenv("TZ", value, true) == 0;
3432+
#endif /* _WIN32 */
3433+
};
3434+
if (*aSuccess) {
3435+
*aSuccess = setTimeZoneEnv(timeZoneId.get());
3436+
if (!*aSuccess) {
3437+
fprintf(stderr, "Failed to set 'TZ' to '%s'\n", timeZoneId.get());
3438+
}
3439+
}
3440+
return NS_OK;
3441+
}
3442+
3443+
NS_IMETHODIMP
3444+
nsDocShell::GetFileInputInterceptionEnabled(bool* aEnabled) {
3445+
MOZ_ASSERT(aEnabled);
3446+
*aEnabled = GetRootDocShell()->mFileInputInterceptionEnabled;
3447+
return NS_OK;
3448+
}
3449+
3450+
NS_IMETHODIMP
3451+
nsDocShell::SetFileInputInterceptionEnabled(bool aEnabled) {
3452+
mFileInputInterceptionEnabled = aEnabled;
3453+
return NS_OK;
3454+
}
3455+
3456+
bool nsDocShell::IsFileInputInterceptionEnabled() {
3457+
return GetRootDocShell()->mFileInputInterceptionEnabled;
3458+
}
3459+
3460+
void nsDocShell::FilePickerShown(mozilla::dom::Element* element) {
3461+
nsCOMPtr<nsIObserverService> observerService =
3462+
mozilla::services::GetObserverService();
3463+
observerService->NotifyObservers(
3464+
ToSupports(element), "juggler-file-picker-shown", nullptr);
3465+
}
3466+
3467+
RefPtr<nsGeolocationService> nsDocShell::GetGeolocationServiceOverride() {
3468+
return GetRootDocShell()->mGeolocationServiceOverride;
3469+
}
3470+
3471+
NS_IMETHODIMP
3472+
nsDocShell::SetGeolocationOverride(nsIDOMGeoPosition* aGeolocationOverride) {
3473+
if (aGeolocationOverride) {
3474+
if (!mGeolocationServiceOverride) {
3475+
mGeolocationServiceOverride = new nsGeolocationService();
3476+
mGeolocationServiceOverride->Init();
3477+
}
3478+
mGeolocationServiceOverride->Update(aGeolocationOverride);
3479+
} else {
3480+
mGeolocationServiceOverride = nullptr;
3481+
}
3482+
return NS_OK;
3483+
}
3484+
3485+
NS_IMETHODIMP
3486+
nsDocShell::GetOnlineOverride(OnlineOverride* aOnlineOverride) {
3487+
*aOnlineOverride = GetRootDocShell()->mOnlineOverride;
3488+
return NS_OK;
3489+
}
3490+
3491+
NS_IMETHODIMP
3492+
nsDocShell::SetOnlineOverride(OnlineOverride aOnlineOverride) {
3493+
// We don't have a way to verify this coming from Javascript, so this check is
3494+
// still needed.
3495+
if (!(aOnlineOverride == ONLINE_OVERRIDE_NONE ||
3496+
aOnlineOverride == ONLINE_OVERRIDE_ONLINE ||
3497+
aOnlineOverride == ONLINE_OVERRIDE_OFFLINE)) {
3498+
return NS_ERROR_INVALID_ARG;
3499+
}
3500+
3501+
mOnlineOverride = aOnlineOverride;
3502+
return NS_OK;
3503+
}
3504+
3505+
NS_IMETHODIMP
3506+
nsDocShell::GetColorSchemeOverride(ColorSchemeOverride* aColorSchemeOverride) {
3507+
*aColorSchemeOverride = GetRootDocShell()->mColorSchemeOverride;
3508+
return NS_OK;
3509+
}
3510+
3511+
NS_IMETHODIMP
3512+
nsDocShell::SetColorSchemeOverride(ColorSchemeOverride aColorSchemeOverride) {
3513+
mColorSchemeOverride = aColorSchemeOverride;
3514+
return NS_OK;
3515+
}
3516+
3517+
// =============== Juggler End =======================
3518+
33433519
NS_IMETHODIMP
33443520
nsDocShell::GetIsNavigating(bool* aOut) {
33453521
*aOut = mIsNavigating;
@@ -12137,6 +12313,9 @@ class OnLinkClickEvent : public Runnable {
1213712313
mNoOpenerImplied, nullptr, nullptr,
1213812314
mIsUserTriggered, mTriggeringPrincipal, mCsp);
1213912315
}
12316+
nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
12317+
observerService->NotifyObservers(ToSupports(mContent), "juggler-link-click-sync", nullptr);
12318+
1214012319
return NS_OK;
1214112320
}
1214212321

@@ -12226,6 +12405,9 @@ nsresult nsDocShell::OnLinkClick(
1222612405
this, aContent, aURI, target, aFileName, aPostDataStream,
1222712406
aHeadersDataStream, noOpenerImplied, aIsUserTriggered, aIsTrusted,
1222812407
aTriggeringPrincipal, aCsp);
12408+
12409+
nsCOMPtr<nsIObserverService> observerService = mozilla::services::GetObserverService();
12410+
observerService->NotifyObservers(ToSupports(aContent), "juggler-link-click", nullptr);
1222912411
return DispatchToTabGroup(TaskCategory::UI, ev.forget());
1223012412
}
1223112413

0 commit comments

Comments
 (0)