Merge mozilla-central to mozilla-inbound

This commit is contained in:
Carsten "Tomcat" Book 2017-04-25 11:52:19 +02:00
Родитель 7eb7732ff7 9155c12847
Коммит aac521e681
116 изменённых файлов: 2068 добавлений и 1386 удалений

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

@ -249,6 +249,25 @@ button {
font-weight: 600;
}
.addon-target-info {
display: grid;
font-size: 14px;
grid-template-columns: 128px 1fr;
}
.addon-target-info-label {
padding-inline-end: 8px;
padding-bottom: 8px;
}
.addon-target-info-label:last-of-type {
padding-bottom: 16px;
}
.addon-target-info-content {
margin: 0;
}
.addon-target-button {
background: none;
border: none;
@ -289,3 +308,18 @@ button {
* lines up with the icon. */
margin-inline-start: -4px;
}
/* We want the ellipsis on the left-hand-side, so make the parent RTL
* with an ellipsis and the child can be LTR. */
.file-path {
direction: rtl;
max-width: 100%;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.file-path-inner {
direction: ltr;
unicode-bidi: plaintext;
}

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

@ -76,7 +76,8 @@ module.exports = createClass({
icon: addon.iconURL || ExtensionIcon,
addonID: addon.id,
addonActor: addon.actor,
temporarilyInstalled: addon.temporarilyInstalled
temporarilyInstalled: addon.temporarilyInstalled,
url: addon.url,
};
});

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

@ -20,6 +20,25 @@ loader.lazyRequireGetter(this, "DebuggerClient",
const Strings = Services.strings.createBundle(
"chrome://devtools/locale/aboutdebugging.properties");
function filePathForTarget(target) {
// Only show file system paths, and only for temporarily installed add-ons.
if (!target.temporarilyInstalled || !target.url || !target.url.startsWith("file://")) {
return [];
}
let path = target.url.slice("file://".length);
return [
dom.dt(
{ className: "addon-target-info-label" },
Strings.GetStringFromName("location")),
// Wrap the file path in a span so we can do some RTL/LTR swapping to get
// the ellipsis on the left.
dom.dd(
{ className: "addon-target-info-content file-path" },
dom.span({ className: "file-path-inner", title: path }, path),
),
];
}
module.exports = createClass({
displayName: "AddonTarget",
@ -31,7 +50,8 @@ module.exports = createClass({
addonID: PropTypes.string.isRequired,
icon: PropTypes.string,
name: PropTypes.string.isRequired,
temporarilyInstalled: PropTypes.bool
temporarilyInstalled: PropTypes.bool,
url: PropTypes.string,
}).isRequired
},
@ -68,6 +88,10 @@ module.exports = createClass({
}),
dom.span({ className: "target-name", title: target.name }, target.name)
),
dom.dl(
{ className: "addon-target-info" },
...filePathForTarget(target),
),
dom.div({className: "addon-target-actions"},
dom.button({
className: "debug-button addon-target-button",

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

@ -20,6 +20,7 @@ support-files =
!/devtools/client/framework/test/shared-head.js
[browser_addons_debug_bootstrapped.js]
[browser_addons_debug_info.js]
[browser_addons_debug_webextension.js]
tags = webextensions
[browser_addons_debug_webextension_inspector.js]

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

@ -0,0 +1,28 @@
"use strict";
const ADDON_ID = "test-devtools@mozilla.org";
const ADDON_NAME = "test-devtools";
add_task(function* () {
let { tab, document } = yield openAboutDebugging("addons");
yield waitForInitialAddonList(document);
yield installAddon({
document,
path: "addons/unpacked/install.rdf",
name: ADDON_NAME,
});
let container = document.querySelector(`[data-addon-id="${ADDON_ID}"]`);
let filePath = container.querySelector(".file-path");
let expectedFilePath = "browser/devtools/client/aboutdebugging/test/addons/unpacked/";
// Verify that the path to the install location is shown next to its label.
ok(filePath, "file path is in DOM");
ok(filePath.textContent.endsWith(expectedFilePath), "file path is set correctly");
is(filePath.previousElementSibling.textContent, "Location", "file path has label");
yield uninstallAddon({document, id: ADDON_ID, name: ADDON_NAME});
yield closeAboutDebugging(tab);
});

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

@ -1,33 +1,33 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests that the qsa commands work as they should.
const TEST_URI = "data:text/html;charset=utf-8,<body></body>";
function test() {
helpers.addTabWithToolbar(TEST_URI, function (options) {
return helpers.audit(options, [
{
setup: "qsa",
check: {
input: "qsa",
hints: " [query]",
markup: "VVV",
status: "VALID"
}
},
{
setup: "qsa body",
check: {
input: "qsa body",
hints: "",
markup: "VVVVVVVV",
status: "VALID"
}
}
]);
}).then(finish, helpers.handleError);
}
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Tests that the qsa commands work as they should.
const TEST_URI = "data:text/html;charset=utf-8,<body></body>";
function test() {
helpers.addTabWithToolbar(TEST_URI, function (options) {
return helpers.audit(options, [
{
setup: "qsa",
check: {
input: "qsa",
hints: " [query]",
markup: "VVV",
status: "VALID"
}
},
{
setup: "qsa body",
check: {
input: "qsa body",
hints: "",
markup: "VVVVVVVV",
status: "VALID"
}
}
]);
}).then(finish, helpers.handleError);
}

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

@ -2,57 +2,57 @@
/* vim: set ft=javascript ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Make sure that canceling a name change correctly unhides the separator and
* value elements.
*/
const TAB_URL = EXAMPLE_URL + "doc_watch-expressions.html";
function test() {
Task.spawn(function* () {
/**
* Make sure that canceling a name change correctly unhides the separator and
* value elements.
*/
const TAB_URL = EXAMPLE_URL + "doc_watch-expressions.html";
function test() {
Task.spawn(function* () {
let options = {
source: TAB_URL,
line: 1
};
let [tab,, panel] = yield initDebugger(TAB_URL, options);
let win = panel.panelWin;
let vars = win.DebuggerView.Variables;
win.DebuggerView.WatchExpressions.addExpression("this");
callInTab(tab, "ermahgerd");
yield waitForDebuggerEvents(panel, win.EVENTS.FETCHED_WATCH_EXPRESSIONS);
let exprScope = vars.getScopeAtIndex(0);
let {target} = exprScope.get("this");
let name = target.querySelector(".title > .name");
let separator = target.querySelector(".separator");
let value = target.querySelector(".value");
is(separator.hidden, false,
"The separator element should not be hidden.");
is(value.hidden, false,
"The value element should not be hidden.");
for (let key of ["ESCAPE", "RETURN"]) {
EventUtils.sendMouseEvent({ type: "dblclick" }, name, win);
is(separator.hidden, true,
"The separator element should be hidden.");
is(value.hidden, true,
"The value element should be hidden.");
EventUtils.sendKey(key, win);
is(separator.hidden, false,
"The separator element should not be hidden.");
is(value.hidden, false,
"The value element should not be hidden.");
}
yield resumeDebuggerThenCloseAndFinish(panel);
});
}
let [tab,, panel] = yield initDebugger(TAB_URL, options);
let win = panel.panelWin;
let vars = win.DebuggerView.Variables;
win.DebuggerView.WatchExpressions.addExpression("this");
callInTab(tab, "ermahgerd");
yield waitForDebuggerEvents(panel, win.EVENTS.FETCHED_WATCH_EXPRESSIONS);
let exprScope = vars.getScopeAtIndex(0);
let {target} = exprScope.get("this");
let name = target.querySelector(".title > .name");
let separator = target.querySelector(".separator");
let value = target.querySelector(".value");
is(separator.hidden, false,
"The separator element should not be hidden.");
is(value.hidden, false,
"The value element should not be hidden.");
for (let key of ["ESCAPE", "RETURN"]) {
EventUtils.sendMouseEvent({ type: "dblclick" }, name, win);
is(separator.hidden, true,
"The separator element should be hidden.");
is(value.hidden, true,
"The value element should be hidden.");
EventUtils.sendKey(key, win);
is(separator.hidden, false,
"The separator element should not be hidden.");
is(value.hidden, false,
"The value element should not be hidden.");
}
yield resumeDebuggerThenCloseAndFinish(panel);
});
}

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

@ -1,80 +1,80 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests opening the variable inspection popup while stopped at a debugger statement,
* clicking "step in" and verifying that the popup is gone.
*/
const TAB_URL = EXAMPLE_URL + "doc_with-frame.html";
let gTab, gPanel, gDebugger;
let actions, gSources, gVariables;
function test() {
let options = {
source: TAB_URL,
line: 1
};
initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
gTab = aTab;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
actions = bindActionCreators(gPanel);
gSources = gDebugger.DebuggerView.Sources;
gVariables = gDebugger.DebuggerView.Variables;
let bubble = gDebugger.DebuggerView.VariableBubble;
let tooltip = bubble._tooltip.panel;
let testPopupHiding = Task.async(function* () {
yield addBreakpoint();
yield ensureThreadClientState(gPanel, "resumed");
yield pauseDebuggee();
yield openVarPopup(gPanel, { line: 20, ch: 17 });
is(tooltip.querySelectorAll(".devtools-tooltip-simple-text").length, 1,
"The popup should be open with a simple text entry");
// Now we're stopped at a breakpoint with an open popup
// we'll send a keypress and check if the popup closes
executeSoon(() => EventUtils.synthesizeKey("VK_F11", {}));
// The keypress should cause one resumed event and one paused event
yield waitForThreadEvents(gPanel, "resumed");
yield waitForThreadEvents(gPanel, "paused");
// Here's the state we're actually interested in checking..
checkVariablePopupClosed(bubble);
yield resumeDebuggerThenCloseAndFinish(gPanel);
});
testPopupHiding();
});
}
function addBreakpoint() {
return actions.addBreakpoint({ actor: gSources.selectedValue, line: 21 });
}
function pauseDebuggee() {
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
// The first 'with' scope should be expanded by default, but the
// variables haven't been fetched yet. This is how 'with' scopes work.
return promise.all([
waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_SCOPES),
waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_VARIABLES)
]);
}
function checkVariablePopupClosed(bubble) {
ok(!bubble.contentsShown(),
"When stepping, popup should close and be hidden.");
ok(bubble._tooltip.isEmpty(),
"The variable inspection popup should now be empty.");
ok(!bubble._markedText,
"The marked text in the editor was removed.");
}
registerCleanupFunction(function () {
gTab = null;
gPanel = null;
gDebugger = null;
actions = null;
gSources = null;
gVariables = null;
});
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Tests opening the variable inspection popup while stopped at a debugger statement,
* clicking "step in" and verifying that the popup is gone.
*/
const TAB_URL = EXAMPLE_URL + "doc_with-frame.html";
let gTab, gPanel, gDebugger;
let actions, gSources, gVariables;
function test() {
let options = {
source: TAB_URL,
line: 1
};
initDebugger(TAB_URL, options).then(([aTab,, aPanel]) => {
gTab = aTab;
gPanel = aPanel;
gDebugger = gPanel.panelWin;
actions = bindActionCreators(gPanel);
gSources = gDebugger.DebuggerView.Sources;
gVariables = gDebugger.DebuggerView.Variables;
let bubble = gDebugger.DebuggerView.VariableBubble;
let tooltip = bubble._tooltip.panel;
let testPopupHiding = Task.async(function* () {
yield addBreakpoint();
yield ensureThreadClientState(gPanel, "resumed");
yield pauseDebuggee();
yield openVarPopup(gPanel, { line: 20, ch: 17 });
is(tooltip.querySelectorAll(".devtools-tooltip-simple-text").length, 1,
"The popup should be open with a simple text entry");
// Now we're stopped at a breakpoint with an open popup
// we'll send a keypress and check if the popup closes
executeSoon(() => EventUtils.synthesizeKey("VK_F11", {}));
// The keypress should cause one resumed event and one paused event
yield waitForThreadEvents(gPanel, "resumed");
yield waitForThreadEvents(gPanel, "paused");
// Here's the state we're actually interested in checking..
checkVariablePopupClosed(bubble);
yield resumeDebuggerThenCloseAndFinish(gPanel);
});
testPopupHiding();
});
}
function addBreakpoint() {
return actions.addBreakpoint({ actor: gSources.selectedValue, line: 21 });
}
function pauseDebuggee() {
generateMouseClickInTab(gTab, "content.document.querySelector('button')");
// The first 'with' scope should be expanded by default, but the
// variables haven't been fetched yet. This is how 'with' scopes work.
return promise.all([
waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_SCOPES),
waitForDebuggerEvents(gPanel, gDebugger.EVENTS.FETCHED_VARIABLES)
]);
}
function checkVariablePopupClosed(bubble) {
ok(!bubble.contentsShown(),
"When stepping, popup should close and be hidden.");
ok(bubble._tooltip.isEmpty(),
"The variable inspection popup should now be empty.");
ok(!bubble._markedText,
"The marked text in the editor was removed.");
}
registerCleanupFunction(function () {
gTab = null;
gPanel = null;
gDebugger = null;
actions = null;
gSources = null;
gVariables = null;
});

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

@ -79,6 +79,10 @@ reload = Reload
# disabled 'reload' button.
reloadDisabledTooltip = Only temporarily installed add-ons can be reloaded
# LOCALIZATION NOTE (location):
# This string is displayed as a label for the filesystem location of an extension.
location = Location
# LOCALIZATION NOTE (workers):
# This string is displayed as a header of the about:debugging#workers page.
workers = Workers

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

