Merge autoland to mozilla-central. a=merge

This commit is contained in:
Oana Pop Rus 2019-03-29 23:51:13 +02:00
Родитель f298a75fb9 696c9d2139
Коммит a84c656b40
404 изменённых файлов: 4753 добавлений и 4501 удалений

Просмотреть файл

@ -22,6 +22,7 @@
#include "mozilla/Components.h"
#include "mozilla/EventListenerManager.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/Event.h" // for Event
#include "nsContentUtils.h"
#include "nsDocShellLoadTypes.h"
@ -437,8 +438,10 @@ DocAccessible* DocManager::CreateDocOrRootAccessible(Document* aDocument) {
}
// Ignore documents without presshell and not having root frame.
nsIPresShell* presShell = aDocument->GetShell();
if (!presShell || presShell->IsDestroying()) return nullptr;
PresShell* presShell = aDocument->GetPresShell();
if (!presShell || presShell->IsDestroying()) {
return nullptr;
}
bool isRootDoc = nsCoreUtils::IsRootDocument(aDocument);

Просмотреть файл

@ -6,6 +6,7 @@
#define mozilla_a11_DocManager_h_
#include "mozilla/ClearOnShutdown.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/Document.h"
#include "nsIDOMEventListener.h"
#include "nsRefPtrHashtable.h"
@ -183,8 +184,8 @@ class DocManager : public nsIWebProgressListener,
* more than one.
*/
inline DocAccessible* GetExistingDocAccessible(const dom::Document* aDocument) {
nsIPresShell* ps = aDocument->GetShell();
return ps ? ps->GetDocAccessible() : nullptr;
PresShell* presShell = aDocument->GetPresShell();
return presShell ? presShell->GetDocAccessible() : nullptr;
}
} // namespace a11y

Просмотреть файл

