зеркало из https://github.com/mozilla/gecko-dev.git
Merge mozilla-central to mozilla-inbound. a=merge CLOSED TREE
This commit is contained in:
Коммит
2cc1782106
|
@ -27,5 +27,10 @@ git = "https://github.com/CraneStation/Cranelift"
|
|||
rev = "312516a69da03dc06eace32f61412389a8dcadf3"
|
||||
replace-with = "vendored-sources"
|
||||
|
||||
[source."https://github.com/ChunMinChang/coreaudio-sys"]
|
||||
git = "https://github.com/ChunMinChang/coreaudio-sys"
|
||||
branch = "gecko-build"
|
||||
replace-with = "vendored-sources"
|
||||
|
||||
[source.vendored-sources]
|
||||
directory = '@top_srcdir@/third_party/rust'
|
||||
|
|
|
@ -61,6 +61,11 @@ dependencies = [
|
|||
"nodrop 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "atomic"
|
||||
version = "0.4.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
|
||||
[[package]]
|
||||
name = "atomic_refcell"
|
||||
version = "0.1.0"
|
||||
|
@ -595,6 +600,22 @@ dependencies = [
|
|||
"libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "coreaudio-sys"
|
||||
version = "0.2.2"
|
||||
source = "git+https://github.com/ChunMinChang/coreaudio-sys?branch=gecko-build#b1fe5ea05def23774027037bd42e53fc6da1a04b"
|
||||
dependencies = [
|
||||
"bindgen 0.49.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "coreaudio-sys-utils"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"coreaudio-sys 0.2.2 (git+https://github.com/ChunMinChang/coreaudio-sys?branch=gecko-build)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cose"
|
||||
version = "0.1.4"
|
||||
|
@ -821,6 +842,18 @@ dependencies = [
|
|||
"cubeb-sys 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cubeb-coreaudio"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"atomic 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"coreaudio-sys-utils 0.1.0",
|
||||
"cubeb-backend 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "cubeb-pulse"
|
||||
version = "0.2.0"
|
||||
|
@ -1252,6 +1285,7 @@ dependencies = [
|
|||
"bookmark_sync 0.1.0",
|
||||
"cert_storage 0.0.1",
|
||||
"cose-c 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"cubeb-coreaudio 0.1.0",
|
||||
"cubeb-pulse 0.2.0",
|
||||
"cubeb-sys 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
"encoding_c 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)",
|
||||
|
@ -3883,6 +3917,7 @@ dependencies = [
|
|||
"checksum argon2rs 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "3f67b0b6a86dae6e67ff4ca2b6201396074996379fba2b92ff649126f37cb392"
|
||||
"checksum arrayref 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "0fd1479b7c29641adbd35ff3b5c293922d696a92f25c8c975da3e0acbc87258f"
|
||||
"checksum arrayvec 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "2f0ef4a9820019a0c91d918918c93dc71d469f581a49b47ddc1d285d4270bbe2"
|
||||
"checksum atomic 0.4.5 (registry+https://github.com/rust-lang/crates.io-index)" = "c210c1f4db048cda477b652d170572d84c9640695835f17663595d3bd543fc28"
|
||||
"checksum atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2dcb6e6d35f20276943cc04bb98e538b348d525a04ac79c10021561d202f21"
|
||||
"checksum atty 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "9a7d5b8723950951411ee34d271d99dddcc2035a16ab25310ea2c8cfd4369652"
|
||||
"checksum audio_thread_priority 0.15.0 (registry+https://github.com/rust-lang/crates.io-index)" = "047460864ea9f62fbdfb80fc04a2e5d844aef9e50727e6e9730ca58d9f1a9267"
|
||||
|
@ -3925,6 +3960,7 @@ dependencies = [
|
|||
"checksum core-foundation-sys 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "e7ca8a5221364ef15ce201e8ed2f609fc312682a8f4e0e3d4aa5879764e0fa3b"
|
||||
"checksum core-graphics 0.17.1 (registry+https://github.com/rust-lang/crates.io-index)" = "62ceafe1622ffc9a332199096841d0ff9912ec8cf8f9cde01e254a7d5217cd10"
|
||||
"checksum core-text 13.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f3f46450d6f2397261af420b4ccce23807add2e45fa206410a03d66fb7f050ae"
|
||||
"checksum coreaudio-sys 0.2.2 (git+https://github.com/ChunMinChang/coreaudio-sys?branch=gecko-build)" = "<none>"
|
||||
"checksum cose 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "72fa26cb151d3ae4b70f63d67d0fed57ce04220feafafbae7f503bef7aae590d"
|
||||
"checksum cose-c 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)" = "49726015ab0ca765144fcca61e4a7a543a16b795a777fa53f554da2fffff9a94"
|
||||
"checksum cranelift-bforest 0.32.0 (git+https://github.com/CraneStation/Cranelift?rev=312516a69da03dc06eace32f61412389a8dcadf3)" = "<none>"
|
||||
|
|
|
@ -32,8 +32,10 @@ async function runTests(browser, accDoc) {
|
|||
evt = await onFocus;
|
||||
testStates(evt.accessible, STATE_FOCUSED);
|
||||
|
||||
let inputField = browser.ownerDocument.getElementById("urlbar").inputField;
|
||||
onFocus = waitForEvent(EVENT_FOCUS, getAccessible(inputField));
|
||||
onFocus = waitForEvent(
|
||||
EVENT_FOCUS,
|
||||
event => event.accessible.DOMNode == gURLBar.inputField
|
||||
);
|
||||
EventUtils.synthesizeKey("t", { accelKey: true }, browser.ownerGlobal);
|
||||
evt = await onFocus;
|
||||
testStates(evt.accessible, STATE_FOCUSED);
|
||||
|
|
|
@ -52,7 +52,7 @@ async function runTests() {
|
|||
|
||||
let focused = waitForEvent(
|
||||
EVENT_FOCUS,
|
||||
event => event.accessible.role == ROLE_ENTRY
|
||||
event => event.accessible.role == ROLE_EDITCOMBOBOX
|
||||
);
|
||||
gURLBar.focus();
|
||||
let event = await focused;
|
||||
|
|
|
@ -30,7 +30,7 @@ async function checkURLBarCaretEvents() {
|
|||
});
|
||||
info("Loaded " + kURL);
|
||||
|
||||
let urlbarInputEl = newWin.document.getElementById("urlbar").inputField;
|
||||
let urlbarInputEl = newWin.gURLBar.inputField;
|
||||
let urlbarInput = getAccessible(urlbarInputEl, [nsIAccessibleText]);
|
||||
|
||||
let onCaretMove = waitForEvents([
|
||||
|
|
|
@ -21,7 +21,7 @@ add_task(async function testAutocompleteRichResult() {
|
|||
value: "a",
|
||||
});
|
||||
|
||||
info("Waiting for accessibility to be created for the richlistbox");
|
||||
info("Waiting for accessibility to be created for the results list");
|
||||
let resultsView;
|
||||
resultsView = gURLBar.view.panel.querySelector("#urlbarView-results");
|
||||
await BrowserTestUtils.waitForCondition(() =>
|
||||
|
|
|
@ -64,6 +64,14 @@ class DocProxyAccessibleWrap : public HyperTextProxyAccessibleWrap {
|
|||
return mIDToAccessibleMap.Get(aID);
|
||||
}
|
||||
|
||||
virtual nsIntRect Bounds() const override {
|
||||
// OuterDocAccessible can return a DocProxyAccessibleWrap as a child.
|
||||
// Accessible::ChildAtPoint on an ancestor might retrieve this proxy and
|
||||
// call Bounds() on it. This will crash on a proxy, so we override it to do
|
||||
// nothing here.
|
||||
return nsIntRect();
|
||||
}
|
||||
|
||||
private:
|
||||
/*
|
||||
* This provides a mapping from 32 bit id to accessible objects.
|
||||
|
@ -105,6 +113,14 @@ class RemoteIframeDocProxyAccessibleWrap : public HyperTextAccessibleWrap {
|
|||
addRefed.forget(aOutAccessible);
|
||||
}
|
||||
|
||||
virtual nsIntRect Bounds() const override {
|
||||
// OuterDocAccessible can return a RemoteIframeDocProxyAccessibleWrap as a
|
||||
// child. Accessible::ChildAtPoint on an ancestor might retrieve this proxy
|
||||
// and call Bounds() on it. This will crash on a proxy, so we override it
|
||||
// to do nothing here.
|
||||
return nsIntRect();
|
||||
}
|
||||
|
||||
private:
|
||||
RefPtr<IDispatch> mCOMProxy;
|
||||
};
|
||||
|
|
|
@ -1358,14 +1358,10 @@ pref("security.insecure_password.ui.enabled", true);
|
|||
// Show in-content login form warning UI for insecure login fields
|
||||
pref("security.insecure_field_warning.contextual.enabled", true);
|
||||
|
||||
// Show degraded UI for http pages; disabled for now
|
||||
pref("security.insecure_connection_icon.enabled", false);
|
||||
// Show degraded UI for http pages in private mode only for Nightly: Bug 1434626
|
||||
#if defined(NIGHTLY_BUILD)
|
||||
// Show degraded UI for http pages.
|
||||
pref("security.insecure_connection_icon.enabled", true);
|
||||
// Show degraded UI for http pages in private mode.
|
||||
pref("security.insecure_connection_icon.pbmode.enabled", true);
|
||||
#else
|
||||
pref("security.insecure_connection_icon.pbmode.enabled", false);
|
||||
#endif
|
||||
|
||||
// Show "Not Secure" text for http pages; disabled for now
|
||||
pref("security.insecure_connection_text.enabled", false);
|
||||
|
|
|
@ -317,7 +317,13 @@ var FullScreen = {
|
|||
if (enterFS) {
|
||||
gNavToolbox.setAttribute("inFullscreen", true);
|
||||
document.documentElement.setAttribute("inFullscreen", true);
|
||||
if (!document.fullscreenElement && this.useLionFullScreen) {
|
||||
let alwaysUsesNativeFullscreen =
|
||||
AppConstants.platform == "macosx" &&
|
||||
Services.prefs.getBoolPref("full-screen-api.macos-native-full-screen");
|
||||
if (
|
||||
(alwaysUsesNativeFullscreen || !document.fullscreenElement) &&
|
||||
this.useLionFullScreen
|
||||
) {
|
||||
document.documentElement.setAttribute("OSXLionFullscreen", true);
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -211,7 +211,7 @@
|
|||
<key id="key_toggleReaderMode" keycode="&toggleReaderMode.win.keycode;" command="View:ReaderView" disabled="true"/>
|
||||
#endif
|
||||
<key key="&reloadCmd.commandkey;" command="Browser:Reload" modifiers="accel" id="key_reload"/>
|
||||
<key key="&reloadCmd.commandkey;" command="Browser:ReloadSkipCache" modifiers="accel,shift"/>
|
||||
<key key="&reloadCmd.commandkey;" command="Browser:ReloadSkipCache" modifiers="accel,shift" id="key_reload_skip_cache"/>
|
||||
<key id="key_viewSource" key="&pageSourceCmd.commandkey;" command="View:PageSource" modifiers="accel"/>
|
||||
#ifdef XP_MACOSX
|
||||
<key id="key_viewSourceSafari" key="&pageSourceCmd.SafariCommandKey;" command="View:PageSource" modifiers="accel,alt"/>
|
||||
|
|
|
@ -194,14 +194,6 @@ var gIdentityHandler = {
|
|||
"identity-icon-label"
|
||||
));
|
||||
},
|
||||
get _connectionIcon() {
|
||||
delete this._connectionIcon;
|
||||
return (this._connectionIcon = document.getElementById("connection-icon"));
|
||||
},
|
||||
get _extensionIcon() {
|
||||
delete this._extensionIcon;
|
||||
return (this._extensionIcon = document.getElementById("extension-icon"));
|
||||
},
|
||||
get _overrideService() {
|
||||
delete this._overrideService;
|
||||
return (this._overrideService = Cc[
|
||||
|
@ -257,6 +249,12 @@ var gIdentityHandler = {
|
|||
}
|
||||
return (this._permissionAnchors = permissionAnchors);
|
||||
},
|
||||
get _trackingProtectionIconContainer() {
|
||||
delete this._trackingProtectionIconContainer;
|
||||
return (this._trackingProtectionIconContainer = document.getElementById(
|
||||
"tracking-protection-icon-container"
|
||||
));
|
||||
},
|
||||
|
||||
get _insecureConnectionIconEnabled() {
|
||||
delete this._insecureConnectionIconEnabled;
|
||||
|
@ -722,6 +720,12 @@ var gIdentityHandler = {
|
|||
}
|
||||
}
|
||||
|
||||
// Hide the shield icon if it is a chrome page.
|
||||
this._trackingProtectionIconContainer.classList.toggle(
|
||||
"chromeUI",
|
||||
this._isSecureInternalUI
|
||||
);
|
||||
|
||||
if (this._isCertUserOverridden) {
|
||||
this._identityBox.classList.add("certUserOverridden");
|
||||
// Cert is trusted because of a security exception, verifier is a special string.
|
||||
|
@ -773,11 +777,11 @@ var gIdentityHandler = {
|
|||
}
|
||||
|
||||
// Push the appropriate strings out to the UI
|
||||
this._connectionIcon.setAttribute("tooltiptext", tooltip);
|
||||
this._identityIcon.setAttribute("tooltiptext", tooltip);
|
||||
|
||||
if (this._pageExtensionPolicy) {
|
||||
let extensionName = this._pageExtensionPolicy.name;
|
||||
this._extensionIcon.setAttribute(
|
||||
this._identityIcon.setAttribute(
|
||||
"tooltiptext",
|
||||
gNavigatorBundle.getFormattedString("identity.extension.tooltip", [
|
||||
extensionName,
|
||||
|
@ -786,10 +790,6 @@ var gIdentityHandler = {
|
|||
}
|
||||
|
||||
this._identityIconLabels.setAttribute("tooltiptext", tooltip);
|
||||
this._identityIcon.setAttribute(
|
||||
"tooltiptext",
|
||||
gNavigatorBundle.getString("identity.icon.tooltip")
|
||||
);
|
||||
this._identityIconLabel.setAttribute("value", icon_label);
|
||||
this._identityIconCountryLabel.setAttribute("value", icon_country_label);
|
||||
// Set cropping and direction
|
||||
|
@ -1000,12 +1000,6 @@ var gIdentityHandler = {
|
|||
* Click handler for the identity-box element in primary chrome.
|
||||
*/
|
||||
handleIdentityButtonEvent(event) {
|
||||
// For Nightly users, show the WIP protections panel if the meta key was held.
|
||||
if (this._protectionsPanelEnabled && event.altKey) {
|
||||
gProtectionsHandler.handleProtectionsButtonEvent(event);
|
||||
return;
|
||||
}
|
||||
|
||||
event.stopPropagation();
|
||||
|
||||
if (
|
||||
|
@ -1077,6 +1071,11 @@ var gIdentityHandler = {
|
|||
// Add the "open" attribute to the identity box for styling
|
||||
this._identityBox.setAttribute("open", "true");
|
||||
|
||||
// Check the panel state of the protections panel. Hide it if needed.
|
||||
if (gProtectionsHandler._protectionsPopup.state != "closed") {
|
||||
PanelMultiView.hidePopup(gProtectionsHandler._protectionsPopup);
|
||||
}
|
||||
|
||||
// Now open the popup, anchored off the primary chrome element
|
||||
PanelMultiView.openPopup(this._identityPopup, this._identityIcon, {
|
||||
position: "bottomcenter topleft",
|
||||
|
|
|
@ -1254,13 +1254,20 @@ var gProtectionsHandler = {
|
|||
onPopupShown(event) {
|
||||
if (event.target == this._protectionsPopup) {
|
||||
window.addEventListener("focus", this, true);
|
||||
|
||||
// Add the "open" attribute to the tracking protection icon container
|
||||
// for styling.
|
||||
gIdentityHandler._trackingProtectionIconContainer.setAttribute(
|
||||
"open",
|
||||
"true"
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
onPopupHidden(event) {
|
||||
if (event.target == this._protectionsPopup) {
|
||||
window.removeEventListener("focus", this, true);
|
||||
this._protectionsPopup.removeAttribute("open");
|
||||
gIdentityHandler._trackingProtectionIconContainer.removeAttribute("open");
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -1567,10 +1574,15 @@ var gProtectionsHandler = {
|
|||
// blocking something or not.
|
||||
gProtectionsHandler.toggleBreakageLink();
|
||||
|
||||
// Check the panel state of the identity panel. Hide it if needed.
|
||||
if (gIdentityHandler._identityPopup.state != "closed") {
|
||||
PanelMultiView.hidePopup(gIdentityHandler._identityPopup);
|
||||
}
|
||||
|
||||
// Now open the popup, anchored off the primary chrome element
|
||||
PanelMultiView.openPopup(
|
||||
this._protectionsPopup,
|
||||
gIdentityHandler._identityIcon,
|
||||
gIdentityHandler._trackingProtectionIconContainer,
|
||||
{
|
||||
position: "bottomcenter topleft",
|
||||
triggerEvent: event,
|
||||
|
|
|
@ -529,11 +529,6 @@ toolbar:not(#TabsToolbar) > #personal-bookmarks {
|
|||
min-width: 1px;
|
||||
}
|
||||
|
||||
|
||||
#urlbar[quantumbar="true"] {
|
||||
-moz-binding: url(chrome://browser/content/urlbarBindings.xml#urlbar);
|
||||
}
|
||||
|
||||
/* Display URLs left-to-right but right aligned in RTL mode. */
|
||||
html|input.urlbar-input:-moz-locale-dir(rtl) {
|
||||
direction: ltr !important;
|
||||
|
@ -583,18 +578,18 @@ html|input.urlbar-scheme {
|
|||
|
||||
/* Visible if the urlbar is not focused and it overflows at the start.
|
||||
Uses the required-valid trick to check if it contains a value */
|
||||
html|input.urlbar-scheme[textoverflow="start"]:not([focused]):valid {
|
||||
#urlbar[textoverflow="start"]:not([focused]) > .urlbar-input-box > html|input.urlbar-scheme:valid {
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
/* Fade out URL on overflow
|
||||
This mask may be overriden when a Contextual Feature Recommendation is shown,
|
||||
see browser/themes/shared/urlbar-searchbar.inc.css for details */
|
||||
html|input.urlbar-input[textoverflow="end"]:not([focused]) {
|
||||
#urlbar[textoverflow="end"]:not([focused]) > .urlbar-input-box > html|input.urlbar-input {
|
||||
mask-image: linear-gradient(to left, transparent, black 3ch);
|
||||
}
|
||||
|
||||
html|input.urlbar-input[textoverflow="start"]:not([focused]) {
|
||||
#urlbar[textoverflow="start"]:not([focused]) > .urlbar-input-box > html|input.urlbar-input {
|
||||
mask-image: linear-gradient(to right, transparent var(--urlbar-scheme-size), black calc(var(--urlbar-scheme-size) + 3ch));
|
||||
}
|
||||
|
||||
|
@ -655,9 +650,9 @@ html|input.urlbar-input {
|
|||
|
||||
#urlbar[pageproxystate=invalid] > #page-action-buttons > .urlbar-page-action,
|
||||
#identity-box.chromeUI ~ #page-action-buttons > .urlbar-page-action:not(#star-button-box),
|
||||
.urlbar-history-dropmarker[usertyping],
|
||||
.urlbar-go-button:not([usertyping]),
|
||||
.urlbar-go-button:not([parentfocused="true"]) {
|
||||
#urlbar[usertyping] > .urlbar-history-dropmarker,
|
||||
#urlbar:not([usertyping]) > .urlbar-go-button,
|
||||
#urlbar:not([focused]) > .urlbar-go-button {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
|
|
@ -1620,10 +1620,6 @@ var gBrowserInit = {
|
|||
},
|
||||
|
||||
onBeforeInitialXULLayout() {
|
||||
// Turn on QuantumBar. This can be removed once the quantumbar attribute is gone.
|
||||
let urlbar = document.getElementById("urlbar");
|
||||
urlbar.setAttribute("quantumbar", true);
|
||||
|
||||
// Set a sane starting width/height for all resolutions on new profiles.
|
||||
if (Services.prefs.getBoolPref("privacy.resistFingerprinting")) {
|
||||
// When the fingerprinting resistance is enabled, making sure that we don't
|
||||
|
@ -1799,7 +1795,7 @@ var gBrowserInit = {
|
|||
|
||||
if (!window.toolbar.visible) {
|
||||
// adjust browser UI for popups
|
||||
gURLBar.setAttribute("readonly", "true");
|
||||
gURLBar.readOnly = true;
|
||||
}
|
||||
|
||||
// Misc. inits.
|
||||
|
@ -1856,6 +1852,55 @@ var gBrowserInit = {
|
|||
}
|
||||
|
||||
this._loadHandled = true;
|
||||
let reloadHistogram = Services.telemetry.getHistogramById(
|
||||
"FX_PAGE_RELOAD_KEY_COMBO"
|
||||
);
|
||||
let reloadCommand = document.getElementById("Browser:Reload");
|
||||
reloadCommand.addEventListener("command", function(event) {
|
||||
let { target } = event.sourceEvent || {};
|
||||
if (target.getAttribute("keycode") == "VK_F5") {
|
||||
reloadHistogram.add("only_f5", 1);
|
||||
} else if (target.id == "key_reload") {
|
||||
reloadHistogram.add("accel_reloadKey", 1);
|
||||
}
|
||||
});
|
||||
|
||||
let reloadSkipCacheCommand = document.getElementById(
|
||||
"Browser:ReloadSkipCache"
|
||||
);
|
||||
reloadSkipCacheCommand.addEventListener("command", function(event) {
|
||||
let { target } = event.sourceEvent || {};
|
||||
if (target.getAttribute("keycode") == "VK_F5") {
|
||||
reloadHistogram.add("ctrl_f5", 1);
|
||||
} else if (target.id == "key_reload_skip_cache") {
|
||||
reloadHistogram.add("accel_shift_reload", 1);
|
||||
}
|
||||
});
|
||||
|
||||
let reloadOrDuplicateCommand = document.getElementById(
|
||||
"Browser:ReloadOrDuplicate"
|
||||
);
|
||||
reloadOrDuplicateCommand.addEventListener("command", function(event) {
|
||||
let { target } = event.sourceEvent || {};
|
||||
if (target.id == "reload-button") {
|
||||
let accelKeyPressed =
|
||||
AppConstants.platform == "macosx" ? event.metaKey : event.ctrlKey;
|
||||
let auxiliaryPressed = false;
|
||||
let { sourceEvent } = event.sourceEvent || {};
|
||||
if (sourceEvent) {
|
||||
auxiliaryPressed = sourceEvent.button == 1;
|
||||
}
|
||||
if (auxiliaryPressed) {
|
||||
reloadHistogram.add("auxiliary_toolbar", 1);
|
||||
} else if (accelKeyPressed) {
|
||||
reloadHistogram.add("accel_toolbar", 1);
|
||||
} else if (event.shiftKey) {
|
||||
reloadHistogram.add("shift_toolbar", 1);
|
||||
} else {
|
||||
reloadHistogram.add("toolbar", 1);
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
_cancelDelayedStartup() {
|
||||
|
@ -2621,9 +2666,9 @@ function BrowserStop() {
|
|||
|
||||
function BrowserReloadOrDuplicate(aEvent) {
|
||||
aEvent = getRootEvent(aEvent);
|
||||
let metaKeyPressed =
|
||||
let accelKeyPressed =
|
||||
AppConstants.platform == "macosx" ? aEvent.metaKey : aEvent.ctrlKey;
|
||||
var backgroundTabModifier = aEvent.button == 1 || metaKeyPressed;
|
||||
var backgroundTabModifier = aEvent.button == 1 || accelKeyPressed;
|
||||
|
||||
if (aEvent.shiftKey && !backgroundTabModifier) {
|
||||
BrowserReloadSkipCache();
|
||||
|
@ -4528,7 +4573,7 @@ const BrowserSearch = {
|
|||
} else {
|
||||
placeholder = gURLBar.getAttribute("defaultPlaceholder");
|
||||
}
|
||||
gURLBar.setAttribute("placeholder", placeholder);
|
||||
gURLBar.placeholder = placeholder;
|
||||
},
|
||||
|
||||
addEngine(browser, engine, uri) {
|
||||
|
|
|
@ -68,7 +68,7 @@
|
|||
screenX="4" screenY="4"
|
||||
fullscreenbutton="true"
|
||||
sizemode="normal"
|
||||
retargetdocumentfocus="urlbar"
|
||||
retargetdocumentfocus="urlbar-input"
|
||||
persist="screenX screenY width height sizemode"
|
||||
>
|
||||
|
||||
|
@ -841,13 +841,22 @@
|
|||
removable="false"
|
||||
class="chromeclass-location" overflows="false">
|
||||
<toolbartabstop/>
|
||||
<textbox id="urlbar" flex="1"
|
||||
placeholder="&urlbar.placeholder2;"
|
||||
defaultPlaceholder="&urlbar.placeholder2;"
|
||||
focused="true"
|
||||
pageproxystate="invalid">
|
||||
<hbox id="urlbar" flex="1"
|
||||
defaultPlaceholder="&urlbar.placeholder2;"
|
||||
focused="true"
|
||||
pageproxystate="invalid">
|
||||
<!-- Use onclick instead of normal popup= syntax since the popup
|
||||
code fires onmousedown, and hence eats our favicon drag events. -->
|
||||
<box id="tracking-protection-icon-container" align="center"
|
||||
onclick="gProtectionsHandler.handleProtectionsButtonEvent(event);"
|
||||
onkeypress="gProtectionsHandler.handleProtectionsButtonEvent(event);">
|
||||
<box id="tracking-protection-icon-box" animationsenabled="true">
|
||||
<image id="tracking-protection-icon"/>
|
||||
<box id="tracking-protection-icon-animatable-box" flex="1">
|
||||
<image id="tracking-protection-icon-animatable-image" flex="1"/>
|
||||
</box>
|
||||
</box>
|
||||
</box>
|
||||
<box id="identity-box" role="button"
|
||||
align="center"
|
||||
aria-label="&urlbar.viewSiteInfo.label;"
|
||||
|
@ -858,12 +867,6 @@
|
|||
consumeanchor="identity-box"
|
||||
onclick="PageProxyClickHandler(event);"/>
|
||||
<image id="sharing-icon" mousethrough="always"/>
|
||||
<box id="tracking-protection-icon-box" animationsenabled="true">
|
||||
<image id="tracking-protection-icon"/>
|
||||
<box id="tracking-protection-icon-animatable-box" flex="1">
|
||||
<image id="tracking-protection-icon-animatable-image" flex="1"/>
|
||||
</box>
|
||||
</box>
|
||||
<box id="blocked-permissions-container" align="center">
|
||||
<image data-permission-id="geo" class="blocked-permission-icon geo-icon" role="button"
|
||||
tooltiptext="&urlbar.geolocationBlocked.tooltip;"/>
|
||||
|
@ -937,8 +940,6 @@
|
|||
<image id="storage-access-notification-icon" class="notification-anchor-icon storage-access-icon" role="button"
|
||||
tooltiptext="&urlbar.storageAccessAnchor.tooltip;"/>
|
||||
</box>
|
||||
<image id="connection-icon"/>
|
||||
<image id="extension-icon"/>
|
||||
<image id="remote-control-icon"
|
||||
tooltiptext="&urlbar.remoteControlNotificationAnchor.tooltip;"/>
|
||||
<hbox id="identity-icon-labels">
|
||||
|
@ -950,6 +951,28 @@
|
|||
<label id="switchtab" class="urlbar-display urlbar-display-switchtab" value="&urlbar.switchToTab.label;"/>
|
||||
<label id="extension" class="urlbar-display urlbar-display-extension" value="&urlbar.extension.label;"/>
|
||||
</box>
|
||||
<moz-input-box tooltip="aHTMLTooltip"
|
||||
class="urlbar-input-box"
|
||||
flex="1">
|
||||
<html:input class="urlbar-scheme textbox-input"
|
||||
required="required"/>
|
||||
<html:input id="urlbar-input"
|
||||
anonid="input"
|
||||
class="urlbar-input textbox-input"
|
||||
role="combobox"
|
||||
aria-owns="urlbarView-results"
|
||||
aria-controls="urlbarView-results"
|
||||
aria-autocomplete="both"
|
||||
allowevents="true"
|
||||
inputmode="mozAwesomebar"
|
||||
placeholder="&urlbar.placeholder2;"/>
|
||||
</moz-input-box>
|
||||
<image class="urlbar-go-button urlbar-icon"
|
||||
onclick="gURLBar.handleCommand(event);"
|
||||
tooltiptext="&goEndCap.tooltip;"/>
|
||||
<image class="urlbar-history-dropmarker urlbar-icon chromeclass-toolbar-additional"
|
||||
tooltiptext="&urlbar.openHistoryPopup.tooltip;"
|
||||
allowevents="true"/>
|
||||
<hbox id="page-action-buttons" context="pageActionContextMenu">
|
||||
<toolbartabstop/>
|
||||
<hbox id="contextual-feature-recommendation" role="button" hidden="true">
|
||||
|
@ -1008,7 +1031,7 @@
|
|||
</hbox>
|
||||
</hbox>
|
||||
</hbox>
|
||||
</textbox>
|
||||
</hbox>
|
||||
<toolbartabstop/>
|
||||
</toolbaritem>
|
||||
|
||||
|
|
|
@ -85,11 +85,7 @@ add_task(async function test_toolbar_contextmenu_touch() {
|
|||
// Test the urlbar input context menu.
|
||||
add_task(async function test_urlbar_contextmenu_touch() {
|
||||
let urlbar = document.getElementById("urlbar");
|
||||
let textBox = document.getAnonymousElementByAttribute(
|
||||
urlbar,
|
||||
"anonid",
|
||||
"moz-input-box"
|
||||
);
|
||||
let textBox = urlbar.querySelector("moz-input-box");
|
||||
let menu = textBox.menupopup;
|
||||
await openAndCheckContextMenu(menu, textBox);
|
||||
});
|
||||
|
|
|
@ -29,11 +29,11 @@ add_task(async function() {
|
|||
await promiseViewShown;
|
||||
|
||||
is_element_visible(
|
||||
document.getElementById("connection-icon"),
|
||||
"Should see connection icon"
|
||||
document.getElementById("identity-icon"),
|
||||
"Should see identity icon"
|
||||
);
|
||||
let connectionIconImage = gBrowser.ownerGlobal
|
||||
.getComputedStyle(document.getElementById("connection-icon"))
|
||||
let identityIconImage = gBrowser.ownerGlobal
|
||||
.getComputedStyle(document.getElementById("identity-icon"))
|
||||
.getPropertyValue("list-style-image");
|
||||
let securityViewBG = gBrowser.ownerGlobal
|
||||
.getComputedStyle(
|
||||
|
@ -50,7 +50,7 @@ add_task(async function() {
|
|||
)
|
||||
.getPropertyValue("background-image");
|
||||
is(
|
||||
connectionIconImage,
|
||||
identityIconImage,
|
||||
'url("chrome://browser/skin/connection-mixed-passive-loaded.svg")',
|
||||
"Using expected icon image in the identity block"
|
||||
);
|
||||
|
|
|
@ -45,8 +45,8 @@ const EXPECTED_APPMENU_OPEN_REFLOWS = [
|
|||
add_task(async function() {
|
||||
await ensureNoPreloadedBrowser();
|
||||
|
||||
let textBoxRect = document
|
||||
.getAnonymousElementByAttribute(gURLBar.textbox, "anonid", "moz-input-box")
|
||||
let textBoxRect = gURLBar
|
||||
.querySelector("moz-input-box")
|
||||
.getBoundingClientRect();
|
||||
let menuButtonRect = document
|
||||
.getElementById("PanelUI-menu-button")
|
||||
|
|
|
@ -32,16 +32,10 @@ add_task(async function() {
|
|||
let tabStripRect = gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
let firstTabRect = gBrowser.selectedTab.getBoundingClientRect();
|
||||
let firstTabLabelRect = gBrowser.selectedTab.textLabel.getBoundingClientRect();
|
||||
let textBoxRect = document
|
||||
.getAnonymousElementByAttribute(gURLBar.textbox, "anonid", "moz-input-box")
|
||||
.getBoundingClientRect();
|
||||
let historyDropmarkerRect = document
|
||||
.getAnonymousElementByAttribute(
|
||||
gURLBar.textbox,
|
||||
"anonid",
|
||||
"historydropmarker"
|
||||
)
|
||||
let textBoxRect = gURLBar
|
||||
.querySelector("moz-input-box")
|
||||
.getBoundingClientRect();
|
||||
let historyDropmarkerRect = gURLBar.dropmarker.getBoundingClientRect();
|
||||
|
||||
let inRange = (val, min, max) => min <= val && val <= max;
|
||||
|
||||
|
|
|
@ -34,8 +34,8 @@ add_task(async function() {
|
|||
await ensureFocusedUrlbar();
|
||||
|
||||
let tabStripRect = gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
let textBoxRect = document
|
||||
.getAnonymousElementByAttribute(gURLBar.textbox, "anonid", "moz-input-box")
|
||||
let textBoxRect = gURLBar
|
||||
.querySelector("moz-input-box")
|
||||
.getBoundingClientRect();
|
||||
|
||||
await withPerfObserver(
|
||||
|
|
|
@ -38,16 +38,10 @@ add_task(async function() {
|
|||
await ensureFocusedUrlbar();
|
||||
|
||||
let tabStripRect = gBrowser.tabContainer.arrowScrollbox.getBoundingClientRect();
|
||||
let textBoxRect = document
|
||||
.getAnonymousElementByAttribute(gURLBar.textbox, "anonid", "moz-input-box")
|
||||
.getBoundingClientRect();
|
||||
let urlbarDropmarkerRect = document
|
||||
.getAnonymousElementByAttribute(
|
||||
gURLBar.textbox,
|
||||
"anonid",
|
||||
"historydropmarker"
|
||||
)
|
||||
let textBoxRect = gURLBar
|
||||
.querySelector("moz-input-box")
|
||||
.getBoundingClientRect();
|
||||
let urlbarDropmarkerRect = gURLBar.dropmarker.getBoundingClientRect();
|
||||
|
||||
let ignoreTabstripRects = {
|
||||
filter: rects =>
|
||||
|
|
|
@ -43,13 +43,7 @@ add_task(async function() {
|
|||
"We shouldn't have added any new expected reflows for window close."
|
||||
);
|
||||
|
||||
let dropmarkerRect = document
|
||||
.getAnonymousElementByAttribute(
|
||||
gURLBar.textbox,
|
||||
"anonid",
|
||||
"historydropmarker"
|
||||
)
|
||||
.getBoundingClientRect();
|
||||
let dropmarkerRect = gURLBar.dropmarker.getBoundingClientRect();
|
||||
|
||||
await withPerfObserver(
|
||||
async function() {
|
||||
|
|
|
@ -298,13 +298,8 @@ async function ensureFocusedUrlbar() {
|
|||
() => !gURLBar.hasAttribute("switchingtabs")
|
||||
);
|
||||
|
||||
let dropmarker = document.getAnonymousElementByAttribute(
|
||||
gURLBar.textbox,
|
||||
"anonid",
|
||||
"historydropmarker"
|
||||
);
|
||||
let opacityPromise = BrowserTestUtils.waitForEvent(
|
||||
dropmarker,
|
||||
gURLBar.dropmarker,
|
||||
"transitionend",
|
||||
false,
|
||||
e => e.propertyName === "opacity"
|
||||
|
@ -821,15 +816,9 @@ async function runUrlbarTest(
|
|||
await UrlbarTestUtils.promisePopupClose(win);
|
||||
};
|
||||
|
||||
let dropmarkerRect = win.document
|
||||
.getAnonymousElementByAttribute(
|
||||
URLBar.textbox,
|
||||
"anonid",
|
||||
"historydropmarker"
|
||||
)
|
||||
.getBoundingClientRect();
|
||||
let textBoxRect = win.document
|
||||
.getAnonymousElementByAttribute(URLBar.textbox, "anonid", "moz-input-box")
|
||||
let dropmarkerRect = URLBar.dropmarker.getBoundingClientRect();
|
||||
let textBoxRect = gURLBar
|
||||
.querySelector("moz-input-box")
|
||||
.getBoundingClientRect();
|
||||
let expectedRects = {
|
||||
filter: rects =>
|
||||
|
|
|
@ -24,13 +24,8 @@ add_task(async function toolbar_ui_visibility() {
|
|||
"'open location' command is not disabled in the popup"
|
||||
);
|
||||
|
||||
let historyButton = doc.getAnonymousElementByAttribute(
|
||||
win.gURLBar.textbox,
|
||||
"anonid",
|
||||
"historydropmarker"
|
||||
);
|
||||
is(
|
||||
historyButton.clientWidth,
|
||||
win.gURLBar.dropmarker.clientWidth,
|
||||
0,
|
||||
"history dropdown button is hidden in the popup"
|
||||
);
|
||||
|
|
|
@ -51,6 +51,10 @@ skip-if = fission
|
|||
[browser_identity_UI.js]
|
||||
[browser_identityBlock_focus.js]
|
||||
support-files = ../permissions/permissions.html
|
||||
[browser_identityIcon_img_url.js]
|
||||
support-files =
|
||||
file_mixedPassiveContent.html
|
||||
file_csp_block_all_mixedcontent.html
|
||||
[browser_identityPopup_clearSiteData.js]
|
||||
skip-if = fission
|
||||
[browser_identityPopup_custom_roots.js]
|
||||
|
|
|
@ -74,11 +74,11 @@ async function webpageTestTextWarning(secureCheck) {
|
|||
if (secureCheck) {
|
||||
is(
|
||||
getIdentityMode(),
|
||||
"unknownIdentity notSecureText",
|
||||
"notSecure notSecureText",
|
||||
"Identity should have not secure text"
|
||||
);
|
||||
} else {
|
||||
is(getIdentityMode(), "unknownIdentity", "Identity should be unknown");
|
||||
is(getIdentityMode(), "notSecure", "Identity should be not secure");
|
||||
}
|
||||
|
||||
gBrowser.selectedTab = oldTab;
|
||||
|
@ -88,11 +88,11 @@ async function webpageTestTextWarning(secureCheck) {
|
|||
if (secureCheck) {
|
||||
is(
|
||||
getIdentityMode(),
|
||||
"unknownIdentity notSecureText",
|
||||
"notSecure notSecureText",
|
||||
"Identity should have not secure text"
|
||||
);
|
||||
} else {
|
||||
is(getIdentityMode(), "unknownIdentity", "Identity should be unknown");
|
||||
is(getIdentityMode(), "notSecure", "Identity should be not secure");
|
||||
}
|
||||
|
||||
gBrowser.removeTab(newTab);
|
||||
|
@ -422,8 +422,8 @@ async function dataUriTest(secureCheck) {
|
|||
}
|
||||
|
||||
add_task(async function test_data_uri() {
|
||||
dataUriTest(true);
|
||||
dataUriTest(false);
|
||||
await dataUriTest(true);
|
||||
await dataUriTest(false);
|
||||
});
|
||||
|
||||
async function pbModeTest(prefs, secureCheck) {
|
||||
|
|
|
@ -0,0 +1,104 @@
|
|||
/* 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/. */
|
||||
/**
|
||||
* Test Bug 1562881 - Ensuring the identity icon loads correct img in different
|
||||
* circumstances.
|
||||
*/
|
||||
|
||||
const kBaseURI = getRootDirectory(gTestPath).replace(
|
||||
"chrome://mochitests/content",
|
||||
"https://example.com"
|
||||
);
|
||||
|
||||
const TEST_CASES = [
|
||||
{
|
||||
type: "http",
|
||||
testURL: "http://example.com",
|
||||
img_url: `url("chrome://browser/skin/connection-mixed-active-loaded.svg")`,
|
||||
},
|
||||
{
|
||||
type: "https",
|
||||
testURL: "https://example.com",
|
||||
img_url: `url("chrome://browser/skin/connection-secure.svg")`,
|
||||
},
|
||||
{
|
||||
type: "non-chrome about page",
|
||||
testURL: "about:about",
|
||||
img_url: `url("chrome://browser/skin/identity-icon.svg")`,
|
||||
},
|
||||
{
|
||||
type: "chrome about page",
|
||||
testURL: "about:preferences",
|
||||
img_url: `url("chrome://branding/content/identity-icons-brand.svg")`,
|
||||
},
|
||||
{
|
||||
type: "file",
|
||||
testURL: "dummy_page.html",
|
||||
img_url: `url("chrome://browser/skin/identity-icon.svg")`,
|
||||
},
|
||||
{
|
||||
type: "mixedPassiveContent",
|
||||
testURL: kBaseURI + "file_mixedPassiveContent.html",
|
||||
img_url: `url("chrome://browser/skin/connection-mixed-passive-loaded.svg")`,
|
||||
},
|
||||
{
|
||||
type: "mixedActiveContent",
|
||||
testURL: kBaseURI + "file_csp_block_all_mixedcontent.html",
|
||||
img_url: `url("chrome://browser/skin/connection-secure.svg")`,
|
||||
},
|
||||
{
|
||||
type: "certificateError",
|
||||
testURL: "https://self-signed.example.com",
|
||||
// We still show a default identity icon for cert error pages. We will
|
||||
// change it to show a not secure lock icon in Bug 1566813.
|
||||
img_url: `url("chrome://browser/skin/identity-icon.svg")`,
|
||||
},
|
||||
];
|
||||
|
||||
add_task(async function test() {
|
||||
for (let testData of TEST_CASES) {
|
||||
info(`Testing for ${testData.type}`);
|
||||
// Open the page for testing.
|
||||
let testURL = testData.testURL;
|
||||
|
||||
// Overwrite the url if it is testing the file url.
|
||||
if (testData.type === "file") {
|
||||
let dir = getChromeDir(getResolvedURI(gTestPath));
|
||||
dir.append(testURL);
|
||||
dir.normalize();
|
||||
testURL = Services.io.newFileURI(dir).spec;
|
||||
}
|
||||
|
||||
let pageLoaded;
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab(
|
||||
gBrowser,
|
||||
() => {
|
||||
gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser, testURL);
|
||||
let browser = gBrowser.selectedBrowser;
|
||||
if (testData.type === "certificateError") {
|
||||
pageLoaded = BrowserTestUtils.waitForErrorPage(browser);
|
||||
} else {
|
||||
pageLoaded = BrowserTestUtils.browserLoaded(browser);
|
||||
}
|
||||
},
|
||||
false
|
||||
);
|
||||
await pageLoaded;
|
||||
|
||||
let identityIcon = document.getElementById("identity-icon");
|
||||
|
||||
// Get the image url from the identity icon.
|
||||
let identityIconImageURL = gBrowser.ownerGlobal
|
||||
.getComputedStyle(identityIcon)
|
||||
.getPropertyValue("list-style-image");
|
||||
|
||||
is(
|
||||
identityIconImageURL,
|
||||
testData.img_url,
|
||||
"The identity icon has a correct image url."
|
||||
);
|
||||
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
}
|
||||
});
|
|
@ -70,7 +70,7 @@ add_task(async function() {
|
|||
let uri = INSECURE_TEST_URI + "#blank";
|
||||
await BrowserTestUtils.withNewTab(uri, async browser => {
|
||||
let identityMode = window.document.getElementById("identity-box").className;
|
||||
is(identityMode, "unknownIdentity", "identity should be 'unknown' before");
|
||||
is(identityMode, "notSecure", "identity should be 'not secure' before");
|
||||
|
||||
await ContentTask.spawn(browser, null, async () => {
|
||||
content.postMessage("", "*"); // This kicks off the navigation.
|
||||
|
@ -81,11 +81,7 @@ add_task(async function() {
|
|||
|
||||
let newIdentityMode = window.document.getElementById("identity-box")
|
||||
.className;
|
||||
is(
|
||||
newIdentityMode,
|
||||
"unknownIdentity",
|
||||
"identity should be 'unknown' after"
|
||||
);
|
||||
is(newIdentityMode, "notSecure", "identity should be 'not secure' after");
|
||||
});
|
||||
});
|
||||
|
||||
|
@ -95,7 +91,7 @@ add_task(async function() {
|
|||
let uri = INSECURE_TEST_URI + "#secure";
|
||||
await BrowserTestUtils.withNewTab(uri, async browser => {
|
||||
let identityMode = window.document.getElementById("identity-box").className;
|
||||
is(identityMode, "unknownIdentity", "identity should be 'unknown' before");
|
||||
is(identityMode, "notSecure", "identity should be 'not secure' before");
|
||||
|
||||
await ContentTask.spawn(browser, null, async () => {
|
||||
content.postMessage("", "*"); // This kicks off the navigation.
|
||||
|
@ -106,10 +102,6 @@ add_task(async function() {
|
|||
|
||||
let newIdentityMode = window.document.getElementById("identity-box")
|
||||
.className;
|
||||
is(
|
||||
newIdentityMode,
|
||||
"unknownIdentity",
|
||||
"identity should be 'unknown' after"
|
||||
);
|
||||
is(newIdentityMode, "notSecure", "identity should be 'not secure' after");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -77,11 +77,11 @@ add_task(async function test_simple() {
|
|||
|
||||
if (expectWarning) {
|
||||
ok(
|
||||
BrowserTestUtils.is_visible(document.getElementById("connection-icon")),
|
||||
"Connection icon should be visible"
|
||||
BrowserTestUtils.is_visible(document.getElementById("identity-icon")),
|
||||
"Identity icon should be visible"
|
||||
);
|
||||
let connectionIconImage = gBrowser.ownerGlobal
|
||||
.getComputedStyle(document.getElementById("connection-icon"))
|
||||
let identityIconImage = gBrowser.ownerGlobal
|
||||
.getComputedStyle(document.getElementById("identity-icon"))
|
||||
.getPropertyValue("list-style-image");
|
||||
let securityViewBG = gBrowser.ownerGlobal
|
||||
.getComputedStyle(
|
||||
|
@ -98,7 +98,7 @@ add_task(async function test_simple() {
|
|||
)
|
||||
.getPropertyValue("background-image");
|
||||
is(
|
||||
connectionIconImage,
|
||||
identityIconImage,
|
||||
'url("chrome://browser/skin/connection-mixed-active-loaded.svg")',
|
||||
"Using expected icon image in the identity block"
|
||||
);
|
||||
|
@ -243,13 +243,13 @@ add_task(async function test_ignoring_window_opener() {
|
|||
await promiseViewShown;
|
||||
|
||||
ok(
|
||||
BrowserTestUtils.is_visible(document.getElementById("connection-icon")),
|
||||
"Connection icon is visible"
|
||||
BrowserTestUtils.is_visible(document.getElementById("identity-icon")),
|
||||
"Identity icon is visible"
|
||||
);
|
||||
|
||||
// Assert that the identity indicators are still "secure".
|
||||
let connectionIconImage = gBrowser.ownerGlobal
|
||||
.getComputedStyle(document.getElementById("connection-icon"))
|
||||
let identityIconImage = gBrowser.ownerGlobal
|
||||
.getComputedStyle(document.getElementById("identity-icon"))
|
||||
.getPropertyValue("list-style-image");
|
||||
let securityViewBG = gBrowser.ownerGlobal
|
||||
.getComputedStyle(
|
||||
|
@ -266,7 +266,7 @@ add_task(async function test_ignoring_window_opener() {
|
|||
)
|
||||
.getPropertyValue("background-image");
|
||||
is(
|
||||
connectionIconImage,
|
||||
identityIconImage,
|
||||
'url("chrome://browser/skin/connection-secure.svg")',
|
||||
"Using expected icon image in the identity block"
|
||||
);
|
||||
|
|
|
@ -355,5 +355,5 @@ function test() {
|
|||
gTestBrowser = gBrowser.selectedBrowser;
|
||||
newTab.linkedBrowser.stop();
|
||||
|
||||
executeSoon(test1);
|
||||
executeSoon(testInsecure1);
|
||||
}
|
||||
|
|
|
@ -18,14 +18,14 @@ function getPopupContentVerifier() {
|
|||
return document.getElementById("identity-popup-content-verifier");
|
||||
}
|
||||
|
||||
function getConnectionIcon() {
|
||||
return window.getComputedStyle(document.getElementById("connection-icon"))
|
||||
function getIdentityIcon() {
|
||||
return window.getComputedStyle(document.getElementById("identity-icon"))
|
||||
.listStyleImage;
|
||||
}
|
||||
|
||||
function checkIdentityPopup(icon) {
|
||||
gIdentityHandler.refreshIdentityPopup();
|
||||
is(getConnectionIcon(), `url("chrome://browser/skin/${icon}")`);
|
||||
is(getIdentityIcon(), `url("chrome://browser/skin/${icon}")`);
|
||||
is(getConnectionState(), "secure-cert-user-overridden");
|
||||
isnot(
|
||||
getPopupContentVerifier().style.display,
|
||||
|
|
|
@ -162,6 +162,6 @@ add_task(async function() {
|
|||
// http://example.com won't be secure, so we treat it as not secure.
|
||||
await BrowserTestUtils.withNewTab("http://example.com/", async browser => {
|
||||
let identityMode = window.document.getElementById("identity-box").className;
|
||||
is(identityMode, "unknownIdentity", "identity should be 'unknown'");
|
||||
is(identityMode, "notSecure", "identity should be 'not secure'");
|
||||
});
|
||||
});
|
||||
|
|
|
@ -110,9 +110,9 @@ async function assertMixedContentBlockingState(tabbrowser, states = {}) {
|
|||
let doc = tabbrowser.ownerDocument;
|
||||
let identityBox = gIdentityHandler._identityBox;
|
||||
let classList = identityBox.classList;
|
||||
let connectionIcon = doc.getElementById("connection-icon");
|
||||
let connectionIconImage = tabbrowser.ownerGlobal
|
||||
.getComputedStyle(connectionIcon)
|
||||
let identityIcon = doc.getElementById("identity-icon");
|
||||
let identityIconImage = tabbrowser.ownerGlobal
|
||||
.getComputedStyle(identityIcon)
|
||||
.getPropertyValue("list-style-image");
|
||||
|
||||
let stateSecure =
|
||||
|
@ -156,15 +156,15 @@ async function assertMixedContentBlockingState(tabbrowser, states = {}) {
|
|||
// should always be visible regardless of MCB state.
|
||||
ok(classList.contains("unknownIdentity"), "unknownIdentity on HTTP page");
|
||||
ok(
|
||||
BrowserTestUtils.is_hidden(connectionIcon),
|
||||
"connection icon should be hidden"
|
||||
BrowserTestUtils.is_visible(identityIcon),
|
||||
"information icon should be still visible"
|
||||
);
|
||||
} else {
|
||||
// HTTP request, there should be a broken padlock shown always.
|
||||
ok(classList.contains("notSecure"), "notSecure on HTTP page");
|
||||
ok(
|
||||
!BrowserTestUtils.is_hidden(connectionIcon),
|
||||
"connection icon should be visible"
|
||||
!BrowserTestUtils.is_hidden(identityIcon),
|
||||
"information icon should be visible"
|
||||
);
|
||||
}
|
||||
|
||||
|
@ -199,33 +199,33 @@ async function assertMixedContentBlockingState(tabbrowser, states = {}) {
|
|||
);
|
||||
|
||||
ok(
|
||||
!BrowserTestUtils.is_hidden(connectionIcon),
|
||||
"connection icon should be visible"
|
||||
!BrowserTestUtils.is_hidden(identityIcon),
|
||||
"information icon should be visible"
|
||||
);
|
||||
if (activeLoaded) {
|
||||
is(
|
||||
connectionIconImage,
|
||||
identityIconImage,
|
||||
'url("chrome://browser/skin/connection-mixed-active-loaded.svg")',
|
||||
"Using active loaded icon"
|
||||
);
|
||||
}
|
||||
if (activeBlocked && !passiveLoaded) {
|
||||
is(
|
||||
connectionIconImage,
|
||||
identityIconImage,
|
||||
'url("chrome://browser/skin/connection-secure.svg")',
|
||||
"Using active blocked icon"
|
||||
);
|
||||
}
|
||||
if (passiveLoaded && !(activeLoaded || activeBlocked)) {
|
||||
is(
|
||||
connectionIconImage,
|
||||
identityIconImage,
|
||||
'url("chrome://browser/skin/connection-mixed-passive-loaded.svg")',
|
||||
"Using passive loaded icon"
|
||||
);
|
||||
}
|
||||
if (passiveLoaded && activeBlocked) {
|
||||
is(
|
||||
connectionIconImage,
|
||||
identityIconImage,
|
||||
'url("chrome://browser/skin/connection-mixed-passive-loaded.svg")',
|
||||
"Using active blocked and passive loaded icon"
|
||||
);
|
||||
|
|
|
@ -14,9 +14,11 @@ async function openProtectionsPanel(toast) {
|
|||
protectionsPopup,
|
||||
"popupshown"
|
||||
);
|
||||
let identityBox = document.getElementById("identity-box");
|
||||
let shieldIconContainer = document.getElementById(
|
||||
"tracking-protection-icon-container"
|
||||
);
|
||||
if (!toast) {
|
||||
EventUtils.synthesizeMouseAtCenter(identityBox, { altKey: true });
|
||||
EventUtils.synthesizeMouseAtCenter(shieldIconContainer, {});
|
||||
} else {
|
||||
gProtectionsHandler.showProtectionsPopup({ toast });
|
||||
}
|
||||
|
|
|
@ -90,6 +90,7 @@ skip-if = (verify && (os == 'win' || os == 'mac'))
|
|||
[browser_reload_deleted_file.js]
|
||||
skip-if = (debug && os == 'mac') || (debug && os == 'linux' && bits == 64) #Bug 1421183, disabled on Linux/OSX for leaked windows
|
||||
[browser_tabCloseSpacer.js]
|
||||
skip-if = (debug && os == 'linux' && bits == 64) || (asan && os == 'linux' && bits == 64) #Bug 1549985
|
||||
[browser_tab_a11y_description.js]
|
||||
[browser_tab_label_during_reload.js]
|
||||
[browser_tabCloseProbes.js]
|
||||
|
|
|
@ -32,7 +32,6 @@ support-files =
|
|||
skip-if = fission || os == 'linux' && (debug || asan) # Bug 1546797
|
||||
[browser_trackingUI_state.js]
|
||||
skip-if = serviceworker_e10s # see https://bugzilla.mozilla.org/show_bug.cgi?id=1511303#c1
|
||||
[browser_trackingUI_state_all_disabled.js]
|
||||
[browser_trackingUI_state_reset.js]
|
||||
[browser_trackingUI_telemetry.js]
|
||||
[browser_trackingUI_trackers_subview.js]
|
||||
|
|
|
@ -41,7 +41,10 @@ add_task(async function testShieldAnimation() {
|
|||
|
||||
await promiseTabLoadEvent(tab, BENIGN_PAGE);
|
||||
ok(BrowserTestUtils.is_hidden(animationIcon), "the animated icon is hidden");
|
||||
ok(BrowserTestUtils.is_hidden(noAnimationIcon), "the default icon is hidden");
|
||||
ok(
|
||||
BrowserTestUtils.is_visible(noAnimationIcon),
|
||||
"the default icon is visible"
|
||||
);
|
||||
|
||||
Services.prefs.setBoolPref(ANIMATIONS_PREF, false);
|
||||
await Promise.all([
|
||||
|
|
|
@ -57,17 +57,11 @@ async function testIdentityState(hasException) {
|
|||
!gProtectionsHandler._protectionsPopup.hasAttribute("detected"),
|
||||
"cryptominers are not detected"
|
||||
);
|
||||
if (hasException) {
|
||||
ok(
|
||||
BrowserTestUtils.is_visible(gProtectionsHandler.iconBox),
|
||||
"icon box is visible to indicate the exception"
|
||||
);
|
||||
} else {
|
||||
ok(
|
||||
BrowserTestUtils.is_hidden(gProtectionsHandler.iconBox),
|
||||
"icon box is not visible"
|
||||
);
|
||||
}
|
||||
|
||||
ok(
|
||||
BrowserTestUtils.is_visible(gProtectionsHandler.iconBox),
|
||||
"icon box is visible regardless the exception"
|
||||
);
|
||||
|
||||
promise = waitForContentBlockingEvent();
|
||||
|
||||
|
|
|
@ -57,17 +57,10 @@ async function testIdentityState(hasException) {
|
|||
!gProtectionsHandler._protectionsPopup.hasAttribute("detected"),
|
||||
"fingerprinters are not detected"
|
||||
);
|
||||
if (hasException) {
|
||||
ok(
|
||||
!BrowserTestUtils.is_hidden(gProtectionsHandler.iconBox),
|
||||
"icon box is visible to indicate the exception"
|
||||
);
|
||||
} else {
|
||||
ok(
|
||||
BrowserTestUtils.is_hidden(gProtectionsHandler.iconBox),
|
||||
"icon box is not visible"
|
||||
);
|
||||
}
|
||||
ok(
|
||||
!BrowserTestUtils.is_hidden(gProtectionsHandler.iconBox),
|
||||
"icon box is visible regardless the exception"
|
||||
);
|
||||
|
||||
promise = waitForContentBlockingEvent();
|
||||
|
||||
|
|
|
@ -79,12 +79,10 @@ function testBenignPage() {
|
|||
!gProtectionsHandler.iconBox.hasAttribute("tooltiptext"),
|
||||
"icon box has no tooltip"
|
||||
);
|
||||
|
||||
ok(
|
||||
BrowserTestUtils.is_hidden(gProtectionsHandler.iconBox),
|
||||
"icon box is hidden"
|
||||
BrowserTestUtils.is_visible(gProtectionsHandler.iconBox),
|
||||
"icon box is visible"
|
||||
);
|
||||
|
||||
ok(
|
||||
hidden("#protections-popup-category-cookies"),
|
||||
"Not showing cookie restrictions category"
|
||||
|
@ -158,10 +156,9 @@ function testTrackingPage(window) {
|
|||
|
||||
let isWindowPrivate = PrivateBrowsingUtils.isWindowPrivate(window);
|
||||
let blockedByTP = areTrackersBlocked(isWindowPrivate);
|
||||
is(
|
||||
ok(
|
||||
BrowserTestUtils.is_visible(gProtectionsHandler.iconBox),
|
||||
blockedByTP,
|
||||
"icon box is" + (blockedByTP ? "" : " not") + " visible"
|
||||
"icon box is always visible"
|
||||
);
|
||||
is(
|
||||
gProtectionsHandler.iconBox.hasAttribute("active"),
|
||||
|
|
|
@ -1,64 +0,0 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
const TRACKING_PAGE =
|
||||
"http://tracking.example.org/browser/browser/base/content/test/trackingUI/trackingPage.html";
|
||||
const BENIGN_PAGE =
|
||||
"http://tracking.example.org/browser/browser/base/content/test/trackingUI/benignPage.html";
|
||||
const TP_PREF = "privacy.trackingprotection.enabled";
|
||||
const COOKIE_PREF = "network.cookie.cookieBehavior";
|
||||
const ANIMATIONS_PREF = "toolkit.cosmeticAnimations.enabled";
|
||||
const DTSCBN_PREF = "dom.testing.sync-content-blocking-notifications";
|
||||
|
||||
// Check that the shield icon is always hidden when all content blocking
|
||||
// categories are turned off, even when content blocking is on.
|
||||
add_task(async function testContentBlockingAllDisabled() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [
|
||||
[TP_PREF, false],
|
||||
[COOKIE_PREF, Ci.nsICookieService.BEHAVIOR_ACCEPT],
|
||||
[DTSCBN_PREF, true],
|
||||
],
|
||||
});
|
||||
await UrlClassifierTestUtils.addTestTrackers();
|
||||
|
||||
let tab = (gBrowser.selectedTab = BrowserTestUtils.addTab(gBrowser));
|
||||
Services.prefs.setBoolPref(ANIMATIONS_PREF, true);
|
||||
|
||||
registerCleanupFunction(function() {
|
||||
gBrowser.removeCurrentTab();
|
||||
Services.prefs.clearUserPref(ANIMATIONS_PREF);
|
||||
UrlClassifierTestUtils.cleanupTestTrackers();
|
||||
});
|
||||
|
||||
let animationIcon = document.getElementById(
|
||||
"tracking-protection-icon-animatable-image"
|
||||
);
|
||||
let noAnimationIcon = document.getElementById("tracking-protection-icon");
|
||||
|
||||
await Promise.all([
|
||||
promiseTabLoadEvent(tab, TRACKING_PAGE),
|
||||
waitForContentBlockingEvent(2, tab.ownerGlobal),
|
||||
]);
|
||||
ok(BrowserTestUtils.is_hidden(noAnimationIcon), "the default icon is hidden");
|
||||
ok(BrowserTestUtils.is_hidden(animationIcon), "the animated icon is hidden");
|
||||
|
||||
await promiseTabLoadEvent(tab, BENIGN_PAGE);
|
||||
ok(BrowserTestUtils.is_hidden(animationIcon), "the animated icon is hidden");
|
||||
ok(BrowserTestUtils.is_hidden(noAnimationIcon), "the default icon is hidden");
|
||||
|
||||
Services.prefs.setBoolPref(ANIMATIONS_PREF, false);
|
||||
await promiseTabLoadEvent(tab, TRACKING_PAGE);
|
||||
ok(BrowserTestUtils.is_hidden(animationIcon), "the animated icon is hidden");
|
||||
ok(BrowserTestUtils.is_hidden(noAnimationIcon), "the default icon is hidden");
|
||||
|
||||
// Sanitity check that the shield is showing when at least one blocker is enabled.
|
||||
await SpecialPowers.pushPrefEnv({ set: [[TP_PREF, true]] });
|
||||
await Promise.all([
|
||||
promiseTabLoadEvent(tab, TRACKING_PAGE),
|
||||
waitForContentBlockingEvent(2, tab.ownerGlobal),
|
||||
]);
|
||||
ok(BrowserTestUtils.is_visible(noAnimationIcon), "the default icon is shown");
|
||||
});
|
|
@ -1,54 +0,0 @@
|
|||
<?xml version="1.0"?>
|
||||
|
||||
<!--
|
||||
-*- Mode: HTML -*-
|
||||
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/.
|
||||
-->
|
||||
|
||||
<!DOCTYPE bindings [
|
||||
<!ENTITY % browserDTD SYSTEM "chrome://browser/locale/browser.dtd">
|
||||
%browserDTD;
|
||||
]>
|
||||
|
||||
<bindings id="urlbarBindings" xmlns="http://www.mozilla.org/xbl"
|
||||
xmlns:html="http://www.w3.org/1999/xhtml"
|
||||
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
|
||||
xmlns:xbl="http://www.mozilla.org/xbl">
|
||||
|
||||
<binding id="urlbar" extends="chrome://global/content/bindings/textbox.xml#textbox">
|
||||
<content role="combobox">
|
||||
<children includes="box"/>
|
||||
<xul:moz-input-box anonid="moz-input-box"
|
||||
tooltip="aHTMLTooltip"
|
||||
class="urlbar-input-box"
|
||||
flex="1">
|
||||
<children/>
|
||||
<html:input anonid="scheme"
|
||||
class="urlbar-scheme textbox-input"
|
||||
required="required"
|
||||
xbl:inherits="textoverflow,focused"/>
|
||||
<html:input anonid="input"
|
||||
class="urlbar-input textbox-input"
|
||||
aria-owns="urlbarView-results"
|
||||
aria-controls="urlbarView-results"
|
||||
aria-autocomplete="both"
|
||||
allowevents="true"
|
||||
inputmode="mozAwesomebar"
|
||||
xbl:inherits="value,maxlength,disabled,size,readonly,placeholder,tabindex,accesskey,focused,textoverflow"/>
|
||||
</xul:moz-input-box>
|
||||
<xul:image anonid="urlbar-go-button"
|
||||
class="urlbar-go-button urlbar-icon"
|
||||
onclick="gURLBar.handleCommand(event);"
|
||||
tooltiptext="&goEndCap.tooltip;"
|
||||
xbl:inherits="pageproxystate,parentfocused=focused,usertyping"/>
|
||||
<xul:image anonid="historydropmarker"
|
||||
class="urlbar-history-dropmarker urlbar-icon chromeclass-toolbar-additional"
|
||||
tooltiptext="&urlbar.openHistoryPopup.tooltip;"
|
||||
allowevents="true"
|
||||
xbl:inherits="open,parentfocused=focused,usertyping"/>
|
||||
<children includes="hbox"/>
|
||||
</content>
|
||||
</binding>
|
||||
</bindings>
|
|
@ -94,7 +94,6 @@ browser.jar:
|
|||
content/browser/tabbrowser.js (content/tabbrowser.js)
|
||||
content/browser/tabbrowser-tab.js (content/tabbrowser-tab.js)
|
||||
content/browser/tabbrowser-tabs.js (content/tabbrowser-tabs.js)
|
||||
content/browser/urlbarBindings.xml (content/urlbarBindings.xml)
|
||||
content/browser/utilityOverlay.js (content/utilityOverlay.js)
|
||||
content/browser/webext-panels.js (content/webext-panels.js)
|
||||
* content/browser/webext-panels.xul (content/webext-panels.xul)
|
||||
|
|
|
@ -123,32 +123,36 @@ var AboutProtectionsHandler = {
|
|||
win.openTrustedLinkIn("about:preferences#sync", "tab");
|
||||
break;
|
||||
case "FetchContentBlockingEvents":
|
||||
TrackingDBService.getEventsByDateRange(
|
||||
let sumEvents = await TrackingDBService.sumAllEvents();
|
||||
let earliestDate = await TrackingDBService.getEarliestRecordedDate();
|
||||
let eventsByDate = await TrackingDBService.getEventsByDateRange(
|
||||
aMessage.data.from,
|
||||
aMessage.data.to
|
||||
).then(results => {
|
||||
let dataToSend = {};
|
||||
let largest = 0;
|
||||
for (let result of results) {
|
||||
let count = result.getResultByName("count");
|
||||
let type = result.getResultByName("type");
|
||||
let timestamp = result.getResultByName("timestamp");
|
||||
dataToSend[timestamp] = dataToSend[timestamp] || { total: 0 };
|
||||
dataToSend[timestamp][idToTextMap.get(type)] = count;
|
||||
dataToSend[timestamp].total += count;
|
||||
// Record the largest amount of tracking events found per day,
|
||||
// to create the tallest column on the graph and compare other days to.
|
||||
if (largest < dataToSend[timestamp].total) {
|
||||
largest = dataToSend[timestamp].total;
|
||||
}
|
||||
);
|
||||
let dataToSend = {};
|
||||
let largest = 0;
|
||||
|
||||
for (let result of eventsByDate) {
|
||||
let count = result.getResultByName("count");
|
||||
let type = result.getResultByName("type");
|
||||
let timestamp = result.getResultByName("timestamp");
|
||||
dataToSend[timestamp] = dataToSend[timestamp] || { total: 0 };
|
||||
dataToSend[timestamp][idToTextMap.get(type)] = count;
|
||||
dataToSend[timestamp].total += count;
|
||||
// Record the largest amount of tracking events found per day,
|
||||
// to create the tallest column on the graph and compare other days to.
|
||||
if (largest < dataToSend[timestamp].total) {
|
||||
largest = dataToSend[timestamp].total;
|
||||
}
|
||||
dataToSend.largest = largest;
|
||||
this.sendMessage(
|
||||
aMessage.target,
|
||||
"SendContentBlockingRecords",
|
||||
dataToSend
|
||||
);
|
||||
});
|
||||
}
|
||||
dataToSend.earliestDate = earliestDate;
|
||||
dataToSend.sumEvents = sumEvents;
|
||||
this.sendMessage(
|
||||
aMessage.target,
|
||||
"SendContentBlockingRecords",
|
||||
dataToSend
|
||||
);
|
||||
break;
|
||||
case "FetchUserLoginsData":
|
||||
this.sendMessage(
|
||||
|
|
|
@ -184,7 +184,11 @@ var AboutLoginsParent = {
|
|||
let messageManager = message.target.messageManager;
|
||||
const logins = await this.getAllLogins();
|
||||
messageManager.sendAsyncMessage("AboutLogins:AllLogins", logins);
|
||||
const breachesByLoginGUID = await this.getBreachesForLogins(logins);
|
||||
const breaches = await RemoteSettings("fxmonitor-breaches").get();
|
||||
const breachesByLoginGUID = await this.getBreachesForLogins(
|
||||
logins,
|
||||
breaches
|
||||
);
|
||||
messageManager.sendAsyncMessage(
|
||||
"AboutLogins:UpdateBreaches",
|
||||
breachesByLoginGUID
|
||||
|
@ -374,21 +378,20 @@ var AboutLoginsParent = {
|
|||
}
|
||||
},
|
||||
|
||||
async getBreachesForLogins(logins) {
|
||||
const breaches = await RemoteSettings("fxmonitor-breaches").get();
|
||||
const breachHostMap = new Map();
|
||||
for (const breach of breaches) {
|
||||
breachHostMap.set(breach.Domain, breach);
|
||||
}
|
||||
async getBreachesForLogins(logins, breaches) {
|
||||
const breachesByLoginGUID = new Map();
|
||||
for (const login of logins) {
|
||||
const loginURI = Services.io.newURI(login.origin);
|
||||
const breach = breachHostMap.get(loginURI.host) || false;
|
||||
if (
|
||||
breach &&
|
||||
login.timePasswordChanged < new Date(breach.BreachDate).getTime()
|
||||
) {
|
||||
breachesByLoginGUID.set(login.guid, breach);
|
||||
for (const breach of breaches) {
|
||||
if (!breach.Domain) {
|
||||
continue;
|
||||
}
|
||||
if (
|
||||
Services.eTLD.hasRootDomain(loginURI.host, breach.Domain) &&
|
||||
login.timePasswordChanged < new Date(breach.BreachDate).getTime()
|
||||
) {
|
||||
breachesByLoginGUID.set(login.guid, breach);
|
||||
}
|
||||
}
|
||||
}
|
||||
return breachesByLoginGUID;
|
||||
|
|
|
@ -19,3 +19,4 @@ FINAL_TARGET_FILES.actors += [
|
|||
|
||||
BROWSER_CHROME_MANIFESTS += ['tests/browser/browser.ini']
|
||||
MOCHITEST_CHROME_MANIFESTS += ['tests/chrome/chrome.ini']
|
||||
XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
"use strict";
|
||||
|
||||
ChromeUtils.import("resource://testing-common/LoginTestUtils.jsm", this);
|
||||
const { LoginHelper } = ChromeUtils.import(
|
||||
"resource://gre/modules/LoginHelper.jsm"
|
||||
);
|
||||
|
||||
const TestData = LoginTestUtils.testData;
|
||||
const newPropertyBag = LoginHelper.newPropertyBag;
|
||||
|
||||
/**
|
||||
* All the tests are implemented with add_task, this starts them automatically.
|
||||
*/
|
||||
function run_test() {
|
||||
do_get_profile();
|
||||
run_next_test();
|
||||
}
|
|
@ -0,0 +1,119 @@
|
|||
/**
|
||||
* Test AboutLoginsParent.getBreachesForLogins
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
const { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
|
||||
const { AboutLoginsParent } = ChromeUtils.import(
|
||||
"resource:///modules/AboutLoginsParent.jsm"
|
||||
);
|
||||
|
||||
const TEST_BREACHES = [
|
||||
{
|
||||
AddedDate: "2018-12-20T23:56:26Z",
|
||||
BreachDate: "2018-12-16",
|
||||
Domain: "breached.com",
|
||||
Name: "Breached",
|
||||
PwnCount: 1643100,
|
||||
_status: "synced",
|
||||
id: "047940fe-d2fd-4314-b636-b4a952ee0043",
|
||||
last_modified: "1541615610052",
|
||||
schema: "1541615609018",
|
||||
},
|
||||
{
|
||||
AddedDate: "2018-12-20T23:56:26Z",
|
||||
BreachDate: "2018-12-16",
|
||||
Domain: "breached-subdomain.host.com",
|
||||
Name: "Only a Sub-Domain was Breached",
|
||||
PwnCount: 2754200,
|
||||
_status: "synced",
|
||||
id: "047940fe-d2fd-4314-b636-b4a952ee0044",
|
||||
last_modified: "1541615610052",
|
||||
schema: "1541615609018",
|
||||
},
|
||||
];
|
||||
|
||||
const NOT_BREACHED_LOGIN = LoginTestUtils.testData.formLogin({
|
||||
origin: "https://www.example.com",
|
||||
formActionOrigin: "https://www.example.com",
|
||||
username: "username",
|
||||
password: "password",
|
||||
timePasswordChanged: Date.now(),
|
||||
});
|
||||
const BREACHED_LOGIN = LoginTestUtils.testData.formLogin({
|
||||
origin: "https://www.breached.com",
|
||||
formActionOrigin: "https://www.breached.com",
|
||||
username: "username",
|
||||
password: "password",
|
||||
timePasswordChanged: new Date("2018-12-15").getTime(),
|
||||
});
|
||||
const NOT_BREACHED_SUBDOMAIN_LOGIN = LoginTestUtils.testData.formLogin({
|
||||
origin: "https://not-breached-subdomain.host.com",
|
||||
formActionOrigin: "https://not-breached-subdomain.host.com",
|
||||
username: "username",
|
||||
password: "password",
|
||||
});
|
||||
const BREACHED_SUBDOMAIN_LOGIN = LoginTestUtils.testData.formLogin({
|
||||
origin: "https://breached-subdomain.host.com",
|
||||
formActionOrigin: "https://breached-subdomain.host.com",
|
||||
username: "username",
|
||||
password: "password",
|
||||
timePasswordChanged: new Date("2018-12-15").getTime(),
|
||||
});
|
||||
|
||||
add_task(async function test_getBreachesForLogins_notBreachedLogin() {
|
||||
Services.logins.addLogin(NOT_BREACHED_LOGIN);
|
||||
|
||||
const breachesByLoginGUID = await AboutLoginsParent.getBreachesForLogins(
|
||||
[NOT_BREACHED_LOGIN],
|
||||
TEST_BREACHES
|
||||
);
|
||||
Assert.strictEqual(
|
||||
breachesByLoginGUID.size,
|
||||
0,
|
||||
"Should be 0 breached logins."
|
||||
);
|
||||
});
|
||||
|
||||
add_task(async function test_getBreachesForLogins_breachedLogin() {
|
||||
Services.logins.addLogin(BREACHED_LOGIN);
|
||||
|
||||
const breachesByLoginGUID = await AboutLoginsParent.getBreachesForLogins(
|
||||
[NOT_BREACHED_LOGIN, BREACHED_LOGIN],
|
||||
TEST_BREACHES
|
||||
);
|
||||
Assert.strictEqual(
|
||||
breachesByLoginGUID.size,
|
||||
1,
|
||||
"Should be 1 breached login: " + BREACHED_LOGIN.origin
|
||||
);
|
||||
});
|
||||
|
||||
add_task(async function test_getBreachesForLogins_notBreachedSubdomain() {
|
||||
Services.logins.addLogin(NOT_BREACHED_SUBDOMAIN_LOGIN);
|
||||
|
||||
const breachesByLoginGUID = await AboutLoginsParent.getBreachesForLogins(
|
||||
[NOT_BREACHED_LOGIN, NOT_BREACHED_SUBDOMAIN_LOGIN],
|
||||
TEST_BREACHES
|
||||
);
|
||||
Assert.strictEqual(
|
||||
breachesByLoginGUID.size,
|
||||
0,
|
||||
"Should be 0 breached logins."
|
||||
);
|
||||
});
|
||||
|
||||
add_task(async function test_getBreachesForLogins_breachedSubdomain() {
|
||||
Services.logins.addLogin(BREACHED_SUBDOMAIN_LOGIN);
|
||||
|
||||
const breachesByLoginGUID = await AboutLoginsParent.getBreachesForLogins(
|
||||
[NOT_BREACHED_SUBDOMAIN_LOGIN, BREACHED_SUBDOMAIN_LOGIN],
|
||||
TEST_BREACHES
|
||||
);
|
||||
Assert.strictEqual(
|
||||
breachesByLoginGUID.size,
|
||||
1,
|
||||
"Should be 1 breached login: " + BREACHED_SUBDOMAIN_LOGIN.origin
|
||||
);
|
||||
});
|
|
@ -0,0 +1,5 @@
|
|||
[DEFAULT]
|
||||
head = head.js
|
||||
firefox-appdir = browser
|
||||
|
||||
[test_getBreachesForLogins.js]
|
|
@ -12,16 +12,6 @@ function confirmDefaults() {
|
|||
"Identity icon should be the search icon"
|
||||
);
|
||||
|
||||
let connectionIconURL = getComputedStyle(
|
||||
document.getElementById("connection-icon")
|
||||
).listStyleImage;
|
||||
is(connectionIconURL, "none", "Connection icon should not be displayed");
|
||||
|
||||
let extensionIconURL = getComputedStyle(
|
||||
document.getElementById("extension-icon")
|
||||
).listStyleImage;
|
||||
is(extensionIconURL, "none", "Extension icon should not be displayed");
|
||||
|
||||
let label = document.getElementById("identity-icon-label").value;
|
||||
is(label, "", "No label should be used before the extension is started");
|
||||
}
|
||||
|
@ -31,23 +21,12 @@ function confirmExtensionPage() {
|
|||
.listStyleImage;
|
||||
is(
|
||||
identityIcon,
|
||||
'url("chrome://browser/skin/identity-icon.svg")',
|
||||
"Identity icon should be the default identity icon"
|
||||
);
|
||||
|
||||
let connectionIconURL = getComputedStyle(
|
||||
document.getElementById("connection-icon")
|
||||
).listStyleImage;
|
||||
is(connectionIconURL, "none", "Connection icon should not be displayed");
|
||||
|
||||
let extensionIconEl = document.getElementById("extension-icon");
|
||||
let extensionIconURL = getComputedStyle(extensionIconEl).listStyleImage;
|
||||
is(
|
||||
extensionIconURL,
|
||||
'url("chrome://mozapps/skin/extensions/extensionGeneric-16.svg")',
|
||||
"Extension icon should be the default extension icon"
|
||||
"Identity icon should be the default extension icon"
|
||||
);
|
||||
let tooltip = extensionIconEl.tooltipText;
|
||||
|
||||
let identityIconEl = document.getElementById("identity-icon");
|
||||
let tooltip = identityIconEl.tooltipText;
|
||||
is(
|
||||
tooltip,
|
||||
"Loaded by extension: Test Extension",
|
||||
|
|
|
@ -8,17 +8,17 @@
|
|||
--clickable-text-active: hsla(0,0%,70%,.3);
|
||||
--card-divider: rgba(12,12,13,0.1) 1px solid;
|
||||
--report-background: #FAFAFC;
|
||||
--card-padding: 22px;
|
||||
--social-color: #AB71FF;
|
||||
--social-color-darker: #7F27FF;
|
||||
--card-padding: 24px;
|
||||
--social-color: #9059FF;
|
||||
--social-color-darker: #7F40FF;
|
||||
--cookie-color: #0090F4;
|
||||
--cookie-color-darker: #0073C3;
|
||||
--tracker-color: #2AC3A2;
|
||||
--tracker-color-darker: #229C82;
|
||||
--orange: #FFA436;
|
||||
--dark-orange: #ffA40C;
|
||||
--grey: #AFAFBB;
|
||||
--dark-grey: #88889A;
|
||||
--dark-orange: #FF981D;
|
||||
--grey: #8F8F9D;
|
||||
--dark-grey: #818191;
|
||||
--tab-highlight: var(--social-color); /* start with social selected */
|
||||
--blue-60: #0060DF;
|
||||
--blue-70: #003eaa;
|
||||
|
@ -172,25 +172,25 @@ body[focuseddatatype=cryptominer] {
|
|||
border-top: var(--card-divider);
|
||||
grid-column: span 2;
|
||||
grid-row: 2;
|
||||
margin-bottom: 24px;
|
||||
}
|
||||
|
||||
.body-wrapper {
|
||||
grid-column: 2;
|
||||
}
|
||||
|
||||
.graph-week-summary,
|
||||
.graph-total-summary {
|
||||
#graph-week-summary,
|
||||
#graph-total-summary {
|
||||
font-size: 0.8rem;
|
||||
}
|
||||
|
||||
.graph-week-summary {
|
||||
#graph-week-summary {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
#graph-wrapper {
|
||||
width: 100%;
|
||||
margin-top: 40px;
|
||||
margin-bottom: 25px;
|
||||
}
|
||||
|
||||
#graph {
|
||||
|
|
|
@ -0,0 +1,25 @@
|
|||
# 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/.
|
||||
|
||||
### This file is not in a locales directory to prevent it from
|
||||
### being translated as the feature is still in heavy development
|
||||
### and strings are likely to change often.
|
||||
|
||||
# Variables:
|
||||
# $count (Number) - Number of tracking events blocked.
|
||||
graph-week-summary =
|
||||
{ $count ->
|
||||
[one] { -brand-short-name } blocked { $count } tracker over the past week
|
||||
*[other] { -brand-short-name } blocked { $count } trackers over the past week
|
||||
}
|
||||
|
||||
# Variables:
|
||||
# $count (Number) - Number of tracking events blocked.
|
||||
# $earliestDate (Number) - Unix timestamp in ms, representing a date. The
|
||||
# earliest date recorded in the database.
|
||||
graph-total-summary =
|
||||
{ $count ->
|
||||
[one] { $count } tracker blocked since { DATETIME($earliestDate, day: "numeric", month: "long", year: "numeric") }
|
||||
*[other] { $count } trackers blocked since { DATETIME($earliestDate, day: "numeric", month: "long", year: "numeric") }
|
||||
}
|
|
@ -7,6 +7,8 @@
|
|||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="Content-Security-Policy" content="default-src chrome: blob:">
|
||||
<link rel="localization" href="branding/brand.ftl"/>
|
||||
<link rel="localization" href="browser/protections.ftl">
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="chrome://browser/content/protections.css">
|
||||
<link rel="icon" href="chrome://global/skin/icons/warning.svg">
|
||||
|
@ -35,26 +37,24 @@
|
|||
</div>
|
||||
<div class="card-body">
|
||||
<div class="body-wrapper">
|
||||
<p class="graph-week-summary">
|
||||
Firefox blocked 970 trackers over the past week
|
||||
</p>
|
||||
<p id="graph-week-summary"></p>
|
||||
<div id="graph-wrapper">
|
||||
<div id="graph"></div>
|
||||
<div id="legend">
|
||||
<input id="tab-social" data-type="social" type="radio" name="tabs" checked>
|
||||
<label for="tab-social" data-type="social">345</label>
|
||||
<label for="tab-social" data-type="social"></label>
|
||||
|
||||
<input id="tab-cookie" data-type="cookie" type="radio" name="tabs">
|
||||
<label for="tab-cookie" data-type="cookie">123</label>
|
||||
<label for="tab-cookie" data-type="cookie"></label>
|
||||
|
||||
<input id="tab-tracker" data-type="tracker" type="radio" name="tabs">
|
||||
<label for="tab-tracker" data-type="tracker">1</label>
|
||||
<label for="tab-tracker" data-type="tracker"></label>
|
||||
|
||||
<input id="tab-fingerprinter" data-type="fingerprinter" type="radio" name="tabs">
|
||||
<label for="tab-fingerprinter" data-type="fingerprinter">45666</label>
|
||||
<label for="tab-fingerprinter" data-type="fingerprinter"></label>
|
||||
|
||||
<input id="tab-cryptominer" data-type="cryptominer" type="radio" name="tabs">
|
||||
<label for="tab-cryptominer" data-type="cryptominer">7</label>
|
||||
<label for="tab-cryptominer" data-type="cryptominer"></label>
|
||||
|
||||
<div id="social" class="tab-content">
|
||||
<p class="content-title">Social Media Trackers</p>
|
||||
|
@ -78,9 +78,7 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="graph-total-summary">
|
||||
125,324 trackers blocked since August, 2018
|
||||
</p>
|
||||
<div id="graph-total-summary"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -32,12 +32,31 @@ document.addEventListener("DOMContentLoaded", e => {
|
|||
RPMSendAsyncMessage("GetEnabledLockwiseCard");
|
||||
|
||||
let createGraph = data => {
|
||||
let dateInMS = data.earliestDate
|
||||
? new Date(data.earliestDate).getTime()
|
||||
: Date.now();
|
||||
|
||||
let summary = document.getElementById("graph-total-summary");
|
||||
summary.setAttribute(
|
||||
"data-l10n-args",
|
||||
JSON.stringify({ count: data.sumEvents, earliestDate: dateInMS })
|
||||
);
|
||||
summary.setAttribute("data-l10n-id", "graph-total-summary");
|
||||
|
||||
// Set a default top size for the height of the graph bars so that small
|
||||
// numbers don't fill the whole graph.
|
||||
let largest = 100;
|
||||
if (largest < data.largest) {
|
||||
largest = data.largest;
|
||||
}
|
||||
let weekCount = 0;
|
||||
let weekTypeCounts = {
|
||||
social: 0,
|
||||
cookie: 0,
|
||||
tracker: 0,
|
||||
fingerprinter: 0,
|
||||
cryptominer: 0,
|
||||
};
|
||||
|
||||
let graph = document.getElementById("graph");
|
||||
for (let i = weekdays.length - 1; i >= 0; i--) {
|
||||
|
@ -54,6 +73,7 @@ document.addEventListener("DOMContentLoaded", e => {
|
|||
count.textContent = content.total;
|
||||
bar.appendChild(count);
|
||||
let barHeight = (content.total / largest) * 100;
|
||||
weekCount += content.total;
|
||||
bar.style.height = `${barHeight}%`;
|
||||
for (let type of dataTypes) {
|
||||
if (content[type]) {
|
||||
|
@ -62,6 +82,7 @@ document.addEventListener("DOMContentLoaded", e => {
|
|||
div.className = `${type}-bar inner-bar`;
|
||||
div.setAttribute("data-type", type);
|
||||
div.style.height = `${dataHeight}%`;
|
||||
weekTypeCounts[type] += content[type];
|
||||
bar.appendChild(div);
|
||||
}
|
||||
}
|
||||
|
@ -70,6 +91,17 @@ document.addEventListener("DOMContentLoaded", e => {
|
|||
bar.classList.add("empty");
|
||||
}
|
||||
graph.appendChild(bar);
|
||||
let weekSummary = document.getElementById("graph-week-summary");
|
||||
weekSummary.setAttribute(
|
||||
"data-l10n-args",
|
||||
JSON.stringify({ count: weekCount })
|
||||
);
|
||||
weekSummary.setAttribute("data-l10n-id", "graph-week-summary");
|
||||
|
||||
for (let type of dataTypes) {
|
||||
document.querySelector(`label[data-type=${type}]`).textContent =
|
||||
weekTypeCounts[type];
|
||||
}
|
||||
|
||||
let label = document.createElement("span");
|
||||
label.className = "column-label";
|
||||
|
|
|
@ -51,6 +51,7 @@ add_task(async function() {
|
|||
url: "about:protections",
|
||||
gBrowser,
|
||||
});
|
||||
const { getLoginData } = AboutProtectionsHandler;
|
||||
|
||||
info("Check that the correct content is displayed for non-logged in users.");
|
||||
await ContentTask.spawn(tab.linkedBrowser, {}, async function() {
|
||||
|
@ -192,5 +193,7 @@ add_task(async function() {
|
|||
// remove logins
|
||||
Services.logins.removeLogin(TEST_LOGIN1);
|
||||
Services.logins.removeLogin(TEST_LOGIN2);
|
||||
|
||||
AboutProtectionsHandler.getLoginData = getLoginData;
|
||||
await BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
|
|
@ -111,17 +111,21 @@ class UrlbarInput {
|
|||
// This exists only for tests.
|
||||
this._enableAutofillPlaceholder = true;
|
||||
|
||||
// Forward textbox methods and properties.
|
||||
const METHODS = [
|
||||
"addEventListener",
|
||||
"removeEventListener",
|
||||
// Forward certain methods and properties.
|
||||
const CONTAINER_METHODS = [
|
||||
"getAttribute",
|
||||
"hasAttribute",
|
||||
"querySelector",
|
||||
"setAttribute",
|
||||
"removeAttribute",
|
||||
"toggleAttribute",
|
||||
];
|
||||
const READ_ONLY_PROPERTIES = ["inputField", "editor"];
|
||||
const INPUT_METHODS = [
|
||||
"addEventListener",
|
||||
"blur",
|
||||
"focus",
|
||||
"removeEventListener",
|
||||
];
|
||||
const READ_WRITE_PROPERTIES = [
|
||||
"placeholder",
|
||||
"readOnly",
|
||||
|
@ -129,33 +133,33 @@ class UrlbarInput {
|
|||
"selectionEnd",
|
||||
];
|
||||
|
||||
for (let method of METHODS) {
|
||||
for (let method of CONTAINER_METHODS) {
|
||||
this[method] = (...args) => {
|
||||
return this.textbox[method](...args);
|
||||
};
|
||||
}
|
||||
|
||||
for (let property of READ_ONLY_PROPERTIES) {
|
||||
Object.defineProperty(this, property, {
|
||||
enumerable: true,
|
||||
get() {
|
||||
return this.textbox && this.textbox[property];
|
||||
},
|
||||
});
|
||||
for (let method of INPUT_METHODS) {
|
||||
this[method] = (...args) => {
|
||||
return this.inputField[method](...args);
|
||||
};
|
||||
}
|
||||
|
||||
for (let property of READ_WRITE_PROPERTIES) {
|
||||
Object.defineProperty(this, property, {
|
||||
enumerable: true,
|
||||
get() {
|
||||
return this.textbox && this.textbox[property];
|
||||
return this.inputField[property];
|
||||
},
|
||||
set(val) {
|
||||
return (this.textbox[property] = val);
|
||||
return (this.inputField[property] = val);
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
this.inputField = this.querySelector(".urlbar-input");
|
||||
this.dropmarker = this.querySelector(".urlbar-history-dropmarker");
|
||||
|
||||
XPCOMUtils.defineLazyGetter(this, "valueFormatter", () => {
|
||||
return new UrlbarValueFormatter(this);
|
||||
});
|
||||
|
@ -163,7 +167,7 @@ class UrlbarInput {
|
|||
// If the toolbar is not visible in this window or the urlbar is readonly,
|
||||
// we'll stop here, so that most properties of the input object are valid,
|
||||
// but we won't handle events.
|
||||
if (!this.window.toolbar.visible || this.hasAttribute("readonly")) {
|
||||
if (!this.window.toolbar.visible || this.readOnly) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -195,12 +199,10 @@ class UrlbarInput {
|
|||
"select",
|
||||
];
|
||||
for (let name of this._inputFieldEvents) {
|
||||
this.inputField.addEventListener(name, this);
|
||||
this.addEventListener(name, this);
|
||||
}
|
||||
|
||||
// This is needed for the dropmarker. Once we remove that (i.e. make
|
||||
// openViewOnFocus = true the default), this won't be needed anymore.
|
||||
this.addEventListener("mousedown", this);
|
||||
this.dropmarker.addEventListener("mousedown", this);
|
||||
|
||||
this.view.panel.addEventListener("popupshowing", this);
|
||||
this.view.panel.addEventListener("popuphidden", this);
|
||||
|
@ -227,9 +229,9 @@ class UrlbarInput {
|
|||
uninit() {
|
||||
this.window.removeEventListener("unload", this);
|
||||
for (let name of this._inputFieldEvents) {
|
||||
this.inputField.removeEventListener(name, this);
|
||||
this.removeEventListener(name, this);
|
||||
}
|
||||
this.removeEventListener("mousedown", this);
|
||||
this.dropmarker.removeEventListener("mousedown", this);
|
||||
|
||||
this.view.panel.remove();
|
||||
|
||||
|
@ -264,6 +266,7 @@ class UrlbarInput {
|
|||
delete this.view;
|
||||
delete this.controller;
|
||||
delete this.textbox;
|
||||
delete this.inputField;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -301,14 +304,6 @@ class UrlbarInput {
|
|||
}
|
||||
}
|
||||
|
||||
focus() {
|
||||
this.inputField.focus();
|
||||
}
|
||||
|
||||
blur() {
|
||||
this.inputField.blur();
|
||||
}
|
||||
|
||||
select() {
|
||||
// See _on_select(). HTMLInputElement.select() dispatches a "select"
|
||||
// event but does not set the primary selection.
|
||||
|
@ -785,16 +780,16 @@ class UrlbarInput {
|
|||
|
||||
// Getters and Setters below.
|
||||
|
||||
get editor() {
|
||||
return this.inputField.editor;
|
||||
}
|
||||
|
||||
get focused() {
|
||||
return this.textbox.getAttribute("focused") == "true";
|
||||
return this.getAttribute("focused") == "true";
|
||||
}
|
||||
|
||||
get goButton() {
|
||||
return this.document.getAnonymousElementByAttribute(
|
||||
this.textbox,
|
||||
"anonid",
|
||||
"urlbar-go-button"
|
||||
);
|
||||
return this.querySelector(".urlbar-go-button");
|
||||
}
|
||||
|
||||
get textValue() {
|
||||
|
@ -822,7 +817,7 @@ class UrlbarInput {
|
|||
this._openViewOnFocus = Services.prefs.getBoolPref(
|
||||
"browser.urlbar.openViewOnFocus"
|
||||
);
|
||||
this.toggleAttribute("hidedropmarker", this._openViewOnFocus);
|
||||
this.dropmarker.hidden = this._openViewOnFocus;
|
||||
}
|
||||
|
||||
_setValue(val, allowTrim) {
|
||||
|
@ -1322,13 +1317,7 @@ class UrlbarInput {
|
|||
}
|
||||
|
||||
_initPasteAndGo() {
|
||||
let inputBox = this.document.getAnonymousElementByAttribute(
|
||||
this.textbox,
|
||||
"anonid",
|
||||
"moz-input-box"
|
||||
);
|
||||
// Force the Custom Element to upgrade until Bug 1470242 handles this:
|
||||
this.window.customElements.upgrade(inputBox);
|
||||
let inputBox = this.querySelector("moz-input-box");
|
||||
let contextMenu = inputBox.menupopup;
|
||||
let insertLocation = contextMenu.firstElementChild;
|
||||
while (
|
||||
|
@ -1405,11 +1394,14 @@ class UrlbarInput {
|
|||
// Event handlers below.
|
||||
|
||||
_on_blur(event) {
|
||||
this.removeAttribute("focused");
|
||||
this.formatValue();
|
||||
this._resetSearchState();
|
||||
|
||||
// In certain cases, like holding an override key and confirming an entry,
|
||||
// we don't key a keyup event for the override key, thus we make this
|
||||
// additional cleanup on blur.
|
||||
this._clearActionOverride();
|
||||
this.formatValue();
|
||||
|
||||
// The extension input sessions depends more on blur than on the fact we
|
||||
// actually cancel a running query, so we do it here.
|
||||
|
@ -1422,11 +1414,11 @@ class UrlbarInput {
|
|||
if (!UrlbarPrefs.get("ui.popup.disable_autohide")) {
|
||||
this.view.close();
|
||||
}
|
||||
|
||||
// We may have hidden popup notifications, show them again if necessary.
|
||||
if (this.getAttribute("pageproxystate") != "valid") {
|
||||
this.window.UpdatePopupNotificationsVisibility();
|
||||
}
|
||||
this._resetSearchState();
|
||||
}
|
||||
|
||||
_on_click(event) {
|
||||
|
@ -1450,6 +1442,7 @@ class UrlbarInput {
|
|||
}
|
||||
|
||||
_on_focus(event) {
|
||||
this.setAttribute("focused", "true");
|
||||
this._updateUrlTooltip();
|
||||
this.formatValue();
|
||||
|
||||
|
@ -1483,10 +1476,7 @@ class UrlbarInput {
|
|||
return;
|
||||
}
|
||||
|
||||
if (
|
||||
event.originalTarget.classList.contains("urlbar-history-dropmarker") &&
|
||||
event.button == 0
|
||||
) {
|
||||
if (event.currentTarget == this.dropmarker && event.button == 0) {
|
||||
if (this.view.isOpen) {
|
||||
this.view.close();
|
||||
} else {
|
||||
|
@ -1711,11 +1701,11 @@ class UrlbarInput {
|
|||
}
|
||||
|
||||
_on_popupshowing() {
|
||||
this.setAttribute("open", "true");
|
||||
this.dropmarker.setAttribute("open", "true");
|
||||
}
|
||||
|
||||
_on_popuphidden() {
|
||||
this.removeAttribute("open");
|
||||
this.dropmarker.removeAttribute("open");
|
||||
}
|
||||
|
||||
_on_dragstart(event) {
|
||||
|
@ -1724,7 +1714,7 @@ class UrlbarInput {
|
|||
event.originalTarget
|
||||
);
|
||||
if (
|
||||
this.inputField != event.originalTarget &&
|
||||
event.target != this.inputField &&
|
||||
!(nodePosition & Node.DOCUMENT_POSITION_CONTAINED_BY)
|
||||
) {
|
||||
return;
|
||||
|
|
|
@ -46,11 +46,7 @@ class UrlbarValueFormatter {
|
|||
}
|
||||
|
||||
get scheme() {
|
||||
return this.document.getAnonymousElementByAttribute(
|
||||
this.urlbarInput.textbox,
|
||||
"anonid",
|
||||
"scheme"
|
||||
);
|
||||
return this.urlbarInput.textbox.querySelector(".urlbar-scheme");
|
||||
}
|
||||
|
||||
update() {
|
||||
|
|
|
@ -216,11 +216,7 @@ var UrlbarTestUtils = {
|
|||
},
|
||||
|
||||
getDropMarker(win) {
|
||||
return win.document.getAnonymousElementByAttribute(
|
||||
win.gURLBar.textbox,
|
||||
"anonid",
|
||||
"historydropmarker"
|
||||
);
|
||||
return win.gURLBar.dropmarker;
|
||||
},
|
||||
|
||||
/**
|
||||
|
|
|
@ -13,7 +13,6 @@ support-files =
|
|||
[browser_action_searchengine.js]
|
||||
[browser_action_searchengine_alias.js]
|
||||
[browser_autocomplete_a11y_label.js]
|
||||
skip-if = (verify && !debug && (os == 'win'))
|
||||
support-files =
|
||||
searchSuggestionEngine.xml
|
||||
searchSuggestionEngine.sjs
|
||||
|
@ -82,7 +81,6 @@ tags = clipboard
|
|||
[browser_primary_selection_safe_on_new_tab.js]
|
||||
[browser_privateBrowsingWindowChange.js]
|
||||
[browser_raceWithTabs.js]
|
||||
skip-if = os == "linux" # Bug 1533807
|
||||
[browser_redirect_error.js]
|
||||
support-files = redirect_error.sjs
|
||||
[browser_remotetab.js]
|
||||
|
@ -104,12 +102,10 @@ support-files =
|
|||
[browser_switchTab_closesUrlbarPopup.js]
|
||||
[browser_switchTab_decodeuri.js]
|
||||
[browser_switchTab_override.js]
|
||||
skip-if = ((os == 'win') && verify && debug)
|
||||
[browser_switchToTab_closes_newtab.js]
|
||||
[browser_switchToTab_fullUrl_repeatedKeydown.js]
|
||||
[browser_switchToTabHavingURI_aOpenParams.js]
|
||||
[browser_tabMatchesInAwesomebar_perwindowpb.js]
|
||||
skip-if = os == 'linux' # Bug 1104755 (Intermittent failure)
|
||||
[browser_tabMatchesInAwesomebar.js]
|
||||
support-files =
|
||||
moz.png
|
||||
|
@ -143,7 +139,6 @@ support-files =
|
|||
[browser_urlbarDelete.js]
|
||||
[browser_urlbarEnter.js]
|
||||
[browser_urlbarEnterAfterMouseOver.js]
|
||||
skip-if = os == "linux" # Bug 1073339 - Investigate autocomplete test unreliability on Linux/e10s
|
||||
[browser_urlbarFocusedCmdK.js]
|
||||
[browser_urlbarHashChangeProxyState.js]
|
||||
[browser_UrlbarInput_formatValue.js]
|
||||
|
@ -182,7 +177,6 @@ support-files =
|
|||
searchSuggestionEngine.xml
|
||||
searchSuggestionEngine.sjs
|
||||
[browser_URLBarSetURI.js]
|
||||
skip-if = (os == "linux" || os == "mac") && debug # bug 970052, bug 970053
|
||||
[browser_urlbarStop.js]
|
||||
[browser_urlbarStopSearchOnSelection.js]
|
||||
support-files =
|
||||
|
|
|
@ -50,12 +50,7 @@ add_task(async function proxyState() {
|
|||
|
||||
async function clickDropmarker() {
|
||||
await UrlbarTestUtils.promisePopupOpen(window, () => {
|
||||
let historyDropMarker = window.document.getAnonymousElementByAttribute(
|
||||
gURLBar.textbox,
|
||||
"anonid",
|
||||
"historydropmarker"
|
||||
);
|
||||
EventUtils.synthesizeMouseAtCenter(historyDropMarker, {}, window);
|
||||
EventUtils.synthesizeMouseAtCenter(gURLBar.dropmarker, {}, window);
|
||||
});
|
||||
let queryContext = await gURLBar.lastQueryContextPromise;
|
||||
return queryContext;
|
||||
|
|
|
@ -30,11 +30,7 @@ add_task(async function() {
|
|||
() => reject(new Error(`Failed to copy string '${url}' to clipboard`))
|
||||
);
|
||||
});
|
||||
let textBox = document.getAnonymousElementByAttribute(
|
||||
gURLBar.textbox,
|
||||
"anonid",
|
||||
"moz-input-box"
|
||||
);
|
||||
let textBox = gURLBar.querySelector("moz-input-box");
|
||||
let cxmenu = textBox.menupopup;
|
||||
let cxmenuPromise = BrowserTestUtils.waitForEvent(cxmenu, "popupshown");
|
||||
EventUtils.synthesizeMouseAtCenter(gURLBar.inputField, {
|
||||
|
@ -71,11 +67,7 @@ add_task(async function() {
|
|||
() => reject(new Error(`Failed to copy string '${url}' to clipboard`))
|
||||
);
|
||||
});
|
||||
let textBox = document.getAnonymousElementByAttribute(
|
||||
gURLBar.textbox,
|
||||
"anonid",
|
||||
"moz-input-box"
|
||||
);
|
||||
let textBox = gURLBar.querySelector("moz-input-box");
|
||||
let cxmenu = textBox.menupopup;
|
||||
let cxmenuPromise = BrowserTestUtils.waitForEvent(cxmenu, "popupshown");
|
||||
EventUtils.synthesizeMouseAtCenter(gURLBar.inputField, {
|
||||
|
|
|
@ -31,12 +31,7 @@ add_task(async function() {
|
|||
await BrowserTestUtils.switchTab(gBrowser, tab1);
|
||||
// Now open the popup by the history marker.
|
||||
await UrlbarTestUtils.promisePopupOpen(window, () => {
|
||||
let historyDropMarker = window.document.getAnonymousElementByAttribute(
|
||||
gURLBar.textbox,
|
||||
"anonid",
|
||||
"historydropmarker"
|
||||
);
|
||||
EventUtils.synthesizeMouseAtCenter(historyDropMarker, {}, window);
|
||||
EventUtils.synthesizeMouseAtCenter(gURLBar.dropmarker, {}, window);
|
||||
});
|
||||
// Check that the popup closes when we switch tab.
|
||||
await UrlbarTestUtils.promisePopupClose(window, () => {
|
||||
|
|
|
@ -46,23 +46,18 @@ add_task(async function test_change_default_engine_updates_placeholder() {
|
|||
await Services.search.setDefault(extraEngine);
|
||||
|
||||
await TestUtils.waitForCondition(
|
||||
() =>
|
||||
gURLBar.getAttribute("placeholder") ==
|
||||
gURLBar.getAttribute("defaultPlaceholder"),
|
||||
() => gURLBar.placeholder == gURLBar.getAttribute("defaultPlaceholder"),
|
||||
"The placeholder should match the default placeholder for non-built-in engines."
|
||||
);
|
||||
Assert.equal(
|
||||
gURLBar.getAttribute("placeholder"),
|
||||
gURLBar.getAttribute("defaultPlaceholder")
|
||||
);
|
||||
Assert.equal(gURLBar.placeholder, gURLBar.getAttribute("defaultPlaceholder"));
|
||||
|
||||
await Services.search.setDefault(originalEngine);
|
||||
|
||||
await TestUtils.waitForCondition(
|
||||
() => gURLBar.getAttribute("placeholder") == expectedString,
|
||||
() => gURLBar.placeholder == expectedString,
|
||||
"The placeholder should include the engine name for built-in engines."
|
||||
);
|
||||
Assert.equal(gURLBar.getAttribute("placeholder"), expectedString);
|
||||
Assert.equal(gURLBar.placeholder, expectedString);
|
||||
});
|
||||
|
||||
add_task(async function test_delayed_update_placeholder() {
|
||||
|
@ -82,7 +77,7 @@ add_task(async function test_delayed_update_placeholder() {
|
|||
BrowserSearch._updateURLBarPlaceholder(extraEngine.name, true);
|
||||
|
||||
Assert.equal(
|
||||
gURLBar.getAttribute("placeholder"),
|
||||
gURLBar.placeholder,
|
||||
expectedString,
|
||||
"Placeholder should be unchanged."
|
||||
);
|
||||
|
@ -91,9 +86,7 @@ add_task(async function test_delayed_update_placeholder() {
|
|||
await BrowserTestUtils.switchTab(gBrowser, urlTab);
|
||||
|
||||
await TestUtils.waitForCondition(
|
||||
() =>
|
||||
gURLBar.getAttribute("placeholder") ==
|
||||
gURLBar.getAttribute("defaultPlaceholder"),
|
||||
() => gURLBar.placeholder == gURLBar.getAttribute("defaultPlaceholder"),
|
||||
"The placeholder should have updated in the background."
|
||||
);
|
||||
|
||||
|
@ -104,7 +97,7 @@ add_task(async function test_delayed_update_placeholder() {
|
|||
await TestUtils.waitForTick();
|
||||
|
||||
Assert.equal(
|
||||
gURLBar.getAttribute("placeholder"),
|
||||
gURLBar.placeholder,
|
||||
gURLBar.getAttribute("defaultPlaceholder"),
|
||||
"Placeholder should be unchanged."
|
||||
);
|
||||
|
@ -112,7 +105,7 @@ add_task(async function test_delayed_update_placeholder() {
|
|||
await BrowserTestUtils.switchTab(gBrowser, urlTab);
|
||||
|
||||
await TestUtils.waitForCondition(
|
||||
() => gURLBar.getAttribute("placeholder") == expectedString,
|
||||
() => gURLBar.placeholder == expectedString,
|
||||
"The placeholder should include the engine name for built-in engines."
|
||||
);
|
||||
|
||||
|
@ -121,7 +114,7 @@ add_task(async function test_delayed_update_placeholder() {
|
|||
await TestUtils.waitForTick();
|
||||
|
||||
Assert.equal(
|
||||
gURLBar.getAttribute("placeholder"),
|
||||
gURLBar.placeholder,
|
||||
gURLBar.getAttribute("defaultPlaceholder"),
|
||||
"Placeholder should be the default."
|
||||
);
|
||||
|
|
|
@ -232,19 +232,31 @@ add_task(async function test_browser_zoom() {
|
|||
const initialWidth = await waitForRenderAndGetWidth(newTabBrowser);
|
||||
|
||||
// Zoom in
|
||||
let newWidthPromise = waitForRenderAndGetWidth(newTabBrowser);
|
||||
FullZoom.enlarge();
|
||||
let newWidth = await waitForRenderAndGetWidth(newTabBrowser);
|
||||
ok(newWidth > initialWidth, "Zoom in makes the page bigger.");
|
||||
ok(
|
||||
(await newWidthPromise) > initialWidth,
|
||||
"Zoom in makes the page bigger."
|
||||
);
|
||||
|
||||
// Reset
|
||||
newWidthPromise = waitForRenderAndGetWidth(newTabBrowser);
|
||||
FullZoom.reset();
|
||||
newWidth = await waitForRenderAndGetWidth(newTabBrowser);
|
||||
is(newWidth, initialWidth, "Zoom reset restores page.");
|
||||
is(await newWidthPromise, initialWidth, "Zoom reset restores page.");
|
||||
|
||||
// Zoom out
|
||||
newWidthPromise = waitForRenderAndGetWidth(newTabBrowser);
|
||||
FullZoom.reduce();
|
||||
newWidth = await waitForRenderAndGetWidth(newTabBrowser);
|
||||
ok(newWidth < initialWidth, "Zoom out makes the page smaller.");
|
||||
ok(
|
||||
(await newWidthPromise) < initialWidth,
|
||||
"Zoom out makes the page smaller."
|
||||
);
|
||||
|
||||
// Clean-up after the PDF viewer.
|
||||
await ContentTask.spawn(newTabBrowser, null, function() {
|
||||
const viewer = content.wrappedJSObject.PDFViewerApplication;
|
||||
return viewer.close();
|
||||
});
|
||||
}
|
||||
);
|
||||
});
|
||||
|
|
|
@ -482,7 +482,6 @@ identity.identified.state_and_country=%S, %S
|
|||
# use a synonym for "safe" or "private" if "secure" is too long.
|
||||
identity.notSecure.label=Not Secure
|
||||
|
||||
identity.icon.tooltip=Show site information
|
||||
identity.extension.label=Extension (%S)
|
||||
identity.extension.tooltip=Loaded by extension: %S
|
||||
identity.showDetails.tooltip=Show connection details
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
# having to create the same entry for each locale.
|
||||
|
||||
[localization] @AB_CD@.jar:
|
||||
browser/protections.ftl (../components/protections/content/protections.ftl)
|
||||
browser/aboutLogins.ftl (../components/aboutlogins/content/aboutLogins.ftl)
|
||||
toolkit/certviewer.ftl (../../toolkit/components/certviewer/content/certviewer.ftl)
|
||||
browser (%browser/**/*.ftl)
|
||||
|
|
|
@ -56,3 +56,4 @@ support-files =
|
|||
[browser_UsageTelemetry_content.js]
|
||||
[browser_UsageTelemetry_content_aboutHome.js]
|
||||
[browser_UsageTelemetry_content_aboutRestartRequired.js]
|
||||
[browser_UsageTelemetry_reload_key_combination.js]
|
||||
|
|
|
@ -0,0 +1,160 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/
|
||||
*/
|
||||
|
||||
/**
|
||||
* This file tests page reload key combination telemetry
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
const TAB_URL = "https://example.com";
|
||||
|
||||
var accelKey = "ctrlKey";
|
||||
if (AppConstants.platform == "macosx") {
|
||||
accelKey = "metaKey";
|
||||
}
|
||||
|
||||
add_task(async function setup() {
|
||||
await SpecialPowers.pushPrefEnv({
|
||||
set: [["toolkit.cosmeticAnimations.enabled", false]],
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_pageReloadOnlyF5() {
|
||||
let histogram = TelemetryTestUtils.getAndClearHistogram(
|
||||
"FX_PAGE_RELOAD_KEY_COMBO"
|
||||
);
|
||||
|
||||
await BrowserTestUtils.withNewTab(TAB_URL, async browser => {
|
||||
let p = BrowserTestUtils.browserLoaded(browser);
|
||||
EventUtils.synthesizeKey("VK_F5");
|
||||
await p;
|
||||
|
||||
TelemetryTestUtils.assertHistogram(histogram, 0, 1);
|
||||
});
|
||||
});
|
||||
|
||||
if (AppConstants.platform != "macosx") {
|
||||
add_task(async function test_pageReloadAccelF5() {
|
||||
let histogram = TelemetryTestUtils.getAndClearHistogram(
|
||||
"FX_PAGE_RELOAD_KEY_COMBO"
|
||||
);
|
||||
|
||||
await BrowserTestUtils.withNewTab(TAB_URL, async browser => {
|
||||
let p = BrowserTestUtils.browserLoaded(browser);
|
||||
EventUtils.synthesizeKey("VK_F5", { accelKey: true });
|
||||
await p;
|
||||
|
||||
TelemetryTestUtils.assertHistogram(histogram, 1, 1);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
add_task(async function test_pageReloadAccelR() {
|
||||
let histogram = TelemetryTestUtils.getAndClearHistogram(
|
||||
"FX_PAGE_RELOAD_KEY_COMBO"
|
||||
);
|
||||
|
||||
await BrowserTestUtils.withNewTab(TAB_URL, async browser => {
|
||||
let p = BrowserTestUtils.browserLoaded(browser);
|
||||
EventUtils.synthesizeKey("r", { accelKey: true });
|
||||
await p;
|
||||
|
||||
TelemetryTestUtils.assertHistogram(histogram, 2, 1);
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_pageReloadAccelShiftR() {
|
||||
let histogram = TelemetryTestUtils.getAndClearHistogram(
|
||||
"FX_PAGE_RELOAD_KEY_COMBO"
|
||||
);
|
||||
|
||||
await BrowserTestUtils.withNewTab(TAB_URL, async browser => {
|
||||
let p = BrowserTestUtils.browserLoaded(browser);
|
||||
EventUtils.synthesizeKey("r", { accelKey: true, shiftKey: true });
|
||||
await p;
|
||||
|
||||
TelemetryTestUtils.assertHistogram(histogram, 3, 1);
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_pageReloadToolbar() {
|
||||
let histogram = TelemetryTestUtils.getAndClearHistogram(
|
||||
"FX_PAGE_RELOAD_KEY_COMBO"
|
||||
);
|
||||
|
||||
await BrowserTestUtils.withNewTab(TAB_URL, async browser => {
|
||||
let reloadButton = document.getElementById("reload-button");
|
||||
let p = BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
await BrowserTestUtils.waitForCondition(() => {
|
||||
return !reloadButton.disabled;
|
||||
});
|
||||
|
||||
EventUtils.synthesizeMouseAtCenter(reloadButton, {});
|
||||
await p;
|
||||
|
||||
TelemetryTestUtils.assertHistogram(histogram, 4, 1);
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_pageReloadShiftToolbar() {
|
||||
let histogram = TelemetryTestUtils.getAndClearHistogram(
|
||||
"FX_PAGE_RELOAD_KEY_COMBO"
|
||||
);
|
||||
|
||||
await BrowserTestUtils.withNewTab(TAB_URL, async browser => {
|
||||
let reloadButton = document.getElementById("reload-button");
|
||||
let p = BrowserTestUtils.browserLoaded(browser);
|
||||
|
||||
await BrowserTestUtils.waitForCondition(() => {
|
||||
return !reloadButton.disabled;
|
||||
});
|
||||
|
||||
EventUtils.synthesizeMouseAtCenter(reloadButton, { shiftKey: true });
|
||||
await p;
|
||||
|
||||
TelemetryTestUtils.assertHistogram(histogram, 5, 1);
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_pageReloadAccelToolbar() {
|
||||
let histogram = TelemetryTestUtils.getAndClearHistogram(
|
||||
"FX_PAGE_RELOAD_KEY_COMBO"
|
||||
);
|
||||
|
||||
await BrowserTestUtils.withNewTab(TAB_URL, async browser => {
|
||||
let reloadButton = document.getElementById("reload-button");
|
||||
|
||||
await BrowserTestUtils.waitForCondition(() => {
|
||||
return !reloadButton.disabled;
|
||||
});
|
||||
|
||||
EventUtils.synthesizeMouseAtCenter(reloadButton, { accelKey: true });
|
||||
|
||||
TelemetryTestUtils.assertHistogram(histogram, 6, 1);
|
||||
// Accel + Toolbar would open an extra tab, so we need to call removeTab twice
|
||||
BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
||||
});
|
||||
});
|
||||
|
||||
add_task(async function test_pageReloadAuxiliaryToobar() {
|
||||
let histogram = TelemetryTestUtils.getAndClearHistogram(
|
||||
"FX_PAGE_RELOAD_KEY_COMBO"
|
||||
);
|
||||
|
||||
await BrowserTestUtils.withNewTab(TAB_URL, async browser => {
|
||||
let reloadButton = document.getElementById("reload-button");
|
||||
|
||||
await BrowserTestUtils.waitForCondition(() => {
|
||||
return !reloadButton.disabled;
|
||||
});
|
||||
|
||||
EventUtils.synthesizeMouseAtCenter(reloadButton, { button: 1 });
|
||||
|
||||
TelemetryTestUtils.assertHistogram(histogram, 7, 1);
|
||||
// Auxiliary + Toolbar would open an extra tab, so we need to call removeTab twice
|
||||
BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
||||
});
|
||||
});
|
|
@ -143,7 +143,8 @@ panelview {
|
|||
#downloadsPanel,
|
||||
#widget-overflow,
|
||||
#appMenu-popup,
|
||||
#customizationui-widget-panel {
|
||||
#customizationui-widget-panel,
|
||||
#protections-popup {
|
||||
margin-top: -6px;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,15 +5,20 @@
|
|||
%endif
|
||||
|
||||
#identity-box {
|
||||
padding-inline-start: 8px;
|
||||
padding-inline-start: 4px;
|
||||
padding-inline-end: 4px;
|
||||
margin-inline-end: 4px;
|
||||
/* Set default fill for icons in the identity block.
|
||||
Individual icons can override this. */
|
||||
fill: currentColor;
|
||||
fill-opacity: .6;
|
||||
/* This is for tracking-protection-icon's slide-in animation. */
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* The tracking protection icon will be hidden if it is a chrome page. There
|
||||
will be only the brand icon in the url bar. So, we need to change the padding
|
||||
start for proper positing the icon. */
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.chromeUI {
|
||||
padding-inline-start: 8px;
|
||||
}
|
||||
|
||||
#urlbar[pageproxystate="invalid"] > #identity-box > #blocked-permissions-container,
|
||||
|
@ -27,13 +32,15 @@
|
|||
-moz-user-focus: ignore;
|
||||
}
|
||||
|
||||
#identity-box:hover:not(.no-hover):not([open=true]) {
|
||||
#identity-box:hover:not(.no-hover):not([open=true]),
|
||||
#tracking-protection-icon-container:hover:not([open=true]) {
|
||||
background-color: hsla(0,0%,70%,.2);
|
||||
fill-opacity: .8;
|
||||
}
|
||||
|
||||
#identity-box:hover:active:not(.no-hover),
|
||||
#identity-box[open=true] {
|
||||
#identity-box[open=true],
|
||||
#tracking-protection-icon-container[open=true] {
|
||||
background-color: hsla(0,0%,70%,.3);
|
||||
fill-opacity: .8;
|
||||
}
|
||||
|
@ -101,10 +108,8 @@
|
|||
#sharing-icon,
|
||||
#identity-icon,
|
||||
#tracking-protection-icon,
|
||||
#connection-icon,
|
||||
.notification-anchor-icon,
|
||||
#blocked-permissions-container > .blocked-permission-icon,
|
||||
#extension-icon {
|
||||
#blocked-permissions-container > .blocked-permission-icon {
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
margin-inline-start: 4px;
|
||||
|
@ -117,10 +122,6 @@
|
|||
list-style-image: url(chrome://browser/skin/identity-icon.svg);
|
||||
}
|
||||
|
||||
#identity-box.grantedPermissions > #identity-icon {
|
||||
list-style-image: url(chrome://browser/skin/identity-icon-notice.svg);
|
||||
}
|
||||
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.chromeUI > #identity-icon {
|
||||
list-style-image: url(chrome://branding/content/identity-icons-brand.svg);
|
||||
}
|
||||
|
@ -134,6 +135,33 @@
|
|||
list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric-16.svg);
|
||||
}
|
||||
|
||||
#urlbar[pageproxystate="valid"] #identity-box.extensionPage > #identity-icon {
|
||||
list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric-16.svg);
|
||||
}
|
||||
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.verifiedDomain > #identity-icon,
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.verifiedIdentity > #identity-icon,
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.mixedActiveBlocked > #identity-icon {
|
||||
list-style-image: url(chrome://browser/skin/connection-secure.svg);
|
||||
-moz-context-properties: fill;
|
||||
fill: #12BC00;
|
||||
}
|
||||
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.weakCipher > #identity-icon,
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.mixedDisplayContent > #identity-icon,
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.mixedDisplayContentLoadedActiveBlocked > #identity-icon,
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.certUserOverridden > #identity-icon {
|
||||
list-style-image: url(chrome://browser/skin/connection-mixed-passive-loaded.svg);
|
||||
fill: unset;
|
||||
-moz-context-properties: fill, fill-opacity;
|
||||
}
|
||||
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.notSecure > #identity-icon,
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.insecureLoginForms > #identity-icon,
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.mixedActiveContent > #identity-icon {
|
||||
list-style-image: url(chrome://browser/skin/connection-mixed-active-loaded.svg);
|
||||
}
|
||||
|
||||
/* SHARING ICON */
|
||||
|
||||
#identity-box[sharing="camera"] > #sharing-icon {
|
||||
|
@ -164,26 +192,26 @@
|
|||
|
||||
/* TRACKING PROTECTION ICON */
|
||||
|
||||
#tracking-protection-icon-container {
|
||||
margin-inline-start: 3px;
|
||||
padding-inline-end: 4px;
|
||||
fill-opacity: .3;
|
||||
fill: currentColor;
|
||||
}
|
||||
|
||||
#urlbar[pageproxystate="valid"] > #tracking-protection-icon-container.chromeUI {
|
||||
display: none;
|
||||
}
|
||||
|
||||
#tracking-protection-icon-box {
|
||||
visibility: collapse;
|
||||
overflow: hidden;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
margin-inline-end: -20px;
|
||||
}
|
||||
|
||||
#tracking-protection-icon-box[active],
|
||||
#tracking-protection-icon-box[hasException] {
|
||||
margin-inline-end: 0px;
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
#tracking-protection-icon-box[animationsenabled][animate] {
|
||||
transition: margin-left 200ms ease-out, margin-right 200ms ease-out;
|
||||
}
|
||||
|
||||
#tracking-protection-icon-box:not([hasException])[active][animationsenabled] > #tracking-protection-icon,
|
||||
#tracking-protection-icon-box:not([animationsenabled]) > #tracking-protection-icon-animatable-box {
|
||||
#tracking-protection-icon-box:not([animationsenabled]) > #tracking-protection-icon-animatable-box,
|
||||
#tracking-protection-icon-box:not([active]) > #tracking-protection-icon-animatable-box {
|
||||
display: none;
|
||||
}
|
||||
|
||||
|
@ -224,7 +252,7 @@
|
|||
animation-name: tp-icon-animation-rtl;
|
||||
}
|
||||
|
||||
#tracking-protection-icon-box[active] > #tracking-protection-icon {
|
||||
#urlbar[pageproxystate="valid"] > #tracking-protection-icon-container > #tracking-protection-icon-box > #tracking-protection-icon {
|
||||
list-style-image: url(chrome://browser/skin/tracking-protection.svg);
|
||||
}
|
||||
|
||||
|
@ -232,8 +260,7 @@
|
|||
list-style-image: url(chrome://browser/skin/tracking-protection-disabled.svg);
|
||||
}
|
||||
|
||||
#urlbar[pageproxystate="invalid"] > #identity-box > #extension-icon,
|
||||
#urlbar[pageproxystate="invalid"] > #identity-box > #tracking-protection-icon-box {
|
||||
#urlbar[pageproxystate="invalid"] > #tracking-protection-icon-container {
|
||||
visibility: collapse;
|
||||
}
|
||||
|
||||
|
@ -255,42 +282,11 @@
|
|||
}
|
||||
}
|
||||
|
||||
/* CONNECTION ICON, EXTENSION ICON, REMOTE CONTROL ICON */
|
||||
/* REMOTE CONTROL ICON */
|
||||
|
||||
#connection-icon,
|
||||
#extension-icon,
|
||||
#remote-control-icon {
|
||||
visibility: collapse;
|
||||
}
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.verifiedDomain > #connection-icon,
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.verifiedIdentity > #connection-icon,
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.mixedActiveBlocked > #connection-icon {
|
||||
list-style-image: url(chrome://browser/skin/connection-secure.svg);
|
||||
visibility: visible;
|
||||
-moz-context-properties: fill;
|
||||
fill: #12BC00;
|
||||
}
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.weakCipher > #connection-icon,
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.mixedDisplayContent > #connection-icon,
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.mixedDisplayContentLoadedActiveBlocked > #connection-icon,
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.certUserOverridden > #connection-icon {
|
||||
list-style-image: url(chrome://browser/skin/connection-mixed-passive-loaded.svg);
|
||||
visibility: visible;
|
||||
fill: unset;
|
||||
-moz-context-properties: fill, fill-opacity;
|
||||
}
|
||||
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.notSecure > #connection-icon,
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.insecureLoginForms > #connection-icon,
|
||||
#urlbar[pageproxystate="valid"] > #identity-box.mixedActiveContent > #connection-icon {
|
||||
list-style-image: url(chrome://browser/skin/connection-mixed-active-loaded.svg);
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
#identity-box.extensionPage > #extension-icon {
|
||||
list-style-image: url(chrome://mozapps/skin/extensions/extensionGeneric-16.svg);
|
||||
visibility: visible;
|
||||
}
|
||||
|
||||
:root[remotecontrol] #remote-control-icon {
|
||||
list-style-image: url(chrome://browser/content/static-robot.png);
|
||||
|
|
|
@ -1,6 +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/. -->
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16">
|
||||
<path fill="context-fill" fill-opacity="context-fill-opacity" fill-rule="evenodd" d="M13.5 5A2.5 2.5 0 1 1 16 2.5 2.5 2.5 0 0 1 13.5 5zM8 6a1 1 0 1 1 1-1 1 1 0 0 1-1 1zm1 5a1 1 0 0 1-2 0V8a1 1 0 0 1 2 0v3zM8 2a6.08 6.08 0 1 0 5.629 3.987 3.452 3.452 0 0 0 .984-.185A6.9 6.9 0 0 1 15 8a7 7 0 1 1-7-7 6.9 6.9 0 0 1 2.2.387 3.452 3.452 0 0 0-.185.984A5.951 5.951 0 0 0 8 2z"/>
|
||||
</svg>
|
До Ширина: | Высота: | Размер: 679 B |
|
@ -61,7 +61,6 @@
|
|||
skin/classic/browser/connection-mixed-passive-loaded.svg (../shared/identity-block/connection-mixed-passive-loaded.svg)
|
||||
skin/classic/browser/connection-mixed-active-loaded.svg (../shared/identity-block/connection-mixed-active-loaded.svg)
|
||||
skin/classic/browser/identity-icon.svg (../shared/identity-block/identity-icon.svg)
|
||||
skin/classic/browser/identity-icon-notice.svg (../shared/identity-block/identity-icon-notice.svg)
|
||||
skin/classic/browser/info.svg (../shared/info.svg)
|
||||
skin/classic/browser/newInstall.css (../shared/newInstall.css)
|
||||
skin/classic/browser/newInstallPage.css (../shared/newInstallPage.css)
|
||||
|
|
|
@ -316,24 +316,18 @@
|
|||
height: 30px;
|
||||
}
|
||||
|
||||
.urlbar-icon:not([disabled]):hover,
|
||||
:not(.urlbar-icon-wrapper) > .urlbar-icon:not([disabled]):hover,
|
||||
.urlbar-icon-wrapper:not([disabled]):hover {
|
||||
background-color: hsla(0,0%,70%,.2);
|
||||
}
|
||||
|
||||
.urlbar-icon[open],
|
||||
.urlbar-icon-wrapper[open],
|
||||
.urlbar-icon:not([disabled]):hover:active,
|
||||
.urlbar-icon-wrapper:hover:active {
|
||||
:not(.urlbar-icon-wrapper) > .urlbar-icon:not([disabled])[open],
|
||||
:not(.urlbar-icon-wrapper) > .urlbar-icon:not([disabled]):hover:active,
|
||||
.urlbar-icon-wrapper:not([disabled])[open],
|
||||
.urlbar-icon-wrapper:not([disabled]):hover:active {
|
||||
background-color: hsla(0,0%,70%,.3);
|
||||
}
|
||||
|
||||
.urlbar-icon-wrapper[open] > .urlbar-icon,
|
||||
.urlbar-icon-wrapper > .urlbar-icon:hover,
|
||||
.urlbar-icon-wrapper > .urlbar-icon:hover:active {
|
||||
background-color: transparent;
|
||||
}
|
||||
|
||||
.urlbar-icon:-moz-focusring,
|
||||
.urlbar-icon-wrapper:-moz-focusring {
|
||||
outline: var(--toolbarbutton-focus-outline);
|
||||
|
@ -356,15 +350,6 @@
|
|||
transition: opacity 0.15s ease;
|
||||
}
|
||||
|
||||
#urlbar[hidedropmarker] > .urlbar-history-dropmarker {
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Avoid re-opening the popup when the dropmarker is clicked while the popup is still open. */
|
||||
#urlbar[quantumbar="false"] > .urlbar-history-dropmarker[open] {
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
#urlbar[switchingtabs] > .urlbar-history-dropmarker {
|
||||
transition: none;
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ buildscript {
|
|||
}
|
||||
|
||||
dependencies {
|
||||
classpath 'org.mozilla.apilint:apilint:0.2.1'
|
||||
classpath 'org.mozilla.apilint:apilint:0.2.2'
|
||||
classpath 'com.android.tools.build:gradle:3.1.4'
|
||||
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.8.2'
|
||||
classpath 'org.apache.commons:commons-exec:1.3'
|
||||
|
|
|
@ -244,6 +244,7 @@ $(RUST_LIBRARY_FILE): force-cargo-library-build
|
|||
# When we are building in --enable-release mode; we add an additional check to confirm
|
||||
# that we are not importing any networking-related functions in rust code. This reduces
|
||||
# the chance of proxy bypasses originating from rust code.
|
||||
ifndef MOZ_PROFILE_GENERATE
|
||||
ifndef DEVELOPER_OPTIONS
|
||||
ifndef MOZ_DEBUG_RUST
|
||||
ifeq ($(OS_ARCH), Linux)
|
||||
|
@ -251,6 +252,7 @@ ifeq ($(OS_ARCH), Linux)
|
|||
endif
|
||||
endif
|
||||
endif
|
||||
endif
|
||||
|
||||
force-cargo-library-check:
|
||||
$(call CARGO_CHECK) --lib $(cargo_target_flag) $(rust_features_flag)
|
||||
|
|
|
@ -58,6 +58,8 @@ class Worker extends Component {
|
|||
active: PropTypes.bool,
|
||||
name: PropTypes.string.isRequired,
|
||||
scope: PropTypes.string.isRequired,
|
||||
lastUpdateTime: PropTypes.number.isRequired,
|
||||
url: PropTypes.string.isRequired,
|
||||
// registrationFront can be missing in e10s.
|
||||
registrationFront: PropTypes.object,
|
||||
workerTargetFront: PropTypes.object,
|
||||
|
|
|
@ -22,7 +22,23 @@ function transform(filePath) {
|
|||
: defaultPlugins;
|
||||
|
||||
const doc = fs.readFileSync(filePath, "utf8");
|
||||
const out = Babel.transform(doc, { plugins });
|
||||
|
||||
let out;
|
||||
try {
|
||||
out = Babel.transform(doc, { plugins });
|
||||
} catch (err) {
|
||||
throw new Error(`
|
||||
========================
|
||||
NODE COMPILATION ERROR!
|
||||
|
||||
File: ${filePath}
|
||||
Stack:
|
||||
|
||||
${err.stack}
|
||||
|
||||
========================
|
||||
`);
|
||||
}
|
||||
|
||||
return out.code;
|
||||
}
|
||||
|
|
|
@ -42,6 +42,7 @@ class ListItemClass extends Component {
|
|||
current: PropTypes.bool,
|
||||
onClick: PropTypes.func,
|
||||
item: PropTypes.shape({
|
||||
key: PropTypes.string,
|
||||
component: PropTypes.object,
|
||||
componentProps: PropTypes.object,
|
||||
className: PropTypes.string,
|
||||
|
|
|
@ -59,6 +59,7 @@ define(function(require, exports, module) {
|
|||
hidden: PropTypes.bool,
|
||||
selected: PropTypes.bool,
|
||||
active: PropTypes.bool,
|
||||
loading: PropTypes.bool,
|
||||
}),
|
||||
decorator: PropTypes.object,
|
||||
renderCell: PropTypes.object,
|
||||
|
|
|
@ -98,6 +98,7 @@ define(function(require, exports, module) {
|
|||
getLabel: PropTypes.func,
|
||||
getValue: PropTypes.func,
|
||||
getKey: PropTypes.func,
|
||||
getLevel: PropTypes.func,
|
||||
getType: PropTypes.func,
|
||||
}).isRequired,
|
||||
// Tree decorator (see also the interface above)
|
||||
|
|
|
@ -23,6 +23,8 @@ function CollapseButton(props) {
|
|||
// prevent focus from moving to the disclosure if clicked,
|
||||
// which is annoying if on the input
|
||||
e.preventDefault();
|
||||
// Clearing the text selection to allow the message to collpase.
|
||||
e.target.ownerDocument.defaultView.getSelection().removeAllRanges();
|
||||
},
|
||||
title: title,
|
||||
});
|
||||
|
|
|
@ -82,12 +82,16 @@ class Message extends Component {
|
|||
timestampsVisible: PropTypes.bool.isRequired,
|
||||
serviceContainer: PropTypes.shape({
|
||||
emitNewMessage: PropTypes.func.isRequired,
|
||||
onViewSource: PropTypes.func.isRequired,
|
||||
onViewSourceInDebugger: PropTypes.func,
|
||||
onViewSourceInScratchpad: PropTypes.func,
|
||||
onViewSourceInStyleEditor: PropTypes.func,
|
||||
openContextMenu: PropTypes.func.isRequired,
|
||||
openLink: PropTypes.func.isRequired,
|
||||
sourceMapService: PropTypes.any,
|
||||
canRewind: PropTypes.func.isRequired,
|
||||
jumpToExecutionPoint: PropTypes.func.isRequired,
|
||||
onMessageHover: PropTypes.func.isRequired,
|
||||
}),
|
||||
notes: PropTypes.arrayOf(
|
||||
PropTypes.shape({
|
||||
|
@ -148,6 +152,13 @@ class Message extends Component {
|
|||
e.stopPropagation();
|
||||
const { open, dispatch, messageId, onToggle } = this.props;
|
||||
|
||||
// Early exit the function to avoid the message to collapse if the user is
|
||||
// selecting a range in the toggle message.
|
||||
const window = e.target.ownerDocument.defaultView;
|
||||
if (window.getSelection && window.getSelection().type === "Range") {
|
||||
return;
|
||||
}
|
||||
|
||||
// If defined on props, we let the onToggle() method handle the toggling,
|
||||
// otherwise we toggle the message open/closed ourselves.
|
||||
if (onToggle) {
|
||||
|
|
|
@ -105,6 +105,7 @@ support-files =
|
|||
test-message-categories-workers.html
|
||||
test-message-categories-workers.js
|
||||
test-mixedcontent-securityerrors.html
|
||||
test-navigate-to-parse-error.html
|
||||
test-network-exceptions.html
|
||||
test-network-request.html
|
||||
test-network.html
|
||||
|
@ -351,6 +352,7 @@ skip-if = fission
|
|||
[browser_webconsole_message_categories.js]
|
||||
skip-if = fission
|
||||
[browser_webconsole_multiple_windows_and_tabs.js]
|
||||
[browser_webconsole_navigate_to_parse_error.js]
|
||||
[browser_webconsole_network_attach.js]
|
||||
[browser_webconsole_network_exceptions.js]
|
||||
skip-if = fission
|
||||
|
|
|
@ -0,0 +1,29 @@
|
|||
/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */
|
||||
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
|
||||
/* Any copyright is dedicated to the Public Domain.
|
||||
* http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// Tests that ensure CSP 'navigate-to' does not parse.
|
||||
// Bug 1566149
|
||||
|
||||
"use strict";
|
||||
|
||||
const TEST_URI =
|
||||
"data:text/html;charset=utf8,Web Console navigate-to parse error test";
|
||||
const TEST_VIOLATION =
|
||||
"https://example.com/browser/devtools/client/webconsole/" +
|
||||
"test/mochitest/test-navigate-to-parse-error.html";
|
||||
|
||||
const CSP_VIOLATION_MSG =
|
||||
"Content Security Policy: Couldn\u2019t process unknown directive \u2018navigate-to\u2019";
|
||||
|
||||
add_task(async function() {
|
||||
const hud = await openNewTabAndConsole(TEST_URI);
|
||||
hud.ui.clearOutput();
|
||||
|
||||
const onRepeatedMessage = waitForRepeatedMessage(hud, CSP_VIOLATION_MSG, 2);
|
||||
await loadDocument(TEST_VIOLATION);
|
||||
await onRepeatedMessage;
|
||||
|
||||
ok(true, "Received expected messages");
|
||||
});
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Security-Policy" content="navigate-to https://example.com"></meta>
|
||||
<meta charset="UTF-8">
|
||||
<title>Test for Bug 1566149 - Write test to ensure CSP 'navigate-to' does not parse</title>
|
||||
<!-- Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ -->
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1566149">Mozilla Bug 1566149</a>
|
||||
</body>
|
||||
</html>
|
|
@ -383,6 +383,10 @@ void BrowsingContext::RestoreChildren(Children&& aChildren, bool aFromIPC) {
|
|||
|
||||
bool BrowsingContext::IsCached() { return mGroup->IsContextCached(this); }
|
||||
|
||||
bool BrowsingContext::IsTargetable() {
|
||||
return !mClosed && !mIsDiscarded && !IsCached();
|
||||
}
|
||||
|
||||
bool BrowsingContext::HasOpener() const {
|
||||
return sBrowsingContexts->Contains(mOpenerId);
|
||||
}
|
||||
|
@ -432,7 +436,7 @@ BrowsingContext* BrowsingContext::FindWithName(const nsAString& aName) {
|
|||
// contexts in the same browsing context group.
|
||||
siblings = &mGroup->Toplevels();
|
||||
} else if (parent->NameEquals(aName) && CanAccess(parent) &&
|
||||
parent->IsActive()) {
|
||||
parent->IsTargetable()) {
|
||||
found = parent;
|
||||
break;
|
||||
} else {
|
||||
|
@ -471,7 +475,7 @@ BrowsingContext* BrowsingContext::FindChildWithName(const nsAString& aName) {
|
|||
}
|
||||
|
||||
for (BrowsingContext* child : mChildren) {
|
||||
if (child->NameEquals(aName) && CanAccess(child) && child->IsActive()) {
|
||||
if (child->NameEquals(aName) && CanAccess(child) && child->IsTargetable()) {
|
||||
return child;
|
||||
}
|
||||
}
|
||||
|
@ -504,7 +508,8 @@ BrowsingContext* BrowsingContext::FindWithNameInSubtree(
|
|||
const nsAString& aName, BrowsingContext* aRequestingContext) {
|
||||
MOZ_DIAGNOSTIC_ASSERT(!aName.IsEmpty());
|
||||
|
||||
if (NameEquals(aName) && aRequestingContext->CanAccess(this) && IsActive()) {
|
||||
if (NameEquals(aName) && aRequestingContext->CanAccess(this) &&
|
||||
IsTargetable()) {
|
||||
return this;
|
||||
}
|
||||
|
||||
|
@ -525,26 +530,6 @@ bool BrowsingContext::CanAccess(BrowsingContext* aContext) {
|
|||
return aContext && nsDocShell::CanAccessItem(aContext->mDocShell, mDocShell);
|
||||
}
|
||||
|
||||
bool BrowsingContext::IsActive() const {
|
||||
// TODO(farre): Mimicking the bahaviour from
|
||||
// ItemIsActive(nsIDocShellTreeItem* aItem) is temporary, we should
|
||||
// implement a replacement for this using mClosed only. See Bug
|
||||
// 1527321.
|
||||
|
||||
if (!mDocShell) {
|
||||
return mClosed;
|
||||
}
|
||||
|
||||
if (nsCOMPtr<nsPIDOMWindowOuter> window = mDocShell->GetWindow()) {
|
||||
auto* win = nsGlobalWindowOuter::Cast(window);
|
||||
if (!win->GetClosedOuter()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
BrowsingContext::~BrowsingContext() {
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mParent || !mParent->mChildren.Contains(this));
|
||||
MOZ_DIAGNOSTIC_ASSERT(!mGroup || !mGroup->Toplevels().Contains(this));
|
||||
|
|
|
@ -172,6 +172,10 @@ class BrowsingContext : public nsWrapperCache, public BrowsingContextBase {
|
|||
// CacheChildren.
|
||||
bool IsCached();
|
||||
|
||||
// Check that this browsing context is targetable for navigations (i.e. that
|
||||
// it is neither closed, cached, nor discarded).
|
||||
bool IsTargetable();
|
||||
|
||||
const nsString& Name() const { return mName; }
|
||||
void GetName(nsAString& aName) { aName = mName; }
|
||||
bool NameEquals(const nsAString& aName) { return mName.Equals(aName); }
|
||||
|
@ -397,8 +401,6 @@ class BrowsingContext : public nsWrapperCache, public BrowsingContextBase {
|
|||
// Performs access control to check that 'this' can access 'aContext'.
|
||||
bool CanAccess(BrowsingContext* aContext);
|
||||
|
||||
bool IsActive() const;
|
||||
|
||||
// Removes the context from its group and sets mIsDetached to true.
|
||||
void Unregister();
|
||||
|
||||
|
|
|
@ -224,6 +224,11 @@ nsresult TabGroup::FindItemWithName(const nsAString& aName,
|
|||
continue;
|
||||
}
|
||||
|
||||
BrowsingContext* bc = outerWindow->GetBrowsingContext();
|
||||
if (!bc || !bc->IsTargetable()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocShellTreeItem> root;
|
||||
docshell->GetSameTypeRootTreeItem(getter_AddRefs(root));
|
||||
MOZ_RELEASE_ASSERT(docshell == root);
|
||||
|
|
|
@ -67,3 +67,7 @@ skip-if = (os == "win" && processor == "aarch64") # aarch64 due to bug 1536566
|
|||
[browser_multiple_popups.js]
|
||||
skip-if = os == 'win' && !debug # Bug 1505235
|
||||
support-files = browser_multiple_popups.html
|
||||
[browser_bug1554070.js]
|
||||
support-files =
|
||||
file_bug1554070_1.html
|
||||
file_bug1554070_2.html
|
||||
|
|
|
@ -0,0 +1,47 @@
|
|||
"use strict";
|
||||
|
||||
const HTTPS_TEST_ROOT = getRootDirectory(gTestPath).replace(
|
||||
"chrome://mochitests/content",
|
||||
"https://example.com"
|
||||
);
|
||||
|
||||
const URL0 = HTTPS_TEST_ROOT + "file_bug1554070_1.html";
|
||||
const URL1 = HTTPS_TEST_ROOT + "file_bug1554070_2.html";
|
||||
const URL2 = "https://example.org/";
|
||||
|
||||
add_task(async function() {
|
||||
let tab = await BrowserTestUtils.openNewForegroundTab({
|
||||
gBrowser,
|
||||
waitForLoad: true,
|
||||
});
|
||||
|
||||
let browser = tab.linkedBrowser;
|
||||
|
||||
function click() {
|
||||
return ContentTask.spawn(browser, null, () => {
|
||||
let anchor = content.document.querySelector("a");
|
||||
anchor.click();
|
||||
});
|
||||
}
|
||||
|
||||
// Load file_bug1554070_1.html.
|
||||
BrowserTestUtils.loadURI(browser, URL0);
|
||||
await BrowserTestUtils.browserLoaded(browser, false, URL0);
|
||||
is(gBrowser.currentURI.spec, URL0, "loaded file_bug1554070_1.html");
|
||||
|
||||
// Click the link in file_bug1554070_1.html. It should open
|
||||
// file_bug1554070_2.html in the current tab.
|
||||
await click();
|
||||
await BrowserTestUtils.browserLoaded(browser, false, URL1);
|
||||
is(gBrowser.currentURI.spec, URL1, "loaded file_bug1554070_2.html");
|
||||
|
||||
// Click the link in file_bug1554070_2.html. It should open example.org in
|
||||
// a new tab.
|
||||
await click();
|
||||
await BrowserTestUtils.waitForNewTab(gBrowser, URL2, true);
|
||||
is(gBrowser.tabs.length, 3, "got new tab");
|
||||
is(gBrowser.currentURI.spec, URL2, "loaded example.org");
|
||||
|
||||
BrowserTestUtils.removeTab(gBrowser.selectedTab);
|
||||
BrowserTestUtils.removeTab(tab);
|
||||
});
|
|
@ -0,0 +1,14 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1554070
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1554070</title>
|
||||
</head>
|
||||
<body>
|
||||
<iframe name="foo"></iframe>
|
||||
<a href="file_bug1554070_2.html">file_bug1554070_2.html</a>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,13 @@
|
|||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=1554070
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 1554070</title>
|
||||
</head>
|
||||
<body>
|
||||
<a href="https://example.org" target="foo">example.org</a>
|
||||
</body>
|
||||
</html>
|
|
@ -1347,6 +1347,12 @@ void MediaStreamGraphImpl::Process() {
|
|||
|
||||
bool MediaStreamGraphImpl::UpdateMainThreadState() {
|
||||
MOZ_ASSERT(OnGraphThread());
|
||||
if (mForceShutDown) {
|
||||
for (MediaStream* stream : AllStreams()) {
|
||||
stream->NotifyForcedShutdown();
|
||||
}
|
||||
}
|
||||
|
||||
MonitorAutoLock lock(mMonitor);
|
||||
bool finalUpdate =
|
||||
mForceShutDown || (IsEmpty() && mBackMessageQueue.IsEmpty());
|
||||
|
|
|
@ -511,6 +511,10 @@ class MediaStream : public mozilla::LinkedListElement<MediaStream> {
|
|||
void DecrementSuspendCount();
|
||||
|
||||
protected:
|
||||
// Called on graph thread before handing control to the main thread to
|
||||
// release streams.
|
||||
virtual void NotifyForcedShutdown() {}
|
||||
|
||||
// |AdvanceTimeVaryingValuesToCurrentTime| will be override in
|
||||
// SourceMediaStream.
|
||||
virtual void AdvanceTimeVaryingValuesToCurrentTime(GraphTime aCurrentTime,
|
||||
|
|
|
@ -446,6 +446,7 @@ class RTCPeerConnection {
|
|||
// canTrickle == null means unknown; when a remote description is received it
|
||||
// is set to true or false based on the presence of the "trickle" ice-option
|
||||
this._canTrickle = null;
|
||||
this._localUfragsToReplace = new Set();
|
||||
|
||||
// So we can record telemetry on state transitions
|
||||
this._iceConnectionState = "new";
|
||||
|
@ -936,12 +937,13 @@ class RTCPeerConnection {
|
|||
} else {
|
||||
options = optionsOrOnSucc;
|
||||
}
|
||||
|
||||
if (this._localUfragsToReplace.size > 0) {
|
||||
options.iceRestart = true;
|
||||
}
|
||||
// This entry-point handles both new and legacy call sig. Decipher which one
|
||||
if (onSuccess) {
|
||||
return this._legacy(onSuccess, onErr, () => this._createOffer(options));
|
||||
}
|
||||
|
||||
return this._async(() => this._createOffer(options));
|
||||
}
|
||||
|
||||
|
@ -1136,6 +1138,12 @@ class RTCPeerConnection {
|
|||
if (type == "answer") {
|
||||
this._currentRole = "answerer";
|
||||
this._pendingRole = null;
|
||||
if (this._localUfragsToReplace.size > 0) {
|
||||
const ufrags = new Set(this._getUfragsWithPwds(sdp));
|
||||
if (![...this._localUfragsToReplace].some(uf => ufrags.has(uf))) {
|
||||
this._localUfragsToReplace.clear();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this._pendingRole = "offerer";
|
||||
}
|
||||
|
@ -1235,6 +1243,14 @@ class RTCPeerConnection {
|
|||
if (type == "answer") {
|
||||
this._currentRole = "offerer";
|
||||
this._pendingRole = null;
|
||||
if (this._localUfragsToReplace.size > 0) {
|
||||
const ufrags = new Set(
|
||||
this._getUfragsWithPwds(this._impl.currentLocalDescription)
|
||||
);
|
||||
if (![...this._localUfragsToReplace].some(uf => ufrags.has(uf))) {
|
||||
this._localUfragsToReplace.clear();
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this._pendingRole = "answerer";
|
||||
}
|
||||
|
@ -1334,6 +1350,32 @@ class RTCPeerConnection {
|
|||
});
|
||||
}
|
||||
|
||||
restartIce() {
|
||||
this._localUfragsToReplace = new Set([
|
||||
...this._getUfragsWithPwds(this._impl.currentLocalDescription),
|
||||
...this._getUfragsWithPwds(this._impl.pendingLocalDescription),
|
||||
]);
|
||||
this.updateNegotiationNeeded();
|
||||
}
|
||||
|
||||
_getUfragsWithPwds(sdp) {
|
||||
return (
|
||||
sdp
|
||||
.split("\r\nm=")
|
||||
.map(block => block.split("\r\n"))
|
||||
.map(lines => [
|
||||
lines.find(l => l.startsWith("a=ice-ufrag:")),
|
||||
lines.find(l => l.startsWith("a=ice-pwd:")),
|
||||
])
|
||||
// Even though our own SDP doesn't currently do this: JSEP says properties
|
||||
// found in the session (array[0]) apply to all m-lines that don't specify
|
||||
// them, like default values.
|
||||
.map(([a, b], i, array) => [a || array[0][0], b || array[0][1]])
|
||||
.filter(([a, b]) => a && b)
|
||||
.map(array => array.join())
|
||||
);
|
||||
}
|
||||
|
||||
addStream(stream) {
|
||||
stream.getTracks().forEach(track => this.addTrack(track, stream));
|
||||
}
|
||||
|
@ -1500,7 +1542,9 @@ class RTCPeerConnection {
|
|||
return;
|
||||
}
|
||||
|
||||
let negotiationNeeded = this._impl.checkNegotiationNeeded();
|
||||
let negotiationNeeded =
|
||||
this._impl.checkNegotiationNeeded() ||
|
||||
this._localUfragsToReplace.size > 0;
|
||||
if (!negotiationNeeded) {
|
||||
this._negotiationNeeded = false;
|
||||
return;
|
||||
|
|
|
@ -35,11 +35,15 @@ class KnowsCompositorVideo : public layers::KnowsCompositor {
|
|||
public:
|
||||
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(KnowsCompositorVideo, override)
|
||||
|
||||
layers::TextureForwarder* GetTextureForwarder() override {
|
||||
VideoBridgeChild* GetVideoBridge() {
|
||||
return mTextureFactoryIdentifier.mParentProcessType == GeckoProcessType_GPU
|
||||
? VideoBridgeChild::GetSingletonToGPUProcess()
|
||||
: VideoBridgeChild::GetSingletonToParentProcess();
|
||||
}
|
||||
|
||||
layers::TextureForwarder* GetTextureForwarder() override {
|
||||
return GetVideoBridge();
|
||||
}
|
||||
layers::LayersIPCActor* GetLayersIPCActor() override {
|
||||
return GetTextureForwarder();
|
||||
}
|
||||
|
@ -405,7 +409,18 @@ MediaResult RemoteVideoDecoderParent::ProcessDecodedData(
|
|||
MediaDataIPDL(data->mOffset, data->mTime, data->mTimecode,
|
||||
data->mDuration, data->mKeyframe),
|
||||
video->mDisplay, size, sd, video->mFrameID);
|
||||
Unused << SendOutput(output);
|
||||
if (mKnowsCompositor) {
|
||||
RefPtr<RemoteVideoDecoderParent> parent = this;
|
||||
mKnowsCompositor->GetVideoBridge()->SendFlush()->Then(
|
||||
GetCurrentThreadSerialEventTarget(), __func__,
|
||||
[parent, output](bool) { Unused << parent->SendOutput(output); },
|
||||
[parent](ResponseRejectReason&& aReason) {
|
||||
parent->Error(NS_ERROR_DOM_MEDIA_NEED_NEW_DECODER);
|
||||
});
|
||||
|
||||
} else {
|
||||
Unused << SendOutput(output);
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
|
|
@ -588,7 +588,7 @@ MediaResult WMFVideoMFTManager::InitInternal() {
|
|||
WMFDecoderModule::GetNumDecoderThreads());
|
||||
bool lowLatency =
|
||||
(StaticPrefs::media_wmf_low_latency_enabled() || IsWin10OrLater()) &&
|
||||
!StaticPrefs::media_mwf_low_latency_force_disabled();
|
||||
!StaticPrefs::media_wmf_low_latency_force_disabled();
|
||||
if (mLowLatency || lowLatency) {
|
||||
hr = attr->SetUINT32(CODECAPI_AVLowLatencyMode, TRUE);
|
||||
if (SUCCEEDED(hr)) {
|
||||
|
|
|
@ -382,8 +382,8 @@ void AudioNodeEngine::ProcessBlock(AudioNodeStream* aStream, GraphTime aFrom,
|
|||
}
|
||||
|
||||
void AudioNodeEngine::ProcessBlocksOnPorts(AudioNodeStream* aStream,
|
||||
const OutputChunks& aInput,
|
||||
OutputChunks& aOutput,
|
||||
Span<const AudioBlock> aInput,
|
||||
Span<AudioBlock> aOutput,
|
||||
bool* aFinished) {
|
||||
MOZ_ASSERT(mInputCount > 1 || mOutputCount > 1);
|
||||
// Only produce one output port, and drop all other input ports.
|
||||
|
|
|
@ -324,8 +324,8 @@ class AudioNodeEngine {
|
|||
* of silence.
|
||||
*/
|
||||
virtual void ProcessBlocksOnPorts(AudioNodeStream* aStream,
|
||||
const OutputChunks& aInput,
|
||||
OutputChunks& aOutput, bool* aFinished);
|
||||
Span<const AudioBlock> aInput,
|
||||
Span<AudioBlock> aOutput, bool* aFinished);
|
||||
|
||||
// IsActive() returns true if the engine needs to continue processing an
|
||||
// unfinished stream even when it has silent or no input connections. This
|
||||
|
@ -333,6 +333,10 @@ class AudioNodeEngine {
|
|||
// returning false, then the stream can be suspended.
|
||||
virtual bool IsActive() const { return false; }
|
||||
|
||||
// Called on forced shutdown of the MediaStreamGraph before handing ownership
|
||||
// from graph thread to main thread.
|
||||
virtual void NotifyForcedShutdown() {}
|
||||
|
||||
bool HasNode() const {
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
return !!mNode;
|
||||
|
|
|
@ -52,6 +52,10 @@ AudioNodeStream::~AudioNodeStream() {
|
|||
MOZ_COUNT_DTOR(AudioNodeStream);
|
||||
}
|
||||
|
||||
void AudioNodeStream::NotifyForcedShutdown() {
|
||||
mEngine->NotifyForcedShutdown();
|
||||
}
|
||||
|
||||
void AudioNodeStream::DestroyImpl() {
|
||||
// These are graph thread objects, so clean up on graph thread.
|
||||
mInputChunks.Clear();
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче