Merge mozilla-central to autoland. a=merge

This commit is contained in:
Cosmin Sabou 2018-09-04 06:52:54 +03:00
commit f368eb76e6
62 changed files with 685 additions and 634 deletions

View File

@ -117,7 +117,7 @@ function openBrowserWindowIntl() {
gBrowserContext.browserWnd =
window.openDialog(AppConstants.BROWSER_CHROME_URL,
"_blank", params,
gBrowserContext.startURL);
gBrowserContext.startURL || "data:text/html,<html></html>");
whenDelayedStartupFinished(browserWindow(), function() {
addA11yLoadEvent(startBrowserTests, browserWindow());

View File

@ -4,6 +4,7 @@
"use strict";
ChromeUtils.import("resource://gre/modules/AppConstants.jsm");
ChromeUtils.import("resource://gre/modules/Services.jsm");
ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
@ -25,7 +26,7 @@ function machine_only_col(text) {
let icon = document.createElement("span");
icon.classList.add("icon");
icon.classList.add("machine-only");
icon.title = "Machine-only";
icon.setAttribute("data-l10n-id", "gpo-machine-only");
let column = document.createElement("td");
let content = document.createTextNode(text);
column.appendChild(content);
@ -236,12 +237,15 @@ function generateDocumentation() {
content.classList.toggle("content");
});
let row = document.createElement("tr");
if (schema.properties[policyName].machine_only) {
if (AppConstants.platform == "win" &&
schema.properties[policyName].machine_only) {
row.appendChild(machine_only_col(policyName));
} else {
row.appendChild(col(policyName));
}
row.appendChild(col(schema.properties[policyName].description));
let descriptionColumn = col("");
descriptionColumn.setAttribute("data-l10n-id", `policy-${policyName}`);
row.appendChild(descriptionColumn);
main_tbody.appendChild(row);
let sec_tbody = document.createElement("tbody");
sec_tbody.classList.add("content");

View File

@ -10,7 +10,10 @@
<head>
<title data-l10n-id="about-policies-title"/>
<link rel="stylesheet" href="chrome://browser/content/policies/aboutPolicies.css" type="text/css" />
<link rel="localization" href="branding/brand.ftl"/>
<link rel="localization" href="browser/branding/sync-brand.ftl"/>
<link rel="localization" href="browser/aboutPolicies.ftl"/>
<link rel="localization" href="browser/policies/policies-descriptions.ftl"/>
<script type="application/javascript" src="chrome://global/content/l10n.js"></script>
<script type="application/javascript" src="chrome://browser/content/policies/aboutPolicies.js" />
</head>

View File

@ -3,14 +3,12 @@
"type": "object",
"properties": {
"AppUpdateURL": {
"description": "Sets custom app update server URL.",
"machine_only": true,
"type": "URL"
},
"Authentication": {
"description": "Sites that support integrated authentication. See https://developer.mozilla.org/en-US/docs/Mozilla/Integrated_authentication",
"type": "object",
"properties": {
"SPNEGO" : {
@ -47,32 +45,22 @@
},
"BlockAboutAddons": {
"description": "Block access to the Add-ons Mananger (about:addons).",
"type": "boolean"
},
"BlockAboutConfig": {
"description": "Blocks access to the about:config page.",
"type": "boolean"
},
"BlockAboutProfiles": {
"description": "Blocks access to the about:profiles page.",
"type": "boolean"
},
"BlockAboutSupport": {
"description": "Blocks access to the about:support page.",
"type": "boolean"
},
"Bookmarks": {
"description": "Allows the creation of bookmarks in the Bookmarks bar, Bookmarks menu, or a specified folder inside them.",
"type": "array",
"items": {
"type": "object",
@ -103,8 +91,6 @@
},
"Certificates": {
"description": "Whether or not to use built in certs. This policy is Windows only at this time.",
"type": "object",
"properties": {
"ImportEnterpriseRoots": {
@ -114,8 +100,6 @@
},
"Cookies": {
"description": "Allow or deny websites to set cookies.",
"type": "object",
"properties": {
"Allow": {
@ -158,99 +142,68 @@
},
"DisableAppUpdate": {
"description": "Prevent the browser from updating.",
"machine_only": true,
"type": "boolean"
},
"DisableBuiltinPDFViewer": {
"description": "Disables PDF.js, which displays PDFs within Firefox.",
"type": "boolean"
},
"DisableDeveloperTools": {
"description": "Prevents access to developer tools.",
"type": "boolean"
},
"DisableFeedbackCommands": {
"description": "Prevents ability to send feedback from the help menu (\"Submit Feedback\" and \"Report Deceptive Site\").",
"type": "boolean"
},
"DisableFirefoxAccounts": {
"description": "Disables Firefox Account based services, including Sync.",
"type": "boolean"
},
"DisableFirefoxScreenshots": {
"description": "Prevents usage of the Firefox Screenshots feature.",
"type": "boolean"
},
"DisableFirefoxStudies": {
"description": "Prevents Firefox from running studies.",
"type": "boolean"
},
"DisableForgetButton": {
"description": "Prevents access to the \"Forget\" button.",
"type": "boolean"
},
"DisableFormHistory": {
"description": "Don't remember search and form history.",
"type": "boolean"
},
"DisableMasterPasswordCreation": {
"description": "If true, removes access to create a master password.",
"type": "boolean"
},
"DisablePocket": {
"description": "Prevents ability to save webpages to Pocket.",
"type": "boolean"
},
"DisablePrivateBrowsing": {
"description": "Disables private browsing.",
"type": "boolean"
},
"DisableProfileImport": {
"description": "Disables the Firefox \"Import data from another browser\" button.",
"type": "boolean"
},
"DisableProfileRefresh": {
"description": "Disables the \"Refresh Firefox\" button in about:support.",
"type": "boolean"
},
"DisableSafeMode": {
"description": "Prevents ability to restart in safe mode. You can only prevent the Shift key by using GPO on Windows.",
"type": "boolean"
},
"DisableSecurityBypass": {
"description": "Prevents the user from bypassing certain security warnings.",
"type": "object",
"properties": {
"InvalidCertificate": {
@ -264,46 +217,34 @@
},
"DisableSetDesktopBackground": {
"description": "Prevents usage of the \"Set Image as Desktop Background\" feature.",
"type": "boolean"
},
"DisableSystemAddonUpdate": {
"description": "Prevent the browser from installing and updating system addons.",
"machine_only": true,
"type": "boolean"
},
"DisableTelemetry": {
"description": "Turns off Telemetry.",
"machine_only": true,
"type": "boolean"
},
"DisplayBookmarksToolbar": {
"description": "Causes the bookmarks toolbar to be displayed by default.",
"type": "boolean"
},
"DisplayMenuBar": {
"description": "Causes the menu bar to be displayed by default.",
"type": "boolean"
},
"DontCheckDefaultBrowser": {
"description": "Don't check for the default browser on startup.",
"type": "boolean"
},
"EnableTrackingProtection": {
"description": "Enables or disables tracking protection and optionally locks it.",
"type": "object",
"properties": {
"Value": {
@ -317,7 +258,6 @@
},
"Extensions": {
"description": "Install, uninstall or lock extensions. The Install option takes URLs or paths as parameters. The Uninstall and Locked options take extension IDs.",
"machine_only": true,
"type": "object",
@ -344,8 +284,6 @@
},
"FlashPlugin": {
"description": "Allow or deny flash plugin usage.",
"type": "object",
"properties": {
"Allow": {
@ -375,13 +313,10 @@
},
"HardwareAcceleration": {
"description": "If false, prevents ability to turn on hardware acceleration.",
"type": "boolean"
},
"Homepage": {
"description": "Set and optionally lock the homepage.",
"machine_only": true,
"type": "object",
@ -404,8 +339,6 @@
},
"InstallAddonsPermission": {
"description": "Allow websites to install add-ons.",
"type": "object",
"properties": {
"Allow": {
@ -422,34 +355,26 @@
},
"NoDefaultBookmarks": {
"description": "Don't create the default bookmarks bundled with Firefox, nor the Smart Bookmarks (Most Visited, Recent Tags). Note: this policy is only effective if used before the first run of the profile.",
"type": "boolean"
},
"OfferToSaveLogins": {
"description": "Enforces the setting to allow Firefox to offer to remember saved logins and passwords. Both true and false values are accepted.",
"type": "boolean"
},
"OverrideFirstRunPage": {
"description": "Override the first run page. Set this policy to blank if you want to disable the first run page.",
"machine_only": true,
"type": "URLorEmpty"
},
"OverridePostUpdatePage": {
"description": "Override the post-update \"What's New\" page. Set this policy to blank if you want to disable the post-update page.",
"machine_only": true,
"type": "URLorEmpty"
},
"Permissions": {
"description": "Configure permissions for camera, microphone, location and notifications.",
"type": "object",
"properties": {
"Camera": {
@ -571,8 +496,6 @@
},
"PopupBlocking": {
"description": "Allow or deny popup usage.",
"type": "object",
"properties": {
"Allow": {
@ -594,8 +517,6 @@
},
"Proxy": {
"description": "Configure Proxy settings.",
"type": "object",
"properties": {
"Mode": {
@ -651,20 +572,15 @@
},
"SanitizeOnShutdown": {
"description": "Clears ALL browser data on shutdown.",
"type": "boolean"
},
"SearchBar": {
"description": "Sets the default location of the search bar. Only applies on first run, but can be changed.",
"type": "string",
"enum": ["unified", "separate"]
},
"SearchEngines": {
"description": "Modifies the list of search engines built into Firefox.",
"enterprise_only": true,
"type": "object",
@ -717,7 +633,6 @@
},
"WebsiteFilter": {
"description": "Blocks websites from being visited. The parameters take an array of Match Patterns, as documented in https://developer.mozilla.org/en-US/Add-ons/WebExtensions/Match_patterns. Only http/https accesses are supported at the moment. The arrays are limited to 1000 entries each.",
"machine_only": "true",
"type": "object",

View File

@ -37,7 +37,8 @@
<vbox id="ConnectionsDialogPane" class="prefpane largeDialogContainer">
<script type="application/javascript" src="chrome://browser/content/preferences/connection.js"/>
<hbox id="proxyExtensionContent" align="top" hidden="true">
<hbox id="proxyExtensionContent"
align="top" hidden="true" class="extension-controlled">
<description control="disableProxyExtension" flex="1" />
<button id="disableProxyExtension"
class="extension-controlled-button accessory-button"

View File

@ -49,7 +49,7 @@ let extensionControlledContentIds = {
get "websites.trackingProtectionMode"() {
return {
button: contentBlockingUiEnabled ?
"contentBlockingTrackingProtectionExtensionContentButton" :
"contentBlockingDisableTrackingProtectionExtension" :
"trackingProtectionExtensionContentButton",
section: contentBlockingUiEnabled ?
"contentBlockingTrackingProtectionExtensionContentLabel" :

View File

@ -84,13 +84,15 @@
</menulist>
</hbox>
<hbox id="browserHomePageExtensionContent" align="center" hidden="true">
<hbox id="browserHomePageExtensionContent"
align="center" hidden="true" class="extension-controlled">
<description control="disableHomePageExtension" flex="1" />
<button id="disableHomePageExtension"
class="extension-controlled-button accessory-button"
data-l10n-id="disable-extension" />
</hbox>
<hbox id="browserNewTabExtensionContent" align="center" hidden="true">
<hbox id="browserNewTabExtensionContent"
align="center" hidden="true" class="extension-controlled">
<description control="disableNewTabExtension" flex="1" />
<button id="disableNewTabExtension"
class="extension-controlled-button accessory-button"

View File

@ -100,7 +100,8 @@
#endif
<vbox id="browserContainersbox" hidden="true">
<hbox id="browserContainersExtensionContent" align="center">
<hbox id="browserContainersExtensionContent"
align="center" class="extension-controlled">
<description control="disableContainersExtension" flex="1" />
<button id="disableContainersExtension"
class="extension-controlled-button accessory-button"

View File

@ -640,8 +640,6 @@ var gPrivacyPane = {
let dependentControls = [
"#content-blocking-categories-label",
".content-blocking-checkbox",
".content-blocking-icon",
".content-blocking-category-name",
"#changeBlockListLink",
"#contentBlockingChangeCookieSettings",
"#blockCookiesCB, #blockCookiesCB > radio",
@ -1163,8 +1161,6 @@ var gPrivacyPane = {
let dependentControls = [
".reject-trackers-ui .content-blocking-checkbox",
".reject-trackers-ui .content-blocking-icon",
".reject-trackers-ui .content-blocking-category-name",
"#blockCookiesCB, #blockCookiesCB > radio",
"#blockCookiesCBDeck",
];
@ -1187,8 +1183,6 @@ var gPrivacyPane = {
let dependentControls = [
".reject-trackers-ui .content-blocking-checkbox",
".reject-trackers-ui .content-blocking-icon",
".reject-trackers-ui .content-blocking-category-name",
"#blockCookiesCB, #blockCookiesCB > radio",
"#blockCookiesCBDeck",
];

View File

@ -332,113 +332,97 @@
<vbox id="contentBlockingCategories">
<label id="content-blocking-categories-label" data-l10n-id="content-blocking-category-label"/>
<hbox class="content-blocking-category fast-block-ui">
<vbox class="content-blocking-category-checkbox">
<vbox>
<checkbox id="contentBlockingFastBlockCheckbox"
class="content-blocking-checkbox"
preference="browser.fastblock.enabled" />
</vbox>
<vbox class="content-blocking-category-icon">
<image class="fastblock-icon content-blocking-icon"/>
</vbox>
<vbox class="content-blocking-category-labels" flex="1">
<label data-l10n-id="content-blocking-fastblock-slow-loading-label"
class="content-blocking-category-name"
control="contentBlockingFastBlockCheckbox"/>
<description data-l10n-id="content-blocking-fastblock-new-description" class="content-blocking-category-description"/>
class="content-blocking-checkbox" flex="1"
src="chrome://browser/skin/controlcenter/slowtrackers.svg"
preference="browser.fastblock.enabled"
data-l10n-id="content-blocking-fastblock-slow-loading-trackers-label"/>
<vbox class="content-blocking-category-labels" flex="1">
<description data-l10n-id="content-blocking-fastblock-new-description" class="content-blocking-category-description"/>
</vbox>
</vbox>
</hbox>
<vbox>
<hbox id="contentBlockingTrackingProtectionExtensionContentLabel" align="center" hidden="true">
<description control="contentBlockingDisableTrackingProtectionExtension" flex="1"/>
</hbox>
<hbox id="contentBlockingTrackingProtectionExtensionContentButton" hidden="true">
<button id="contentBlockingDisableTrackingProtectionExtension"
class="extension-controlled-button accessory-button"
data-l10n-id="disable-extension"/>
</hbox>
<hbox class="content-blocking-category tracking-protection-ui">
<vbox class="content-blocking-category-checkbox">
<checkbox id="contentBlockingTrackingProtectionCheckbox" class="content-blocking-checkbox" />
</vbox>
<vbox class="content-blocking-category-icon">
<image class="tracking-protection-icon content-blocking-icon" />
</vbox>
<vbox class="content-blocking-category-labels" flex="1">
<label data-l10n-id="content-blocking-tracking-protection-all-label"
class="content-blocking-category-name"
control="contentBlockingTrackingProtectionCheckbox"/>
<description data-l10n-id="content-blocking-tracking-protection-new-description"
class="content-blocking-category-description"
id="trackingProtectionMenuDesc"/>
<radiogroup id="trackingProtectionMenu"
aria-labelledby="trackingProtectionMenuDesc">
<radio value="private"
data-l10n-id="content-blocking-tracking-protection-option-private"
flex="1" />
<radio value="always"
data-l10n-id="content-blocking-tracking-protection-option-always"
flex="1" />
</radiogroup>
<label id="changeBlockListLink"
data-l10n-id="content-blocking-tracking-protection-change-block-list"
class="text-link"
search-l10n-ids="blocklist-window.title, blocklist-desc, blocklist-button-cancel.label, blocklist-button-ok.label"/>
<vbox>
<checkbox id="contentBlockingTrackingProtectionCheckbox"
class="content-blocking-checkbox" flex="1"
src="chrome://browser/skin/controlcenter/trackers.svg"
data-l10n-id="content-blocking-tracking-protection-all-detected-trackers-label"/>
<vbox class="content-blocking-category-labels" flex="1">
<hbox id="contentBlockingTrackingProtectionExtensionContentLabel"
align="center" hidden="true" class="extension-controlled">
<description control="contentBlockingDisableTrackingProtectionExtension" flex="1"/>
<button id="contentBlockingDisableTrackingProtectionExtension"
class="extension-controlled-button accessory-button"
data-l10n-id="disable-extension" hidden="true"/>
</hbox>
<description data-l10n-id="content-blocking-tracking-protection-new-description"
class="content-blocking-category-description"
id="trackingProtectionMenuDesc"/>
<radiogroup id="trackingProtectionMenu"
aria-labelledby="trackingProtectionMenuDesc">
<radio value="private"
data-l10n-id="content-blocking-tracking-protection-option-private"
flex="1" />
<radio value="always"
data-l10n-id="content-blocking-tracking-protection-option-always"
flex="1" />
</radiogroup>
<label id="changeBlockListLink" data-l10n-id="content-blocking-tracking-protection-change-block-list" class="text-link"/>
<label id="changeBlockListLink"
data-l10n-id="content-blocking-tracking-protection-change-block-list"
class="text-link"
search-l10n-ids="blocklist-window.title, blocklist-desc, blocklist-button-cancel.label, blocklist-button-ok.label"/>
</vbox>
</vbox>
</hbox>
</vbox>
<hbox class="content-blocking-category reject-trackers-ui">
<hbox flex="1">
<vbox class="content-blocking-category-checkbox">
<checkbox id="contentBlockingBlockCookiesCheckbox" class="content-blocking-checkbox" />
</vbox>
<vbox class="content-blocking-category-icon">
<image class="reject-trackers-icon content-blocking-icon"/>
</vbox>
<vbox class="content-blocking-category-labels" flex="1">
<hbox>
<vbox>
<label data-l10n-id="content-blocking-reject-trackers-label"
class="content-blocking-category-name"
control="contentBlockingBlockCookiesCheckbox"/>
<deck id="blockCookiesCBDeck">
<description id="blockCookiesCBDesc"
data-l10n-id="content-blocking-reject-trackers-description"
class="content-blocking-category-description"/>
<hbox id="warningAllCookiesBlocked">
<image class="reject-trackers-warning-icon"/>
<checkbox id="contentBlockingBlockCookiesCheckbox"
class="content-blocking-checkbox" flex="1"
src="chrome://browser/skin/controlcenter/3rdpartycookies.svg"
data-l10n-id="content-blocking-third-party-cookies-label"/>
<vbox class="content-blocking-category-labels" flex="1">
<hbox>
<vbox flex="1">
<deck id="blockCookiesCBDeck">
<description id="blockCookiesCBDesc"
data-l10n-id="content-blocking-reject-trackers-description"
class="content-blocking-category-description"/>
<description data-l10n-id="content-blocking-reject-trackers-warning-your-settings-prevent-changes"
class="content-blocking-category-description description-with-side-element"/>
</hbox>
<hbox id="warningFromVisitedCookiesBlocked">
<image class="reject-trackers-warning-icon"/>
class="content-blocking-category-description description-with-side-element reject-trackers-warning-icon"/>
<description data-l10n-id="content-blocking-reject-trackers-warning-your-settings-prevent-changes"
class="content-blocking-category-description description-with-side-element"/>
</hbox>
</deck>
</vbox>
<hbox align="center">
<vbox align="center">
<button id="contentBlockingChangeCookieSettings"
class="accessory-button"
flex="1"
hidden="true"
data-l10n-id="content-blocking-change-cookie-settings"/>
class="content-blocking-category-description description-with-side-element reject-trackers-warning-icon"/>
</deck>
</vbox>
<hbox align="center" pack="end">
<vbox align="center">
<button id="contentBlockingChangeCookieSettings"
class="accessory-button"
flex="1"
hidden="true"
data-l10n-id="content-blocking-change-cookie-settings"/>
</vbox>
</hbox>
</hbox>
</hbox>
<radiogroup id="blockCookiesCB"
aria-labelledby="blockCookiesCBDesc"
preference="network.cookie.cookieBehavior"
onsyncfrompreference="return gPrivacyPane.readBlockCookiesCB();"
onsynctopreference="return gPrivacyPane.writeBlockCookiesCB();">
<radio value="trackers"
id="blockCookiesFromTrackersCB"
data-l10n-id="content-blocking-reject-trackers-block-trackers-option"
flex="1" />
<radio value="all-third-parties"
data-l10n-id="content-blocking-reject-trackers-all-third-parties-option"
flex="1" />
</radiogroup>
<radiogroup id="blockCookiesCB"
aria-labelledby="blockCookiesCBDesc"
preference="network.cookie.cookieBehavior"
onsyncfrompreference="return gPrivacyPane.readBlockCookiesCB();"
onsynctopreference="return gPrivacyPane.writeBlockCookiesCB();">
<radio value="trackers"
id="blockCookiesFromTrackersCB"
data-l10n-id="content-blocking-reject-trackers-block-trackers-option"
flex="1" />
<radio value="all-third-parties"
data-l10n-id="content-blocking-reject-trackers-all-third-parties-option"
flex="1" />
</radiogroup>
</vbox>
</vbox>
</hbox>
</hbox>

View File

@ -23,7 +23,8 @@
<caption><label data-l10n-id="search-engine-default-header" /></caption>
<description data-l10n-id="search-engine-default-desc" />
<hbox id="browserDefaultSearchExtensionContent" align="center" hidden="true">
<hbox id="browserDefaultSearchExtensionContent"
align="center" hidden="true" class="extension-controlled">
<description control="disableDefaultSearchExtension" flex="1"/>
</hbox>

View File

@ -202,11 +202,9 @@ add_task(async function testContentBlockingRestoreDefaultsSkipExtensionControlle
await TestUtils.waitForCondition(() => Services.prefs.prefHasUserValue(TP_PREF));
let dependentControls = [
"#content-blocking-categories-label",
".fast-block-ui .content-blocking-checkbox",
".reject-trackers-ui .content-blocking-checkbox",
".content-blocking-icon",
".content-blocking-category-name",
"#content-blocking-categories-label",
"#changeBlockListLink",
"#contentBlockingChangeCookieSettings",
"#blockCookiesCB, #blockCookiesCB > radio",
@ -310,10 +308,8 @@ add_task(async function testContentBlockingDependentControls() {
]});
let dependentControls = [
"#content-blocking-categories-label",
".content-blocking-checkbox",
".content-blocking-icon",
".content-blocking-category-name",
"#content-blocking-categories-label",
"#changeBlockListLink",
"#contentBlockingChangeCookieSettings",
];
@ -334,10 +330,8 @@ add_task(async function testContentBlockingDependentControls() {
]});
dependentControls = [
"#content-blocking-categories-label",
".content-blocking-checkbox",
".content-blocking-icon",
".content-blocking-category-name",
"#content-blocking-categories-label",
"#changeBlockListLink",
"#contentBlockingChangeCookieSettings",
"#blockCookiesCB, #blockCookiesCB > radio",
@ -404,8 +398,6 @@ add_task(async function testContentBlockingDependentControlsOnSiteDataUI() {
"#contentBlockingChangeCookieSettings",
];
let alwaysDisabledControls = [
".reject-trackers-checkbox",
".reject-trackers-icon",
"[control=blockCookiesCB]",
"#blockCookiesCBDeck",
"#blockCookiesCB, #blockCookiesCB > radio",
@ -431,8 +423,6 @@ add_task(async function testContentBlockingDependentControlsOnSiteDataUI() {
let dependentControls = [
"#content-blocking-categories-label",
".content-blocking-checkbox",
".content-blocking-icon",
".content-blocking-category-name",
"#trackingProtectionMenu",
"[control=trackingProtectionMenu]",
"#changeBlockListLink",
@ -464,8 +454,6 @@ add_task(async function testContentBlockingDependentControlsOnSiteDataUI() {
let dependentControls = [
"#content-blocking-categories-label",
".content-blocking-checkbox",
".content-blocking-icon",
".content-blocking-category-name",
"#trackingProtectionMenu",
"[control=trackingProtectionMenu]",
"#changeBlockListLink",

View File

@ -526,7 +526,7 @@ add_task(async function testExtensionControlledTrackingProtection() {
};
const CONTROLLED_BUTTON_ID = {
old: "trackingProtectionExtensionContentButton",
new: "contentBlockingTrackingProtectionExtensionContentButton",
new: "contentBlockingDisableTrackingProtectionExtension",
};
const DISABLE_BUTTON_ID = {
old: "disableTrackingProtectionExtension",

View File

@ -11,6 +11,6 @@ support-files =
skip-if = os == 'win' && !e10s # bug 1374446
[browser_translation_telemetry.js]
[browser_translation_infobar.js]
skip-if = (verify && debug && (os == 'mac')) || (os == 'mac') || (os == 'linux') # Bug 1316953
skip-if = debug || (os == 'mac') || (os == 'linux') # Bug 1316953
[browser_translation_exceptions.js]
skip-if = (verify && debug && (os == 'mac')) || (os == 'linux') || (os == 'mac') # Bug 1387666

View File

@ -12,3 +12,11 @@ documentation-tab = Documentation
policy-name = Policy Name
policy-value = Policy Value
policy-errors = Policy Errors
# 'gpo-machine-only' policies are related to the Group Policy features
# on Windows. Please use the same terminology that is used on Windows
# to describe Group Policy.
# These policies can only be set at the computer-level settings, while
# the other policies can also be set at the user-level.
gpo-machine-only =
.title = When using Group Policy, this policy can only be set at the computer level.

View File

@ -0,0 +1,107 @@
# 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/.
## The Enterprise Policies feature is aimed at system administrators
## who want to deploy these settings across several Firefox installations
## all at once. This is traditionally done through the Windows Group Policy
## feature, but the system also supports other forms of deployment.
## These are short descriptions for individual policies, to be displayed
## in the documentation section in about:policies.
policy-AppUpdateURL = Set custom app update URL.
policy-Authentication = Configure integrated authentication for websites that support it.
policy-BlockAboutAddons = Block access to the Add-ons Manager (about:addons).
policy-BlockAboutConfig = Block access to the about:config page.
policy-BlockAboutProfiles = Block access to the about:profiles page.
policy-BlockAboutSupport = Block access to the about:support page.
policy-Bookmarks = Create bookmarks in the Bookmarks toolbar, Bookmarks menu, or a specified folder inside them.
policy-Certificates = Whether or not to use built-in certificates. This policy is Windows only at this time.
policy-Cookies = Allow or deny websites to set cookies.
policy-DisableAppUpdate = Prevent the browser from updating.
policy-DisableBuiltinPDFViewer = Disable PDF.js, the built-in PDF viewer in { -brand-short-name }.
policy-DisableDeveloperTools = Block access to the developer tools.
policy-DisableFeedbackCommands = Disable commands to send feedback from the Help menu (Submit Feedback and Report Deceptive Site).
policy-DisableFirefoxAccounts = Disable { -fxaccount-brand-name } based services, including Sync.
# Firefox Screenshots is the name of the feature, and should not be translated.
policy-DisableFirefoxScreenshots = Disable the Firefox Screenshots feature.
policy-DisableFirefoxStudies = Prevent { -brand-short-name } from running studies.
policy-DisableForgetButton = Prevent access to the Forget button.
policy-DisableFormHistory = Dont remember search and form history.
policy-DisableMasterPasswordCreation = If true, a master password cant be created.
policy-DisablePocket = Disable the feature to save webpages to Pocket.
policy-DisablePrivateBrowsing = Disable Private Browsing.
policy-DisableProfileImport = Disable the menu command to Import data from another browser.
policy-DisableProfileRefresh = Disable the Refresh { -brand-short-name } button in the about:support page.
policy-DisableSafeMode = Disable the feature to restart in Safe Mode. Note: the Shift key to enter Safe Mode can only be disabled on Windows using Group Policy.
policy-DisableSecurityBypass = Prevent the user from bypassing certain security warnings.
policy-DisableSetDesktopBackground = Disable the menu command Set Image as Desktop Background.
policy-DisableSystemAddonUpdate = Prevent the browser from installing and updating system add-ons.
policy-DisableTelemetry = Turn off Telemetry.
policy-DisplayBookmarksToolbar = Display the Bookmark Toolbar by default.
policy-DisplayMenuBar = Display the Menu Bar by default.
policy-DontCheckDefaultBrowser = Disable check for default browser on startup.
policy-EnableTrackingProtection = Enable or disable Content Blocking and optionally lock it.
policy-Extensions = Install, uninstall or lock extensions. The Install option takes URLs or paths as parameters. The Uninstall and Locked options take extension IDs.
policy-FlashPlugin = Allow or deny usage of the Flash plugin.
policy-HardwareAcceleration = If false, turn off hardware acceleration.
policy-Homepage = Set and optionally lock the homepage.
policy-InstallAddonsPermission = Allow certain websites to install add-ons.
policy-NoDefaultBookmarks = Disable creation of the default bookmarks bundled with { -brand-short-name }, and the Smart Bookmarks (Most Visited, Recent Tags). Note: this policy is only effective if used before the first run of the profile.
policy-OfferToSaveLogins = Enforce the setting to allow { -brand-short-name } to offer to remember saved logins and passwords. Both true and false values are accepted.
policy-OverrideFirstRunPage = Override the first run page. Set this policy to blank if you want to disable the first run page.
policy-OverridePostUpdatePage = Override the post-update "Whats New" page. Set this policy to blank if you want to disable the post-update page.
policy-Permissions = Configure permissions for camera, microphone, location and notifications.
policy-PopupBlocking = Allow certain websites to display popups by default.
policy-Proxy = Configure proxy settings.
policy-SanitizeOnShutdown = Clear all navigation data on shutdown.
policy-SearchBar = Set the default location of the search bar. The user is still allowed to customize it.
policy-SearchEngines = Configure search engine settings. This policy is only available on the Extended Support Release (ESR) version.
policy-WebsiteFilter = Block websites from being visited. See documentation for more details on the format.

View File

@ -835,10 +835,12 @@ content-blocking-category-label = Choose what to block
# "Slow" in this instance means "slow to load on the network".
# FastBlock is a feature that blocks requests to tracking sites if they
# have not finished loading after a certain threshold of seconds.
content-blocking-fastblock-slow-loading-label = Slow-Loading Trackers
content-blocking-fastblock-slow-loading-trackers-label =
.label = Slow-Loading Trackers
.accesskey = S
content-blocking-fastblock-new-description = Block just the trackers that keep pages from loading quickly.
content-blocking-tracking-protection-all-label = All Detected Trackers
content-blocking-tracking-protection-all-detected-trackers-label =
.label = All Detected Trackers
.accesskey = T
content-blocking-tracking-protection-new-description = Block all known trackers. (May prevent some pages from loading.)
content-blocking-tracking-protection-option-always =
@ -849,7 +851,8 @@ content-blocking-tracking-protection-option-private =
.accesskey = p
content-blocking-tracking-protection-change-block-list = Change block list
content-blocking-reject-trackers-label = Third-Party Cookies
content-blocking-third-party-cookies-label =
.label = Third-Party Cookies
.accesskey = C
content-blocking-reject-trackers-description = Block all third-party cookies or just those set by trackers.
# This is a warning message shown next to a yellow warning icon when the Third-Party Cookies subsection

View File

@ -180,6 +180,25 @@ button > hbox > label {
font-weight: 600;
}
.extension-controlled {
margin-top: 18px !important;
margin-bottom: 18px !important;
background: var(--grey-20);
border-radius: 5px;
-moz-padding-end: 10px;
}
.extension-controlled > description {
line-height: 16px;
background: url(chrome://browser/skin/identity-icon.svg) 10px 14px no-repeat;
padding: 10px;
-moz-padding-start: 30px;
}
.extension-controlled > description:-moz-locale-dir(rtl) {
background-position-x: right 10px;
}
.extension-controlled-icon {
height: 20px;
margin: 2px 0 6px;

View File

@ -12,6 +12,12 @@
vertical-align: middle;
}
.content-blocking-checkbox .checkbox-icon {
margin-inline-end: 8px;
margin-inline-start: 4px;
width: 16px;
}
.content-blocking-icon,
.permission-icon {
-moz-context-properties: fill;
@ -116,16 +122,9 @@
margin: 16px 0;
}
.content-blocking-category-checkbox {
padding: 4px;
}
.content-blocking-category-icon {
padding: 4px;
}
.content-blocking-category-labels {
padding-inline-start: 4px;
margin-inline-start: 25px !important;
}
#trackingProtectionMenu,
@ -133,6 +132,10 @@
margin-top: 0.75em;
}
#blockCookiesCBDeck {
max-width: 444px;
}
#changeBlockListLink {
font-size: 90%;
/* In order to override the margins set in preferences.inc.css, we have to use !important. */
@ -144,24 +147,16 @@
opacity: 0.6;
}
.fastblock-icon {
list-style-image: url(chrome://browser/skin/controlcenter/slowtrackers.svg);
}
.tracking-protection-icon {
list-style-image: url(chrome://browser/skin/controlcenter/trackers.svg);
}
.reject-trackers-icon {
list-style-image: url(chrome://browser/skin/controlcenter/3rdpartycookies.svg);
}
.reject-trackers-warning-icon {
list-style-image: url(chrome://browser/skin/controlcenter/warning.svg);
background: url(chrome://browser/skin/controlcenter/warning.svg) no-repeat 0 5px;
-moz-context-properties: fill, stroke;
fill: #d7b600;
stroke: white;
padding: 4px;
padding-inline-start: 20px;
}
.reject-trackers-warning-icon:-moz-locale-dir(rtl) {
background-position-x: right 0;
}
#contentBlockingChangeCookieSettings {

View File

@ -9,6 +9,7 @@
@import "resource://devtools/client/aboutdebugging-new/src/components/RuntimeInfo.css";
@import "resource://devtools/client/aboutdebugging-new/src/components/debugtarget/DebugTargetItem.css";
@import "resource://devtools/client/aboutdebugging-new/src/components/debugtarget/DebugTargetList.css";
@import "resource://devtools/client/aboutdebugging-new/src/components/debugtarget/DebugTargetPane.css";
@import "resource://devtools/client/aboutdebugging-new/src/components/debugtarget/ExtensionDetail.css";
@import "resource://devtools/client/aboutdebugging-new/src/components/debugtarget/WorkerDetail.css";
@import "resource://devtools/client/aboutdebugging-new/src/components/sidebar/Sidebar.css";

View File

@ -24,6 +24,9 @@ const { L10nRegistry, FileSource } =
const actions = require("./src/actions/index");
const { configureStore } = require("./src/create-store");
const {
setDebugTargetCollapsibilities,
} = require("./src/modules/debug-target-collapsibilities");
const {
addNetworkLocationsObserver,
getNetworkLocations,
@ -83,6 +86,7 @@ const AboutDebugging = {
},
destroy() {
setDebugTargetCollapsibilities(this.store.getState().ui.debugTargetCollapsibilities);
unmountComponentAtNode(this.mount);
},

View File

@ -5,6 +5,7 @@
"use strict";
const {
DEBUG_TARGET_COLLAPSIBILITY_UPDATED,
NETWORK_LOCATIONS_UPDATED,
PAGE_SELECTED,
PAGES,
@ -30,11 +31,16 @@ function selectPage(page) {
};
}
function updateDebugTargetCollapsibility(key, isCollapsed) {
return { type: DEBUG_TARGET_COLLAPSIBILITY_UPDATED, key, isCollapsed };
}
function updateNetworkLocations(locations) {
return { type: NETWORK_LOCATIONS_UPDATED, locations };
}
module.exports = {
selectPage,
updateDebugTargetCollapsibility,
updateNetworkLocations,
};

View File

@ -21,10 +21,12 @@ const TemporaryExtensionInstaller =
const WorkerDetail = createFactory(require("./debugtarget/WorkerDetail"));
const Services = require("Services");
const { DEBUG_TARGET_PANE } = require("../constants");
class RuntimePage extends PureComponent {
static get propTypes() {
return {
collapsibilities: PropTypes.object.isRequired,
dispatch: PropTypes.func.isRequired,
installedExtensions: PropTypes.arrayOf(PropTypes.object).isRequired,
otherWorkers: PropTypes.arrayOf(PropTypes.object).isRequired,
@ -37,6 +39,7 @@ class RuntimePage extends PureComponent {
render() {
const {
collapsibilities,
dispatch,
installedExtensions,
otherWorkers,
@ -58,43 +61,55 @@ class RuntimePage extends PureComponent {
TemporaryExtensionInstaller({ dispatch }),
DebugTargetPane({
actionComponent: TemporaryExtensionAction,
collapsibilityKey: DEBUG_TARGET_PANE.TEMPORARY_EXTENSION,
detailComponent: ExtensionDetail,
dispatch,
isCollapsed: collapsibilities.get(DEBUG_TARGET_PANE.TEMPORARY_EXTENSION),
name: "Temporary Extensions",
targets: temporaryExtensions,
}),
DebugTargetPane({
actionComponent: InspectAction,
collapsibilityKey: DEBUG_TARGET_PANE.INSTALLED_EXTENSION,
detailComponent: ExtensionDetail,
dispatch,
isCollapsed: collapsibilities.get(DEBUG_TARGET_PANE.INSTALLED_EXTENSION),
name: "Extensions",
targets: installedExtensions,
}),
DebugTargetPane({
actionComponent: InspectAction,
collapsibilityKey: DEBUG_TARGET_PANE.TAB,
detailComponent: TabDetail,
dispatch,
isCollapsed: collapsibilities.get(DEBUG_TARGET_PANE.TAB),
name: "Tabs",
targets: tabs
}),
DebugTargetPane({
actionComponent: ServiceWorkerAction,
collapsibilityKey: DEBUG_TARGET_PANE.SERVICE_WORKER,
detailComponent: WorkerDetail,
dispatch,
isCollapsed: collapsibilities.get(DEBUG_TARGET_PANE.SERVICE_WORKER),
name: "Service Workers",
targets: serviceWorkers
}),
DebugTargetPane({
actionComponent: InspectAction,
collapsibilityKey: DEBUG_TARGET_PANE.SHARED_WORKER,
detailComponent: WorkerDetail,
dispatch,
isCollapsed: collapsibilities.get(DEBUG_TARGET_PANE.SHARED_WORKER),
name: "Shared Workers",
targets: sharedWorkers
}),
DebugTargetPane({
actionComponent: InspectAction,
collapsibilityKey: DEBUG_TARGET_PANE.OTHER_WORKER,
detailComponent: WorkerDetail,
dispatch,
isCollapsed: collapsibilities.get(DEBUG_TARGET_PANE.OTHER_WORKER),
name: "Other Workers",
targets: otherWorkers
}),
@ -104,6 +119,7 @@ class RuntimePage extends PureComponent {
const mapStateToProps = state => {
return {
collapsibilities: state.ui.debugTargetCollapsibilities,
installedExtensions: state.runtime.installedExtensions,
otherWorkers: state.runtime.otherWorkers,
serviceWorkers: state.runtime.serviceWorkers,

View File

@ -4,4 +4,9 @@
.debug-target-list {
margin-inline-start: 60px;
overflow: hidden;
}
.debug-target-list--collapsed {
max-height: 0;
}

View File

@ -4,7 +4,8 @@
"use strict";
const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react");
const { createFactory, createRef, PureComponent } =
require("devtools/client/shared/vendor/react");
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
@ -19,19 +20,53 @@ class DebugTargetList extends PureComponent {
actionComponent: PropTypes.any.isRequired,
detailComponent: PropTypes.any.isRequired,
dispatch: PropTypes.func.isRequired,
isCollapsed: PropTypes.bool.isRequired,
targets: PropTypes.arrayOf(PropTypes.object).isRequired,
};
}
constructor(props) {
super(props);
this.listRef = createRef();
}
componentDidUpdate(prevProps, prevState, snapshot) {
if (snapshot === null) {
return;
}
const list = this.listRef.current;
list.animate({ maxHeight: [`${ snapshot }px`, `${ list.clientHeight }px`] },
{ duration: 150, easing: "cubic-bezier(.07, .95, 0, 1)" });
}
getSnapshotBeforeUpdate(prevProps) {
if (this.props.isCollapsed !== prevProps.isCollapsed) {
return this.listRef.current.clientHeight;
}
return null;
}
render() {
const { actionComponent, detailComponent, dispatch, targets } = this.props;
const {
actionComponent,
detailComponent,
dispatch,
isCollapsed,
targets,
} = this.props;
return dom.ul(
{
className: "debug-target-list",
className: "debug-target-list" +
(isCollapsed ? " debug-target-list--collapsed" : ""),
ref: this.listRef,
},
targets.map(target =>
DebugTargetItem({ actionComponent, detailComponent, dispatch, target })),
targets.length === 0
? "Nothing yet."
: targets.map((target, key) =>
DebugTargetItem({ actionComponent, detailComponent, dispatch, key, target })),
);
}
}

View File

@ -0,0 +1,37 @@
/* 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/. */
.debug-target-pane__title {
align-items: center;
display: flex;
}
.debug-target-pane__title::before {
background-image: url(chrome://devtools/skin/images/aboutdebugging-collapse-icon.svg);
background-position: center;
background-repeat: no-repeat;
background-size: contain;
content: "";
display: inline-block;
fill: currentColor;
height: 1em;
margin-inline-end: 0.5em;
transition: transform 150ms cubic-bezier(.07, .95, 0, 1);
width: 1em;
-moz-context-properties: fill;
}
.debug-target-pane__title,
.debug-target-pane__title:active,
.debug-target-pane__title:hover,
.debug-target-pane__title:hover:active,
.debug-target-pane__title:link,
.debug-target-pane__title:visited {
text-decoration: none;
color: var(--text-color);
}
.debug-target-pane__title--collapsed::before {
transform: rotate(-90deg);
}

View File

@ -10,6 +10,8 @@ const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const DebugTargetList = createFactory(require("./DebugTargetList"));
const Actions = require("../../actions/index");
/**
* This component provides list for debug target and name area.
*/
@ -17,20 +19,52 @@ class DebugTargetPane extends PureComponent {
static get propTypes() {
return {
actionComponent: PropTypes.any.isRequired,
collapsibilityKey: PropTypes.string.isRequired,
detailComponent: PropTypes.any.isRequired,
dispatch: PropTypes.func.isRequired,
isCollapsed: PropTypes.bool.isRequired,
name: PropTypes.string.isRequired,
targets: PropTypes.arrayOf(PropTypes.Object).isRequired,
targets: PropTypes.arrayOf(PropTypes.object).isRequired,
};
}
toggleCollapsibility() {
const { collapsibilityKey, dispatch, isCollapsed } = this.props;
dispatch(Actions.updateDebugTargetCollapsibility(collapsibilityKey, !isCollapsed));
}
render() {
const { actionComponent, detailComponent, dispatch, name, targets } = this.props;
const {
actionComponent,
detailComponent,
dispatch,
isCollapsed,
name,
targets,
} = this.props;
return dom.section(
{},
dom.h2({}, name),
DebugTargetList({ actionComponent, detailComponent, dispatch, targets }),
dom.h2(
{},
dom.a(
{
className: "debug-target-pane__title" +
(isCollapsed ? " debug-target-pane__title--collapsed" : ""),
href: "#",
onClick: e => this.toggleCollapsibility(),
},
name,
isCollapsed ? dom.span({}, `(${ targets.length })`) : null,
)
),
DebugTargetList({
actionComponent,
detailComponent,
dispatch,
isCollapsed,
targets,
}),
);
}
}

View File

@ -18,12 +18,13 @@ class ExtensionDetail extends PureComponent {
};
}
renderField(name, value, title) {
renderField(key, name, value, title) {
return [
dom.dt({}, name),
dom.dt({ key: `${ key }-dt` }, name),
dom.dd(
{
className: "ellipsis-text",
key: `${ key }-dd`,
title: title || value,
},
value,
@ -40,6 +41,7 @@ class ExtensionDetail extends PureComponent {
dom.a(
{
className: "extension-detail__manifest",
key: "manifest",
href: manifestURL,
target: "_blank",
},
@ -47,7 +49,7 @@ class ExtensionDetail extends PureComponent {
)
];
return this.renderField("Internal UUID", value, uuid);
return this.renderField("uuid", "Internal UUID", value, uuid);
}
render() {
@ -59,8 +61,8 @@ class ExtensionDetail extends PureComponent {
{
className: "extension-detail",
},
location ? this.renderField("Location", location) : null,
this.renderField("Extension ID", id),
location ? this.renderField("location", "Location", location) : null,
this.renderField("extension", "Extension ID", id),
uuid ? this.renderUUID() : null,
);
}

View File

@ -27,15 +27,16 @@ class WorkerDetail extends PureComponent {
const label = fetch === SERVICE_WORKER_FETCH_STATES.LISTENING
? "Listening for fetch events"
: "Not listening for fetch events";
return this.renderField("Fetch", label);
return this.renderField("fetch", "Fetch", label);
}
renderField(name, value) {
renderField(key, name, value) {
return [
dom.dt({}, name),
dom.dt({ key: `${ key }-dt` }, name),
dom.dd(
{
className: "ellipsis-text",
key: `${ key }-dd`,
title: value,
},
value,
@ -62,7 +63,7 @@ class WorkerDetail extends PureComponent {
className: "worker-detail",
},
fetch ? this.renderFetch() : null,
scope ? this.renderField("Scope", scope) : null,
scope ? this.renderField("scope", "Scope", scope) : null,
status ? this.renderStatus() : null,
);
}

View File

@ -7,6 +7,7 @@ DevToolsModules(
'DebugTargetItem.js',
'DebugTargetList.css',
'DebugTargetList.js',
'DebugTargetPane.css',
'DebugTargetPane.js',
'ExtensionDetail.css',
'ExtensionDetail.js',

View File

@ -8,6 +8,7 @@ const actionTypes = {
CONNECT_RUNTIME_FAILURE: "CONNECT_RUNTIME_FAILURE",
CONNECT_RUNTIME_START: "CONNECT_RUNTIME_START",
CONNECT_RUNTIME_SUCCESS: "CONNECT_RUNTIME_SUCCESS",
DEBUG_TARGET_COLLAPSIBILITY_UPDATED: "DEBUG_TARGET_COLLAPSIBILITY_UPDATED",
DISCONNECT_RUNTIME_FAILURE: "DISCONNECT_RUNTIME_FAILURE",
DISCONNECT_RUNTIME_START: "DISCONNECT_RUNTIME_START",
DISCONNECT_RUNTIME_SUCCESS: "DISCONNECT_RUNTIME_SUCCESS",
@ -30,6 +31,15 @@ const DEBUG_TARGETS = {
WORKER: "WORKER",
};
const DEBUG_TARGET_PANE = {
INSTALLED_EXTENSION: "installedExtension",
OTHER_WORKER: "otherWorker",
SERVICE_WORKER: "serviceWorker",
SHARED_WORKER: "sharedWorker",
TAB: "tab",
TEMPORARY_EXTENSION: "temporaryExtension",
};
const PAGES = {
THIS_FIREFOX: "this-firefox",
CONNECT: "connect",
@ -49,6 +59,7 @@ const SERVICE_WORKER_STATUSES = {
// flatten constants
module.exports = Object.assign({}, {
DEBUG_TARGETS,
DEBUG_TARGET_PANE,
PAGES,
SERVICE_WORKER_FETCH_STATES,
SERVICE_WORKER_STATUSES,

View File

@ -14,6 +14,7 @@ const debugTargetListenerMiddleware = require("./middleware/debug-target-listene
const extensionComponentDataMiddleware = require("./middleware/extension-component-data");
const tabComponentDataMiddleware = require("./middleware/tab-component-data");
const workerComponentDataMiddleware = require("./middleware/worker-component-data");
const { getDebugTargetCollapsibilities } = require("./modules/debug-target-collapsibilities");
const { getNetworkLocations } = require("./modules/network-locations");
function configureStore() {
@ -32,8 +33,9 @@ function configureStore() {
}
function getUiState() {
const collapsibilities = getDebugTargetCollapsibilities();
const locations = getNetworkLocations();
return new UiState(locations);
return new UiState(locations, collapsibilities);
}
exports.configureStore = configureStore;

View File

@ -0,0 +1,46 @@
/* 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/. */
"use strict";
const Services = require("Services");
const PREF_PREFIX = "devtools.aboutdebugging.collapsibilities.";
const { DEBUG_TARGET_PANE } = require("../constants");
/**
* This module provides a collection of helper methods to read and update the debug
* target pane's collapsibilities.
*/
/**
* @return {Object}
* {
* key: constants.DEBUG_TARGET_PANE
* value: true - collapsed
* false - expanded
* }
*/
function getDebugTargetCollapsibilities() {
const map = new Map();
for (const key of Object.values(DEBUG_TARGET_PANE)) {
const pref = Services.prefs.getBoolPref(PREF_PREFIX + key, false);
map.set(key, pref);
}
return map;
}
exports.getDebugTargetCollapsibilities = getDebugTargetCollapsibilities;
/**
* @param collapsibilities - Same format to getDebugTargetCollapsibilities.
*/
function setDebugTargetCollapsibilities(collapsibilities) {
for (const key of Object.values(DEBUG_TARGET_PANE)) {
const isCollapsed = collapsibilities.get(key);
Services.prefs.setBoolPref(PREF_PREFIX + key, isCollapsed);
}
}
exports.setDebugTargetCollapsibilities = setDebugTargetCollapsibilities;

View File

@ -3,6 +3,7 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DevToolsModules(
'debug-target-collapsibilities.js',
'extensions-helper.js',
'network-locations.js',
)

View File

@ -5,12 +5,14 @@
"use strict";
const {
DEBUG_TARGET_COLLAPSIBILITY_UPDATED,
NETWORK_LOCATIONS_UPDATED,
PAGE_SELECTED,
} = require("../constants");
function UiState(locations = []) {
function UiState(locations = [], debugTargetCollapsibilities = {}) {
return {
debugTargetCollapsibilities,
networkLocations: locations,
selectedPage: null,
};
@ -18,9 +20,11 @@ function UiState(locations = []) {
function uiReducer(state = UiState(), action) {
switch (action.type) {
case PAGE_SELECTED: {
const { page } = action;
return Object.assign({}, state, { selectedPage: page });
case DEBUG_TARGET_COLLAPSIBILITY_UPDATED: {
const { isCollapsed, key } = action;
const debugTargetCollapsibilities = new Map(state.debugTargetCollapsibilities);
debugTargetCollapsibilities.set(key, isCollapsed);
return Object.assign({}, state, { debugTargetCollapsibilities });
}
case NETWORK_LOCATIONS_UPDATED: {
@ -28,6 +32,11 @@ function uiReducer(state = UiState(), action) {
return Object.assign({}, state, { networkLocations: locations });
}
case PAGE_SELECTED: {
const { page } = action;
return Object.assign({}, state, { selectedPage: page });
}
default:
return state;
}

View File

@ -112,6 +112,7 @@ devtools.jar:
skin/images/breadcrumbs-divider.svg (themes/images/breadcrumbs-divider.svg)
skin/images/filters.svg (themes/images/filters.svg)
skin/images/filter-swatch.svg (themes/images/filter-swatch.svg)
skin/images/aboutdebugging-collapse-icon.svg (themes/images/aboutdebugging-collapse-icon.svg)
skin/images/aboutdebugging-connect-icon.svg (themes/images/aboutdebugging-connect-icon.svg)
skin/images/aboutdebugging-firefox-logo.svg (themes/images/aboutdebugging-firefox-logo.svg)
skin/images/aboutdebugging-globe-icon.svg (themes/images/aboutdebugging-globe-icon.svg)

View File

@ -332,6 +332,13 @@ pref("devtools.responsive.show-setting-tooltip", false);
// Enable new about:debugging.
pref("devtools.aboutdebugging.new-enabled", false);
pref("devtools.aboutdebugging.network-locations", "[]");
// Debug target pane collapse/expand settings.
pref("devtools.aboutdebugging.collapsibilities.installedExtension", false);
pref("devtools.aboutdebugging.collapsibilities.otherWorker", false);
pref("devtools.aboutdebugging.collapsibilities.serviceWorker", false);
pref("devtools.aboutdebugging.collapsibilities.sharedWorker", false);
pref("devtools.aboutdebugging.collapsibilities.tab", false);
pref("devtools.aboutdebugging.collapsibilities.temporaryExtension", false);
// about:debugging: only show system add-ons in local builds by default.
#ifdef MOZILLA_OFFICIAL

View File

@ -0,0 +1,8 @@
<!-- 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/. -->
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="context-fill #0b0b0b">
<path d="M4 12.5l8-5-8-5v10zm-1 0v-10a1 1 0 0 1 1.53-.848l8 5a1 1 0 0 1 0 1.696l-8 5A1 1 0 0 1 3 12.5z"
transform="rotate(90, 7.5, 8)"
fill-rule="evenodd"/>
</svg>

After

Width:  |  Height:  |  Size: 506 B

View File

@ -60,8 +60,8 @@ public:
explicit Animation(nsIGlobalObject* aGlobal)
: DOMEventTargetHelper(aGlobal)
, mPlaybackRate(1.0)
, mPendingState(PendingState::NotPending)
, mAnimationIndex(sNextAnimationIndex++)
, mPendingState(PendingState::NotPending)
, mFinishedAtLastComposeStyle(false)
, mIsRelevant(false)
, mFinishedIsResolved(false)
@ -568,15 +568,6 @@ protected:
// See http://drafts.csswg.org/web-animations/#current-finished-promise
RefPtr<Promise> mFinished;
// Indicates if the animation is in the pending state (and what state it is
// waiting to enter when it finished pending). We use this rather than
// checking if this animation is tracked by a PendingAnimationTracker because
// the animation will continue to be pending even after it has been removed
// from the PendingAnimationTracker while it is waiting for the next tick
// (see TriggerOnNextTick for details).
enum class PendingState { NotPending, PlayPending, PausePending };
PendingState mPendingState;
static uint64_t sNextAnimationIndex;
// The relative position of this animation within the global animation list.
@ -588,12 +579,25 @@ protected:
// possible for two different objects to have the same index.
uint64_t mAnimationIndex;
// Indicates if the animation is in the pending state (and what state it is
// waiting to enter when it finished pending). We use this rather than
// checking if this animation is tracked by a PendingAnimationTracker because
// the animation will continue to be pending even after it has been removed
// from the PendingAnimationTracker while it is waiting for the next tick
// (see TriggerOnNextTick for details).
enum class PendingState : uint8_t
{
NotPending,
PlayPending,
PausePending
};
PendingState mPendingState;
bool mFinishedAtLastComposeStyle;
// Indicates that the animation should be exposed in an element's
// getAnimations() list.
bool mIsRelevant;
RefPtr<MicroTaskRunnable> mFinishNotificationTask;
// True if mFinished is resolved or would be resolved if mFinished has
// yet to be created. This is not set when mFinished is rejected since
// in that case mFinished is immediately reset to represent a new current
@ -605,6 +609,8 @@ protected:
// the main thread.
bool mSyncWithGeometricAnimations;
RefPtr<MicroTaskRunnable> mFinishNotificationTask;
nsString mId;
};

View File

@ -12,7 +12,6 @@ XPIDL_SOURCES += [
'nsIDOMXULCommandDispatcher.idl',
'nsIDOMXULContainerElement.idl',
'nsIDOMXULControlElement.idl',
'nsIDOMXULDescriptionElement.idl',
'nsIDOMXULLabeledControlEl.idl',
'nsIDOMXULLabelElement.idl',
'nsIDOMXULMenuListElement.idl',

View File

@ -1,15 +0,0 @@
/* -*- Mode: IDL; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#include "nsISupports.idl"
[scriptable, uuid(64c3500e-e258-4d49-b7ca-c93ab0931ce4)]
interface nsIDOMXULDescriptionElement : nsISupports {
attribute boolean disabled;
attribute boolean crop;
attribute DOMString value;
};

View File

@ -3,11 +3,10 @@
* 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/. */
#include "nsIDOMXULDescriptionElement.idl"
#include "nsISupports.idl"
[scriptable, uuid(8b67286b-bf86-4808-8a68-ecdbc7d9877b)]
interface nsIDOMXULLabelElement : nsIDOMXULDescriptionElement {
interface nsIDOMXULLabelElement : nsISupports {
attribute DOMString accessKey;
attribute DOMString control;
};

View File

@ -9,14 +9,12 @@ TEST_DIRS += ['tests']
XPIDL_SOURCES += [
'nsIScriptableUConv.idl',
'nsITextToSubURI.idl',
'nsIUTF8ConverterService.idl',
]
XPIDL_MODULE = 'uconv'
EXPORTS += [
'nsConverterInputStream.h',
'nsUConvCID.h',
]
UNIFIED_SOURCES += [
@ -25,7 +23,6 @@ UNIFIED_SOURCES += [
'nsScriptableUConv.cpp',
'nsTextToSubURI.cpp',
'nsUConvModule.cpp',
'nsUTF8ConverterService.cpp'
]
FINAL_LIBRARY = 'xul'

View File

@ -1,68 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/* vim:expandtab:shiftwidth=4:tabstop=4:
*/
/* 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/. */
#include "nsISupports.idl"
[scriptable, uuid(249f52a3-2599-4b00-ba40-0481364831a2)]
interface nsIUTF8ConverterService : nsISupports
{
/**
* Ensure that |aString| is encoded in UTF-8. If not,
* convert to UTF-8 assuming it's encoded in |aCharset|
* and return the converted string in UTF-8.
*
* @param aString a string to ensure its UTF8ness
* @param aCharset the charset to convert from if |aString| is not in UTF-8
* @param aSkipCheck determines whether or not to skip 'ASCIIness' and
* 'UTF8ness' check. Set this to PR_TRUE only if you suspect that
* aString can be mistaken for ASCII / UTF-8 but is actually NOT
* in ASCII / UTF-8 so that aString has to go through the conversion.
* skipping ASCIIness/UTF8ness check.
* The most common case is the input is in 7bit non-ASCII charsets
* like ISO-2022-JP, HZ or UTF-7 (in its original form or
* a modified form used in IMAP folder names).
* @param aAllowSubstitution when true, allow the decoder to substitute
* invalid input sequences by replacement characters (defaults to
* true)
* @return the converted string in UTF-8.
* @throws NS_ERROR_UCONV_NOCONV when there is no decoder for aCharset
* or NS_ERROR_UDEC_ILLEGALINPUT in case of conversion failure
*/
[optional_argc]
AUTF8String convertStringToUTF8(in ACString aString,
in string aCharset,
in boolean aSkipCheck,
[optional] in boolean aAllowSubstitution);
/* XXX : To-be-added. convertStringFromUTF8 */
/**
* Ensure that |aSpec| (after URL-unescaping it) is encoded in UTF-8.
* If not, convert it to UTF-8, assuming it's encoded in |aCharset|,
* and return the result.
*
* <p>Make sure that all characters outside US-ASCII in your input spec
* are url-escaped if your spec is not in UTF-8 (before url-escaping)
* because the presence of non-ASCII characters is <strong>blindly</strong>
* regarded as an indication that your input spec is in unescaped UTF-8
* and it will be returned without further processing. No valid spec
* going around in Mozilla code would break this assumption.
*
* <p>XXX The above may change in the future depending on the usage pattern.
*
* @param aSpec an url-escaped URI spec to ensure its UTF8ness
* @param aCharset the charset to convert from if |aSpec| is not in UTF-8
* @return the converted spec in UTF-8.
* @throws NS_ERROR_UCONV_NOCONV when there is no decoder for aCharset
* or NS_ERROR_UDEC_ILLEGALINPUT in case of conversion failure
*/
AUTF8String convertURISpecToUTF8(in ACString aSpec,
in string aCharset);
};

View File

@ -1,18 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:expandtab:shiftwidth=2:tabstop=2:
**/
/* 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/. */
// I am taking the first step in the hope that this file will become 'the'
// repository of #defines for CID's and CONTRACTID's of implementations of
// all interfaces in nsUConvModule and be included by any file that wants
// to refers to one or more of implementations by CID/CONTRACTID.
// see bug 162765 comment #33.
// {2b026890-5a2e-4981-ada2-a600358947b4}
#define NS_UTF8CONVERTERSERVICE_CID { 0x2b026890, 0x5a2e, 0x4981, \
{ 0xad, 0xa2, 0xa6, 0x00, 0x35, 0x89, 0x47, 0xb4 } }
#define NS_UTF8CONVERTERSERVICE_CONTRACTID "@mozilla.org/intl/utf8converterservice;1"

View File

@ -5,16 +5,13 @@
#include "mozilla/ModuleUtils.h"
#include "nsTextToSubURI.h"
#include "nsUTF8ConverterService.h"
#include "nsConverterInputStream.h"
#include "nsConverterOutputStream.h"
#include "nsScriptableUConv.h"
#include "nsIOutputStream.h"
#include "nsITextToSubURI.h"
#include "nsUConvCID.h"
NS_GENERIC_FACTORY_CONSTRUCTOR(nsTextToSubURI)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsUTF8ConverterService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsConverterInputStream)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsConverterOutputStream)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsScriptableUnicodeConverter)
@ -23,14 +20,12 @@ NS_DEFINE_NAMED_CID(NS_TEXTTOSUBURI_CID);
NS_DEFINE_NAMED_CID(NS_CONVERTERINPUTSTREAM_CID);
NS_DEFINE_NAMED_CID(NS_CONVERTEROUTPUTSTREAM_CID);
NS_DEFINE_NAMED_CID(NS_ISCRIPTABLEUNICODECONVERTER_CID);
NS_DEFINE_NAMED_CID(NS_UTF8CONVERTERSERVICE_CID);
static const mozilla::Module::CIDEntry kUConvCIDs[] = {
{ &kNS_TEXTTOSUBURI_CID, false, nullptr, nsTextToSubURIConstructor },
{ &kNS_CONVERTERINPUTSTREAM_CID, false, nullptr, nsConverterInputStreamConstructor },
{ &kNS_CONVERTEROUTPUTSTREAM_CID, false, nullptr, nsConverterOutputStreamConstructor },
{ &kNS_ISCRIPTABLEUNICODECONVERTER_CID, false, nullptr, nsScriptableUnicodeConverterConstructor },
{ &kNS_UTF8CONVERTERSERVICE_CID, false, nullptr, nsUTF8ConverterServiceConstructor },
{ nullptr },
};
@ -39,7 +34,6 @@ static const mozilla::Module::ContractIDEntry kUConvContracts[] = {
{ NS_CONVERTERINPUTSTREAM_CONTRACTID, &kNS_CONVERTERINPUTSTREAM_CID },
{ "@mozilla.org/intl/converter-output-stream;1", &kNS_CONVERTEROUTPUTSTREAM_CID },
{ NS_ISCRIPTABLEUNICODECONVERTER_CONTRACTID, &kNS_ISCRIPTABLEUNICODECONVERTER_CID },
{ NS_UTF8CONVERTERSERVICE_CONTRACTID, &kNS_UTF8CONVERTERSERVICE_CID },
{ nullptr }
};

View File

@ -1,109 +0,0 @@
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* vim:expandtab:shiftwidth=2:tabstop=4:
*/
/* 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/. */
#include "nsString.h"
#include "nsUTF8ConverterService.h"
#include "nsEscape.h"
#include "mozilla/Encoding.h"
using namespace mozilla;
NS_IMPL_ISUPPORTS(nsUTF8ConverterService, nsIUTF8ConverterService)
static nsresult
ToUTF8(const nsACString& aString,
const char* aCharset,
bool aAllowSubstitution,
nsACString& aResult)
{
if (!aCharset || !*aCharset)
return NS_ERROR_INVALID_ARG;
auto encoding = Encoding::ForLabelNoReplacement(MakeStringSpan(aCharset));
if (!encoding) {
return NS_ERROR_UCONV_NOCONV;
}
if (aAllowSubstitution) {
nsresult rv = encoding->DecodeWithoutBOMHandling(aString, aResult);
if (NS_SUCCEEDED(rv)) {
return NS_OK;
}
return rv;
}
return encoding->DecodeWithoutBOMHandlingAndWithoutReplacement(aString,
aResult);
}
NS_IMETHODIMP
nsUTF8ConverterService::ConvertStringToUTF8(const nsACString& aString,
const char* aCharset,
bool aSkipCheck,
bool aAllowSubstitution,
uint8_t aOptionalArgc,
nsACString& aUTF8String)
{
bool allowSubstitution = (aOptionalArgc == 1) ? aAllowSubstitution : true;
// return if ASCII only or valid UTF-8 providing that the ASCII/UTF-8
// check is requested. It may not be asked for if a caller suspects
// that the input is in non-ASCII 7bit charset (ISO-2022-xx, HZ) or
// it's in a charset other than UTF-8 that can be mistaken for UTF-8.
if (!aSkipCheck && (IsASCII(aString) || IsUTF8(aString))) {
aUTF8String = aString;
return NS_OK;
}
aUTF8String.Truncate();
nsresult rv = ToUTF8(aString, aCharset, allowSubstitution, aUTF8String);
// additional protection for cases where check is skipped and the input
// is actually in UTF-8 as opposed to aCharset. (i.e. caller's hunch
// was wrong.) We don't check ASCIIness assuming there's no charset
// incompatible with ASCII (we don't support EBCDIC).
if (aSkipCheck && NS_FAILED(rv) && IsUTF8(aString)) {
aUTF8String = aString;
return NS_OK;
}
return rv;
}
NS_IMETHODIMP
nsUTF8ConverterService::ConvertURISpecToUTF8(const nsACString& aSpec,
const char* aCharset,
nsACString& aUTF8Spec)
{
// assume UTF-8 if the spec contains unescaped non-ASCII characters.
// No valid spec in Mozilla would break this assumption.
if (!IsASCII(aSpec)) {
aUTF8Spec = aSpec;
return NS_OK;
}
aUTF8Spec.Truncate();
nsAutoCString unescapedSpec;
// NS_UnescapeURL does not fill up unescapedSpec unless there's at least
// one character to unescape.
bool written = NS_UnescapeURL(PromiseFlatCString(aSpec).get(),
aSpec.Length(),
esc_OnlyNonASCII,
unescapedSpec);
if (!written) {
aUTF8Spec = aSpec;
return NS_OK;
}
// return if ASCII only or escaped UTF-8
if (IsASCII(unescapedSpec) || IsUTF8(unescapedSpec)) {
aUTF8Spec = unescapedSpec;
return NS_OK;
}
return ToUTF8(unescapedSpec, aCharset, true, aUTF8Spec);
}

View File

@ -1,24 +0,0 @@
/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* 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/. */
#ifndef nsUTF8ConverterService_h__
#define nsUTF8ConverterService_h__
#include "nsIUTF8ConverterService.h"
//==============================================================
class nsUTF8ConverterService: public nsIUTF8ConverterService {
public:
NS_DECL_ISUPPORTS
NS_DECL_NSIUTF8CONVERTERSERVICE
nsUTF8ConverterService() {}
private:
virtual ~nsUTF8ConverterService() {}
};
#endif // nsUTF8ConverterService_h__

View File

@ -1057,7 +1057,7 @@ nsSubDocumentFrame::GetMarginAttributes()
}
nsFrameLoader*
nsSubDocumentFrame::FrameLoader()
nsSubDocumentFrame::FrameLoader() const
{
nsIContent* content = GetContent();
if (!content)
@ -1072,6 +1072,12 @@ nsSubDocumentFrame::FrameLoader()
return mFrameLoader;
}
mozilla::layout::RenderFrameParent*
nsSubDocumentFrame::GetRenderFrameParent() const
{
return FrameLoader() ? FrameLoader()->GetCurrentRenderFrame() : nullptr;
}
// XXX this should be called ObtainDocShell or something like that,
// to indicate that it could have side effects
nsIDocShell*

View File

@ -13,6 +13,12 @@
#include "nsFrameLoader.h"
#include "Units.h"
namespace mozilla {
namespace layout {
class RenderFrameParent;
}
}
/******************************************************************************
* nsSubDocumentFrame
*****************************************************************************/
@ -134,13 +140,15 @@ public:
}
}
mozilla::layout::RenderFrameParent* GetRenderFrameParent() const;
protected:
friend class AsyncFrameInit;
// Helper method to look up the HTML marginwidth & marginheight attributes.
mozilla::CSSIntSize GetMarginAttributes();
nsFrameLoader* FrameLoader();
nsFrameLoader* FrameLoader() const;
bool IsInline() { return mIsInline; }
@ -167,7 +175,8 @@ protected:
nsView* GetViewInternal() const override { return mOuterView; }
void SetViewInternal(nsView* aView) override { mOuterView = aView; }
RefPtr<nsFrameLoader> mFrameLoader;
mutable RefPtr<nsFrameLoader> mFrameLoader;
nsView* mOuterView;
nsView* mInnerView;
bool mIsInline;

View File

@ -293,7 +293,7 @@ RenderFrameParent::BuildDisplayList(nsDisplayListBuilder* aBuilder,
clipState.ClipContentDescendants(bounds);
aLists.Content()->AppendToTop(
MakeDisplayItem<nsDisplayRemote>(aBuilder, aFrame, this));
MakeDisplayItem<nsDisplayRemote>(aBuilder, aFrame));
}
void
@ -344,10 +344,8 @@ RenderFrameParent::EnsureLayersConnected(CompositorOptions* aCompositorOptions)
} // namespace mozilla
nsDisplayRemote::nsDisplayRemote(nsDisplayListBuilder* aBuilder,
nsSubDocumentFrame* aFrame,
RenderFrameParent* aRemoteFrame)
nsSubDocumentFrame* aFrame)
: nsDisplayItem(aBuilder, aFrame)
, mRemoteFrame(aRemoteFrame)
, mEventRegionsOverride(EventRegionsOverride::NoOverride)
{
bool frameIsPointerEventsNone =
@ -361,12 +359,24 @@ nsDisplayRemote::nsDisplayRemote(nsDisplayListBuilder* aBuilder,
}
}
bool
nsDisplayRemote::HasDeletedFrame() const
{
// RenderFrameParent might change without invalidating nsSubDocumentFrame.
return !GetRenderFrameParent() || nsDisplayItem::HasDeletedFrame();
}
already_AddRefed<Layer>
nsDisplayRemote::BuildLayer(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aContainerParameters)
{
RefPtr<Layer> layer = mRemoteFrame->BuildLayer(aBuilder, mFrame, aManager, this, aContainerParameters);
MOZ_ASSERT(GetRenderFrameParent());
RefPtr<Layer> layer =
GetRenderFrameParent()->BuildLayer(aBuilder, mFrame, aManager,
this, aContainerParameters);
if (layer && layer->AsRefLayer()) {
layer->AsRefLayer()->SetEventRegionsOverride(mEventRegionsOverride);
}
@ -409,5 +419,12 @@ nsDisplayRemote::UpdateScrollData(mozilla::layers::WebRenderScrollData* aData,
LayersId
nsDisplayRemote::GetRemoteLayersId() const
{
return mRemoteFrame->GetLayersId();
MOZ_ASSERT(GetRenderFrameParent());
return GetRenderFrameParent()->GetLayersId();
}
mozilla::layout::RenderFrameParent*
nsDisplayRemote::GetRenderFrameParent() const
{
return static_cast<nsSubDocumentFrame*>(Frame())->GetRenderFrameParent();
}

View File

@ -149,32 +149,36 @@ class nsDisplayRemote : public nsDisplayItem
typedef mozilla::layout::RenderFrameParent RenderFrameParent;
public:
nsDisplayRemote(nsDisplayListBuilder* aBuilder, nsSubDocumentFrame* aFrame,
RenderFrameParent* aRemoteFrame);
nsDisplayRemote(nsDisplayListBuilder* aBuilder,
nsSubDocumentFrame* aFrame);
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aParameters) override
{ return mozilla::LAYER_ACTIVE_FORCE; }
bool HasDeletedFrame() const override;
virtual already_AddRefed<Layer>
LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
LayerManager* aManager,
const ContainerLayerParameters& aParameters) override
{
return mozilla::LAYER_ACTIVE_FORCE;
}
already_AddRefed<Layer>
BuildLayer(nsDisplayListBuilder* aBuilder, LayerManager* aManager,
const ContainerLayerParameters& aContainerParameters) override;
virtual bool CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
mozilla::wr::IpcResourceUpdateQueue& aResources,
const StackingContextHelper& aSc,
mozilla::layers::WebRenderLayerManager* aManager,
nsDisplayListBuilder* aDisplayListBuilder) override;
virtual bool UpdateScrollData(mozilla::layers::WebRenderScrollData* aData,
mozilla::layers::WebRenderLayerScrollData* aLayerData) override;
mozilla::layers::LayersId GetRemoteLayersId() const;
bool CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
mozilla::wr::IpcResourceUpdateQueue& aResources,
const StackingContextHelper& aSc,
mozilla::layers::WebRenderLayerManager* aManager,
nsDisplayListBuilder* aDisplayListBuilder) override;
bool UpdateScrollData(mozilla::layers::WebRenderScrollData* aData,
mozilla::layers::WebRenderLayerScrollData* aLayerData) override;
NS_DISPLAY_DECL_NAME("Remote", TYPE_REMOTE)
private:
RenderFrameParent* mRemoteFrame;
mozilla::layers::LayersId GetRemoteLayersId() const;
RenderFrameParent* GetRenderFrameParent() const;
mozilla::LayoutDeviceIntPoint mOffset;
mozilla::layers::EventRegionsOverride mEventRegionsOverride;
};

View File

@ -533,27 +533,6 @@
{0xa5, 0x0c, 0x2c, 0xbb, 0x08, 0x5a, 0xb7, 0xa5} \
}
#define NS_APPLICATIONCACHENAMESPACE_CONTRACTID \
"@mozilla.org/network/application-cache-namespace;1"
#define NS_APPLICATIONCACHENAMESPACE_CID \
{ /* b00ed78a-04e2-4f74-8e1c-d1af79dfd12f */ \
0xb00ed78a, \
0x04e2, \
0x4f74, \
{0x8e, 0x1c, 0xd1, 0xaf, 0x79, 0xdf, 0xd1, 0x2f} \
}
#define NS_APPLICATIONCACHE_CONTRACTID \
"@mozilla.org/network/application-cache;1"
#define NS_APPLICATIONCACHE_CID \
{ /* 463440c5-baad-4f3c-9e50-0b107abe7183 */ \
0x463440c5, \
0xbaad, \
0x4f3c, \
{0x9e, 0x50, 0xb, 0x10, 0x7a, 0xbe, 0x71, 0x83 } \
}
/******************************************************************************
* netwerk/protocol/http/ classes
*/

View File

@ -28,7 +28,6 @@
#include "nsSOCKSSocketProvider.h"
#include "nsCacheService.h"
#include "nsDiskCacheDeviceSQL.h"
#include "nsApplicationCache.h"
#include "nsApplicationCacheService.h"
#include "nsMimeTypes.h"
#include "nsDNSPrefetch.h"
@ -230,8 +229,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsNestedAboutURIMutator)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsAboutCacheEntry)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsApplicationCacheService)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsApplicationCacheNamespace)
NS_GENERIC_FACTORY_CONSTRUCTOR(nsApplicationCache)
// file
#include "nsFileProtocolHandler.h"
@ -743,8 +740,6 @@ NS_DEFINE_NAMED_CID(NS_SOCKS4SOCKETPROVIDER_CID);
NS_DEFINE_NAMED_CID(NS_UDPSOCKETPROVIDER_CID);
NS_DEFINE_NAMED_CID(NS_CACHESERVICE_CID);
NS_DEFINE_NAMED_CID(NS_APPLICATIONCACHESERVICE_CID);
NS_DEFINE_NAMED_CID(NS_APPLICATIONCACHENAMESPACE_CID);
NS_DEFINE_NAMED_CID(NS_APPLICATIONCACHE_CID);
#ifdef NECKO_COOKIES
NS_DEFINE_NAMED_CID(NS_COOKIEMANAGER_CID);
NS_DEFINE_NAMED_CID(NS_COOKIESERVICE_CID);
@ -865,8 +860,6 @@ static const mozilla::Module::CIDEntry kNeckoCIDs[] = {
{ &kNS_UDPSOCKETPROVIDER_CID, false, nullptr, nsUDPSocketProviderConstructor },
{ &kNS_CACHESERVICE_CID, false, nullptr, nsCacheService::Create },
{ &kNS_APPLICATIONCACHESERVICE_CID, false, nullptr, nsApplicationCacheServiceConstructor },
{ &kNS_APPLICATIONCACHENAMESPACE_CID, false, nullptr, nsApplicationCacheNamespaceConstructor },
{ &kNS_APPLICATIONCACHE_CID, false, nullptr, nsApplicationCacheConstructor },
#ifdef NECKO_COOKIES
{ &kNS_COOKIEMANAGER_CID, false, nullptr, nsICookieServiceConstructor },
{ &kNS_COOKIESERVICE_CID, false, nullptr, nsICookieServiceConstructor },
@ -990,8 +983,6 @@ static const mozilla::Module::ContractIDEntry kNeckoContracts[] = {
{ NS_NETWORK_SOCKET_CONTRACTID_PREFIX "udp", &kNS_UDPSOCKETPROVIDER_CID },
{ NS_CACHESERVICE_CONTRACTID, &kNS_CACHESERVICE_CID },
{ NS_APPLICATIONCACHESERVICE_CONTRACTID, &kNS_APPLICATIONCACHESERVICE_CID },
{ NS_APPLICATIONCACHENAMESPACE_CONTRACTID, &kNS_APPLICATIONCACHENAMESPACE_CID },
{ NS_APPLICATIONCACHE_CONTRACTID, &kNS_APPLICATIONCACHE_CID },
#ifdef NECKO_COOKIES
{ NS_COOKIEMANAGER_CONTRACTID, &kNS_COOKIEMANAGER_CID },
{ NS_COOKIESERVICE_CONTRACTID, &kNS_COOKIESERVICE_CID },

View File

@ -19,9 +19,12 @@ XPIDL_SOURCES += [
XPIDL_MODULE = 'necko_cache'
EXPORTS += [
'nsApplicationCache.h',
'nsApplicationCacheService.h',
'nsCacheDevice.h',
'nsCacheService.h',
'nsDeleteDir.h'
'nsDeleteDir.h',
'nsDiskCacheDeviceSQL.h',
]
UNIFIED_SOURCES += [

View File

@ -3,6 +3,13 @@
* 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/. */
#include "nsIApplicationCache.h"
#include "nsWeakReference.h"
#include "mozilla/RefPtr.h"
#include "nsString.h"
class nsOfflineCacheDevice;
class nsApplicationCache : public nsIApplicationCache
, public nsSupportsWeakReference
{

View File

@ -3,10 +3,10 @@
* 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/. */
#include "mozilla/Encoding.h"
#include "mozilla/dom/ToJSValue.h"
#include "nsAutoPtr.h"
#include "nsCookie.h"
#include "nsUTF8ConverterService.h"
#include <stdlib.h>
/******************************************************************************
@ -97,9 +97,8 @@ nsCookie::Create(const nsACString &aName,
{
// Ensure mValue contains a valid UTF-8 sequence. Otherwise XPConnect will
// truncate the string after the first invalid octet.
RefPtr<nsUTF8ConverterService> converter = new nsUTF8ConverterService();
nsAutoCString aUTF8Value;
converter->ConvertStringToUTF8(aValue, "UTF-8", false, true, 1, aUTF8Value);
UTF_8_ENCODING->DecodeWithoutBOMHandling(aValue, aUTF8Value);
// find the required string buffer size, adding 4 for the terminating nulls
const uint32_t stringLength = aName.Length() + aUTF8Value.Length() +

View File

@ -13,8 +13,6 @@
#include "nsTArray.h"
#include "nsCOMPtr.h"
#include "nsEscape.h"
#include "nsIUTF8ConverterService.h"
#include "nsUConvCID.h"
#include "nsIServiceManager.h"
#include "nsMIMEHeaderParamImpl.h"
#include "nsReadableUtils.h"
@ -33,6 +31,63 @@ static nsresult DecodeRFC2047Str(const char *, const char *, bool, nsACString&);
static nsresult internalDecodeParameter(const nsACString&, const char*,
const char*, bool, bool, nsACString&);
static nsresult
ToUTF8(const nsACString& aString,
const char* aCharset,
bool aAllowSubstitution,
nsACString& aResult)
{
if (!aCharset || !*aCharset)
return NS_ERROR_INVALID_ARG;
auto encoding = Encoding::ForLabelNoReplacement(
mozilla::MakeStringSpan(aCharset));
if (!encoding) {
return NS_ERROR_UCONV_NOCONV;
}
if (aAllowSubstitution) {
nsresult rv = encoding->DecodeWithoutBOMHandling(aString, aResult);
if (NS_SUCCEEDED(rv)) {
return NS_OK;
}
return rv;
}
return encoding->DecodeWithoutBOMHandlingAndWithoutReplacement(aString,
aResult);
}
static nsresult
ConvertStringToUTF8(const nsACString& aString,
const char* aCharset,
bool aSkipCheck,
bool aAllowSubstitution,
nsACString& aUTF8String)
{
// return if ASCII only or valid UTF-8 providing that the ASCII/UTF-8
// check is requested. It may not be asked for if a caller suspects
// that the input is in non-ASCII 7bit charset (ISO-2022-xx, HZ) or
// it's in a charset other than UTF-8 that can be mistaken for UTF-8.
if (!aSkipCheck && (IsASCII(aString) || IsUTF8(aString))) {
aUTF8String = aString;
return NS_OK;
}
aUTF8String.Truncate();
nsresult rv = ToUTF8(aString, aCharset, aAllowSubstitution, aUTF8String);
// additional protection for cases where check is skipped and the input
// is actually in UTF-8 as opposed to aCharset. (i.e. caller's hunch
// was wrong.) We don't check ASCIIness assuming there's no charset
// incompatible with ASCII (we don't support EBCDIC).
if (aSkipCheck && NS_FAILED(rv) && IsUTF8(aString)) {
aUTF8String = aString;
return NS_OK;
}
return rv;
}
// XXX The chance of UTF-7 being used in the message header is really
// low, but in theory it's possible.
#define IS_7BIT_NON_ASCII_CHARSET(cset) \
@ -117,13 +172,10 @@ nsMIMEHeaderParamImpl::DoGetParameter(const nsACString& aHeaderVal,
{
const Encoding* encoding = Encoding::ForLabel(aFallbackCharset);
nsAutoCString str2;
nsCOMPtr<nsIUTF8ConverterService>
cvtUTF8(do_GetService(NS_UTF8CONVERTERSERVICE_CONTRACTID));
if (cvtUTF8 &&
NS_SUCCEEDED(cvtUTF8->ConvertStringToUTF8(str1,
if (NS_SUCCEEDED(ConvertStringToUTF8(str1,
PromiseFlatCString(aFallbackCharset).get(), false,
encoding != UTF_8_ENCODING,
1, str2))) {
str2))) {
CopyUTF8toUTF16(str2, aResult);
return NS_OK;
}
@ -322,20 +374,13 @@ int32_t parseSegmentNumber(const char *aValue, int32_t aLen)
// encoding
bool IsValidOctetSequenceForCharset(nsACString& aCharset, const char *aOctets)
{
nsCOMPtr<nsIUTF8ConverterService> cvtUTF8(do_GetService
(NS_UTF8CONVERTERSERVICE_CONTRACTID));
if (!cvtUTF8) {
NS_WARNING("Can't get UTF8ConverterService\n");
return false;
}
nsAutoCString tmpRaw;
tmpRaw.Assign(aOctets);
nsAutoCString tmpDecoded;
nsresult rv = cvtUTF8->ConvertStringToUTF8(tmpRaw,
PromiseFlatCString(aCharset).get(),
false, false, 1, tmpDecoded);
nsresult rv = ConvertStringToUTF8(tmpRaw,
PromiseFlatCString(aCharset).get(),
false, false, tmpDecoded);
if (rv != NS_OK) {
// we can't decode; charset may be unsupported, or the octet sequence
@ -887,13 +932,8 @@ nsMIMEHeaderParamImpl::DecodeRFC5987Param(const nsACString& aParamVal,
aLang.Assign(language);
// finally convert octet sequence to UTF-8 and be done
nsresult rv = NS_OK;
nsCOMPtr<nsIUTF8ConverterService> cvtUTF8 =
do_GetService(NS_UTF8CONVERTERSERVICE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
nsAutoCString utf8;
rv = cvtUTF8->ConvertStringToUTF8(value, charset.get(), true, false, 1, utf8);
nsresult rv = ConvertStringToUTF8(value, charset.get(), true, false, utf8);
NS_ENSURE_SUCCESS(rv, rv);
CopyUTF8toUTF16(utf8, aResult);
@ -910,10 +950,7 @@ internalDecodeParameter(const nsACString& aParamValue, const char* aCharset,
// encoding and we're pretty sure that it's in aCharset.
if (aCharset && *aCharset)
{
nsCOMPtr<nsIUTF8ConverterService> cvtUTF8(do_GetService(NS_UTF8CONVERTERSERVICE_CONTRACTID));
if (cvtUTF8)
return cvtUTF8->ConvertStringToUTF8(aParamValue, aCharset,
true, true, 1, aResult);
return ConvertStringToUTF8(aParamValue, aCharset, true, true, aResult);
}
const nsCString& param = PromiseFlatCString(aParamValue);
@ -1101,14 +1138,11 @@ void CopyRawHeader(const char *aInput, uint32_t aLen,
IS_7BIT_NON_ASCII_CHARSET(aDefaultCharset);
// If not UTF-8, treat as default charset
nsCOMPtr<nsIUTF8ConverterService>
cvtUTF8(do_GetService(NS_UTF8CONVERTERSERVICE_CONTRACTID));
nsAutoCString utf8Text;
if (cvtUTF8 &&
NS_SUCCEEDED(
cvtUTF8->ConvertStringToUTF8(Substring(aInput, aInput + aLen),
aDefaultCharset, skipCheck, true, 1,
utf8Text))) {
if (NS_SUCCEEDED(
ConvertStringToUTF8(Substring(aInput, aInput + aLen),
aDefaultCharset, skipCheck, true,
utf8Text))) {
aOutput.Append(utf8Text);
} else { // replace each octet with Unicode replacement char in UTF-8.
for (uint32_t i = 0; i < aLen; i++) {
@ -1138,17 +1172,12 @@ nsresult DecodeQOrBase64Str(const char *aEncoded, size_t aLen, char aQOrBase64,
return NS_ERROR_INVALID_ARG;
}
nsresult rv;
nsCOMPtr<nsIUTF8ConverterService>
cvtUTF8(do_GetService(NS_UTF8CONVERTERSERVICE_CONTRACTID, &rv));
nsAutoCString utf8Text;
if (NS_SUCCEEDED(rv)) {
// skip ASCIIness/UTF8ness test if aCharset is 7bit non-ascii charset.
rv = cvtUTF8->ConvertStringToUTF8(nsDependentCString(decodedText),
aCharset,
IS_7BIT_NON_ASCII_CHARSET(aCharset),
true, 1, utf8Text);
}
// skip ASCIIness/UTF8ness test if aCharset is 7bit non-ascii charset.
nsresult rv = ConvertStringToUTF8(nsDependentCString(decodedText),
aCharset,
IS_7BIT_NON_ASCII_CHARSET(aCharset),
true, utf8Text);
free(decodedText);
if (NS_FAILED(rv)) {
return rv;

View File

@ -58,6 +58,7 @@
#include "nsStreamUtils.h"
#include "nsThreadUtils.h"
#include "nsCORSListenerProxy.h"
#include "nsApplicationCache.h"
#ifdef MOZ_TASK_TRACER
#include "GeckoTaskTracer.h"
@ -401,10 +402,7 @@ HttpChannelChild::AssociateApplicationCache(const nsCString &groupID,
const nsCString &clientID)
{
LOG(("HttpChannelChild::AssociateApplicationCache [this=%p]\n", this));
nsresult rv;
mApplicationCache = do_CreateInstance(NS_APPLICATIONCACHE_CONTRACTID, &rv);
if (NS_FAILED(rv))
return;
mApplicationCache = new nsApplicationCache();
mLoadedFromApplicationCache = true;
mApplicationCache->InitAsHandle(groupID, clientID);

View File

@ -11,7 +11,7 @@
<!-- bound to <description>s -->
<binding id="text-base">
<implementation implements="nsIDOMXULDescriptionElement">
<implementation>
<property name="disabled" onset="if (val) this.setAttribute('disabled', 'true');
else this.removeAttribute('disabled');
return val;"

View File

@ -31,6 +31,7 @@
#include "nsProxyRelease.h"
#include "mozilla/Logging.h"
#include "nsIAsyncVerifyRedirectCallback.h"
#include "nsApplicationCache.h"
using namespace mozilla::ipc;
using namespace mozilla::net;
@ -440,12 +441,7 @@ OfflineCacheUpdateChild::RecvAssociateDocuments(const nsCString &cacheGroupId,
{
LOG(("OfflineCacheUpdateChild::RecvAssociateDocuments [%p, cache=%s]", this, cacheClientId.get()));
nsresult rv;
nsCOMPtr<nsIApplicationCache> cache =
do_CreateInstance(NS_APPLICATIONCACHE_CONTRACTID, &rv);
if (NS_FAILED(rv))
return IPC_OK();
nsCOMPtr<nsIApplicationCache> cache = new nsApplicationCache();
cache->InitAsHandle(cacheGroupId, cacheClientId);

View File

@ -38,6 +38,7 @@
#include "mozilla/Attributes.h"
#include "nsContentUtils.h"
#include "nsIPrincipal.h"
#include "nsDiskCacheDeviceSQL.h"
#include "nsXULAppAPI.h"
@ -791,8 +792,7 @@ nsOfflineManifestItem::AddNamespace(uint32_t namespaceType,
}
nsCOMPtr<nsIApplicationCacheNamespace> ns =
do_CreateInstance(NS_APPLICATIONCACHENAMESPACE_CONTRACTID, &rv);
NS_ENSURE_SUCCESS(rv, rv);
new nsApplicationCacheNamespace();
rv = ns->Init(namespaceType, namespaceSpec, data);
NS_ENSURE_SUCCESS(rv, rv);