@ -22,6 +22,7 @@
#include "prenv.h"
#include "nsIDocShellTreeItem.h"
#include "nsIURI.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/HTMLBodyElement.h"
#include "mozilla/dom/Selection.h"
@ -164,13 +165,13 @@ static void LogDocState(dom::Document* aDocumentNode) {
}
static void LogPresShell(dom::Document* aDocumentNode) {
nsIPresShell* ps = aDocumentNode->GetShell();
printf("presshell: %p", static_cast<void*>(ps));
PresShell* presShell = aDocumentNode->GetPresShell();
printf("presshell: %p", static_cast<void*>(presShell));
nsIScrollableFrame* sf = nullptr;
if (ps) {
printf(", is %s destroying", (ps->IsDestroying() ? "" : "not"));
sf = ps->GetRootScrollFrameAsScrollable();
if (presShell) {
printf(", is %s destroying", (presShell->IsDestroying() ? "" : "not"));
sf = presShell->GetRootScrollFrameAsScrollable();
}
printf(", root scroll frame: %p", static_cast<void*>(sf));
}

Просмотреть файл

@ -72,6 +72,7 @@
#include "mozilla/dom/EventTarget.h"
#include "mozilla/dom/HTMLTableElement.h"
#include "mozilla/Preferences.h"
#include "mozilla/PresShell.h"
#include "mozilla/Services.h"
#include "nsDeckFrame.h"
@ -372,9 +373,9 @@ class PluginTimerCallBack final : public nsITimerCallback, public nsINamed {
NS_IMETHOD Notify(nsITimer* aTimer) final {
if (!mContent->IsInUncomposedDoc()) return NS_OK;
nsIPresShell* ps = mContent->OwnerDoc()->GetShell();
if (ps) {
DocAccessible* doc = ps->GetDocAccessible();
PresShell* presShell = mContent->OwnerDoc()->GetPresShell();
if (presShell) {
DocAccessible* doc = presShell->GetDocAccessible();
if (doc) {
// Make sure that if we created an accessible for the plugin that wasn't
// a plugin accessible we remove it before creating the right

Просмотреть файл

@ -14,7 +14,6 @@
#include "nsXULElement.h"
#include "nsIDocShell.h"
#include "nsIObserverService.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsIScrollableFrame.h"
#include "nsISelectionController.h"
@ -24,6 +23,7 @@
#include "mozilla/EventListenerManager.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/PresShell.h"
#include "mozilla/TouchEvents.h"
#include "nsView.h"
#include "nsGkAtoms.h"
@ -70,8 +70,10 @@ void nsCoreUtils::DispatchClickEvent(XULTreeElement *aTree, int32_t aRowIndex,
Document *document = tcElm->GetUncomposedDoc();
if (!document) return;
nsCOMPtr<nsIPresShell> presShell = document->GetShell();
if (!presShell) return;
RefPtr<PresShell> presShell = document->GetPresShell();
if (!presShell) {
return;
}
// Ensure row is visible.
aTree->EnsureRowIsVisible(aRowIndex);

Просмотреть файл

@ -7,11 +7,11 @@
#define nsCoreUtils_h_
#include "mozilla/EventForwards.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/Element.h"
#include "nsIAccessibleEvent.h"
#include "nsIContent.h"
#include "mozilla/dom/Document.h" // for GetShell()
#include "nsIPresShell.h"
#include "mozilla/dom/Document.h" // for GetPresShell()
#include "nsPoint.h"
#include "nsTArray.h"
@ -213,7 +213,7 @@ class nsCoreUtils {
* Return presShell for the document containing the given DOM node.
*/
static nsIPresShell *GetPresShellFor(nsINode *aNode) {
return aNode->OwnerDoc()->GetShell();
return aNode->OwnerDoc()->GetPresShell();
}
/**

Просмотреть файл

@ -30,7 +30,6 @@
#include "nsIInterfaceRequestorUtils.h"
#include "nsImageFrame.h"
#include "nsIPersistentProperties2.h"
#include "nsIPresShell.h"
#include "nsIServiceManager.h"
#include "nsViewManager.h"
#include "nsIScrollableFrame.h"
@ -43,6 +42,7 @@
#include "mozilla/EventStateManager.h"
#include "mozilla/EventStates.h"
#include "mozilla/HTMLEditor.h"
#include "mozilla/PresShell.h"
#include "mozilla/TextEditor.h"
#include "mozilla/dom/TabChild.h"
#include "mozilla/dom/DocumentType.h"
@ -466,8 +466,10 @@ nsRect DocAccessible::RelativeBounds(nsIFrame** aRelativeFrame) const {
nsRect bounds;
while (document) {
nsIPresShell* presShell = document->GetShell();
if (!presShell) return nsRect();
mozilla::PresShell* presShell = document->GetPresShell();
if (!presShell) {
return nsRect();
}
nsRect scrollPort;
nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollable();

Просмотреть файл

@ -24,8 +24,6 @@ XPCOMUtils.defineLazyGetter(this, "gPipNSSBundle", function() {
XPCOMUtils.defineLazyGetter(this, "gBrandBundle", function() {
return Services.strings.createBundle("chrome://branding/locale/brand.properties");
});
XPCOMUtils.defineLazyPreferenceGetter(this, "newErrorPagesEnabled",
"browser.security.newcerterrorpage.enabled");
XPCOMUtils.defineLazyPreferenceGetter(this, "mitmErrorPageEnabled",
"browser.security.newcerterrorpage.mitm.enabled");
XPCOMUtils.defineLazyPreferenceGetter(this, "mitmPrimingEnabled",
@ -128,7 +126,7 @@ class NetErrorChild extends ActorChild {
if (input.data.certIsUntrusted) {
switch (input.data.code) {
case MOZILLA_PKIX_ERROR_MITM_DETECTED:
if (newErrorPagesEnabled && mitmErrorPageEnabled) {
if (mitmErrorPageEnabled) {
let brandName = gBrandBundle.GetStringFromName("brandShortName");
msg1 = gPipNSSBundle.GetStringFromName("certErrorMitM");
msg1 += "\n\n";
@ -141,17 +139,11 @@ class NetErrorChild extends ActorChild {
// If the condition is false, fall through...
case SEC_ERROR_UNKNOWN_ISSUER:
let brandName = gBrandBundle.GetStringFromName("brandShortName");
if (newErrorPagesEnabled) {
msg1 = "";
msg1 += gPipNSSBundle.formatStringFromName("certErrorTrust_UnknownIssuer4", [hostString], 1);
msg1 += "\n\n";
msg1 += gPipNSSBundle.formatStringFromName("certErrorTrust_UnknownIssuer6", [brandName, hostString], 2);
msg1 += "\n\n";
} else {
msg1 += gPipNSSBundle.GetStringFromName("certErrorTrust_UnknownIssuer") + "\n";
msg1 += gPipNSSBundle.GetStringFromName("certErrorTrust_UnknownIssuer2") + "\n";
msg1 += gPipNSSBundle.GetStringFromName("certErrorTrust_UnknownIssuer3") + "\n";
}
msg1 = "";
msg1 += gPipNSSBundle.formatStringFromName("certErrorTrust_UnknownIssuer4", [hostString], 1);
msg1 += "\n\n";
msg1 += gPipNSSBundle.formatStringFromName("certErrorTrust_UnknownIssuer6", [brandName, hostString], 2);
msg1 += "\n\n";
break;
case SEC_ERROR_CA_CERT_INVALID:
msg1 += gPipNSSBundle.GetStringFromName("certErrorTrust_CaInvalid") + "\n";
@ -190,14 +182,10 @@ class NetErrorChild extends ActorChild {
let msgPrefix = "";
if (numSubjectAltNames != 0) {
if (numSubjectAltNames == 1) {
if (newErrorPagesEnabled) {
technicalInfo.textContent = "";
let brandName = gBrandBundle.GetStringFromName("brandShortName");
msgPrefix = gPipNSSBundle.formatStringFromName("certErrorMismatchSinglePrefix3", [brandName, hostString], 2) + " ";
msgPrefix += gPipNSSBundle.GetStringFromName("certErrorMismatchSinglePrefix");
} else {
msgPrefix = gPipNSSBundle.GetStringFromName("certErrorMismatchSinglePrefix");
}
technicalInfo.textContent = "";
let brandName = gBrandBundle.GetStringFromName("brandShortName");
msgPrefix = gPipNSSBundle.formatStringFromName("certErrorMismatchSinglePrefix3", [brandName, hostString], 2) + " ";
msgPrefix += gPipNSSBundle.GetStringFromName("certErrorMismatchSinglePrefix");
// Let's check if we want to make this a link.
let okHost = input.data.certSubjectAltNames;
let href = "";
@ -264,13 +252,9 @@ class NetErrorChild extends ActorChild {
technicalInfo.append("\n");
} else {
let msg = "";
if (newErrorPagesEnabled) {
technicalInfo.textContent = "";
let brandName = gBrandBundle.GetStringFromName("brandShortName");
msg = gPipNSSBundle.formatStringFromName("certErrorMismatchMultiple3", [brandName, hostString], 2) + " ";
} else {
msg = gPipNSSBundle.GetStringFromName("certErrorMismatchMultiple") + "\n";
}
technicalInfo.textContent = "";
let brandName = gBrandBundle.GetStringFromName("brandShortName");
msg = gPipNSSBundle.formatStringFromName("certErrorMismatchMultiple3", [brandName, hostString], 2) + " ";
for (let i = 0; i < numSubjectAltNames; i++) {
msg += subjectAltNames[i];
if (i != (numSubjectAltNames - 1)) {
@ -281,61 +265,34 @@ class NetErrorChild extends ActorChild {
}
} else {
let msg = "";
if (newErrorPagesEnabled) {
technicalInfo.textContent = "";
let brandName = gBrandBundle.GetStringFromName("brandShortName");
msg = gPipNSSBundle.formatStringFromName("certErrorMismatch3", [brandName, hostString], 2) + " ";
} else {
msg = gPipNSSBundle.formatStringFromName("certErrorMismatch",
[hostString], 1);
}
technicalInfo.textContent = "";
let brandName = gBrandBundle.GetStringFromName("brandShortName");
msg = gPipNSSBundle.formatStringFromName("certErrorMismatch3", [brandName, hostString], 2) + " ";
technicalInfo.append(msg + "\n");
}
}
if (input.data.isNotValidAtThisTime) {
let nowTime = new Date().getTime() * 1000;
let dateOptions = { year: "numeric", month: "long", day: "numeric", hour: "numeric", minute: "numeric" };
let now = new Services.intl.DateTimeFormat(undefined, dateOptions).format(new Date());
let msg = "";
if (input.data.validity.notBefore) {
if (nowTime > input.data.validity.notAfter) {
if (newErrorPagesEnabled) {
technicalInfo.textContent = "";
msg += gPipNSSBundle.formatStringFromName("certErrorExpiredNow2",
[hostString], 1);
msg += "\n";
} else {
msg += gPipNSSBundle.formatStringFromName("certErrorExpiredNow",
[input.data.validity.notAfterLocalTime, now], 2);
msg += "\n";
}
technicalInfo.textContent = "";
msg += gPipNSSBundle.formatStringFromName("certErrorExpiredNow2",
[hostString], 1);
msg += "\n";
} else {
// eslint-disable-next-line no-lonely-if
if (newErrorPagesEnabled) {
technicalInfo.textContent = "";
msg += gPipNSSBundle.formatStringFromName("certErrorNotYetValidNow2",
[hostString], 1);
msg += "\n";
} else {
msg += gPipNSSBundle.formatStringFromName("certErrorNotYetValidNow",
[input.data.validity.notBeforeLocalTime, now], 2);
msg += "\n";
}
technicalInfo.textContent = "";
msg += gPipNSSBundle.formatStringFromName("certErrorNotYetValidNow2",
[hostString], 1);
msg += "\n";
}
} else {
// If something goes wrong, we assume the cert expired.
// eslint-disable-next-line no-lonely-if
if (newErrorPagesEnabled) {
technicalInfo.textContent = "";
msg += gPipNSSBundle.formatStringFromName("certErrorExpiredNow2",
[hostString], 1);
msg += "\n";
} else {
msg += gPipNSSBundle.formatStringFromName("certErrorExpiredNow",
["", now], 2);
msg += "\n";
}
// If something goes wrong, we assume the cert expired.
technicalInfo.textContent = "";
msg += gPipNSSBundle.formatStringFromName("certErrorExpiredNow2",
[hostString], 1);
msg += "\n";
}
technicalInfo.append(msg);
}
@ -387,8 +344,7 @@ class NetErrorChild extends ActorChild {
// Check if the connection is being man-in-the-middled. When the parent
// detects an intercepted connection, the page may be reloaded with a new
// error code (MOZILLA_PKIX_ERROR_MITM_DETECTED).
if (newErrorPagesEnabled && mitmPrimingEnabled &&
msg.data.code == SEC_ERROR_UNKNOWN_ISSUER &&
if (mitmPrimingEnabled && msg.data.code == SEC_ERROR_UNKNOWN_ISSUER &&
// Only do this check for top-level failures.
doc.ownerGlobal.top === doc.ownerGlobal) {
this.mm.sendAsyncMessage("Browser:PrimeMitm");
@ -433,9 +389,6 @@ class NetErrorChild extends ActorChild {
case SSL_ERROR_BAD_CERT_DOMAIN:
case SEC_ERROR_OCSP_INVALID_SIGNING_CERT:
case SEC_ERROR_UNKNOWN_ISSUER:
if (!newErrorPagesEnabled) {
break;
}
if (es) {
// eslint-disable-next-line no-unsanitized/property
es.innerHTML = errWhatToDo.innerHTML;
@ -468,7 +421,7 @@ class NetErrorChild extends ActorChild {
updateContainerPosition();
break;
case MOZILLA_PKIX_ERROR_MITM_DETECTED:
if (newErrorPagesEnabled && mitmErrorPageEnabled) {
if (mitmErrorPageEnabled) {
let autoEnabledEnterpriseRoots =
Services.prefs.getBoolPref("security.enterprise_roots.auto-enabled", false);
if (mitmPrimingEnabled && autoEnabledEnterpriseRoots) {
@ -575,9 +528,7 @@ class NetErrorChild extends ActorChild {
.textContent = formatter.format(systemDate);
}
}
if (!newErrorPagesEnabled) {
break;
}
let systemDate = formatter.format(new Date());
doc.getElementById("wrongSystemTime_systemDate1").textContent = systemDate;
if (clockSkew) {
@ -640,18 +591,16 @@ class NetErrorChild extends ActorChild {
// Add slightly more alarming UI unless there are indicators that
// show that the error is harmless or can not be skipped anyway.
if (newErrorPagesEnabled) {
let {cssClass} = this.getParams(doc);
// Don't alarm users when they can't continue to the website anyway...
if (cssClass != "badStsCert" &&
// Errors in iframes can't be skipped either...
doc.ownerGlobal.parent == doc.ownerGlobal &&
// Also don't bother if it's just the user's clock being off...
!clockSkew &&
// Symantec distrust is likely harmless as well.
msg.data.code != MOZILLA_PKIX_ERROR_ADDITIONAL_POLICY_CONSTRAINT_FAILED) {
doc.body.classList.add("caution");
}
let {cssClass} = this.getParams(doc);
// Don't alarm users when they can't continue to the website anyway...
if (cssClass != "badStsCert" &&
// Errors in iframes can't be skipped either...
doc.ownerGlobal.parent == doc.ownerGlobal &&
// Also don't bother if it's just the user's clock being off...
!clockSkew &&
// Symantec distrust is likely harmless as well.
msg.data.code != MOZILLA_PKIX_ERROR_ADDITIONAL_POLICY_CONSTRAINT_FAILED) {
doc.body.classList.add("caution");
}
}

Просмотреть файл

@ -968,9 +968,6 @@ pref("app.productInfo.baseURL", "https://www.mozilla.org/firefox/features/");
// Name of alternate about: page for certificate errors (when undefined, defaults to about:neterror)
pref("security.alternate_certificate_error_page", "certerror");
// Enable the new certificate error pages.
pref("browser.security.newcerterrorpage.enabled", true);
pref("browser.security.newcerterrorpage.mitm.enabled", true);
pref("security.certerrors.recordEventTelemetry", true);
pref("security.certerrors.permanentOverride", true);

Просмотреть файл

@ -17,6 +17,7 @@
#include "mozilla/Maybe.h"
#include "mozilla/SafeMode.h"
#include "mozilla/UniquePtr.h"
#include "mozilla/WindowsConsole.h"
#include "mozilla/WindowsVersion.h"
#include "mozilla/WinHeaderOnlyUtils.h"
#include "nsWindowsHelpers.h"
@ -219,6 +220,8 @@ Maybe<int> LauncherMain(int& argc, wchar_t* argv[],
}
}
mozilla::UseParentConsole();
if (!SetArgv0ToFullBinaryPath(argv)) {
HandleLauncherError(LAUNCHER_ERROR_GENERIC());
return Nothing();

Просмотреть файл

@ -31,6 +31,7 @@ TEST_DIRS += [
if CONFIG['MOZ_LAUNCHER_PROCESS']:
UNIFIED_SOURCES += [
'/toolkit/xre/LauncherRegistryInfo.cpp',
'/widget/windows/WindowsConsole.cpp',
]
for var in ('MOZ_APP_BASENAME', 'MOZ_APP_VENDOR'):
DEFINES[var] = '"%s"' % CONFIG[var]

Просмотреть файл

@ -1,237 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html [
<!ENTITY % htmlDTD
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"DTD/xhtml1-strict.dtd">
%htmlDTD;
<!ENTITY % netErrorDTD
SYSTEM "chrome://browser/locale/netError.dtd">
%netErrorDTD;
<!ENTITY % globalDTD
SYSTEM "chrome://global/locale/global.dtd">
%globalDTD;
]>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Security-Policy" content="default-src chrome:" />
<title>&loadError.label;</title>
<link rel="stylesheet" href="chrome://browser/skin/aboutNetError-new.css" type="text/css" media="all" />
<!-- If the location of the favicon is changed here, the FAVICON_ERRORPAGE_URL symbol in
toolkit/components/places/src/nsFaviconService.h should be updated. -->
<link rel="icon" id="favicon" href="chrome://global/skin/icons/warning.svg"/>
</head>
<body data-new-error-pages-enabled="true" dir="&locale.dir;">
<!-- ERROR ITEM CONTAINER (removed during loading to avoid bug 39098) -->
<div id="errorContainer">
<div id="errorPageTitlesContainer">
<span id="ept_nssBadCert">&certerror.pagetitle2;</span>
<span id="ept_nssBadCert_sts">&certerror.sts.pagetitle;</span>
<span id="ept_captivePortal">&captivePortal.title;</span>
<span id="ept_dnsNotFound">&dnsNotFound.pageTitle;</span>
<span id="ept_malformedURI">&malformedURI.pageTitle;</span>
<span id="ept_blockedByPolicy">&blockedByPolicy.title;</span>
</div>
<div id="errorTitlesContainer">
<h1 id="et_generic">&generic.title;</h1>
<h1 id="et_captivePortal">&captivePortal.title;</h1>
<h1 id="et_dnsNotFound">&dnsNotFound.title1;</h1>
<h1 id="et_fileNotFound">&fileNotFound.title;</h1>
<h1 id="et_fileAccessDenied">&fileAccessDenied.title;</h1>
<h1 id="et_malformedURI">&malformedURI.title1;</h1>
<h1 id="et_unknownProtocolFound">&unknownProtocolFound.title;</h1>
<h1 id="et_connectionFailure">&connectionFailure.title;</h1>
<h1 id="et_netTimeout">&netTimeout.title;</h1>
<h1 id="et_redirectLoop">&redirectLoop.title;</h1>
<h1 id="et_unknownSocketType">&unknownSocketType.title;</h1>
<h1 id="et_netReset">&netReset.title;</h1>
<h1 id="et_notCached">&notCached.title;</h1>
<h1 id="et_netOffline">&netOffline.title;</h1>
<h1 id="et_netInterrupt">&netInterrupt.title;</h1>
<h1 id="et_deniedPortAccess">&deniedPortAccess.title;</h1>
<h1 id="et_proxyResolveFailure">&proxyResolveFailure.title;</h1>
<h1 id="et_proxyConnectFailure">&proxyConnectFailure.title;</h1>
<h1 id="et_contentEncodingError">&contentEncodingError.title;</h1>
<h1 id="et_unsafeContentType">&unsafeContentType.title;</h1>
<h1 id="et_nssFailure2">&nssFailure2.title;</h1>
<h1 id="et_nssBadCert">&certerror.longpagetitle2;</h1>
<h1 id="et_nssBadCert_sts">&certerror.sts.longpagetitle;</h1>
<h1 id="et_cspBlocked">&cspBlocked.title;</h1>
<h1 id="et_remoteXUL">&remoteXUL.title;</h1>
<h1 id="et_corruptedContentErrorv2">&corruptedContentErrorv2.title;</h1>
<h1 id="et_sslv3Used">&sslv3Used.title;</h1>
<h1 id="et_inadequateSecurityError">&inadequateSecurityError.title;</h1>
<h1 id="et_blockedByPolicy">&blockedByPolicy.title;</h1>
<h1 id="et_mitm">&certerror.mitm.title;</h1>
<h1 id="et_clockSkewError">&clockSkewError.title;</h1>
<h1 id="et_networkProtocolError">&networkProtocolError.title;</h1>
</div>
<div id="errorDescriptionsContainer">
<div id="ed_generic">&generic.longDesc;</div>
<div id="ed_captivePortal">&captivePortal.longDesc2;</div>
<div id="ed_dnsNotFound">&dnsNotFound.longDesc1;</div>
<div id="ed_fileNotFound">&fileNotFound.longDesc;</div>
<div id="ed_fileAccessDenied">&fileAccessDenied.longDesc;</div>
<div id="ed_malformedURI"></div>
<div id="ed_unknownProtocolFound">&unknownProtocolFound.longDesc;</div>
<div id="ed_connectionFailure">&connectionFailure.longDesc;</div>
<div id="ed_netTimeout">&netTimeout.longDesc;</div>
<div id="ed_redirectLoop">&redirectLoop.longDesc;</div>
<div id="ed_unknownSocketType">&unknownSocketType.longDesc;</div>
<div id="ed_netReset">&netReset.longDesc;</div>
<div id="ed_notCached">&notCached.longDesc;</div>
<div id="ed_netOffline">&netOffline.longDesc2;</div>
<div id="ed_netInterrupt">&netInterrupt.longDesc;</div>
<div id="ed_deniedPortAccess">&deniedPortAccess.longDesc;</div>
<div id="ed_proxyResolveFailure">&proxyResolveFailure.longDesc;</div>
<div id="ed_proxyConnectFailure">&proxyConnectFailure.longDesc;</div>
<div id="ed_contentEncodingError">&contentEncodingError.longDesc;</div>
<div id="ed_unsafeContentType">&unsafeContentType.longDesc;</div>
<div id="ed_nssFailure2">&nssFailure2.longDesc2;</div>
<div id="ed_nssBadCert">&certerror.introPara2;</div>
<div id="ed_nssBadCert_sts">&certerror.sts.introPara;</div>
<div id="ed_nssBadCert_SEC_ERROR_EXPIRED_CERTIFICATE">&certerror.expiredCert.introPara;</div>
<div id="ed_mitm">&certerror.mitm.longDesc;</div>
<div id="ed_cspBlocked">&cspBlocked.longDesc;</div>
<div id="ed_remoteXUL">&remoteXUL.longDesc;</div>
<div id="ed_corruptedContentErrorv2">&corruptedContentErrorv2.longDesc;</div>
<div id="ed_sslv3Used">&sslv3Used.longDesc2;</div>
<div id="ed_inadequateSecurityError">&inadequateSecurityError.longDesc;</div>
<div id="ed_blockedByPolicy"></div>
<div id="ed_clockSkewError">&clockSkewError.longDesc;</div>
<div id="ed_networkProtocolError">&networkProtocolError.longDesc;</div>
</div>
<div id="errorDescriptions2Container">
<div id="ed2_nssBadCert_SEC_ERROR_EXPIRED_CERTIFICATE">&certerror.expiredCert.secondPara2;</div>
<div id="ed2_nssBadCert_SEC_ERROR_EXPIRED_CERTIFICATE_sts">&certerror.expiredCert.sts.secondPara;</div>
</div>
<div id="whatCanYouDoAboutItTitleContainer">
<div id="edd_nssBadCert"><strong>&certerror.whatCanYouDoAboutItTitle;</strong></div>
</div>
<div id="whatCanYouDoAboutItContainer">
<div id="es_nssBadCert_SEC_ERROR_UNKNOWN_ISSUER">&certerror.unknownIssuer.whatCanYouDoAboutIt;</div>
<div id="es_nssBadCert_SEC_ERROR_EXPIRED_CERTIFICATE">&certerror.expiredCert.whatCanYouDoAboutIt2;</div>
<div id="es_nssBadCert_SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE">&certerror.expiredCert.whatCanYouDoAboutIt2;</div>
<div id="es_nssBadCert_MOZILLA_PKIX_ERROR_NOT_YET_VALID_CERTIFICATE">&certerror.expiredCert.whatCanYouDoAboutIt2;</div>
<div id="es_nssBadCert_MOZILLA_PKIX_ERROR_NOT_YET_VALID_ISSUER_CERTIFICATE">&certerror.expiredCert.whatCanYouDoAboutIt2;</div>
<div id="es_nssBadCert_SSL_ERROR_BAD_CERT_DOMAIN">&certerror.badCertDomain.whatCanYouDoAboutIt;</div>
<div id="es_nssBadCert_MOZILLA_PKIX_ERROR_MITM_DETECTED">
<ul>
<li>&certerror.mitm.whatCanYouDoAboutIt1;</li>
<li>&certerror.mitm.whatCanYouDoAboutIt2;</li>
<li id="mitmWhatCanYouDoAboutIt3">&certerror.mitm.whatCanYouDoAboutIt3;</li>
</ul>
</div>
</div>
<!-- Stores an alternative text for when we don't want to add "Recommended" to the
return button. This is one of many l10n atrocities in this file and should be
removed when we finally switch to Fluent. -->
<span id="stsReturnButtonText">&returnToPreviousPage.label;</span>
<span id="stsMitmWhatCanYouDoAboutIt3">&certerror.mitm.sts.whatCanYouDoAboutIt3;</span>
</div>
<!-- PAGE CONTAINER (for styling purposes only) -->
<div id="errorPageContainer" class="container">
<div id="text-container">
<!-- Error Title -->
<div class="title">
<h1 class="title-text"/>
</div>
<!-- LONG CONTENT (the section most likely to require scrolling) -->
<div id="errorLongContent">
<!-- Short Description -->
<div id="errorShortDesc">
<p id="errorShortDescText" />
</div>
<div id="errorShortDesc2">
<p id="errorShortDescText2" />
</div>
<div id="errorWhatToDoTitle">
<p id="errorWhatToDoTitleText" />
</div>
<div id="errorWhatToDo">
<p id="badStsCertExplanation" hidden="true">&certerror.whatShouldIDo.badStsCertExplanation1;</p>
<p id="errorWhatToDoText" />
</div>
<div id="errorWhatToDo2">
<p id="errorWhatToDoText2" />
<p id="badStsCertExplanation" hidden="true">&certerror.whatShouldIDo.badStsCertExplanation1;</p>
</div>
<div id="wrongSystemTimePanel">
&certerror.wrongSystemTime2;
</div>
<div id="wrongSystemTimeWithoutReferencePanel">
&certerror.wrongSystemTimeWithoutReference;
</div>
<!-- Long Description (Note: See netError.dtd for used XHTML tags) -->
<div id="errorLongDesc" />
<div id="learnMoreContainer">
<p><a id="learnMoreLink" target="new" data-telemetry-id="learn_more_link">&errorReporting.learnMore;</a></p>
</div>
</div>
<!-- UI for option to report certificate errors to Mozilla. Removed on
init for other error types .-->
<div id="prefChangeContainer" class="button-container">
<p>&prefReset.longDesc;</p>
<button id="prefResetButton" class="primary">&prefReset.label;</button>
</div>
<div id="certErrorAndCaptivePortalButtonContainer" class="button-container">
<button id="returnButton" class="primary" data-telemetry-id="return_button_top">&returnToPreviousPage1.label;</button>
<button id="openPortalLoginPageButton" class="primary">&openPortalLoginPage.label2;</button>
<button id="errorTryAgain" class="primary">&retry.label;</button>
<button id="advancedButton" data-telemetry-id="advanced_button">&advanced2.label;</button>
</div>
</div>
<div id="netErrorButtonContainer" class="button-container">
<button id="errorTryAgain" class="primary">&retry.label;</button>
</div>
<div id="advancedPanelContainer">
<div id="badCertAdvancedPanel" class="advanced-panel">
<p id="badCertTechnicalInfo"/>
<a id="viewCertificate" href="javascript:void(0)">&viewCertificate.label;</a>
<div id="advancedPanelButtonContainer" class="button-container">
<button id="advancedPanelReturnButton" class="primary" data-telemetry-id="return_button_adv">&returnToPreviousPage1.label;</button>
<button id="advancedPanelErrorTryAgain" class="primary">&retry.label;</button>
<div class="exceptionDialogButtonContainer">
<button id="exceptionDialogButton" data-telemetry-id="exception_button">&securityOverride.exceptionButton1Label;</button>
</div>
</div>
</div>
<div id="certificateErrorReporting">
<p class="toggle-container-with-text">
<input type="checkbox" id="automaticallyReportInFuture" role="checkbox" data-telemetry-id="auto_report_cb"/>
<label for="automaticallyReportInFuture">&errorReporting.automatic2;</label>
</p>
</div>
<div id="certificateErrorDebugInformation">
<button id="copyToClipboard" data-telemetry-id="clipboard_button_top">&certerror.copyToClipboard.label;</button>
<div id="certificateErrorText"/>
<button id="copyToClipboard" data-telemetry-id="clipboard_button_bot">&certerror.copyToClipboard.label;</button>
</div>
</div>
</div>
</body>
<script type="application/javascript" src="chrome://browser/content/aboutNetError.js"/>
</html>

Просмотреть файл

@ -15,7 +15,6 @@ let searchParams = new URLSearchParams(document.documentURI.split("?")[1]);
// Set to true on init if the error code is nssBadCert.
let gIsCertError;
let gNewErrorPagesEnabled;
function getErrorCode() {
return searchParams.get("e");
@ -129,16 +128,14 @@ function disallowCertOverridesIfNeeded() {
if (cssClass == "badStsCert") {
document.getElementById("badStsCertExplanation").removeAttribute("hidden");
if (gNewErrorPagesEnabled) {
let stsReturnButtonText = document.getElementById("stsReturnButtonText").textContent;
document.getElementById("returnButton").textContent = stsReturnButtonText;
document.getElementById("advancedPanelReturnButton").textContent = stsReturnButtonText;
let stsReturnButtonText = document.getElementById("stsReturnButtonText").textContent;
document.getElementById("returnButton").textContent = stsReturnButtonText;
document.getElementById("advancedPanelReturnButton").textContent = stsReturnButtonText;
let stsMitmWhatCanYouDoAboutIt3 =
document.getElementById("stsMitmWhatCanYouDoAboutIt3").innerHTML;
// eslint-disable-next-line no-unsanitized/property
document.getElementById("mitmWhatCanYouDoAboutIt3").innerHTML = stsMitmWhatCanYouDoAboutIt3;
}
let stsMitmWhatCanYouDoAboutIt3 =
document.getElementById("stsMitmWhatCanYouDoAboutIt3").innerHTML;
// eslint-disable-next-line no-unsanitized/property
document.getElementById("mitmWhatCanYouDoAboutIt3").innerHTML = stsMitmWhatCanYouDoAboutIt3;
}
}
@ -157,7 +154,6 @@ function initPage() {
}
gIsCertError = (err == "nssBadCert");
gNewErrorPagesEnabled = !!document.body.dataset.newErrorPagesEnabled;
// Only worry about captive portals if this is a cert error.
let showCaptivePortalUI = isCaptive() && gIsCertError;
if (showCaptivePortalUI) {
@ -170,7 +166,7 @@ function initPage() {
document.body.classList.add(className);
}
if (gNewErrorPagesEnabled && gIsCertError && (window !== window.top || className == "badStsCert")) {
if (gIsCertError && (window !== window.top || className == "badStsCert")) {
l10nErrId += "_sts";
}

Просмотреть файл

@ -31,7 +31,8 @@
<!-- ERROR ITEM CONTAINER (removed during loading to avoid bug 39098) -->
<div id="errorContainer">
<div id="errorPageTitlesContainer">
<span id="ept_nssBadCert">&certerror.pagetitle1;</span>
<span id="ept_nssBadCert">&certerror.pagetitle2;</span>
<span id="ept_nssBadCert_sts">&certerror.sts.pagetitle;</span>
<span id="ept_captivePortal">&captivePortal.title;</span>
<span id="ept_dnsNotFound">&dnsNotFound.pageTitle;</span>
<span id="ept_malformedURI">&malformedURI.pageTitle;</span>
@ -59,13 +60,16 @@
<h1 id="et_contentEncodingError">&contentEncodingError.title;</h1>
<h1 id="et_unsafeContentType">&unsafeContentType.title;</h1>
<h1 id="et_nssFailure2">&nssFailure2.title;</h1>
<h1 id="et_nssBadCert">&certerror.longpagetitle1;</h1>
<h1 id="et_nssBadCert">&certerror.longpagetitle2;</h1>
<h1 id="et_nssBadCert_sts">&certerror.sts.longpagetitle;</h1>
<h1 id="et_cspBlocked">&cspBlocked.title;</h1>
<h1 id="et_remoteXUL">&remoteXUL.title;</h1>
<h1 id="et_corruptedContentErrorv2">&corruptedContentErrorv2.title;</h1>
<h1 id="et_sslv3Used">&sslv3Used.title;</h1>
<h1 id="et_inadequateSecurityError">&inadequateSecurityError.title;</h1>
<h1 id="et_blockedByPolicy">&blockedByPolicy.title;</h1>
<h1 id="et_mitm">&certerror.mitm.title;</h1>
<h1 id="et_clockSkewError">&clockSkewError.title;</h1>
<h1 id="et_networkProtocolError">&networkProtocolError.title;</h1>
</div>
<div id="errorDescriptionsContainer">
@ -90,15 +94,46 @@
<div id="ed_contentEncodingError">&contentEncodingError.longDesc;</div>
<div id="ed_unsafeContentType">&unsafeContentType.longDesc;</div>
<div id="ed_nssFailure2">&nssFailure2.longDesc2;</div>
<div id="ed_nssBadCert">&certerror.introPara;</div>
<div id="ed_nssBadCert">&certerror.introPara2;</div>
<div id="ed_nssBadCert_sts">&certerror.sts.introPara;</div>
<div id="ed_nssBadCert_SEC_ERROR_EXPIRED_CERTIFICATE">&certerror.expiredCert.introPara;</div>
<div id="ed_mitm">&certerror.mitm.longDesc;</div>
<div id="ed_cspBlocked">&cspBlocked.longDesc;</div>
<div id="ed_remoteXUL">&remoteXUL.longDesc;</div>
<div id="ed_corruptedContentErrorv2">&corruptedContentErrorv2.longDesc;</div>
<div id="ed_sslv3Used">&sslv3Used.longDesc2;</div>
<div id="ed_inadequateSecurityError">&inadequateSecurityError.longDesc;</div>
<div id="ed_blockedByPolicy"></div>
<div id="ed_clockSkewError">&clockSkewError.longDesc;</div>
<div id="ed_networkProtocolError">&networkProtocolError.longDesc;</div>
</div>
<div id="errorDescriptions2Container">
<div id="ed2_nssBadCert_SEC_ERROR_EXPIRED_CERTIFICATE">&certerror.expiredCert.secondPara2;</div>
<div id="ed2_nssBadCert_SEC_ERROR_EXPIRED_CERTIFICATE_sts">&certerror.expiredCert.sts.secondPara;</div>
</div>
<div id="whatCanYouDoAboutItTitleContainer">
<div id="edd_nssBadCert"><strong>&certerror.whatCanYouDoAboutItTitle;</strong></div>
</div>
<div id="whatCanYouDoAboutItContainer">
<div id="es_nssBadCert_SEC_ERROR_UNKNOWN_ISSUER">&certerror.unknownIssuer.whatCanYouDoAboutIt;</div>
<div id="es_nssBadCert_SEC_ERROR_EXPIRED_CERTIFICATE">&certerror.expiredCert.whatCanYouDoAboutIt2;</div>
<div id="es_nssBadCert_SEC_ERROR_EXPIRED_ISSUER_CERTIFICATE">&certerror.expiredCert.whatCanYouDoAboutIt2;</div>
<div id="es_nssBadCert_MOZILLA_PKIX_ERROR_NOT_YET_VALID_CERTIFICATE">&certerror.expiredCert.whatCanYouDoAboutIt2;</div>
<div id="es_nssBadCert_MOZILLA_PKIX_ERROR_NOT_YET_VALID_ISSUER_CERTIFICATE">&certerror.expiredCert.whatCanYouDoAboutIt2;</div>
<div id="es_nssBadCert_SSL_ERROR_BAD_CERT_DOMAIN">&certerror.badCertDomain.whatCanYouDoAboutIt;</div>
<div id="es_nssBadCert_MOZILLA_PKIX_ERROR_MITM_DETECTED">
<ul>
<li>&certerror.mitm.whatCanYouDoAboutIt1;</li>
<li>&certerror.mitm.whatCanYouDoAboutIt2;</li>
<li id="mitmWhatCanYouDoAboutIt3">&certerror.mitm.whatCanYouDoAboutIt3;</li>
</ul>
</div>
</div>
<!-- Stores an alternative text for when we don't want to add "Recommended" to the
return button. This is one of many l10n atrocities in this file and should be
removed when we finally switch to Fluent. -->
<span id="stsReturnButtonText">&returnToPreviousPage.label;</span>
<span id="stsMitmWhatCanYouDoAboutIt3">&certerror.mitm.sts.whatCanYouDoAboutIt3;</span>
</div>
<!-- PAGE CONTAINER (for styling purposes only) -->
@ -121,7 +156,19 @@
<p id="errorShortDescText2" />
</div>
<p id="badStsCertExplanation" hidden="true">&certerror.whatShouldIDo.badStsCertExplanation;</p>
<div id="errorWhatToDoTitle">
<p id="errorWhatToDoTitleText" />
</div>
<div id="errorWhatToDo">
<p id="badStsCertExplanation" hidden="true">&certerror.whatShouldIDo.badStsCertExplanation1;</p>
<p id="errorWhatToDoText" />
</div>
<div id="errorWhatToDo2">
<p id="errorWhatToDoText2" />
<p id="badStsCertExplanation" hidden="true">&certerror.whatShouldIDo.badStsCertExplanation1;</p>
</div>
<div id="wrongSystemTimePanel">
&certerror.wrongSystemTime2;
@ -135,28 +182,22 @@
<div id="errorLongDesc" />
<div id="learnMoreContainer">
<p><a href="https://support.mozilla.org/kb/what-does-your-connection-is-not-secure-mean" id="learnMoreLink" target="new" data-telemetry-id="learn_more_link">&errorReporting.learnMore;</a></p>
<p><a id="learnMoreLink" target="new" data-telemetry-id="learn_more_link">&errorReporting.learnMore;</a></p>
</div>
</div>
<!-- UI for option to report certificate errors to Mozilla. Removed on
init for other error types .-->
<div id="certificateErrorReporting">
<p class="toggle-container-with-text">
<input type="checkbox" id="automaticallyReportInFuture" role="checkbox" data-telemetry-id="auto_report_cb"/>
<label for="automaticallyReportInFuture" id="automaticallyReportInFuture">&errorReporting.automatic2;</label>
</p>
</div>
<div id="prefChangeContainer" class="button-container">
<p>&prefReset.longDesc;</p>
<button id="prefResetButton" class="primary">&prefReset.label;</button>
</div>
<div id="certErrorAndCaptivePortalButtonContainer" class="button-container">
<button id="returnButton" class="primary" data-telemetry-id="return_button_top">&returnToPreviousPage.label;</button>
<button id="returnButton" class="primary" data-telemetry-id="return_button_top">&returnToPreviousPage1.label;</button>
<button id="openPortalLoginPageButton" class="primary">&openPortalLoginPage.label2;</button>
<button id="advancedButton" data-telemetry-id="advanced_button">&advanced.label;</button>
<button id="errorTryAgain" class="primary">&retry.label;</button>
<button id="advancedButton" data-telemetry-id="advanced_button">&advanced2.label;</button>
</div>
</div>
@ -167,12 +208,21 @@
<div id="advancedPanelContainer">
<div id="badCertAdvancedPanel" class="advanced-panel">
<p id="badCertTechnicalInfo"/>
<a id="viewCertificate" href="javascript:void(0)">&viewCertificate.label;</a>
<div id="advancedPanelButtonContainer" class="button-container">
<button id="advancedPanelReturnButton" class="primary" data-telemetry-id="return_button_adv">&returnToPreviousPage1.label;</button>
<button id="advancedPanelErrorTryAgain" class="primary">&retry.label;</button>
<div class="exceptionDialogButtonContainer">
<button id="exceptionDialogButton" data-telemetry-id="exception_button">&securityOverride.exceptionButton1Label;</button>
</div>
</div>
<div class="exceptionDialogButtonContainer">
<button id="exceptionDialogButton" data-telemetry-id="exception_button">&securityOverride.exceptionButtonLabel;</button>
</div>
</div>
<div id="certificateErrorReporting">
<p class="toggle-container-with-text">
<input type="checkbox" id="automaticallyReportInFuture" role="checkbox" data-telemetry-id="auto_report_cb"/>
<label for="automaticallyReportInFuture">&errorReporting.automatic2;</label>
</p>
</div>
<div id="certificateErrorDebugInformation">

Просмотреть файл

@ -4,6 +4,7 @@
var Fingerprinting = {
PREF_ENABLED: "privacy.trackingprotection.fingerprinting.enabled",
reportBreakageLabel: "fingerprinting",
telemetryIdentifier: "fp",
strings: {
@ -116,6 +117,7 @@ var Fingerprinting = {
var Cryptomining = {
PREF_ENABLED: "privacy.trackingprotection.cryptomining.enabled",
reportBreakageLabel: "cryptomining",
telemetryIdentifier: "cm",
strings: {
@ -984,6 +986,8 @@ var ContentBlocking = {
body += `${ThirdPartyCookies.PREF_ENABLED}: ${Services.prefs.getIntPref(ThirdPartyCookies.PREF_ENABLED)}\n`;
body += `network.cookie.lifetimePolicy: ${Services.prefs.getIntPref("network.cookie.lifetimePolicy")}\n`;
body += `privacy.restrict3rdpartystorage.expiration: ${Services.prefs.getIntPref("privacy.restrict3rdpartystorage.expiration")}\n`;
body += `${Fingerprinting.PREF_ENABLED}: ${Services.prefs.getBoolPref(Fingerprinting.PREF_ENABLED)}\n`;
body += `${Cryptomining.PREF_ENABLED}: ${Services.prefs.getBoolPref(Cryptomining.PREF_ENABLED)}\n`;
let comments = document.getElementById("identity-popup-breakageReportView-collection-comments");
body += "\n**Comments**\n" + comments.value;

Просмотреть файл

@ -3180,52 +3180,28 @@ var BrowserOnClick = {
break;
case "exceptionDialogButton":
securityInfo = getSecurityInfo(securityInfoAsString);
let params = { exceptionAdded: false,
securityInfo };
if (Services.prefs.getBoolPref("browser.security.newcerterrorpage.enabled", false)) {
let overrideService = Cc["@mozilla.org/security/certoverride;1"]
.getService(Ci.nsICertOverrideService);
let flags = 0;
if (securityInfo.isUntrusted) {
flags |= overrideService.ERROR_UNTRUSTED;
}
if (securityInfo.isDomainMismatch) {
flags |= overrideService.ERROR_MISMATCH;
}
if (securityInfo.isNotValidAtThisTime) {
flags |= overrideService.ERROR_TIME;
}
let uri = Services.uriFixup.createFixupURI(location, 0);
let permanentOverride =
Services.prefs.getBoolPref("security.certerrors.permanentOverride");
cert = securityInfo.serverCert;
overrideService.rememberValidityOverride(
uri.asciiHost, uri.port,
cert,
flags,
!permanentOverride);
browser.reload();
return;
let overrideService = Cc["@mozilla.org/security/certoverride;1"]
.getService(Ci.nsICertOverrideService);
let flags = 0;
if (securityInfo.isUntrusted) {
flags |= overrideService.ERROR_UNTRUSTED;
}
try {
switch (Services.prefs.getIntPref("browser.ssl_override_behavior")) {
case 2 : // Pre-fetch & pre-populate
params.prefetchCert = true;
case 1 : // Pre-populate
params.location = location;
}
} catch (e) {
Cu.reportError("Couldn't get ssl_override pref: " + e);
if (securityInfo.isDomainMismatch) {
flags |= overrideService.ERROR_MISMATCH;
}
window.openDialog("chrome://pippki/content/exceptionDialog.xul",
"", "chrome,centerscreen,modal", params);
// If the user added the exception cert, attempt to reload the page
if (params.exceptionAdded) {
browser.reload();
if (securityInfo.isNotValidAtThisTime) {
flags |= overrideService.ERROR_TIME;
}
let uri = Services.uriFixup.createFixupURI(location, 0);
let permanentOverride =
Services.prefs.getBoolPref("security.certerrors.permanentOverride");
cert = securityInfo.serverCert;
overrideService.rememberValidityOverride(
uri.asciiHost, uri.port,
cert,
flags,
!permanentOverride);
browser.reload();
break;
case "returnButton":

Просмотреть файл

@ -125,69 +125,52 @@
<menupopup id="tabContextMenu"
onpopupshowing="if (event.target == this) TabContextMenu.updateContextMenu(this);"
onpopuphidden="if (event.target == this) TabContextMenu.contextTab = null;">
<menuitem id="context_reloadTab" label="&reloadTab.label;" accesskey="&reloadTab.accesskey;"
<menuitem id="context_reloadTab" data-lazy-l10n-id="reload-tab"
oncommand="gBrowser.reloadTab(TabContextMenu.contextTab);"/>
<menuitem id="context_reloadSelectedTabs" label="&reloadTabs.label;" hidden="true"
accesskey="&reloadTabs.accesskey;"
<menuitem id="context_reloadSelectedTabs" data-lazy-l10n-id="reload-tabs" hidden="true"
oncommand="gBrowser.reloadMultiSelectedTabs();"/>
<menuitem id="context_toggleMuteTab" oncommand="TabContextMenu.contextTab.toggleMuteAudio();"/>
<menuitem id="context_toggleMuteSelectedTabs" hidden="true"
oncommand="gBrowser.toggleMuteAudioOnMultiSelectedTabs(TabContextMenu.contextTab);"/>
<menuitem id="context_pinTab" label="&pinTab.label;"
accesskey="&pinTab.accesskey;"
<menuitem id="context_pinTab" data-lazy-l10n-id="pin-tab"
oncommand="gBrowser.pinTab(TabContextMenu.contextTab);"/>
<menuitem id="context_unpinTab" label="&unpinTab.label;" hidden="true"
accesskey="&unpinTab.accesskey;"
<menuitem id="context_unpinTab" data-lazy-l10n-id="unpin-tab" hidden="true"
oncommand="gBrowser.unpinTab(TabContextMenu.contextTab);"/>
<menuitem id="context_pinSelectedTabs" label="&pinSelectedTabs.label;" hidden="true"
accesskey="&pinSelectedTabs.accesskey;"
<menuitem id="context_pinSelectedTabs" data-lazy-l10n-id="pin-selected-tabs" hidden="true"
oncommand="gBrowser.pinMultiSelectedTabs();"/>
<menuitem id="context_unpinSelectedTabs" label="&unpinSelectedTabs.label;" hidden="true"
accesskey="&unpinSelectedTabs.accesskey;"
<menuitem id="context_unpinSelectedTabs" data-lazy-l10n-id="unpin-selected-tabs" hidden="true"
oncommand="gBrowser.unpinMultiSelectedTabs();"/>
<menuitem id="context_duplicateTab" label="&duplicateTab.label;"
accesskey="&duplicateTab.accesskey;"
<menuitem id="context_duplicateTab" data-lazy-l10n-id="duplicate-tab"
oncommand="duplicateTabIn(TabContextMenu.contextTab, 'tab');"/>
<menuitem id="context_duplicateTabs" label="&duplicateTabs.label;"
accesskey="&duplicateTabs.accesskey;"
<menuitem id="context_duplicateTabs" data-lazy-l10n-id="duplicate-tabs"
oncommand="TabContextMenu.duplicateSelectedTabs();"/>
<menuseparator/>
<menuitem id="context_selectAllTabs" label="&selectAllTabs.label;" accesskey="&selectAllTabs.accesskey;"
<menuitem id="context_selectAllTabs" data-lazy-l10n-id="select-all-tabs"
oncommand="gBrowser.selectAllTabs();"/>
<menuitem id="context_bookmarkSelectedTabs"
hidden="true"
label="&bookmarkSelectedTabs.label;"
accesskey="&bookmarkSelectedTabs.accesskey;"
data-lazy-l10n-id="bookmark-selected-tabs"
oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.uniqueSelectedPages);"/>
<menuitem id="context_bookmarkTab"
label="&bookmarkTab.label;"
accesskey="&bookmarkTab.accesskey;"
data-lazy-l10n-id="bookmark-tab"
oncommand="PlacesCommandHook.bookmarkPages(PlacesCommandHook.getUniquePages([TabContextMenu.contextTab]));"/>
<menu id="context_reopenInContainer"
label="&reopenInContainer.label;"
accesskey="&reopenInContainer.accesskey;"
data-lazy-l10n-id="reopen-in-container"
hidden="true">
<menupopup oncommand="TabContextMenu.reopenInContainer(event);"
onpopupshowing="TabContextMenu.createReopenInContainerMenu(event);"/>
</menu>
<menu id="context_moveTabOptions"
multiselectcontextlabel="&moveSelectedTabOptions.label;"
multiselectcontextaccesskey="&moveSelectedTabOptions.accesskey;"
nonmultiselectcontextlabel="&moveTabOptions.label;"
nonmultiselectcontextaccesskey="&moveTabOptions.accesskey;">
<menu id="context_moveTabOptions">
<menupopup id="moveTabOptionsMenu">
<menuitem id="context_moveToStart"
label="&moveToStart.label;"
accesskey="&moveToStart.accesskey;"
data-lazy-l10n-id="move-to-start"
tbattr="tabbrowser-multiple"
oncommand="gBrowser.moveTabsToStart(TabContextMenu.contextTab);"/>
<menuitem id="context_moveToEnd"
label="&moveToEnd.label;"
accesskey="&moveToEnd.accesskey;"
data-lazy-l10n-id="move-to-end"
tbattr="tabbrowser-multiple"
oncommand="gBrowser.moveTabsToEnd(TabContextMenu.contextTab);"/>
<menuitem id="context_openTabInWindow" label="&moveToNewWindow.label;"
accesskey="&moveToNewWindow.accesskey;"
<menuitem id="context_openTabInWindow" data-lazy-l10n-id="move-to-new-window"
tbattr="tabbrowser-multiple"
oncommand="gBrowser.replaceTabsWithWindow(TabContextMenu.contextTab);"/>
</menupopup>
@ -198,18 +181,17 @@
onpopupshowing="gSync.populateSendTabToDevicesMenu(event.target, TabContextMenu.contextTab.linkedBrowser.currentURI.spec, TabContextMenu.contextTab.linkedBrowser.contentTitle, TabContextMenu.contextTab.multiselected);"/>
</menu>
<menuseparator/>
<menuitem id="context_closeTabsToTheEnd" label="&closeTabsToTheEnd.label;" accesskey="&closeTabsToTheEnd.accesskey;"
<menuitem id="context_closeTabsToTheEnd" data-lazy-l10n-id="close-tabs-to-the-end"
oncommand="gBrowser.removeTabsToTheEndFrom(TabContextMenu.contextTab, {animate: true});"/>
<menuitem id="context_closeOtherTabs" label="&closeOtherTabs.label;" accesskey="&closeOtherTabs.accesskey;"
<menuitem id="context_closeOtherTabs" data-lazy-l10n-id="close-other-tabs"
oncommand="gBrowser.removeAllTabsBut(TabContextMenu.contextTab);"/>
<menuitem id="context_undoCloseTab"
label="&undoCloseTab.label;"
accesskey="&undoCloseTab.accesskey;"
data-lazy-l10n-id="undo-close-tab"
observes="History:UndoCloseTab"/>
<menuitem id="context_closeTab" label="&closeTab.label;" accesskey="&closeTab.accesskey;"
<menuitem id="context_closeTab" data-lazy-l10n-id="close-tab"
oncommand="gBrowser.removeTab(TabContextMenu.contextTab, { animate: true });"/>
<menuitem id="context_closeSelectedTabs" label="&closeTabs.label;"
hidden="true" accesskey="&closeTabs.accesskey;"
<menuitem id="context_closeSelectedTabs" data-lazy-l10n-id="close-tabs"
hidden="true"
oncommand="gBrowser.removeMultiSelectedTabs();"/>
</menupopup>

Просмотреть файл

@ -2,10 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
.tabbrowser-arrowscrollbox {
-moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-arrowscrollbox");
}
.tab-close-button[pinned],
#tabbrowser-tabs[closebuttons="activetab"] > .tabbrowser-tab > .tab-stack > .tab-content > .tab-close-button:not([selected="true"]),
.tab-icon-pending:not([pendingicon]),

Просмотреть файл

@ -4745,6 +4745,19 @@ window._gBrowser = {
SitePermissions.SCOPE_GLOBAL,
browser);
});
let tabContextFTLInserter = () => {
MozXULElement.insertFTLIfNeeded("browser/tabContextMenu.ftl");
// Un-lazify the l10n-ids now that the FTL file has been inserted.
document.getElementById("tabContextMenu").querySelectorAll("[data-lazy-l10n-id]").forEach(el => {
el.setAttribute("data-l10n-id", el.getAttribute("data-lazy-l10n-id"));
el.removeAttribute("data-lazy-l10n-id");
});
this.tabContainer.removeEventListener("mouseover", tabContextFTLInserter);
this.tabContainer.removeEventListener("focus", tabContextFTLInserter, true);
};
this.tabContainer.addEventListener("mouseover", tabContextFTLInserter);
this.tabContainer.addEventListener("focus", tabContextFTLInserter, true);
},
setSuccessor(aTab, successorTab) {
@ -5402,11 +5415,7 @@ var TabContextMenu = {
let contextMoveTabOptions = document.getElementById("context_moveTabOptions");
contextMoveTabOptions.disabled = gBrowser.allTabsSelected();
let moveTabOptionsStringPrefix = multiselectionContext ? "multiselectcontext" : "nonmultiselectcontext";
let moveTabOptionsLabel = contextMoveTabOptions.getAttribute(moveTabOptionsStringPrefix + "label");
let moveTabOptionsAccessKey = contextMoveTabOptions.getAttribute(moveTabOptionsStringPrefix + "accesskey");
contextMoveTabOptions.setAttribute("label", moveTabOptionsLabel);
contextMoveTabOptions.setAttribute("accesskey", moveTabOptionsAccessKey);
document.l10n.setAttributes(contextMoveTabOptions, multiselectionContext ? "move-tabs" : "move-tab");
let selectedTabs = gBrowser.selectedTabs;
let contextMoveTabToEnd = document.getElementById("context_moveToEnd");
let allSelectedTabsAdjacent = selectedTabs.every((element, index, array) => {

Просмотреть файл

@ -8,67 +8,6 @@
xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:xbl="http://www.mozilla.org/xbl">
<binding id="tabbrowser-arrowscrollbox" extends="chrome://global/content/bindings/scrollbox.xml#arrowscrollbox">
<implementation>
<!-- Override scrollbox.xml method, since our scrollbox's children are
inherited from the binding parent -->
<method name="_getScrollableElements">
<body><![CDATA[
return Array.filter(document.getBindingParent(this).children,
this._canScrollToElement, this);
]]></body>
</method>
<method name="_canScrollToElement">
<parameter name="tab"/>
<body><![CDATA[
return !tab._pinnedUnscrollable && !tab.hidden;
]]></body>
</method>
</implementation>
<handlers>
<handler event="underflow" phase="capturing"><![CDATA[
// Ignore underflow events:
// - from nested scrollable elements
// - for vertical orientation
// - corresponding to an overflow event that we ignored
let tabs = document.getBindingParent(this);
if (event.originalTarget != this.scrollbox ||
event.detail == 0 ||
!tabs.hasAttribute("overflow")) {
return;
}
tabs.removeAttribute("overflow");
if (tabs._lastTabClosedByMouse) {
tabs._expandSpacerBy(this._scrollButtonDown.clientWidth);
}
for (let tab of Array.from(gBrowser._removingTabs)) {
gBrowser.removeTab(tab);
}
tabs._positionPinnedTabs();
]]></handler>
<handler event="overflow"><![CDATA[
// Ignore overflow events:
// - from nested scrollable elements
// - for vertical orientation
if (event.originalTarget != this.scrollbox ||
event.detail == 0) {
return;
}
var tabs = document.getBindingParent(this);
tabs.setAttribute("overflow", "true");
tabs._positionPinnedTabs();
tabs._handleTabSelect(true);
]]></handler>
</handlers>
</binding>
<binding id="tabbrowser-tabs"
extends="chrome://global/content/bindings/tabbox.xml#tabs">
<content>
@ -141,6 +80,7 @@
CustomizableUI.addListener(this);
this._updateNewTabVisibility();
this._initializeArrowScrollbox();
XPCOMUtils.defineLazyPreferenceGetter(this, "_closeTabByDblclick",
"browser.tabs.closeTabByDblclick", false);
@ -196,6 +136,58 @@
</getter>
</property>
<method name="_initializeArrowScrollbox">
<body><![CDATA[
let arrowScrollbox = this.arrowScrollbox;
arrowScrollbox.addEventListener("underflow", event => {
// Ignore underflow events:
// - from nested scrollable elements
// - for vertical orientation
// - corresponding to an overflow event that we ignored
if (event.originalTarget != arrowScrollbox.scrollbox ||
event.detail == 0 ||
!this.hasAttribute("overflow")) {
return;
}
this.removeAttribute("overflow");
if (this._lastTabClosedByMouse) {
this._expandSpacerBy(this._scrollButtonDown.clientWidth);
}
for (let tab of Array.from(gBrowser._removingTabs)) {
gBrowser.removeTab(tab);
}
this._positionPinnedTabs();
}, true);
arrowScrollbox.addEventListener("overflow", event => {
// Ignore overflow events:
// - from nested scrollable elements
// - for vertical orientation
if (event.originalTarget != arrowScrollbox.scrollbox ||
event.detail == 0) {
return;
}
this.setAttribute("overflow", "true");
this._positionPinnedTabs();
this._handleTabSelect(true);
});
// Override scrollbox.xml method, since our scrollbox's children are
// inherited from the scrollbox binding parent (this).
arrowScrollbox._getScrollableElements = () => {
return Array.filter(this.children, arrowScrollbox._canScrollToElement);
};
arrowScrollbox._canScrollToElement = tab => {
return !tab._pinnedUnscrollable && !tab.hidden;
};
]]></body>
</method>
<method name="observe">
<parameter name="aSubject"/>
<parameter name="aTopic"/>

Просмотреть файл

@ -11,7 +11,6 @@ const BAD_CERT = "https://expired.example.com/";
const UNKNOWN_ISSUER = "https://self-signed.example.com ";
const BAD_STS_CERT = "https://badchain.include-subdomains.pinning.example.com:443";
const {TabStateFlusher} = ChromeUtils.import("resource:///modules/sessionstore/TabStateFlusher.jsm");
const PREF_NEW_CERT_ERRORS = "browser.security.newcerterrorpage.enabled";
add_task(async function checkReturnToAboutHome() {
info("Loading a bad cert page directly and making sure 'return to previous page' goes to about:home");
@ -259,7 +258,6 @@ add_task(async function checkUnknownIssuerLearnMoreLink() {
});
add_task(async function checkCautionClass() {
Services.prefs.setBoolPref(PREF_NEW_CERT_ERRORS, true);
info("Checking that are potentially more dangerous get a 'caution' class");
for (let useFrame of [false, true]) {
let tab = await openErrorPage(UNKNOWN_ISSUER, useFrame);
@ -282,11 +280,9 @@ add_task(async function checkCautionClass() {
BrowserTestUtils.removeTab(gBrowser.selectedTab);
}
Services.prefs.clearUserPref(PREF_NEW_CERT_ERRORS);
});
add_task(async function checkViewCertificate() {
Services.prefs.setBoolPref(PREF_NEW_CERT_ERRORS, true);
info("Loading a cert error and checking that the certificate can be shown.");
for (let useFrame of [false, true]) {
let tab = await openErrorPage(UNKNOWN_ISSUER, useFrame);
@ -310,7 +306,6 @@ add_task(async function checkViewCertificate() {
BrowserTestUtils.removeTab(gBrowser.selectedTab);
}
Services.prefs.clearUserPref(PREF_NEW_CERT_ERRORS);
});
add_task(async function checkBadStsCertHeadline() {

Просмотреть файл

@ -5,11 +5,8 @@
const PREF_SERVICES_SETTINGS_CLOCK_SKEW_SECONDS = "services.settings.clock_skew_seconds";
const PREF_SERVICES_SETTINGS_LAST_FETCHED = "services.settings.last_update_seconds";
const PREF_NEW_CERT_ERRORS = "browser.security.newcerterrorpage.enabled";
add_task(async function checkWrongSystemTimeWarning() {
Services.prefs.setBoolPref(PREF_NEW_CERT_ERRORS, true);
async function setUpPage() {
let browser;
let certErrorLoaded;
@ -80,5 +77,4 @@ add_task(async function checkWrongSystemTimeWarning() {
Services.prefs.clearUserPref(PREF_SERVICES_SETTINGS_LAST_FETCHED);
Services.prefs.clearUserPref(PREF_SERVICES_SETTINGS_CLOCK_SKEW_SECONDS);
Services.prefs.clearUserPref(PREF_NEW_CERT_ERRORS);
});

Просмотреть файл

@ -5,11 +5,9 @@
const BAD_CERT = "https://expired.example.com/";
const BAD_STS_CERT = "https://badchain.include-subdomains.pinning.example.com:443";
const PREF_NEW_CERT_ERRORS = "browser.security.newcerterrorpage.enabled";
const PREF_PERMANENT_OVERRIDE = "security.certerrors.permanentOverride";
add_task(async function checkExceptionDialogButton() {
Services.prefs.setBoolPref(PREF_NEW_CERT_ERRORS, true);
info("Loading a bad cert page and making sure the exceptionDialogButton directly adds an exception");
let tab = await openErrorPage(BAD_CERT);
let browser = tab.linkedBrowser;
@ -33,11 +31,9 @@ add_task(async function checkExceptionDialogButton() {
.getService(Ci.nsICertOverrideService);
certOverrideService.clearValidityOverride("expired.example.com", -1);
BrowserTestUtils.removeTab(gBrowser.selectedTab);
Services.prefs.clearUserPref(PREF_NEW_CERT_ERRORS);
});
add_task(async function checkPermanentExceptionPref() {
Services.prefs.setBoolPref(PREF_NEW_CERT_ERRORS, true);
info("Loading a bad cert page and making sure the permanent state of exceptions can be controlled via pref");
for (let permanentOverride of [false, true]) {
@ -83,7 +79,6 @@ add_task(async function checkPermanentExceptionPref() {
}
Services.prefs.clearUserPref(PREF_PERMANENT_OVERRIDE);
Services.prefs.clearUserPref(PREF_NEW_CERT_ERRORS);
});
add_task(async function checkBadStsCert() {
@ -105,18 +100,9 @@ add_task(async function checkBadStsCert() {
advancedButton.click();
return doc.getElementById("badCertTechnicalInfo").textContent;
});
if (Services.prefs.getBoolPref(PREF_NEW_CERT_ERRORS)) {
ok(message.includes("SSL_ERROR_BAD_CERT_DOMAIN"), "Didn't find SSL_ERROR_BAD_CERT_DOMAIN.");
ok(message.includes("The certificate is only valid for"), "Didn't find error message.");
ok(message.includes("a certificate that is not valid for"), "Didn't find error message.");
ok(message.includes("badchain.include-subdomains.pinning.example.com"), "Didn't find domain in error message.");
BrowserTestUtils.removeTab(gBrowser.selectedTab);
return;
}
ok(message.includes("SSL_ERROR_BAD_CERT_DOMAIN"), "Didn't find SSL_ERROR_BAD_CERT_DOMAIN.");
ok(message.includes("The certificate is only valid for"), "Didn't find error message.");
ok(message.includes("uses an invalid security certificate"), "Didn't find error message.");
ok(message.includes("a certificate that is not valid for"), "Didn't find error message.");
ok(message.includes("badchain.include-subdomains.pinning.example.com"), "Didn't find domain in error message.");
BrowserTestUtils.removeTab(gBrowser.selectedTab);

Просмотреть файл

@ -3,7 +3,6 @@
"use strict";
const PREF_NEW_CERT_ERRORS = "browser.security.newcerterrorpage.enabled";
const PREF_MITM_PRIMING = "security.certerrors.mitm.priming.enabled";
const PREF_MITM_PRIMING_ENDPOINT = "security.certerrors.mitm.priming.endpoint";
const PREF_MITM_CANARY_ISSUER = "security.pki.mitm_canary_issuer";
@ -15,7 +14,6 @@ const UNKNOWN_ISSUER = "https://untrusted.example.com";
// Check that basic MitM priming works and the MitM error page is displayed successfully.
add_task(async function checkMitmPriming() {
await SpecialPowers.pushPrefEnv({"set": [
[PREF_NEW_CERT_ERRORS, true],
[PREF_MITM_PRIMING, true],
[PREF_MITM_PRIMING_ENDPOINT, UNKNOWN_ISSUER],
]});
@ -60,7 +58,6 @@ add_task(async function checkMitmPriming() {
// Check that we set the enterprise roots pref correctly on MitM
add_task(async function checkMitmAutoEnableEnterpriseRoots() {
await SpecialPowers.pushPrefEnv({"set": [
[PREF_NEW_CERT_ERRORS, true],
[PREF_MITM_PRIMING, true],
[PREF_MITM_PRIMING_ENDPOINT, UNKNOWN_ISSUER],
[PREF_MITM_AUTO_ENABLE_ENTERPRISE_ROOTS, true],

Просмотреть файл

@ -53,11 +53,9 @@ add_task(async function checkTelemetryClickEvents() {
"return_button_top",
];
if (Services.prefs.getBoolPref("browser.security.newcerterrorpage.enabled")) {
recordedObjects.push("return_button_adv");
if (!useFrame) {
recordedObjects.push("exception_button");
}
recordedObjects.push("return_button_adv");
if (!useFrame) {
recordedObjects.push("exception_button");
}
for (let object of recordedObjects) {

Просмотреть файл

@ -4,6 +4,9 @@
add_task(async function() {
let testWindow = await BrowserTestUtils.openNewBrowserWindow();
// The TabContextMenu initializes its strings only on a focus or mouseover event.
// Calls focus event on the TabContextMenu early in the test.
testWindow.gBrowser.selectedTab.focus();
BrowserTestUtils.loadURI(testWindow.gBrowser, "data:text/html,<h1>A Page</h1>");
await BrowserTestUtils.browserLoaded(testWindow.gBrowser.selectedBrowser);

Просмотреть файл

@ -460,28 +460,6 @@ function promiseOnBookmarkItemAdded(aExpectedURI) {
}
async function loadBadCertPage(url) {
const EXCEPTION_DIALOG_URI = "chrome://pippki/content/exceptionDialog.xul";
let exceptionDialogResolved = new Promise(function(resolve) {
// When the certificate exception dialog has opened, click the button to add
// an exception.
let certExceptionDialogObserver = {
observe(aSubject, aTopic, aData) {
if (aTopic == "cert-exception-ui-ready") {
Services.obs.removeObserver(this, "cert-exception-ui-ready");
let certExceptionDialog = getCertExceptionDialog(EXCEPTION_DIALOG_URI);
ok(certExceptionDialog, "found exception dialog");
executeSoon(function() {
certExceptionDialog.documentElement.getButton("extra1").click();
resolve();
});
}
},
};
Services.obs.addObserver(certExceptionDialogObserver,
"cert-exception-ui-ready");
});
let loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
await BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
await loaded;
@ -489,28 +467,9 @@ async function loadBadCertPage(url) {
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
content.document.getElementById("exceptionDialogButton").click();
});
if (!Services.prefs.getBoolPref("browser.security.newcerterrorpage.enabled", false)) {
await exceptionDialogResolved;
}
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
}
// Utility function to get a handle on the certificate exception dialog.
// Modified from toolkit/components/passwordmgr/test/prompt_common.js
function getCertExceptionDialog(aLocation) {
for (let {docShell} of Services.wm.getXULWindowEnumerator(null)) {
let containedDocShells = docShell.getDocShellEnumerator(
docShell.typeChrome,
docShell.ENUMERATE_FORWARDS);
for (let {domWindow} of containedDocShells) {
if (domWindow.location.href == aLocation) {
return domWindow.document;
}
}
}
return undefined;
}
/**
* Waits for the message from content to update the Page Style menu.
*

Просмотреть файл

@ -25,10 +25,6 @@ const whitelist = [
file: "chrome://browser/skin/arrow-left.svg",
platforms: ["linux", "win", "macosx"],
},
{
file: "chrome://browser/skin/tabbrowser/tab-overflow-indicator.png",
platforms: ["linux", "win", "macosx"],
},
{
file: "chrome://browser/skin/places/toolbarDropMarker.png",

Просмотреть файл

@ -50,6 +50,9 @@ add_task(async function testTempPermissionOnReload() {
// Open the tab context menu.
let contextMenu = document.getElementById("tabContextMenu");
// The TabContextMenu initializes its strings only on a focus or mouseover event.
// Calls focus event on the TabContextMenu early in the test.
gBrowser.selectedTab.focus();
let popupShownPromise = BrowserTestUtils.waitForEvent(contextMenu, "popupshown");
EventUtils.synthesizeMouseAtCenter(gBrowser.selectedTab, {type: "contextmenu", button: 2});
await popupShownPromise;
@ -85,6 +88,9 @@ add_task(async function testTempPermissionOnReloadAllTabs() {
// Open the tab context menu.
let contextMenu = document.getElementById("tabContextMenu");
// The TabContextMenu initializes its strings only on a focus or mouseover event.
// Calls focus event on the TabContextMenu early in the test.
gBrowser.selectedTab.focus();
let popupShownPromise = BrowserTestUtils.waitForEvent(contextMenu, "popupshown");
EventUtils.synthesizeMouseAtCenter(gBrowser.selectedTab, {type: "contextmenu", button: 2});
await popupShownPromise;

Просмотреть файл

@ -5,6 +5,9 @@
add_task(async function test() {
// This test relies on the form history being empty to start with delete
// all the items first.
// The TabContextMenu initializes its strings only on a focus or mouseover event.
// Calls focus event on the TabContextMenu early in the test.
gBrowser.selectedTab.focus();
await new Promise((resolve, reject) => {
FormHistory.update({ op: "remove" },
{ handleError(error) {

Просмотреть файл

@ -256,28 +256,6 @@ async function assertMixedContentBlockingState(tabbrowser, states = {}) {
}
async function loadBadCertPage(url) {
const EXCEPTION_DIALOG_URI = "chrome://pippki/content/exceptionDialog.xul";
let exceptionDialogResolved = new Promise(function(resolve) {
// When the certificate exception dialog has opened, click the button to add
// an exception.
let certExceptionDialogObserver = {
observe(aSubject, aTopic, aData) {
if (aTopic == "cert-exception-ui-ready") {
Services.obs.removeObserver(this, "cert-exception-ui-ready");
let certExceptionDialog = getCertExceptionDialog(EXCEPTION_DIALOG_URI);
ok(certExceptionDialog, "found exception dialog");
executeSoon(function() {
certExceptionDialog.documentElement.getButton("extra1").click();
resolve();
});
}
},
};
Services.obs.addObserver(certExceptionDialogObserver,
"cert-exception-ui-ready");
});
let loaded = BrowserTestUtils.waitForErrorPage(gBrowser.selectedBrowser);
await BrowserTestUtils.loadURI(gBrowser.selectedBrowser, url);
await loaded;
@ -285,26 +263,5 @@ async function loadBadCertPage(url) {
await ContentTask.spawn(gBrowser.selectedBrowser, null, async function() {
content.document.getElementById("exceptionDialogButton").click();
});
if (!Services.prefs.getBoolPref("browser.security.newcerterrorpage.enabled", false)) {
await exceptionDialogResolved;
}
await BrowserTestUtils.browserLoaded(gBrowser.selectedBrowser);
}
// Utility function to get a handle on the certificate exception dialog.
// Modified from toolkit/components/passwordmgr/test/prompt_common.js
function getCertExceptionDialog(aLocation) {
for (let win of Services.wm.getXULWindowEnumerator(null)) {
let windowDocShell = win.docShell;
let containedDocShells = windowDocShell.getDocShellEnumerator(
Ci.nsIDocShellTreeItem.typeChrome,
Ci.nsIDocShell.ENUMERATE_FORWARDS);
for (let {domWindow} of containedDocShells) {
if (domWindow.location.href == aLocation) {
return domWindow.document;
}
}
}
return undefined;
}

Просмотреть файл

@ -9,10 +9,6 @@
* the end of the test, there is an assertion that all items have been
* removed from the whitelist, thus ensuring there are no stale entries. */
let gWhitelist = [{
file: "netError.dtd",
key: "certerror.introPara",
type: "single-quote",
}, {
file: "netError.dtd",
key: "certerror.introPara2",
type: "single-quote",

Просмотреть файл

@ -76,6 +76,15 @@ if (!Services.prefs.getBoolPref("layout.css.xul-box-display-values.content.enabl
});
}
if (!Services.prefs.getBoolPref("layout.css.line-height-moz-block-height.content.enabled")) {
// -moz-block-height is used in form controls but not exposed to the web.
whitelist.push({
sourceName: /(?:res|gre-resources)\/forms\.css$/i,
errorMessage: /Error in parsing value for \u2018line-height\u2019/iu,
isFromDevTools: false,
});
}
if (!Services.prefs.getBoolPref("full-screen-api.unprefix.enabled")) {
whitelist.push({
sourceName: /(?:res|gre-resources)\/(ua|html)\.css$/i,

Просмотреть файл

@ -19,6 +19,9 @@ function updateTabContextMenu(tab = gBrowser.selectedTab) {
let menu = document.getElementById("tabContextMenu");
var evt = new Event("");
tab.dispatchEvent(evt);
// The TabContextMenu initializes its strings only on a focus or mouseover event.
// Calls focus event on the TabContextMenu early in the test
gBrowser.selectedTab.focus();
menu.openPopup(tab, "end_after", 0, 0, true, false, evt);
is(window.TabContextMenu.contextTab, tab, "TabContextMenu context is the expected tab");
menu.hidePopup();

Просмотреть файл

@ -7,7 +7,10 @@ const TRACKING_PAGE = "http://tracking.example.org/browser/browser/base/content/
const BENIGN_PAGE = "http://tracking.example.org/browser/browser/base/content/test/trackingUI/benignPage.html";
const COOKIE_PAGE = "http://not-tracking.example.com/browser/browser/base/content/test/trackingUI/cookiePage.html";
const CM_PREF = "privacy.trackingprotection.cryptomining.enabled";
const FP_PREF = "privacy.trackingprotection.fingerprinting.enabled";
const TP_PREF = "privacy.trackingprotection.enabled";
const PREF_REPORT_BREAKAGE_ENABLED = "browser.contentblocking.reportBreakage.enabled";
const PREF_REPORT_BREAKAGE_URL = "browser.contentblocking.reportBreakage.url";
@ -23,7 +26,26 @@ add_task(async function setup() {
registerCleanupFunction(() => {
Services.telemetry.canRecordExtended = oldCanRecord;
// Clear prefs that are touched in this test again for sanity.
Services.prefs.clearUserPref(TP_PREF);
Services.prefs.clearUserPref(FP_PREF);
Services.prefs.clearUserPref(CM_PREF);
Services.prefs.clearUserPref(PREF_REPORT_BREAKAGE_ENABLED);
Services.prefs.clearUserPref(PREF_REPORT_BREAKAGE_URL);
UrlClassifierTestUtils.cleanupTestTrackers();
});
await SpecialPowers.pushPrefEnv({set: [
[ ContentBlocking.prefIntroCount, ContentBlocking.MAX_INTROS ],
[ "privacy.trackingprotection.fingerprinting.annotate.enabled", true ],
[ "urlclassifier.features.fingerprinting.blacklistHosts", "fingerprinting.example.com" ],
[ "urlclassifier.features.fingerprinting.annotate.blacklistHosts", "fingerprinting.example.com" ],
[ "privacy.trackingprotection.cryptomining.enabled", true ],
[ "urlclassifier.features.cryptomining.blacklistHosts", "cryptomining.example.com" ],
[ "urlclassifier.features.cryptomining.annotate.blacklistHosts", "cryptomining.example.com" ],
]});
});
add_task(async function testReportBreakageVisibility() {
@ -134,103 +156,134 @@ add_task(async function testReportBreakageCancel() {
Services.prefs.clearUserPref(PREF_REPORT_BREAKAGE_ENABLED);
});
add_task(async function testReportBreakage() {
add_task(async function testTP() {
Services.prefs.setBoolPref(TP_PREF, true);
// Make sure that we correctly strip the query.
let url = TRACKING_PAGE + "?a=b&1=abc&unicode=🦊";
await BrowserTestUtils.withNewTab(url, async function() {
await testReportBreakage(TRACKING_PAGE, "trackingprotection");
});
Services.prefs.clearUserPref(TP_PREF);
});
add_task(async function testFP() {
Services.prefs.setBoolPref(FP_PREF, true);
// Make sure that we correctly strip the query.
let url = TRACKING_PAGE + "?a=b&1=abc&unicode=🦊";
await BrowserTestUtils.withNewTab(url, async function(browser) {
await ContentTask.spawn(browser, {}, function() {
content.postMessage("fingerprinting", "*");
});
// Without TP, we will have a cookie restrictions entry for trackertest.org.
await testReportBreakage(TRACKING_PAGE, "cookierestrictions,fingerprinting");
});
Services.prefs.clearUserPref(FP_PREF);
});
add_task(async function testCM() {
Services.prefs.setBoolPref(CM_PREF, true);
// Make sure that we correctly strip the query.
let url = TRACKING_PAGE + "?a=b&1=abc&unicode=🦊";
await BrowserTestUtils.withNewTab(url, async function(browser) {
await ContentTask.spawn(browser, {}, function() {
content.postMessage("cryptomining", "*");
});
// Without TP, we will have a cookie restrictions entry for trackertest.org.
await testReportBreakage(TRACKING_PAGE, "cookierestrictions,cryptomining");
});
Services.prefs.clearUserPref(CM_PREF);
});
async function testReportBreakage(url, tags) {
// Setup a mock server for receiving breakage reports.
let server = new HttpServer();
server.start(-1);
let i = server.identity;
let path = i.primaryScheme + "://" + i.primaryHost + ":" + i.primaryPort + "/";
Services.prefs.setBoolPref(TP_PREF, true);
Services.prefs.setBoolPref(PREF_REPORT_BREAKAGE_ENABLED, true);
Services.prefs.setStringPref(PREF_REPORT_BREAKAGE_URL, path);
// Make sure that we correctly strip the query.
let url = TRACKING_PAGE + "?a=b&1=abc&unicode=🦊";
await BrowserTestUtils.withNewTab(url, async function() {
await openIdentityPopup();
await openIdentityPopup();
let reportBreakageButton = document.getElementById("identity-popup-content-blocking-report-breakage");
ok(BrowserTestUtils.is_visible(reportBreakageButton), "report breakage button is visible");
let reportBreakageView = document.getElementById("identity-popup-breakageReportView");
let viewShown = BrowserTestUtils.waitForEvent(reportBreakageView, "ViewShown");
reportBreakageButton.click();
await viewShown;
let reportBreakageButton = document.getElementById("identity-popup-content-blocking-report-breakage");
await TestUtils.waitForCondition(() => BrowserTestUtils.is_visible(reportBreakageButton),
"report breakage button is visible");
let reportBreakageView = document.getElementById("identity-popup-breakageReportView");
let viewShown = BrowserTestUtils.waitForEvent(reportBreakageView, "ViewShown");
reportBreakageButton.click();
await viewShown;
let submitButton = document.getElementById("identity-popup-breakageReportView-submit");
let reportURL = document.getElementById("identity-popup-breakageReportView-collection-url").value;
let submitButton = document.getElementById("identity-popup-breakageReportView-submit");
let reportURL = document.getElementById("identity-popup-breakageReportView-collection-url").value;
is(reportURL, TRACKING_PAGE, "Shows the correct URL in the report UI.");
is(reportURL, url, "Shows the correct URL in the report UI.");
// Make sure that sending the report closes the identity popup.
let popuphidden = BrowserTestUtils.waitForEvent(gIdentityHandler._identityPopup, "popuphidden");
// Make sure that sending the report closes the identity popup.
let popuphidden = BrowserTestUtils.waitForEvent(gIdentityHandler._identityPopup, "popuphidden");
// Check that we're receiving a good report.
await new Promise(resolve => {
server.registerPathHandler("/", async (request, response) => {
is(request.method, "POST", "request was a post");
// Check that we're receiving a good report.
await new Promise(resolve => {
server.registerPathHandler("/", async (request, response) => {
is(request.method, "POST", "request was a post");
// Extract and "parse" the form data in the request body.
let body = CommonUtils.readBytesFromInputStream(request.bodyInputStream);
let boundary = request.getHeader("Content-Type").match(/boundary=-+([^-]*)/i)[1];
let regex = new RegExp("-+" + boundary + "-*\\s+");
let sections = body.split(regex);
// Extract and "parse" the form data in the request body.
let body = CommonUtils.readBytesFromInputStream(request.bodyInputStream);
let boundary = request.getHeader("Content-Type").match(/boundary=-+([^-]*)/i)[1];
let regex = new RegExp("-+" + boundary + "-*\\s+");
let sections = body.split(regex);
let prefs = [
"privacy.trackingprotection.enabled",
"privacy.trackingprotection.pbmode.enabled",
"urlclassifier.trackingTable",
"network.http.referer.defaultPolicy",
"network.http.referer.defaultPolicy.pbmode",
"network.cookie.cookieBehavior",
"network.cookie.lifetimePolicy",
"privacy.restrict3rdpartystorage.expiration",
];
let prefsBody = "";
let prefs = [
"privacy.trackingprotection.enabled",
"privacy.trackingprotection.pbmode.enabled",
"urlclassifier.trackingTable",
"network.http.referer.defaultPolicy",
"network.http.referer.defaultPolicy.pbmode",
"network.cookie.cookieBehavior",
"network.cookie.lifetimePolicy",
"privacy.restrict3rdpartystorage.expiration",
"privacy.trackingprotection.fingerprinting.enabled",
"privacy.trackingprotection.cryptomining.enabled",
];
let prefsBody = "";
for (let pref of prefs) {
prefsBody += `${pref}: ${Preferences.get(pref)}\r\n`;
}
for (let pref of prefs) {
prefsBody += `${pref}: ${Preferences.get(pref)}\r\n`;
}
Assert.deepEqual(sections, [
"",
"Content-Disposition: form-data; name=\"title\"\r\n\r\ntracking.example.org\r\n",
"Content-Disposition: form-data; name=\"body\"\r\n\r\n" +
`Full URL: ${reportURL + "?"}\r\n` +
`userAgent: ${navigator.userAgent}\r\n\r\n` +
"**Preferences**\r\n" +
`${prefsBody}\r\n` +
"**Comments**\r\n" +
"This is a comment\r\n",
"Content-Disposition: form-data; name=\"labels\"\r\n\r\n" +
"trackingprotection\r\n",
"",
], "Should send the correct form data");
Assert.deepEqual(sections, [
"",
"Content-Disposition: form-data; name=\"title\"\r\n\r\ntracking.example.org\r\n",
"Content-Disposition: form-data; name=\"body\"\r\n\r\n" +
`Full URL: ${reportURL + "?"}\r\n` +
`userAgent: ${navigator.userAgent}\r\n\r\n` +
"**Preferences**\r\n" +
`${prefsBody}\r\n` +
"**Comments**\r\n" +
"This is a comment\r\n",
"Content-Disposition: form-data; name=\"labels\"\r\n\r\n" +
`${tags}\r\n`,
"",
], "Should send the correct form data");
resolve();
});
let comments = document.getElementById("identity-popup-breakageReportView-collection-comments");
comments.value = "This is a comment";
submitButton.click();
resolve();
});
await popuphidden;
let comments = document.getElementById("identity-popup-breakageReportView-collection-comments");
comments.value = "This is a comment";
submitButton.click();
});
await popuphidden;
// Stop the server.
await new Promise(r => server.stop(r));
Services.prefs.clearUserPref(TP_PREF);
Services.prefs.clearUserPref(PREF_REPORT_BREAKAGE_ENABLED);
Services.prefs.clearUserPref(PREF_REPORT_BREAKAGE_URL);
});
add_task(async function cleanup() {
// Clear prefs that are touched in this test again for sanity.
Services.prefs.clearUserPref(TP_PREF);
Services.prefs.clearUserPref(PREF_REPORT_BREAKAGE_ENABLED);
Services.prefs.clearUserPref(PREF_REPORT_BREAKAGE_URL);
UrlClassifierTestUtils.cleanupTestTrackers();
});
}

Просмотреть файл

@ -21,7 +21,6 @@ browser.jar:
content/browser/illustrations/blue-berror.svg (content/illustrations/blue-berror.svg)
content/browser/aboutNetError.xhtml (content/aboutNetError.xhtml)
content/browser/aboutNetError.js (content/aboutNetError.js)
content/browser/aboutNetError-new.xhtml (content/aboutNetError-new.xhtml)
content/browser/aboutRobots-icon.png (content/aboutRobots-icon.png)
content/browser/aboutRobots-widget-left.png (content/aboutRobots-widget-left.png)
content/browser/aboutTabCrashed.css (content/aboutTabCrashed.css)

Просмотреть файл

@ -22,7 +22,6 @@ namespace browser {
NS_IMPL_ISUPPORTS(AboutRedirector, nsIAboutModule)
bool AboutRedirector::sNewTabPageEnabled = false;
bool AboutRedirector::sNewCertErrorPageEnabled = false;
static const uint32_t ACTIVITY_STREAM_FLAGS =
nsIAboutModule::ALLOW_SCRIPT | nsIAboutModule::ENABLE_INDEXED_DB |
@ -145,13 +144,6 @@ AboutRedirector::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo,
sNTPEnabledCacheInited = true;
}
static bool sNCEPEnabledCacheInited = false;
if (!sNCEPEnabledCacheInited) {
Preferences::AddBoolVarCache(&AboutRedirector::sNewCertErrorPageEnabled,
"browser.security.newcerterrorpage.enabled");
sNCEPEnabledCacheInited = true;
}
for (auto& redir : kRedirMap) {
if (!strcmp(path.get(), redir.id)) {
nsAutoCString url;
@ -175,10 +167,6 @@ AboutRedirector::NewChannel(nsIURI* aURI, nsILoadInfo* aLoadInfo,
NS_ENSURE_SUCCESS(rv, rv);
}
if (sNewCertErrorPageEnabled && path.EqualsLiteral("certerror")) {
url.AssignLiteral("chrome://browser/content/aboutNetError-new.xhtml");
}
// fall back to the specified url in the map
if (url.IsEmpty()) {
url.AssignASCII(redir.url);

Просмотреть файл

@ -6,6 +6,9 @@
add_task(async function() {
info("Check find button existence and functionality");
// The TabContextMenu initializes its strings only on a focus or mouseover event.
// Calls focus event on the TabContextMenu early in the test.
gBrowser.selectedTab.focus();
CustomizableUI.addWidgetToArea("find-button", CustomizableUI.AREA_FIXED_OVERFLOW_PANEL);
registerCleanupFunction(() => CustomizableUI.reset());

Просмотреть файл

@ -8,6 +8,9 @@ const TEST_PATH = getRootDirectory(gTestPath).replace("chrome://mochitests/conte
add_task(async function() {
info("Check history button existence and functionality");
// The TabContextMenu initializes its strings only on a focus or mouseover event.
// Calls focus event on the TabContextMenu early in the test.
gBrowser.selectedTab.focus();
let tab = await BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_PATH + "dummy_history_item.html");
BrowserTestUtils.removeTab(tab);

Просмотреть файл

@ -503,6 +503,9 @@ function closeActionContextMenu(itemToSelect, kind, win = window) {
}
function openTabContextMenu(win = window) {
// The TabContextMenu initializes its strings only on a focus or mouseover event.
// Calls focus event on the TabContextMenu before opening.
gBrowser.selectedTab.focus();
return openChromeContextMenu("tabContextMenu", ".tabbrowser-tab[selected]", win);
}

Просмотреть файл

@ -41,8 +41,8 @@ function loadContentWindow(webNavigation, url, principal) {
if (flags & Ci.nsIWebProgressListener.LOCATION_CHANGE_SAME_DOCUMENT) {
return;
}
// Ignore the initial about:blank
if (uri.spec != location.spec) {
// Ignore the initial about:blank, unless about:blank is requested
if (location.spec == "about:blank" && uri.spec != "about:blank") {
return;
}
let contentWindow = docShell.domWindow;

Просмотреть файл

@ -1,5 +1,8 @@
[DEFAULT]
support-files = headless.html
support-files =
headless.html
headless_redirect.html
headless_redirect.html^headers^
[test_headless_screenshot.html]
skip-if = toolkit == 'android'

Просмотреть файл

Просмотреть файл

@ -0,0 +1,2 @@
HTTP 302 Moved Temporarily
Location: headless.html

Просмотреть файл

@ -137,6 +137,9 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1378010
await testFileCreationNegative(["-url", "http://mochi.test:8888/chrome/browser/components/shell/test/headless.html", "-screenshot", "-window-size", "hello"], "screenshot.png");
await testFileCreationNegative(["-url", "http://mochi.test:8888/chrome/browser/components/shell/test/headless.html", "-screenshot", "-window-size", "800,"], "screenshot.png");
// Test when the requested URL redirects
await testFileCreationPositive(["-url", "http://mochi.test:8888/chrome/browser/components/shell/test/headless_redirect.html", "-screenshot", screenshotPath], screenshotPath);
SimpleTest.finish();
})();
</script>

Просмотреть файл

@ -115,7 +115,8 @@ class UrlbarController {
* The reason the query was cancelled.
*/
cancelQuery(reason) {
if (!this._lastQueryContext) {
if (!this._lastQueryContext ||
this._lastQueryContext._cancelled) {
return;
}
@ -123,8 +124,8 @@ class UrlbarController {
TelemetryStopwatch.cancel(TELEMETRY_6_FIRST_RESULTS, this._lastQueryContext);
this.manager.cancelQuery(this._lastQueryContext);
this._lastQueryContext._cancelled = true;
this._notify("onQueryCancelled", this._lastQueryContext);
delete this._lastQueryContext;
if (reason == UrlbarUtils.CANCEL_REASON.BLUR &&
ExtensionSearchHandler.hasActiveInputSession()) {

Просмотреть файл

@ -36,8 +36,8 @@ class UrlbarView {
this._mainContainer = this.panel.querySelector(".urlbarView-body-inner");
this._rows = this.panel.querySelector("#urlbarView-results");
this._rows.addEventListener("mouseup", this);
this._rows.addEventListener("mousedown", this);
this._rows.addEventListener("mouseup", this);
// For the horizontal fade-out effect, set the overflow attribute on result
// rows when they overflow.
@ -140,6 +140,9 @@ class UrlbarView {
throw new Error("UrlbarView: Cannot select an item if the view isn't open.");
}
// Freeze results as the user is interacting with them.
this.controller.cancelQuery();
let row = this._selected;
if (!row) {
@ -413,7 +416,7 @@ class UrlbarView {
content.appendChild(title);
item._elements.set("title", title);
let tagsContainer = this._createElement("div");
let tagsContainer = this._createElement("span");
tagsContainer.className = "urlbarView-tags";
content.appendChild(tagsContainer);
item._elements.set("tagsContainer", tagsContainer);

Просмотреть файл

@ -149,9 +149,6 @@ browser/chrome/browser/res/payments/formautofill/autofillEditForms.js
# Bug 1451050 - Remote settings empty dumps (will be populated with data eventually)
browser/defaults/settings/pinning/pins.json
browser/defaults/settings/main/example.json
# Bug 1463748 - Fork and pref-off the new error pages
browser/chrome/browser/content/browser/aboutNetError-new.xhtml
browser/chrome/browser/content/browser/aboutNetError.xhtml
#ifdef MOZ_EME_WIN32_ARTIFACT
gmp-clearkey/0.1/manifest.json
i686/gmp-clearkey/0.1/manifest.json

Просмотреть файл

@ -2,7 +2,6 @@ ach
af
an
ar
as
ast
az
be
@ -21,7 +20,6 @@ dsb
el
en-CA
en-GB
en-ZA
eo
es-AR
es-CL
@ -62,9 +60,7 @@ lo
lt
ltg
lv
mai
mk
ml
mr
ms
my
@ -73,7 +69,6 @@ ne-NP
nl
nn-NO
oc
or
pa-IN
pl
pt-BR

Просмотреть файл

@ -0,0 +1,70 @@
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
reload-tab =
.label = Reload Tab
.accesskey = R
select-all-tabs =
.label = Select All Tabs
.accesskey = S
duplicate-tab =
.label = Duplicate Tab
.accesskey = D
duplicate-tabs =
.label = Duplicate Tabs
.accesskey = D
close-tabs-to-the-end =
.label = Close Tabs to the Right
.accesskey = i
close-other-tabs =
.label = Close Other Tabs
.accesskey = o
reload-tabs =
.label = Reload Tabs
.accesskey = R
pin-tab =
.label = Pin Tab
.accesskey = P
unpin-tab =
.label = Unpin Tab
.accesskey = p
pin-selected-tabs =
.label = Pin Tabs
.accesskey = P
unpin-selected-tabs =
.label = Unpin Tabs
.accesskey = p
bookmark-selected-tabs =
.label = Bookmark Tabs…
.accesskey = B
bookmark-tab =
.label = Bookmark Tab
.accesskey = B
reopen-in-container =
.label = Reopen in Container
.accesskey = e
move-to-start =
.label = Move to Start
.accesskey = S
move-to-end =
.label = Move to End
.accesskey = E
move-to-new-window =
.label = Move to New Window
.accesskey = W
undo-close-tab =
.label = Undo Close Tab
.accesskey = U
close-tab =
.label = Close Tab
.accesskey = c
close-tabs =
.label = Close Tabs
.accesskey = S
move-tabs =
.label = Move Tabs
.accesskey = v
move-tab =
.label = Move Tab
.accesskey = v

Просмотреть файл

@ -19,50 +19,6 @@
<!ENTITY navbarOverflow.label "More tools…">
<!-- Tab context menu -->
<!ENTITY reloadTab.label "Reload Tab">
<!ENTITY reloadTab.accesskey "R">
<!ENTITY selectAllTabs.label "Select All Tabs">
<!ENTITY selectAllTabs.accesskey "S">
<!-- LOCALIZATION NOTE (duplicateTab.label): This is a command to duplicate
a tab (i.e. it is a verb, not adjective). -->
<!ENTITY duplicateTab.label "Duplicate Tab">
<!-- LOCALIZATION NOTE (duplicateTab.accesskey, duplicateTabs.accesskey):
These items have the same accesskey but will never be visible at the same time. -->
<!ENTITY duplicateTab.accesskey "D">
<!-- LOCALIZATION NOTE (duplicateTabs.label): This is a command to duplicate
a tab (i.e. it is a verb, not adjective). -->
<!ENTITY duplicateTabs.label "Duplicate Tabs">
<!-- LOCALIZATION NOTE (duplicateTab.accesskey, duplicateTabs.accesskey):
These items have the same accesskey but will never be visible at the same time. -->
<!ENTITY duplicateTabs.accesskey "D">
<!-- LOCALIZATION NOTE (closeTabsToTheEnd.label): This should indicate the
direction in which tabs are closed, i.e. locales that use RTL mode should say
left instead of right. -->
<!ENTITY closeTabsToTheEnd.label "Close Tabs to the Right">
<!ENTITY closeTabsToTheEnd.accesskey "i">
<!ENTITY closeOtherTabs.label "Close Other Tabs">
<!ENTITY closeOtherTabs.accesskey "o">
<!ENTITY closeTabs.label "Close Tabs">
<!ENTITY closeTabs.accesskey "S">
<!ENTITY pinSelectedTabs.label "Pin Tabs">
<!-- LOCALIZATION NOTE(pinTab.accesskey, pinSelectedTabs.accesskey,
unpinTab.accesskey, unpinSelectedTabs.accesskey): These share the
same accesskey but will never be visible at the same time. -->
<!ENTITY pinSelectedTabs.accesskey "P">
<!ENTITY unpinSelectedTabs.label "Unpin Tabs">
<!-- LOCALIZATION NOTE(pinTab.accesskey, pinSelectedTabs.accesskey,
unpinTab.accesskey, unpinSelectedTabs.accesskey): These share the
same accesskey but will never be visible at the same time. -->
<!ENTITY unpinSelectedTabs.accesskey "p">
<!-- LOCALIZATION NOTE(reloadTab.label, reloadTabs.label): have the same accesskey
but will never be visible at the same time. -->
<!ENTITY reloadTabs.label "Reload Tabs">
<!ENTITY reloadTabs.accesskey "R">
<!ENTITY bookmarkSelectedTabs.label "Bookmark Tabs…">
<!-- LOCALIZATION NOTE(bookmarkTab.accesskey, bookmarkSelectedTabs.accesskey):
These items have the same accesskey but will never be visible at the same time. -->
<!ENTITY bookmarkSelectedTabs.accesskey "B">
<!-- LOCALIZATION NOTE (pinTab.label, unpinTab.label): "Pin" is being
used as a metaphor for expressing the fact that these tabs are "pinned" to the
@ -83,28 +39,8 @@ same accesskey but will never be visible at the same time. -->
<!ENTITY sendPageToDevice.accesskey "n">
<!ENTITY sendLinkToDevice.label "Send Link to Device">
<!ENTITY sendLinkToDevice.accesskey "n">
<!-- LOCALIZATION NOTE (moveTabOptions.label and moveSelectedTabOptions.label):
These two items have the same accesskey but will never be visible at the same time. -->
<!ENTITY moveTabOptions.label "Move Tab">
<!ENTITY moveTabOptions.accesskey "v">
<!ENTITY moveSelectedTabOptions.label "Move Tabs">
<!ENTITY moveSelectedTabOptions.accesskey "v">
<!ENTITY moveToStart.label "Move to Start">
<!ENTITY moveToStart.accesskey "S">
<!ENTITY moveToEnd.label "Move to End">
<!ENTITY moveToEnd.accesskey "E">
<!ENTITY moveToNewWindow.label "Move to New Window">
<!ENTITY moveToNewWindow.accesskey "W">
<!ENTITY reopenInContainer.label "Reopen in Container">
<!ENTITY reopenInContainer.accesskey "e">
<!ENTITY bookmarkTab.label "Bookmark Tab">
<!-- LOCALIZATION NOTE(bookmarkTab.accesskey, bookmarkSelectedTabs.accesskey):
These items have the same accesskey but will never be visible at the same time. -->
<!ENTITY bookmarkTab.accesskey "B">
<!ENTITY undoCloseTab.label "Undo Close Tab">
<!ENTITY undoCloseTab.accesskey "U">
<!ENTITY closeTab.label "Close Tab">
<!ENTITY closeTab.accesskey "c">
<!ENTITY hiddenTabs.label "Hidden Tabs">
<!ENTITY listAllTabs.label "List all tabs">

Просмотреть файл

@ -9,7 +9,6 @@
<!ENTITY retry.label "Try Again">
<!ENTITY returnToPreviousPage.label "Go Back">
<!ENTITY returnToPreviousPage1.label "Go Back (Recommended)">
<!ENTITY advanced.label "Advanced">
<!ENTITY advanced2.label "Advanced…">
<!ENTITY viewCertificate.label "View Certificate">
@ -148,13 +147,11 @@
</ul>
">
<!ENTITY certerror.longpagetitle1 "Your connection is not secure">
<!ENTITY certerror.longpagetitle2 "Warning: Potential Security Risk Ahead">
<!ENTITY certerror.sts.longpagetitle "Did Not Connect: Potential Security Issue">
<!-- Localization note (certerror.introPara, certerror.introPara2) - The text content of the span tag
<!-- Localization note (certerror.introPara2) - The text content of the span tag
will be replaced at runtime with the name of the server to which the user
was trying to connect. -->
<!ENTITY certerror.introPara "The owner of <span class='hostname'/> has configured their website improperly. To protect your information from being stolen, &brandShortName; has not connected to this website.">
<!ENTITY certerror.introPara2 "&brandShortName; detected a potential security threat and did not continue to <span class='hostname'/>. If you visit this site, attackers could try to steal information like your passwords, emails, or credit card details.">
<!ENTITY certerror.sts.introPara "&brandShortName; detected a potential security threat and did not continue to <span class='hostname'/> because this website requires a secure connection.">
@ -195,8 +192,6 @@ was trying to connect. -->
<!ENTITY corruptedContentErrorv2.title "Corrupted Content Error">
<!ENTITY corruptedContentErrorv2.longDesc "<p>The page you are trying to view cannot be shown because an error in the data transmission was detected.</p><ul><li>Please contact the website owners to inform them of this problem.</li></ul>">
<!ENTITY securityOverride.exceptionButtonLabel "Add Exception…">
<!ENTITY securityOverride.exceptionButton1Label "Accept the Risk and Continue">
<!ENTITY errorReporting.automatic2 "Report errors like this to help Mozilla identify and block malicious sites">
@ -216,13 +211,8 @@ was trying to connect. -->
<!ENTITY certerror.wrongSystemTime2 "<p> &brandShortName; did not connect to <span id='wrongSystemTime_URL'/> because your computers clock appears to show the wrong time and this is preventing a secure connection.</p> <p>Your computer is set to <span id='wrongSystemTime_systemDate'/>, when it should be <span id='wrongSystemTime_actualDate'/>. To fix this problem, change your date and time settings to match the correct time.</p>">
<!ENTITY certerror.wrongSystemTimeWithoutReference "<p>&brandShortName; did not connect to <span id='wrongSystemTimeWithoutReference_URL'/> because your computers clock appears to show the wrong time and this is preventing a secure connection.</p> <p>Your computer is set to <span id='wrongSystemTimeWithoutReference_systemDate'/>. To fix this problem, change your date and time settings to match the correct time.</p>">
<!ENTITY certerror.pagetitle1 "Insecure Connection">
<!ENTITY certerror.pagetitle2 "Warning: Potential Security Risk Ahead">
<!ENTITY certerror.sts.pagetitle "Did Not Connect: Potential Security Issue">
<!ENTITY certerror.whatShouldIDo.badStsCertExplanation "This site uses HTTP
Strict Transport Security (HSTS) to specify that &brandShortName; may only connect
to it securely. As a result, it is not possible to add an exception for this
certificate.">
<!ENTITY certerror.whatShouldIDo.badStsCertExplanation1 "<span class='hostname'></span> has a security policy called HTTP Strict Transport Security (HSTS), which means that &brandShortName; can only connect to it securely. You cant add an exception to visit this site.">
<!ENTITY certerror.copyToClipboard.label "Copy text to clipboard">

Просмотреть файл

@ -9,7 +9,6 @@ locales = [
"af",
"an",
"ar",
"as",
"ast",
"az",
"be",
@ -28,7 +27,6 @@ locales = [
"el",
"en-CA",
"en-GB",
"en-ZA",
"eo",
"es-AR",
"es-CL",
@ -69,9 +67,7 @@ locales = [
"lt",
"ltg",
"lv",
"mai",
"mk",
"ml",
"mr",
"ms",
"my",
@ -80,7 +76,6 @@ locales = [
"nl",
"nn-NO",
"oc",
"or",
"pa-IN",
"pl",
"pt-BR",

Просмотреть файл

@ -2,7 +2,6 @@ ach
af
an
ar
as
ast
az
be
@ -21,7 +20,6 @@ el
en-CA
en-GB
en-US
en-ZA
eo
es-AR
es-CL
@ -60,9 +58,7 @@ ko
lij
lt
lv
mai
mk
ml
mr
ms
my
@ -71,7 +67,6 @@ ne-NP
nl
nn-NO
oc
or
pa-IN
pl
pt-BR

Просмотреть файл

@ -1,290 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@import url("chrome://browser/skin/error-pages.css");
:root {
--exception-button-container-background: #F5F5F7;
}
body.certerror {
width: 100%;
justify-content: normal;
}
body.caution {
border-style: solid;
border-color: #ffe900;
border-width: 16px;
}
body.captiveportal .title {
background-image: url("wifi.svg");
}
body.certerror .title {
background-image: url("cert-error-new.svg");
}
body.blocked .title {
background-image: url("chrome://global/skin/icons/blocked.svg");
}
body.clockSkewError .title {
background-image: none;
background-repeat: no-repeat;
}
#errorContainer {
display: none;
}
/* Pressing the retry button will cause the cursor to flicker from a pointer to
* not-allowed. Override the disabled cursor behaviour since we will never show
* the button disabled as the initial state. */
button:disabled {
cursor: pointer;
}
#errorWhatToDoTitle {
margin-top: 2em;
}
#prefChangeContainer {
display: none;
}
#learnMoreContainer {
display: none;
}
#certErrorAndCaptivePortalButtonContainer {
display: none;
}
#advancedPanelButtonContainer {
background-color: var(--exception-button-container-background);
display: flex;
justify-content: end;
padding: 5px;
margin-top: 2em;
}
body:not(.neterror) #certErrorAndCaptivePortalButtonContainer {
display: flex;
}
body:not(.neterror) #netErrorButtonContainer {
display: none;
}
#errorTryAgain {
margin-top: 1.2em;
}
#advancedButton {
display: none;
}
body.captiveportal #returnButton {
display: none;
}
body:not(.captiveportal) #openPortalLoginPageButton {
display: none;
}
body:not(.clockSkewError) #errorTryAgain {
display: none;
}
body:not(.clockSkewError) #advancedPanelErrorTryAgain {
display: none;
}
#openPortalLoginPageButton {
margin-inline-start: 0;
}
body:not(.neterror) #advancedButton {
display: block;
}
#certificateErrorReporting {
display: none;
padding-bottom: 10px;
}
#advancedPanelContainer {
width: 100%;
left: 0;
}
.advanced-panel {
/* Hidden until the link is clicked */
display: none;
background-color: white;
border: 1px lightgray solid;
margin: 48px auto;
min-width: var(--in-content-container-min-width);
max-width: var(--in-content-container-max-width);
}
#overrideWeakCryptoPanel {
display: none;
flex-direction: row;
flex-wrap: wrap;
justify-content: space-between;
align-content: space-between;
align-items: flex-start;
margin-top: 1em;
}
.mitm-name,
#hostname {
font-weight: bold;
}
#automaticallyReportInFuture {
cursor: pointer;
/* Prevent the checkbox from looking super
* squeezed on small viewports */
flex-shrink: 0;
}
#errorCode:not([href]) {
color: var(--in-content-page-color);
cursor: text;
text-decoration: none;
}
#errorCode[href] {
white-space: nowrap;
}
#viewCertificate {
margin: 0 3em;
}
#badCertTechnicalInfo {
margin: 3em 3em 1em;
overflow: auto;
white-space: pre-wrap;
}
#certificateErrorReporting {
display: none;
}
#certificateErrorDebugInformation {
display: none;
background-color: var(--in-content-box-background-hover) !important;
border-top: 1px solid var(--in-content-border-color);
width: 100%;
padding: 1em 17.5%;
box-sizing: border-box;
}
#certificateErrorText {
font-family: monospace;
white-space: pre-wrap;
padding: 1em 0;
display: flex;
flex-wrap: wrap;
}
#cert_domain_link:not([href]) {
color: var(--in-content-page-color);
text-decoration: none;
}
.exceptionDialogButtonContainer {
background-color: var(--exception-button-container-background);
display: flex;
justify-content: end;
}
.exceptionDialogButtonContainer[hidden] {
display: none;
}
.connectionFailure #errorPageContainer,
.netInterrupt #errorPageContainer,
.netTimeout #errorPageContainer,
.netReset #errorPageContainer,
.netOffline #errorPageContainer {
background-image: url("chrome://browser/content/illustrations/error-connection-failure.svg");
}
.dnsNotFound #errorPageContainer {
background-image: url("chrome://browser/content/illustrations/error-server-not-found.svg");
}
.malformedURI #errorPageContainer {
background-image: url("chrome://browser/content/illustrations/error-malformed-url.svg");
}
.clockSkewError #errorPageContainer {
background-image: url("chrome://browser/content/illustrations/blue-berror.svg");
background-size: 18.5em;
}
.clockSkewError #returnButton {
display: none;
}
.clockSkewError #advancedButton {
display: none;
}
.clockSkewError #advancedPanelErrorTryAgain,
.clockSkewError #errorTryAgain {
display: block;
margin-top: 0.3em;
}
.clockSkewError #exceptionDialogButton {
display: none;
}
.clockSkewError #advancedPanelReturnButton {
display: none;
}
.malformedURI #errorTryAgain {
display: none;
}
#wrongSystemTimePanel {
display: none;
}
#wrongSystemTimeWithoutReferencePanel {
display: none;
}
@media only screen and (max-width: 959px) {
#certificateErrorText {
/* The encoded certificate chain looks better when we're not
* wrapping words on big screens, but at some point we need
* to wrap to avoid overflowing */
word-wrap: anywhere;
}
}
@media only screen and (max-width: 480px) {
#badCertTechnicalInfo {
margin: 10px 10px 5px;
}
#viewCertificate {
margin: 0 10px;
}
#errorCode[href] {
/* Break the error code to avoid long codes overflowing the screen */
white-space: normal;
word-wrap: anywhere;
}
}

