Merge m-c to m-i

MozReview-Commit-ID: FArqhSVQLaT
This commit is contained in:
Phil Ringnalda 2016-12-15 17:53:14 -08:00
commit e3ceaf61be
49 changed files with 14107 additions and 14032 deletions

View File

@ -834,7 +834,6 @@ var BookmarksEventHandler = {
if (node.localName == "menupopup")
node.hidePopup();
else if (node.localName != "menu" &&
node.localName != "splitmenu" &&
node.localName != "hbox" &&
node.localName != "vbox" )
break;

View File

@ -434,13 +434,7 @@ toolbar:not(#TabsToolbar) > #personal-bookmarks {
background-position: bottom left;
}
.menuitem-tooltip {
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#menuitem-tooltip");
}
.menuitem-iconic-tooltip,
.menuitem-tooltip[type="checkbox"],
.menuitem-tooltip[type="radio"] {
.menuitem-iconic-tooltip {
-moz-binding: url("chrome://browser/content/urlbarBindings.xml#menuitem-iconic-tooltip");
}

View File

@ -2528,131 +2528,7 @@ file, You can obtain one at http://mozilla.org/MPL/2.0/.
</handlers>
</binding>
<binding id="splitmenu">
<content>
<xul:hbox anonid="menuitem" flex="1"
class="splitmenu-menuitem"
xbl:inherits="iconic,label,disabled,onclick=oncommand,_moz-menuactive=active"/>
<xul:menu anonid="menu" class="splitmenu-menu"
xbl:inherits="disabled,_moz-menuactive=active"
oncommand="event.stopPropagation();">
<children includes="menupopup"/>
</xul:menu>
</content>
<implementation implements="nsIDOMEventListener">
<constructor><![CDATA[
this._parentMenupopup.addEventListener("DOMMenuItemActive", this, false);
this._parentMenupopup.addEventListener("popuphidden", this, false);
]]></constructor>
<destructor><![CDATA[
this._parentMenupopup.removeEventListener("DOMMenuItemActive", this, false);
this._parentMenupopup.removeEventListener("popuphidden", this, false);
]]></destructor>
<field name="menuitem" readonly="true">
document.getAnonymousElementByAttribute(this, "anonid", "menuitem");
</field>
<field name="menu" readonly="true">
document.getAnonymousElementByAttribute(this, "anonid", "menu");
</field>
<field name="_menuDelay">600</field>
<field name="_parentMenupopup"><![CDATA[
this._getParentMenupopup(this);
]]></field>
<method name="_getParentMenupopup">
<parameter name="aNode"/>
<body><![CDATA[
let node = aNode.parentNode;
while (node) {
if (node.localName == "menupopup")
break;
node = node.parentNode;
}
return node;
]]></body>
</method>
<method name="handleEvent">
<parameter name="event"/>
<body><![CDATA[
switch (event.type) {
case "DOMMenuItemActive":
if (this.getAttribute("active") == "true" &&
event.target != this &&
this._getParentMenupopup(event.target) == this._parentMenupopup)
this.removeAttribute("active");
break;
case "popuphidden":
if (event.target == this._parentMenupopup)
this.removeAttribute("active");
break;
}
]]></body>
</method>
</implementation>
<handlers>
<handler event="mouseover"><![CDATA[
if (this.getAttribute("active") != "true") {
this.setAttribute("active", "true");
let menuItemActiveEvent = document.createEvent("Events");
menuItemActiveEvent.initEvent("DOMMenuItemActive", true, false);
this.dispatchEvent(menuItemActiveEvent);
if (this.getAttribute("disabled") != "true") {
let self = this;
setTimeout(function() {
if (self.getAttribute("active") == "true")
self.menu.open = true;
}, this._menuDelay);
}
}
]]></handler>
<handler event="popupshowing"><![CDATA[
if (event.target == this.firstChild &&
this._parentMenupopup._currentPopup)
this._parentMenupopup._currentPopup.hidePopup();
]]></handler>
<handler event="click" phase="capturing"><![CDATA[
if (this.getAttribute("disabled") == "true") {
// Prevent the command from being carried out
event.stopPropagation();
return;
}
let node = event.originalTarget;
while (true) {
if (node == this.menuitem)
break;
if (node == this)
return;
node = node.parentNode;
}
this._parentMenupopup.hidePopup();
]]></handler>
</handlers>
</binding>
<binding id="menuitem-tooltip" extends="chrome://global/content/bindings/menu.xml#menuitem">
<implementation>
<constructor><![CDATA[
this.setAttribute("tooltiptext", this.getAttribute("acceltext"));
// TODO: Simplify this to this.setAttribute("acceltext", "") once bug
// 592424 is fixed
document.getAnonymousElementByAttribute(this, "anonid", "accel").firstChild.setAttribute("value", "");
]]></constructor>
</implementation>
</binding>
<!-- This binding is only retained for add-ons compatibility -->
<binding id="menuitem-iconic-tooltip" extends="chrome://global/content/bindings/menu.xml#menuitem-iconic">
<implementation>
<constructor><![CDATA[

View File

@ -5,6 +5,9 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "OfflineAppCacheHelper",
"resource:///modules/offlineAppCache.jsm");
this.EXPORTED_SYMBOLS = [
"SiteDataManager"
];
@ -62,12 +65,17 @@ this.SiteDataManager = {
this._updateQuota();
this._updateAppCache();
this._updateDiskCache();
Promise.all([this._updateQuotaPromise, this._updateDiskCachePromise])
.then(() => {
Services.obs.notifyObservers(null, "sitedatamanager:sites-updated", null);
});
},
_updateQuota() {
this._quotaUsageRequests = [];
let promises = [];
for (let [key, site] of this._sites) { // eslint-disable-line no-unused-vars
for (let site of this._sites.values()) {
promises.push(new Promise(resolve => {
let callback = {
onUsageResult: function(request) {
@ -96,7 +104,7 @@ this.SiteDataManager = {
_updateAppCache() {
let groups = this._appCache.getGroups();
for (let [key, site] of this._sites) { // eslint-disable-line no-unused-vars
for (let site of this._sites.values()) {
for (let group of groups) {
let uri = Services.io.newURI(group, null, null);
if (site.perm.matchesURI(uri, true)) {
@ -113,7 +121,7 @@ this.SiteDataManager = {
let sites = this._sites;
let visitor = {
onCacheEntryInfo: function(uri, idEnhance, dataSize) {
for (let [key, site] of sites) { // eslint-disable-line no-unused-vars
for (let site of sites.values()) {
if (site.perm.matchesURI(uri, true)) {
site.diskCacheList.push({
dataSize,
@ -138,7 +146,7 @@ this.SiteDataManager = {
return Promise.all([this._updateQuotaPromise, this._updateDiskCachePromise])
.then(() => {
let usage = 0;
for (let [key, site] of this._sites) { // eslint-disable-line no-unused-vars
for (let site of this._sites.values()) {
let cache = null;
for (cache of site.appCacheList) {
usage += cache.usage;
@ -151,4 +159,23 @@ this.SiteDataManager = {
return usage;
});
},
_removePermission(site) {
Services.perms.removePermission(site.perm);
},
_removeQuotaUsage(site) {
this._qms.clearStoragesForPrincipal(site.perm.principal, null, true);
},
removeAll() {
for (let site of this._sites.values()) {
this._removePermission(site);
this._removeQuotaUsage(site);
}
Services.cache2.clear();
Services.cookies.removeAll();
OfflineAppCacheHelper.clear();
this.updateSites();
}
};

View File

@ -56,8 +56,10 @@ var gAdvancedPane = {
this.updateActualAppCacheSize();
if (Services.prefs.getBoolPref("browser.storageManager.enabled")) {
Services.obs.addObserver(this, "sitedatamanager:sites-updated", false);
SiteDataManager.updateSites();
this.updateTotalSiteDataSize();
setEventListener("clearSiteDataButton", "command",
gAdvancedPane.clearSiteData);
}
setEventListener("layers.acceleration.disabled", "change",
@ -479,6 +481,23 @@ var gAdvancedPane = {
this.updateOfflineApps();
},
clearSiteData: function() {
let flags =
Services.prompt.BUTTON_TITLE_IS_STRING * Services.prompt.BUTTON_POS_0 +
Services.prompt.BUTTON_TITLE_CANCEL * Services.prompt.BUTTON_POS_1 +
Services.prompt.BUTTON_POS_0_DEFAULT;
let prefStrBundle = document.getElementById("bundlePreferences");
let title = prefStrBundle.getString("clearSiteDataPromptTitle");
let text = prefStrBundle.getString("clearSiteDataPromptText");
let btn0Label = prefStrBundle.getString("clearSiteDataNow");
let result = Services.prompt.confirmEx(
window, title, text, flags, btn0Label, null, null, null, {});
if (result == 0) {
SiteDataManager.removeAll();
}
},
readOfflineNotify: function()
{
var pref = document.getElementById("browser.offline-apps.notify");
@ -774,6 +793,10 @@ var gAdvancedPane = {
case "nsPref:changed":
this.updateReadPrefs();
break;
case "sitedatamanager:sites-updated":
this.updateTotalSiteDataSize();
break;
}
}
},

View File

@ -335,6 +335,8 @@
<hbox align="center">
<label id="totalSiteDataSize" flex="1"></label>
<button id="clearSiteDataButton" icon="clear"
label="&clearSiteData.label;" accesskey="&clearSiteData.accesskey;"/>
</hbox>
</groupbox>
</tabpanel>

View File

@ -2,7 +2,9 @@
support-files =
head.js
privacypane_tests_perwindow.js
site_data_test.html
[browser_advanced_siteData.js]
[browser_advanced_update.js]
[browser_basic_rebuild_fonts_test.js]
[browser_bug410900.js]

View File

@ -0,0 +1,154 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const { classes: Cc, interfaces: Ci, utils: Cu, results: Cr } = Components;
Cu.import('resource://gre/modules/XPCOMUtils.jsm');
Services.scriptloader.loadSubScript("resource://testing-common/sinon-1.16.1.js");
const TEST_HOST = "example.com";
const TEST_ORIGIN = "http://" + TEST_HOST;
const TEST_BASE_URL = TEST_ORIGIN + "/browser/browser/components/preferences/in-content/tests/";
const { NetUtil } = Cu.import("resource://gre/modules/NetUtil.jsm", {});
const { SiteDataManager } = Cu.import("resource:///modules/SiteDataManager.jsm", {});
const { OfflineAppCacheHelper } = Cu.import("resource:///modules/offlineAppCache.jsm", {});
const mockOfflineAppCacheHelper = {
clear: null,
originalClear: null,
register: function() {
this.originalClear = OfflineAppCacheHelper.clear;
this.clear = sinon.spy();
OfflineAppCacheHelper.clear = this.clear;
},
unregister: function() {
OfflineAppCacheHelper.clear = this.originalClear;
}
};
function addPersistentStoragePerm(origin) {
let uri = NetUtil.newURI(origin);
let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
Services.perms.addFromPrincipal(principal, "persistent-storage", Ci.nsIPermissionManager.ALLOW_ACTION);
}
function getPersistentStoragePermStatus(origin) {
let uri = NetUtil.newURI(origin);
let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
return Services.perms.testExactPermissionFromPrincipal(principal, "persistent-storage");
}
function getQuotaUsage(origin) {
return new Promise(resolve => {
let uri = NetUtil.newURI(origin);
let principal = Services.scriptSecurityManager.createCodebasePrincipal(uri, {});
Services.qms.getUsageForPrincipal(principal, request => resolve(request.usage));
});
}
function getCacheUsage() {
return new Promise(resolve => {
let obs = {
onNetworkCacheDiskConsumption: function(usage) {
resolve(usage);
},
QueryInterface: XPCOMUtils.generateQI([
Components.interfaces.nsICacheStorageConsumptionObserver,
Components.interfaces.nsISupportsWeakReference
]),
};
Services.cache2.asyncGetDiskConsumption(obs);
});
}
function promiseSitesUpdated() {
return TestUtils.topicObserved("sitedatamanager:sites-updated", () => true);
}
function promiseCookiesCleared() {
return TestUtils.topicObserved("cookie-changed", (subj, data) => {
return data === "cleared";
});
}
registerCleanupFunction(function() {
delete window.sinon;
delete window.setImmediate;
delete window.clearImmediate;
mockOfflineAppCacheHelper.unregister();
});
add_task(function* () {
yield SpecialPowers.pushPrefEnv({set: [["browser.storageManager.enabled", true]]});
addPersistentStoragePerm(TEST_ORIGIN);
yield BrowserTestUtils.openNewForegroundTab(gBrowser, TEST_BASE_URL + "site_data_test.html");
yield waitForEvent(gBrowser.selectedBrowser.contentWindow, "test-indexedDB-done");
gBrowser.removeCurrentTab();
yield openPreferencesViaOpenPreferencesAPI("advanced", "networkTab", { leaveOpen: true });
// Test the initial states
let cacheUsage = yield getCacheUsage();
let quotaUsage = yield getQuotaUsage(TEST_ORIGIN);
let totalUsage = yield SiteDataManager.getTotalUsage();
Assert.greater(cacheUsage, 0, "The cache usage should not be 0");
Assert.greater(quotaUsage, 0, "The quota usage should not be 0");
Assert.greater(totalUsage, 0, "The total usage should not be 0");
// Test cancelling "Clear All Data"
// Click "Clear All Data" button and then cancel
let doc = gBrowser.selectedBrowser.contentDocument;
let cancelPromise = promiseAlertDialogOpen("cancel");
let clearBtn = doc.getElementById("clearSiteDataButton");
clearBtn.doCommand();
yield cancelPromise;
// Test the items are not removed
let status = getPersistentStoragePermStatus(TEST_ORIGIN);
is(status, Ci.nsIPermissionManager.ALLOW_ACTION, "Should not remove permission");
cacheUsage = yield getCacheUsage();
quotaUsage = yield getQuotaUsage(TEST_ORIGIN);
totalUsage = yield SiteDataManager.getTotalUsage();
Assert.greater(cacheUsage, 0, "The cache usage should not be 0");
Assert.greater(quotaUsage, 0, "The quota usage should not be 0");
Assert.greater(totalUsage, 0, "The total usage should not be 0");
// Test cancelling "Clear All Data" ends
// Test accepting "Clear All Data"
// Click "Clear All Data" button and then accept
let acceptPromise = promiseAlertDialogOpen("accept");
let updatePromise = promiseSitesUpdated();
let cookiesClearedPromise = promiseCookiesCleared();
mockOfflineAppCacheHelper.register();
clearBtn.doCommand();
yield acceptPromise;
yield updatePromise;
mockOfflineAppCacheHelper.unregister();
// Test all the items are removed
yield cookiesClearedPromise;
ok(mockOfflineAppCacheHelper.clear.calledOnce, "Should clear app cache");
status = getPersistentStoragePermStatus(TEST_ORIGIN);
is(status, Ci.nsIPermissionManager.UNKNOWN_ACTION, "Should remove permission");
cacheUsage = yield getCacheUsage();
quotaUsage = yield getQuotaUsage(TEST_ORIGIN);
totalUsage = yield SiteDataManager.getTotalUsage();
is(cacheUsage, 0, "The cahce usage should be removed");
is(quotaUsage, 0, "The quota usage should be removed");
is(totalUsage, 0, "The total usage should be removed");
// Test accepting "Clear All Data" ends
gBrowser.removeCurrentTab();
});

View File

@ -163,3 +163,21 @@ function waitForCondition(aConditionFn, aMaxTries = 50, aCheckInterval = 100) {
tryAgain();
});
}
function promiseAlertDialogOpen(buttonAction) {
return new Promise(resolve => {
Services.ww.registerNotification(function onOpen(subj, topic, data) {
if (topic == "domwindowopened" && subj instanceof Ci.nsIDOMWindow) {
subj.addEventListener("load", function onLoad() {
subj.removeEventListener("load", onLoad);
if (subj.document.documentURI == "chrome://global/content/commonDialog.xul") {
Services.ww.unregisterNotification(onOpen);
let doc = subj.document.documentElement;
doc.getButton(buttonAction).click();
resolve();
}
});
}
});
});
}

View File

@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="Cache-Control" content="public" />
<meta name="viewport" content="width=device-width, user-scalable=no, initial-scale=1, maximum-scale=1">
<title>Site Data Test</title>
</head>
<body>
<h1>Site Data Test</h1>
<script type="text/javascript">
let request = indexedDB.open("TestDatabase", 1);
request.onupgradeneeded = function(e) {
let db = e.target.result;
db.createObjectStore("TestStore", { keyPath: "id" });
};
request.onsuccess = function(e) {
let db = e.target.result;
let tx = db.transaction("TestStore", "readwrite");
let store = tx.objectStore("TestStore");
store.put({ id: "test_id", description: "Site Data Test"});
window.dispatchEvent(new Event("test-indexedDB-done"));
}
</script>
</body>
</html>

View File

@ -58,7 +58,9 @@
<!ENTITY offlineStorage2.label "Offline Web Content and User Data">
<!-- Site Data section manages sites using Storage API and is under Network -->
<!ENTITY siteData.label "Site Data">
<!ENTITY siteData.label "Site Data">
<!ENTITY clearSiteData.label "Clear All Data">
<!ENTITY clearSiteData.accesskey "l">
<!-- LOCALIZATION NOTE:
The entities limitCacheSizeBefore.label and limitCacheSizeAfter.label appear on a single

View File

@ -170,6 +170,9 @@ actualAppCacheSize=Your application cache is currently using %1$S %2$S of disk s
# %1$S = size
# %2$S = unit (MB, KB, etc.)
totalSiteDataSize=Your stored site data is currently using %1$S %2$S of disk space
clearSiteDataPromptTitle=Clear all cookies and site data
clearSiteDataPromptText=Selecting Clear Now will clear all cookies and site data stored by Firefox. This may sign you out of websites and remove offline web content.
clearSiteDataNow=Clear Now
syncUnlink.title=Do you want to unlink your device?
syncUnlink.label=This device will no longer be associated with your Sync account. All of your personal data, both on this device and in your Sync account, will remain intact.

View File

@ -20,7 +20,6 @@ const {scrollIntoViewIfNeeded} = require("devtools/client/shared/scroll");
const {UndoStack} = require("devtools/client/shared/undo");
const {HTMLTooltip} = require("devtools/client/shared/widgets/tooltip/HTMLTooltip");
const {PrefObserver} = require("devtools/client/shared/prefs");
const HTMLEditor = require("devtools/client/inspector/markup/views/html-editor");
const MarkupElementContainer = require("devtools/client/inspector/markup/views/element-container");
const MarkupReadOnlyContainer = require("devtools/client/inspector/markup/views/read-only-container");
const MarkupTextContainer = require("devtools/client/inspector/markup/views/text-container");
@ -71,7 +70,6 @@ function MarkupView(inspector, frame, controllerWindow) {
this.win = this._frame.contentWindow;
this.doc = this._frame.contentDocument;
this._elt = this.doc.querySelector("#root");
this.htmlEditor = new HTMLEditor(this.doc);
try {
this.maxChildren = Services.prefs.getIntPref("devtools.markup.pagesize");
@ -569,7 +567,9 @@ MarkupView.prototype = {
_onNewSelection: function () {
let selection = this.inspector.selection;
this.htmlEditor.hide();
if (this.htmlEditor) {
this.htmlEditor.hide();
}
if (this._hoveredNode && this._hoveredNode !== selection.nodeFront) {
this.getContainer(this._hoveredNode).hovered = false;
this._hoveredNode = null;
@ -1044,7 +1044,9 @@ MarkupView.prototype = {
// Since the htmlEditor is absolutely positioned, a mutation may change
// the location in which it should be shown.
this.htmlEditor.refresh();
if (this.htmlEditor) {
this.htmlEditor.refresh();
}
});
},
@ -1414,6 +1416,11 @@ MarkupView.prototype = {
if (!container) {
return;
}
// Load load and create HTML Editor as it is rarely used and fetch complex deps
if (!this.htmlEditor) {
let HTMLEditor = require("devtools/client/inspector/markup/views/html-editor");
this.htmlEditor = new HTMLEditor(this.doc);
}
this.htmlEditor.show(container.tagLine, oldValue);
this.htmlEditor.once("popuphidden", (e, commit, value) => {
// Need to focus the <html> element instead of the frame / window
@ -1424,6 +1431,8 @@ MarkupView.prototype = {
this.updateNodeOuterHTML(node, value, oldValue);
}
});
this.emit("begin-editing");
});
},
@ -1724,8 +1733,10 @@ MarkupView.prototype = {
this._hoveredNode = null;
this.htmlEditor.destroy();
this.htmlEditor = null;
if (this.htmlEditor) {
this.htmlEditor.destroy();
this.htmlEditor = null;
}
this.undo.destroy();
this.undo = null;

View File

@ -47,9 +47,9 @@ add_task(function* () {
function* testEscapeCancels(inspector, testActor) {
yield selectNode(SELECTOR, inspector);
let onEditorShown = once(inspector.markup.htmlEditor, "popupshown");
let onHtmlEditorCreated = once(inspector.markup, "begin-editing");
EventUtils.sendKey("F2", inspector.markup._frame.contentWindow);
yield onEditorShown;
yield onHtmlEditorCreated;
ok(inspector.markup.htmlEditor._visible, "HTML Editor is visible");
is((yield testActor.getProperty(SELECTOR, "outerHTML")), OLD_HTML,

View File

@ -24,12 +24,12 @@ const {
getFormDataSections,
getUrlBaseName,
getUrlQuery,
getUrlHost,
parseQueryString,
} = require("./request-utils");
const { createFactory } = require("devtools/client/shared/vendor/react");
const ReactDOM = require("devtools/client/shared/vendor/react-dom");
const Provider = createFactory(require("devtools/client/shared/vendor/react-redux").Provider);
const SecurityPanel = createFactory(require("./shared/components/security-panel"));
const TimingsPanel = createFactory(require("./shared/components/timings-panel"));
// 100 KB in bytes
@ -93,6 +93,13 @@ DetailsView.prototype = {
initialize: function (store) {
dumpn("Initializing the DetailsView");
this._securityPanelNode = $("#react-security-tabpanel-hook");
ReactDOM.render(Provider(
{ store },
SecurityPanel()
), this._securityPanelNode);
this._timingsPanelNode = $("#react-timings-tabpanel-hook");
ReactDOM.render(Provider(
@ -145,6 +152,7 @@ DetailsView.prototype = {
*/
destroy: function () {
dumpn("Destroying the DetailsView");
ReactDOM.unmountComponentAtNode(this._securityPanelNode);
ReactDOM.unmountComponentAtNode(this._timingsPanelNode);
this.sidebar.destroy();
$("tabpanels", this.widget).removeEventListener("select",
@ -255,10 +263,6 @@ DetailsView.prototype = {
case 3:
yield view._setResponseBody(src.url, src.responseContent);
break;
// "Security"
case 5:
yield view._setSecurityInfo(src.securityInfo, src.url);
break;
// "Preview"
case 6:
yield view._setHtmlPreview(src.responseContent);
@ -717,112 +721,6 @@ DetailsView.prototype = {
return undefined;
}),
/**
* Sets the security information shown in this view.
*
* @param object securityInfo
* The data received from server
* @param string url
* The URL of this request
* @return object
* A promise that is resolved when the security info is rendered.
*/
_setSecurityInfo: Task.async(function* (securityInfo, url) {
if (!securityInfo) {
// We don't have security info. This could mean one of two things:
// 1) This connection is not secure and this tab is not visible and thus
// we shouldn't be here.
// 2) We have already received securityState and the tab is visible BUT
// the rest of the information is still on its way. Once it arrives
// this method is called again.
return;
}
/**
* A helper that sets value and tooltiptext attributes of an element to
* specified value.
*
* @param string selector
* A selector for the element.
* @param string value
* The value to set. If this evaluates to false a placeholder string
* <Not Available> is used instead.
*/
function setValue(selector, value) {
let label = $(selector);
if (!value) {
label.setAttribute("value", L10N.getStr(
"netmonitor.security.notAvailable"));
label.setAttribute("tooltiptext", label.getAttribute("value"));
} else {
label.setAttribute("value", value);
label.setAttribute("tooltiptext", value);
}
}
let errorbox = $("#security-error");
let infobox = $("#security-information");
if (securityInfo.state === "secure" || securityInfo.state === "weak") {
infobox.hidden = false;
errorbox.hidden = true;
// Warning icons
let cipher = $("#security-warning-cipher");
if (securityInfo.state === "weak") {
cipher.hidden = securityInfo.weaknessReasons.indexOf("cipher") === -1;
} else {
cipher.hidden = true;
}
let enabledLabel = L10N.getStr("netmonitor.security.enabled");
let disabledLabel = L10N.getStr("netmonitor.security.disabled");
// Connection parameters
setValue("#security-protocol-version-value",
securityInfo.protocolVersion);
setValue("#security-ciphersuite-value", securityInfo.cipherSuite);
// Host header
let domain = getUrlHost(url);
let hostHeader = L10N.getFormatStr("netmonitor.security.hostHeader",
domain);
setValue("#security-info-host-header", hostHeader);
// Parameters related to the domain
setValue("#security-http-strict-transport-security-value",
securityInfo.hsts ? enabledLabel : disabledLabel);
setValue("#security-public-key-pinning-value",
securityInfo.hpkp ? enabledLabel : disabledLabel);
// Certificate parameters
let cert = securityInfo.cert;
setValue("#security-cert-subject-cn", cert.subject.commonName);
setValue("#security-cert-subject-o", cert.subject.organization);
setValue("#security-cert-subject-ou", cert.subject.organizationalUnit);
setValue("#security-cert-issuer-cn", cert.issuer.commonName);
setValue("#security-cert-issuer-o", cert.issuer.organization);
setValue("#security-cert-issuer-ou", cert.issuer.organizationalUnit);
setValue("#security-cert-validity-begins", cert.validity.start);
setValue("#security-cert-validity-expires", cert.validity.end);
setValue("#security-cert-sha1-fingerprint", cert.fingerprint.sha1);
setValue("#security-cert-sha256-fingerprint", cert.fingerprint.sha256);
} else {
infobox.hidden = true;
errorbox.hidden = false;
// Strip any HTML from the message.
let plain = new DOMParser().parseFromString(securityInfo.errorMessage,
"text/html");
setValue("#security-error-message", plain.body.textContent);
}
}),
_dataSrc: null,
_headers: null,
_cookies: null,

View File

@ -267,204 +267,8 @@
</tabpanel>
<tabpanel id="security-tabpanel"
class="tabpanel-content">
<vbox id="security-error"
class="tabpanel-summary-container"
flex="1">
<label class="plain tabpanel-summary-label"
data-localization="content=netmonitor.security.error"/>
<hbox class="security-info-section"
flex="1">
<textbox id="security-error-message"
class="plain"
flex="1"
multiline="true"
readonly="true"/>
</hbox>
</vbox>
<vbox id="security-information"
flex="1">
<vbox id="security-info-connection"
class="tabpanel-summary-container">
<label class="plain tabpanel-summary-label"
data-localization="content=netmonitor.security.connection"/>
<vbox class="security-info-section">
<hbox id="security-protocol-version"
class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
data-localization="content=netmonitor.security.protocolVersion"/>
<textbox id="security-protocol-version-value"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
<hbox id="security-ciphersuite"
class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
data-localization="content=netmonitor.security.cipherSuite"/>
<textbox id="security-ciphersuite-value"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
<image class="security-warning-icon"
id="security-warning-cipher"
data-localization="tooltiptext=netmonitor.security.warning.cipher" />
</hbox>
</vbox>
</vbox>
<vbox id="security-info-domain"
class="tabpanel-summary-container">
<label class="plain tabpanel-summary-label"
id="security-info-host-header"/>
<vbox class="security-info-section">
<hbox id="security-http-strict-transport-security"
class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
data-localization="content=netmonitor.security.hsts"/>
<textbox id="security-http-strict-transport-security-value"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
<hbox id="security-public-key-pinning"
class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
data-localization="content=netmonitor.security.hpkp"/>
<textbox id="security-public-key-pinning-value"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
</vbox>
</vbox>
<vbox id="security-info-certificate"
class="tabpanel-summary-container">
<label class="plain tabpanel-summary-label"
data-localization="content=netmonitor.security.certificate"/>
<vbox class="security-info-section">
<vbox class="tabpanel-summary-container">
<label class="plain tabpanel-summary-label"
data-localization="content=certmgr.subjectinfo.label" flex="1"/>
</vbox>
<vbox class="security-info-section">
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
data-localization="content=certmgr.certdetail.cn"/>
<textbox id="security-cert-subject-cn"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
data-localization="content=certmgr.certdetail.o"/>
<textbox id="security-cert-subject-o"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
data-localization="content=certmgr.certdetail.ou"/>
<textbox id="security-cert-subject-ou"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
</vbox>
<vbox class="tabpanel-summary-container">
<label class="plain tabpanel-summary-label"
data-localization="content=certmgr.issuerinfo.label"
flex="1"/>
</vbox>
<vbox class="security-info-section">
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
data-localization="content=certmgr.certdetail.cn"/>
<textbox id="security-cert-issuer-cn"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
data-localization="content=certmgr.certdetail.o"/>
<textbox id="security-cert-issuer-o"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
data-localization="content=certmgr.certdetail.ou"/>
<textbox id="security-cert-issuer-ou"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
</vbox>
<vbox class="tabpanel-summary-container">
<label class="plain tabpanel-summary-label"
data-localization="content=certmgr.periodofvalidity.label"
flex="1"/>
</vbox>
<vbox class="security-info-section">
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
data-localization="content=certmgr.begins"/>
<textbox id="security-cert-validity-begins"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
data-localization="content=certmgr.expires"/>
<textbox id="security-cert-validity-expires"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
</vbox>
<vbox class="tabpanel-summary-container">
<label class="plain tabpanel-summary-label"
data-localization="content=certmgr.fingerprints.label"
flex="1"/>
</vbox>
<vbox class="security-info-section">
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
data-localization="content=certmgr.certdetail.sha256fingerprint"/>
<textbox id="security-cert-sha256-fingerprint"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
<hbox class="tabpanel-summary-container"
align="baseline">
<label class="plain tabpanel-summary-label"
data-localization="content=certmgr.certdetail.sha1fingerprint"/>
<textbox id="security-cert-sha1-fingerprint"
class="plain tabpanel-summary-value devtools-monospace cropped-textbox"
flex="1"
readonly="true"/>
</hbox>
</vbox>
</vbox>
</vbox>
</vbox>
<html:div xmlns="http://www.w3.org/1999/xhtml"
id="react-security-tabpanel-hook"/>
</tabpanel>
<tabpanel id="preview-tabpanel"
class="tabpanel-content">

View File

@ -3,5 +3,6 @@
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
DevToolsModules(
'security-panel.js',
'timings-panel.js',
)

View File

@ -0,0 +1,176 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { DOM, PropTypes, createFactory } = require("devtools/client/shared/vendor/react");
const { connect } = require("devtools/client/shared/vendor/react-redux");
const TreeView = createFactory(require("devtools/client/shared/components/tree/tree-view"));
const { L10N } = require("../../l10n");
const { getUrlHost } = require("../../request-utils");
const { getSelectedRequest } = require("../../selectors/index");
const { div, input } = DOM;
/*
* Security panel component
* If the site is being served over HTTPS, you get an extra tab labeled "Security".
* This contains details about the secure connection used including the protocol,
* the cipher suite, and certificate details
*/
function SecurityPanel({
securityInfo,
url,
}) {
if (!securityInfo || !url) {
return div();
}
const notAvailable = L10N.getStr("netmonitor.security.notAvailable");
let object;
if ((securityInfo.state === "secure" || securityInfo.state === "weak")) {
const { subject, issuer, validity, fingerprint } = securityInfo.cert;
const enabledLabel = L10N.getStr("netmonitor.security.enabled");
const disabledLabel = L10N.getStr("netmonitor.security.disabled");
object = {
[L10N.getStr("netmonitor.security.connection")]: {
[L10N.getStr("netmonitor.security.protocolVersion")]:
securityInfo.protocolVersion || notAvailable,
[L10N.getStr("netmonitor.security.cipherSuite")]:
securityInfo.cipherSuite || notAvailable,
},
[L10N.getFormatStr("netmonitor.security.hostHeader", getUrlHost(url))]: {
[L10N.getStr("netmonitor.security.hsts")]:
securityInfo.hsts ? enabledLabel : disabledLabel,
[L10N.getStr("netmonitor.security.hpkp")]:
securityInfo.hpkp ? enabledLabel : disabledLabel,
},
[L10N.getStr("netmonitor.security.certificate")]: {
[L10N.getStr("certmgr.subjectinfo.label")]: {
[L10N.getStr("certmgr.certdetail.cn")]:
subject.commonName || notAvailable,
[L10N.getStr("certmgr.certdetail.o")]:
subject.organization || notAvailable,
[L10N.getStr("certmgr.certdetail.ou")]:
subject.organizationUnit || notAvailable,
},
[L10N.getStr("certmgr.issuerinfo.label")]: {
[L10N.getStr("certmgr.certdetail.cn")]:
issuer.commonName || notAvailable,
[L10N.getStr("certmgr.certdetail.o")]:
issuer.organization || notAvailable,
[L10N.getStr("certmgr.certdetail.ou")]:
issuer.organizationUnit || notAvailable,
},
[L10N.getStr("certmgr.periodofvalidity.label")]: {
[L10N.getStr("certmgr.begins")]:
validity.start || notAvailable,
[L10N.getStr("certmgr.expires")]:
validity.end || notAvailable,
},
[L10N.getStr("certmgr.fingerprints.label")]: {
[L10N.getStr("certmgr.certdetail.sha256fingerprint")]:
fingerprint.sha256 || notAvailable,
[L10N.getStr("certmgr.certdetail.sha1fingerprint")]:
fingerprint.sha1 || notAvailable,
},
},
};
} else {
object = {
[L10N.getStr("netmonitor.security.error")]:
new DOMParser().parseFromString(securityInfo.errorMessage, "text/html")
.body.textContent || notAvailable
};
}
return div({ id: "security-information" },
TreeView({
object,
columns: [{
id: "value",
width: "100%",
}],
renderValue: renderValue.bind(null, securityInfo.weaknessReasons),
expandedNodes: getExpandedNodes(object),
expandableStrings: false,
})
);
}
SecurityPanel.displayName = "SecurityPanel";
SecurityPanel.propTypes = {
securityInfo: PropTypes.object.isRequired,
url: PropTypes.string.isRequired,
};
function renderValue(weaknessReasons = [], props) {
const { member, value } = props;
// Hide object summary
if (typeof member.value === "object") {
return null;
}
return div({ className: "security-info-value" },
member.name === L10N.getStr("netmonitor.security.error") ?
// Display multiline text for security error
value
:
// Display one line selectable text for security details
input({
className: "textbox-input",
readonly: "true",
value,
})
,
weaknessReasons.indexOf("cipher") !== -1 &&
member.name === L10N.getStr("netmonitor.security.cipherSuite") ?
// Display an extra warning icon after the cipher suite
div({
id: "security-warning-cipher",
className: "security-warning-icon",
title: L10N.getStr("netmonitor.security.warning.cipher"),
})
:
null
);
}
function getExpandedNodes(object, path = "", level = 0) {
if (typeof object !== "object") {
return null;
}
let expandedNodes = new Set();
for (let prop in object) {
let nodePath = path + "/" + prop;
expandedNodes.add(nodePath);
let nodes = getExpandedNodes(object[prop], nodePath, level + 1);
if (nodes) {
expandedNodes = new Set([...expandedNodes, ...nodes]);
}
}
return expandedNodes;
}
module.exports = connect(
(state) => {
const selectedRequest = getSelectedRequest(state);
if (selectedRequest) {
const { securityInfo, url} = selectedRequest;
return {
securityInfo,
url,
};
}
return {};
}
)(SecurityPanel);

View File

@ -9,7 +9,7 @@
add_task(function* () {
let { tab, monitor } = yield initNetMonitor(CUSTOM_GET_URL);
let { $, EVENTS, NetMonitorView } = monitor.panelWin;
let { $, $all, EVENTS, NetMonitorView } = monitor.panelWin;
let { RequestsMenu, NetworkDetails } = NetMonitorView;
RequestsMenu.lazyUpdate = false;
@ -36,67 +36,50 @@ add_task(function* () {
let errorbox = $("#security-error");
let infobox = $("#security-information");
is(errorbox.hidden, true, "Error box is hidden.");
is(infobox.hidden, false, "Information box visible.");
is(errorbox, null, "Error box is hidden.");
ok(infobox, "Information box visible.");
let textboxes = $all(".textbox-input");
// Connection
// The protocol will be TLS but the exact version depends on which protocol
// the test server example.com supports.
let protocol = $("#security-protocol-version-value").value;
let protocol = textboxes[0].value;
ok(protocol.startsWith("TLS"), "The protocol " + protocol + " seems valid.");
// The cipher suite used by the test server example.com might change at any
// moment but all of them should start with "TLS_".
// http://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml
let suite = $("#security-ciphersuite-value").value;
let suite = textboxes[1].value;
ok(suite.startsWith("TLS_"), "The suite " + suite + " seems valid.");
// Host
checkLabel("#security-info-host-header", "Host example.com:");
checkLabel("#security-http-strict-transport-security-value", "Disabled");
checkLabel("#security-public-key-pinning-value", "Disabled");
let hostLabel = $all(".treeLabel.objectLabel")[1];
is(hostLabel.textContent, "Host example.com:", "Label has the expected value.");
is(textboxes[2].value, "Disabled", "Label has the expected value.");
is(textboxes[3].value, "Disabled", "Label has the expected value.");
// Cert
checkLabel("#security-cert-subject-cn", "example.com");
checkLabel("#security-cert-subject-o", "<Not Available>");
checkLabel("#security-cert-subject-ou", "<Not Available>");
is(textboxes[4].value, "example.com", "Label has the expected value.");
is(textboxes[5].value, "<Not Available>", "Label has the expected value.");
is(textboxes[6].value, "<Not Available>", "Label has the expected value.");
checkLabel("#security-cert-issuer-cn", "Temporary Certificate Authority");
checkLabel("#security-cert-issuer-o", "Mozilla Testing");
checkLabel("#security-cert-issuer-ou", "<Not Available>");
is(textboxes[7].value, "Temporary Certificate Authority", "Label has the expected value.");
is(textboxes[8].value, "Mozilla Testing", "Label has the expected value.");
is(textboxes[9].value, "Profile Guided Optimization", "Label has the expected value.");
// Locale sensitive and varies between timezones. Cant't compare equality or
// the test fails depending on which part of the world the test is executed.
checkLabelNotEmpty("#security-cert-validity-begins");
checkLabelNotEmpty("#security-cert-validity-expires");
checkLabelNotEmpty("#security-cert-sha1-fingerprint");
checkLabelNotEmpty("#security-cert-sha256-fingerprint");
// cert validity begins
isnot(textboxes[10].value, "", "Label was not empty.");
// cert validity expires
isnot(textboxes[11].value, "", "Label was not empty.");
// cert sha1 fingerprint
isnot(textboxes[12].value, "", "Label was not empty.");
// cert sha256 fingerprint
isnot(textboxes[13].value, "", "Label was not empty.");
yield teardown(monitor);
/**
* A helper that compares value attribute of a label with given selector to the
* expected value.
*/
function checkLabel(selector, expected) {
info("Checking label " + selector);
let element = $(selector);
ok(element, "Selector matched an element.");
is(element.value, expected, "Label has the expected value.");
}
/**
* A helper that checks the label with given selector is not an empty string.
*/
function checkLabelNotEmpty(selector) {
info("Checking that label " + selector + " is non-empty.");
let element = $(selector);
ok(element, "Selector matched an element.");
isnot(element.value, "", "Label was not empty.");
}
});

View File

@ -33,14 +33,9 @@ add_task(function* () {
info("Waiting for security tab to be updated.");
yield monitor.panelWin.once(EVENTS.TAB_UPDATED);
let errorbox = $("#security-error");
let errormsg = $("#security-error-message");
let infobox = $("#security-information");
let errormsg = $(".security-info-value");
is(errorbox.hidden, false, "Error box is visble.");
is(infobox.hidden, true, "Information box is hidden.");
isnot(errormsg.value, "", "Error message is not empty.");
isnot(errormsg.textContent, "", "Error message is not empty.");
return teardown(monitor);

View File

@ -11,7 +11,7 @@ const TEST_CASES = [
{
desc: "no warnings",
uri: "https://example.com" + CORS_SJS_PATH,
warnCipher: false,
warnCipher: null,
},
];
@ -47,7 +47,7 @@ add_task(function* () {
yield monitor.panelWin.once(EVENTS.TAB_UPDATED);
}
is(cipher.hidden, !test.warnCipher, "Cipher suite warning is hidden.");
is(cipher, test.warnCipher, "Cipher suite warning is hidden.");
RequestsMenu.clear();
}

View File

@ -97,6 +97,8 @@ define(function (require, exports, module) {
onSort: PropTypes.func,
// A header is displayed if set to true
header: PropTypes.bool,
// Long string is expandable by a toggle button
expandableStrings: PropTypes.bool,
// Array of columns
columns: PropTypes.arrayOf(PropTypes.shape({
id: PropTypes.string.isRequired,
@ -111,6 +113,7 @@ define(function (require, exports, module) {
renderRow: null,
provider: ObjectProvider,
expandedNodes: new Set(),
expandableStrings: true,
columns: []
};
},
@ -179,7 +182,7 @@ define(function (require, exports, module) {
return [];
}
let provider = this.props.provider;
let { expandableStrings, provider } = this.props;
let children = provider.getChildren(parent) || [];
// If the return value is non-array, the children
@ -201,7 +204,7 @@ define(function (require, exports, module) {
// Value for actual column is get when a cell is rendered.
let value = provider.getValue(child);
if (isLongString(value)) {
if (expandableStrings && isLongString(value)) {
hasChildren = true;
}

View File

@ -1,8 +1,9 @@
/* vim:set ts=2 sw=2 sts=2 et: */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
@import "resource://devtools/client/shared/components/tree/tree-view.css";
#toolbar-labels {
overflow: hidden;
display: flex;
@ -786,6 +787,7 @@
#security-tabpanel {
overflow: auto;
-moz-user-select: text;
}
.security-warning-icon {
@ -1084,10 +1086,59 @@
}
}
/* Overwrite tree-view cell colon and use l10n string instead */
.treeTable .treeLabelCell::after {
content: "";
}
/* Layout additional warning icon in tree value cell */
.security-info-value {
display: flex;
}
.security-info-value .textbox-input {
text-overflow: ellipsis;
border: none;
background: none;
color: inherit;
width: 100%;
margin-inline-end: 2px;
}
.security-info-value .textbox-input:focus {
outline: 0;
box-shadow: var(--theme-focus-box-shadow-textbox);
}
.treeTable .treeLabel {
font-weight: 600;
}
/* Customize default tree table style to align with devtools theme */
.theme-light .treeTable .treeLabel,
.theme-light .treeTable .treeRow.hasChildren > .treeLabelCell > .treeLabel:hover {
color: var(--theme-highlight-red);
}
.theme-dark .treeTable .treeLabel,
.theme-dark .treeTable .treeRow.hasChildren > .treeLabelCell > .treeLabel:hover {
color: var(--theme-highlight-purple);
}
.theme-firebug .treeTable .treeLabel {
color: var(--theme-body-color);
}
.treeTable .treeRow.hasChildren > .treeLabelCell > .treeLabel:hover {
cursor: default;
text-decoration: none;
}
/*
* FIXME: normal html block element cannot fill outer XUL element
* This workaround should be removed after sidebar is migrated to react
*/
#react-security-tabpanel-hook,
#react-timings-tabpanel-hook {
display: -moz-box;
-moz-box-orient: vertical;

View File

@ -1172,7 +1172,6 @@ GK_ATOM(span, "span")
GK_ATOM(spellcheck, "spellcheck")
GK_ATOM(spinner, "spinner")
GK_ATOM(split, "split")
GK_ATOM(splitmenu, "splitmenu")
GK_ATOM(splitter, "splitter")
GK_ATOM(spring, "spring")
GK_ATOM(src, "src")

View File

@ -55,7 +55,6 @@ SimpleTest.waitForExplicitFinish();
SpecialPowers.pushPrefEnv({
"set": [
["media.cache_size", 40000],
["dom.MediaError.message.enabled", true]
]
}, beginTest);
function beginTest() {

View File

@ -20,6 +20,5 @@ interface MediaError {
[Constant]
readonly attribute unsigned short code;
[Pref="dom.MediaError.message.enabled"]
readonly attribute DOMString message;
};

View File

@ -1759,7 +1759,6 @@ ConsumeOutsideClicksResult nsMenuPopupFrame::ConsumeOutsideClicks()
#if defined(XP_WIN)
// Don't consume outside clicks for menus in Windows
if (ni->Equals(nsGkAtoms::menu, kNameSpaceID_XUL) ||
ni->Equals(nsGkAtoms::splitmenu, kNameSpaceID_XUL) ||
ni->Equals(nsGkAtoms::popupset, kNameSpaceID_XUL) ||
((ni->Equals(nsGkAtoms::button, kNameSpaceID_XUL) ||
ni->Equals(nsGkAtoms::toolbarbutton, kNameSpaceID_XUL)) &&

View File

@ -45,6 +45,7 @@ public class BrowserContract {
public static final String PARAM_PROFILE_PATH = "profilePath";
public static final String PARAM_LIMIT = "limit";
public static final String PARAM_SUGGESTEDSITES_LIMIT = "suggestedsites_limit";
public static final String PARAM_TOPSITES_EXCLUDE_REMOTE_ONLY = "topsites_exclude_remote_only";
public static final String PARAM_IS_SYNC = "sync";
public static final String PARAM_SHOW_DELETED = "show_deleted";
public static final String PARAM_IS_TEST = "test";

View File

@ -896,6 +896,8 @@ public class BrowserProvider extends SharedBrowserDatabaseProvider {
final String limitParam = uri.getQueryParameter(BrowserContract.PARAM_LIMIT);
final String gridLimitParam = uri.getQueryParameter(BrowserContract.PARAM_SUGGESTEDSITES_LIMIT);
final boolean excludeRemoteOnly = Boolean.parseBoolean(
uri.getQueryParameter(BrowserContract.PARAM_TOPSITES_EXCLUDE_REMOTE_ONLY));
final String nonPositionedPins = uri.getQueryParameter(BrowserContract.PARAM_NON_POSITIONED_PINS);
final int totalLimit;
@ -949,7 +951,7 @@ public class BrowserProvider extends SharedBrowserDatabaseProvider {
// Filter out: unvisited pages (history_id == -1) pinned (and other special) sites, deleted sites,
// and about: pages.
final String ignoreForTopSitesWhereClause =
String ignoreForTopSitesWhereClause =
"(" + Combined.HISTORY_ID + " IS NOT -1)" +
" AND " +
Combined.URL + " NOT IN (SELECT " +
@ -959,6 +961,10 @@ public class BrowserProvider extends SharedBrowserDatabaseProvider {
" AND " +
"(" + Combined.URL + " NOT LIKE ?)";
if (excludeRemoteOnly) {
ignoreForTopSitesWhereClause += " AND (" + Combined.LOCAL_VISITS_COUNT + " > 0)";
}
final String[] ignoreForTopSitesArgs = new String[] {
AboutPages.URL_FILTER
};

View File

@ -1908,6 +1908,8 @@ public class LocalBrowserDB extends BrowserDB {
String.valueOf(suggestedRangeLimit))
.appendQueryParameter(BrowserContract.PARAM_NON_POSITIONED_PINS,
String.valueOf(true))
.appendQueryParameter(BrowserContract.PARAM_TOPSITES_EXCLUDE_REMOTE_ONLY,
String.valueOf(true))
.build();
return new TelemetrisedCursorLoader(context,

View File

@ -44,15 +44,15 @@ public class StringUtils {
public static boolean isSearchQuery(String text, boolean wasSearchQuery) {
// We remove leading and trailing white spaces when decoding URLs
text = text.trim();
if (text.length() == 0)
if (text.length() == 0) {
return wasSearchQuery;
}
int colon = text.indexOf(':');
int dot = text.indexOf('.');
int space = text.indexOf(' ');
// If a space is found before any dot and colon, we assume this is a search query
if (space > -1 && (colon == -1 || space < colon) && (dot == -1 || space < dot)) {
// If a space is found in a trimmed string, we assume this is a search query(Bug 1278245)
if (space > -1) {
return true;
}
// Otherwise, if a dot or a colon is found, we assume this is a URL

View File

@ -104,4 +104,42 @@ public class TestStringUtils {
assertEquals("m::o::z::i::l::l::a", StringUtils.join("::", Arrays.asList("m", "o", "z", "i", "l", "l", "a")));
}
@Test
public void testIsSearchQuery(){
boolean any = true;
// test trim
assertFalse(StringUtils.isSearchQuery("",false));
assertTrue(StringUtils.isSearchQuery("",true));
// test space
assertTrue(StringUtils.isSearchQuery(" apple pen ",any));
assertTrue(StringUtils.isSearchQuery("pineapple pen",any));
assertTrue(StringUtils.isSearchQuery(": :",any));
assertTrue(StringUtils.isSearchQuery(". .",any));
assertTrue(StringUtils.isSearchQuery("gcm site:stackoverflow.com",any));
assertTrue(StringUtils.isSearchQuery("/mnt/etc/resolv.conf does not exist",true));
// test colon
assertFalse(StringUtils.isSearchQuery(":",any));
assertFalse(StringUtils.isSearchQuery("site:stackoverflow.com",any));
assertFalse(StringUtils.isSearchQuery("http:mozilla.com",any));
assertFalse(StringUtils.isSearchQuery("http://mozilla.com",any));
assertFalse(StringUtils.isSearchQuery("http:/mozilla.com",any));
// test dot
assertFalse(StringUtils.isSearchQuery(".",any));
assertFalse(StringUtils.isSearchQuery("cd..",any));
assertFalse(StringUtils.isSearchQuery("cd...",any));
assertFalse(StringUtils.isSearchQuery("mozilla.com",any));
// test ambiguous
String ambiguous = "~!@#$%^&*()_+`34567890-=qwertyuiop[]\\QWERTYUIOP{}|asdfghjkl;'ASDFGHJKL:\"ZXCVBNM<>?zxcvbnm,./";
ambiguous = ambiguous.replace(" ","").replace(".","").replace(":","");
assertTrue(StringUtils.isSearchQuery(ambiguous,true));
assertFalse(StringUtils.isSearchQuery(ambiguous,false));
}
}

View File

@ -305,13 +305,6 @@ pref("mathml.disabled", false);
// Enable scale transform for stretchy MathML operators. See bug 414277.
pref("mathml.scale_stretchy_operators.enabled", true);
// Disable MediaError.message.
#ifdef RELEASE_OR_BETA
pref("dom.MediaError.message.enabled", false);
#else
pref("dom.MediaError.message.enabled", true);
#endif
// Enabled on nightly only until we fix mochitest failures.
#ifdef NIGHTLY_BUILD
pref("media.dormant-on-pause-timeout-ms", 5000);

View File

@ -1149,4 +1149,4 @@ static const TransportSecurityPreload kPublicKeyPinningPreloadList[] = {
static const int32_t kUnknownId = -1;
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1490193107372000);
static const PRTime kPreloadPKPinsExpirationTime = INT64_C(1490279095479000);

View File

@ -38,6 +38,7 @@
4mm.org: could not connect to host
4sqsu.eu: could not connect to host
50millionablaze.org: did not receive HSTS header
540.co: did not receive HSTS header
56ct.com: could not connect to host
60ych.net: did not receive HSTS header
7kovrikov.ru: did not receive HSTS header
@ -160,7 +161,7 @@ allinnote.com: could not connect to host
allstarswithus.com: could not connect to host
alpha.irccloud.com: could not connect to host
alphabit-secure.com: could not connect to host
alphabuild.io: could not connect to host
alphabuild.io: did not receive HSTS header
alphalabs.xyz: could not connect to host
alterbaum.net: did not receive HSTS header
altfire.ca: could not connect to host
@ -183,6 +184,7 @@ anassiriphotography.com: could not connect to host
ancientkarma.com: could not connect to host
andere-gedanken.net: max-age too low: 10
andreasbreitenlohner.de: did not receive HSTS header
andreaskrasa.com: could not connect to host
andreasolsson.se: could not connect to host
andreastoneman.com: could not connect to host
andreigec.net: did not receive HSTS header
@ -227,6 +229,7 @@ api.mega.co.nz: could not connect to host
apibot.de: could not connect to host
apis.google.com: did not receive HSTS header (error ignored - included regardless)
apis.world: did not receive HSTS header
apmg-certified.com: could not connect to host
apnakliyat.com: did not receive HSTS header
aponkral.net: did not receive HSTS header
aponkralsunucu.com: did not receive HSTS header
@ -255,7 +258,6 @@ armytricka.cz: did not receive HSTS header
arrayify.com: could not connect to host
ars-design.net: could not connect to host
ars.toscana.it: max-age too low: 0
artegusto.ru: could not connect to host
artistnetwork.nl: did not receive HSTS header
arvamus.eu: could not connect to host
as.se: could not connect to host
@ -264,7 +266,6 @@ asasuou.pw: could not connect to host
asc16.com: could not connect to host
ascii.moe: could not connect to host
asdpress.cn: could not connect to host
ashleymedway.com: could not connect to host
asianodor.com: could not connect to host
askfit.cz: did not receive HSTS header
asm-x.com: did not receive HSTS header
@ -282,6 +283,7 @@ atavio.at: could not connect to host
atavio.ch: could not connect to host
atavio.de: did not receive HSTS header
atbeckett.com: did not receive HSTS header
atelierdesflammesnoires.fr: could not connect to host
athaliasoft.com: did not receive HSTS header
athenelive.com: could not connect to host
athul.xyz: did not receive HSTS header
@ -374,6 +376,7 @@ beneffy.com: did not receive HSTS header
benk.press: could not connect to host
benny003.de: did not receive HSTS header
benzkosmetik.de: could not connect to host
berasavocate.com: could not connect to host
bermytraq.bm: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
berr.yt: could not connect to host
berrymark.be: max-age too low: 0
@ -424,8 +427,6 @@ bitheus.com: could not connect to host
bithosting.io: did not receive HSTS header
bitnet.io: did not receive HSTS header
bitsafe.systems: could not connect to host
bitstorm.nl: could not connect to host
bitstorm.org: could not connect to host
bitvigor.com: could not connect to host
bivsi.com: could not connect to host
bizcms.com: did not receive HSTS header
@ -438,7 +439,6 @@ bl4ckb0x.net: did not receive HSTS header
bl4ckb0x.org: did not receive HSTS header
black-armada.com.pl: could not connect to host
black-armada.pl: could not connect to host
black-khat.com: could not connect to host
blackburn.link: did not receive HSTS header
blacklane.com: did not receive HSTS header
blackly.uk: could not connect to host
@ -456,7 +456,6 @@ blucas.org: did not receive HSTS header
blueliv.com: did not receive HSTS header
bluescloud.xyz: could not connect to host
bluetenmeer.com: did not receive HSTS header
bluserv.net: could not connect to host
bm-trading.nl: did not receive HSTS header
bngsecure.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
bobiji.com: did not receive HSTS header
@ -524,6 +523,7 @@ bunaken.asia: could not connect to host
burian-server.cz: could not connect to host
burrow.ovh: could not connect to host
burtrum.me: could not connect to host
burtrum.top: could not connect to host
business.lookout.com: could not connect to host
businesshosting.nl: did not receive HSTS header
busold.ws: could not connect to host
@ -592,6 +592,7 @@ catinmay.com: did not receive HSTS header
catnapstudios.com: could not connect to host
caveclan.org: did not receive HSTS header
cavedroid.xyz: could not connect to host
cbbank.com: did not receive HSTS header
cbhq.net: could not connect to host
cbtistexcalac.mx: could not connect to host
ccsys.com: could not connect to host
@ -627,7 +628,6 @@ charnleyhouse.co.uk: max-age too low: 604800
chartpen.com: did not receive HSTS header
chartstoffarm.de: max-age too low: 10
chatbot.me: did not receive HSTS header
chateau-belvoir.com: did not receive HSTS header
chateauconstellation.ch: did not receive HSTS header
chatup.cf: could not connect to host
chaulootz.com: could not connect to host
@ -637,7 +637,6 @@ checkout.google.com: did not receive HSTS header (error ignored - included regar
cheerflow.com: could not connect to host
cheesetart.my: could not connect to host
chejianer.cn: did not receive HSTS header
chepaofen.com: could not connect to host
cherysunzhang.com: max-age too low: 7776000
chic-leather.com: could not connect to host
chihiro.xyz: could not connect to host
@ -655,6 +654,7 @@ christiaandruif.nl: could not connect to host
christianbro.gq: could not connect to host
christophheich.me: could not connect to host
chrisupjohn.com: could not connect to host
chriswells.io: could not connect to host
chrome-devtools-frontend.appspot.com: did not receive HSTS header (error ignored - included regardless)
chrome.google.com: did not receive HSTS header (error ignored - included regardless)
chroniclesofgeorge.com: did not receive HSTS header
@ -674,7 +674,6 @@ clcleaningco.com: could not connect to host
cleaningsquad.ca: max-age too low: 0
clerkendweller.uk: could not connect to host
clickandgo.com: did not receive HSTS header
clickphish.com: could not connect to host
clint.id.au: max-age too low: 0
clintonbloodworth.com: could not connect to host
clintonbloodworth.io: could not connect to host
@ -816,13 +815,13 @@ cupidmentor.com: did not receive HSTS header
curroapp.com: could not connect to host
custe.rs: could not connect to host
cuvva.insure: did not receive HSTS header
cvjm-memmingen.de: did not receive HSTS header
cyanogenmod.xxx: could not connect to host
cybershambles.com: could not connect to host
cycleluxembourg.lu: did not receive HSTS header
cydia-search.io: could not connect to host
cyphertite.com: could not connect to host
dad256.tk: could not connect to host
dadtheimpaler.com: could not connect to host
dah5.com: did not receive HSTS header
dailystormerpodcasts.com: did not receive HSTS header
dakrib.net: could not connect to host
@ -830,6 +829,8 @@ dalingk.co: could not connect to host
dango.in: did not receive HSTS header
daniel-steuer.de: did not receive HSTS header
danieldk.eu: did not receive HSTS header
danielmostertman.com: could not connect to host
danielmostertman.nl: could not connect to host
danielworthy.com: did not receive HSTS header
danijobs.com: could not connect to host
danpiel.net: could not connect to host
@ -867,7 +868,7 @@ davidnoren.com: did not receive HSTS header
davidreinhardt.de: could not connect to host
davidscherzer.at: could not connect to host
daylightcompany.com: did not receive HSTS header
db.gy: did not receive HSTS header
db.gy: could not connect to host
dbx.ovh: did not receive HSTS header
dccode.gov: could not connect to host
dcurt.is: did not receive HSTS header
@ -917,7 +918,6 @@ devinfo.net: did not receive HSTS header
devmsg.com: did not receive HSTS header
devtub.com: did not receive HSTS header
devuan.org: did not receive HSTS header
dfranke.com: did not receive HSTS header
diablotine.rocks: could not connect to host
diarbag.us: did not receive HSTS header
diasp.cz: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
@ -1052,6 +1052,7 @@ ehrenamt-skpfcw.de: could not connect to host
eicfood.com: could not connect to host
eidolonhost.com: did not receive HSTS header
ekbanden.nl: could not connect to host
ekodevices.com: could not connect to host
ekostecki.de: did not receive HSTS header
el-soul.com: did not receive HSTS header
elaintehtaat.fi: did not receive HSTS header
@ -1066,7 +1067,6 @@ elgacien.de: could not connect to host
elimdengelen.com: did not receive HSTS header
elisabeth-kostecki.de: did not receive HSTS header
elisabethkostecki.de: did not receive HSTS header
elite-porno.ru: could not connect to host
elitefishtank.com: could not connect to host
elmermx.ch: could not connect to host
elnutricionista.es: did not receive HSTS header
@ -1086,7 +1086,7 @@ encode.space: did not receive HSTS header
encoder.pw: could not connect to host
encrypted.google.com: did not receive HSTS header (error ignored - included regardless)
endzeit-architekten.com: did not receive HSTS header
engelwerbung.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
engelwerbung.com: did not receive HSTS header
enigmacpt.com: did not receive HSTS header
enigmail.net: did not receive HSTS header
enteente.club: could not connect to host
@ -1119,11 +1119,10 @@ errlytics.com: [Exception... "Component returned failure code: 0x80004005 (NS_ER
errolz.com: could not connect to host
errors.zenpayroll.com: could not connect to host
ersindemirtas.com: did not receive HSTS header
esclear.de: did not receive HSTS header
esclear.de: could not connect to host
escotour.com: did not receive HSTS header
escritoriodearte.com: did not receive HSTS header
esec.rs: did not receive HSTS header
esln.org: could not connect to host
espra.com: could not connect to host
esquonic.com: could not connect to host
essexcosmeticdentists.co.uk: did not receive HSTS header
@ -1193,6 +1192,7 @@ fatherhood.gov: did not receive HSTS header
fatlossguide.xyz: could not connect to host
fatox.de: could not connect to host
fatwin.pw: could not connect to host
fawkex.me: did not receive HSTS header
fayolle.info: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
fbox.li: could not connect to host
fdj.im: could not connect to host
@ -1202,7 +1202,6 @@ fedux.com.ar: could not connect to host
feezmodo.com: max-age too low: 0
felisslovakia.sk: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
feliwyn.fr: did not receive HSTS header
felixsanz.com: could not connect to host
feminists.co: could not connect to host
fenteo.com: could not connect to host
feragon.net: max-age too low: 84600
@ -1244,7 +1243,6 @@ fj.search.yahoo.com: did not receive HSTS header
fjruiz.es: could not connect to host
flags.ninja: could not connect to host
flamewall.net: could not connect to host
flamingkeys.com: did not receive HSTS header
flamingkeys.com.au: could not connect to host
flana.com: could not connect to host
flawcheck.com: did not receive HSTS header
@ -1314,6 +1312,7 @@ fuckgfw233.org: could not connect to host
fugle.de: could not connect to host
fukushima-web.com: did not receive HSTS header
funkyweddingideas.com.au: could not connect to host
funnyang.com: could not connect to host
funrun.com: did not receive HSTS header
furiffic.com: did not receive HSTS header
furry.be: max-age too low: 86400
@ -1374,6 +1373,7 @@ getcarefirst.com: did not receive HSTS header
getcolor.com: did not receive HSTS header
getfirepress.com: could not connect to host
getinternet.de: max-age too low: 0
getkai.co.nz: did not receive HSTS header
getlantern.org: did not receive HSTS header
getlifti.com: did not receive HSTS header
getlolaccount.com: could not connect to host
@ -1410,7 +1410,6 @@ globalmusic.ga: could not connect to host
gloomyvancouver.com: could not connect to host
glopoi.com: did not receive HSTS header
glws.org: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
glyph.ws: could not connect to host
gm.search.yahoo.com: did not receive HSTS header
gmail.com: did not receive HSTS header (error ignored - included regardless)
gmantra.org: could not connect to host
@ -1441,9 +1440,12 @@ googleplex.com: did not receive HSTS header (error ignored - included regardless
goolok.com: did not receive HSTS header
gorf.chat: could not connect to host
gorilla-gym.site: could not connect to host
gospelofmark.ch: max-age too low: 2592000
gotech.com.eg: did not receive HSTS header
goto.google.com: did not receive HSTS header (error ignored - included regardless)
goto.world: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
gottcode.org: did not receive HSTS header
gov.ax: could not connect to host
govillemo.ca: did not receive HSTS header
gowe.wang: could not connect to host
gparent.org: did not receive HSTS header
@ -1557,6 +1559,7 @@ henriknoerr.com: could not connect to host
hermes-net.de: did not receive HSTS header
herpaderp.net: did not receive HSTS header
herzbotschaft.de: did not receive HSTS header
hex2013.com: did not receive HSTS header
hibilog.com: could not connect to host
hicn.gq: could not connect to host
hiddendepth.ie: max-age too low: 0
@ -1582,7 +1585,6 @@ holifestival-freyung.de: could not connect to host
holymoly.lu: did not receive HSTS header
homa.website: could not connect to host
homads.com: could not connect to host
homeprivate.de: could not connect to host
honeytracks.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
hongzhaxiaofendui.com: could not connect to host
honoo.com: could not connect to host
@ -1620,6 +1622,7 @@ huntshomeinspections.com: [Exception... "Component returned failure code: 0x8000
hup.blue: could not connect to host
hurricanelabs.com: did not receive HSTS header
huskybutt.dog: could not connect to host
hycken.com: did not receive HSTS header
hydra.ws: could not connect to host
hyper69.com: did not receive HSTS header
hzsh.xyz: did not receive HSTS header
@ -1691,6 +1694,7 @@ infinitusgaming.eu: could not connect to host
inflation.ml: could not connect to host
infogrfx.com: did not receive HSTS header
informatik.zone: could not connect to host
infosec.rip: could not connect to host
infotics.es: did not receive HSTS header
injigo.com: did not receive HSTS header
inkable.com.au: did not receive HSTS header
@ -1708,7 +1712,6 @@ inspiroinc.com: could not connect to host
instacart.com: did not receive HSTS header
instantdev.io: could not connect to host
institutoflordelavida.com: could not connect to host
intarweb.ca: could not connect to host
intel.li: could not connect to host
intelldynamics.com: could not connect to host
interference.io: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
@ -1880,7 +1883,6 @@ jwilsson.me: could not connect to host
jxm.in: could not connect to host
k-dev.de: could not connect to host
ka-clan.com: could not connect to host
kab-s.de: did not receive HSTS header
kabuabc.com: did not receive HSTS header
kabus.org: could not connect to host
kadioglumakina.com.tr: did not receive HSTS header
@ -1910,12 +1912,14 @@ keeley.ml: could not connect to host
keeleysam.me: could not connect to host
keepclean.me: could not connect to host
ken.fm: did not receive HSTS header
kennethlim.me: could not connect to host
kerangalam.com: did not receive HSTS header
kerksanders.nl: did not receive HSTS header
kermadec.net: could not connect to host
kernl.us: did not receive HSTS header
kevinapease.com: did not receive HSTS header
keymaster.lookout.com: did not receive HSTS header
kfz-hantschel.de: could not connect to host
kg-rating.com: did not receive HSTS header
kgxtech.com: max-age too low: 2592000
kickass.al: could not connect to host
@ -1931,6 +1935,7 @@ kinnon.enterprises: could not connect to host
kinogb.net: max-age too low: 0
kionetworks.com: did not receive HSTS header
kipira.com: could not connect to host
kircp.com: could not connect to host
kirkforcongress.com: could not connect to host
kirkforsenate.com: could not connect to host
kirkpatrickdavis.com: could not connect to host
@ -1956,11 +1961,12 @@ kleppe.co: could not connect to host
kletterkater.com: did not receive HSTS header
klicktojob.de: could not connect to host
kmartin.io: did not receive HSTS header
knccloud.com: did not receive HSTS header
knccloud.com: could not connect to host
kodokushi.fr: could not connect to host
koen.io: did not receive HSTS header
koenrouwhorst.nl: did not receive HSTS header
kollabria.com: max-age too low: 0
komget.net: did not receive HSTS header
komikito.com: could not connect to host
kompetenzwerft.de: did not receive HSTS header
konsertoversikt.no: could not connect to host
@ -1974,8 +1980,8 @@ korsanparti.org: could not connect to host
kotonehoko.net: could not connect to host
kotovstyle.ru: could not connect to host
kr.search.yahoo.com: did not receive HSTS header
kreavis.com: max-age too low: 0
kredite.sale: could not connect to host
kriechel.de: could not connect to host
kriegt.es: could not connect to host
krmela.com: could not connect to host
kroetenfuchs.de: could not connect to host
@ -2007,6 +2013,7 @@ labordata.io: could not connect to host
labrador-retrievers.com.au: did not receive HSTS header
labs.moscow: did not receive HSTS header
lachlankidson.net: did not receive HSTS header
lacicloud.net: could not connect to host
lacledeslan.ninja: could not connect to host
ladbroke.net: did not receive HSTS header
laf.in.net: did not receive HSTS header
@ -2175,6 +2182,7 @@ macbolo.com: could not connect to host
macchaberrycream.com: could not connect to host
macgeneral.de: did not receive HSTS header
machon.biz: could not connect to host
macker.io: could not connect to host
madars.org: did not receive HSTS header
maddin.ga: could not connect to host
madebymagnitude.com: did not receive HSTS header
@ -2205,7 +2213,6 @@ marcuskoh.com: could not connect to host
mariannematthew.com: could not connect to host
marie-curie.fr: could not connect to host
marie-elisabeth.dk: did not receive HSTS header
marie.club: could not connect to host
markaconnor.com: could not connect to host
markayapilandirma.com: did not receive HSTS header
market.android.com: did not receive HSTS header (error ignored - included regardless)
@ -2216,6 +2223,7 @@ marleyresort.com: did not receive HSTS header
marshut.net: could not connect to host
martiert.com: could not connect to host
martijnvhoof.nl: could not connect to host
martineve.com: did not receive HSTS header
martinsfamilyappliance.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
marumagic.com: did not receive HSTS header
masjidtawheed.net: did not receive HSTS header
@ -2262,6 +2270,7 @@ megaxchange.com: did not receive HSTS header
meghudson.com: could not connect to host
mein-gesundheitsmanager.com: did not receive HSTS header
meincenter-meinemeinung.de: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
meincloudspeicher.de: could not connect to host
meinebo.it: could not connect to host
melted.pw: could not connect to host
members.mayfirst.org: did not receive HSTS header
@ -2293,7 +2302,6 @@ michal-kral.cz: could not connect to host
michalborka.cz: could not connect to host
michelchouinard.ca: could not connect to host
micro-dv.ru: could not connect to host
micro-rain-systems.com: could not connect to host
microme.ga: could not connect to host
micropple.net: could not connect to host
midwestwomenworkers.org: did not receive HSTS header
@ -2332,7 +2340,6 @@ miyoshi-kikaku.com: did not receive HSTS header
mizd.at: could not connect to host
mizi.name: did not receive HSTS header
mlpepilepsy.org: could not connect to host
mmalisz.com: could not connect to host
mmgazhomeloans.com: did not receive HSTS header
mnemotiv.com: could not connect to host
mnetworkingsolutions.co.uk: did not receive HSTS header
@ -2449,11 +2456,13 @@ narada.com.ua: could not connect to host
nargileh.nl: could not connect to host
natalia.io: could not connect to host
natalt.org: did not receive HSTS header
nathanmfarrugia.com: did not receive HSTS header
naturesystems.cz: max-age too low: 0
natuurbehangnederland.nl: could not connect to host
nauck.org: did not receive HSTS header
nav.jobs: could not connect to host
naval.tf: could not connect to host
navenlle.com: did not receive HSTS header
navigate-it-services.de: max-age too low: 0
navjobs.com: did not receive HSTS header
nbb.io: could not connect to host
@ -2475,6 +2484,7 @@ nellacms.org: could not connect to host
nellafw.org: could not connect to host
nemno.de: could not connect to host
nemovement.org: did not receive HSTS header
nemunai.re: could not connect to host
neonisi.com: could not connect to host
nepustil.net: did not receive HSTS header
neris.io: could not connect to host
@ -2525,6 +2535,7 @@ nipponcareers.com: did not receive HSTS header
nixien.fr: could not connect to host
nkinka.de: did not receive HSTS header
nmctest.net: could not connect to host
nnqc.nl: could not connect to host
nnya.cat: did not receive HSTS header
no17sifangjie.cc: could not connect to host
nocallaghan.com: could not connect to host
@ -2554,6 +2565,7 @@ nowak.ninja: did not receive HSTS header
noworrywp.com: could not connect to host
np.search.yahoo.com: did not receive HSTS header
npol.de: did not receive HSTS header
nsboutique.com: did not receive HSTS header
ntbs.pro: could not connect to host
nu3.at: did not receive HSTS header
nu3.ch: did not receive HSTS header
@ -2578,6 +2590,7 @@ nutleyef.org: did not receive HSTS header
nutrienti.eu: did not receive HSTS header
nutritionculture.com: could not connect to host
nutsandboltsmedia.com: did not receive HSTS header
nwa.xyz: could not connect to host
nwgh.org: max-age too low: 86400
nwork.media: could not connect to host
nyantec.com: did not receive HSTS header
@ -2587,7 +2600,7 @@ nz.search.yahoo.com: max-age too low: 172800
nzb.cat: max-age too low: 7776000
o0o.one: did not receive HSTS header
oasis.mobi: did not receive HSTS header
oasisim.net: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
oasisim.net: could not connect to host
obsydian.org: could not connect to host
occasion-impro.com: could not connect to host
occentus.net: did not receive HSTS header
@ -2599,15 +2612,18 @@ ofcourselanguages.com: could not connect to host
offshore-firma.org: could not connect to host
oishioffice.com: did not receive HSTS header
okane.love: could not connect to host
okok-rent.com: could not connect to host
okok.rent: could not connect to host
okutama.in.th: could not connect to host
olafnorge.de: could not connect to host
oliver-pietsch.de: did not receive HSTS header
oliveraiedelabastideblanche.fr: could not connect to host
oliverdunk.com: did not receive HSTS header
ollehbizev.co.kr: could not connect to host
ollie.io: did not receive HSTS header
omgaanmetidealen.com: could not connect to host
ominto.com: max-age too low: 0
omniasl.com: could not connect to host
omniti.com: max-age too low: 1
omquote.gq: could not connect to host
oneb4nk.com: could not connect to host
@ -2636,6 +2652,7 @@ ookjesprookje.nl: could not connect to host
ooonja.de: could not connect to host
oopsmycase.com: could not connect to host
oost.io: could not connect to host
open-coding.org: could not connect to host
open-mx.de: could not connect to host
open-to-repair.fr: did not receive HSTS header
opendesk.cc: did not receive HSTS header
@ -2684,6 +2701,7 @@ overclockers.ge: could not connect to host
override.io: did not receive HSTS header
oversight.io: could not connect to host
overthinkingit.com: max-age too low: 3600
ovvy.net: could not connect to host
owncloud.help: could not connect to host
ownmovies.fr: could not connect to host
oxygenabsorbers.com: did not receive HSTS header
@ -2703,7 +2721,7 @@ pamsoft.pl: max-age too low: 0
panaceallc.net: could not connect to host
pants-off.xyz: could not connect to host
pantsu.cat: did not receive HSTS header
papeda.net: could not connect to host
papeda.net: did not receive HSTS header
papercard.co.uk: did not receive HSTS header
papierniak.net: could not connect to host
papygeek.com: could not connect to host
@ -2713,6 +2731,7 @@ parodybit.net: [Exception... "Component returned failure code: 0x80004005 (NS_ER
parpaing-paillette.net: could not connect to host
particonpsplus.it: could not connect to host
partijtjevoordevrijheid.nl: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
partnersfcu.org: could not connect to host
partyvan.it: could not connect to host
partyvan.moe: could not connect to host
partyvan.nl: could not connect to host
@ -2720,6 +2739,7 @@ partyvan.se: could not connect to host
passwordbox.com: did not receive HSTS header
passwordrevelator.net: did not receive HSTS header
passwords.google.com: did not receive HSTS header (error ignored - included regardless)
pastaenprosecco.nl: could not connect to host
pastaf.com: could not connect to host
paste.fedoraproject.org: did not receive HSTS header
paste.linode.com: could not connect to host
@ -2742,6 +2762,7 @@ pbprint.ru: max-age too low: 0
pc-nf.de: did not receive HSTS header
pcfun.net: could not connect to host
pchax.net: could not connect to host
pebblesdemo.com: could not connect to host
peissen.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
pekkapikkarainen.fi: could not connect to host
pekkarik.ru: could not connect to host
@ -2757,7 +2778,6 @@ perplex.nl: did not receive HSTS header
perroud.pro: max-age too low: 2592000
personaldatabasen.no: could not connect to host
personalinjurylist.com: did not receive HSTS header
persson.me: could not connect to host
perthdevicelab.com: did not receive HSTS header
pet-nsk.ru: could not connect to host
petchart.net: could not connect to host
@ -2773,6 +2793,7 @@ phonenumberinfo.co.uk: could not connect to host
phongmay24h.com: could not connect to host
phurl.de: could not connect to host
pic.gov: did not receive HSTS header
pickme.nl: could not connect to host
pickr.co: could not connect to host
picotronic.biz: could not connect to host
picscare.co.uk: did not receive HSTS header
@ -2809,7 +2830,6 @@ play.google.com: did not receive HSTS header (error ignored - included regardles
playkh.com: did not receive HSTS header
playmaker.io: could not connect to host
playnation.io: did not receive HSTS header
pleasure.forsale: did not receive HSTS header
pleier-it.de: did not receive HSTS header
pleier.it: did not receive HSTS header
plhdb.org: did not receive HSTS header
@ -2835,7 +2855,6 @@ poolsandstuff.com: did not receive HSTS header
poon.tech: could not connect to host
poris.web.id: did not receive HSTS header
portalplatform.net: did not receive HSTS header
posobota.cz: could not connect to host
postcodewise.co.uk: did not receive HSTS header
posterspy.com: did not receive HSTS header
postscheduler.org: could not connect to host
@ -2857,7 +2876,6 @@ prelist.org: did not receive HSTS header
pressfreedomfoundation.org: did not receive HSTS header
preworkout.me: could not connect to host
prezola.com: did not receive HSTS header
printexpress.cloud: could not connect to host
printfn.com: could not connect to host
priolkar.com: did not receive HSTS header
priva.si: could not connect to host
@ -2882,7 +2900,6 @@ proximato.com: could not connect to host
proxybay.al: could not connect to host
proxybay.club: could not connect to host
proxybay.info: did not receive HSTS header
prxio.date: could not connect to host
prxio.site: could not connect to host
prytkov.com: did not receive HSTS header
psw.academy: did not receive HSTS header
@ -2906,7 +2923,7 @@ pyplo.org: did not receive HSTS header
pypt.lt: did not receive HSTS header
q2.si: did not receive HSTS header
qccqld.org.au: could not connect to host
qingxuan.info: max-age too low: 864000
qingxuan.info: could not connect to host
qinxi1992.com: did not receive HSTS header
qldconservation.org: could not connect to host
qorm.co.uk: did not receive HSTS header
@ -2993,6 +3010,7 @@ respostas.com.br: did not receive HSTS header
restchart.com: did not receive HSTS header
retrotracks.net: max-age too low: 0
revello.org: did not receive HSTS header
revensoftware.com: could not connect to host
reverie.pw: could not connect to host
reviews.anime.my: max-age too low: 5184000
revtut.net: did not receive HSTS header
@ -3020,6 +3038,7 @@ rkmantpur.org: did not receive HSTS header
rme.li: did not receive HSTS header
roan24.pl: did not receive HSTS header
robertglastra.com: could not connect to host
robertof.ovh: could not connect to host
robigalia.org: did not receive HSTS header
robtex.com: did not receive HSTS header
robtex.net: did not receive HSTS header
@ -3030,6 +3049,7 @@ roddis.net: did not receive HSTS header
rodney.id.au: did not receive HSTS header
rodosto.com: did not receive HSTS header
roeper.party: could not connect to host
roesemann.email: could not connect to host
romans-place.me.uk: did not receive HSTS header
ronvandordt.info: did not receive HSTS header
ronwo.de: max-age too low: 1
@ -3062,6 +3082,7 @@ rugirlfriend.com: could not connect to host
ruiming.me: max-age too low: 86400
runawebinar.nl: could not connect to host
runementors.com: could not connect to host
runreport.fr: could not connect to host
runtondev.com: did not receive HSTS header
ruobiyi.com: could not connect to host
ruqu.nl: could not connect to host
@ -3177,6 +3198,8 @@ servercode.ca: did not receive HSTS header
serverdensity.io: did not receive HSTS header
servergno.me: did not receive HSTS header
seryo.moe: could not connect to host
seryo.net: could not connect to host
sesha.co.za: could not connect to host
sethcaplan.com: could not connect to host
setphaserstostun.org: could not connect to host
setuid.de: could not connect to host
@ -3213,6 +3236,7 @@ shukatsu-note.com: could not connect to host
shv25.se: could not connect to host
shwongacc.com: could not connect to host
siammedia.co: could not connect to host
siciliadigitale.pro: could not connect to host
siddhant.me: could not connect to host
sifls.com: could not connect to host
silentcircle.org: could not connect to host
@ -3232,6 +3256,7 @@ simply-premium.com: max-age too low: 0
sincron.org: could not connect to host
siriad.com: did not receive HSTS header
sirius-lee.net: could not connect to host
sitennisclub.com: could not connect to host
sites.google.com: did not receive HSTS header (error ignored - included regardless)
sitesten.com: did not receive HSTS header
sitsy.ru: did not receive HSTS header
@ -3315,6 +3340,7 @@ souyar.us: could not connect to host
sovereignshare.com: could not connect to host
sown.dyndns.org: could not connect to host
spacehq.org: max-age too low: 0
spaggel.nl: could not connect to host
sparelib.com: max-age too low: 3650
spark.team: could not connect to host
sparklingsparklers.com: did not receive HSTS header
@ -3332,6 +3358,7 @@ speidel.com.tr: did not receive HSTS header
spencerbaer.com: could not connect to host
sperohub.io: could not connect to host
spherenix.org: could not connect to host
spibe.is: could not connect to host
spicydog.tk: could not connect to host
spideroak.com: did not receive HSTS header
spiegels.nl: could not connect to host
@ -3412,6 +3439,7 @@ subdimension.org: did not receive HSTS header
subeesu.com: could not connect to host
subrosa.io: could not connect to host
subtitle.rip: could not connect to host
succ.in: could not connect to host
sudo.li: did not receive HSTS header
suian.or.jp: max-age too low: 86400
suite73.org: could not connect to host
@ -3432,6 +3460,7 @@ superwally.org: could not connect to host
suprlink.net: could not connect to host
supweb.ovh: did not receive HSTS header
surfeasy.com: did not receive HSTS header
surfone-leucate.com: did not receive HSTS header
sushi101tempe.com: did not receive HSTS header
suzukikenichi.com: did not receive HSTS header
sv.search.yahoo.com: did not receive HSTS header
@ -3463,6 +3492,7 @@ tafoma.com: did not receive HSTS header
tageau.com: could not connect to host
taglondon.org: did not receive HSTS header
tails.com.ar: did not receive HSTS header
taken.pl: could not connect to host
talk.google.com: did not receive HSTS header (error ignored - included regardless)
talktwincities.com: could not connect to host
tallr.se: could not connect to host
@ -3494,6 +3524,7 @@ tcomms.org: max-age too low: 0
tcp.expert: did not receive HSTS header
teachforcanada.ca: did not receive HSTS header
team-pancake.eu: could not connect to host
teamblueridge.org: could not connect to host
teamsocial.co: did not receive HSTS header
teamzeus.cz: could not connect to host
techassist.io: did not receive HSTS header
@ -3541,7 +3572,6 @@ thecoffeehouse.xyz: could not connect to host
thediaryofadam.com: did not receive HSTS header
thedisc.nl: could not connect to host
theendofzion.com: did not receive HSTS header
theeyeopener.com: did not receive HSTS header
thefootballanalyst.com: could not connect to host
thehiddenbay.me: could not connect to host
thehiddenbay.net: could not connect to host
@ -3595,6 +3625,7 @@ timwittenberg.com: could not connect to host
tipsyk.ru: could not connect to host
tirex.media: did not receive HSTS header
titanleaf.com: could not connect to host
titouan.co: could not connect to host
tittelbach.at: did not receive HSTS header
titties.ml: could not connect to host
tkarstens.de: did not receive HSTS header
@ -3623,7 +3654,9 @@ tomharris.tech: could not connect to host
tomlankhorst.nl: did not receive HSTS header
tomli.me: could not connect to host
tommsy.com: did not receive HSTS header
tommyads.com: could not connect to host
tonburi.jp: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
tonegidoarchief.nl: could not connect to host
tonyfantjr.com: could not connect to host
toomanypillows.com: could not connect to host
topbargains.com.au: did not receive HSTS header
@ -3690,6 +3723,7 @@ txclimbers.com: could not connect to host
txf.pw: could not connect to host
ty2u.com: did not receive HSTS header
tylian.net: max-age too low: 0
typingrevolution.com: did not receive HSTS header
tyrelius.com: did not receive HSTS header
tyroproducts.eu: did not receive HSTS header
tzappa.net: could not connect to host
@ -3847,10 +3881,12 @@ wapjt.cn: could not connect to host
warandpeace.xyz: could not connect to host
warhistoryonline.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
warmlyyours.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
warmservers.com: could not connect to host
warped.com: did not receive HSTS header
warsentech.com: could not connect to host
wassim.is: could not connect to host
watchium.com: did not receive HSTS header
watertrails.io: could not connect to host
watsonhall.uk: could not connect to host
wave.is: could not connect to host
wavefrontsystemstech.com: could not connect to host
@ -3862,7 +3898,7 @@ web4all.fr: max-age too low: 0
web4pro.fr: max-age too low: 0
webandwords.com.au: could not connect to host
webassadors.com: could not connect to host
webdesign-kronberg.de: did not receive HSTS header
webdesign-kronberg.de: could not connect to host
webdev.mobi: could not connect to host
weberjulia.com: [Exception... "Component returned failure code: 0x80004005 (NS_ERROR_FAILURE) [nsISiteSecurityService.processHeader]" nsresult: "0x80004005 (NS_ERROR_FAILURE)" location: "JS frame :: /builds/slave/m-cen-l64-periodicupdate-00000/getHSTSPreloadList.js :: processStsHeader :: line 121" data: no]
webhosting4.net: did not receive HSTS header
@ -3944,12 +3980,13 @@ wolfesden.com: could not connect to host
womosale.de: could not connect to host
wonderfall.xyz: could not connect to host
wonderhost.info: could not connect to host
woodomat.com: could not connect to host
woording.com: could not connect to host
woresite.jp: did not receive HSTS header
workfone.io: did not receive HSTS header
workingclassmedia.com: could not connect to host
workwithgo.com: could not connect to host
wowapi.org: could not connect to host
wpac.de: could not connect to host
wphostingspot.com: did not receive HSTS header
wpmetadatastandardsproject.org: could not connect to host
writeapp.me: did not receive HSTS header
@ -4116,5 +4153,5 @@ ztan.tk: could not connect to host
zten.org: could not connect to host
zulu7.com: could not connect to host
zvncloud.com: did not receive HSTS header
zwy.me: did not receive HSTS header
zwy.me: could not connect to host
zyf.pw: could not connect to host

File diff suppressed because it is too large Load Diff

View File

@ -3,20 +3,21 @@
- 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 window [
<!DOCTYPE dialog [
]>
<window id="winTest" title="Title Test" windowtype="Test Type"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<dialog id="dia"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<dialog id="testDialogAnonymousNode"
buttons="accept, cancel"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<bindings id="testBindings" xmlns="http://www.mozilla.org/xbl"
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<binding id="framebox">
<content orient="vertical" mousethrough="never">
<xul:browser anonid="content" id="browser" flex="1"
context="contentAreaContextMenu"
src="test.xul"
type="content"/>
context="contentAreaContextMenu"
src="test.xul"
type="content"/>
</content>
</binding>
@ -28,8 +29,9 @@
</content>
</binding>
</bindings>
<hbox id="testAnonymousContentBox"/>
<hbox id="container" style="-moz-binding: url('#testBindings');"/>
<hbox id="container2" style="-moz-binding: url('#iframebox');"/>
</dialog>
</window>
</dialog>

View File

@ -277,7 +277,25 @@ element.find = function (container, strategy, selector, opts = {}) {
function find_(container, strategy, selector, searchFn, opts) {
let rootNode = container.shadowRoot || container.frame.document;
let startNode = opts.startNode || rootNode;
let startNode;
if (opts.startNode) {
startNode = opts.startNode;
} else {
switch (strategy) {
// For anonymous nodes the start node needs to be of type DOMElement, which
// will refer to :root in case of a DOMDocument.
case element.Strategy.Anon:
case element.Strategy.AnonAttribute:
if (rootNode instanceof Ci.nsIDOMDocument) {
startNode = rootNode.documentElement;
}
break;
default:
startNode = rootNode;
}
}
let res;
try {

View File

@ -4,17 +4,15 @@
from marionette_driver.by import By
from marionette_driver.errors import NoSuchElementException
from marionette_driver.expected import element_present
from marionette_driver.marionette import HTMLElement
from marionette_driver.wait import Wait
from marionette_harness import MarionetteTestCase, WindowManagerMixin
class TestAnonymousContent(WindowManagerMixin, MarionetteTestCase):
class TestAnonymousNodes(WindowManagerMixin, MarionetteTestCase):
def setUp(self):
super(TestAnonymousContent, self).setUp()
super(TestAnonymousNodes, self).setUp()
self.marionette.set_context("chrome")
def open_window_with_js():
@ -25,11 +23,12 @@ class TestAnonymousContent(WindowManagerMixin, MarionetteTestCase):
new_window = self.open_window(trigger=open_window_with_js)
self.marionette.switch_to_window(new_window)
self.assertNotEqual(self.marionette.current_chrome_window_handle, self.start_window)
def tearDown(self):
self.close_all_windows()
super(TestAnonymousNodes, self).tearDown()
def test_switch_to_anonymous_frame(self):
self.marionette.find_element(By.ID, "testAnonymousContentBox")
anon_browser_el = self.marionette.find_element(By.ID, "browser")
@ -37,7 +36,8 @@ class TestAnonymousContent(WindowManagerMixin, MarionetteTestCase):
self.marionette.switch_to_frame(anon_browser_el)
self.assertTrue("test.xul" in self.marionette.get_url())
self.marionette.find_element(By.ID, "testXulBox")
self.assertRaises(NoSuchElementException, self.marionette.find_element, By.ID, "testAnonymousContentBox")
self.assertRaises(NoSuchElementException,
self.marionette.find_element, By.ID, "testAnonymousContentBox")
def test_switch_to_anonymous_iframe(self):
self.marionette.find_element(By.ID, "testAnonymousContentBox")
@ -50,20 +50,41 @@ class TestAnonymousContent(WindowManagerMixin, MarionetteTestCase):
"testAnonymousContentBox")
def test_find_anonymous_element_by_attribute(self):
el = Wait(self.marionette).until(element_present(By.ID, "dia"))
self.assertEquals(HTMLElement, type(el.find_element(By.ANON_ATTRIBUTE, {"anonid": "buttons"})))
self.assertEquals(1, len(el.find_elements(By.ANON_ATTRIBUTE, {"anonid": "buttons"})))
accept_button = (By.ANON_ATTRIBUTE, {"dlgtype": "accept"},)
not_existent = (By.ANON_ATTRIBUTE, {"anonid": "notexistent"},)
# By using the window document element
start_node = self.marionette.find_element(By.CSS_SELECTOR, ":root")
button = start_node.find_element(*accept_button)
self.assertEquals(HTMLElement, type(button))
with self.assertRaises(NoSuchElementException):
el.find_element(By.ANON_ATTRIBUTE, {"anonid": "nonexistent"})
self.assertEquals([], el.find_elements(By.ANON_ATTRIBUTE, {"anonid": "nonexistent"}))
start_node.find_element(*not_existent)
# By using the default start node
self.assertEquals(button, self.marionette.find_element(*accept_button))
with self.assertRaises(NoSuchElementException):
self.marionette.find_element(*not_existent)
def test_find_anonymous_elements_by_attribute(self):
dialog_buttons = (By.ANON_ATTRIBUTE, {"anonid": "buttons"},)
not_existent = (By.ANON_ATTRIBUTE, {"anonid": "notexistent"},)
# By using the window document element
start_node = self.marionette.find_element(By.CSS_SELECTOR, ":root")
buttons = start_node.find_elements(*dialog_buttons)
self.assertEquals(1, len(buttons))
self.assertEquals(HTMLElement, type(buttons[0]))
self.assertListEqual([], start_node.find_elements(*not_existent))
# By using the default start node
self.assertListEqual(buttons, self.marionette.find_elements(*dialog_buttons))
self.assertListEqual([], self.marionette.find_elements(*not_existent))
def test_find_anonymous_children(self):
el = Wait(self.marionette).until(element_present(By.ID, "dia"))
self.assertEquals(HTMLElement, type(el.find_element(By.ANON, None)))
self.assertEquals(2, len(el.find_elements(By.ANON, None)))
self.assertEquals(HTMLElement, type(self.marionette.find_element(By.ANON, None)))
self.assertEquals(2, len(self.marionette.find_elements(By.ANON, None)))
el = self.marionette.find_element(By.ID, "framebox")
frame = self.marionette.find_element(By.ID, "framebox")
with self.assertRaises(NoSuchElementException):
el.find_element(By.ANON, None)
self.assertEquals([], el.find_elements(By.ANON, None))
frame.find_element(By.ANON, None)
self.assertListEqual([], frame.find_elements(By.ANON, None))

View File

@ -23,6 +23,8 @@ function waitForCondition(condition, nextTest, errorMsg) {
}
function getAnonElementWithinVideoByAttribute(video, aName, aValue) {
const domUtils = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"].
getService(SpecialPowers.Ci.inIDOMUtils);
const videoControl = domUtils.getChildrenForNode(video, true)[1];
return SpecialPowers.wrap(videoControl.ownerDocument)

View File

@ -18,9 +18,6 @@
<script clas="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
const domUtils = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"].
getService(SpecialPowers.Ci.inIDOMUtils);
const video = document.getElementById("video");
const statusOverlay = getAnonElementWithinVideoByAttribute(video, "anonid", "statusOverlay");
const statusIcon = getAnonElementWithinVideoByAttribute(video, "anonid", "statusIcon");

View File

@ -30,8 +30,6 @@
<script clas="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
const domUtils = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"].
getService(SpecialPowers.Ci.inIDOMUtils);
const videoElems = [...document.getElementsByTagName("video")];
const testCases = [];

View File

@ -13,9 +13,8 @@
<pre id="test">
<script class="testbody" type="text/javascript">
const videoBorderWidth = 1;
const videoWidth = 320 + videoBorderWidth * 2;
const videoHeight = 240 + videoBorderWidth * 2;
const videoWidth = 320;
const videoHeight = 240;
function getMediaElement(aWindow) {
return aWindow.document.getElementsByTagName("video")[0];
@ -69,7 +68,7 @@ function runTestAudioPre() {
function runTestAudio(aAudio) {
info("User agent (help diagnose bug #943556): " + navigator.userAgent);
var isAndroid = navigator.userAgent.includes("Android");
var expectedHeight = isAndroid ? 103 : 42;
var expectedHeight = isAndroid ? 103 : 40;
var condition = function() {
var boundingRect = aAudio.getBoundingClientRect();
return boundingRect.height == expectedHeight;

View File

@ -18,8 +18,6 @@
<script clas="testbody" type="application/javascript">
SimpleTest.waitForExplicitFinish();
const domUtils = SpecialPowers.Cc["@mozilla.org/inspector/dom-utils;1"].
getService(SpecialPowers.Ci.inIDOMUtils);
const video = document.getElementById("video");
const ccBtn = getAnonElementWithinVideoByAttribute(video, "anonid", "closedCaptionButton");
const testCases = [];

View File

@ -69,8 +69,15 @@
<!-- =================== nsIAutoCompleteInput =================== -->
<field name="_popup">null</field>
<property name="popup" readonly="true">
<getter><![CDATA[
// Memoize the result in a field rather than replacing this property,
// so that it can be reset along with the binding.
if (this._popup) {
return this._popup;
}
let popup = null;
let popupId = this.getAttribute("autocompletepopup");
if (popupId) {
@ -86,14 +93,7 @@
}
popup.mInput = this;
// Avoid having to recalculate the popup property each time
Object.defineProperty(this, "popup", {
configurable: true,
enumerable: true,
writable: true,
value: popup
});
return popup;
return this._popup = popup;
]]></getter>
</property>

View File

@ -347,8 +347,15 @@
</setter>
</property>
<field name="_tabbox">null</field>
<property name="tabbox" readonly="true">
<getter><![CDATA[
// Memoize the result in a field rather than replacing this property,
// so that it can be reset along with the binding.
if (this._tabbox) {
return this._tabbox;
}
let parent = this.parentNode;
while (parent) {
if (parent.localName == "tabbox") {
@ -357,14 +364,7 @@
parent = parent.parentNode;
}
// Avoid having to recalculate the tabbox property each time
Object.defineProperty(this, "tabbox", {
configurable: true,
enumerable: true,
writable: true,
value: parent
});
return parent;
return this._tabbox = parent;
]]></getter>
</property>
@ -642,8 +642,15 @@
</method>
<!-- public -->
<field name="_tabbox">null</field>
<property name="tabbox" readonly="true">
<getter><![CDATA[
// Memoize the result in a field rather than replacing this property,
// so that it can be reset along with the binding.
if (this._tabbox) {
return this._tabbox;
}
let parent = this.parentNode;
while (parent) {
if (parent.localName == "tabbox") {
@ -652,14 +659,7 @@
parent = parent.parentNode;
}
// Avoid having to recalculate the tabbox property each time
Object.defineProperty(this, "tabbox", {
configurable: true,
enumerable: true,
writable: true,
value: parent
});
return parent;
return this._tabbox = parent;
]]></getter>
</property>

View File

@ -12,8 +12,7 @@
menu,
menuitem,
menucaption,
.splitmenu-menuitem {
menucaption {
-moz-appearance: menuitem;
-moz-box-align: center;
max-width: 42em;
@ -28,15 +27,13 @@ menuitem[default="true"] {
}
menu[_moz-menuactive="true"],
menuitem[_moz-menuactive="true"],
.splitmenu-menuitem[_moz-menuactive="true"] {
menuitem[_moz-menuactive="true"] {
color: -moz-menuhovertext;
background-color: -moz-menuhover;
}
menu[disabled="true"],
menuitem[disabled="true"],
.splitmenu-menuitem[disabled="true"],
menucaption[disabled="true"] {
color: GrayText;
}

View File

@ -8,6 +8,5 @@ body {
}
video {
border: 1px #000000 solid;
box-shadow: 0 0 5px rgba(0,0,0,0.6);
}

View File

@ -12,8 +12,7 @@
menu,
menuitem,
menucaption,
.splitmenu-menuitem {
menucaption {
-moz-appearance: menuitem;
-moz-box-align: center;
color: MenuText;
@ -28,10 +27,8 @@ menuitem[default="true"] {
menu[disabled="true"],
menuitem[disabled="true"],
.splitmenu-menuitem[disabled="true"],
menu[_moz-menuactive="true"][disabled="true"],
menuitem[_moz-menuactive="true"][disabled="true"],
.splitmenu-menuitem[_moz-menuactive="true"][disabled="true"] {
menuitem[_moz-menuactive="true"][disabled="true"] {
color: GrayText;
text-shadow: none;
}
@ -39,8 +36,7 @@ menuitem[_moz-menuactive="true"][disabled="true"],
@media (-moz-windows-classic) {
menu[disabled="true"],
menubar > menu[disabled="true"][_moz-menuactive="true"],
menuitem[disabled="true"],
.splitmenu-menuitem[disabled="true"] {
menuitem[disabled="true"] {
color: ThreeDShadow;
text-shadow: 1px 1px ThreeDHighlight;
}
@ -102,8 +98,7 @@ menucaption > .menu-iconic-text {
}
menu.menu-iconic > .menu-iconic-left,
menuitem.menuitem-iconic > .menu-iconic-left,
.splitmenu-menuitem[iconic="true"] > .menu-iconic-left {
menuitem.menuitem-iconic > .menu-iconic-left {
-moz-appearance: menuimage;
padding-top: 2px;
}
@ -186,8 +181,7 @@ menupopup > menucaption {
}
menu[_moz-menuactive="true"],
menuitem[_moz-menuactive="true"],
.splitmenu-menuitem[_moz-menuactive="true"] {
menuitem[_moz-menuactive="true"] {
background-color: -moz-menuhover;
color: -moz-menuhovertext;
}