@ -40,7 +40,6 @@ const RequestListColumnFile = createClass({
img({
className: "requests-list-icon",
src: responseContentDataUri,
"data-type": responseContentDataUri ? "thumbnail" : undefined,
}),
urlDetails.baseNameWithQuery
)

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

@ -93,18 +93,6 @@ const EVENTS = {
UPDATING_RESPONSE_CONTENT: "NetMonitor:NetworkEventUpdating:ResponseContent",
RECEIVED_RESPONSE_CONTENT: "NetMonitor:NetworkEventUpdated:ResponseContent",
// When the request post params are displayed in the UI.
REQUEST_POST_PARAMS_DISPLAYED: "NetMonitor:RequestPostParamsAvailable",
// When the image response thumbnail is displayed in the UI.
RESPONSE_IMAGE_THUMBNAIL_DISPLAYED:
"NetMonitor:ResponseImageThumbnailAvailable",
// Fired when charts have been displayed in the PerformanceStatisticsView.
PLACEHOLDER_CHARTS_DISPLAYED: "NetMonitor:PlaceholderChartsDisplayed",
PRIMED_CACHE_CHART_DISPLAYED: "NetMonitor:PrimedChartsDisplayed",
EMPTY_CACHE_CHART_DISPLAYED: "NetMonitor:EmptyChartsDisplayed",
// Fired once the NetMonitorController establishes a connection to the debug
// target.
CONNECTED: "connected",

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

@ -7,10 +7,7 @@
const { TimelineFront } = require("devtools/shared/fronts/timeline");
const { CurlUtils } = require("devtools/client/shared/curl");
const { ACTIVITY_TYPE, EVENTS } = require("./constants");
const {
getRequestById,
getDisplayedRequestById,
} = require("./selectors/index");
const { getDisplayedRequestById } = require("./selectors/index");
const {
fetchHeaders,
formDataURI,
@ -307,7 +304,6 @@ function NetworkEventsHandler() {
this._onRequestPostData = this._onRequestPostData.bind(this);
this._onResponseHeaders = this._onResponseHeaders.bind(this);
this._onResponseCookies = this._onResponseCookies.bind(this);
this._onResponseContent = this._onResponseContent.bind(this);
this._onSecurityInfo = this._onSecurityInfo.bind(this);
this._onEventTimings = this._onEventTimings.bind(this);
}
@ -428,45 +424,11 @@ NetworkEventsHandler.prototype = {
.then(() => window.emit(EVENTS.REQUEST_ADDED, id));
},
async updateRequest(id, data) {
await this.actions.updateRequest(id, data, true);
let {
responseContent,
responseCookies,
responseHeaders,
requestCookies,
requestHeaders,
requestPostData,
} = data;
let request = getRequestById(window.gStore.getState(), id);
if (requestHeaders && requestHeaders.headers && requestHeaders.headers.length) {
let headers = await fetchHeaders(requestHeaders, getLongString);
if (headers) {
await this.actions.updateRequest(
id,
{ requestHeaders: headers },
true,
);
}
}
if (responseHeaders && responseHeaders.headers && responseHeaders.headers.length) {
let headers = await fetchHeaders(responseHeaders, getLongString);
if (headers) {
await this.actions.updateRequest(
id,
{ responseHeaders: headers },
true,
);
}
}
if (request && responseContent && responseContent.content) {
let { mimeType } = request;
let { text, encoding } = responseContent.content;
async fetchImage(mimeType, responseContent) {
let payload = {};
if (mimeType && responseContent && responseContent.content) {
let { encoding, text } = responseContent.content;
let response = await getLongString(text);
let payload = {};
if (mimeType.includes("image/")) {
payload.responseContentDataUri = formDataURI(mimeType, encoding, response);
@ -474,16 +436,36 @@ NetworkEventsHandler.prototype = {
responseContent.content.text = response;
payload.responseContent = responseContent;
}
return payload;
},
await this.actions.updateRequest(id, payload, true);
if (mimeType.includes("image/")) {
window.emit(EVENTS.RESPONSE_IMAGE_THUMBNAIL_DISPLAYED);
async fetchRequestHeaders(requestHeaders) {
let payload = {};
if (requestHeaders && requestHeaders.headers && requestHeaders.headers.length) {
let headers = await fetchHeaders(requestHeaders, getLongString);
if (headers) {
payload.requestHeaders = headers;
}
}
return payload;
},
// Search the POST data upload stream for request headers and add
// them as a separate property, different from the classic headers.
async fetchResponseHeaders(responseHeaders) {
let payload = {};
if (responseHeaders && responseHeaders.headers && responseHeaders.headers.length) {
let headers = await fetchHeaders(responseHeaders, getLongString);
if (headers) {
payload.responseHeaders = headers;
}
}
return payload;
},
// Search the POST data upload stream for request headers and add
// them as a separate property, different from the classic headers.
async fetchPostData(requestPostData) {
let payload = {};
if (requestPostData && requestPostData.postData) {
let { text } = requestPostData.postData;
let postData = await getLongString(text);
@ -491,35 +473,15 @@ NetworkEventsHandler.prototype = {
const headersSize = headers.reduce((acc, { name, value }) => {
return acc + name.length + value.length + 2;
}, 0);
let payload = {};
requestPostData.postData.text = postData;
payload.requestPostData = Object.assign({}, requestPostData);
payload.requestHeadersFromUploadStream = { headers, headersSize };
await this.actions.updateRequest(id, payload, true);
}
// Fetch request and response cookies long value.
// Actor does not provide full sized cookie value when the value is too long
// To display values correctly, we need fetch them in each request.
if (requestCookies) {
let reqCookies = [];
// request store cookies in requestCookies or requestCookies.cookies
let cookies = requestCookies.cookies ?
requestCookies.cookies : requestCookies;
// make sure cookies is iterable
if (typeof cookies[Symbol.iterator] === "function") {
for (let cookie of cookies) {
reqCookies.push(Object.assign({}, cookie, {
value: await getLongString(cookie.value),
}));
}
if (reqCookies.length) {
await this.actions.updateRequest(id, { requestCookies: reqCookies }, true);
}
}
}
return payload;
},
async fetchResponseCookies(responseCookies) {
let payload = {};
if (responseCookies) {
let resCookies = [];
// response store cookies in responseCookies or responseCookies.cookies
@ -533,10 +495,70 @@ NetworkEventsHandler.prototype = {
}));
}
if (resCookies.length) {
await this.actions.updateRequest(id, { responseCookies: resCookies }, true);
payload.responseCookies = resCookies;
}
}
}
return payload;
},
// Fetch request and response cookies long value.
// Actor does not provide full sized cookie value when the value is too long
// To display values correctly, we need fetch them in each request.
async fetchRequestCookies(requestCookies) {
let payload = {};
if (requestCookies) {
let reqCookies = [];
// request store cookies in requestCookies or requestCookies.cookies
let cookies = requestCookies.cookies ?
requestCookies.cookies : requestCookies;
// make sure cookies is iterable
if (typeof cookies[Symbol.iterator] === "function") {
for (let cookie of cookies) {
reqCookies.push(Object.assign({}, cookie, {
value: await getLongString(cookie.value),
}));
}
if (reqCookies.length) {
payload.requestCookies = reqCookies;
}
}
}
return payload;
},
async updateRequest(id, data) {
let {
mimeType,
responseContent,
responseCookies,
responseHeaders,
requestCookies,
requestHeaders,
requestPostData,
} = data;
// fetch request detail contents in parallel
let [
imageObj,
requestHeadersObj,
responseHeadersObj,
postDataObj,
requestCookiesObj,
responseCookiesObj,
] = await Promise.all([
this.fetchImage(mimeType, responseContent),
this.fetchRequestHeaders(requestHeaders),
this.fetchResponseHeaders(responseHeaders),
this.fetchPostData(requestPostData),
this.fetchRequestCookies(requestCookies),
this.fetchResponseCookies(responseCookies),
]);
let payload = Object.assign({}, data,
imageObj, requestHeadersObj, responseHeadersObj,
postDataObj, requestCookiesObj, responseCookiesObj);
await this.actions.updateRequest(id, payload, true);
},
/**
@ -568,9 +590,10 @@ NetworkEventsHandler.prototype = {
case "securityInfo":
this.updateRequest(actor, {
securityState: networkInfo.securityInfo,
}).then(() => {
this.webConsoleClient.getSecurityInfo(actor, this._onSecurityInfo);
window.emit(EVENTS.UPDATING_SECURITY_INFO, actor);
});
this.webConsoleClient.getSecurityInfo(actor, this._onSecurityInfo);
window.emit(EVENTS.UPDATING_SECURITY_INFO, actor);
break;
case "responseHeaders":
this.webConsoleClient.getResponseHeaders(actor,
@ -590,25 +613,26 @@ NetworkEventsHandler.prototype = {
status: networkInfo.response.status,
statusText: networkInfo.response.statusText,
headersSize: networkInfo.response.headersSize
}).then(() => {
window.emit(EVENTS.STARTED_RECEIVING_RESPONSE, actor);
});
window.emit(EVENTS.STARTED_RECEIVING_RESPONSE, actor);
break;
case "responseContent":
this.updateRequest(actor, {
contentSize: networkInfo.response.bodySize,
transferredSize: networkInfo.response.transferredSize,
mimeType: networkInfo.response.content.mimeType
});
this.webConsoleClient.getResponseContent(actor,
this._onResponseContent);
this._onResponseContent.bind(this, {
contentSize: networkInfo.response.bodySize,
transferredSize: networkInfo.response.transferredSize,
mimeType: networkInfo.response.content.mimeType
}));
window.emit(EVENTS.UPDATING_RESPONSE_CONTENT, actor);
break;
case "eventTimings":
this.updateRequest(actor, {
totalTime: networkInfo.totalTime
}).then(() => {
this.webConsoleClient.getEventTimings(actor, this._onEventTimings);
window.emit(EVENTS.UPDATING_EVENT_TIMINGS, actor);
});
this.webConsoleClient.getEventTimings(actor, this._onEventTimings);
window.emit(EVENTS.UPDATING_EVENT_TIMINGS, actor);
break;
}
},
@ -700,13 +724,14 @@ NetworkEventsHandler.prototype = {
/**
* Handles additional information received for a "responseContent" packet.
*
* @param object data
* The message received from the server event.
* @param object response
* The message received from the server.
*/
_onResponseContent: function (response) {
this.updateRequest(response.from, {
responseContent: response
}).then(() => {
_onResponseContent: function (data, response) {
let payload = Object.assign({ responseContent: response }, data);
this.updateRequest(response.from, payload).then(() => {
window.emit(EVENTS.RECEIVED_RESPONSE_CONTENT, response.from);
});
},

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

@ -9,22 +9,21 @@
add_task(function* () {
let { tab, monitor } = yield initNetMonitor(CONTENT_TYPE_WITHOUT_CACHE_URL);
const SELECTOR = ".requests-list-icon[src]";
info("Starting test... ");
let { document, gStore, windowRequire } = monitor.panelWin;
let Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
let { NetMonitorController } =
windowRequire("devtools/client/netmonitor/src/netmonitor-controller");
let {
ACTIVITY_TYPE,
EVENTS,
} = windowRequire("devtools/client/netmonitor/src/constants");
let { ACTIVITY_TYPE } = windowRequire("devtools/client/netmonitor/src/constants");
gStore.dispatch(Actions.batchEnable(false));
let wait = waitForEvents();
let wait = waitForNetworkEvents(monitor, CONTENT_TYPE_WITHOUT_CACHE_REQUESTS);
yield performRequests();
yield wait;
yield waitUntil(() => !!document.querySelector(SELECTOR));
info("Checking the image thumbnail when all items are shown.");
checkImageThumbnail();
@ -38,22 +37,16 @@ add_task(function* () {
checkImageThumbnail();
info("Reloading the debuggee and performing all requests again...");
wait = waitForEvents();
wait = waitForNetworkEvents(monitor, CONTENT_TYPE_WITHOUT_CACHE_REQUESTS);
yield reloadAndPerformRequests();
yield wait;
yield waitUntil(() => !!document.querySelector(SELECTOR));
info("Checking the image thumbnail after a reload.");
checkImageThumbnail();
yield teardown(monitor);
function waitForEvents() {
return promise.all([
waitForNetworkEvents(monitor, CONTENT_TYPE_WITHOUT_CACHE_REQUESTS),
monitor.panelWin.once(EVENTS.RESPONSE_IMAGE_THUMBNAIL_DISPLAYED)
]);
}
function performRequests() {
return ContentTask.spawn(tab.linkedBrowser, {}, function* () {
content.wrappedJSObject.performRequests();
@ -66,12 +59,11 @@ add_task(function* () {
}
function checkImageThumbnail() {
is(document.querySelectorAll(".requests-list-icon[data-type=thumbnail]").length, 1,
is(document.querySelectorAll(SELECTOR).length, 1,
"There should be only one image request with a thumbnail displayed.");
is(document.querySelector(".requests-list-icon[data-type=thumbnail]").src,
TEST_IMAGE_DATA_URI,
is(document.querySelector(SELECTOR).src, TEST_IMAGE_DATA_URI,
"The image requests-list-icon thumbnail is displayed correctly.");
is(document.querySelector(".requests-list-icon[data-type=thumbnail]").hidden, false,
is(document.querySelector(SELECTOR).hidden, false,
"The image requests-list-icon thumbnail should not be hidden.");
}
});

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

@ -11,25 +11,22 @@ const IMAGE_TOOLTIP_REQUESTS = 1;
*/
add_task(function* test() {
let { tab, monitor } = yield initNetMonitor(IMAGE_TOOLTIP_URL);
const SELECTOR = ".requests-list-icon[src]";
info("Starting test... ");
let { document, gStore, windowRequire } = monitor.panelWin;
let Actions = windowRequire("devtools/client/netmonitor/src/actions/index");
let { NetMonitorController } =
windowRequire("devtools/client/netmonitor/src/netmonitor-controller");
let {
ACTIVITY_TYPE,
EVENTS,
} = windowRequire("devtools/client/netmonitor/src/constants");
let { ACTIVITY_TYPE } = windowRequire("devtools/client/netmonitor/src/constants");
let toolboxDoc = monitor.panelWin.parent.document;
gStore.dispatch(Actions.batchEnable(false));
let onEvents = waitForNetworkEvents(monitor, IMAGE_TOOLTIP_REQUESTS);
let onThumbnail = monitor.panelWin.once(EVENTS.RESPONSE_IMAGE_THUMBNAIL_DISPLAYED);
yield performRequests();
yield onEvents;
yield onThumbnail;
yield waitUntil(() => !!document.querySelector(SELECTOR));
info("Checking the image thumbnail after a few requests were made...");
yield showTooltipAndVerify(document.querySelectorAll(".request-list-item")[0]);
@ -41,13 +38,12 @@ add_task(function* test() {
// +1 extra document reload
onEvents = waitForNetworkEvents(monitor, IMAGE_TOOLTIP_REQUESTS + 1);
onThumbnail = monitor.panelWin.once(EVENTS.RESPONSE_IMAGE_THUMBNAIL_DISPLAYED);
info("Reloading the debuggee and performing all requests again...");
yield NetMonitorController.triggerActivity(ACTIVITY_TYPE.RELOAD.WITH_CACHE_ENABLED);
yield performRequests();
yield onEvents;
yield onThumbnail;
yield waitUntil(() => !!document.querySelector(SELECTOR));
info("Checking the image thumbnail after a reload.");
yield showTooltipAndVerify(document.querySelectorAll(".request-list-item")[1]);

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

@ -193,7 +193,7 @@ function test() {
);
});
monitor.panelWin.once(EVENTS.UPDATING_RESPONSE_CONTENT, () => {
monitor.panelWin.once(EVENTS.RECEIVED_RESPONSE_CONTENT, () => {
let requestItem = getSortedRequests(gStore.getState()).get(0);
is(requestItem.transferredSize, "12",
@ -203,24 +203,6 @@ function test() {
is(requestItem.mimeType, "text/plain; charset=utf-8",
"The mimeType data has an incorrect value.");
verifyRequestItemTarget(
document,
getDisplayedRequests(gStore.getState()),
requestItem,
"GET",
SIMPLE_SJS,
{
type: "plain",
fullMimeType: "text/plain; charset=utf-8",
transferred: L10N.getFormatStrWithNumbers("networkMenu.sizeB", 12),
size: L10N.getFormatStrWithNumbers("networkMenu.sizeB", 12),
}
);
});
monitor.panelWin.once(EVENTS.RECEIVED_RESPONSE_CONTENT, () => {
let requestItem = getSortedRequests(gStore.getState()).get(0);
ok(requestItem.responseContent,
"There should be a responseContent data available.");
// eslint-disable-next-line mozilla/no-cpows-in-tests

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

@ -29,7 +29,7 @@ const PriorityLevels = {
/**
* This component represents Notification Box - HTML alternative for
* <xul:notifictionbox> binding.
* <xul:notificationbox> binding.
*
* See also MDN for more info about <xul:notificationbox>:
* https://developer.mozilla.org/en-US/docs/Mozilla/Tech/XUL/notificationbox

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

@ -1,18 +1,18 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that we can require acorn.
*/
function run_test() {
const acorn = require("acorn/acorn");
const acorn_loose = require("acorn/acorn_loose");
const walk = require("acorn/util/walk");
do_check_true(isObject(acorn));
do_check_true(isObject(acorn_loose));
do_check_true(isObject(walk));
do_check_eq(typeof acorn.parse, "function");
do_check_eq(typeof acorn_loose.parse_dammit, "function");
do_check_eq(typeof walk.simple, "function");
}
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that we can require acorn.
*/
function run_test() {
const acorn = require("acorn/acorn");
const acorn_loose = require("acorn/acorn_loose");
const walk = require("acorn/util/walk");
do_check_true(isObject(acorn));
do_check_true(isObject(acorn_loose));
do_check_true(isObject(walk));
do_check_eq(typeof acorn.parse, "function");
do_check_eq(typeof acorn_loose.parse_dammit, "function");
do_check_eq(typeof walk.simple, "function");
}

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

@ -1,62 +1,62 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that acorn's lenient parser gives something usable.
*/
const acorn_loose = require("acorn/acorn_loose");
function run_test() {
let actualAST = acorn_loose.parse_dammit("let x = 10", {});
do_print("Actual AST:");
do_print(JSON.stringify(actualAST, null, 2));
do_print("Expected AST:");
do_print(JSON.stringify(expectedAST, null, 2));
checkEquivalentASTs(expectedAST, actualAST);
}
const expectedAST = {
"type": "Program",
"start": 0,
"end": 10,
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 3,
"expression": {
"type": "Identifier",
"start": 0,
"end": 3,
"name": "let"
}
},
{
"type": "ExpressionStatement",
"start": 4,
"end": 10,
"expression": {
"type": "AssignmentExpression",
"start": 4,
"end": 10,
"operator": "=",
"left": {
"type": "Identifier",
"start": 4,
"end": 5,
"name": "x"
},
"right": {
"type": "Literal",
"start": 8,
"end": 10,
"value": 10,
"raw": "10"
}
}
}
]
};
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that acorn's lenient parser gives something usable.
*/
const acorn_loose = require("acorn/acorn_loose");
function run_test() {
let actualAST = acorn_loose.parse_dammit("let x = 10", {});
do_print("Actual AST:");
do_print(JSON.stringify(actualAST, null, 2));
do_print("Expected AST:");
do_print(JSON.stringify(expectedAST, null, 2));
checkEquivalentASTs(expectedAST, actualAST);
}
const expectedAST = {
"type": "Program",
"start": 0,
"end": 10,
"body": [
{
"type": "ExpressionStatement",
"start": 0,
"end": 3,
"expression": {
"type": "Identifier",
"start": 0,
"end": 3,
"name": "let"
}
},
{
"type": "ExpressionStatement",
"start": 4,
"end": 10,
"expression": {
"type": "AssignmentExpression",
"start": 4,
"end": 10,
"operator": "=",
"left": {
"type": "Identifier",
"start": 4,
"end": 5,
"name": "x"
},
"right": {
"type": "Literal",
"start": 8,
"end": 10,
"value": 10,
"raw": "10"
}
}
}
]
};

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

@ -1,37 +1,37 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that Reflect and acorn create the same AST for ES5.
*/
const acorn = require("acorn/acorn");
const { Reflect } = require("resource://gre/modules/reflect.jsm");
const testCode = "" + function main () {
function makeAcc(n) {
return function () {
return ++n;
};
}
var acc = makeAcc(10);
for (var i = 0; i < 10; i++) {
acc();
}
console.log(acc());
};
function run_test() {
const reflectAST = Reflect.parse(testCode);
const acornAST = acorn.parse(testCode);
do_print("Reflect AST:");
do_print(JSON.stringify(reflectAST, null, 2));
do_print("acorn AST:");
do_print(JSON.stringify(acornAST, null, 2));
checkEquivalentASTs(reflectAST, acornAST);
}
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
/**
* Test that Reflect and acorn create the same AST for ES5.
*/
const acorn = require("acorn/acorn");
const { Reflect } = require("resource://gre/modules/reflect.jsm");
const testCode = "" + function main () {
function makeAcc(n) {
return function () {
return ++n;
};
}
var acc = makeAcc(10);
for (var i = 0; i < 10; i++) {
acc();
}
console.log(acc());
};
function run_test() {
const reflectAST = Reflect.parse(testCode);
const acornAST = acorn.parse(testCode);
do_print("Reflect AST:");
do_print(JSON.stringify(reflectAST, null, 2));
do_print("acorn AST:");
do_print(JSON.stringify(acornAST, null, 2));
checkEquivalentASTs(reflectAST, acornAST);
}

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

@ -145,6 +145,7 @@ DOM4_MSG_DEF(AbortError, "Error retrieving push subscription.", NS_ERROR_DOM_PUS
DOM4_MSG_DEF(NetworkError, "Push service unreachable.", NS_ERROR_DOM_PUSH_SERVICE_UNREACHABLE)
DOM4_MSG_DEF(InvalidAccessError, "Invalid raw ECDSA P-256 public key.", NS_ERROR_DOM_PUSH_INVALID_KEY_ERR)
DOM4_MSG_DEF(InvalidStateError, "A subscription with a different application server key already exists.", NS_ERROR_DOM_PUSH_MISMATCHED_KEY_ERR)
DOM4_MSG_DEF(InvalidStateError, "GCM service disabled.", NS_ERROR_DOM_PUSH_GCM_DISABLED)
/* Media errors */
DOM4_MSG_DEF(AbortError, "The fetching process for the media resource was aborted by the user agent at the user's request.", NS_ERROR_DOM_MEDIA_ABORT_ERR)

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

@ -120,6 +120,8 @@ skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulato
skip-if = android_version == '18' # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_basicVideo.html]
skip-if = (android_version == '18' && debug) # android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_basicVideoRemoteHwEncoder.html]
skip-if = os == 'linux' || os == 'mac' || os == 'win' || (android_version == '18' && debug) # android-specific feature. android(Bug 1189784, timeouts on 4.3 emulator)
[test_peerConnection_basicScreenshare.html]
# frequent timeouts/crashes on e10s (bug 1048455)
skip-if = toolkit == 'android' # no screenshare on android

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

@ -0,0 +1,31 @@
<!DOCTYPE HTML>
<html>
<head>
<script type="application/javascript" src="pc.js"></script>
</head>
<body>
<pre id="test">
<script type="application/javascript">
createHTML({
bug: "1265755",
title: "Basic video peer connection with android oop hw encoder"
});
runNetworkTest(options => {
SpecialPowers.pushPrefEnv(
{
set: [
['media.navigator.hardware.vp8_encode.acceleration_enabled', true],
['media.navigator.hardware.vp8_encode.acceleration_remote_enabled', true]
]
}, function (options = {}) {
var test = new PeerConnectionTest(options);
test.setMediaConstraints([{video: true}],
[{video: true}]);
test.run();
})
});
</script>
</pre>
</body>
</html>

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

@ -26,10 +26,8 @@
#include "nsGkAtoms.h"
#include "nsIContent.h"
#include "nsIDOMDocument.h"
#include "nsIDOMElement.h"
#include "nsIDOMNode.h"
#include "nsIDOMNodeFilter.h"
#include "nsIDOMNodeIterator.h"
#include "nsIDOMText.h"
#include "nsNameSpaceManager.h"
#include "nsINode.h"
@ -191,7 +189,7 @@ TextEditRules::BeforeEdit(EditAction action,
RefPtr<Selection> selection = mTextEditor->GetSelection();
NS_ENSURE_STATE(selection);
selection->GetAnchorNode(getter_AddRefs(mCachedSelectionNode));
mCachedSelectionNode = selection->GetAnchorNode();
selection->GetAnchorOffset(&mCachedSelectionOffset);
return NS_OK;
@ -216,7 +214,7 @@ TextEditRules::AfterEdit(EditAction action,
NS_ENSURE_STATE(mTextEditor);
nsresult rv =
mTextEditor->HandleInlineSpellCheck(action, selection,
mCachedSelectionNode,
GetAsDOMNode(mCachedSelectionNode),
mCachedSelectionOffset,
nullptr, 0, nullptr, 0);
NS_ENSURE_SUCCESS(rv, rv);
@ -995,7 +993,7 @@ TextEditRules::DidUndo(Selection* aSelection,
NS_ENSURE_TRUE(theRoot, NS_ERROR_FAILURE);
nsIContent* node = mTextEditor->GetLeftmostChild(theRoot);
if (node && mTextEditor->IsMozEditorBogusNode(node)) {
mBogusNode = do_QueryInterface(node);
mBogusNode = node;
} else {
mBogusNode = nullptr;
}
@ -1045,7 +1043,7 @@ TextEditRules::DidRedo(Selection* aSelection,
RefPtr<Element> node = nodeList->Item(0);
if (mTextEditor->IsMozEditorBogusNode(node)) {
mBogusNode = do_QueryInterface(node);
mBogusNode = node;
} else {
mBogusNode = nullptr;
}
@ -1131,7 +1129,7 @@ TextEditRules::RemoveRedundantTrailingBR()
elem->UnsetAttr(kNameSpaceID_None, nsGkAtoms::type, true);
// set mBogusNode to be this <br>
mBogusNode = do_QueryInterface(elem);
mBogusNode = elem;
// give it the bogus node attribute
elem->SetAttr(kNameSpaceID_None, kMOZEditorBogusNodeAttrAtom,
@ -1220,16 +1218,14 @@ TextEditRules::CreateBogusNodeIfNeeded(Selection* aSelection)
NS_ENSURE_STATE(newContent);
// set mBogusNode to be the newly created <br>
mBogusNode = do_QueryInterface(newContent);
NS_ENSURE_TRUE(mBogusNode, NS_ERROR_NULL_POINTER);
mBogusNode = newContent;
// Give it a special attribute.
newContent->SetAttr(kNameSpaceID_None, kMOZEditorBogusNodeAttrAtom,
kMOZEditorBogusNodeValue, false);
// Put the node in the document.
nsCOMPtr<nsIDOMNode> bodyNode = do_QueryInterface(body);
nsresult rv = mTextEditor->InsertNode(mBogusNode, bodyNode, 0);
nsresult rv = mTextEditor->InsertNode(*mBogusNode, *body, 0);
NS_ENSURE_SUCCESS(rv, rv);
// Set selection.

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

@ -16,7 +16,6 @@
#include "nsString.h"
#include "nscore.h"
class nsIDOMElement;
class nsIDOMNode;
namespace mozilla {
@ -124,7 +123,6 @@ protected:
nsAString* outString,
int32_t aMaxLength);
nsresult DidInsertText(Selection* aSelection, nsresult aResult);
nsresult GetTopEnclosingPre(nsIDOMNode* aNode, nsIDOMNode** aOutPreNode);
nsresult WillInsertBreak(Selection* aSelection, bool* aCancel,
bool* aHandled, int32_t aMaxLength);
@ -235,9 +233,9 @@ protected:
nsString mPasswordIMEText;
uint32_t mPasswordIMEIndex;
// Magic node acts as placeholder in empty doc.
nsCOMPtr<nsIDOMNode> mBogusNode;
nsCOMPtr<nsIContent> mBogusNode;
// Cached selected node.
nsCOMPtr<nsIDOMNode> mCachedSelectionNode;
nsCOMPtr<nsINode> mCachedSelectionNode;
// Cached selected offset.
int32_t mCachedSelectionOffset;
uint32_t mActionNesting;

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

@ -1298,6 +1298,7 @@ struct ParamTraits<mozilla::layers::AsyncDragMetrics>
WriteParam(aMsg, aParam.mDragStartSequenceNumber);
WriteParam(aMsg, aParam.mScrollbarDragOffset);
WriteParam(aMsg, aParam.mScrollTrack);
WriteParam(aMsg, aParam.mScrollThumbLength);
WriteParam(aMsg, aParam.mDirection);
}
@ -1308,6 +1309,7 @@ struct ParamTraits<mozilla::layers::AsyncDragMetrics>
ReadParam(aMsg, aIter, &aResult->mDragStartSequenceNumber) &&
ReadParam(aMsg, aIter, &aResult->mScrollbarDragOffset) &&
ReadParam(aMsg, aIter, &aResult->mScrollTrack) &&
ReadParam(aMsg, aIter, &aResult->mScrollThumbLength) &&
ReadParam(aMsg, aIter, &aResult->mDirection));
}
};

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

@ -411,15 +411,6 @@ public:
return mLayer->GetScrollbarTargetContainerId();
}
int32_t GetScrollThumbLength() const
{
if (GetScrollbarDirection() == ScrollDirection::VERTICAL) {
return mLayer->GetVisibleRegion().GetBounds().height;
} else {
return mLayer->GetVisibleRegion().GetBounds().width;
}
}
bool IsScrollbarContainer() const
{
MOZ_ASSERT(IsValid());

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

@ -495,7 +495,6 @@ APZCTreeManager::PrepareNodeForLayer(const LayerMetricsWrapper& aLayer,
GetEventRegionsOverride(aParent, aLayer));
node->SetScrollbarData(aLayer.GetScrollbarTargetContainerId(),
aLayer.GetScrollbarDirection(),
aLayer.GetScrollThumbLength(),
aLayer.IsScrollbarContainer());
node->SetFixedPosData(aLayer.GetFixedPositionScrollContainerId());
return node;
@ -685,7 +684,6 @@ APZCTreeManager::PrepareNodeForLayer(const LayerMetricsWrapper& aLayer,
// when those properties change.
node->SetScrollbarData(aLayer.GetScrollbarTargetContainerId(),
aLayer.GetScrollbarDirection(),
aLayer.GetScrollThumbLength(),
aLayer.IsScrollbarContainer());
node->SetFixedPosData(aLayer.GetFixedPositionScrollContainerId());
return node;

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

@ -34,6 +34,7 @@ public:
, mPresShellId(0)
, mDragStartSequenceNumber(0)
, mScrollbarDragOffset(0)
, mScrollThumbLength(0)
, mDirection(NONE)
{}
@ -42,12 +43,14 @@ public:
uint64_t aDragStartSequenceNumber,
CSSCoord aScrollbarDragOffset,
const CSSRect& aScrollTrack,
CSSCoord aScrollThumbLength,
DragDirection aDirection)
: mViewId(aViewId)
, mPresShellId(aPresShellId)
, mDragStartSequenceNumber(aDragStartSequenceNumber)
, mScrollbarDragOffset(aScrollbarDragOffset)
, mScrollTrack(aScrollTrack)
, mScrollThumbLength(aScrollThumbLength)
, mDirection(aDirection)
{}
@ -56,6 +59,7 @@ public:
uint64_t mDragStartSequenceNumber;
CSSCoord mScrollbarDragOffset;
CSSRect mScrollTrack;
CSSCoord mScrollThumbLength;
DragDirection mDirection;
};

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

@ -927,9 +927,7 @@ nsEventStatus AsyncPanZoomController::HandleDragEvent(const MouseInput& aEvent,
GetAxisStart(aDragMetrics.mDirection, aDragMetrics.mScrollTrack);
CSSCoord scrollMax = GetAxisLength(aDragMetrics.mDirection, aDragMetrics.mScrollTrack);
scrollMax -= node->GetScrollThumbLength() /
GetAxisScale(aDragMetrics.mDirection, mFrameMetrics.GetZoom()) *
mFrameMetrics.GetPresShellResolution();
scrollMax -= aDragMetrics.mScrollThumbLength;
float scrollPercent = mousePosition / scrollMax;

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

@ -28,7 +28,6 @@ HitTestingTreeNode::HitTestingTreeNode(AsyncPanZoomController* aApzc,
, mLayersId(aLayersId)
, mScrollViewId(FrameMetrics::NULL_SCROLL_ID)
, mScrollDir(ScrollDirection::NONE)
, mScrollThumbLength(0)
, mIsScrollbarContainer(false)
, mFixedPosTarget(FrameMetrics::NULL_SCROLL_ID)
, mOverride(EventRegionsOverride::NoOverride)
@ -97,12 +96,10 @@ HitTestingTreeNode::SetLastChild(HitTestingTreeNode* aChild)
void
HitTestingTreeNode::SetScrollbarData(FrameMetrics::ViewID aScrollViewId,
ScrollDirection aDir,
int32_t aScrollThumbLength,
bool aIsScrollContainer)
{
mScrollViewId = aScrollViewId;
mScrollDir = aDir;
mScrollThumbLength = aScrollThumbLength;
mIsScrollbarContainer = aIsScrollContainer;
}
@ -116,12 +113,6 @@ HitTestingTreeNode::MatchesScrollDragMetrics(const AsyncDragMetrics& aDragMetric
mScrollViewId == aDragMetrics.mViewId;
}
LayerIntCoord
HitTestingTreeNode::GetScrollThumbLength() const
{
return mScrollThumbLength;
}
bool
HitTestingTreeNode::IsScrollbarNode() const
{

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

@ -93,7 +93,6 @@ public:
void SetScrollbarData(FrameMetrics::ViewID aScrollViewId,
ScrollDirection aDir,
int32_t aScrollThumbLength,
bool aIsScrollContainer);
bool MatchesScrollDragMetrics(const AsyncDragMetrics& aDragMetrics) const;
LayerIntCoord GetScrollThumbLength() const;
@ -135,7 +134,6 @@ private:
// This is set for scroll thumb Container layers only.
ScrollDirection mScrollDir;
int32_t mScrollThumbLength;
// This is set for scroll track Container layers only.
bool mIsScrollbarContainer;

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

@ -717,7 +717,7 @@ MessageChannel::Clear()
gUnresolvedPromises -= mPendingPromises.size();
for (auto& pair : mPendingPromises) {
pair.second.mRejectFunction(__func__);
pair.second.mRejectFunction(pair.second.mPromise, __func__);
}
mPendingPromises.clear();

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

@ -98,7 +98,7 @@ class MessageChannel : HasResultCodes, MessageLoop::DestructionObserver
struct PromiseHolder
{
RefPtr<MozPromiseRefcountable> mPromise;
std::function<void(const char*)> mRejectFunction;
std::function<void(MozPromiseRefcountable*, const char*)> mRejectFunction;
};
static Atomic<size_t> gUnresolvedPromises;
friend class PromiseReporter;
@ -186,8 +186,10 @@ class MessageChannel : HasResultCodes, MessageLoop::DestructionObserver
}
PromiseHolder holder;
holder.mPromise = aPromise;
holder.mRejectFunction = [aPromise](const char* aRejectSite) {
aPromise->Reject(PromiseRejectReason::ChannelClosed, aRejectSite);
holder.mRejectFunction = [](MozPromiseRefcountable* aRejectPromise,
const char* aRejectSite) {
static_cast<Promise*>(aRejectPromise)->Reject(
PromiseRejectReason::ChannelClosed, aRejectSite);
};
mPendingPromises.insert(std::make_pair(seqno, Move(holder)));
gUnresolvedPromises++;

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

@ -2,6 +2,8 @@
#include "IPDLUnitTests.h" // fail etc.
#include "mozilla/Unused.h"
namespace mozilla {
namespace _ipdltest {
@ -79,7 +81,7 @@ mozilla::ipc::IPCResult
TestAsyncReturnsChild::RecvNoReturn(RefPtr<NoReturnPromise>&& aPromise)
{
// Leak the promise intentionally
aPromise->AddRef();
Unused << do_AddRef(aPromise);
return IPC_OK();
}

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

@ -1,29 +1,29 @@
# DO NOT EDIT! This is a auto-generated temporary list for Stylo testing
fails == values.html values.html
fails == values-rtl.html values-rtl.html
fails == margin-padding.html margin-padding.html
fails == margin-padding-rtl.html margin-padding-rtl.html
== values.html values.html
== values-rtl.html values-rtl.html
== margin-padding.html margin-padding.html
== margin-padding-rtl.html margin-padding-rtl.html
fails == bar-pseudo-element.html bar-pseudo-element.html
fails == bar-pseudo-element-rtl.html bar-pseudo-element-rtl.html
fails == indeterminate-style-width.html indeterminate-style-width.html
== bar-pseudo-element-rtl.html bar-pseudo-element-rtl.html
== indeterminate-style-width.html indeterminate-style-width.html
# vertical tests
fails == values-vertical.html values-vertical.html
fails == values-vertical-rtl.html values-vertical-rtl.html
fails == margin-padding-vertical.html margin-padding-vertical.html
fails == margin-padding-vertical-rtl.html margin-padding-vertical-rtl.html
fails == bar-pseudo-element-vertical.html bar-pseudo-element-vertical.html
fails == bar-pseudo-element-vertical-rtl.html bar-pseudo-element-vertical-rtl.html
fails == indeterminate-style-height.html indeterminate-style-height.html
== values-vertical.html values-vertical.html
== values-vertical-rtl.html values-vertical-rtl.html
== margin-padding-vertical.html margin-padding-vertical.html
== margin-padding-vertical-rtl.html margin-padding-vertical-rtl.html
== bar-pseudo-element-vertical.html bar-pseudo-element-vertical.html
== bar-pseudo-element-vertical-rtl.html bar-pseudo-element-vertical-rtl.html
== indeterminate-style-height.html indeterminate-style-height.html
# The following test is disabled but kept in the repository because the
# transformations will not behave exactly the same for <progress> and two divs.
# However, it would be possible to manually check those.
fails == transformations.html transformations.html
== transformations.html transformations.html
# Tests for bugs:
fails == block-invalidate.html block-invalidate.html
fails == in-cells.html in-cells.html
== block-invalidate.html block-invalidate.html
== in-cells.html in-cells.html
== max-height.html max-height.html
# Tests for block and inline orientation in combination with writing-mode

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

@ -457,7 +457,7 @@ Gecko_UpdateAnimations(RawGeckoElementBorrowed aElement,
ServoComputedValuesBorrowedOrNull aOldComputedValues,
ServoComputedValuesBorrowedOrNull aComputedValues,
ServoComputedValuesBorrowedOrNull aParentComputedValues,
UpdateAnimationsTasks aTaskBits)
UpdateAnimationsTasks aTasks)
{
MOZ_ASSERT(NS_IsMainThread());
MOZ_ASSERT(aElement);
@ -470,7 +470,6 @@ Gecko_UpdateAnimations(RawGeckoElementBorrowed aElement,
return;
}
UpdateAnimationsTasks tasks = static_cast<UpdateAnimationsTasks>(aTaskBits);
if (presContext->IsDynamic() && aElement->IsInComposedDoc()) {
const ServoComputedValuesWithParent servoValues =
{ aComputedValues, aParentComputedValues };
@ -478,12 +477,23 @@ Gecko_UpdateAnimations(RawGeckoElementBorrowed aElement,
nsCSSPseudoElements::GetPseudoType(aPseudoTagOrNull,
CSSEnabledState::eForAllContent);
if (tasks & UpdateAnimationsTasks::CSSAnimations) {
if (aTasks & UpdateAnimationsTasks::CSSAnimations) {
presContext->AnimationManager()->
UpdateAnimations(const_cast<dom::Element*>(aElement), pseudoType,
servoValues);
}
if (tasks & UpdateAnimationsTasks::CSSTransitions) {
// aComputedValues might be nullptr if the target element is now in a
// display:none subtree. We still call Gecko_UpdateAnimations in this case
// because we need to stop CSS animations in the display:none subtree.
// However, we don't need to update transitions since they are stopped by
// RestyleManager::AnimationsWithDestroyedFrame so we just return early
// here.
if (!aComputedValues) {
return;
}
if (aTasks & UpdateAnimationsTasks::CSSTransitions) {
MOZ_ASSERT(aOldComputedValues);
const ServoComputedValuesWithParent oldServoValues =
{ aOldComputedValues, nullptr };
@ -491,7 +501,7 @@ Gecko_UpdateAnimations(RawGeckoElementBorrowed aElement,
UpdateTransitions(const_cast<dom::Element*>(aElement), pseudoType,
oldServoValues, servoValues);
}
if (tasks & UpdateAnimationsTasks::EffectProperties) {
if (aTasks & UpdateAnimationsTasks::EffectProperties) {
presContext->EffectCompositor()->UpdateEffectProperties(
servoValues, const_cast<dom::Element*>(aElement), pseudoType);
}
@ -958,6 +968,33 @@ Gecko_AtomEqualsUTF8IgnoreCase(nsIAtom* aAtom, const char* aString, uint32_t aLe
return nsContentUtils::EqualsIgnoreASCIICase(atomStr, inStr);
}
void
Gecko_EnsureMozBorderColors(nsStyleBorder* aBorder)
{
aBorder->EnsureBorderColors();
}
void Gecko_ClearMozBorderColors(nsStyleBorder* aBorder, mozilla::Side aSide)
{
aBorder->ClearBorderColors(aSide);
}
void
Gecko_AppendMozBorderColors(nsStyleBorder* aBorder, mozilla::Side aSide,
nscolor aColor)
{
aBorder->AppendBorderColor(aSide, aColor);
}
void
Gecko_CopyMozBorderColors(nsStyleBorder* aDest, const nsStyleBorder* aSrc,
mozilla::Side aSide)
{
if (aSrc->mBorderColors) {
aDest->CopyBorderColorsFrom(aSrc->mBorderColors[aSide], aSide);
}
}
void
Gecko_FontFamilyList_Clear(FontFamilyList* aList) {
aList->Clear();

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

@ -36,6 +36,7 @@ namespace mozilla {
class FontFamilyList;
enum FontFamilyType : uint32_t;
struct Keyframe;
enum Side;
namespace css {
struct URLValue;
};
@ -200,7 +201,7 @@ void Gecko_UpdateAnimations(RawGeckoElementBorrowed aElement,
ServoComputedValuesBorrowedOrNull aOldComputedValues,
ServoComputedValuesBorrowedOrNull aComputedValues,
ServoComputedValuesBorrowedOrNull aParentComputedValues,
mozilla::UpdateAnimationsTasks aTaskBits);
mozilla::UpdateAnimationsTasks aTasks);
bool Gecko_ElementHasAnimations(RawGeckoElementBorrowed aElement,
nsIAtom* aPseudoTagOrNull);
bool Gecko_ElementHasCSSAnimations(RawGeckoElementBorrowed aElement,
@ -239,6 +240,14 @@ const uint16_t* Gecko_GetAtomAsUTF16(nsIAtom* aAtom, uint32_t* aLength);
bool Gecko_AtomEqualsUTF8(nsIAtom* aAtom, const char* aString, uint32_t aLength);
bool Gecko_AtomEqualsUTF8IgnoreCase(nsIAtom* aAtom, const char* aString, uint32_t aLength);
// Border style
void Gecko_EnsureMozBorderColors(nsStyleBorder* aBorder);
void Gecko_ClearMozBorderColors(nsStyleBorder* aBorder, mozilla::Side aSide);
void Gecko_AppendMozBorderColors(nsStyleBorder* aBorder, mozilla::Side aSide,
nscolor aColor);
void Gecko_CopyMozBorderColors(nsStyleBorder* aDest, const nsStyleBorder* aSrc,
mozilla::Side aSide);
// Font style
void Gecko_FontFamilyList_Clear(FontFamilyList* aList);
void Gecko_FontFamilyList_AppendNamed(FontFamilyList* aList, nsIAtom* aName, bool aQuoted);

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

@ -366,13 +366,8 @@ nsStyleBorder::nsStyleBorder(const nsStyleBorder& aSrc)
{
MOZ_COUNT_CTOR(nsStyleBorder);
if (aSrc.mBorderColors) {
EnsureBorderColors();
for (int32_t i = 0; i < 4; i++) {
if (aSrc.mBorderColors[i]) {
mBorderColors[i] = aSrc.mBorderColors[i]->Clone();
} else {
mBorderColors[i] = nullptr;
}
NS_FOR_CSS_SIDES(side) {
CopyBorderColorsFrom(aSrc.mBorderColors[side], side);
}
}

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

@ -1162,6 +1162,14 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleBorder
}
}
void CopyBorderColorsFrom(const nsBorderColors* aSrcBorderColors, mozilla::Side aSide) {
if (aSrcBorderColors) {
EnsureBorderColors();
ClearBorderColors(aSide);
mBorderColors[aSide] = aSrcBorderColors->Clone();
}
}
// Return whether aStyle is a visible style. Invisible styles cause
// the relevant computed border width to be 0.
// Note that this does *not* consider the effects of 'border-image':

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

@ -105,9 +105,6 @@ to mochitest command.
* test_font_face_parser.html `font-language-override`: bug 1355364 [8]
* ... `font-feature-settings`: bug 1355366 [10]
* test_font_face_parser.html `font-weight`: keyword values should be preserved in \@font-face [4]
* unicode-range parsing bugs
* servo/rust-cssparser#133
* test_font_face_parser.html `4E00`: servo/rust-cssparser#135 [2]
* @font-face support bug 1290237
* test_descriptor_storage.html [1]
* test_font_face_parser.html `@font-face` [8]
@ -134,14 +131,6 @@ to mochitest command.
* test_inherit_computation.html `border-image` [2]
* test_initial_computation.html `border-image` [4]
* Unimplemented prefixed properties:
* -moz-border-*-colors bug 1348173
* test_compute_data_with_start_struct.html `-colors` [8]
* test_inherit_computation.html `-colors` [8]
* test_inherit_storage.html `-colors` [12]
* test_initial_computation.html `-colors` [16]
* test_initial_storage.html `-colors` [24]
* test_value_storage.html `-colors` [96]
* test_shorthand_property_getters.html `-colors` [1]
* -moz-force-broken-image-icon servo/servo#16001
* test_compute_data_with_start_struct.html `-moz-force-broken-image-icon` [2]
* test_inherit_computation.html `-moz-force-broken-image-icon` [2]

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

@ -1040,6 +1040,14 @@ nsSliderFrame::StartAPZDrag(WidgetGUIEvent* aEvent)
}
}
nsIFrame* thumbFrame = mFrames.FirstChild();
if (!thumbFrame) {
return;
}
bool isHorizontal = IsXULHorizontal();
nsSize thumbSize = thumbFrame->GetSize();
nscoord thumbLength = isHorizontal ? thumbSize.width : thumbSize.height;
mozilla::layers::FrameMetrics::ViewID scrollTargetId;
bool hasID = nsLayoutUtils::FindIDFor(scrollableContent, &scrollTargetId);
bool hasAPZView = hasID && (scrollTargetId != layers::FrameMetrics::NULL_SCROLL_ID);
@ -1065,8 +1073,10 @@ nsSliderFrame::StartAPZDrag(WidgetGUIEvent* aEvent)
NSAppUnitsToFloatPixels(mDragStart,
float(AppUnitsPerCSSPixel())),
sliderTrackCSS,
IsXULHorizontal() ? AsyncDragMetrics::HORIZONTAL :
AsyncDragMetrics::VERTICAL);
NSAppUnitsToFloatPixels(thumbLength,
float(AppUnitsPerCSSPixel())),
isHorizontal ? AsyncDragMetrics::HORIZONTAL :
AsyncDragMetrics::VERTICAL);
if (!nsLayoutUtils::HasDisplayPort(scrollableContent)) {
return;

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

@ -179,7 +179,12 @@ public class ActionBarPresenter {
private void initIndicator() {
mActionBar.setDisplayHomeAsUpEnabled(true);
final Drawable icon = mActionBar.getThemedContext().getDrawable(R.drawable.ic_close_light);
@SuppressWarnings("deprecation")
final Drawable icon = mActionBar.getThemedContext()
.getResources()
.getDrawable(R.drawable.ic_close_light);
DrawableCompat.setTint(icon, mTextPrimaryColor);
mActionBar.setHomeAsUpIndicator(icon);
}

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

@ -241,7 +241,10 @@ public class CustomTabsActivity extends GeckoApp implements Tabs.OnTabsChangedLi
// insert an action button for menu. click it to show popup menu
popupMenu = createCustomPopupMenu();
actionBarPresenter.addActionButton(menu, getDrawable(R.drawable.ab_menu), true)
@SuppressWarnings("deprecation")
Drawable icon = getResources().getDrawable(R.drawable.ab_menu);
actionBarPresenter.addActionButton(menu, icon, true)
.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View anchor) {

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

@ -61,6 +61,12 @@ public class PushService implements BundleEventListener {
public static final String SERVICE_WEBPUSH = "webpush";
public static final String SERVICE_FXA = "fxa";
public static final double ERROR_GCM_DISABLED = 2154627078L; // = NS_ERROR_DOM_PUSH_GCM_DISABLED
public static final String REPLY_BUNDLE_KEY_ERROR = "error";
public static final String ERROR_BUNDLE_KEY_MESSAGE = "message";
public static final String ERROR_BUNDLE_KEY_RESULT = "result";
private static PushService sInstance;
private static final String[] GECKO_EVENTS = new String[] {
@ -170,7 +176,7 @@ public class PushService implements BundleEventListener {
}
// We'll obtain a new subscription as part of device registration.
if (FxAccountDeviceRegistrator.needToRenewRegistration(fxAccount.getDeviceRegistrationTimestamp())) {
if (FxAccountDeviceRegistrator.shouldRenewRegistration(fxAccount)) {
Log.i(LOG_TAG, "FxA device needs registration renewal");
FxAccountDeviceRegistrator.renewRegistration(context);
}
@ -467,7 +473,13 @@ public class PushService implements BundleEventListener {
// with the WebPush? Perhaps we can show a dialog when interacting with the Push
// permissions, and then be more aggressive showing this notification when we have
// registrations and subscriptions that can't be advanced.
callback.sendError("To handle event [" + event + "], user interaction is needed to enable Google Play Services.");
String msg = "To handle event [" + event + "], user interaction is needed to enable Google Play Services.";
GeckoBundle reply = new GeckoBundle();
GeckoBundle error = new GeckoBundle();
error.putString(ERROR_BUNDLE_KEY_MESSAGE, msg);
error.putDouble(ERROR_BUNDLE_KEY_RESULT, ERROR_GCM_DISABLED);
reply.putBundle(REPLY_BUNDLE_KEY_ERROR, error);
callback.sendError(reply);
}
}

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

@ -3,9 +3,7 @@
* 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/. */
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
@ -60,7 +58,9 @@ FxAccountsPush.prototype = {
resolve(subscription);
} else {
Log.w("FxAccountsPush failed to subscribe", result);
reject(new Error("FxAccountsPush failed to subscribe"));
const err = new Error("FxAccountsPush failed to subscribe");
err.result = result;
reject(err);
}
});
})
@ -76,6 +76,10 @@ FxAccountsPush.prototype = {
})
.catch(err => {
Log.i("Error when registering FxA push endpoint " + err);
EventDispatcher.instance.sendRequest({
type: "FxAccountsPush:Subscribe:Response",
error: err.result.toString() // Convert to string because the GeckoBundle can't getLong();
});
});
},

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

@ -35,16 +35,6 @@ public class FxAccountDevice {
this.pushAuthKey = pushAuthKey;
}
public static FxAccountDevice forRegister(String name, String type, String pushCallback,
String pushPublicKey, String pushAuthKey) {
return new FxAccountDevice(name, null, type, null, pushCallback, pushPublicKey, pushAuthKey);
}
public static FxAccountDevice forUpdate(String id, String name, String pushCallback,
String pushPublicKey, String pushAuthKey) {
return new FxAccountDevice(name, id, null, null, pushCallback, pushPublicKey, pushAuthKey);
}
public static FxAccountDevice fromJson(ExtendedJSONObject json) {
String name = json.getString(JSON_KEY_NAME);
String id = json.getString(JSON_KEY_ID);
@ -78,4 +68,47 @@ public class FxAccountDevice {
}
return body;
}
public static class Builder {
private String id;
private String name;
private String type;
private Boolean isCurrentDevice;
private String pushCallback;
private String pushPublicKey;
private String pushAuthKey;
public void id(String id) {
this.id = id;
}
public void name(String name) {
this.name = name;
}
public void type(String type) {
this.type = type;
}
public void isCurrentDevice() {
this.isCurrentDevice = Boolean.TRUE;
}
public void pushCallback(String pushCallback) {
this.pushCallback = pushCallback;
}
public void pushPublicKey(String pushPublicKey) {
this.pushPublicKey = pushPublicKey;
}
public void pushAuthKey(String pushAuthKey) {
this.pushAuthKey = pushAuthKey;
}
public FxAccountDevice build() {
return new FxAccountDevice(this.name, this.id, this.type, this.isCurrentDevice,
this.pushCallback, this.pushPublicKey, this.pushAuthKey);
}
}
}

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

@ -6,7 +6,9 @@ package org.mozilla.gecko.fxa;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.annotation.VisibleForTesting;
import android.text.TextUtils;
import android.util.Log;
@ -34,7 +36,7 @@ import java.util.concurrent.Executors;
/* This class provides a way to register the current device against FxA
* and also stores the registration details in the Android FxAccount.
* This should be used in a state where we possess a sessionToken, most likely the Married state.
* This should be used in a state where we possess a sessionToken, most likely the Engaged/Married states.
*/
public class FxAccountDeviceRegistrator implements BundleEventListener {
private static final String LOG_TAG = "FxADeviceRegistrator";
@ -44,38 +46,60 @@ public class FxAccountDeviceRegistrator implements BundleEventListener {
// expiring from underneath us, we unsubscribe and resubscribe every 21 days.
// Note that this simple schedule means that we might unsubscribe perfectly valid (but old)
// subscriptions. This will be improved as part of Bug 1345651.
private static final long TIME_BETWEEN_CHANNEL_REGISTRATION_IN_MILLIS = 21 * 24 * 60 * 60 * 1000L;
@VisibleForTesting
static final long TIME_BETWEEN_CHANNEL_REGISTRATION_IN_MILLIS = 21 * 24 * 60 * 60 * 1000L;
@VisibleForTesting
static final long RETRY_TIME_AFTER_GCM_DISABLED_ERROR = 15 * 24 * 60 * 60 * 1000L;
public static final String PUSH_SUBSCRIPTION_REPLY_BUNDLE_KEY_ERROR = "error";
@VisibleForTesting
static final long ERROR_GCM_DISABLED = 2154627078L; // = NS_ERROR_DOM_PUSH_GCM_DISABLED
// The current version of the device registration, we use this to re-register
// devices after we update what we send on device registration.
public static final Integer DEVICE_REGISTRATION_VERSION = 2;
@VisibleForTesting
static final Integer DEVICE_REGISTRATION_VERSION = 2;
private static FxAccountDeviceRegistrator instance;
private final WeakReference<Context> context;
private FxAccountDeviceRegistrator(Context appContext) {
this.context = new WeakReference<Context>(appContext);
this.context = new WeakReference<>(appContext);
}
private static FxAccountDeviceRegistrator getInstance(Context appContext) throws ClassNotFoundException, NoSuchMethodException, InvocationTargetException, IllegalAccessException {
if (instance == null) {
FxAccountDeviceRegistrator tempInstance = new FxAccountDeviceRegistrator(appContext);
final FxAccountDeviceRegistrator tempInstance = new FxAccountDeviceRegistrator(appContext);
tempInstance.setupListeners(); // Set up listener for FxAccountPush:Subscribe:Response
instance = tempInstance;
}
return instance;
}
public static boolean needToRenewRegistration(final long timestamp) {
public static boolean shouldRegister(final AndroidFxAccount fxAccount) {
if (fxAccount.getDeviceRegistrationVersion() != FxAccountDeviceRegistrator.DEVICE_REGISTRATION_VERSION ||
TextUtils.isEmpty(fxAccount.getDeviceId())) {
return true;
}
// At this point, we have a working up-to-date registration, but it might be a partial one
// (no push registration).
return fxAccount.getDevicePushRegistrationError() == ERROR_GCM_DISABLED &&
(System.currentTimeMillis() - fxAccount.getDevicePushRegistrationErrorTime()) > RETRY_TIME_AFTER_GCM_DISABLED_ERROR;
}
public static boolean shouldRenewRegistration(final AndroidFxAccount fxAccount) {
final long deviceRegistrationTimestamp = fxAccount.getDeviceRegistrationTimestamp();
// NB: we're comparing wall clock to wall clock, at different points in time.
// It's possible that wall clocks have changed, and our comparison will be meaningless.
// However, this happens in the context of a sync, and we won't be able to sync anyways if our
// wall clock deviates too much from time on the server.
return (System.currentTimeMillis() - timestamp) > TIME_BETWEEN_CHANNEL_REGISTRATION_IN_MILLIS;
return (System.currentTimeMillis() - deviceRegistrationTimestamp) > TIME_BETWEEN_CHANNEL_REGISTRATION_IN_MILLIS;
}
public static void register(Context context) {
Context appContext = context.getApplicationContext();
final Context appContext = context.getApplicationContext();
try {
getInstance(appContext).beginRegistration(appContext);
} catch (Exception e) {
@ -84,7 +108,7 @@ public class FxAccountDeviceRegistrator implements BundleEventListener {
}
public static void renewRegistration(Context context) {
Context appContext = context.getApplicationContext();
final Context appContext = context.getApplicationContext();
try {
getInstance(appContext).beginRegistrationRenewal(appContext);
} catch (Exception e) {
@ -122,30 +146,51 @@ public class FxAccountDeviceRegistrator implements BundleEventListener {
@Override
public void handleMessage(String event, GeckoBundle message, EventCallback callback) {
if ("FxAccountsPush:Subscribe:Response".equals(event)) {
doFxaRegistration(message.getBundle("subscription"));
handlePushSubscriptionResponse(message);
} else {
Log.e(LOG_TAG, "No action defined for " + event);
}
}
private void doFxaRegistration(GeckoBundle subscription) {
private void handlePushSubscriptionResponse(final GeckoBundle message) {
// Make sure the context has not been gc'd during the push registration
// and the FxAccount still exists.
final Context context = this.context.get();
if (this.context == null) {
if (context == null) {
throw new IllegalStateException("Application context has been gc'ed");
}
doFxaRegistration(context, subscription, true);
}
private static void doFxaRegistration(final Context context, final GeckoBundle subscription, final boolean allowRecursion) {
String pushCallback = subscription.getString("pushCallback");
String pushPublicKey = subscription.getString("pushPublicKey");
String pushAuthKey = subscription.getString("pushAuthKey");
final AndroidFxAccount fxAccount = AndroidFxAccount.fromContext(context);
if (fxAccount == null) {
Log.e(LOG_TAG, "AndroidFxAccount is null");
return;
}
fxAccount.resetDevicePushRegistrationError();
final long error = getSubscriptionReplyError(message);
final FxAccountDevice device;
if (error == 0L) {
Log.i(LOG_TAG, "Push registration succeeded. Beginning normal FxA Registration.");
device = buildFxAccountDevice(context, fxAccount, message.getBundle("subscription"));
} else {
fxAccount.setDevicePushRegistrationError(error, System.currentTimeMillis());
Log.i(LOG_TAG, "Push registration failed. Beginning degraded FxA Registration.");
device = buildFxAccountDevice(context, fxAccount);
}
doFxaRegistration(context, fxAccount, device, true);
}
private long getSubscriptionReplyError(final GeckoBundle message) {
String errorStr = message.getString(PUSH_SUBSCRIPTION_REPLY_BUNDLE_KEY_ERROR);
if (TextUtils.isEmpty(errorStr)) {
return 0L;
}
return Long.parseLong(errorStr);
}
private static void doFxaRegistration(final Context context, final AndroidFxAccount fxAccount,
final FxAccountDevice device, final boolean allowRecursion) {
final byte[] sessionToken;
try {
sessionToken = fxAccount.getState().getSessionToken();
@ -153,19 +198,14 @@ public class FxAccountDeviceRegistrator implements BundleEventListener {
Log.e(LOG_TAG, "Could not get a session token", e);
return;
}
final FxAccountDevice device;
String deviceId = fxAccount.getDeviceId();
String clientName = getClientName(fxAccount, context);
if (TextUtils.isEmpty(deviceId)) {
if (device.id == null) {
Log.i(LOG_TAG, "Attempting registration for a new device");
device = FxAccountDevice.forRegister(clientName, "mobile", pushCallback, pushPublicKey, pushAuthKey);
} else {
Log.i(LOG_TAG, "Attempting registration for an existing device");
Logger.pii(LOG_TAG, "Device ID: " + deviceId);
device = FxAccountDevice.forUpdate(deviceId, clientName, pushCallback, pushPublicKey, pushAuthKey);
}
ExecutorService executor = Executors.newSingleThreadExecutor(); // Not called often, it's okay to spawn another thread
final ExecutorService executor = Executors.newSingleThreadExecutor(); // Not called often, it's okay to spawn another thread
final FxAccountClient20 fxAccountClient =
new FxAccountClient20(fxAccount.getAccountServerURI(), executor);
fxAccountClient.registerOrUpdateDevice(sessionToken, device, new RequestDelegate<FxAccountDevice>() {
@ -185,8 +225,10 @@ public class FxAccountDeviceRegistrator implements BundleEventListener {
if (error.apiErrorNumber == FxAccountRemoteError.UNKNOWN_DEVICE) {
recoverFromUnknownDevice(fxAccount);
} else if (error.apiErrorNumber == FxAccountRemoteError.DEVICE_SESSION_CONFLICT) {
recoverFromDeviceSessionConflict(error, fxAccountClient, sessionToken, fxAccount, context,
subscription, allowRecursion);
// This can happen if a device was already registered using our session token, and we
// tried to create a new one (no id field).
recoverFromDeviceSessionConflict(error, fxAccountClient, sessionToken, fxAccount, device,
context, allowRecursion);
}
} else
if (error.httpStatusCode == 401
@ -201,11 +243,44 @@ public class FxAccountDeviceRegistrator implements BundleEventListener {
public void handleSuccess(FxAccountDevice result) {
Log.i(LOG_TAG, "Device registration complete");
Logger.pii(LOG_TAG, "Registered device ID: " + result.id);
Log.i(LOG_TAG, "Setting DEVICE_REGISTRATION_VERSION to " + DEVICE_REGISTRATION_VERSION);
fxAccount.setFxAUserData(result.id, DEVICE_REGISTRATION_VERSION, System.currentTimeMillis());
}
});
}
private static FxAccountDevice buildFxAccountDevice(Context context, AndroidFxAccount fxAccount) {
return makeFxADeviceCommonBuilder(context, fxAccount).build();
}
private static FxAccountDevice buildFxAccountDevice(Context context, AndroidFxAccount fxAccount, @NonNull GeckoBundle subscription) {
final FxAccountDevice.Builder builder = makeFxADeviceCommonBuilder(context, fxAccount);
final String pushCallback = subscription.getString("pushCallback");
final String pushPublicKey = subscription.getString("pushPublicKey");
final String pushAuthKey = subscription.getString("pushAuthKey");
if (!TextUtils.isEmpty(pushCallback) && !TextUtils.isEmpty(pushPublicKey) &&
!TextUtils.isEmpty(pushAuthKey)) {
builder.pushCallback(pushCallback);
builder.pushPublicKey(pushPublicKey);
builder.pushAuthKey(pushAuthKey);
}
return builder.build();
}
// Do not call this directly, use buildFxAccountDevice instead.
private static FxAccountDevice.Builder makeFxADeviceCommonBuilder(Context context, AndroidFxAccount fxAccount) {
final String deviceId = fxAccount.getDeviceId();
final String clientName = getClientName(fxAccount, context);
final FxAccountDevice.Builder builder = new FxAccountDevice.Builder();
builder.name(clientName);
builder.type("mobile");
if (!TextUtils.isEmpty(deviceId)) {
builder.id(deviceId);
}
return builder;
}
private static void logErrorAndResetDeviceRegistrationVersionAndTimestamp(
final FxAccountClientRemoteException error, final AndroidFxAccount fxAccount) {
Log.e(LOG_TAG, "Device registration failed", error);
@ -216,7 +291,7 @@ public class FxAccountDeviceRegistrator implements BundleEventListener {
@Nullable
private static String getClientName(final AndroidFxAccount fxAccount, final Context context) {
try {
SharedPreferencesClientsDataDelegate clientsDataDelegate =
final SharedPreferencesClientsDataDelegate clientsDataDelegate =
new SharedPreferencesClientsDataDelegate(fxAccount.getSyncPrefs(), context);
return clientsDataDelegate.getClientName();
} catch (UnsupportedEncodingException | GeneralSecurityException e) {
@ -242,7 +317,7 @@ public class FxAccountDeviceRegistrator implements BundleEventListener {
@Override
public void handleSuccess(AccountStatusResponse result) {
State doghouseState = fxAccount.getState().makeDoghouseState();
final State doghouseState = fxAccount.getState().makeDoghouseState();
if (!result.exists) {
Log.i(LOG_TAG, "token invalidated because the account no longer exists");
// TODO: Should be in a "I have an Android account, but the FxA is gone." State.
@ -268,9 +343,12 @@ public class FxAccountDeviceRegistrator implements BundleEventListener {
final FxAccountClient fxAccountClient,
final byte[] sessionToken,
final AndroidFxAccount fxAccount,
final FxAccountDevice device,
final Context context,
final GeckoBundle subscription,
final boolean allowRecursion) {
// Recovery strategy: re-try a registration, UPDATING (instead of creating) the device.
// We do that by finding the device ID who conflicted with us and try a registration update
// using that id.
Log.w(LOG_TAG, "device session conflict, attempting to ascertain the correct device id");
fxAccountClient.deviceList(sessionToken, new RequestDelegate<FxAccountDevice[]>() {
private void onError() {
@ -290,16 +368,20 @@ public class FxAccountDeviceRegistrator implements BundleEventListener {
@Override
public void handleSuccess(FxAccountDevice[] devices) {
for (FxAccountDevice device : devices) {
if (device.isCurrentDevice) {
fxAccount.setFxAUserData(device.id, 0, 0L); // Reset device registration version/timestamp
if (!allowRecursion) {
Log.d(LOG_TAG, "Failure to register a device on the second try");
break;
}
doFxaRegistration(context, subscription, false);
return;
for (final FxAccountDevice fxaDevice : devices) {
if (!fxaDevice.isCurrentDevice) {
continue;
}
fxAccount.setFxAUserData(fxaDevice.id, 0, 0L); // Reset device registration version/timestamp
if (!allowRecursion) {
Log.d(LOG_TAG, "Failure to register a device on the second try");
break;
}
final FxAccountDevice updatedDevice = new FxAccountDevice(device.name, fxaDevice.id, device.type,
device.isCurrentDevice, device.pushCallback,
device.pushPublicKey, device.pushAuthKey);
doFxaRegistration(context, fxAccount, updatedDevice, false);
return;
}
onError();
}
@ -309,10 +391,10 @@ public class FxAccountDeviceRegistrator implements BundleEventListener {
private void setupListeners() throws ClassNotFoundException, NoSuchMethodException,
InvocationTargetException, IllegalAccessException {
// We have no choice but to use reflection here, sorry :(
Class<?> eventDispatcher = Class.forName("org.mozilla.gecko.EventDispatcher");
Method getInstance = eventDispatcher.getMethod("getInstance");
Object instance = getInstance.invoke(null);
Method registerBackgroundThreadListener = eventDispatcher.getMethod("registerBackgroundThreadListener",
final Class<?> eventDispatcher = Class.forName("org.mozilla.gecko.EventDispatcher");
final Method getInstance = eventDispatcher.getMethod("getInstance");
final Object instance = getInstance.invoke(null);
final Method registerBackgroundThreadListener = eventDispatcher.getMethod("registerBackgroundThreadListener",
BundleEventListener.class, String[].class);
registerBackgroundThreadListener.invoke(instance, this, new String[] { "FxAccountsPush:Subscribe:Response" });
}

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

@ -15,7 +15,6 @@ import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.os.ResultReceiver;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.LocalBroadcastManager;
import android.text.TextUtils;
@ -39,6 +38,8 @@ import org.mozilla.gecko.util.ThreadUtils;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import java.security.GeneralSecurityException;
import java.text.NumberFormat;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@ -80,6 +81,8 @@ public class AndroidFxAccount {
public static final String ACCOUNT_KEY_DEVICE_ID = "deviceId";
public static final String ACCOUNT_KEY_DEVICE_REGISTRATION_VERSION = "deviceRegistrationVersion";
private static final String ACCOUNT_KEY_DEVICE_REGISTRATION_TIMESTAMP = "deviceRegistrationTimestamp";
private static final String ACCOUNT_KEY_DEVICE_PUSH_REGISTRATION_ERROR = "devicePushRegistrationError";
private static final String ACCOUNT_KEY_DEVICE_PUSH_REGISTRATION_ERROR_TIME = "devicePushRegistrationErrorTime";
// Account authentication token type for fetching account profile.
public static final String PROFILE_OAUTH_TOKEN_TYPE = "oauth::profile";
@ -802,40 +805,39 @@ public class AndroidFxAccount {
});
}
@SuppressWarnings("unchecked")
private <T extends Number> T getUserDataNumber(String key, T defaultValue) {
final String numStr = accountManager.getUserData(account, key);
if (TextUtils.isEmpty(numStr)) {
return defaultValue;
}
try {
return (T) NumberFormat.getInstance().parse(numStr);
} catch (ParseException e) {
Logger.warn(LOG_TAG, "Couldn't parse " + key + "; defaulting to 0L.", e);
return defaultValue;
}
}
@Nullable
public synchronized String getDeviceId() {
return accountManager.getUserData(account, ACCOUNT_KEY_DEVICE_ID);
}
@NonNull
public synchronized int getDeviceRegistrationVersion() {
String versionStr = accountManager.getUserData(account, ACCOUNT_KEY_DEVICE_REGISTRATION_VERSION);
if (TextUtils.isEmpty(versionStr)) {
return 0;
} else {
try {
return Integer.parseInt(versionStr);
} catch (NumberFormatException ex) {
return 0;
}
}
return getUserDataNumber(ACCOUNT_KEY_DEVICE_REGISTRATION_VERSION, 0);
}
public synchronized long getDeviceRegistrationTimestamp() {
final String timestampStr = accountManager.getUserData(account, ACCOUNT_KEY_DEVICE_REGISTRATION_TIMESTAMP);
return getUserDataNumber(ACCOUNT_KEY_DEVICE_REGISTRATION_TIMESTAMP, 0L);
}
if (TextUtils.isEmpty(timestampStr)) {
return 0L;
}
public synchronized long getDevicePushRegistrationError() {
return getUserDataNumber(ACCOUNT_KEY_DEVICE_PUSH_REGISTRATION_ERROR, 0L);
}
// Long.parseLong might throw; while it's not expected that this might happen, let's not risk
// crashing here as this method will be called on startup.
try {
return Long.parseLong(timestampStr);
} catch (NumberFormatException e) {
Logger.warn(LOG_TAG, "Couldn't parse deviceRegistrationTimestamp; defaulting to 0L.", e);
return 0L;
}
public synchronized long getDevicePushRegistrationErrorTime() {
return getUserDataNumber(ACCOUNT_KEY_DEVICE_PUSH_REGISTRATION_ERROR_TIME, 0L);
}
public synchronized void setDeviceId(String id) {
@ -864,6 +866,15 @@ public class AndroidFxAccount {
Long.toString(timestamp));
}
public synchronized void setDevicePushRegistrationError(long error, long errorTimeMs) {
accountManager.setUserData(account, ACCOUNT_KEY_DEVICE_PUSH_REGISTRATION_ERROR, Long.toString(error));
accountManager.setUserData(account, ACCOUNT_KEY_DEVICE_PUSH_REGISTRATION_ERROR_TIME, Long.toString(errorTimeMs));
}
public synchronized void resetDevicePushRegistrationError() {
setDevicePushRegistrationError(0L, 0l);
}
@SuppressLint("ParcelCreator") // The CREATOR field is defined in the super class.
private class ProfileResultReceiver extends ResultReceiver {
public ProfileResultReceiver(Handler handler) {

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

@ -409,13 +409,12 @@ public class FxAccountSyncAdapter extends AbstractThreadedSyncAdapter {
// As part of device registration, we obtain a PushSubscription, register our push endpoint
// with FxA, and update account data with fxaDeviceId, which is part of our synced
// clients record.
if (fxAccount.getDeviceRegistrationVersion() != FxAccountDeviceRegistrator.DEVICE_REGISTRATION_VERSION
|| TextUtils.isEmpty(fxAccount.getDeviceId())) {
if (FxAccountDeviceRegistrator.shouldRegister(fxAccount)) {
FxAccountDeviceRegistrator.register(context);
// We might need to re-register periodically to ensure our FxA push subscription is valid.
// This involves unsubscribing, subscribing and updating remote FxA device record with
// new push subscription information.
} else if (FxAccountDeviceRegistrator.needToRenewRegistration(fxAccount.getDeviceRegistrationTimestamp())) {
} else if (FxAccountDeviceRegistrator.shouldRenewRegistration(fxAccount)) {
FxAccountDeviceRegistrator.renewRegistration(context);
}
}

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

@ -0,0 +1,91 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
package org.mozilla.gecko.fxa;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.mozilla.gecko.background.testhelpers.TestRunner;
import org.mozilla.gecko.fxa.authenticator.AndroidFxAccount;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertTrue;
import static org.mockito.Mockito.when;
@RunWith(TestRunner.class)
public class TestFxAccountDeviceRegistrator {
@Mock
AndroidFxAccount fxAccount;
@Before
public void init() {
// Process Mockito annotations
MockitoAnnotations.initMocks(this);
}
@Test
public void shouldRegister() {
// Assuming there is no previous push registration errors recorded:
when(fxAccount.getDevicePushRegistrationError()).thenReturn(0L);
when(fxAccount.getDevicePushRegistrationErrorTime()).thenReturn(0L);
// Should return false if the device registration version is up-to-date and a device ID is stored.
// (general case after a successful device registration)
when(fxAccount.getDeviceRegistrationVersion()).thenReturn(FxAccountDeviceRegistrator.DEVICE_REGISTRATION_VERSION);
when(fxAccount.getDeviceId()).thenReturn("bogusdeviceid");
assertFalse(FxAccountDeviceRegistrator.shouldRegister(fxAccount));
// Should return true if the device registration version is up-to-date but no device ID is stored.
// (data mangling)
when(fxAccount.getDeviceRegistrationVersion()).thenReturn(FxAccountDeviceRegistrator.DEVICE_REGISTRATION_VERSION);
when(fxAccount.getDeviceId()).thenReturn(null);
assertTrue(FxAccountDeviceRegistrator.shouldRegister(fxAccount));
// Should return true if the device ID is stored but no device registration version can be found.
// (data mangling)
when(fxAccount.getDeviceRegistrationVersion()).thenReturn(0);
when(fxAccount.getDeviceId()).thenReturn("bogusid");
assertTrue(FxAccountDeviceRegistrator.shouldRegister(fxAccount));
// Should return true if the device registration version is too old.
// (code update pushed)
when(fxAccount.getDeviceRegistrationVersion()).thenReturn(FxAccountDeviceRegistrator.DEVICE_REGISTRATION_VERSION - 1);
assertTrue(FxAccountDeviceRegistrator.shouldRegister(fxAccount));
// Should return true if the device registration is OK, but we didn't get a push subscription because
// Google Play Services were unavailable at the time and the retry delay is passed.
when(fxAccount.getDeviceRegistrationVersion()).thenReturn(FxAccountDeviceRegistrator.DEVICE_REGISTRATION_VERSION);
when(fxAccount.getDevicePushRegistrationError()).thenReturn(FxAccountDeviceRegistrator.ERROR_GCM_DISABLED);
when(fxAccount.getDevicePushRegistrationErrorTime()).thenReturn(System.currentTimeMillis() -
FxAccountDeviceRegistrator.RETRY_TIME_AFTER_GCM_DISABLED_ERROR - 1);
assertTrue(FxAccountDeviceRegistrator.shouldRegister(fxAccount));
// Should return false if the device registration is OK, but we didn't get a push subscription because
// Google Play Services were unavailable at the time and the retry delay has not passed.
// We assume that RETRY_TIME_AFTER_GCM_DISABLED_ERROR is longer than the time it takes to execute this test :)
when(fxAccount.getDevicePushRegistrationErrorTime()).thenReturn(System.currentTimeMillis());
assertFalse(FxAccountDeviceRegistrator.shouldRegister(fxAccount));
// Should return false if the device registration is OK, but we didn't get a push subscription because
// an unknown error happened at the time.
when(fxAccount.getDevicePushRegistrationError()).thenReturn(12345L);
assertFalse(FxAccountDeviceRegistrator.shouldRegister(fxAccount));
}
@Test
public void shouldRenewRegistration() {
// Should return true if our last push registration was done a day before our expiration threshold.
when(fxAccount.getDeviceRegistrationTimestamp()).thenReturn(System.currentTimeMillis() -
FxAccountDeviceRegistrator.TIME_BETWEEN_CHANNEL_REGISTRATION_IN_MILLIS -
1 * 24 * 60 * 60 * 1000L);
// Should return false if our last push registration is recent enough.
// We assume that TIME_BETWEEN_CHANNEL_REGISTRATION_IN_MILLIS is longer than a day + the time it takes to run this test.
when(fxAccount.getDeviceRegistrationTimestamp()).thenReturn(System.currentTimeMillis() -
1 * 24 * 60 * 60 * 1000L);
}
}

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

@ -14,10 +14,19 @@ add_task(function* test_merge_bookmarks_flat() {
let rootFolder = yield CloudSync().bookmarks.getRootFolder("TEST");
ok(rootFolder.id, "root folder id is ok");
let items = [
{"id":"G_UL4ZhOyX8m", "type":rootFolder.BOOKMARK, "title":"reddit: the front page of the internet 1", "uri":"http://www.reddit.com", index:2},
{"id":"G_UL4ZhOyX8n", "type":rootFolder.BOOKMARK, "title":"reddit: the front page of the internet 2", "uri":"http://www.reddit.com?1", index:1},
];
let items = [{
"id": "G_UL4ZhOyX8m",
"type": rootFolder.BOOKMARK,
"title": "reddit: the front page of the internet 1",
"uri": "http://www.reddit.com",
index: 2
}, {
"id": "G_UL4ZhOyX8n",
"type": rootFolder.BOOKMARK,
"title": "reddit: the front page of the internet 2",
"uri": "http://www.reddit.com?1",
index: 1
}];
yield rootFolder.mergeRemoteItems(items);
let localItems = yield rootFolder.getLocalItems();
@ -32,11 +41,23 @@ add_task(function* test_merge_bookmarks_in_folders() {
let rootFolder = yield CloudSync().bookmarks.getRootFolder("TEST");
ok(rootFolder.id, "root folder id is ok");
let items = [
{"id":"G_UL4ZhOyX8m", "type":rootFolder.BOOKMARK, "title":"reddit: the front page of the internet 1", "uri":"http://www.reddit.com", index:2},
{"id":"G_UL4ZhOyX8n", "type":rootFolder.BOOKMARK, parent:"G_UL4ZhOyX8x", "title":"reddit: the front page of the internet 2", "uri":"http://www.reddit.com/?a=å%20ä%20ö", index:1},
{"id":"G_UL4ZhOyX8x", "type":rootFolder.FOLDER},
];
let items = [{
"id": "G_UL4ZhOyX8m",
"type": rootFolder.BOOKMARK,
"title": "reddit: the front page of the internet 1",
"uri": "http://www.reddit.com",
index: 2
}, {
"id": "G_UL4ZhOyX8n",
"type": rootFolder.BOOKMARK,
parent: "G_UL4ZhOyX8x",
"title": "reddit: the front page of the internet 2",
"uri": "http://www.reddit.com/?a=å%20ä%20ö",
index: 1
}, {
"id": "G_UL4ZhOyX8x",
"type": rootFolder.FOLDER
}];
yield rootFolder.mergeRemoteItems(items);
let localItems = yield rootFolder.getLocalItems();

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

@ -17,10 +17,17 @@ add_task(function* test_get_remote_tabs() {
yield cloudSync.tabs.mergeRemoteTabs({
id: "001",
name: "FakeClient",
}, [
{url:"https://www.google.ca?a=å%20ä%20ö", title:"Google Canada", icon:"https://www.google.ca/favicon.ico", lastUsed:0},
{url:"http://www.reddit.com", title:"Reddit", icon:"http://www.reddit.com/favicon.ico", lastUsed:1},
]);
}, [{
url: "https://www.google.ca?a=å%20ä%20ö",
title: "Google Canada",
icon: "https://www.google.ca/favicon.ico",
lastUsed: 0
}, {
url: "http://www.reddit.com",
title: "Reddit",
icon: "http://www.reddit.com/favicon.ico",
lastUsed: 1
}]);
ok(cloudSync.tabs.hasRemoteTabs());
clients = yield cloudSync.tabs.getRemoteTabs();

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

@ -169,7 +169,16 @@ function getSampleResponse(req, port) {
"Server: waitress"
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"settings":{"batch_max_requests":25}, "url":`http://localhost:${port}/v1/`, "documentation":"https://kinto.readthedocs.org/", "version":"1.5.1", "commit":"cbc6f58", "hello":"kinto"})
"responseBody": JSON.stringify({
"settings": {
"batch_max_requests": 25
},
"url": `http://localhost:${port}/v1/`,
"documentation": "https://kinto.readthedocs.org/",
"version": "1.5.1",
"commit": "cbc6f58",
"hello": "kinto"
})
},
"GET:/v1/buckets/blocklists/collections/certificates/records?_sort=-last_modified": {
"sampleHeaders": [
@ -180,7 +189,7 @@ function getSampleResponse(req, port) {
"Etag: \"1000\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{}]})
"responseBody": JSON.stringify({"data": [{}]})
},
"GET:/v1/buckets/blocklists/collections/certificates/records?_sort=-last_modified&_since=1000": {
"sampleHeaders": [
@ -191,11 +200,11 @@ function getSampleResponse(req, port) {
"Etag: \"3000\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{
"responseBody": JSON.stringify({"data": [{
"issuerName": "MEQxCzAJBgNVBAYTAlVTMRUwEwYDVQQKEwx0aGF3dGUsIEluYy4xHjAcBgNVBAMTFXRoYXd0ZSBFViBTU0wgQ0EgLSBHMw==",
"serialNumber":"CrTHPEE6AZSfI3jysin2bA==",
"id":"78cf8900-fdea-4ce5-f8fb-b78710617718",
"last_modified":3000
"serialNumber": "CrTHPEE6AZSfI3jysin2bA==",
"id": "78cf8900-fdea-4ce5-f8fb-b78710617718",
"last_modified": 3000
}]})
},
"GET:/v1/buckets/blocklists/collections/certificates/records?_sort=-last_modified&_since=3000": {
@ -207,16 +216,16 @@ function getSampleResponse(req, port) {
"Etag: \"4000\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{
"issuerName":"MFkxCzAJBgNVBAYTAk5MMR4wHAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKjAoBgNVBAMTIVN0YWF0IGRlciBOZWRlcmxhbmRlbiBPdmVyaGVpZCBDQQ",
"serialNumber":"ATFpsA==",
"id":"dabafde9-df4a-ddba-2548-748da04cc02c",
"last_modified":4000
"responseBody": JSON.stringify({"data": [{
"issuerName": "MFkxCzAJBgNVBAYTAk5MMR4wHAYDVQQKExVTdGFhdCBkZXIgTmVkZXJsYW5kZW4xKjAoBgNVBAMTIVN0YWF0IGRlciBOZWRlcmxhbmRlbiBPdmVyaGVpZCBDQQ",
"serialNumber": "ATFpsA==",
"id": "dabafde9-df4a-ddba-2548-748da04cc02c",
"last_modified": 4000
}, {
"subject":"MCIxIDAeBgNVBAMMF0Fub3RoZXIgVGVzdCBFbmQtZW50aXR5",
"pubKeyHash":"VCIlmPM9NkgFQtrs4Oa5TeFcDu6MWRTKSNdePEhOgD8=",
"id":"dabafde9-df4a-ddba-2548-748da04cc02d",
"last_modified":4000
"subject": "MCIxIDAeBgNVBAMMF0Fub3RoZXIgVGVzdCBFbmQtZW50aXR5",
"pubKeyHash": "VCIlmPM9NkgFQtrs4Oa5TeFcDu6MWRTKSNdePEhOgD8=",
"id": "dabafde9-df4a-ddba-2548-748da04cc02d",
"last_modified": 4000
}]})
},
"GET:/v1/buckets/blocklists/collections/certificates/records?_sort=-last_modified&_since=4000": {
@ -228,21 +237,21 @@ function getSampleResponse(req, port) {
"Etag: \"5000\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{
"issuerName":"not a base64 encoded issuer",
"serialNumber":"not a base64 encoded serial",
"id":"dabafde9-df4a-ddba-2548-748da04cc02e",
"last_modified":5000
"responseBody": JSON.stringify({"data": [{
"issuerName": "not a base64 encoded issuer",
"serialNumber": "not a base64 encoded serial",
"id": "dabafde9-df4a-ddba-2548-748da04cc02e",
"last_modified": 5000
}, {
"subject":"not a base64 encoded subject",
"pubKeyHash":"not a base64 encoded pubKeyHash",
"id":"dabafde9-df4a-ddba-2548-748da04cc02f",
"last_modified":5000
"subject": "not a base64 encoded subject",
"pubKeyHash": "not a base64 encoded pubKeyHash",
"id": "dabafde9-df4a-ddba-2548-748da04cc02f",
"last_modified": 5000
}, {
"subject":"MCIxIDAeBgNVBAMMF0Fub3RoZXIgVGVzdCBFbmQtZW50aXR5",
"pubKeyHash":"VCIlmPM9NkgFQtrs4Oa5TeFcDu6MWRTKSNdePEhOgD8=",
"id":"dabafde9-df4a-ddba-2548-748da04cc02g",
"last_modified":5000
"subject": "MCIxIDAeBgNVBAMMF0Fub3RoZXIgVGVzdCBFbmQtZW50aXR5",
"pubKeyHash": "VCIlmPM9NkgFQtrs4Oa5TeFcDu6MWRTKSNdePEhOgD8=",
"id": "dabafde9-df4a-ddba-2548-748da04cc02g",
"last_modified": 5000
}]})
}
};

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

@ -231,7 +231,16 @@ function getSampleResponse(req, port) {
"Server: waitress"
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"settings":{"batch_max_requests":25}, "url":`http://localhost:${port}/v1/`, "documentation":"https://kinto.readthedocs.org/", "version":"1.5.1", "commit":"cbc6f58", "hello":"kinto"})
"responseBody": JSON.stringify({
"settings": {
"batch_max_requests": 25
},
"url": `http://localhost:${port}/v1/`,
"documentation": "https://kinto.readthedocs.org/",
"version": "1.5.1",
"commit": "cbc6f58",
"hello": "kinto"
})
},
"GET:/v1/buckets/blocklists/collections/addons/records?_sort=-last_modified": {
"sampleHeaders": [
@ -242,7 +251,7 @@ function getSampleResponse(req, port) {
"Etag: \"3000\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{
"responseBody": JSON.stringify({"data": [{
"prefs": [],
"blockID": "i539",
"last_modified": 3000,
@ -265,7 +274,7 @@ function getSampleResponse(req, port) {
"Etag: \"3000\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{
"responseBody": JSON.stringify({"data": [{
"matchFilename": "NPFFAddOn.dll",
"blockID": "p28",
"id": "7b1e0b3c-e390-a817-11b6-a6887f65f56e",
@ -282,7 +291,7 @@ function getSampleResponse(req, port) {
"Etag: \"3000\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{
"responseBody": JSON.stringify({"data": [{
"driverVersionComparator": "LESS_THAN_OR_EQUAL",
"driverVersion": "8.17.12.5896",
"vendor": "0x10de",
@ -304,7 +313,7 @@ function getSampleResponse(req, port) {
"Etag: \"4000\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{
"responseBody": JSON.stringify({"data": [{
"prefs": [],
"blockID": "i808",
"last_modified": 4000,
@ -339,7 +348,7 @@ function getSampleResponse(req, port) {
"Etag: \"4000\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{
"responseBody": JSON.stringify({"data": [{
"infoURL": "https://get.adobe.com/flashplayer/",
"blockID": "p1044",
"matchFilename": "libflashplayer\\.so",
@ -376,7 +385,7 @@ function getSampleResponse(req, port) {
"Etag: \"4000\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{
"responseBody": JSON.stringify({"data": [{
"vendor": "0x8086",
"blockID": "g204",
"feature": "WEBGL_MSAA",

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

@ -218,7 +218,16 @@ function getSampleResponse(req, port) {
"Server: waitress"
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"settings":{"batch_max_requests":25}, "url":`http://localhost:${port}/v1/`, "documentation":"https://kinto.readthedocs.org/", "version":"1.5.1", "commit":"cbc6f58", "hello":"kinto"})
"responseBody": JSON.stringify({
"settings": {
"batch_max_requests": 25
},
"url": `http://localhost:${port}/v1/`,
"documentation": "https://kinto.readthedocs.org/",
"version": "1.5.1",
"commit": "cbc6f58",
"hello": "kinto"
})
},
"GET:/v1/buckets/pinning/collections/pins/records?_sort=-last_modified": {
"sampleHeaders": [
@ -229,16 +238,16 @@ function getSampleResponse(req, port) {
"Etag: \"3000\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{
"responseBody": JSON.stringify({"data": [{
"pinType": "KeyPin",
"hostName": "one.example.com",
"includeSubdomains": false,
"expires": new Date().getTime() + 1000000,
"pins" : ["cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=",
"pins": ["cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=",
"M8HztCzM3elUxkcjR2S5P4hhyBNf6lHkmjAHKhpGPWE="],
"versions" : [appInfo.version],
"id":"78cf8900-fdea-4ce5-f8fb-b78710617718",
"last_modified":3000
"versions": [appInfo.version],
"id": "78cf8900-fdea-4ce5-f8fb-b78710617718",
"last_modified": 3000
}]})
},
"GET:/v1/buckets/pinning/collections/pins/records?_sort=-last_modified&_since=3000": {
@ -250,44 +259,44 @@ function getSampleResponse(req, port) {
"Etag: \"4000\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{
"responseBody": JSON.stringify({"data": [{
"pinType": "KeyPin",
"hostName": "two.example.com",
"includeSubdomains": false,
"expires": new Date().getTime() + 1000000,
"pins" : ["cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=",
"pins": ["cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=",
"M8HztCzM3elUxkcjR2S5P4hhyBNf6lHkmjAHKhpGPWE="],
"versions" : [appInfo.version],
"id":"dabafde9-df4a-ddba-2548-748da04cc02c",
"last_modified":4000
"versions": [appInfo.version],
"id": "dabafde9-df4a-ddba-2548-748da04cc02c",
"last_modified": 4000
}, {
"pinType": "KeyPin",
"hostName": "three.example.com",
"includeSubdomains": false,
"expires": new Date().getTime() + 1000000,
"pins" : ["cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=",
"pins": ["cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=",
"M8HztCzM3elUxkcjR2S5P4hhyBNf6lHkmjAHKhpGPWE="],
"versions" : [appInfo.version, "some other version that won't match"],
"id":"dabafde9-df4a-ddba-2548-748da04cc02d",
"last_modified":4000
"versions": [appInfo.version, "some other version that won't match"],
"id": "dabafde9-df4a-ddba-2548-748da04cc02d",
"last_modified": 4000
}, {
"pinType": "KeyPin",
"hostName": "four.example.com",
"includeSubdomains": false,
"expires": new Date().getTime() + 1000000,
"pins" : ["cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=",
"pins": ["cUPcTAZWKaASuYWhhneDttWpY3oBAkE3h2+soZS7sWs=",
"M8HztCzM3elUxkcjR2S5P4hhyBNf6lHkmjAHKhpGPWE="],
"versions" : ["some version that won't match"],
"id":"dabafde9-df4a-ddba-2548-748da04cc02e",
"last_modified":4000
"versions": ["some version that won't match"],
"id": "dabafde9-df4a-ddba-2548-748da04cc02e",
"last_modified": 4000
}, {
"pinType": "STSPin",
"hostName": "five.example.com",
"includeSubdomains": false,
"expires": new Date().getTime() + 1000000,
"versions" : [appInfo.version, "some version that won't match"],
"id":"dabafde9-df4a-ddba-2548-748da04cc032",
"last_modified":4000
"versions": [appInfo.version, "some version that won't match"],
"id": "dabafde9-df4a-ddba-2548-748da04cc032",
"last_modified": 4000
}]})
},
"GET:/v1/buckets/pinning/collections/pins/records?_sort=-last_modified&_since=4000": {
@ -299,37 +308,37 @@ function getSampleResponse(req, port) {
"Etag: \"5000\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{
"irrelevant":"this entry looks nothing whatsoever like a pin preload",
"responseBody": JSON.stringify({"data": [{
"irrelevant": "this entry looks nothing whatsoever like a pin preload",
"pinType": "KeyPin",
"id":"dabafde9-df4a-ddba-2548-748da04cc02f",
"last_modified":5000
"id": "dabafde9-df4a-ddba-2548-748da04cc02f",
"last_modified": 5000
}, {
"irrelevant":"this entry has data of the wrong type",
"irrelevant": "this entry has data of the wrong type",
"pinType": "KeyPin",
"hostName": 3,
"includeSubdomains": "nonsense",
"expires": "more nonsense",
"pins" : [1, 2, 3, 4],
"id":"dabafde9-df4a-ddba-2548-748da04cc030",
"last_modified":5000
"pins": [1, 2, 3, 4],
"id": "dabafde9-df4a-ddba-2548-748da04cc030",
"last_modified": 5000
}, {
"irrelevant":"this entry is missing the actual pins",
"irrelevant": "this entry is missing the actual pins",
"pinType": "KeyPin",
"hostName": "missingpins.example.com",
"includeSubdomains": false,
"expires": new Date().getTime() + 1000000,
"versions" : [appInfo.version],
"id":"dabafde9-df4a-ddba-2548-748da04cc031",
"last_modified":5000
"versions": [appInfo.version],
"id": "dabafde9-df4a-ddba-2548-748da04cc031",
"last_modified": 5000
}, {
"pinType": "STSPin",
"hostName": "five.example.com",
"includeSubdomains": true,
"expires": new Date().getTime() + 1000000,
"versions" : [appInfo.version, "some version that won't match"],
"id":"dabafde9-df4a-ddba-2548-748da04cc032",
"last_modified":5000
"versions": [appInfo.version, "some version that won't match"],
"id": "dabafde9-df4a-ddba-2548-748da04cc032",
"last_modified": 5000
}]})
}
};

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

@ -255,7 +255,16 @@ add_task(function* test_check_signatures() {
"Server: waitress"
],
status: {status: 200, statusText: "OK"},
responseBody: JSON.stringify({"settings":{"batch_max_requests":25}, "url":`http://localhost:${port}/v1/`, "documentation":"https://kinto.readthedocs.org/", "version":"1.5.1", "commit":"cbc6f58", "hello":"kinto"})
responseBody: JSON.stringify({
"settings": {
"batch_max_requests": 25
},
"url": `http://localhost:${port}/v1/`,
"documentation": "https://kinto.readthedocs.org/",
"version": "1.5.1",
"commit": "cbc6f58",
"hello": "kinto"
})
};
// This is the initial, empty state of the collection. This is only used
@ -281,7 +290,7 @@ add_task(function* test_check_signatures() {
// Here, we map request method and path to the available responses
const emptyCollectionResponses = {
"GET:/test_blocklist_signatures/test_cert_chain.pem?":[RESPONSE_CERT_CHAIN],
"GET:/test_blocklist_signatures/test_cert_chain.pem?": [RESPONSE_CERT_CHAIN],
"GET:/v1/?": [RESPONSE_SERVER_SETTINGS],
"GET:/v1/buckets/blocklists/collections/certificates/records?_sort=-last_modified":
[RESPONSE_EMPTY_INITIAL],

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

@ -19,7 +19,7 @@ function do_get_kinto_sqliteHandle() {
function do_get_kinto_collection(sqliteHandle, collection = "test_collection") {
let config = {
remote:`http://localhost:${server.identity.primaryPort}/v1/`,
remote: `http://localhost:${server.identity.primaryPort}/v1/`,
headers: {Authorization: "Basic " + btoa("user:pass")},
adapter: FirefoxAdapter,
adapterOptions: {sqliteHandle},
@ -378,7 +378,16 @@ function getSampleResponse(req, port) {
"Server: waitress"
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"settings":{"batch_max_requests":25}, "url":`http://localhost:${port}/v1/`, "documentation":"https://kinto.readthedocs.org/", "version":"1.5.1", "commit":"cbc6f58", "hello":"kinto"})
"responseBody": JSON.stringify({
"settings": {
"batch_max_requests": 25
},
"url": `http://localhost:${port}/v1/`,
"documentation": "https://kinto.readthedocs.org/",
"version": "1.5.1",
"commit": "cbc6f58",
"hello": "kinto"
})
},
"GET:/v1/buckets/default/collections/test_collection/records?_sort=-last_modified": {
"sampleHeaders": [
@ -389,7 +398,14 @@ function getSampleResponse(req, port) {
"Etag: \"1445606341071\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{"last_modified":1445606341071, "done":false, "id":"68db8313-686e-4fff-835e-07d78ad6f2af", "title":"New test"}]})
"responseBody": JSON.stringify({
"data": [{
"last_modified": 1445606341071,
"done": false,
"id": "68db8313-686e-4fff-835e-07d78ad6f2af",
"title": "New test"
}]
})
},
"GET:/v1/buckets/default/collections/test_collection/records?_sort=-last_modified&_since=1445606341071": {
"sampleHeaders": [
@ -400,7 +416,14 @@ function getSampleResponse(req, port) {
"Etag: \"1445607941223\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{"last_modified":1445607941223, "done":false, "id":"901967b0-f729-4b30-8d8d-499cba7f4b1d", "title":"Another new test"}]})
"responseBody": JSON.stringify({
"data": [{
"last_modified": 1445607941223,
"done": false,
"id": "901967b0-f729-4b30-8d8d-499cba7f4b1d",
"title": "Another new test"
}]
})
},
"GET:/v1/buckets/default/collections/test_collection/records?_sort=-last_modified&_since=1445607941223": {
"sampleHeaders": [
@ -411,7 +434,14 @@ function getSampleResponse(req, port) {
"Etag: \"1445607541265\""
],
"status": {status: 200, statusText: "OK"},
"responseBody": JSON.stringify({"data":[{"last_modified":1445607541265, "done":false, "id":"901967b0-f729-4b30-8d8d-499cba7f4b1d", "title":"Modified title"}]})
"responseBody": JSON.stringify({
"data": [{
"last_modified": 1445607541265,
"done": false,
"id": "901967b0-f729-4b30-8d8d-499cba7f4b1d",
"title": "Modified title"
}]
})
}
};
return responses[`${req.method}:${req.path}?${req.queryString}`] ||

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

@ -43,7 +43,7 @@ function test_collection_operations() {
add_task(function* test_kinto_create_new_get_existing() {
let sqliteHandle = yield do_get_kinto_connection();
let adapter = do_get_kinto_adapter(sqliteHandle);
let record = {id:"test-id", foo:"bar"};
let record = {id: "test-id", foo: "bar"};
yield adapter.execute((transaction) => transaction.create(record));
let newRecord = yield adapter.get("test-id");
// ensure the record is the same as when it was added
@ -56,7 +56,7 @@ function test_collection_operations() {
let sqliteHandle = yield do_get_kinto_connection();
let adapter = do_get_kinto_adapter(sqliteHandle);
// create a second record
let record = {id:"test-id-2", foo:"baz"};
let record = {id: "test-id-2", foo: "baz"};
yield adapter.execute((transaction) => transaction.create(record));
let newRecord = yield adapter.get("test-id-2");
deepEqual(record, newRecord);
@ -86,8 +86,8 @@ function test_collection_operations() {
add_task(function* test_kinto_update_get_existing() {
let sqliteHandle = yield do_get_kinto_connection();
let adapter = do_get_kinto_adapter(sqliteHandle);
let originalRecord = {id:"test-id", foo:"bar"};
let updatedRecord = {id:"test-id", foo:"baz"};
let originalRecord = {id: "test-id", foo: "bar"};
let updatedRecord = {id: "test-id", foo: "baz"};
yield adapter.clear();
yield adapter.execute((transaction) => transaction.create(originalRecord));
yield adapter.execute((transaction) => transaction.update(updatedRecord));
@ -102,7 +102,7 @@ function test_collection_operations() {
add_task(function* test_kinto_list() {
let sqliteHandle = yield do_get_kinto_connection();
let adapter = do_get_kinto_adapter(sqliteHandle);
let originalRecord = {id:"test-id-1", foo:"bar"};
let originalRecord = {id: "test-id-1", foo: "bar"};
let records = yield adapter.list();
do_check_eq(records.length, 1);
yield adapter.execute((transaction) => transaction.create(originalRecord));

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

@ -28,14 +28,14 @@ this.WeaveCrypto = function WeaveCrypto() {
};
WeaveCrypto.prototype = {
prefBranch : null,
debug : true, // services.sync.log.cryptoDebug
prefBranch: null,
debug: true, // services.sync.log.cryptoDebug
observer : {
_self : null,
observer: {
_self: null,
QueryInterface : XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
QueryInterface: XPCOMUtils.generateQI([Ci.nsIObserver,
Ci.nsISupportsWeakReference]),
observe(subject, topic, data) {
let self = this._self;

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

@ -182,7 +182,7 @@ this.CryptoUtils = {
* The output is an octet string of length dkLen, which you
* can encode as you wish.
*/
pbkdf2Generate : function pbkdf2Generate(P, S, c, dkLen,
pbkdf2Generate: function pbkdf2Generate(P, S, c, dkLen,
hmacAlg = Ci.nsICryptoHMAC.SHA1, hmacLen = 20) {
// We don't have a default in the algo itself, as NSS does.

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

@ -296,7 +296,7 @@ ClientEngine.prototype = {
// We assume that clients not present in the FxA Device Manager list have been
// disconnected and so are stale
_refreshKnownStaleClients() {
this._log.debug('Refreshing the known stale clients list');
this._log.debug("Refreshing the known stale clients list");
let localClients = Object.values(this._store._remoteClients)
.filter(client => client.fxaDeviceId) // iOS client records don't have fxaDeviceId
.map(client => client.fxaDeviceId);
@ -304,7 +304,7 @@ ClientEngine.prototype = {
try {
fxaClients = Async.promiseSpinningly(this.fxAccounts.getDeviceList()).map(device => device.id);
} catch (ex) {
this._log.error('Could not retrieve the FxA device list', ex);
this._log.error("Could not retrieve the FxA device list", ex);
this._knownStaleFxADeviceIds = [];
return;
}

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

@ -302,7 +302,7 @@ this.Utils = {
* N.B., salt should be base64 encoded, even though we have to decode
* it later!
*/
derivePresentableKeyFromPassphrase : function derivePresentableKeyFromPassphrase(passphrase, salt, keyLength, forceJS) {
derivePresentableKeyFromPassphrase: function derivePresentableKeyFromPassphrase(passphrase, salt, keyLength, forceJS) {
let k = CryptoUtils.deriveKeyFromPassphrase(passphrase, salt, keyLength,
forceJS);
return Utils.encodeKeyBase32(k);
@ -312,7 +312,7 @@ this.Utils = {
* N.B., salt should be base64 encoded, even though we have to decode
* it later!
*/
deriveEncodedKeyFromPassphrase : function deriveEncodedKeyFromPassphrase(passphrase, salt, keyLength, forceJS) {
deriveEncodedKeyFromPassphrase: function deriveEncodedKeyFromPassphrase(passphrase, salt, keyLength, forceJS) {
let k = CryptoUtils.deriveKeyFromPassphrase(passphrase, salt, keyLength,
forceJS);
return Utils.base64Key(k);
@ -323,7 +323,7 @@ this.Utils = {
* uppercase alphanumeric characters, separated by hyphens.
* A.K.A. base64-to-base32 encoding.
*/
presentEncodedKeyAsSyncKey : function presentEncodedKeyAsSyncKey(encodedKey) {
presentEncodedKeyAsSyncKey: function presentEncodedKeyAsSyncKey(encodedKey) {
return Utils.encodeKeyBase32(atob(encodedKey));
},
@ -461,13 +461,13 @@ this.Utils = {
try {
if (args) {
return Str.errors.formatStringFromName(error, args, args.length);
} else {
return Str.errors.GetStringFromName(error);
}
return Str.errors.GetStringFromName(error);
} catch (e) {}
// basically returns "Unknown Error"
return Str.errors.GetStringFromName('error.reason.unknown');
return Str.errors.GetStringFromName("error.reason.unknown");
},
/**

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

@ -58,26 +58,26 @@ var bookmarks_after = {
* Test phases
*/
Phase('phase1', [
Phase("phase1", [
[Bookmarks.add, bookmarks_initial],
[Bookmarks.verify, bookmarks_initial],
[Sync]
]);
Phase('phase2', [
Phase("phase2", [
[Bookmarks.add, bookmarks_initial],
[Bookmarks.verify, bookmarks_initial],
[Sync]
]);
Phase('phase3', [
Phase("phase3", [
[Bookmarks.verify, bookmarks_initial],
[Bookmarks.modify, bookmarks_initial],
[Bookmarks.verify, bookmarks_after],
[Sync]
]);
Phase('phase4', [
Phase("phase4", [
[Sync],
[Bookmarks.verify, bookmarks_after]
]);

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

@ -513,22 +513,22 @@ add_task(async function test_mismatched_types() {
let oldRecord = {
"id": "l1nZZXfB8nC7",
"type":"folder",
"parentName":"Bookmarks Toolbar",
"title":"Innerst i Sneglehode",
"description":null,
"type": "folder",
"parentName": "Bookmarks Toolbar",
"title": "Innerst i Sneglehode",
"description": null,
"parentid": "toolbar"
};
oldRecord.cleartext = oldRecord;
let newRecord = {
"id": "l1nZZXfB8nC7",
"type":"livemark",
"siteUri":"http://sneglehode.wordpress.com/",
"feedUri":"http://sneglehode.wordpress.com/feed/",
"parentName":"Bookmarks Toolbar",
"title":"Innerst i Sneglehode",
"description":null,
"type": "livemark",
"siteUri": "http://sneglehode.wordpress.com/",
"feedUri": "http://sneglehode.wordpress.com/feed/",
"parentName": "Bookmarks Toolbar",
"title": "Innerst i Sneglehode",
"description": null,
"children":
["HCRq40Rnxhrd", "YeyWCV1RVsYw", "GCceVZMhvMbP", "sYi2hevdArlF",
"vjbZlPlSyGY8", "UtjUhVyrpeG6", "rVq8WMG2wfZI", "Lx0tcy43ZKhZ",

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

@ -21,14 +21,14 @@ var record631361 = {
index: 150,
modified: 1296768176.49,
payload:
{"id":"M5bwUKK8hPyF",
"type":"livemark",
"siteUri":"http://www.bbc.co.uk/go/rss/int/news/-/news/",
"feedUri":"http://fxfeeds.mozilla.com/en-US/firefox/headlines.xml",
"parentName":"Bookmarks Toolbar",
"parentid":"toolbar",
"title":"Latest Headlines",
"description":"",
{"id": "M5bwUKK8hPyF",
"type": "livemark",
"siteUri": "http://www.bbc.co.uk/go/rss/int/news/-/news/",
"feedUri": "http://fxfeeds.mozilla.com/en-US/firefox/headlines.xml",
"parentName": "Bookmarks Toolbar",
"parentid": "toolbar",
"title": "Latest Headlines",
"description": "",
"children":
["7oBdEZB-8BMO", "SUd1wktMNCTB", "eZe4QWzo1BcY", "YNBhGwhVnQsN",
"92Aw2SMEkFg0", "uw0uKqrVFwd-", "x7mx2P3--8FJ", "d-jVF8UuC9Ye",

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

@ -74,7 +74,7 @@ async function promiseValidationDone(expected) {
actual.sort((a, b) => String(a.name).localeCompare(b.name));
expected.sort((a, b) => String(a.name).localeCompare(b.name));
deepEqual(actual, expected);
};
}
async function cleanup(server) {
bookmarksEngine._store.wipe();
@ -166,8 +166,8 @@ add_task(async function test_bookmark_repair_integration() {
// sync again - we should have a few problems...
_("Sync again to trigger repair");
validationPromise = promiseValidationDone([
{"name":"missingChildren","count":1},
{"name":"structuralDifferences","count":1},
{"name": "missingChildren", "count": 1},
{"name": "structuralDifferences", "count": 1},
]);
Service.sync();
await validationPromise;
@ -396,8 +396,8 @@ add_task(async function test_repair_client_missing() {
// sync again - we should have a few problems...
_("Syncing again.");
validationPromise = promiseValidationDone([
{"name":"clientMissing","count":1},
{"name":"structuralDifferences","count":1},
{"name": "clientMissing", "count": 1},
{"name": "structuralDifferences", "count": 1},
]);
Service.sync();
await validationPromise;
@ -480,8 +480,8 @@ add_task(async function test_repair_server_missing() {
// sync again - we should have a few problems...
_("Syncing again.");
validationPromise = promiseValidationDone([
{"name":"serverMissing","count":1},
{"name":"missingChildren","count":1},
{"name": "serverMissing", "count": 1},
{"name": "missingChildren", "count": 1},
]);
Service.sync();
await validationPromise;
@ -567,9 +567,9 @@ add_task(async function test_repair_server_deleted() {
// sync again - we should have a few problems...
_("Syncing again.");
validationPromise = promiseValidationDone([
{"name":"serverDeleted","count":1},
{"name":"deletedChildren","count":1},
{"name":"orphans","count":1}
{"name": "serverDeleted", "count": 1},
{"name": "deletedChildren", "count": 1},
{"name": "orphans", "count": 1}
]);
Service.sync();
await validationPromise;

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

@ -496,17 +496,17 @@ add_task(async function test_requestor_already_repairing_continue() {
{ method: "started",
object: "repair",
value: undefined,
extra: { flowID: flowID, numIDs: "3" },
extra: { flowID, numIDs: "3" },
},
{ method: "request",
object: "repair",
value: "upload",
extra: { flowID: flowID, numIDs: "3", deviceID: "client-a" },
extra: { flowID, numIDs: "3", deviceID: "client-a" },
},
{ method: "aborted",
object: "repair",
value: undefined,
extra: { flowID: flowID, numIDs: "3", reason: "other clients repairing" },
extra: { flowID, numIDs: "3", reason: "other clients repairing" },
}
];

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

@ -947,7 +947,7 @@ add_task(async function test_engine_applyFailed() {
engine.enabled = true;
delete engine.exception;
engine.sync = function sync() {
Svc.Obs.notify("weave:engine:sync:applied", {newFailed:1}, "catapult");
Svc.Obs.notify("weave:engine:sync:applied", {newFailed: 1}, "catapult");
};
Svc.Prefs.set("log.appender.file.logOnError", true);

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

@ -25,23 +25,23 @@ function TPSCmdLineHandler() {}
TPSCmdLineHandler.prototype = {
classDescription: "TPSCmdLineHandler",
classID : TPS_CMDLINE_CLSID,
contractID : TPS_CMDLINE_CONTRACTID,
classID: TPS_CMDLINE_CLSID,
contractID: TPS_CMDLINE_CONTRACTID,
QueryInterface: XPCOMUtils.generateQI([nsISupports,
nsICommandLineHandler,
nsICmdLineHandler]), /* nsISupports */
/* nsICmdLineHandler */
commandLineArgument : "-tps",
prefNameForStartup : "general.startup.tps",
helpText : "Run TPS tests with the given test file.",
handlesArgs : true,
defaultArgs : "",
openWindowWithArgs : true,
commandLineArgument: "-tps",
prefNameForStartup: "general.startup.tps",
helpText: "Run TPS tests with the given test file.",
handlesArgs: true,
defaultArgs: "",
openWindowWithArgs: true,
/* nsICommandLineHandler */
handle : function handler_handle(cmdLine) {
handle: function handler_handle(cmdLine) {
let options = {};
let uristr = cmdLine.handleFlagWithParam("tps", false);
@ -72,10 +72,10 @@ TPSCmdLineHandler.prototype = {
// cmdLine.preventDefault = true;
},
helpInfo : " --tps <file> Run TPS tests with the given test file.\n" +
" --tpsphase <phase> Run the specified phase in the TPS test.\n" +
" --tpslogfile <file> Logfile for TPS output.\n" +
" --ignore-unused-engines Don't load engines not used in tests.\n",
helpInfo: " --tps <file> Run TPS tests with the given test file.\n" +
" --tpsphase <phase> Run the specified phase in the TPS test.\n" +
" --tpslogfile <file> Logfile for TPS output.\n" +
" --ignore-unused-engines Don't load engines not used in tests.\n",
};

34
servo/Cargo.lock сгенерированный
Просмотреть файл

@ -281,7 +281,7 @@ version = "0.0.1"
dependencies = [
"azure 0.15.0 (git+https://github.com/servo/rust-azure)",
"canvas_traits 0.0.1",
"cssparser 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gleam 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
"ipc-channel 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)",
@ -296,7 +296,7 @@ dependencies = [
name = "canvas_traits"
version = "0.0.1"
dependencies = [
"cssparser 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -511,10 +511,10 @@ dependencies = [
[[package]]
name = "cssparser"
version = "0.12.1"
version = "0.13.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"cssparser-macros 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser-macros 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"phf 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
@ -526,7 +526,7 @@ dependencies = [
[[package]]
name = "cssparser-macros"
version = "0.2.0"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"phf_codegen 0.7.21 (registry+https://github.com/rust-lang/crates.io-index)",
@ -937,7 +937,7 @@ name = "geckoservo"
version = "0.0.1"
dependencies = [
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
"log 0.3.7 (registry+https://github.com/rust-lang/crates.io-index)",
@ -1359,7 +1359,7 @@ dependencies = [
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas_traits 0.0.1",
"cssparser 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx 0.0.1",
@ -1666,7 +1666,7 @@ name = "msg"
version = "0.0.1"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"serde 0.9.15 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2244,7 +2244,7 @@ dependencies = [
"caseless 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
"cmake 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)",
"cookie 0.6.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"deny_public_fields 0.0.1",
"devtools_traits 0.0.1",
"dom_struct 0.0.1",
@ -2314,7 +2314,7 @@ dependencies = [
"app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"canvas_traits 0.0.1",
"cssparser 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"gfx_traits 0.0.1",
"heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2385,7 +2385,7 @@ name = "selectors"
version = "0.18.0"
dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
"matches 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
"precomputed-hash 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2735,7 +2735,7 @@ dependencies = [
"bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)",
"byteorder 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cfg-if 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"encoding 0.2.33 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"fnv 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2774,7 +2774,7 @@ name = "style_tests"
version = "0.0.1"
dependencies = [
"app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"html5ever-atoms 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"parking_lot 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2793,7 +2793,7 @@ name = "style_traits"
version = "0.0.1"
dependencies = [
"app_units 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize 0.3.8 (registry+https://github.com/rust-lang/crates.io-index)",
"heapsize_derive 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -2806,7 +2806,7 @@ name = "stylo_tests"
version = "0.0.1"
dependencies = [
"atomic_refcell 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)",
"cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)",
"env_logger 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)",
"euclid 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"geckoservo 0.0.1",
@ -3359,8 +3359,8 @@ dependencies = [
"checksum core-foundation-sys 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "41115a6aa5d3e1e5ef98148373f25971d1fad53818553f216495f9e67e90a624"
"checksum core-graphics 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ead017dcf77f503dc991f6b52de6084eeea60a94b0a652baa9bf88654a28e83f"
"checksum core-text 4.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "0e9719616a10f717628e074744f8c55df7b450f7a34d29c196d14f4498aad05d"
"checksum cssparser 0.12.1 (registry+https://github.com/rust-lang/crates.io-index)" = "35e3e110221f306501253d8d34857040de365ce2d92ac0abb2f06dedc845d9d0"
"checksum cssparser-macros 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b8f0415de0bdbce823c0db204e00a62c8240fa2d3e04cd13ff7c6396e4446b95"
"checksum cssparser 0.13.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b39404c5e04492194e3c69f1a10964b980f2c95c884a940f7903446779f6b027"
"checksum cssparser-macros 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "079adec4af52bb5275eadd004292028c79eb3c5f5b4ee8086a36d4197032f6df"
"checksum dbghelp-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97590ba53bcb8ac28279161ca943a924d1fd4a8fb3fa63302591647c4fc5b850"
"checksum dbus 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "47f881971824401c27bc1ff9f641d54ac66e0f409631806fa7be8cad8e6be450"
"checksum debug_unreachable 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "9a032eac705ca39214d169f83e3d3da290af06d8d1d344d1baad2fd002dca4b3"

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

@ -12,7 +12,7 @@ path = "lib.rs"
[dependencies]
azure = {git = "https://github.com/servo/rust-azure"}
canvas_traits = {path = "../canvas_traits"}
cssparser = "0.12.1"
cssparser = "0.13"
euclid = "0.11"
gleam = "0.4"
ipc-channel = "0.7"

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

@ -10,7 +10,7 @@ name = "canvas_traits"
path = "lib.rs"
[dependencies]
cssparser = "0.12.1"
cssparser = "0.13"
euclid = "0.11"
heapsize = "0.3.0"
heapsize_derive = "0.1"

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

@ -14,7 +14,7 @@ app_units = "0.4"
atomic_refcell = "0.1"
bitflags = "0.7"
canvas_traits = {path = "../canvas_traits"}
cssparser = "0.12.1"
cssparser = "0.13"
euclid = "0.11"
fnv = "1.0"
gfx = {path = "../gfx"}

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

@ -11,7 +11,7 @@ path = "lib.rs"
[dependencies]
bitflags = "0.7"
cssparser = "0.12.1"
cssparser = "0.13"
heapsize = "0.3.0"
heapsize_derive = "0.1"
serde = "0.9"

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

@ -35,7 +35,7 @@ byteorder = "1.0"
canvas_traits = {path = "../canvas_traits"}
caseless = "0.1.0"
cookie = "0.6"
cssparser = "0.12.1"
cssparser = "0.13"
deny_public_fields = {path = "../deny_public_fields"}
devtools_traits = {path = "../devtools_traits"}
dom_struct = {path = "../dom_struct"}

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

@ -1850,6 +1850,7 @@ class CGImports(CGWrapper):
'unused_imports',
'unused_variables',
'unused_assignments',
'unused_mut',
]
def componentTypes(type):

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

@ -45,6 +45,7 @@ impl DissimilarOriginLocation {
DissimilarOriginLocationBinding::Wrap)
}
#[allow(dead_code)]
pub fn origin(&self) -> &MutableOrigin {
self.window.origin()
}

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

@ -65,6 +65,7 @@ impl DissimilarOriginWindow {
unsafe { DissimilarOriginWindowBinding::Wrap(cx, win) }
}
#[allow(dead_code)]
pub fn origin(&self) -> &MutableOrigin {
self.globalscope.origin()
}

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

@ -61,6 +61,7 @@ impl Location {
self.window.load_url(self.get_url(), true, true, None);
}
#[allow(dead_code)]
pub fn origin(&self) -> &MutableOrigin {
self.window.origin()
}

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

@ -13,7 +13,7 @@ path = "lib.rs"
app_units = "0.4"
atomic_refcell = "0.1"
canvas_traits = {path = "../canvas_traits"}
cssparser = "0.12.1"
cssparser = "0.13"
euclid = "0.11"
gfx_traits = {path = "../gfx_traits"}
heapsize = "0.3.0"

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

@ -18,7 +18,7 @@ path = "lib.rs"
[dependencies]
bitflags = "0.7"
matches = "0.1"
cssparser = "0.12.1"
cssparser = "0.13"
fnv = "1.0"
precomputed-hash = "0.1"
smallvec = "0.3"

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

@ -29,7 +29,7 @@ bitflags = "0.7"
bit-vec = "0.4.3"
byteorder = "1.0"
cfg-if = "0.1.0"
cssparser = "0.12.1"
cssparser = "0.13.1"
encoding = {version = "0.2", optional = true}
euclid = "0.11"
fnv = "1.0"

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

@ -624,6 +624,7 @@ mod bindings {
.whitelisted_function("Gecko_.*");
let structs_types = [
"mozilla::css::URLValue",
"mozilla::Side",
"RawGeckoAnimationPropertySegment",
"RawGeckoComputedTiming",
"RawGeckoDocument",

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

@ -4,6 +4,7 @@ pub use nsstring::{nsACString, nsAString, nsString};
type nsACString_internal = nsACString;
type nsAString_internal = nsAString;
use gecko_bindings::structs::mozilla::css::URLValue;
use gecko_bindings::structs::mozilla::Side;
use gecko_bindings::structs::RawGeckoAnimationPropertySegment;
use gecko_bindings::structs::RawGeckoComputedTiming;
use gecko_bindings::structs::RawGeckoDocument;
@ -719,6 +720,21 @@ extern "C" {
*const ::std::os::raw::c_char,
aLength: u32) -> bool;
}
extern "C" {
pub fn Gecko_EnsureMozBorderColors(aBorder: *mut nsStyleBorder);
}
extern "C" {
pub fn Gecko_ClearMozBorderColors(aBorder: *mut nsStyleBorder,
aSide: Side);
}
extern "C" {
pub fn Gecko_AppendMozBorderColors(aBorder: *mut nsStyleBorder,
aSide: Side, aColor: nscolor);
}
extern "C" {
pub fn Gecko_CopyMozBorderColors(aDest: *mut nsStyleBorder,
aSrc: *const nsStyleBorder, aSide: Side);
}
extern "C" {
pub fn Gecko_FontFamilyList_Clear(aList: *mut FontFamilyList);
}

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

@ -4010,26 +4010,27 @@ pub mod root {
mozHandlerBlocked = 59,
mozHandlerCrashed = 60,
mozMathIncrementScriptLevel = 61,
required = 62,
optional = 63,
valid = 64,
invalid = 65,
inRange = 66,
outOfRange = 67,
defaultPseudo = 68,
placeholderShown = 69,
mozReadOnly = 70,
mozReadWrite = 71,
mozSubmitInvalid = 72,
mozUIInvalid = 73,
mozUIValid = 74,
mozMeterOptimum = 75,
mozMeterSubOptimum = 76,
mozMeterSubSubOptimum = 77,
mozPlaceholder = 78,
Count = 79,
NotPseudo = 80,
MAX = 81,
mozAutofill = 62,
required = 63,
optional = 64,
valid = 65,
invalid = 66,
inRange = 67,
outOfRange = 68,
defaultPseudo = 69,
placeholderShown = 70,
mozReadOnly = 71,
mozReadWrite = 72,
mozSubmitInvalid = 73,
mozUIInvalid = 74,
mozUIValid = 75,
mozMeterOptimum = 76,
mozMeterSubOptimum = 77,
mozMeterSubSubOptimum = 78,
mozPlaceholder = 79,
Count = 80,
NotPseudo = 81,
MAX = 82,
}
pub const SERVO_PREF_ENABLED_align_content: bool = false;
pub const SERVO_PREF_ENABLED_align_items: bool = false;
@ -4660,6 +4661,24 @@ pub mod root {
pub type IntRect = [u32; 4usize];
pub type Matrix4x4 = [u32; 16usize];
#[repr(C)]
#[derive(Debug, Copy)]
pub struct FontVariation {
pub _bindgen_opaque_blob: [u32; 2usize],
}
#[test]
fn bindgen_test_layout_FontVariation() {
assert_eq!(::std::mem::size_of::<FontVariation>() , 8usize ,
concat ! (
"Size of: " , stringify ! ( FontVariation ) ));
assert_eq! (::std::mem::align_of::<FontVariation>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( FontVariation )
));
}
impl Clone for FontVariation {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct SourceSurface([u8; 0]);
#[repr(C)]
@ -9319,6 +9338,24 @@ pub mod root {
}
pub type FILE = root::_IO_FILE;
pub type va_list = root::__builtin_va_list;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct InfallibleAllocPolicy {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_InfallibleAllocPolicy() {
assert_eq!(::std::mem::size_of::<InfallibleAllocPolicy>() , 1usize ,
concat ! (
"Size of: " , stringify ! ( InfallibleAllocPolicy ) ));
assert_eq! (::std::mem::align_of::<InfallibleAllocPolicy>() , 1usize ,
concat ! (
"Alignment of " , stringify ! ( InfallibleAllocPolicy )
));
}
impl Clone for InfallibleAllocPolicy {
fn clone(&self) -> Self { *self }
}
/**
* MozRefCountType is Mozilla's reference count type.
*
@ -9611,6 +9648,7 @@ pub mod root {
= 2152924160,
NS_ERROR_DOM_INVALID_ACCESS_XHR_TIMEOUT_AND_RESPONSETYPE_UNSUPPORTED_FOR_SYNC
= 2152924161,
NS_ERROR_DOM_JS_DECODING_ERROR = 2152924162,
NS_SUCCESS_DOM_NO_OPERATION = 5439489,
NS_SUCCESS_DOM_SCRIPT_EVALUATION_THREW = 5439490,
NS_SUCCESS_DOM_SCRIPT_EVALUATION_THREW_UNCATCHABLE = 5439491,
@ -12548,7 +12586,7 @@ pub mod root {
pub mStyleAttrStyleSheet: root::RefPtr<root::nsHTMLCSSStyleSheet>,
pub mImageTracker: root::RefPtr<root::mozilla::dom::ImageTracker>,
pub mActivityObservers: root::nsAutoPtr<()>,
pub mLinksToUpdate: [u64; 6usize],
pub mLinksToUpdate: [u64; 3usize],
pub mAnimationController: root::RefPtr<root::nsSMILAnimationController>,
pub mPropertyTable: root::nsPropertyTable,
pub mExtraPropertyTables: root::nsTArray<root::nsAutoPtr<root::nsPropertyTable>>,
@ -12612,7 +12650,7 @@ pub mod root {
pub mXPathEvaluator: root::RefPtr<root::mozilla::dom::XPathEvaluator>,
pub mAnonymousContents: root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>>,
pub mBlockDOMContentLoaded: u32,
pub mDOMMediaQueryLists: root::PRCList,
pub mDOMMediaQueryLists: root::mozilla::LinkedList<root::mozilla::dom::MediaQueryList>,
pub mUseCounters: [u64; 2usize],
pub mChildDocumentUseCounters: [u64; 2usize],
pub mNotifiedPageForUseCounter: [u64; 2usize],
@ -12896,9 +12934,10 @@ pub mod root {
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nsIDocument_FrameRequest([u8; 0]);
pub const nsIDocument_kSegmentSize: usize = 128;
#[test]
fn bindgen_test_layout_nsIDocument() {
assert_eq!(::std::mem::size_of::<nsIDocument>() , 912usize , concat !
assert_eq!(::std::mem::size_of::<nsIDocument>() , 896usize , concat !
( "Size of: " , stringify ! ( nsIDocument ) ));
assert_eq! (::std::mem::align_of::<nsIDocument>() , 8usize , concat !
( "Alignment of " , stringify ! ( nsIDocument ) ));
@ -16987,33 +17026,6 @@ pub mod root {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PRCListStr {
pub next: *mut root::PRCList,
pub prev: *mut root::PRCList,
}
#[test]
fn bindgen_test_layout_PRCListStr() {
assert_eq!(::std::mem::size_of::<PRCListStr>() , 16usize , concat ! (
"Size of: " , stringify ! ( PRCListStr ) ));
assert_eq! (::std::mem::align_of::<PRCListStr>() , 8usize , concat ! (
"Alignment of " , stringify ! ( PRCListStr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PRCListStr ) ) . next as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( PRCListStr ) , "::"
, stringify ! ( next ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PRCListStr ) ) . prev as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( PRCListStr ) , "::"
, stringify ! ( prev ) ));
}
impl Clone for PRCListStr {
fn clone(&self) -> Self { *self }
}
pub type PRCList = root::PRCListStr;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct gfxUserFontSet([u8; 0]);
#[repr(C)]
@ -17076,6 +17088,21 @@ pub mod root {
CORS_ANONYMOUS = 2,
CORS_USE_CREDENTIALS = 3,
}
pub const imgIRequest_CATEGORY_FRAME_INIT: root::imgIRequest__bindgen_ty_3
=
imgIRequest__bindgen_ty_3::CATEGORY_FRAME_INIT;
pub const imgIRequest_CATEGORY_SIZE_QUERY: root::imgIRequest__bindgen_ty_3
=
imgIRequest__bindgen_ty_3::CATEGORY_SIZE_QUERY;
pub const imgIRequest_CATEGORY_DISPLAY: root::imgIRequest__bindgen_ty_3 =
imgIRequest__bindgen_ty_3::CATEGORY_DISPLAY;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum imgIRequest__bindgen_ty_3 {
CATEGORY_FRAME_INIT = 1,
CATEGORY_SIZE_QUERY = 2,
CATEGORY_DISPLAY = 4,
}
#[test]
fn bindgen_test_layout_imgIRequest() {
assert_eq!(::std::mem::size_of::<imgIRequest>() , 8usize , concat ! (
@ -17725,33 +17752,7 @@ pub mod root {
gfxFontFeatureValueSet ) , "::" , stringify ! (
mFontFeatureValues ) ));
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct gfxFontVariation {
pub mTag: u32,
pub mValue: f32,
}
#[test]
fn bindgen_test_layout_gfxFontVariation() {
assert_eq!(::std::mem::size_of::<gfxFontVariation>() , 8usize , concat
! ( "Size of: " , stringify ! ( gfxFontVariation ) ));
assert_eq! (::std::mem::align_of::<gfxFontVariation>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( gfxFontVariation ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const gfxFontVariation ) ) . mTag as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( gfxFontVariation )
, "::" , stringify ! ( mTag ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const gfxFontVariation ) ) . mValue as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( gfxFontVariation )
, "::" , stringify ! ( mValue ) ));
}
impl Clone for gfxFontVariation {
fn clone(&self) -> Self { *self }
}
pub type gfxFontVariation = root::mozilla::gfx::FontVariation;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct gfxFontStyle([u8; 0]);
@ -17786,7 +17787,7 @@ pub mod root {
pub alternateValues: root::nsTArray<root::gfxAlternateValue>,
pub featureValueLookup: root::RefPtr<root::gfxFontFeatureValueSet>,
pub fontFeatureSettings: root::nsTArray<root::gfxFontFeature>,
pub fontVariationSettings: root::nsTArray<root::gfxFontVariation>,
pub fontVariationSettings: root::nsTArray<root::mozilla::gfx::FontVariation>,
pub languageOverride: u32,
}
#[test]
@ -23514,6 +23515,7 @@ pub mod root {
pub mCORSMode: i32,
pub mReferrerPolicy: root::imgRequest_ReferrerPolicy,
pub mImageErrorCode: root::nsresult,
pub mBoostCategoriesRequested: u32,
pub mMutex: root::mozilla::Mutex,
pub mProgressTracker: root::RefPtr<root::mozilla::image::ProgressTracker>,
pub mImage: root::RefPtr<root::mozilla::image::Image>,
@ -28166,6 +28168,19 @@ pub mod root {
}
#[test]
fn __bindgen_test_layout_template_42() {
assert_eq!(::std::mem::size_of::<root::mozilla::LinkedList<root::mozilla::dom::MediaQueryList>>()
, 24usize , concat ! (
"Size of template specialization: " , stringify ! (
root::mozilla::LinkedList<root::mozilla::dom::MediaQueryList>
) ));
assert_eq!(::std::mem::align_of::<root::mozilla::LinkedList<root::mozilla::dom::MediaQueryList>>()
, 8usize , concat ! (
"Alignment of template specialization: " , stringify ! (
root::mozilla::LinkedList<root::mozilla::dom::MediaQueryList>
) ));
}
#[test]
fn __bindgen_test_layout_template_43() {
assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28176,7 +28191,7 @@ pub mod root {
root::RefPtr<root::mozilla::dom::Element> ) ));
}
#[test]
fn __bindgen_test_layout_template_43() {
fn __bindgen_test_layout_template_44() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::Element>>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28189,7 +28204,7 @@ pub mod root {
));
}
#[test]
fn __bindgen_test_layout_template_44() {
fn __bindgen_test_layout_template_45() {
assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIObserver>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28200,7 +28215,7 @@ pub mod root {
root::nsCOMPtr<root::nsIObserver> ) ));
}
#[test]
fn __bindgen_test_layout_template_45() {
fn __bindgen_test_layout_template_46() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr<root::nsIObserver>>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28211,7 +28226,7 @@ pub mod root {
root::nsTArray<root::nsCOMPtr<root::nsIObserver>> ) ));
}
#[test]
fn __bindgen_test_layout_template_46() {
fn __bindgen_test_layout_template_47() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIDocument>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28222,7 +28237,7 @@ pub mod root {
root::already_AddRefed<root::nsIDocument> ) ));
}
#[test]
fn __bindgen_test_layout_template_47() {
fn __bindgen_test_layout_template_48() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsContentList>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28233,7 +28248,7 @@ pub mod root {
root::already_AddRefed<root::nsContentList> ) ));
}
#[test]
fn __bindgen_test_layout_template_48() {
fn __bindgen_test_layout_template_49() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsINode>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28244,7 +28259,18 @@ pub mod root {
root::already_AddRefed<root::nsINode> ) ));
}
#[test]
fn __bindgen_test_layout_template_49() {
fn __bindgen_test_layout_template_50() {
assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::mozilla::dom::Link>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
root::nsCOMPtr<root::mozilla::dom::Link> ) ));
assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::mozilla::dom::Link>>()
, 8usize , concat ! (
"Alignment of template specialization: " , stringify ! (
root::nsCOMPtr<root::mozilla::dom::Link> ) ));
}
#[test]
fn __bindgen_test_layout_template_51() {
assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIWeakReference>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28255,7 +28281,7 @@ pub mod root {
root::nsCOMPtr<root::nsIWeakReference> ) ));
}
#[test]
fn __bindgen_test_layout_template_50() {
fn __bindgen_test_layout_template_52() {
assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( u64 )
));
@ -28264,7 +28290,7 @@ pub mod root {
u64 ) ));
}
#[test]
fn __bindgen_test_layout_template_51() {
fn __bindgen_test_layout_template_53() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsRect>>() ,
8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28275,7 +28301,7 @@ pub mod root {
root::nsTArray<root::nsRect> ) ));
}
#[test]
fn __bindgen_test_layout_template_52() {
fn __bindgen_test_layout_template_54() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsBidi>>()
, 1usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28286,7 +28312,7 @@ pub mod root {
root::mozilla::DefaultDelete<root::nsBidi> ) ));
}
#[test]
fn __bindgen_test_layout_template_53() {
fn __bindgen_test_layout_template_55() {
assert_eq!(::std::mem::size_of::<[u64; 29usize]>() , 232usize , concat
! (
"Size of template specialization: " , stringify ! (
@ -28297,7 +28323,7 @@ pub mod root {
[u64; 29usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_54() {
fn __bindgen_test_layout_template_56() {
assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28308,7 +28334,7 @@ pub mod root {
root::nsTArray<*mut root::nsIContent> ) ));
}
#[test]
fn __bindgen_test_layout_template_55() {
fn __bindgen_test_layout_template_57() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::CSSValue>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28319,7 +28345,7 @@ pub mod root {
root::already_AddRefed<root::mozilla::dom::CSSValue> ) ));
}
#[test]
fn __bindgen_test_layout_template_56() {
fn __bindgen_test_layout_template_58() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::mozilla::dom::TimeoutManager>>()
, 1usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28332,7 +28358,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_57() {
fn __bindgen_test_layout_template_59() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsISupports>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28343,7 +28369,7 @@ pub mod root {
root::already_AddRefed<root::nsISupports> ) ));
}
#[test]
fn __bindgen_test_layout_template_58() {
fn __bindgen_test_layout_template_60() {
assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIRunnable>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28354,7 +28380,7 @@ pub mod root {
root::nsCOMPtr<root::nsIRunnable> ) ));
}
#[test]
fn __bindgen_test_layout_template_59() {
fn __bindgen_test_layout_template_61() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIContent>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28365,7 +28391,7 @@ pub mod root {
root::already_AddRefed<root::nsIContent> ) ));
}
#[test]
fn __bindgen_test_layout_template_60() {
fn __bindgen_test_layout_template_62() {
assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat !
(
"Size of template specialization: " , stringify ! (
@ -28376,7 +28402,7 @@ pub mod root {
[u64; 6usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_61() {
fn __bindgen_test_layout_template_63() {
assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::nsINode>>()
, 16usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28387,28 +28413,6 @@ pub mod root {
root::mozilla::OwningNonNull<root::nsINode> ) ));
}
#[test]
fn __bindgen_test_layout_template_62() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_63() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_64() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
@ -28421,14 +28425,14 @@ pub mod root {
}
#[test]
fn __bindgen_test_layout_template_65() {
assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat !
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 4usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat !
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 4usize] ) ));
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_66() {
@ -28443,6 +28447,17 @@ pub mod root {
}
#[test]
fn __bindgen_test_layout_template_67() {
assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 4usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 4usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_68() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
@ -28453,26 +28468,15 @@ pub mod root {
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_68() {
assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 4usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 4usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_69() {
assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat !
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 4usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat !
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 4usize] ) ));
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_70() {
@ -28487,6 +28491,28 @@ pub mod root {
}
#[test]
fn __bindgen_test_layout_template_71() {
assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 4usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 4usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_72() {
assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 4usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 4usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_73() {
assert_eq!(::std::mem::size_of::<u32>() , 4usize , concat ! (
"Size of template specialization: " , stringify ! ( u32 )
));
@ -28495,28 +28521,6 @@ pub mod root {
u32 ) ));
}
#[test]
fn __bindgen_test_layout_template_72() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_73() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_74() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
@ -28529,6 +28533,28 @@ pub mod root {
}
#[test]
fn __bindgen_test_layout_template_75() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_76() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_77() {
assert_eq!(::std::mem::size_of::<root::nsTArray<f64>>() , 8usize ,
concat ! (
"Size of template specialization: " , stringify ! (
@ -28539,7 +28565,7 @@ pub mod root {
root::nsTArray<f64> ) ));
}
#[test]
fn __bindgen_test_layout_template_76() {
fn __bindgen_test_layout_template_78() {
assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28552,7 +28578,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_77() {
fn __bindgen_test_layout_template_79() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28565,7 +28591,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_78() {
fn __bindgen_test_layout_template_80() {
assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::ProfilerBacktrace,
root::ProfilerBacktraceDestructor>>()
, 8usize , concat ! (
@ -28582,7 +28608,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_79() {
fn __bindgen_test_layout_template_81() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::FontFamilyName>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28593,7 +28619,7 @@ pub mod root {
root::nsTArray<root::mozilla::FontFamilyName> ) ));
}
#[test]
fn __bindgen_test_layout_template_80() {
fn __bindgen_test_layout_template_82() {
assert_eq!(::std::mem::size_of::<root::nsTArray<::std::os::raw::c_uint>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28604,7 +28630,7 @@ pub mod root {
root::nsTArray<::std::os::raw::c_uint> ) ));
}
#[test]
fn __bindgen_test_layout_template_81() {
fn __bindgen_test_layout_template_83() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::FramePropertyTable_PropertyValue>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28617,7 +28643,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_82() {
fn __bindgen_test_layout_template_84() {
assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<root::nsIFrame>>()
, 16usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28628,7 +28654,7 @@ pub mod root {
root::nsPtrHashKey<root::nsIFrame> ) ));
}
#[test]
fn __bindgen_test_layout_template_83() {
fn __bindgen_test_layout_template_85() {
assert_eq!(::std::mem::size_of::<[u64; 6usize]>() , 48usize , concat !
(
"Size of template specialization: " , stringify ! (
@ -28639,7 +28665,7 @@ pub mod root {
[u64; 6usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_84() {
fn __bindgen_test_layout_template_86() {
assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor>>()
, 16usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28652,7 +28678,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_85() {
fn __bindgen_test_layout_template_87() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::ProxyBehaviour>>()
, 1usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28663,7 +28689,7 @@ pub mod root {
root::mozilla::DefaultDelete<root::ProxyBehaviour> ) ));
}
#[test]
fn __bindgen_test_layout_template_86() {
fn __bindgen_test_layout_template_88() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::URLExtraData>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28674,7 +28700,7 @@ pub mod root {
root::already_AddRefed<root::mozilla::URLExtraData> ) ));
}
#[test]
fn __bindgen_test_layout_template_87() {
fn __bindgen_test_layout_template_89() {
assert_eq!(::std::mem::size_of::<root::nsMainThreadPtrHolder<root::nsIURI>>()
, 24usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28685,7 +28711,7 @@ pub mod root {
root::nsMainThreadPtrHolder<root::nsIURI> ) ));
}
#[test]
fn __bindgen_test_layout_template_88() {
fn __bindgen_test_layout_template_90() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsCSSValueList>>()
, 1usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28696,7 +28722,7 @@ pub mod root {
root::mozilla::DefaultDelete<root::nsCSSValueList> ) ));
}
#[test]
fn __bindgen_test_layout_template_89() {
fn __bindgen_test_layout_template_91() {
assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValueList,
root::mozilla::DefaultDelete<root::nsCSSValueList>>>()
, 8usize , concat ! (
@ -28713,7 +28739,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_90() {
fn __bindgen_test_layout_template_92() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsCSSValuePairList>>()
, 1usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28726,7 +28752,7 @@ pub mod root {
));
}
#[test]
fn __bindgen_test_layout_template_91() {
fn __bindgen_test_layout_template_93() {
assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList,
root::mozilla::DefaultDelete<root::nsCSSValuePairList>>>()
, 8usize , concat ! (
@ -28743,7 +28769,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_92() {
fn __bindgen_test_layout_template_94() {
assert_eq!(::std::mem::size_of::<[u64; 2usize]>() , 16usize , concat !
(
"Size of template specialization: " , stringify ! (
@ -28754,7 +28780,7 @@ pub mod root {
[u64; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_93() {
fn __bindgen_test_layout_template_95() {
assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( u64 )
));
@ -28763,7 +28789,7 @@ pub mod root {
u64 ) ));
}
#[test]
fn __bindgen_test_layout_template_94() {
fn __bindgen_test_layout_template_96() {
assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat !
(
"Size of template specialization: " , stringify ! (
@ -28774,7 +28800,7 @@ pub mod root {
[u32; 3usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_95() {
fn __bindgen_test_layout_template_97() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleImageRequest>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28785,7 +28811,7 @@ pub mod root {
root::already_AddRefed<root::nsStyleImageRequest> ) ));
}
#[test]
fn __bindgen_test_layout_template_96() {
fn __bindgen_test_layout_template_98() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsStyleSides>>()
, 1usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28796,7 +28822,7 @@ pub mod root {
root::mozilla::DefaultDelete<root::nsStyleSides> ) ));
}
#[test]
fn __bindgen_test_layout_template_97() {
fn __bindgen_test_layout_template_99() {
assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsStyleSides,
root::mozilla::DefaultDelete<root::nsStyleSides>>>()
, 8usize , concat ! (
@ -28813,7 +28839,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_98() {
fn __bindgen_test_layout_template_100() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::CachedBorderImageData>>()
, 1usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28826,7 +28852,7 @@ pub mod root {
));
}
#[test]
fn __bindgen_test_layout_template_99() {
fn __bindgen_test_layout_template_101() {
assert_eq!(::std::mem::size_of::<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>()
, 32usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28837,7 +28863,7 @@ pub mod root {
root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) ));
}
#[test]
fn __bindgen_test_layout_template_100() {
fn __bindgen_test_layout_template_102() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::std::pair<::nsstring::nsStringRepr,
::nsstring::nsStringRepr>>>()
, 8usize , concat ! (
@ -28852,7 +28878,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_101() {
fn __bindgen_test_layout_template_103() {
assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat
! (
"Size of template specialization: " , stringify ! (
@ -28863,7 +28889,7 @@ pub mod root {
[u64; 18usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_102() {
fn __bindgen_test_layout_template_104() {
assert_eq!(::std::mem::size_of::<root::mozilla::BaseTimeDuration<root::mozilla::StickyTimeDurationValueCalculator>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28876,7 +28902,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_103() {
fn __bindgen_test_layout_template_105() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28889,7 +28915,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_104() {
fn __bindgen_test_layout_template_106() {
assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28900,7 +28926,7 @@ pub mod root {
root::RefPtr<root::mozilla::dom::DOMRect> ) ));
}
#[test]
fn __bindgen_test_layout_template_105() {
fn __bindgen_test_layout_template_107() {
assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( u64 )
));
@ -28909,7 +28935,7 @@ pub mod root {
u64 ) ));
}
#[test]
fn __bindgen_test_layout_template_106() {
fn __bindgen_test_layout_template_108() {
assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28920,7 +28946,7 @@ pub mod root {
root::nsTArray<*mut root::mozilla::css::DocumentRule> ) ));
}
#[test]
fn __bindgen_test_layout_template_107() {
fn __bindgen_test_layout_template_109() {
assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::nsMediaQuery>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (

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

@ -3962,26 +3962,27 @@ pub mod root {
mozHandlerBlocked = 59,
mozHandlerCrashed = 60,
mozMathIncrementScriptLevel = 61,
required = 62,
optional = 63,
valid = 64,
invalid = 65,
inRange = 66,
outOfRange = 67,
defaultPseudo = 68,
placeholderShown = 69,
mozReadOnly = 70,
mozReadWrite = 71,
mozSubmitInvalid = 72,
mozUIInvalid = 73,
mozUIValid = 74,
mozMeterOptimum = 75,
mozMeterSubOptimum = 76,
mozMeterSubSubOptimum = 77,
mozPlaceholder = 78,
Count = 79,
NotPseudo = 80,
MAX = 81,
mozAutofill = 62,
required = 63,
optional = 64,
valid = 65,
invalid = 66,
inRange = 67,
outOfRange = 68,
defaultPseudo = 69,
placeholderShown = 70,
mozReadOnly = 71,
mozReadWrite = 72,
mozSubmitInvalid = 73,
mozUIInvalid = 74,
mozUIValid = 75,
mozMeterOptimum = 76,
mozMeterSubOptimum = 77,
mozMeterSubSubOptimum = 78,
mozPlaceholder = 79,
Count = 80,
NotPseudo = 81,
MAX = 82,
}
pub const SERVO_PREF_ENABLED_align_content: bool = false;
pub const SERVO_PREF_ENABLED_align_items: bool = false;
@ -4611,6 +4612,24 @@ pub mod root {
pub type IntRect = [u32; 4usize];
pub type Matrix4x4 = [u32; 16usize];
#[repr(C)]
#[derive(Debug, Copy)]
pub struct FontVariation {
pub _bindgen_opaque_blob: [u32; 2usize],
}
#[test]
fn bindgen_test_layout_FontVariation() {
assert_eq!(::std::mem::size_of::<FontVariation>() , 8usize ,
concat ! (
"Size of: " , stringify ! ( FontVariation ) ));
assert_eq! (::std::mem::align_of::<FontVariation>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( FontVariation )
));
}
impl Clone for FontVariation {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct SourceSurface([u8; 0]);
#[repr(C)]
@ -8922,6 +8941,24 @@ pub mod root {
}
}
pub type va_list = root::__builtin_va_list;
#[repr(C)]
#[derive(Debug, Copy)]
pub struct InfallibleAllocPolicy {
pub _address: u8,
}
#[test]
fn bindgen_test_layout_InfallibleAllocPolicy() {
assert_eq!(::std::mem::size_of::<InfallibleAllocPolicy>() , 1usize ,
concat ! (
"Size of: " , stringify ! ( InfallibleAllocPolicy ) ));
assert_eq! (::std::mem::align_of::<InfallibleAllocPolicy>() , 1usize ,
concat ! (
"Alignment of " , stringify ! ( InfallibleAllocPolicy )
));
}
impl Clone for InfallibleAllocPolicy {
fn clone(&self) -> Self { *self }
}
/**
* MozRefCountType is Mozilla's reference count type.
*
@ -9214,6 +9251,7 @@ pub mod root {
= 2152924160,
NS_ERROR_DOM_INVALID_ACCESS_XHR_TIMEOUT_AND_RESPONSETYPE_UNSUPPORTED_FOR_SYNC
= 2152924161,
NS_ERROR_DOM_JS_DECODING_ERROR = 2152924162,
NS_SUCCESS_DOM_NO_OPERATION = 5439489,
NS_SUCCESS_DOM_SCRIPT_EVALUATION_THREW = 5439490,
NS_SUCCESS_DOM_SCRIPT_EVALUATION_THREW_UNCATCHABLE = 5439491,
@ -12083,7 +12121,7 @@ pub mod root {
pub mStyleAttrStyleSheet: root::RefPtr<root::nsHTMLCSSStyleSheet>,
pub mImageTracker: root::RefPtr<root::mozilla::dom::ImageTracker>,
pub mActivityObservers: root::nsAutoPtr<()>,
pub mLinksToUpdate: [u64; 5usize],
pub mLinksToUpdate: [u64; 3usize],
pub mAnimationController: root::RefPtr<root::nsSMILAnimationController>,
pub mPropertyTable: root::nsPropertyTable,
pub mExtraPropertyTables: root::nsTArray<root::nsAutoPtr<root::nsPropertyTable>>,
@ -12142,7 +12180,7 @@ pub mod root {
pub mXPathEvaluator: root::RefPtr<root::mozilla::dom::XPathEvaluator>,
pub mAnonymousContents: root::nsTArray<root::RefPtr<root::mozilla::dom::AnonymousContent>>,
pub mBlockDOMContentLoaded: u32,
pub mDOMMediaQueryLists: root::PRCList,
pub mDOMMediaQueryLists: root::mozilla::LinkedList<root::mozilla::dom::MediaQueryList>,
pub mUseCounters: [u64; 2usize],
pub mChildDocumentUseCounters: [u64; 2usize],
pub mNotifiedPageForUseCounter: [u64; 2usize],
@ -12426,9 +12464,10 @@ pub mod root {
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct nsIDocument_FrameRequest([u8; 0]);
pub const nsIDocument_kSegmentSize: usize = 128;
#[test]
fn bindgen_test_layout_nsIDocument() {
assert_eq!(::std::mem::size_of::<nsIDocument>() , 880usize , concat !
assert_eq!(::std::mem::size_of::<nsIDocument>() , 872usize , concat !
( "Size of: " , stringify ! ( nsIDocument ) ));
assert_eq! (::std::mem::align_of::<nsIDocument>() , 8usize , concat !
( "Alignment of " , stringify ! ( nsIDocument ) ));
@ -16429,33 +16468,6 @@ pub mod root {
fn clone(&self) -> Self { *self }
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct PRCListStr {
pub next: *mut root::PRCList,
pub prev: *mut root::PRCList,
}
#[test]
fn bindgen_test_layout_PRCListStr() {
assert_eq!(::std::mem::size_of::<PRCListStr>() , 16usize , concat ! (
"Size of: " , stringify ! ( PRCListStr ) ));
assert_eq! (::std::mem::align_of::<PRCListStr>() , 8usize , concat ! (
"Alignment of " , stringify ! ( PRCListStr ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PRCListStr ) ) . next as * const _ as
usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( PRCListStr ) , "::"
, stringify ! ( next ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const PRCListStr ) ) . prev as * const _ as
usize } , 8usize , concat ! (
"Alignment of field: " , stringify ! ( PRCListStr ) , "::"
, stringify ! ( prev ) ));
}
impl Clone for PRCListStr {
fn clone(&self) -> Self { *self }
}
pub type PRCList = root::PRCListStr;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct gfxUserFontSet([u8; 0]);
#[repr(C)]
@ -16518,6 +16530,21 @@ pub mod root {
CORS_ANONYMOUS = 2,
CORS_USE_CREDENTIALS = 3,
}
pub const imgIRequest_CATEGORY_FRAME_INIT: root::imgIRequest__bindgen_ty_3
=
imgIRequest__bindgen_ty_3::CATEGORY_FRAME_INIT;
pub const imgIRequest_CATEGORY_SIZE_QUERY: root::imgIRequest__bindgen_ty_3
=
imgIRequest__bindgen_ty_3::CATEGORY_SIZE_QUERY;
pub const imgIRequest_CATEGORY_DISPLAY: root::imgIRequest__bindgen_ty_3 =
imgIRequest__bindgen_ty_3::CATEGORY_DISPLAY;
#[repr(u32)]
#[derive(Debug, Copy, Clone, PartialEq, Eq, Hash)]
pub enum imgIRequest__bindgen_ty_3 {
CATEGORY_FRAME_INIT = 1,
CATEGORY_SIZE_QUERY = 2,
CATEGORY_DISPLAY = 4,
}
#[test]
fn bindgen_test_layout_imgIRequest() {
assert_eq!(::std::mem::size_of::<imgIRequest>() , 8usize , concat ! (
@ -17159,33 +17186,7 @@ pub mod root {
gfxFontFeatureValueSet ) , "::" , stringify ! (
mFontFeatureValues ) ));
}
#[repr(C)]
#[derive(Debug, Copy)]
pub struct gfxFontVariation {
pub mTag: u32,
pub mValue: f32,
}
#[test]
fn bindgen_test_layout_gfxFontVariation() {
assert_eq!(::std::mem::size_of::<gfxFontVariation>() , 8usize , concat
! ( "Size of: " , stringify ! ( gfxFontVariation ) ));
assert_eq! (::std::mem::align_of::<gfxFontVariation>() , 4usize ,
concat ! (
"Alignment of " , stringify ! ( gfxFontVariation ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const gfxFontVariation ) ) . mTag as *
const _ as usize } , 0usize , concat ! (
"Alignment of field: " , stringify ! ( gfxFontVariation )
, "::" , stringify ! ( mTag ) ));
assert_eq! (unsafe {
& ( * ( 0 as * const gfxFontVariation ) ) . mValue as *
const _ as usize } , 4usize , concat ! (
"Alignment of field: " , stringify ! ( gfxFontVariation )
, "::" , stringify ! ( mValue ) ));
}
impl Clone for gfxFontVariation {
fn clone(&self) -> Self { *self }
}
pub type gfxFontVariation = root::mozilla::gfx::FontVariation;
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct gfxFontStyle([u8; 0]);
@ -17220,7 +17221,7 @@ pub mod root {
pub alternateValues: root::nsTArray<root::gfxAlternateValue>,
pub featureValueLookup: root::RefPtr<root::gfxFontFeatureValueSet>,
pub fontFeatureSettings: root::nsTArray<root::gfxFontFeature>,
pub fontVariationSettings: root::nsTArray<root::gfxFontVariation>,
pub fontVariationSettings: root::nsTArray<root::mozilla::gfx::FontVariation>,
pub languageOverride: u32,
}
#[test]
@ -22855,6 +22856,7 @@ pub mod root {
pub mCORSMode: i32,
pub mReferrerPolicy: root::imgRequest_ReferrerPolicy,
pub mImageErrorCode: root::nsresult,
pub mBoostCategoriesRequested: u32,
pub mMutex: root::mozilla::Mutex,
pub mProgressTracker: root::RefPtr<root::mozilla::image::ProgressTracker>,
pub mImage: root::RefPtr<root::mozilla::image::Image>,
@ -27507,6 +27509,19 @@ pub mod root {
}
#[test]
fn __bindgen_test_layout_template_42() {
assert_eq!(::std::mem::size_of::<root::mozilla::LinkedList<root::mozilla::dom::MediaQueryList>>()
, 24usize , concat ! (
"Size of template specialization: " , stringify ! (
root::mozilla::LinkedList<root::mozilla::dom::MediaQueryList>
) ));
assert_eq!(::std::mem::align_of::<root::mozilla::LinkedList<root::mozilla::dom::MediaQueryList>>()
, 8usize , concat ! (
"Alignment of template specialization: " , stringify ! (
root::mozilla::LinkedList<root::mozilla::dom::MediaQueryList>
) ));
}
#[test]
fn __bindgen_test_layout_template_43() {
assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::Element>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27517,7 +27532,7 @@ pub mod root {
root::RefPtr<root::mozilla::dom::Element> ) ));
}
#[test]
fn __bindgen_test_layout_template_43() {
fn __bindgen_test_layout_template_44() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::Element>>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27530,7 +27545,7 @@ pub mod root {
));
}
#[test]
fn __bindgen_test_layout_template_44() {
fn __bindgen_test_layout_template_45() {
assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIObserver>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27541,7 +27556,7 @@ pub mod root {
root::nsCOMPtr<root::nsIObserver> ) ));
}
#[test]
fn __bindgen_test_layout_template_45() {
fn __bindgen_test_layout_template_46() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsCOMPtr<root::nsIObserver>>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27552,7 +27567,7 @@ pub mod root {
root::nsTArray<root::nsCOMPtr<root::nsIObserver>> ) ));
}
#[test]
fn __bindgen_test_layout_template_46() {
fn __bindgen_test_layout_template_47() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIDocument>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27563,7 +27578,7 @@ pub mod root {
root::already_AddRefed<root::nsIDocument> ) ));
}
#[test]
fn __bindgen_test_layout_template_47() {
fn __bindgen_test_layout_template_48() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsContentList>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27574,7 +27589,7 @@ pub mod root {
root::already_AddRefed<root::nsContentList> ) ));
}
#[test]
fn __bindgen_test_layout_template_48() {
fn __bindgen_test_layout_template_49() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsINode>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27585,7 +27600,18 @@ pub mod root {
root::already_AddRefed<root::nsINode> ) ));
}
#[test]
fn __bindgen_test_layout_template_49() {
fn __bindgen_test_layout_template_50() {
assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::mozilla::dom::Link>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
root::nsCOMPtr<root::mozilla::dom::Link> ) ));
assert_eq!(::std::mem::align_of::<root::nsCOMPtr<root::mozilla::dom::Link>>()
, 8usize , concat ! (
"Alignment of template specialization: " , stringify ! (
root::nsCOMPtr<root::mozilla::dom::Link> ) ));
}
#[test]
fn __bindgen_test_layout_template_51() {
assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIWeakReference>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27596,7 +27622,7 @@ pub mod root {
root::nsCOMPtr<root::nsIWeakReference> ) ));
}
#[test]
fn __bindgen_test_layout_template_50() {
fn __bindgen_test_layout_template_52() {
assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( u64 )
));
@ -27605,7 +27631,7 @@ pub mod root {
u64 ) ));
}
#[test]
fn __bindgen_test_layout_template_51() {
fn __bindgen_test_layout_template_53() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::nsRect>>() ,
8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27616,7 +27642,7 @@ pub mod root {
root::nsTArray<root::nsRect> ) ));
}
#[test]
fn __bindgen_test_layout_template_52() {
fn __bindgen_test_layout_template_54() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsBidi>>()
, 1usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27627,7 +27653,7 @@ pub mod root {
root::mozilla::DefaultDelete<root::nsBidi> ) ));
}
#[test]
fn __bindgen_test_layout_template_53() {
fn __bindgen_test_layout_template_55() {
assert_eq!(::std::mem::size_of::<[u64; 28usize]>() , 224usize , concat
! (
"Size of template specialization: " , stringify ! (
@ -27638,7 +27664,7 @@ pub mod root {
[u64; 28usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_54() {
fn __bindgen_test_layout_template_56() {
assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::nsIContent>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27649,7 +27675,7 @@ pub mod root {
root::nsTArray<*mut root::nsIContent> ) ));
}
#[test]
fn __bindgen_test_layout_template_55() {
fn __bindgen_test_layout_template_57() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::dom::CSSValue>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27660,7 +27686,7 @@ pub mod root {
root::already_AddRefed<root::mozilla::dom::CSSValue> ) ));
}
#[test]
fn __bindgen_test_layout_template_56() {
fn __bindgen_test_layout_template_58() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::mozilla::dom::TimeoutManager>>()
, 1usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27673,7 +27699,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_57() {
fn __bindgen_test_layout_template_59() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsISupports>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27684,7 +27710,7 @@ pub mod root {
root::already_AddRefed<root::nsISupports> ) ));
}
#[test]
fn __bindgen_test_layout_template_58() {
fn __bindgen_test_layout_template_60() {
assert_eq!(::std::mem::size_of::<root::nsCOMPtr<root::nsIRunnable>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27695,7 +27721,7 @@ pub mod root {
root::nsCOMPtr<root::nsIRunnable> ) ));
}
#[test]
fn __bindgen_test_layout_template_59() {
fn __bindgen_test_layout_template_61() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsIContent>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27706,7 +27732,7 @@ pub mod root {
root::already_AddRefed<root::nsIContent> ) ));
}
#[test]
fn __bindgen_test_layout_template_60() {
fn __bindgen_test_layout_template_62() {
assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat !
(
"Size of template specialization: " , stringify ! (
@ -27717,7 +27743,7 @@ pub mod root {
[u64; 5usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_61() {
fn __bindgen_test_layout_template_63() {
assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::nsINode>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27728,28 +27754,6 @@ pub mod root {
root::mozilla::OwningNonNull<root::nsINode> ) ));
}
#[test]
fn __bindgen_test_layout_template_62() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_63() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_64() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
@ -27762,14 +27766,14 @@ pub mod root {
}
#[test]
fn __bindgen_test_layout_template_65() {
assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat !
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 4usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat !
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 4usize] ) ));
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_66() {
@ -27784,6 +27788,17 @@ pub mod root {
}
#[test]
fn __bindgen_test_layout_template_67() {
assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 4usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 4usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_68() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
@ -27794,26 +27809,15 @@ pub mod root {
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_68() {
assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 4usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 4usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_69() {
assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat !
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 4usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat !
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 4usize] ) ));
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_70() {
@ -27828,6 +27832,28 @@ pub mod root {
}
#[test]
fn __bindgen_test_layout_template_71() {
assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 4usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 4usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_72() {
assert_eq!(::std::mem::size_of::<[u32; 4usize]>() , 16usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 4usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 4usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 4usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_73() {
assert_eq!(::std::mem::size_of::<u32>() , 4usize , concat ! (
"Size of template specialization: " , stringify ! ( u32 )
));
@ -27836,28 +27862,6 @@ pub mod root {
u32 ) ));
}
#[test]
fn __bindgen_test_layout_template_72() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_73() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_74() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
@ -27870,6 +27874,28 @@ pub mod root {
}
#[test]
fn __bindgen_test_layout_template_75() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_76() {
assert_eq!(::std::mem::size_of::<[u32; 2usize]>() , 8usize , concat !
(
"Size of template specialization: " , stringify ! (
[u32; 2usize] ) ));
assert_eq!(::std::mem::align_of::<[u32; 2usize]>() , 4usize , concat !
(
"Alignment of template specialization: " , stringify ! (
[u32; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_77() {
assert_eq!(::std::mem::size_of::<root::nsTArray<f64>>() , 8usize ,
concat ! (
"Size of template specialization: " , stringify ! (
@ -27880,7 +27906,7 @@ pub mod root {
root::nsTArray<f64> ) ));
}
#[test]
fn __bindgen_test_layout_template_76() {
fn __bindgen_test_layout_template_78() {
assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27893,7 +27919,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_77() {
fn __bindgen_test_layout_template_79() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::RefPtr<root::mozilla::dom::DOMIntersectionObserverEntry>>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27906,7 +27932,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_78() {
fn __bindgen_test_layout_template_80() {
assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::ProfilerBacktrace,
root::ProfilerBacktraceDestructor>>()
, 8usize , concat ! (
@ -27923,7 +27949,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_79() {
fn __bindgen_test_layout_template_81() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::FontFamilyName>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27934,7 +27960,7 @@ pub mod root {
root::nsTArray<root::mozilla::FontFamilyName> ) ));
}
#[test]
fn __bindgen_test_layout_template_80() {
fn __bindgen_test_layout_template_82() {
assert_eq!(::std::mem::size_of::<root::nsTArray<::std::os::raw::c_uint>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27945,7 +27971,7 @@ pub mod root {
root::nsTArray<::std::os::raw::c_uint> ) ));
}
#[test]
fn __bindgen_test_layout_template_81() {
fn __bindgen_test_layout_template_83() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::FramePropertyTable_PropertyValue>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27958,7 +27984,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_82() {
fn __bindgen_test_layout_template_84() {
assert_eq!(::std::mem::size_of::<root::nsPtrHashKey<root::nsIFrame>>()
, 16usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27969,7 +27995,7 @@ pub mod root {
root::nsPtrHashKey<root::nsIFrame> ) ));
}
#[test]
fn __bindgen_test_layout_template_83() {
fn __bindgen_test_layout_template_85() {
assert_eq!(::std::mem::size_of::<[u64; 5usize]>() , 40usize , concat !
(
"Size of template specialization: " , stringify ! (
@ -27980,7 +28006,7 @@ pub mod root {
[u64; 5usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_84() {
fn __bindgen_test_layout_template_86() {
assert_eq!(::std::mem::size_of::<root::mozilla::OwningNonNull<root::mozilla::EffectCompositor_AnimationStyleRuleProcessor>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -27993,7 +28019,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_85() {
fn __bindgen_test_layout_template_87() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::ProxyBehaviour>>()
, 1usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28004,7 +28030,7 @@ pub mod root {
root::mozilla::DefaultDelete<root::ProxyBehaviour> ) ));
}
#[test]
fn __bindgen_test_layout_template_86() {
fn __bindgen_test_layout_template_88() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::mozilla::URLExtraData>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28015,7 +28041,7 @@ pub mod root {
root::already_AddRefed<root::mozilla::URLExtraData> ) ));
}
#[test]
fn __bindgen_test_layout_template_87() {
fn __bindgen_test_layout_template_89() {
assert_eq!(::std::mem::size_of::<root::nsMainThreadPtrHolder<root::nsIURI>>()
, 24usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28026,7 +28052,7 @@ pub mod root {
root::nsMainThreadPtrHolder<root::nsIURI> ) ));
}
#[test]
fn __bindgen_test_layout_template_88() {
fn __bindgen_test_layout_template_90() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsCSSValueList>>()
, 1usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28037,7 +28063,7 @@ pub mod root {
root::mozilla::DefaultDelete<root::nsCSSValueList> ) ));
}
#[test]
fn __bindgen_test_layout_template_89() {
fn __bindgen_test_layout_template_91() {
assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValueList,
root::mozilla::DefaultDelete<root::nsCSSValueList>>>()
, 8usize , concat ! (
@ -28054,7 +28080,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_90() {
fn __bindgen_test_layout_template_92() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsCSSValuePairList>>()
, 1usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28067,7 +28093,7 @@ pub mod root {
));
}
#[test]
fn __bindgen_test_layout_template_91() {
fn __bindgen_test_layout_template_93() {
assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsCSSValuePairList,
root::mozilla::DefaultDelete<root::nsCSSValuePairList>>>()
, 8usize , concat ! (
@ -28084,7 +28110,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_92() {
fn __bindgen_test_layout_template_94() {
assert_eq!(::std::mem::size_of::<[u64; 2usize]>() , 16usize , concat !
(
"Size of template specialization: " , stringify ! (
@ -28095,7 +28121,7 @@ pub mod root {
[u64; 2usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_93() {
fn __bindgen_test_layout_template_95() {
assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( u64 )
));
@ -28104,7 +28130,7 @@ pub mod root {
u64 ) ));
}
#[test]
fn __bindgen_test_layout_template_94() {
fn __bindgen_test_layout_template_96() {
assert_eq!(::std::mem::size_of::<[u32; 3usize]>() , 12usize , concat !
(
"Size of template specialization: " , stringify ! (
@ -28115,7 +28141,7 @@ pub mod root {
[u32; 3usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_95() {
fn __bindgen_test_layout_template_97() {
assert_eq!(::std::mem::size_of::<root::already_AddRefed<root::nsStyleImageRequest>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28126,7 +28152,7 @@ pub mod root {
root::already_AddRefed<root::nsStyleImageRequest> ) ));
}
#[test]
fn __bindgen_test_layout_template_96() {
fn __bindgen_test_layout_template_98() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::nsStyleSides>>()
, 1usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28137,7 +28163,7 @@ pub mod root {
root::mozilla::DefaultDelete<root::nsStyleSides> ) ));
}
#[test]
fn __bindgen_test_layout_template_97() {
fn __bindgen_test_layout_template_99() {
assert_eq!(::std::mem::size_of::<root::mozilla::UniquePtr<root::nsStyleSides,
root::mozilla::DefaultDelete<root::nsStyleSides>>>()
, 8usize , concat ! (
@ -28154,7 +28180,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_98() {
fn __bindgen_test_layout_template_100() {
assert_eq!(::std::mem::size_of::<root::mozilla::DefaultDelete<root::CachedBorderImageData>>()
, 1usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28167,7 +28193,7 @@ pub mod root {
));
}
#[test]
fn __bindgen_test_layout_template_99() {
fn __bindgen_test_layout_template_101() {
assert_eq!(::std::mem::size_of::<root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr>>()
, 32usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28178,7 +28204,7 @@ pub mod root {
root::std::pair<::nsstring::nsStringRepr, ::nsstring::nsStringRepr> ) ));
}
#[test]
fn __bindgen_test_layout_template_100() {
fn __bindgen_test_layout_template_102() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::std::pair<::nsstring::nsStringRepr,
::nsstring::nsStringRepr>>>()
, 8usize , concat ! (
@ -28193,7 +28219,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_101() {
fn __bindgen_test_layout_template_103() {
assert_eq!(::std::mem::size_of::<[u64; 18usize]>() , 144usize , concat
! (
"Size of template specialization: " , stringify ! (
@ -28204,7 +28230,7 @@ pub mod root {
[u64; 18usize] ) ));
}
#[test]
fn __bindgen_test_layout_template_102() {
fn __bindgen_test_layout_template_104() {
assert_eq!(::std::mem::size_of::<root::mozilla::BaseTimeDuration<root::mozilla::StickyTimeDurationValueCalculator>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28217,7 +28243,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_103() {
fn __bindgen_test_layout_template_105() {
assert_eq!(::std::mem::size_of::<root::nsTArray<root::mozilla::DisplayItemClip_RoundedRect>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28230,7 +28256,7 @@ pub mod root {
) ));
}
#[test]
fn __bindgen_test_layout_template_104() {
fn __bindgen_test_layout_template_106() {
assert_eq!(::std::mem::size_of::<root::RefPtr<root::mozilla::dom::DOMRect>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28241,7 +28267,7 @@ pub mod root {
root::RefPtr<root::mozilla::dom::DOMRect> ) ));
}
#[test]
fn __bindgen_test_layout_template_105() {
fn __bindgen_test_layout_template_107() {
assert_eq!(::std::mem::size_of::<u64>() , 8usize , concat ! (
"Size of template specialization: " , stringify ! ( u64 )
));
@ -28250,7 +28276,7 @@ pub mod root {
u64 ) ));
}
#[test]
fn __bindgen_test_layout_template_106() {
fn __bindgen_test_layout_template_108() {
assert_eq!(::std::mem::size_of::<root::nsTArray<*mut root::mozilla::css::DocumentRule>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (
@ -28261,7 +28287,7 @@ pub mod root {
root::nsTArray<*mut root::mozilla::css::DocumentRule> ) ));
}
#[test]
fn __bindgen_test_layout_template_107() {
fn __bindgen_test_layout_template_109() {
assert_eq!(::std::mem::size_of::<root::nsAutoPtr<root::nsMediaQuery>>()
, 8usize , concat ! (
"Size of template specialization: " , stringify ! (

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

@ -827,9 +827,13 @@ fn static_assert() {
for y in ["color", "style", "width"]] +
["border-{0}-radius".format(x.ident.replace("_", "-"))
for x in CORNERS]) %>
<% skip_moz_border_color_longhands = " ".join("-moz-border-{0}-colors".format(x.ident)
for x in SIDES) %>
<%self:impl_trait style_struct_name="Border"
skip_longhands="${skip_border_longhands} border-image-source border-image-outset
border-image-repeat border-image-width border-image-slice"
border-image-repeat border-image-width border-image-slice
${skip_moz_border_color_longhands}"
skip_additionals="*">
% for side in SIDES:
@ -880,6 +884,42 @@ fn static_assert() {
pub fn border_${side.ident}_has_nonzero_width(&self) -> bool {
self.gecko.mComputedBorder.${side.ident} != 0
}
#[allow(non_snake_case)]
pub fn set__moz_border_${side.ident}_colors(&mut self,
v: longhands::_moz_border_${side.ident}_colors::computed_value::T) {
match v.0 {
None => {
unsafe {
bindings::Gecko_ClearMozBorderColors(&mut self.gecko,
structs::Side::eSide${to_camel_case(side.ident)});
}
},
Some(ref colors) => {
unsafe {
bindings::Gecko_EnsureMozBorderColors(&mut self.gecko);
bindings::Gecko_ClearMozBorderColors(&mut self.gecko,
structs::Side::eSide${to_camel_case(side.ident)});
}
for color in colors {
let c = color_to_nscolor_zero_currentcolor(*color);
unsafe {
bindings::Gecko_AppendMozBorderColors(&mut self.gecko,
structs::Side::eSide${to_camel_case(side.ident)},
c);
}
}
}
}
}
#[allow(non_snake_case)]
pub fn copy__moz_border_${side.ident}_colors_from(&mut self, other: &Self) {
unsafe {
bindings::Gecko_CopyMozBorderColors(&mut self.gecko, &other.gecko,
structs::Side::eSide${to_camel_case(side.ident)});
}
}
% endfor
% for corner in CORNERS:

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

@ -73,6 +73,130 @@ ${helpers.gecko_keyword_conversion(Keyword('border-style',
animation_value_type="ComputedValue")}
% endfor
/// -moz-border-*-colors: color, string, enum, none, inherit/initial
/// These non-spec properties are just for Gecko (Stylo) internal use.
% for side in PHYSICAL_SIDES:
<%helpers:longhand name="-moz-border-${side}-colors" animation_value_type="none"
spec="Nonstandard (https://developer.mozilla.org/en-US/docs/Web/CSS/-moz-border-*-colors)"
products="gecko">
use std::fmt;
use style_traits::ToCss;
use values::HasViewportPercentage;
use values::specified::CSSColor;
no_viewport_percentage!(SpecifiedValue);
pub mod computed_value {
use values::computed::CSSColor;
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub struct T(pub Option<Vec<CSSColor>>);
}
#[derive(Debug, Clone, PartialEq)]
#[cfg_attr(feature = "servo", derive(HeapSizeOf))]
pub enum SpecifiedValue {
None,
Colors(Vec<CSSColor>),
}
impl ToCss for computed_value::T {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
match self.0 {
None => return dest.write_str("none"),
Some(ref vec) => {
let mut first = true;
for ref color in vec {
if !first {
try!(dest.write_str(" "));
}
first = false;
try!(color.to_css(dest))
}
Ok(())
}
}
}
}
impl ToCss for SpecifiedValue {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
match *self {
SpecifiedValue::None => return dest.write_str("none"),
SpecifiedValue::Colors(ref vec) => {
let mut first = true;
for ref color in vec {
if !first {
try!(dest.write_str(" "));
}
first = false;
try!(color.to_css(dest))
}
Ok(())
}
}
}
}
#[inline] pub fn get_initial_value() -> computed_value::T {
computed_value::T(None)
}
#[inline] pub fn get_initial_specified_value() -> SpecifiedValue {
SpecifiedValue::None
}
impl ToComputedValue for SpecifiedValue {
type ComputedValue = computed_value::T;
#[inline]
fn to_computed_value(&self, context: &Context) -> computed_value::T {
match *self {
SpecifiedValue::Colors(ref vec) => {
computed_value::T(Some(vec.iter()
.map(|c| c.to_computed_value(context))
.collect()))
},
SpecifiedValue::None => {
computed_value::T(None)
}
}
}
#[inline]
fn from_computed_value(computed: &computed_value::T) -> Self {
match *computed {
computed_value::T(Some(ref vec)) => {
SpecifiedValue::Colors(vec.iter()
.map(|c| ToComputedValue::from_computed_value((c)))
.collect())
},
computed_value::T(None) => {
SpecifiedValue::None
}
}
}
}
#[inline]
pub fn parse(context: &ParserContext, input: &mut Parser)
-> Result<SpecifiedValue, ()> {
if input.try(|input| input.expect_ident_matching("none")).is_ok() {
return Ok(SpecifiedValue::None)
}
let mut result = Vec::new();
while let Ok(value) = input.try(|i| CSSColor::parse(context, i)) {
result.push(value);
}
if !result.is_empty() {
Ok(SpecifiedValue::Colors(result))
} else {
Err(())
}
}
</%helpers:longhand>
% endfor
${helpers.single_keyword("box-decoration-break", "slice clone",
gecko_enum_prefix="StyleBoxDecorationBreak",
gecko_inexhaustive=True,

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

@ -841,7 +841,7 @@ impl PropertyId {
// FIXME(https://github.com/rust-lang/rust/issues/33156): remove this enum and use PropertyId
// when stable Rust allows destructors in statics.
enum StaticId {
pub enum StaticId {
Longhand(LonghandId),
Shorthand(ShorthandId),
}

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

@ -14,7 +14,7 @@ ${helpers.four_sides_shorthand("border-style", "border-%s-style",
<%helpers:shorthand name="border-width" sub_properties="${
' '.join('border-%s-width' % side
for side in ['top', 'right', 'bottom', 'left'])}"
for side in PHYSICAL_SIDES)}"
spec="https://drafts.csswg.org/css-backgrounds/#border-width">
use super::parse_four_sides;
use parser::Parse;
@ -23,7 +23,7 @@ ${helpers.four_sides_shorthand("border-style", "border-%s-style",
pub fn parse_value(context: &ParserContext, input: &mut Parser) -> Result<Longhands, ()> {
let (top, right, bottom, left) = try!(parse_four_sides(input, |i| specified::BorderWidth::parse(context, i)));
Ok(Longhands {
% for side in ["top", "right", "bottom", "left"]:
% for side in PHYSICAL_SIDES:
${to_rust_ident('border-%s-width' % side)}: ${side},
% endfor
})
@ -31,7 +31,7 @@ ${helpers.four_sides_shorthand("border-style", "border-%s-style",
impl<'a> ToCss for LonghandsToSerialize<'a> {
fn to_css<W>(&self, dest: &mut W) -> fmt::Result where W: fmt::Write {
% for side in ["top", "right", "bottom", "left"]:
% for side in PHYSICAL_SIDES:
let ${side} = self.border_${side}_width.clone();
% endfor
@ -124,22 +124,32 @@ pub fn parse_border(context: &ParserContext, input: &mut Parser)
<%helpers:shorthand name="border"
sub_properties="${' '.join('border-%s-%s' % (side, prop)
for side in ['top', 'right', 'bottom', 'left']
for side in PHYSICAL_SIDES
for prop in ['color', 'style', 'width'])}
${' '.join('border-image-%s' % name
for name in ['outset', 'repeat', 'slice', 'source', 'width'])}"
for name in ['outset', 'repeat', 'slice', 'source', 'width'])}
${' '.join('-moz-border-%s-colors' % side
for side in PHYSICAL_SIDES) if product == 'gecko' else ''}"
spec="https://drafts.csswg.org/css-backgrounds/#border">
% if product == "gecko":
use properties::longhands::{_moz_border_top_colors, _moz_border_right_colors,
_moz_border_bottom_colors, _moz_border_left_colors};
% endif
pub fn parse_value(context: &ParserContext, input: &mut Parser) -> Result<Longhands, ()> {
use properties::longhands::{border_image_outset, border_image_repeat, border_image_slice};
use properties::longhands::{border_image_source, border_image_width};
let (color, style, width) = try!(super::parse_border(context, input));
Ok(Longhands {
% for side in ["top", "right", "bottom", "left"]:
% for side in PHYSICAL_SIDES:
border_${side}_color: color.clone(),
border_${side}_style: style,
border_${side}_width: width.clone(),
% if product == "gecko":
_moz_border_${side}_colors: _moz_border_${side}_colors::get_initial_specified_value(),
% endif
% endfor
// The border shorthand resets border-image to its initial value.

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

@ -1160,8 +1160,12 @@ impl LengthOrPercentage {
NoCalcLength::parse_dimension(context, value.value, unit).map(LengthOrPercentage::Length),
Token::Percentage(ref value) if num_context.is_ok(value.unit_value) =>
Ok(LengthOrPercentage::Percentage(Percentage(value.unit_value))),
Token::Number(ref value) if value.value == 0. =>
Ok(LengthOrPercentage::zero()),
Token::Number(ref value) => {
if value.value != 0. && !context.length_parsing_mode.allows_unitless_lengths() {
return Err(())
}
Ok(LengthOrPercentage::Length(NoCalcLength::Absolute(AbsoluteLength::Px(value.value))))
}
Token::Function(ref name) if name.eq_ignore_ascii_case("calc") => {
let calc = try!(input.parse_nested_block(|i| {
CalcLengthOrPercentage::parse_length_or_percentage(context, i)
@ -1284,8 +1288,14 @@ impl LengthOrPercentageOrAuto {
NoCalcLength::parse_dimension(context, value.value, unit).map(LengthOrPercentageOrAuto::Length),
Token::Percentage(ref value) if num_context.is_ok(value.unit_value) =>
Ok(LengthOrPercentageOrAuto::Percentage(Percentage(value.unit_value))),
Token::Number(ref value) if value.value == 0. =>
Ok(Self::zero()),
Token::Number(ref value) if value.value == 0. => {
if value.value != 0. && !context.length_parsing_mode.allows_unitless_lengths() {
return Err(())
}
Ok(LengthOrPercentageOrAuto::Length(
NoCalcLength::Absolute(AbsoluteLength::Px(value.value))
))
}
Token::Ident(ref value) if value.eq_ignore_ascii_case("auto") =>
Ok(LengthOrPercentageOrAuto::Auto),
Token::Function(ref name) if name.eq_ignore_ascii_case("calc") => {
@ -1363,8 +1373,14 @@ impl LengthOrPercentageOrNone {
NoCalcLength::parse_dimension(context, value.value, unit).map(LengthOrPercentageOrNone::Length),
Token::Percentage(ref value) if num_context.is_ok(value.unit_value) =>
Ok(LengthOrPercentageOrNone::Percentage(Percentage(value.unit_value))),
Token::Number(ref value) if value.value == 0. =>
Ok(LengthOrPercentageOrNone::Length(NoCalcLength::zero())),
Token::Number(ref value) if value.value == 0. => {
if value.value != 0. && !context.length_parsing_mode.allows_unitless_lengths() {
return Err(())
}
Ok(LengthOrPercentageOrNone::Length(
NoCalcLength::Absolute(AbsoluteLength::Px(value.value))
))
}
Token::Function(ref name) if name.eq_ignore_ascii_case("calc") => {
let calc = try!(input.parse_nested_block(|i| {
CalcLengthOrPercentage::parse_length_or_percentage(context, i)

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

@ -15,7 +15,7 @@ servo = ["heapsize", "heapsize_derive", "serde", "serde_derive",
[dependencies]
app_units = "0.4"
cssparser = "0.12.1"
cssparser = "0.13"
euclid = "0.11"
heapsize = {version = "0.3.0", optional = true}
heapsize_derive = {version = "0.1", optional = true}

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

@ -16,7 +16,7 @@ gecko_debug = ["style/gecko_debug"]
[dependencies]
atomic_refcell = "0.1"
cssparser = "0.12.1"
cssparser = "0.13"
env_logger = {version = "0.4", default-features = false} # disable `regex` to reduce code size
libc = "0.2"
log = {version = "0.3.5", features = ["release_max_level_info"]}

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

@ -693,6 +693,7 @@ impl Window {
G_NESTED_EVENT_LOOP_LISTENER = None
}
#[cfg(target_os = "windows")]
fn char_to_script_key(c: char) -> Option<constellation_msg::Key> {
match c {
' ' => Some(Key::Space),

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

@ -33,6 +33,7 @@ extern crate sig;
use backtrace::Backtrace;
use servo::Browser;
use servo::compositing::windowing::WindowEvent;
#[cfg(target_os = "android")]
use servo::config;
use servo::config::opts::{self, ArgumentParsingResult};
use servo::config::servo_version;

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

@ -14,7 +14,7 @@ testing = ["style/testing"]
[dependencies]
app_units = "0.4"
cssparser = "0.12.1"
cssparser = "0.13"
euclid = "0.11"
html5ever-atoms = "0.3"
parking_lot = "0.3"

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

@ -16,7 +16,7 @@ testing = ["style/testing"]
[dependencies]
atomic_refcell = "0.1"
cssparser = "0.12.1"
cssparser = "0.13"
env_logger = "0.4"
euclid = "0.11"
libc = "0.2"

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

@ -1347,12 +1347,12 @@ talos-tp5o:
talos-perf-reftest:
description: "Talos perf-reftest"
suite: talos
talos-try-name: perfref
talos-try-name: perf-reftest
treeherder-symbol: tc-T(p)
run-on-projects:
by-test-platform:
linux64-stylo/.*: ['try']
default: ['try']
linux64-stylo/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'mozilla-inbound', 'autoland', 'try']
max-run-time: 3600
mozharness:
script: talos_script.py

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

@ -151,7 +151,7 @@ function check_hazards () {
exit 1
fi
NUM_ALLOWED_WRITE_HAZARDS=3
NUM_ALLOWED_WRITE_HAZARDS=7
if [ $NUM_WRITE_HAZARDS -gt $NUM_ALLOWED_WRITE_HAZARDS ]; then
echo "TEST-UNEXPECTED-FAIL $NUM_WRITE_HAZARDS heap write hazards detected out of $NUM_ALLOWED_WRITE_HAZARDS allowed" >&2
echo "TinderboxPrint: documentation<br/><a href='https://wiki.mozilla.org/Javascript:Hazard_Builds#Diagnosing_a_heap_write_hazard_failure'>heap write hazard analysis failures</a>, visit \"Inspect Task\" link for hazard details"

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

@ -1 +1 @@
{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"e740a473ab5e2339d639a86f1996b1ecc72f25b25f23b2789c836bff1455cf5a","lib.rs":"2b54cf96da2049eb03e4b30a223124e7f5a9c067975d54ec0ecf92f0245777a1"},"package":"b8f0415de0bdbce823c0db204e00a62c8240fa2d3e04cd13ff7c6396e4446b95"}
{"files":{".cargo-ok":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","Cargo.toml":"3080a72e897022e23ede1dd38cf28049e74a077518cc25d91f559c3b575aa3e3","lib.rs":"17331a3a0b0be3c05fe360e08538baf26b343ae61feec9062429a34a1c1eb1e2"},"package":"079adec4af52bb5275eadd004292028c79eb3c5f5b4ee8086a36d4197032f6df"}

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