Просмотреть файл

@ -9,9 +9,16 @@
}
body.certerror {
width: 100%;
justify-content: normal;
}
body.caution {
border-style: solid;
border-color: #ffe900;
border-width: 16px;
}
body.captiveportal .title {
background-image: url("wifi.svg");
}
@ -24,6 +31,11 @@ body.blocked .title {
background-image: url("chrome://global/skin/icons/blocked.svg");
}
body.clockSkewError .title {
background-image: none;
background-repeat: no-repeat;
}
#errorContainer {
display: none;
}
@ -35,6 +47,10 @@ button:disabled {
cursor: pointer;
}
#errorWhatToDoTitle {
margin-top: 2em;
}
#prefChangeContainer {
display: none;
}
@ -47,6 +63,14 @@ button:disabled {
display: none;
}
#advancedPanelButtonContainer {
background-color: var(--exception-button-container-background);
display: flex;
justify-content: end;
padding: 5px;
margin-top: 2em;
}
body:not(.neterror) #certErrorAndCaptivePortalButtonContainer {
display: flex;
}
@ -55,10 +79,6 @@ body:not(.neterror) #netErrorButtonContainer {
display: none;
}
#advancedPanelErrorTryAgain {
display: none;
}
#errorTryAgain {
margin-top: 1.2em;
}
@ -75,6 +95,14 @@ body:not(.captiveportal) #openPortalLoginPageButton {
display: none;
}
body:not(.clockSkewError) #errorTryAgain {
display: none;
}
body:not(.clockSkewError) #advancedPanelErrorTryAgain {
display: none;
}
#openPortalLoginPageButton {
margin-inline-start: 0;
}
@ -85,10 +113,10 @@ body:not(.neterror) #advancedButton {
#certificateErrorReporting {
display: none;
padding-bottom: 10px;
}
#advancedPanelContainer {
position: absolute;
width: 100%;
left: 0;
}
@ -113,12 +141,16 @@ body:not(.neterror) #advancedButton {
margin-top: 1em;
}
span#hostname {
.mitm-name,
#hostname {
font-weight: bold;
}
#automaticallyReportInFuture {
cursor: pointer;
/* Prevent the checkbox from looking super
* squeezed on small viewports */
flex-shrink: 0;
}
#errorCode:not([href]) {
@ -131,8 +163,12 @@ span#hostname {
white-space: nowrap;
}
#viewCertificate {
margin: 0 3em;
}
#badCertTechnicalInfo {
margin: 3em;
margin: 3em 3em 1em;
overflow: auto;
white-space: pre-wrap;
}
@ -145,7 +181,6 @@ span#hostname {
display: none;
background-color: var(--in-content-box-background-hover) !important;
border-top: 1px solid var(--in-content-border-color);
position: absolute;
width: 100%;
padding: 1em 17.5%;
box-sizing: border-box;
@ -168,7 +203,6 @@ span#hostname {
background-color: var(--exception-button-container-background);
display: flex;
justify-content: end;
padding: 10px;
}
.exceptionDialogButtonContainer[hidden] {
@ -191,6 +225,33 @@ span#hostname {
background-image: url("chrome://browser/content/illustrations/error-malformed-url.svg");
}
.clockSkewError #errorPageContainer {
background-image: url("chrome://browser/content/illustrations/blue-berror.svg");
background-size: 18.5em;
}
.clockSkewError #returnButton {
display: none;
}
.clockSkewError #advancedButton {
display: none;
}
.clockSkewError #advancedPanelErrorTryAgain,
.clockSkewError #errorTryAgain {
display: block;
margin-top: 0.3em;
}
.clockSkewError #exceptionDialogButton {
display: none;
}
.clockSkewError #advancedPanelReturnButton {
display: none;
}
.malformedURI #errorTryAgain {
display: none;
}
@ -202,3 +263,28 @@ span#hostname {
#wrongSystemTimeWithoutReferencePanel {
display: none;
}
@media only screen and (max-width: 959px) {
#certificateErrorText {
/* The encoded certificate chain looks better when we're not
* wrapping words on big screens, but at some point we need
* to wrap to avoid overflowing */
word-wrap: anywhere;
}
}
@media only screen and (max-width: 480px) {
#badCertTechnicalInfo {
margin: 10px 10px 5px;
}
#viewCertificate {
margin: 0 10px;
}
#errorCode[href] {
/* Break the error code to avoid long codes overflowing the screen */
white-space: normal;
word-wrap: anywhere;
}
}

Просмотреть файл

@ -25,6 +25,12 @@
}
}
@media (min-resolution: 3dppx) {
:root {
--tabs-navbar-shadow-size: 0.33px;
}
}
/* Increase contrast of UI links on dark themes */
:root[lwt-popup-brighttext] panel .text-link {

Просмотреть файл

@ -1,7 +0,0 @@
<svg height="96" viewBox="0 0 96 96" width="96" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fill-rule="evenodd">
<path d="m54 87h-38.718c-4.1514504-.0042773-8.00579913-2.1539983-10.19089334-5.6838598-2.1850942-3.5298615-2.39050529-7.9383886-.54310666-11.6561402l29.718-59.46c2.0323569-4.06636891 6.1880314-6.63518463 10.734-6.63518463s8.7016431 2.56881572 10.734 6.63518463l19.0437959 38.0875919c-8.4035561 1.5187368-14.7777959 8.8711807-14.7777959 17.7124081v1.0104467c-3.547421 1.6851959-6 5.3009594-6 9.4895533z" fill="#ffe900" fill-rule="nonzero"/>
<path d="m39 27c0-3.3137085 2.6862915-6 6-6s6 2.6862915 6 6v24c0 3.3137085-2.6862915 6-6 6s-6-2.6862915-6-6zm6 49.5c-4.1421356 0-7.5-3.3578644-7.5-7.5s3.3578644-7.5 7.5-7.5 7.5 3.3578644 7.5 7.5-3.3578644 7.5-7.5 7.5z" fill="#3e2800"/>
<path d="m89.2954301 61.9390003c.4560585 1.2683141.7045699 2.6356354.7045699 4.0609997v6h1.5c2.4620372-.0002189 4.4671728 1.9781816 4.5 4.44v15c.0160526 1.203836-.4509571 2.3639032-1.296617 3.2208385-.8456598.8569353-1.99944 1.3392685-3.203383 1.3391615h-27c-2.4852814 0-4.5-2.0147186-4.5-4.5v-15c0-2.4852814 2.0147186-4.5 4.5-4.5h1.5v-6c0-6.627417 5.372583-12 12-12 2.9975478 0 5.7383932 1.0990736 7.8415359 2.9162204l-4.2654615 4.2654616c-.998662-.7424058-2.236069-1.181682-3.5760744-1.181682-3.3137085 0-6 2.6862915-6 6v6h12v-4.7655696z" fill="#b1b1b3" fill-rule="nonzero"/>
</g>
</svg>

До

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Просмотреть файл

@ -1,41 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<svg version="1.1"
xmlns="http://www.w3.org/2000/svg"
width="45"
height="45"
viewBox="0 0 45 45">
<style>
.icon-default {
fill: #999;
}
</style>
<defs>
<rect id="shape-lock-clasp-outer" x="8" y="2" width="28" height="40" rx="14" ry="14" />
<rect id="shape-lock-clasp-inner" x="14" y="8" width="16" height="28" rx="8" ry="8" />
<rect id="shape-lock-base" x="4" y="18" width="36" height="24" rx="3" ry="3" />
<mask id="mask-clasp-cutout">
<rect width="48" height="48" fill="#000" />
<use href="#shape-lock-clasp-outer" fill="#fff" />
<use href="#shape-lock-clasp-inner" fill="#000" />
<line x1="4" y1="38" x2="41" y2="3" stroke="#000" stroke-width="5.5" />
<line x1="4" y1="46" x2="41" y2="11" stroke="#000" stroke-width="5.5" />
<rect x="4" y="18" width="36" height="26" rx="6" ry="6" />
</mask>
<mask id="mask-base-cutout">
<rect width="45" height="45" fill="#000" />
<use href="#shape-lock-base" fill="#fff" />
<line x1="2.5" y1="41.5" x2="41" y2="5" stroke="#000" stroke-width="8.5" />
</mask>
</defs>
<use href="#shape-lock-clasp-outer" mask="url(#mask-clasp-cutout)" fill="#999" />
<use href="#shape-lock-base" mask="url(#mask-base-cutout)" fill="#999" />
<line x1="2.5" y1="41.5" x2="41" y2="5" stroke="#d92d21" stroke-width="5.5" />
<svg height="96" viewBox="0 0 96 96" width="96" xmlns="http://www.w3.org/2000/svg">
<g fill="none" fill-rule="evenodd">
<path d="m54 87h-38.718c-4.1514504-.0042773-8.00579913-2.1539983-10.19089334-5.6838598-2.1850942-3.5298615-2.39050529-7.9383886-.54310666-11.6561402l29.718-59.46c2.0323569-4.06636891 6.1880314-6.63518463 10.734-6.63518463s8.7016431 2.56881572 10.734 6.63518463l19.0437959 38.0875919c-8.4035561 1.5187368-14.7777959 8.8711807-14.7777959 17.7124081v1.0104467c-3.547421 1.6851959-6 5.3009594-6 9.4895533z" fill="#ffe900" fill-rule="nonzero"/>
<path d="m39 27c0-3.3137085 2.6862915-6 6-6s6 2.6862915 6 6v24c0 3.3137085-2.6862915 6-6 6s-6-2.6862915-6-6zm6 49.5c-4.1421356 0-7.5-3.3578644-7.5-7.5s3.3578644-7.5 7.5-7.5 7.5 3.3578644 7.5 7.5-3.3578644 7.5-7.5 7.5z" fill="#3e2800"/>
<path d="m89.2954301 61.9390003c.4560585 1.2683141.7045699 2.6356354.7045699 4.0609997v6h1.5c2.4620372-.0002189 4.4671728 1.9781816 4.5 4.44v15c.0160526 1.203836-.4509571 2.3639032-1.296617 3.2208385-.8456598.8569353-1.99944 1.3392685-3.203383 1.3391615h-27c-2.4852814 0-4.5-2.0147186-4.5-4.5v-15c0-2.4852814 2.0147186-4.5 4.5-4.5h1.5v-6c0-6.627417 5.372583-12 12-12 2.9975478 0 5.7383932 1.0990736 7.8415359 2.9162204l-4.2654615 4.2654616c-.998662-.7424058-2.236069-1.181682-3.5760744-1.181682-3.3137085 0-6 2.6862915-6 6v6h12v-4.7655696z" fill="#b1b1b3" fill-rule="nonzero"/>
</g>
</svg>

До

Ширина:  |  Высота:  |  Размер: 1.4 KiB

После

Ширина:  |  Высота:  |  Размер: 1.4 KiB

Просмотреть файл

@ -8,7 +8,6 @@
# to the location of the actual manifest.
skin/classic/browser/aboutNetError.css (../shared/aboutNetError.css)
skin/classic/browser/aboutNetError-new.css (../shared/aboutNetError-new.css)
skin/classic/browser/blockedSite.css (../shared/blockedSite.css)
skin/classic/browser/error-pages.css (../shared/error-pages.css)
skin/classic/browser/aboutRestartRequired.css (../shared/aboutRestartRequired.css)
@ -242,7 +241,6 @@
skin/classic/browser/update-badge.svg (../shared/update-badge.svg)
skin/classic/browser/warning.svg (../shared/warning.svg)
skin/classic/browser/cert-error.svg (../shared/incontent-icons/cert-error.svg)
skin/classic/browser/cert-error-new.svg (../shared/incontent-icons/cert-error-new.svg)
skin/classic/browser/wifi.svg (../shared/incontent-icons/wifi.svg)
skin/classic/browser/tab-crashed.svg (../shared/incontent-icons/tab-crashed.svg)
skin/classic/browser/welcome-back.svg (../shared/incontent-icons/welcome-back.svg)

Просмотреть файл

@ -21,11 +21,11 @@
#include "mozilla/dom/Document.h"
#include "nsIDOMWindow.h"
#include "nsIObserverService.h"
#include "nsIPresShell.h"
#include "nsIScriptError.h"
#include "nsIWindowMediator.h"
#include "nsIPrefService.h"
#include "mozilla/Preferences.h"
#include "mozilla/PresShell.h"
#include "mozilla/Printf.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
@ -38,6 +38,7 @@ nsChromeRegistry* nsChromeRegistry::gChromeRegistry;
// DO NOT use namespace mozilla; it'll break due to a naming conflict between
// mozilla::TextRange and a TextRange in OSX headers.
using mozilla::PresShell;
using mozilla::StyleSheet;
using mozilla::dom::Document;
using mozilla::dom::IsChromeURI;
@ -344,11 +345,11 @@ nsresult nsChromeRegistry::RefreshWindow(nsPIDOMWindowOuter* aWindow) {
if (!document) return NS_OK;
// Deal with the agent sheets first. Have to do all the style sets by hand.
nsCOMPtr<nsIPresShell> shell = document->GetShell();
if (shell) {
RefPtr<PresShell> presShell = document->GetPresShell();
if (presShell) {
// Reload only the chrome URL agent style sheets.
nsTArray<RefPtr<StyleSheet>> agentSheets;
rv = shell->GetAgentStyleSheets(agentSheets);
rv = presShell->GetAgentStyleSheets(agentSheets);
NS_ENSURE_SUCCESS(rv, rv);
nsTArray<RefPtr<StyleSheet>> newAgentSheets;
@ -370,7 +371,7 @@ nsresult nsChromeRegistry::RefreshWindow(nsPIDOMWindowOuter* aWindow) {
}
}
rv = shell->SetAgentStyleSheets(newAgentSheets);
rv = presShell->SetAgentStyleSheets(newAgentSheets);
NS_ENSURE_SUCCESS(rv, rv);
}

Просмотреть файл

@ -130,7 +130,17 @@ class App extends PureComponent {
// in this case maybe we'd like to do something else than a redirect.
// See: https://bugzilla.mozilla.org/show_bug.cgi?id=1509897
Route({
render: () => Redirect({ to: "/setup"}),
render: routeProps => {
const { pathname } = routeProps.location;
// The old about:debugging supported the following routes:
// about:debugging#workers, about:debugging#addons and about:debugging#tabs.
// Such links can still be found in external documentation pages.
// We redirect to This Firefox rather than the Setup Page here.
if (pathname === "/workers" || pathname === "/addons" || pathname === "/tabs") {
return Redirect({ to: `/runtime/${RUNTIMES.THIS_FIREFOX}`});
}
return Redirect({ to: "/setup"});
},
})
);
}

Просмотреть файл

@ -28,7 +28,7 @@ class ConnectSteps extends PureComponent {
{
className: "connect-page__step-list",
},
this.props.steps.map(step =>
...this.props.steps.map(step =>
Localized(
{
id: step.localizationId,

Просмотреть файл

@ -91,3 +91,26 @@ add_task(async function() {
await removeTab(tab);
});
/**
* Test that routes from old about:debugging redirect to this Firefox.
*/
add_task(async function testOldAboutDebuggingRoutes() {
info("Check that routes from old about:debugging redirect to this Firefox");
const { document, tab } = await openAboutDebugging();
const routes = ["addons", "tabs", "workers"];
for (const route of routes) {
info("Move to setup page before testing the route");
document.location.hash = "#/setup";
await waitUntil(() => document.querySelector(".js-connect-page"));
info(`Check that navigating to ${route} redirects to This Firefox`);
document.location.hash = route;
await waitUntil(() => document.querySelector(".js-runtime-page"));
is(document.location.hash, "#/runtime/this-firefox",
`${route} was redirected to This Firefox`);
}
await removeTab(tab);
});

Просмотреть файл

@ -17,6 +17,9 @@ const { Management } = ChromeUtils.import("resource://gre/modules/Extension.jsm"
const { ExtensionTestCommon } = ChromeUtils.import("resource://testing-common/ExtensionTestCommon.jsm");
async function openAboutDebugging(page, win) {
info("Turn off the new about:debugging for the test");
await pushPref("devtools.aboutdebugging.new-enabled", false);
info("opening about:debugging");
let url = "about:debugging";
if (page) {

Просмотреть файл

@ -64,6 +64,8 @@ loader.lazyRequireGetter(this, "createEditContextMenu",
"devtools/client/framework/toolbox-context-menu", true);
loader.lazyRequireGetter(this, "remoteClientManager",
"devtools/client/shared/remote-debugging/remote-client-manager.js", true);
loader.lazyRequireGetter(this, "ResponsiveUIManager",
"devtools/client/responsive.html/manager", true);
loader.lazyGetter(this, "domNodeConstants", () => {
return require("devtools/shared/dom-node-constants");
@ -1343,6 +1345,7 @@ Toolbox.prototype = {
},
_onPickerStarting: async function() {
this.tellRDMAboutPickerState(true);
this.pickerButton.isChecked = true;
await this.selectTool("inspector", "inspect_dom");
this.on("select", this.inspector.nodePicker.stop);
@ -1354,11 +1357,31 @@ Toolbox.prototype = {
},
_onPickerStopped: function() {
this.tellRDMAboutPickerState(false);
this.off("select", this.inspector.nodePicker.stop);
this.doc.removeEventListener("keypress", this._onPickerKeypress, true);
this.pickerButton.isChecked = false;
},
/**
* RDM sometimes simulates touch events. For this to work correctly at all times, it
* needs to know when the picker is active or not.
* This method communicates with the RDM Manager if it exists.
*
* @param {Boolean} state
*/
tellRDMAboutPickerState: async function(state) {
const { tab } = this.target;
if (!ResponsiveUIManager.isActiveForTab(tab) ||
await !this.target.actorHasMethod("emulation", "setElementPickerState")) {
return;
}
const ui = ResponsiveUIManager.getResponsiveUIForTab(tab);
await ui.emulationFront.setElementPickerState(state);
},
/**
* When the picker is canceled, make sure the toolbox
* gets the focus.

Просмотреть файл

@ -343,7 +343,7 @@ pref("devtools.responsive.showUserAgentInput", false);
#endif
// Enable new about:debugging.
pref("devtools.aboutdebugging.new-enabled", false);
pref("devtools.aboutdebugging.new-enabled", true);
// Show tab debug targets for This Firefox (on by default for local builds).
#ifdef MOZILLA_OFFICIAL

Просмотреть файл

@ -73,7 +73,7 @@ class NotificationBox extends Component {
// Message that should be shown when hovering over the close button
closeButtonTooltip: PropTypes.string,
// Wraps text when passed from console window as wrapping: true
wrapping: PropTypes.boolean,
wrapping: PropTypes.bool,
};
}

Просмотреть файл

@ -19,6 +19,9 @@ add_task(async function() {
});
async function performTests() {
// The TabContextMenu initializes its strings only on a focus or mouseover event.
// Calls focus event on the TabContextMenu early in the test.
gBrowser.selectedTab.focus();
const hud = await openNewTabAndConsole(TEST_URI);
const {jsterm} = hud;

Просмотреть файл

@ -177,6 +177,30 @@ const EmulationActor = protocol.ActorClassWithSpec(emulationSpec, {
_previousTouchEventsOverride: undefined,
/**
* Set the current element picker state.
*
* True means the element picker is currently active and we should not be emulating
* touch events.
* False means the element picker is not active and it is ok to emulate touch events.
*
* This actor method is meant to be called by the DevTools front-end. The reason for
* this is the following:
* RDM is the only current consumer of the touch simulator. RDM instantiates this actor
* on its own, whether or not the Toolbox is opened. That means it does so in its own
* Debugger Server instance.
* When the Toolbox is running, it uses a different DebuggerServer. Therefore, it is not
* possible for the touch simulator to know whether the picker is active or not. This
* state has to be sent by the client code of the Toolbox to this actor.
* If a future use case arises where we want to use the touch simulator from the Toolbox
* too, then we could add code in here to detect the picker mode as described in
* https://bugzilla.mozilla.org/show_bug.cgi?id=1409085#c3
* @param {Boolean} state
*/
setElementPickerState(state) {
this.touchSimulator.setElementPickerState(state);
},
setTouchEventsOverride(flag) {
if (this.getTouchEventsOverride() == flag) {
return false;

Просмотреть файл

@ -73,7 +73,23 @@ TouchSimulator.prototype = {
this.enabled = false;
},
/**
* Set the current element picker state value.
* True means the element picker is currently active and we should not be emulating
* touch events.
* False means the element picker is not active and it is ok to emulate touch events.
* @param {Boolean} state
*/
setElementPickerState(state) {
this._isPicking = state;
},
handleEvent(evt) {
// Bail out if devtools is in pick mode in the same tab.
if (this._isPicking) {
return;
}
// The gaia system window use an hybrid system even on the device which is
// a mix of mouse/touch events. So let's not cancel *all* mouse events
// if it is the current target.

Просмотреть файл

@ -123,6 +123,13 @@ const emulationSpec = generateActorSpec({
valueChanged: RetVal("boolean"),
},
},
setElementPickerState: {
request: {
state: Arg(0, "boolean"),
},
response: {},
},
},
});

Просмотреть файл

@ -28,6 +28,7 @@
#include "mozilla/Logging.h"
#include "mozilla/MediaFeatureChange.h"
#include "mozilla/Preferences.h"
#include "mozilla/PresShell.h"
#include "mozilla/ResultExtensions.h"
#include "mozilla/ScrollTypes.h"
#include "mozilla/Services.h"
@ -7878,8 +7879,9 @@ nsresult nsDocShell::RestoreFromHistory() {
} else {
rootViewParent = nullptr;
}
if (sibling && sibling->GetShell() && sibling->GetShell()->GetViewManager()) {
rootViewSibling = sibling->GetShell()->GetViewManager()->GetRootView();
if (sibling && sibling->GetPresShell() &&
sibling->GetPresShell()->GetViewManager()) {
rootViewSibling = sibling->GetPresShell()->GetViewManager()->GetRootView();
} else {
rootViewSibling = nullptr;
}

Просмотреть файл

@ -58,23 +58,6 @@ bool nsDocShellEditorData::GetEditable() {
return mMakeEditable || (mHTMLEditor != nullptr);
}
nsresult nsDocShellEditorData::CreateEditor() {
nsCOMPtr<nsIEditingSession> editingSession;
nsresult rv = GetEditingSession(getter_AddRefs(editingSession));
if (NS_FAILED(rv)) {
return rv;
}
nsCOMPtr<nsPIDOMWindowOuter> domWindow =
mDocShell ? mDocShell->GetWindow() : nullptr;
rv = editingSession->SetupEditorOnWindow(domWindow);
if (NS_FAILED(rv)) {
return rv;
}
return NS_OK;
}
nsresult nsDocShellEditorData::GetEditingSession(nsIEditingSession** aResult) {
EnsureEditingSession();

Просмотреть файл

@ -24,7 +24,6 @@ class nsDocShellEditorData {
nsresult MakeEditable(bool aWaitForUriLoad);
bool GetEditable();
nsresult CreateEditor();
nsresult GetEditingSession(nsIEditingSession** aResult);
mozilla::HTMLEditor* GetHTMLEditor() const { return mHTMLEditor; }
nsresult SetHTMLEditor(mozilla::HTMLEditor* aHTMLEditor);

Просмотреть файл

@ -9,6 +9,7 @@
#include "mozilla/dom/AnimationBinding.h"
#include "mozilla/dom/AnimationPlaybackEvent.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/DocumentInlines.h"
#include "mozilla/dom/DocumentTimeline.h"
#include "mozilla/AnimationEventDispatcher.h"
#include "mozilla/AnimationTarget.h"

Просмотреть файл

@ -19,6 +19,7 @@ struct JSContext;
namespace mozilla {
enum class PseudoStyleType : uint8_t;
class ComputedTimingFunction;
class EffectSet;

Просмотреть файл

@ -20,6 +20,7 @@
#include "mozilla/LayerAnimationInfo.h"
#include "mozilla/LookAndFeel.h" // For LookAndFeel::GetInt
#include "mozilla/KeyframeUtils.h"
#include "mozilla/PresShell.h"
#include "mozilla/ServoBindings.h"
#include "mozilla/StaticPrefs.h"
#include "mozilla/TypeTraits.h"
@ -31,8 +32,8 @@
#include "nsCSSPseudoElements.h" // For PseudoStyleType
#include "nsDOMMutationObserver.h" // For nsAutoAnimationMutationBatch
#include "nsIFrame.h"
#include "nsIPresShell.h"
#include "nsIScriptError.h"
#include "nsPresContextInlines.h"
#include "nsRefreshDriver.h"
namespace mozilla {
@ -1206,7 +1207,7 @@ bool KeyframeEffect::CanThrottleIfNotVisible(nsIFrame& aFrame) const {
return false;
}
nsIPresShell* presShell = GetPresShell();
PresShell* presShell = GetPresShell();
if (presShell && !presShell->IsActive()) {
return true;
}
@ -1408,12 +1409,12 @@ Document* KeyframeEffect::GetRenderedDocument() const {
return mTarget->mElement->GetComposedDoc();
}
nsIPresShell* KeyframeEffect::GetPresShell() const {
PresShell* KeyframeEffect::GetPresShell() const {
Document* doc = GetRenderedDocument();
if (!doc) {
return nullptr;
}
return doc->GetShell();
return doc->GetPresShell();
}
/* static */

Просмотреть файл

@ -34,7 +34,6 @@ struct JSContext;
class JSObject;
class nsIContent;
class nsIFrame;
class nsIPresShell;
namespace mozilla {
@ -45,6 +44,7 @@ struct AnimationRule;
struct TimingParams;
class EffectSet;
class ComputedStyle;
class PresShell;
namespace dom {
class ElementOrCSSPseudoElement;
@ -283,7 +283,7 @@ class KeyframeEffect : public AnimationEffect {
}
Document* GetRenderedDocument() const;
nsIPresShell* GetPresShell() const;
PresShell* GetPresShell() const;
// Associates a warning with the animated property set on the specified frame
// indicating why, for example, the property could not be animated on the

Просмотреть файл

@ -30,6 +30,7 @@
#include "nsCSSProps.h"
#include "nsCSSPseudoElements.h" // For PseudoStyleType
#include "nsIScriptError.h"
#include "nsPresContextInlines.h"
#include "nsTArray.h"
#include <algorithm> // For std::stable_sort, std::min

Просмотреть файл

@ -6,10 +6,10 @@
#include "PendingAnimationTracker.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/AnimationTimeline.h"
#include "mozilla/dom/Nullable.h"
#include "nsIFrame.h"
#include "nsIPresShell.h"
#include "nsTransitionManager.h" // For CSSTransition
using mozilla::dom::Nullable;
@ -173,7 +173,7 @@ void PendingAnimationTracker::EnsurePaintIsScheduled() {
return;
}
nsIPresShell* presShell = mDocument->GetShell();
PresShell* presShell = mDocument->GetPresShell();
if (!presShell) {
return;
}

Просмотреть файл

@ -5,11 +5,12 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "AnonymousContent.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/AnonymousContentBinding.h"
#include "nsComputedDOMStyle.h"
#include "nsCycleCollectionParticipant.h"
#include "mozilla/dom/Document.h"
#include "nsIFrame.h"
#include "nsStyledElement.h"
#include "HTMLCanvasElement.h"
@ -185,8 +186,7 @@ void AnonymousContent::GetComputedStylePropertyValue(
return;
}
nsIPresShell* shell = element->OwnerDoc()->GetShell();
if (!shell) {
if (!element->OwnerDoc()->GetPresShell()) {
aRv.Throw(NS_ERROR_NOT_AVAILABLE);
return;
}

Просмотреть файл

@ -9,6 +9,7 @@
#include "nsIFrame.h"
#include "nsContentUtils.h"
#include "nsLayoutUtils.h"
#include "mozilla/PresShell.h"
#include "mozilla/ServoBindings.h"
namespace mozilla {
@ -252,7 +253,7 @@ void DOMIntersectionObserver::Update(Document* aDocument,
rootFrame, rootRectRelativeToRootFrame, containingBlock);
}
} else {
nsCOMPtr<nsIPresShell> presShell = aDocument->GetShell();
RefPtr<PresShell> presShell = aDocument->GetPresShell();
if (presShell) {
rootFrame = presShell->GetRootScrollFrame();
if (rootFrame) {

Просмотреть файл

@ -2251,9 +2251,9 @@ void Document::RemoveDocStyleSheetsFromStyleSets() {
sheet->ClearAssociatedDocumentOrShadowRoot();
if (sheet->IsApplicable()) {
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {
shell->StyleSet()->RemoveDocStyleSheet(sheet);
RefPtr<PresShell> presShell = GetPresShell();
if (presShell) {
presShell->StyleSet()->RemoveDocStyleSheet(sheet);
}
}
// XXX Tell observers?
@ -2267,9 +2267,9 @@ void Document::RemoveStyleSheetsFromStyleSets(
sheet->ClearAssociatedDocumentOrShadowRoot();
if (sheet->IsApplicable()) {
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {
shell->StyleSet()->RemoveStyleSheet(aType, sheet);
RefPtr<PresShell> presShell = GetPresShell();
if (presShell) {
presShell->StyleSet()->RemoveStyleSheet(aType, sheet);
}
}
// XXX Tell observers?
@ -2323,10 +2323,10 @@ void Document::ResetStylesheetsToURI(nsIURI* aURI) {
}
// Now set up our style sets
if (nsIPresShell* shell = GetShell()) {
FillStyleSet(shell->StyleSet());
if (shell->StyleSet()->StyleSheetsHaveChanged()) {
shell->ApplicableStylesChanged();
if (PresShell* presShell = GetPresShell()) {
FillStyleSet(presShell->StyleSet());
if (presShell->StyleSet()->StyleSheetsHaveChanged()) {
presShell->ApplicableStylesChanged();
}
}
}
@ -3630,7 +3630,7 @@ static inline void AssertNoStaleServoDataIn(nsINode& aSubtreeRoot) {
#endif
}
already_AddRefed<nsIPresShell> Document::CreateShell(
already_AddRefed<PresShell> Document::CreatePresShell(
nsPresContext* aContext, nsViewManager* aViewManager,
UniquePtr<ServoStyleSet> aStyleSet) {
NS_ASSERTION(!mPresShell, "We have a presshell already!");
@ -3640,18 +3640,20 @@ already_AddRefed<nsIPresShell> Document::CreateShell(
FillStyleSet(aStyleSet.get());
AssertNoStaleServoDataIn(*this);
RefPtr<PresShell> shell = new PresShell;
RefPtr<PresShell> presShell = new PresShell;
// Note: we don't hold a ref to the shell (it holds a ref to us)
mPresShell = shell;
shell->Init(this, aContext, aViewManager, std::move(aStyleSet));
mPresShell = presShell;
presShell->Init(this, aContext, aViewManager, std::move(aStyleSet));
// Make sure to never paint if we belong to an invisible DocShell.
nsCOMPtr<nsIDocShell> docShell(mDocumentContainer);
if (docShell && docShell->IsInvisible()) shell->SetNeverPainting(true);
if (docShell && docShell->IsInvisible()) {
presShell->SetNeverPainting(true);
}
MOZ_LOG(gDocumentLeakPRLog, LogLevel::Debug,
("DOCUMENT %p with PressShell %p and DocShell %p", this, shell.get(),
docShell.get()));
("DOCUMENT %p with PressShell %p and DocShell %p", this,
presShell.get(), docShell.get()));
mExternalResourceMap.ShowViewers();
@ -3663,11 +3665,11 @@ already_AddRefed<nsIPresShell> Document::CreateShell(
// is ready to update we'll flush the font set.
MarkUserFontSetDirty();
return shell.forget();
return presShell.forget();
}
void Document::UpdateFrameRequestCallbackSchedulingState(
nsIPresShell* aOldShell) {
PresShell* aOldPresShell) {
// If the condition for shouldBeScheduled changes to depend on some other
// variable, add UpdateFrameRequestCallbackSchedulingState() calls to the
// places where that variable can change.
@ -3678,7 +3680,7 @@ void Document::UpdateFrameRequestCallbackSchedulingState(
return;
}
nsIPresShell* presShell = aOldShell ? aOldShell : mPresShell;
PresShell* presShell = aOldPresShell ? aOldPresShell : mPresShell;
MOZ_RELEASE_ASSERT(presShell);
nsRefreshDriver* rd = presShell->GetPresContext()->RefreshDriver();
@ -3738,7 +3740,7 @@ bool Document::ShouldThrottleFrameRequests() {
return false;
}
void Document::DeleteShell() {
void Document::DeletePresShell() {
mExternalResourceMap.HideViewers();
if (nsPresContext* presContext = mPresShell->GetPresContext()) {
presContext->RefreshDriver()->CancelPendingFullscreenEvents(this);
@ -3755,9 +3757,9 @@ void Document::DeleteShell() {
// no point on it.
MarkUserFontSetDirty();
nsIPresShell* oldShell = mPresShell;
PresShell* oldPresShell = mPresShell;
mPresShell = nullptr;
UpdateFrameRequestCallbackSchedulingState(oldShell);
UpdateFrameRequestCallbackSchedulingState(oldPresShell);
mStyleSetFilled = false;
ClearStaleServoData();
@ -3952,9 +3954,9 @@ void Document::RemoveChildNode(nsIContent* aKid, bool aNotify) {
}
void Document::AddStyleSheetToStyleSets(StyleSheet* aSheet) {
if (nsIPresShell* shell = GetShell()) {
shell->StyleSet()->AddDocStyleSheet(aSheet, this);
shell->ApplicableStylesChanged();
if (PresShell* presShell = GetPresShell()) {
presShell->StyleSet()->AddDocStyleSheet(aSheet, this);
presShell->ApplicableStylesChanged();
}
}
@ -3992,9 +3994,9 @@ void Document::NotifyStyleSheetRemoved(StyleSheet* aSheet,
}
void Document::RemoveStyleSheetFromStyleSets(StyleSheet* aSheet) {
if (nsIPresShell* shell = GetShell()) {
shell->StyleSet()->RemoveDocStyleSheet(aSheet);
shell->ApplicableStylesChanged();
if (PresShell* presShell = GetPresShell()) {
presShell->StyleSet()->RemoveDocStyleSheet(aSheet);
presShell->ApplicableStylesChanged();
}
}
@ -4174,10 +4176,10 @@ nsresult Document::AddAdditionalStyleSheet(additionalSheetType aType,
mAdditionalSheets[aType].AppendElement(aSheet);
if (nsIPresShell* shell = GetShell()) {
if (PresShell* presShell = GetPresShell()) {
SheetType type = ConvertAdditionalSheetType(aType);
shell->StyleSet()->AppendStyleSheet(type, aSheet);
shell->ApplicableStylesChanged();
presShell->StyleSet()->AppendStyleSheet(type, aSheet);
presShell->ApplicableStylesChanged();
}
// Passing false, so documet.styleSheets.length will not be affected by
@ -4199,10 +4201,10 @@ void Document::RemoveAdditionalStyleSheet(additionalSheetType aType,
if (!mIsGoingAway) {
MOZ_ASSERT(sheetRef->IsApplicable());
if (nsIPresShell* shell = GetShell()) {
if (PresShell* presShell = GetPresShell()) {
SheetType type = ConvertAdditionalSheetType(aType);
shell->StyleSet()->RemoveStyleSheet(type, sheetRef);
shell->ApplicableStylesChanged();
presShell->StyleSet()->RemoveStyleSheet(type, sheetRef);
presShell->ApplicableStylesChanged();
}
}
@ -4941,8 +4943,8 @@ void Document::UnblockDOMContentLoaded() {
("DOCUMENT %p UnblockDOMContentLoaded", this));
mDidFireDOMContentLoaded = true;
if (nsIPresShell* shell = GetShell()) {
shell->GetRefreshDriver()->NotifyDOMContentLoaded();
if (PresShell* presShell = GetPresShell()) {
presShell->GetRefreshDriver()->NotifyDOMContentLoaded();
}
MOZ_ASSERT(mReadyState == READYSTATE_INTERACTIVE);
@ -4971,8 +4973,8 @@ void Document::DocumentStatesChanged(EventStates aStateMask) {
}
void Document::StyleRuleChanged(StyleSheet* aSheet, css::Rule* aStyleRule) {
if (nsIPresShell* shell = GetShell()) {
shell->ApplicableStylesChanged();
if (PresShell* presShell = GetPresShell()) {
presShell->ApplicableStylesChanged();
}
if (!StyleSheetChangeEventsEnabled()) {
@ -4984,8 +4986,8 @@ void Document::StyleRuleChanged(StyleSheet* aSheet, css::Rule* aStyleRule) {
}
void Document::StyleRuleAdded(StyleSheet* aSheet, css::Rule* aStyleRule) {
if (nsIPresShell* shell = GetShell()) {
shell->ApplicableStylesChanged();
if (PresShell* presShell = GetPresShell()) {
presShell->ApplicableStylesChanged();
}
if (!StyleSheetChangeEventsEnabled()) {
@ -4997,8 +4999,8 @@ void Document::StyleRuleAdded(StyleSheet* aSheet, css::Rule* aStyleRule) {
}
void Document::StyleRuleRemoved(StyleSheet* aSheet, css::Rule* aStyleRule) {
if (nsIPresShell* shell = GetShell()) {
shell->ApplicableStylesChanged();
if (PresShell* presShell = GetPresShell()) {
presShell->ApplicableStylesChanged();
}
if (!StyleSheetChangeEventsEnabled()) {
@ -5011,17 +5013,17 @@ void Document::StyleRuleRemoved(StyleSheet* aSheet, css::Rule* aStyleRule) {
#undef DO_STYLESHEET_NOTIFICATION
static Element* GetCustomContentContainer(nsIPresShell* aShell) {
if (!aShell || !aShell->GetCanvasFrame()) {
static Element* GetCustomContentContainer(PresShell* aPresShell) {
if (!aPresShell || !aPresShell->GetCanvasFrame()) {
return nullptr;
}
return aShell->GetCanvasFrame()->GetCustomContentContainer();
return aPresShell->GetCanvasFrame()->GetCustomContentContainer();
}
static void InsertAnonContentIntoCanvas(AnonymousContent& aAnonContent,
nsIPresShell* aShell) {
Element* container = GetCustomContentContainer(aShell);
PresShell* aPresShell) {
Element* container = GetCustomContentContainer(aPresShell);
if (!container) {
return;
}
@ -5031,7 +5033,7 @@ static void InsertAnonContentIntoCanvas(AnonymousContent& aAnonContent,
return;
}
aShell->GetCanvasFrame()->ShowCustomContentContainer();
aPresShell->GetCanvasFrame()->ShowCustomContentContainer();
}
already_AddRefed<AnonymousContent> Document::InsertAnonymousContent(
@ -5048,14 +5050,14 @@ already_AddRefed<AnonymousContent> Document::InsertAnonymousContent(
MakeRefPtr<AnonymousContent>(clone.forget().downcast<Element>());
mAnonymousContents.AppendElement(anonContent);
InsertAnonContentIntoCanvas(*anonContent, GetShell());
InsertAnonContentIntoCanvas(*anonContent, GetPresShell());
return anonContent.forget();
}
static void RemoveAnonContentFromCanvas(AnonymousContent& aAnonContent,
nsIPresShell* aShell) {
RefPtr<Element> container = GetCustomContentContainer(aShell);
PresShell* aPresShell) {
RefPtr<Element> container = GetCustomContentContainer(aPresShell);
if (!container) {
return;
}
@ -5072,10 +5074,11 @@ void Document::RemoveAnonymousContent(AnonymousContent& aContent,
}
mAnonymousContents.RemoveElementAt(index);
RemoveAnonContentFromCanvas(aContent, GetShell());
RemoveAnonContentFromCanvas(aContent, GetPresShell());
if (mAnonymousContents.IsEmpty() && GetCustomContentContainer(GetShell())) {
GetShell()->GetCanvasFrame()->HideCustomContentContainer();
if (mAnonymousContents.IsEmpty() &&
GetCustomContentContainer(GetPresShell())) {
GetPresShell()->GetCanvasFrame()->HideCustomContentContainer();
}
}
@ -5085,14 +5088,14 @@ Element* Document::GetAnonRootIfInAnonymousContentContainer(
return nullptr;
}
nsIPresShell* shell = GetShell();
if (!shell || !shell->GetCanvasFrame()) {
PresShell* presShell = GetPresShell();
if (!presShell || !presShell->GetCanvasFrame()) {
return nullptr;
}
nsAutoScriptBlocker scriptBlocker;
nsCOMPtr<Element> customContainer =
shell->GetCanvasFrame()->GetCustomContentContainer();
presShell->GetCanvasFrame()->GetCustomContentContainer();
if (!customContainer) {
return nullptr;
}
@ -5526,9 +5529,9 @@ void Document::EnableStyleSheetsForSetInternal(const nsAString& aSheetSet,
if (aUpdateCSSLoader) {
CSSLoader()->DocumentStyleSheetSetChanged();
}
if (nsIPresShell* shell = GetShell()) {
if (shell->StyleSet()->StyleSheetsHaveChanged()) {
shell->ApplicableStylesChanged();
if (PresShell* presShell = GetPresShell()) {
if (presShell->StyleSet()->StyleSheetsHaveChanged()) {
presShell->ApplicableStylesChanged();
}
}
}
@ -5891,10 +5894,10 @@ void Document::DoNotifyPossibleTitleChange() {
nsAutoString title;
GetTitle(title);
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {
RefPtr<PresShell> presShell = GetPresShell();
if (presShell) {
nsCOMPtr<nsISupports> container =
shell->GetPresContext()->GetContainerWeak();
presShell->GetPresContext()->GetContainerWeak();
if (container) {
nsCOMPtr<nsIBaseWindow> docShellWin = do_QueryInterface(container);
if (docShellWin) {
@ -7114,8 +7117,8 @@ void Document::FlushPendingNotifications(mozilla::ChangesToFlush aFlush) {
mParentDocument->FlushPendingNotifications(parentFlush);
}
if (nsIPresShell* shell = GetShell()) {
shell->FlushPendingNotifications(aFlush);
if (RefPtr<PresShell> presShell = GetPresShell()) {
presShell->FlushPendingNotifications(aFlush);
}
}
@ -7315,10 +7318,11 @@ already_AddRefed<Element> Document::CreateElem(const nsAString& aName,
}
bool Document::IsSafeToFlush() const {
nsIPresShell* shell = GetShell();
if (!shell) return true;
return shell->IsSafeToFlush();
PresShell* presShell = GetPresShell();
if (!presShell) {
return true;
}
return presShell->IsSafeToFlush();
}
void Document::Sanitize() {
@ -8303,12 +8307,12 @@ static void FireOrClearDelayedEvents(nsTArray<nsCOMPtr<Document>>& aDocuments,
// closed before this event ran.
if (!aDocuments[i]->EventHandlingSuppressed()) {
fm->FireDelayedEvents(aDocuments[i]);
nsCOMPtr<nsIPresShell> shell = aDocuments[i]->GetShell();
if (shell) {
RefPtr<PresShell> presShell = aDocuments[i]->GetPresShell();
if (presShell) {
// Only fire events for active documents.
bool fire = aFireEvents && aDocuments[i]->GetInnerWindow() &&
aDocuments[i]->GetInnerWindow()->IsCurrentInnerWindow();
shell->FireOrClearDelayedEvents(fire);
presShell->FireOrClearDelayedEvents(fire);
}
}
}
@ -8790,9 +8794,9 @@ void Document::SetScrollToRef(nsIURI* aDocumentURI) {
void Document::ScrollToRef() {
if (mScrolledToRefAlready) {
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {
shell->ScrollToAnchor();
RefPtr<PresShell> presShell = GetPresShell();
if (presShell) {
presShell->ScrollToAnchor();
}
return;
}
@ -8801,8 +8805,8 @@ void Document::ScrollToRef() {
return;
}
nsCOMPtr<nsIPresShell> shell = GetShell();
if (shell) {
RefPtr<PresShell> presShell = GetPresShell();
if (presShell) {
nsresult rv = NS_ERROR_FAILURE;
// We assume that the bytes are in UTF-8, as it says in the spec:
// http://www.w3.org/TR/html4/appendix/notes.html#h-B.2.1
@ -8810,7 +8814,7 @@ void Document::ScrollToRef() {
// Check an empty string which might be caused by the UTF-8 conversion
if (!ref.IsEmpty()) {
// Note that GoToAnchor will handle flushing layout as needed.
rv = shell->GoToAnchor(ref, mChangeScrollPosWhenScrollingToRef);
rv = presShell->GoToAnchor(ref, mChangeScrollPosWhenScrollingToRef);
} else {
rv = NS_ERROR_FAILURE;
}
@ -8825,7 +8829,8 @@ void Document::ScrollToRef() {
if (unescaped) {
NS_ConvertUTF8toUTF16 utf16Str(buff);
if (!utf16Str.IsEmpty()) {
rv = shell->GoToAnchor(utf16Str, mChangeScrollPosWhenScrollingToRef);
rv = presShell->GoToAnchor(utf16Str,
mChangeScrollPosWhenScrollingToRef);
}
}
@ -8836,7 +8841,7 @@ void Document::ScrollToRef() {
rv = encoding->DecodeWithoutBOMHandling(unescaped ? buff : mScrollToRef,
ref);
if (NS_SUCCEEDED(rv) && !ref.IsEmpty()) {
rv = shell->GoToAnchor(ref, mChangeScrollPosWhenScrollingToRef);
rv = presShell->GoToAnchor(ref, mChangeScrollPosWhenScrollingToRef);
}
}
}
@ -9171,8 +9176,8 @@ void Document::ScheduleSVGUseElementShadowTreeUpdate(
mSVGUseElementsNeedingShadowTreeUpdate.PutEntry(&aUseElement);
if (nsIPresShell* shell = GetShell()) {
shell->EnsureStyleFlush();
if (PresShell* presShell = GetPresShell()) {
presShell->EnsureStyleFlush();
}
}
@ -9258,12 +9263,12 @@ already_AddRefed<nsDOMCaretPosition> Document::CaretPositionFromPoint(
FlushPendingNotifications(FlushType::Layout);
nsIPresShell* ps = GetShell();
if (!ps) {
PresShell* presShell = GetPresShell();
if (!presShell) {
return nullptr;
}
nsIFrame* rootFrame = ps->GetRootFrame();
nsIFrame* rootFrame = presShell->GetRootFrame();
// XUL docs, unlike HTML, have no frame tree until everything's done loading
if (!rootFrame) {
@ -9280,7 +9285,7 @@ already_AddRefed<nsDOMCaretPosition> Document::CaretPositionFromPoint(
// We require frame-relative coordinates for GetContentOffsetsFromPoint.
nsPoint aOffset;
nsCOMPtr<nsIWidget> widget = nsContentUtils::GetWidget(ps, &aOffset);
nsCOMPtr<nsIWidget> widget = nsContentUtils::GetWidget(presShell, &aOffset);
LayoutDeviceIntPoint refPoint = nsContentUtils::ToWidgetPoint(
CSSPoint(aX, aY), aOffset, GetPresContext());
nsPoint adjustedPoint =
@ -10222,10 +10227,10 @@ void Document::CleanupFullscreenState() {
mFullscreenRoot = nullptr;
// Restore the zoom level that was in place prior to entering fullscreen.
if (nsIPresShell* shell = GetShell()) {
if (shell->GetMobileViewportManager()) {
shell->SetResolutionAndScaleTo(mSavedResolution,
nsIPresShell::ChangeOrigin::eMainThread);
if (PresShell* presShell = GetPresShell()) {
if (presShell->GetMobileViewportManager()) {
presShell->SetResolutionAndScaleTo(
mSavedResolution, nsIPresShell::ChangeOrigin::eMainThread);
}
}
@ -10616,13 +10621,14 @@ bool Document::ApplyFullscreen(UniquePtr<FullscreenRequest> aRequest) {
// fixed elements are sized to the layout viewport).
// This also ensures that things like video controls aren't zoomed in
// when in fullscreen mode.
if (nsIPresShell* shell = child->GetShell()) {
if (PresShell* presShell = child->GetPresShell()) {
if (RefPtr<MobileViewportManager> manager =
shell->GetMobileViewportManager()) {
presShell->GetMobileViewportManager()) {
// Save the previous resolution so it can be restored.
child->mSavedResolution = shell->GetResolution();
shell->SetResolutionAndScaleTo(manager->ComputeIntrinsicResolution(),
nsIPresShell::ChangeOrigin::eMainThread);
child->mSavedResolution = presShell->GetResolution();
presShell->SetResolutionAndScaleTo(
manager->ComputeIntrinsicResolution(),
nsIPresShell::ChangeOrigin::eMainThread);
}
}
@ -10892,8 +10898,8 @@ bool Document::SetPointerLock(Element* aElement, StyleCursorKind aCursorStyle) {
}
#endif
nsIPresShell* shell = GetShell();
if (!shell) {
PresShell* presShell = GetPresShell();
if (!presShell) {
NS_WARNING("SetPointerLock(): No PresShell");
if (!aElement) {
// If we are unlocking pointer lock, but for some reason the doc
@ -10904,19 +10910,19 @@ bool Document::SetPointerLock(Element* aElement, StyleCursorKind aCursorStyle) {
}
return false;
}
nsPresContext* presContext = shell->GetPresContext();
nsPresContext* presContext = presShell->GetPresContext();
if (!presContext) {
NS_WARNING("SetPointerLock(): Unable to get PresContext");
return false;
}
nsCOMPtr<nsIWidget> widget;
nsIFrame* rootFrame = shell->GetRootFrame();
nsIFrame* rootFrame = presShell->GetRootFrame();
if (!NS_WARN_IF(!rootFrame)) {
widget = rootFrame->GetNearestWidget();
NS_WARNING_ASSERTION(widget,
"SetPointerLock(): Unable to find widget in "
"shell->GetRootFrame()->GetNearestWidget();");
"presShell->GetRootFrame()->GetNearestWidget();");
if (aElement && !widget) {
return false;
}
@ -11696,8 +11702,8 @@ void Document::FlushUserFontSet() {
if (gfxPlatform::GetPlatform()->DownloadableFontsEnabled()) {
nsTArray<nsFontFaceRuleContainer> rules;
nsIPresShell* shell = GetShell();
if (shell && !shell->StyleSet()->AppendFontFaceRules(rules)) {
PresShell* presShell = GetPresShell();
if (presShell && !presShell->StyleSet()->AppendFontFaceRules(rules)) {
return;
}
@ -11715,8 +11721,8 @@ void Document::FlushUserFontSet() {
// reflect that we're modifying @font-face rules. (However,
// without a reflow, nothing will happen to start any downloads
// that are needed.)
if (changed && shell) {
if (nsPresContext* presContext = shell->GetPresContext()) {
if (changed && presShell) {
if (nsPresContext* presContext = presShell->GetPresContext()) {
presContext->UserFontSetUpdated();
}
}
@ -11728,8 +11734,8 @@ void Document::MarkUserFontSetDirty() {
return;
}
mFontFaceSetDirty = true;
if (nsIPresShell* shell = GetShell()) {
shell->EnsureStyleFlush();
if (PresShell* presShell = GetPresShell()) {
presShell->EnsureStyleFlush();
}
}

Просмотреть файл

@ -6,6 +6,7 @@
#ifndef mozilla_dom_Document_h___
#define mozilla_dom_Document_h___
#include "mozilla/EventStates.h" // for EventStates
#include "mozilla/FlushType.h" // for enum
#include "mozilla/Pair.h" // for Pair
#include "nsAutoPtr.h" // for member
@ -23,7 +24,6 @@
#include "nsILoadGroup.h" // for member (in nsCOMPtr)
#include "nsINode.h" // for base class
#include "nsIParser.h"
#include "nsIPresShell.h"
#include "nsIChannelEventSink.h"
#include "nsIProgressEventSink.h"
#include "nsIRadioGroupContainer.h"
@ -138,6 +138,7 @@ class EventListenerManager;
class FullscreenExit;
class FullscreenRequest;
class PendingAnimationTracker;
class PresShell;
class ServoStyleSet;
class SMILAnimationController;
enum class StyleCursorKind : uint8_t;
@ -470,8 +471,8 @@ class Document : public nsINode,
func_, params_); \
/* FIXME(emilio): Apparently we can keep observing from the BFCache? That \
looks bogus. */ \
if (nsIPresShell* shell = GetObservingShell()) { \
shell->func_ params_; \
if (PresShell* presShell = GetObservingPresShell()) { \
presShell->func_ params_; \
} \
} while (0)
@ -1243,27 +1244,21 @@ class Document : public nsINode,
* method is responsible for calling BeginObservingDocument() on the
* presshell if the presshell should observe document mutations.
*/
already_AddRefed<nsIPresShell> CreateShell(
already_AddRefed<PresShell> CreatePresShell(
nsPresContext* aContext, nsViewManager* aViewManager,
UniquePtr<ServoStyleSet> aStyleSet);
void DeleteShell();
void DeletePresShell();
nsIPresShell* GetShell() const {
PresShell* GetPresShell() const {
return GetBFCacheEntry() ? nullptr : mPresShell;
}
nsIPresShell* GetObservingShell() const {
return mPresShell && mPresShell->IsObservingDocument() ? mPresShell
: nullptr;
}
inline PresShell* GetObservingPresShell() const;
// Return whether the presshell for this document is safe to flush.
bool IsSafeToFlush() const;
nsPresContext* GetPresContext() const {
nsIPresShell* shell = GetShell();
return shell ? shell->GetPresContext() : nullptr;
}
inline nsPresContext* GetPresContext() const;
bool HasShellOrBFCacheEntry() const { return mPresShell || mBFCacheEntry; }
@ -2518,7 +2513,7 @@ class Document : public nsINode,
* null.
*/
void SetDisplayDocument(Document* aDisplayDocument) {
MOZ_ASSERT(!GetShell() && !GetContainer() && !GetWindow(),
MOZ_ASSERT(!GetPresShell() && !GetContainer() && !GetWindow(),
"Shouldn't set mDisplayDocument on documents that already "
"have a presentation or a docshell or a window");
MOZ_ASSERT(aDisplayDocument, "Must not be null");
@ -3857,7 +3852,7 @@ class Document : public nsINode,
// mPresShell is becoming null; in that case it will be used to get hold of
// the relevant refresh driver.
void UpdateFrameRequestCallbackSchedulingState(
nsIPresShell* aOldShell = nullptr);
PresShell* aOldPresShell = nullptr);
// Helper for GetScrollingElement/IsScrollingElement.
bool IsPotentiallyScrollable(HTMLBodyElement* aBody);
@ -4337,7 +4332,7 @@ class Document : public nsINode,
// won't be collected
uint32_t mMarkedCCGeneration;
nsIPresShell* mPresShell;
PresShell* mPresShell;
nsCOMArray<nsINode> mSubtreeModifiedTargets;
uint32_t mSubtreeModifiedDepth;

Просмотреть файл

@ -6,14 +6,26 @@
#ifndef mozilla_dom_DocumentInlines_h
#define mozilla_dom_DocumentInlines_h
#include "nsContentUtils.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/HTMLBodyElement.h"
#include "nsContentUtils.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsStyleSheetService.h"
namespace mozilla {
namespace dom {
inline PresShell* Document::GetObservingPresShell() const {
return mPresShell && mPresShell->IsObservingDocument() ? mPresShell : nullptr;
}
inline nsPresContext* Document::GetPresContext() const {
PresShell* presShell = GetPresShell();
return presShell ? presShell->GetPresContext() : nullptr;
}
inline HTMLBodyElement* Document::GetBodyElement() {
return static_cast<HTMLBodyElement*>(GetHtmlChildElement(nsGkAtoms::body));
}

Просмотреть файл

@ -6,6 +6,7 @@
#include "DocumentOrShadowRoot.h"
#include "mozilla/EventStateManager.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/HTMLInputElement.h"
#include "mozilla/dom/ShadowRoot.h"
@ -244,12 +245,12 @@ static void QueryNodesFromRect(DocumentOrShadowRoot& aRoot, const nsRect& aRect,
doc->FlushPendingNotifications(FlushType::Layout);
}
nsIPresShell* ps = doc->GetShell();
if (!ps) {
PresShell* presShell = doc->GetPresShell();
if (!presShell) {
return;
}
nsIFrame* rootFrame = ps->GetRootFrame();
nsIFrame* rootFrame = presShell->GetRootFrame();
// XUL docs, unlike HTML, have no frame tree until everything's done loading
if (!rootFrame) {
return; // return null to premature XUL callers as a reminder to wait

Просмотреть файл

@ -34,7 +34,6 @@
#include "nsIURL.h"
#include "nsContainerFrame.h"
#include "nsIAnonymousContentCreator.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsStyleConsts.h"
#include "nsString.h"
@ -68,6 +67,7 @@
#include "mozilla/FullscreenChange.h"
#include "mozilla/InternalMutationEvent.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/PresShell.h"
#include "mozilla/RestyleManager.h"
#include "mozilla/ScrollTypes.h"
#include "mozilla/SizeOfState.h"
@ -448,7 +448,7 @@ Element::StyleStateLocks Element::LockedStyleStates() const {
void Element::NotifyStyleStateChange(EventStates aStates) {
Document* doc = GetComposedDoc();
if (doc) {
nsIPresShell* presShell = doc->GetShell();
RefPtr<PresShell> presShell = doc->GetPresShell();
if (presShell) {
nsAutoScriptBlocker scriptBlocker;
presShell->ContentStateChanged(doc, this, aStates);
@ -527,7 +527,7 @@ static bool MayNeedToLoadXBLBinding(const Document& aDocument,
// Otherwise, don't do anything else here unless we're dealing with
// XUL or an HTML element that may have a plugin-related overlay
// (i.e. object or embed).
if (!aDocument.GetShell() || aElement.GetPrimaryFrame()) {
if (!aDocument.GetPresShell() || aElement.GetPrimaryFrame()) {
return false;
}
@ -698,8 +698,8 @@ nsIScrollableFrame* Element::GetScrollFrame(nsIFrame** aFrame,
if (isScrollingElement) {
// Our scroll info should map to the root scrollable frame if there is one.
if (nsIPresShell* shell = doc->GetShell()) {
return shell->GetRootScrollFrameAsScrollable();
if (PresShell* presShell = doc->GetPresShell()) {
return presShell->GetRootScrollFrameAsScrollable();
}
}
@ -731,7 +731,7 @@ void Element::ScrollIntoView(const ScrollIntoViewOptions& aOptions) {
}
// Get the presentation shell
nsCOMPtr<nsIPresShell> presShell = document->GetShell();
RefPtr<PresShell> presShell = document->GetPresShell();
if (!presShell) {
return;
}
@ -990,7 +990,7 @@ nsRect Element::GetClientAreaRect() {
// We will always have a pres shell if we have a pres context, and we will
// only get here if we have a pres context from the root content document
// check
nsIPresShell* presShell = doc->GetShell();
PresShell* presShell = doc->GetPresShell();
// Ensure up to date dimensions, but don't reflow
RefPtr<nsViewManager> viewManager = presShell->GetViewManager();
@ -1198,8 +1198,8 @@ already_AddRefed<ShadowRoot> Element::AttachShadowWithoutNameChecks(
DOCUMENT_FRAGMENT_NODE);
if (Document* doc = GetComposedDoc()) {
if (nsIPresShell* shell = doc->GetShell()) {
shell->DestroyFramesForAndRestyle(this);
if (PresShell* presShell = doc->GetPresShell()) {
presShell->DestroyFramesForAndRestyle(this);
}
}
MOZ_ASSERT(!GetPrimaryFrame());
@ -1319,8 +1319,8 @@ void Element::UnattachShadow() {
nsAutoScriptBlocker scriptBlocker;
if (Document* doc = GetComposedDoc()) {
if (nsIPresShell* shell = doc->GetShell()) {
shell->DestroyFramesForAndRestyle(this);
if (PresShell* presShell = doc->GetPresShell()) {
presShell->DestroyFramesForAndRestyle(this);
}
}
MOZ_ASSERT(!GetPrimaryFrame());
@ -2041,8 +2041,8 @@ nsresult Element::SetSMILOverrideStyleDeclaration(
// be in a document, if we're clearing animation effects on a target node
// that's been detached since the previous animation sample.)
if (Document* doc = GetComposedDoc()) {
if (nsIPresShell* shell = doc->GetShell()) {
shell->RestyleForAnimation(this, StyleRestyleHint_RESTYLE_SMIL);
if (PresShell* presShell = doc->GetPresShell()) {
presShell->RestyleForAnimation(this, StyleRestyleHint_RESTYLE_SMIL);
}
}
@ -4290,8 +4290,8 @@ static void NoteDirtyElement(Element* aElement, uint32_t aBits) {
}
}
if (nsIPresShell* shell = doc->GetShell()) {
shell->EnsureStyleFlush();
if (PresShell* presShell = doc->GetPresShell()) {
presShell->EnsureStyleFlush();
}
MOZ_ASSERT(parent->IsElement() || parent == doc);

Просмотреть файл

@ -31,6 +31,8 @@
#include "mozilla/EventForwards.h"
#include "mozilla/EventStates.h"
#include "mozilla/FlushType.h"
#include "mozilla/PresShell.h"
#include "mozilla/PseudoStyleType.h"
#include "mozilla/RustCell.h"
#include "mozilla/SMILAttr.h"
#include "mozilla/UniquePtr.h"

Просмотреть файл

@ -1376,16 +1376,10 @@ void EventSourceImpl::DispatchAllMessageEvents() {
}
AutoJSAPI jsapi;
if (mIsMainThread) {
if (NS_WARN_IF(!jsapi.Init(mEventSource->GetOwner()))) {
return;
}
} else {
MOZ_ASSERT(mWorkerRef);
if (NS_WARN_IF(!jsapi.Init(mWorkerRef->Private()->GlobalScope()))) {
return;
}
if (NS_WARN_IF(!jsapi.Init(mEventSource->GetOwnerGlobal()))) {
return;
}
JSContext* cx = jsapi.cx();
while (mMessagesToDispatch.GetSize() > 0) {
@ -1783,13 +1777,14 @@ EventSourceImpl::CheckListenerChain() {
// EventSource
////////////////////////////////////////////////////////////////////////////////
EventSource::EventSource(nsPIDOMWindowInner* aOwnerWindow,
EventSource::EventSource(nsIGlobalObject* aGlobal,
nsICookieSettings* aCookieSettings,
bool aWithCredentials)
: DOMEventTargetHelper(aOwnerWindow),
: DOMEventTargetHelper(aGlobal),
mWithCredentials(aWithCredentials),
mIsMainThread(true),
mKeepingAlive(false) {
MOZ_ASSERT(aGlobal);
MOZ_ASSERT(aCookieSettings);
mImpl = new EventSourceImpl(this, aCookieSettings);
}
@ -1810,12 +1805,14 @@ nsresult EventSource::CreateAndDispatchSimpleEvent(const nsAString& aName) {
already_AddRefed<EventSource> EventSource::Constructor(
const GlobalObject& aGlobal, const nsAString& aURL,
const EventSourceInit& aEventSourceInitDict, ErrorResult& aRv) {
nsCOMPtr<nsPIDOMWindowInner> ownerWindow =
do_QueryInterface(aGlobal.GetAsSupports());
MOZ_ASSERT(!NS_IsMainThread() || ownerWindow);
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
if (NS_WARN_IF(!global)) {
aRv.Throw(NS_ERROR_FAILURE);
return nullptr;
}
nsCOMPtr<nsICookieSettings> cookieSettings;
nsCOMPtr<nsPIDOMWindowInner> ownerWindow = do_QueryInterface(global);
if (ownerWindow) {
Document* doc = ownerWindow->GetExtantDoc();
if (NS_WARN_IF(!doc)) {
@ -1832,7 +1829,7 @@ already_AddRefed<EventSource> EventSource::Constructor(
}
RefPtr<EventSource> eventSource = new EventSource(
ownerWindow, cookieSettings, aEventSourceInitDict.mWithCredentials);
global, cookieSettings, aEventSourceInitDict.mWithCredentials);
RefPtr<EventSourceImpl> eventSourceImp = eventSource->mImpl;
if (NS_IsMainThread()) {

Просмотреть файл

@ -24,7 +24,7 @@
#include "nsIHttpChannel.h"
#include "nsDeque.h"
class nsPIDOMWindowInner;
class nsIGlobalObject;
class nsICookieSettings;
namespace mozilla {
@ -81,8 +81,8 @@ class EventSource final : public DOMEventTargetHelper {
void Close();
private:
EventSource(nsPIDOMWindowInner* aOwnerWindow,
nsICookieSettings* aCookieSettings, bool aWithCredentials);
EventSource(nsIGlobalObject* aGlobal, nsICookieSettings* aCookieSettings,
bool aWithCredentials);
virtual ~EventSource();
// prevent bad usage
EventSource(const EventSource& x) = delete;

Просмотреть файл

@ -22,6 +22,7 @@
#include "mozilla/EventListenerManager.h"
#include "mozilla/EventStates.h"
#include "mozilla/HTMLEditor.h"
#include "mozilla/PresShell.h"
#include "mozilla/RestyleManager.h"
#include "mozilla/TextEditor.h"
#include "mozilla/TouchEvents.h"
@ -43,7 +44,6 @@
#include "nsNetUtil.h"
#include "nsIFrame.h"
#include "nsIAnonymousContentCreator.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsStyleConsts.h"
#include "nsString.h"
@ -1580,7 +1580,7 @@ static bool ShouldClearPurple(nsIContent* aContent) {
// we can act as if it was optimizable. When the primary frame dies, aNode
// will end up to the purple buffer because of the refcount change.
bool NodeHasActiveFrame(Document* aCurrentDoc, nsINode* aNode) {
return aCurrentDoc->GetShell() && aNode->IsElement() &&
return aCurrentDoc->GetPresShell() && aNode->IsElement() &&
aNode->AsElement()->GetPrimaryFrame();
}

Просмотреть файл

@ -19,7 +19,6 @@
#include "nsCOMPtr.h"
#include "nsEscape.h"
#include "nsIDOMWindow.h"
#include "mozilla/dom/Document.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsError.h"
@ -33,6 +32,8 @@
#include "mozilla/Components.h"
#include "mozilla/NullPrincipal.h"
#include "mozilla/Unused.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/DocumentInlines.h"
#include "mozilla/dom/LocationBinding.h"
#include "mozilla/dom/ScriptSettings.h"
#include "ReferrerInfo.h"

Просмотреть файл

@ -8,6 +8,7 @@
#include "MessageEvent.h"
#include "mozilla/dom/BlobBinding.h"
#include "mozilla/dom/DocumentInlines.h"
#include "mozilla/dom/File.h"
#include "mozilla/dom/FileList.h"
#include "mozilla/dom/FileListBinding.h"

Просмотреть файл

@ -5,6 +5,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "mozilla/dom/ResponsiveImageSelector.h"
#include "mozilla/PresShell.h"
#include "mozilla/ServoStyleSetInlines.h"
#include "mozilla/TextUtils.h"
#include "nsIURI.h"
@ -401,7 +402,7 @@ int ResponsiveImageSelector::GetSelectedCandidateIndex() {
bool ResponsiveImageSelector::ComputeFinalWidthForCurrentViewport(
double* aWidth) {
dom::Document* doc = Document();
nsIPresShell* presShell = doc->GetShell();
PresShell* presShell = doc->GetPresShell();
nsPresContext* pctx = presShell ? presShell->GetPresContext() : nullptr;
if (!pctx) {

Просмотреть файл

@ -17,6 +17,7 @@
#include "mozilla/dom/HTMLSlotElement.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/IdentifierMapEntry.h"
#include "mozilla/PresShell.h"
#include "mozilla/ServoStyleRuleMap.h"
#include "mozilla/StyleSheet.h"
#include "mozilla/StyleSheetInlines.h"
@ -185,12 +186,12 @@ void ShadowRoot::InvalidateStyleAndLayoutOnSubtree(Element* aElement) {
return;
}
nsIPresShell* shell = doc->GetShell();
if (!shell) {
PresShell* presShell = doc->GetPresShell();
if (!presShell) {
return;
}
shell->DestroyFramesForAndRestyle(aElement);
presShell->DestroyFramesForAndRestyle(aElement);
}
void ShadowRoot::AddSlot(HTMLSlotElement* aSlot) {
@ -349,8 +350,8 @@ void ShadowRoot::ApplicableRulesChanged() {
return;
}
if (nsIPresShell* shell = doc->GetShell()) {
shell->RecordShadowStyleChange(*this);
if (PresShell* presShell = doc->GetPresShell()) {
presShell->RecordShadowStyleChange(*this);
}
}
@ -534,8 +535,8 @@ void ShadowRoot::MaybeReassignElement(Element* aElement) {
}
if (Document* doc = GetComposedDoc()) {
if (nsIPresShell* shell = doc->GetShell()) {
shell->SlotAssignmentWillChange(*aElement, oldSlot, assignment.mSlot);
if (RefPtr<PresShell> presShell = doc->GetPresShell()) {
presShell->SlotAssignmentWillChange(*aElement, oldSlot, assignment.mSlot);
}
}

Просмотреть файл

@ -11,6 +11,7 @@
#include "nsContentSink.h"
#include "mozilla/Components.h"
#include "mozilla/PresShell.h"
#include "mozilla/dom/Document.h"
#include "mozilla/css/Loader.h"
#include "mozilla/dom/SRILogHelper.h"
@ -24,7 +25,6 @@
#include "nsIProtocolHandler.h"
#include "nsIHttpChannel.h"
#include "nsIContent.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsViewManager.h"
#include "nsAtom.h"
@ -99,7 +99,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
nsContentSink::nsContentSink()
: mBackoffCount(0),
mLastNotificationTime(0),
mBeganUpdate(0),
mLayoutStarted(0),
mDynamicLowerValue(0),
mParsing(0),
@ -1191,14 +1190,14 @@ void nsContentSink::StartLayout(bool aIgnorePendingSheets) {
mLastNotificationTime = PR_Now();
mDocument->SetMayStartLayout(true);
nsCOMPtr<nsIPresShell> shell = mDocument->GetShell();
RefPtr<PresShell> presShell = mDocument->GetPresShell();
// Make sure we don't call Initialize() for a shell that has
// already called it. This can happen when the layout frame for
// an iframe is constructed *between* the Embed() call for the
// docshell in the iframe, and the content sink's call to OpenBody().
// (Bug 153815)
if (shell && !shell->DidInitialize()) {
nsresult rv = shell->Initialize();
if (presShell && !presShell->DidInitialize()) {
nsresult rv = presShell->Initialize();
if (NS_FAILED(rv)) {
return;
}
@ -1211,17 +1210,13 @@ void nsContentSink::StartLayout(bool aIgnorePendingSheets) {
}
void nsContentSink::NotifyAppend(nsIContent* aContainer, uint32_t aStartIndex) {
if (aContainer->GetUncomposedDoc() != mDocument) {
// aContainer is not actually in our document anymore.... Just bail out of
// here; notifying on our document for this append would be wrong.
return;
}
mInNotification++;
{
// Scope so we call EndUpdate before we decrease mInNotification
MOZ_AUTO_DOC_UPDATE(mDocument, !mBeganUpdate);
//
// Note that aContainer->OwnerDoc() may not be mDocument.
MOZ_AUTO_DOC_UPDATE(aContainer->OwnerDoc(), true);
nsNodeUtils::ContentAppended(
aContainer, aContainer->GetChildAt_Deprecated(aStartIndex));
mLastNotificationTime = PR_Now();
@ -1350,8 +1345,8 @@ nsresult nsContentSink::DidProcessATokenImpl() {
}
// Get the current user event time
nsIPresShell* shell = mDocument->GetShell();
if (!shell) {
PresShell* presShell = mDocument->GetPresShell();
if (!presShell) {
// If there's no pres shell in the document, return early since
// we're not laying anything out here.
return NS_OK;
@ -1363,7 +1358,7 @@ nsresult nsContentSink::DidProcessATokenImpl() {
// Check if there's a pending event
if (sPendingEventMode != 0 && !mHasPendingEvent &&
(mDeflectedCount % sEventProbeRate) == 0) {
nsViewManager* vm = shell->GetViewManager();
nsViewManager* vm = presShell->GetViewManager();
NS_ENSURE_TRUE(vm, NS_ERROR_FAILURE);
nsCOMPtr<nsIWidget> widget;
vm->GetRootWidget(getter_AddRefs(widget));
@ -1497,15 +1492,15 @@ nsresult nsContentSink::WillParseImpl(void) {
return NS_OK;
}
nsIPresShell* shell = mDocument->GetShell();
if (!shell) {
PresShell* presShell = mDocument->GetPresShell();
if (!presShell) {
return NS_OK;
}
uint32_t currentTime = PR_IntervalToMicroseconds(PR_IntervalNow());
if (sEnablePerfMode == 0) {
nsViewManager* vm = shell->GetViewManager();
nsViewManager* vm = presShell->GetViewManager();
NS_ENSURE_TRUE(vm, NS_ERROR_FAILURE);
uint32_t lastEventTime;
vm->GetLastUserEventTime(lastEventTime);

Просмотреть файл

@ -288,8 +288,6 @@ class nsContentSink : public nsICSSLoaderObserver,
// Timer used for notification
nsCOMPtr<nsITimer> mNotificationTimer;
// Have we already called BeginUpdate for this set of content changes?
uint8_t mBeganUpdate : 1;
uint8_t mLayoutStarted : 1;
uint8_t mDynamicLowerValue : 1;
uint8_t mParsing : 1;

Просмотреть файл

@ -50,6 +50,7 @@
#include "mozilla/dom/ContentChild.h"
#include "mozilla/dom/CustomElementRegistry.h"
#include "mozilla/dom/Document.h"
#include "mozilla/dom/DocumentInlines.h"
#include "mozilla/dom/MessageBroadcaster.h"
#include "mozilla/dom/DocumentFragment.h"
#include "mozilla/dom/DOMException.h"
@ -90,6 +91,7 @@
#include "mozilla/ManualNAC.h"
#include "mozilla/MouseEvents.h"
#include "mozilla/Preferences.h"
#include "mozilla/PresShell.h"
#include "mozilla/ResultExtensions.h"
#include "mozilla/dom/Selection.h"
#include "mozilla/Services.h"
@ -3196,25 +3198,21 @@ void nsContentUtils::SplitExpatName(const char16_t* aExpatName,
}
// static
nsIPresShell* nsContentUtils::GetPresShellForContent(
const nsIContent* aContent) {
PresShell* nsContentUtils::GetPresShellForContent(const nsIContent* aContent) {
Document* doc = aContent->GetComposedDoc();
if (!doc) {
return nullptr;
}
return doc->GetShell();
return doc->GetPresShell();
}
// static
nsPresContext* nsContentUtils::GetContextForContent(
const nsIContent* aContent) {
nsIPresShell* presShell = GetPresShellForContent(aContent);
PresShell* presShell = GetPresShellForContent(aContent);
if (!presShell) {
return nullptr;
}
return presShell->GetPresContext();
}
@ -4183,7 +4181,7 @@ nsresult nsContentUtils::DispatchInputEvent(Element* aEventTargetElement,
}
// If we're running xpcshell tests, we fail to get presShell here.
// Even in such case, we need to dispatch "input" event without widget.
nsIPresShell* presShell = document->GetShell();
PresShell* presShell = document->GetPresShell();
if (presShell) {
nsPresContext* presContext = presShell->GetPresContext();
if (NS_WARN_IF(!presContext)) {
@ -6297,9 +6295,9 @@ nsIPresShell* nsContentUtils::FindPresShellForDocument(const Document* aDoc) {
doc = displayDoc;
}
nsIPresShell* shell = doc->GetShell();
if (shell) {
return shell;
PresShell* presShell = doc->GetPresShell();
if (presShell) {
return presShell;
}
nsCOMPtr<nsIDocShellTreeItem> docShellTreeItem = doc->GetDocShell();
@ -9832,7 +9830,7 @@ void nsContentUtils::AppendDocumentLevelNativeAnonymousContentTo(
size_t oldLength = aElements.Length();
#endif
if (nsIPresShell* presShell = aDocument->GetShell()) {
if (PresShell* presShell = aDocument->GetPresShell()) {
if (nsIFrame* scrollFrame = presShell->GetRootScrollFrame()) {
nsIAnonymousContentCreator* creator = do_QueryFrame(scrollFrame);
MOZ_ASSERT(
@ -10509,9 +10507,9 @@ bool nsContentUtils::
}
Document* topLevel = aDocument->GetTopLevelContentDocument();
return topLevel && topLevel->GetShell() &&
topLevel->GetShell()->GetPresContext() &&
!topLevel->GetShell()->GetPresContext()->HadContentfulPaint() &&
return topLevel && topLevel->GetPresShell() &&
topLevel->GetPresShell()->GetPresContext() &&
!topLevel->GetPresShell()->GetPresContext()->HadContentfulPaint() &&
nsThreadManager::MainThreadHasPendingHighPriorityEvents();
}

Просмотреть файл

@ -127,6 +127,7 @@ class Dispatcher;
class ErrorResult;
class EventListenerManager;
class HTMLEditor;
class PresShell;
class TextEditor;
namespace dom {
@ -827,7 +828,7 @@ class nsContentUtils {
* @return the pres shell, or nullptr if the content is not in a document
* (if GetComposedDoc returns nullptr)
*/
static nsIPresShell* GetPresShellForContent(const nsIContent* aContent);
static mozilla::PresShell* GetPresShellForContent(const nsIContent* aContent);
/**
* Method to do security and content policy checks on the image URI

Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше