Merge autoland to mozilla-central. a=merge

This commit is contained in:
shindli 2019-02-26 18:41:24 +02:00
Родитель 08b7f8eebb 66bda67c38
Коммит 3e61151522
55 изменённых файлов: 942 добавлений и 279 удалений

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

@ -13,9 +13,6 @@ origin uitour 1 https://support.mozilla.org
origin uitour 1 about:home
origin uitour 1 about:newtab
# XPInstall
origin install 1 https://addons.mozilla.org
# Remote troubleshooting
origin remote-troubleshooting 1 https://input.mozilla.org
origin remote-troubleshooting 1 https://support.mozilla.org

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

@ -32,7 +32,7 @@ function zoomTab1() {
}, browser1);
info("Waiting for tab 1 to be zoomed");
await promiseWaitForCondition(() => {
await TestUtils.waitForCondition(() => {
gLevel1 = ZoomManager.getZoomForBrowser(browser1);
return gLevel1 > 1;
});

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

@ -10,7 +10,6 @@
--border-color: #d7d7db; /* --in-content-border-color */
--box-background: #fff;
--box-background-hover: #ebebeb;
--box-border-color: #d7d7db;
--category-background-hover: rgba(12,12,13,0.1);
@ -36,18 +35,34 @@
--highlight-50: #0a84ff;
--grey-20: #ededf0;
--grey-30: #d7d7db; /* for ui, no special semantic */
--grey-90: #0c0c0d;
--grey-90-a10: rgba(12, 12, 13, 0.1);
--grey-90-a20: rgba(12, 12, 13, 0.2);
--grey-90-a30: rgba(12, 12, 13, 0.3);
--grey-90-a60: rgba(12, 12, 13, 0.6);
--grey-90-a80: rgba(12, 12, 13, 0.8);
--white-100: #fff; /* for ui, no special semantic */
/* Typography from Photon */
--body-10-font-size: 13px;
--body-10-font-weight: 400;
--body-20-font-size: 15px;
--body-20-font-weight: 700;
--caption-20-font-size: 13px;
--caption-20-font-weight: 400;
--title-20-font-size: 17px;
--title-20-font-weight: 600;
/* Global layout vars */
--page-width: 664px;
--base-unit: 4px;
/* Global styles */
--base-font-style: message-box;
--base-font-size: 15px; /* root font of 11px * 1.36em = 15px */
--base-font-size: var(--body-10-font-size);
--base-font-weight: var(--body-10-font-weight);
--base-line-height: 1.8;
--button-font-size: var(--base-font-size);
--micro-font-size: 11px;
--monospace-font-family: monospace;
@ -59,7 +74,7 @@
--alt-heading-icon-gap: var(--base-unit);
--main-heading-icon-size: calc(var(--base-unit) * 16);
--main-heading-icon-gap: calc(var(--base-unit) * 3);
--main-subheading-icon-size: calc(var(--base-unit) * 5);
--main-subheading-icon-size: calc(var(--base-unit) * 4);
--main-subheading-heading-icon-gap: calc(var(--base-unit) * 2);
}
@ -76,6 +91,8 @@ body {
padding: 0;
color: var(--text-color);
font-size: var(--base-font-size);
font-weight: var(--base-font-weight);
line-height: var(--base-line-height);
background: var(--bg-color);
}
@ -161,10 +178,9 @@ p {
* +--------+-------------+
*/
.main-subheading {
margin-block-start: calc(var(--base-unit) * 4);
font-weight: 600;
font-size: 1.46em; /* import from .header-name in common.inc.css */
line-height: 1.3em; /* import from .header-name in common.inc.css */
margin-block: calc(var(--base-unit) * 4);
font-size: var(--title-20-font-size); /* Note: this is from Photon Title 20 */
font-weight: var(--title-20-font-weight); /* Note: this is from Photon Title 20 */
display: grid;
grid-template-columns: var(--main-subheading-icon-size) 1fr;
@ -241,27 +257,31 @@ Form controls
}
/* standard, normal button */
.default-button, .default-select {
.default-button {
-moz-appearance: none;
font-size: 1em;
color: var(--text-color);
background-color: var(--page-background);
color: var(--grey-90); /* Note: this is from Photon Default button */
background-color: var(--grey-90-a10); /* Note: this is from Photon Default button */
font-size: var(--button-font-size); /* Note: this is from Photon Default button */
margin: 0;
height: calc(var(--base-unit) * 8); /* Note: this is from Photon, not common.css */
padding-inline-start: calc(var(--base-unit) * 5);
padding-inline-end: calc(var(--base-unit) * 5);
border: 1px solid var(--box-border-color);
border: none;
border-radius: calc(var(--base-unit) / 2);
}
.default-button:enabled:hover {
background: var(--box-background-hover)
background: var(--grey-90-a20); /* Note: this is from Photon Default button */
}
.default-button:enabled:active {
background: var(--grey-90-a30); /* Note: this is from Photon Default button */
}
.default-button:disabled {
opacity: 0.4;
opacity: 0.4; /* Note: this is from Photon Default button */
}
/* smaller size for a default button */
@ -342,6 +362,17 @@ Form controls
background: var(--error-50);
}
/*
* Card style which is used in debug target item and so on.
*/
.card {
background-color: var(--white-100); /* from common.inc.css */
border-radius: var(--base-unit); /* from common.inc.css */
box-shadow: 0 1px 4px var(--grey-90-a10); /* from common.inc.css */
padding-block: calc(var(--base-unit) * 3) calc(var(--base-unit) * 2);
padding-inline: calc(var(--base-unit) * 3) calc(var(--base-unit) * 2);
}
.undecorated-link,
.undecorated-link:hover {
text-decoration: none;

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

@ -32,6 +32,7 @@
grid-template-columns: var(--sidebar-width) auto;
font-size: var(--base-font-size);
font-weight: var(--base-font-weight);
line-height: var(--base-line-height);
}

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

@ -29,7 +29,8 @@ const TemporaryExtensionDetail = createFactory(require("./debugtarget/TemporaryE
const WorkerDetail = createFactory(require("./debugtarget/WorkerDetail"));
const Actions = require("../actions/index");
const { DEBUG_TARGET_PANE, MESSAGE_LEVEL, PAGE_TYPES } = require("../constants");
const { DEBUG_TARGETS, DEBUG_TARGET_PANE, MESSAGE_LEVEL, PAGE_TYPES } =
require("../constants");
const Types = require("../types/index");
const { getCurrentRuntimeDetails } = require("../modules/runtimes-state-helper");
@ -60,7 +61,20 @@ class RuntimePage extends PureComponent {
dispatch(Actions.selectPage(PAGE_TYPES.RUNTIME, runtimeId));
}
renderDebugTargetPane(name, targets, actionComponent,
getIconByType(type) {
switch (type) {
case DEBUG_TARGETS.EXTENSION:
return "chrome://devtools/skin/images/debugging-addons.svg";
case DEBUG_TARGETS.TAB:
return "chrome://devtools/skin/images/debugging-tabs.svg";
case DEBUG_TARGETS.WORKER:
return "chrome://devtools/skin/images/debugging-workers.svg";
}
throw new Error(`Unsupported type [${ type }]`);
}
renderDebugTargetPane(name, icon, targets, actionComponent,
detailComponent, paneKey, localizationId) {
const { collapsibilities, dispatch, runtimeDetails } = this.props;
@ -78,6 +92,7 @@ class RuntimePage extends PureComponent {
collapsibilityKey: paneKey,
detailComponent,
dispatch,
icon,
isCollapsed: collapsibilities.get(paneKey),
name,
targets,
@ -148,36 +163,42 @@ class RuntimePage extends PureComponent {
CompatibilityWarning({ compatibilityReport }),
this.renderTemporaryExtensionInstallError(),
this.renderDebugTargetPane("Temporary Extensions",
this.getIconByType(DEBUG_TARGETS.EXTENSION),
temporaryExtensions,
TemporaryExtensionAction,
TemporaryExtensionDetail,
DEBUG_TARGET_PANE.TEMPORARY_EXTENSION,
"about-debugging-runtime-temporary-extensions"),
this.renderDebugTargetPane("Extensions",
this.getIconByType(DEBUG_TARGETS.EXTENSION),
installedExtensions,
ExtensionAction,
ExtensionDetail,
DEBUG_TARGET_PANE.INSTALLED_EXTENSION,
"about-debugging-runtime-extensions"),
this.renderDebugTargetPane("Tabs",
this.getIconByType(DEBUG_TARGETS.TAB),
tabs,
InspectAction,
TabDetail,
DEBUG_TARGET_PANE.TAB,
"about-debugging-runtime-tabs"),
this.renderDebugTargetPane("Service Workers",
this.getIconByType(DEBUG_TARGETS.WORKER),
serviceWorkers,
ServiceWorkerAction,
WorkerDetail,
DEBUG_TARGET_PANE.SERVICE_WORKER,
"about-debugging-runtime-service-workers"),
this.renderDebugTargetPane("Shared Workers",
this.getIconByType(DEBUG_TARGETS.WORKER),
sharedWorkers,
InspectAction,
WorkerDetail,
DEBUG_TARGET_PANE.SHARED_WORKER,
"about-debugging-runtime-shared-workers"),
this.renderDebugTargetPane("Other Workers",
this.getIconByType(DEBUG_TARGETS.WORKER),
otherWorkers,
InspectAction,
WorkerDetail,

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

@ -14,7 +14,7 @@
*/
.debug-target-item {
display: grid;
grid-template-columns: calc(var(--base-unit) * 9) 1fr max-content;
grid-template-columns: calc(var(--base-unit) * 8) 1fr max-content;
grid-column-gap: calc(var(--base-unit) * 2);
grid-template-areas: "icon name action"
". detail detail";
@ -28,9 +28,8 @@
.debug-target-item__name {
grid-area: name;
/* so as to ellipsis */
min-width: 0;
font-size: calc(var(--base-unit) * 5);
font-size: var(--body-20-font-size);
font-weight: var(--body-20-font-weight);
}
.debug-target-item__action {
@ -40,4 +39,6 @@
.debug-target-item__detail {
grid-area: detail;
font-size: var(--caption-20-font-size);
font-weight: var(--caption-20-font-weight);
}

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

@ -63,7 +63,7 @@ class DebugTargetItem extends PureComponent {
render() {
return dom.li(
{
className: "debug-target-item js-debug-target-item",
className: "card debug-target-item js-debug-target-item",
},
this.renderIcon(),
this.renderName(),

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

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
.debug-target-list {
margin-inline-start: calc(var(--base-unit) * 6);
overflow: hidden;
}

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

@ -2,14 +2,26 @@
* 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/. */
/*
* Style for the heading of a debug target pane
* +-----------------+---------------+-----------------+
* | [Category icon] | Category name | [Collapse icon] |
* +-----------------+---------------+-----------------+
*/
.debug-target-pane__heading {
grid-template-columns: var(--main-subheading-icon-size) max-content calc(var(--base-unit) * 3);
-moz-user-select: none;
}
.debug-target-pane__icon {
transition: transform 150ms cubic-bezier(.07, .95, 0, 1);
transform: rotate(90deg);
}
.debug-target-pane__icon--collapsed {
transform: rotate(-90deg);
transform: rotate(0deg);
}
.debug-target-pane__title {
cursor: pointer;
}
}

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

@ -8,6 +8,8 @@ const { createFactory, PureComponent } = require("devtools/client/shared/vendor/
const dom = require("devtools/client/shared/vendor/react-dom-factories");
const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
const FluentReact = require("devtools/client/shared/vendor/fluent-react");
const DebugTargetList = createFactory(require("./DebugTargetList"));
const Actions = require("../../actions/index");
@ -23,6 +25,9 @@ class DebugTargetPane extends PureComponent {
collapsibilityKey: PropTypes.string.isRequired,
detailComponent: PropTypes.any.isRequired,
dispatch: PropTypes.func.isRequired,
// Provided by wrapping the component with FluentReact.withLocalization.
getString: PropTypes.func.isRequired,
icon: PropTypes.string.isRequired,
isCollapsed: PropTypes.bool.isRequired,
name: PropTypes.string.isRequired,
targets: PropTypes.arrayOf(Types.debugTarget).isRequired,
@ -39,11 +44,15 @@ class DebugTargetPane extends PureComponent {
actionComponent,
detailComponent,
dispatch,
getString,
icon,
isCollapsed,
name,
targets,
} = this.props;
const title = getString("about-debugging-collapse-expand-debug-targets");
return dom.section(
{
className: "js-debug-target-pane",
@ -51,19 +60,26 @@ class DebugTargetPane extends PureComponent {
dom.a(
{
className: "undecorated-link debug-target-pane__title " +
"js-debug-target-pane-title",
"js-debug-target-pane-title",
title,
onClick: e => this.toggleCollapsibility(),
},
dom.h2(
{ className: "main-subheading" },
{ className: "main-subheading debug-target-pane__heading" },
dom.img(
{
className: "main-subheading__icon",
src: icon,
}
),
`${ name } (${ targets.length })`,
dom.img(
{
className: "main-subheading__icon debug-target-pane__icon" +
(isCollapsed ? " debug-target-pane__icon--collapsed" : ""),
src: "chrome://devtools/skin/images/aboutdebugging-collapse-icon.svg",
(isCollapsed ? " debug-target-pane__icon--collapsed" : ""),
src: "chrome://devtools/skin/images/arrow-e.svg",
}
),
name + (isCollapsed ? ` (${ targets.length })` : ""),
)
),
DebugTargetList({
@ -77,4 +93,4 @@ class DebugTargetPane extends PureComponent {
}
}
module.exports = DebugTargetPane;
module.exports = FluentReact.withLocalization(DebugTargetPane);

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

@ -15,12 +15,15 @@ const {
REMOTE_RUNTIMES_UPDATED,
RUNTIMES,
SELECT_PAGE_SUCCESS,
SHOW_PROFILER_DIALOG,
TELEMETRY_RECORD,
UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS,
} = require("../constants");
const {
findRuntimeById,
getAllRuntimes,
getCurrentRuntime,
} = require("../modules/runtimes-state-helper");
function recordEvent(method, details) {
@ -40,6 +43,11 @@ function getTelemetryRuntimeId(id) {
return telemetryRuntimeIds.get(id);
}
function getCurrentRuntimeIdForTelemetry(store) {
const id = getCurrentRuntime(store.getState().runtimes).id;
return getTelemetryRuntimeId(id);
}
function getRuntimeEventExtras(runtime) {
const { extra, runtimeDetails } = runtime;
@ -145,6 +153,11 @@ function eventRecordingMiddleware(store) {
case SELECT_PAGE_SUCCESS:
recordEvent("select_page", { "page_type": action.page });
break;
case SHOW_PROFILER_DIALOG:
recordEvent("show_profiler", {
"runtime_id": getCurrentRuntimeIdForTelemetry(store),
});
break;
case TELEMETRY_RECORD:
const { method, details } = action;
if (method) {
@ -153,6 +166,12 @@ function eventRecordingMiddleware(store) {
console.error(`[RECORD EVENT FAILED] ${action.type}: no "method" property`);
}
break;
case UPDATE_CONNECTION_PROMPT_SETTING_SUCCESS:
recordEvent("update_conn_prompt", {
"prompt_enabled": `${action.connectionPromptEnabled}`,
"runtime_id": getCurrentRuntimeIdForTelemetry(store),
});
break;
}
return next(action);

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

@ -97,6 +97,7 @@ skip-if = (os == 'linux' && bits == 32) # ADB start() fails on linux 32, see Bug
[browser_aboutdebugging_telemetry_basic.js]
[browser_aboutdebugging_telemetry_inspect.js]
[browser_aboutdebugging_telemetry_navigate.js]
[browser_aboutdebugging_telemetry_runtime_actions.js]
[browser_aboutdebugging_telemetry_runtime_updates.js]
[browser_aboutdebugging_telemetry_runtime_updates_multi.js]
[browser_aboutdebugging_telemetry_runtime_updates_network.js]

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

@ -51,5 +51,7 @@ async function assertDebugTargetExpanded(paneEl, title) {
ok(true, "Height of list element is greater than zero");
// check title
const titleEl = paneEl.querySelector(".js-debug-target-pane-title");
is(titleEl.textContent, title, "Expanded title is correct");
const expectedTitle =
`${ title } (${ listEl.querySelectorAll(".js-debug-target-item").length })`;
is(titleEl.textContent, expectedTitle, "Expanded title is correct");
}

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

@ -65,16 +65,3 @@ function assertDialogHidden(doc) {
ok(!document.querySelector(".js-profiler-dialog"), "Dialog is removed");
ok(!document.querySelector(".js-profiler-dialog-mask"), "Dialog mask is removed");
}
function openProfilerDialog(client, doc) {
const onProfilerLoaded = new Promise(r => {
client.loadPerformanceProfiler = r;
});
info("Click on the Profile Runtime button");
const profileButton = doc.querySelector(".js-profile-runtime-button");
profileButton.click();
info("Wait for the loadPerformanceProfiler callback to be executed on client-wrapper");
return onProfilerLoaded;
}

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

@ -0,0 +1,77 @@
/* Any copyright is dedicated to the Public Domain.
* http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
/* import-globals-from helper-telemetry.js */
Services.scriptloader.loadSubScript(CHROME_URL_ROOT + "helper-telemetry.js", this);
const RUNTIME_ID = "test-runtime-id";
const RUNTIME_NAME = "Test Runtime";
const RUNTIME_DEVICE_NAME = "Test Device";
/**
* Test that runtime specific actions are logged as telemetry events with the expected
* runtime id and action type.
*/
add_task(async function testUsbRuntimeUpdates() {
// enable USB devices mocks
const mocks = new Mocks();
setupTelemetryTest();
const { tab, document } = await openAboutDebugging();
const sessionId = getOpenEventSessionId();
ok(!isNaN(sessionId), "Open event has a valid session id");
const usbClient = mocks.createUSBRuntime(RUNTIME_ID, {
deviceName: RUNTIME_DEVICE_NAME,
name: RUNTIME_NAME,
shortName: RUNTIME_NAME,
});
mocks.emitUSBUpdate();
info("Wait for the runtime to appear in the sidebar");
await waitUntil(() => findSidebarItemByText(RUNTIME_NAME, document));
await connectToRuntime(RUNTIME_DEVICE_NAME, document);
await selectRuntime(RUNTIME_DEVICE_NAME, RUNTIME_NAME, document);
info("Read telemetry events to flush unrelated events");
const evts = readAboutDebuggingEvents();
const runtimeAddedEvent = evts.filter(e => e.method === "runtime_added")[0];
const telemetryRuntimeId = runtimeAddedEvent.extras.runtime_id;
info("Click on the toggle button and wait until the text is updated");
const promptButton = document.querySelector(".js-connection-prompt-toggle-button");
promptButton.click();
await waitUntil(() => promptButton.textContent.includes("Enable"));
checkTelemetryEvents([{
method: "update_conn_prompt",
extras: { "prompt_enabled": "false", "runtime_id": telemetryRuntimeId },
}], sessionId);
info("Click on the toggle button again and check we log the correct value");
promptButton.click();
await waitUntil(() => promptButton.textContent.includes("Disable"));
checkTelemetryEvents([{
method: "update_conn_prompt",
extras: { "prompt_enabled": "true", "runtime_id": telemetryRuntimeId },
}], sessionId);
info("Open the profiler dialog");
await openProfilerDialog(usbClient, document);
checkTelemetryEvents([{
method: "show_profiler",
extras: { "runtime_id": telemetryRuntimeId },
}], sessionId);
info("Remove runtime");
mocks.removeRuntime(RUNTIME_ID);
mocks.emitUSBUpdate();
await waitUntil(() => !findSidebarItemByText(RUNTIME_NAME, document));
await removeTab(tab);
});

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

@ -33,10 +33,12 @@ add_task(async function() {
const paneTitles = [...paneTitlesEls].map(el => el.textContent);
EXPECTED_TARGET_PANES.forEach(expectedPane => {
ok(paneTitles.includes(expectedPane),
"Expected debug target category found: " + expectedPane);
});
for (let i = 0; i < EXPECTED_TARGET_PANES.length; i++) {
const expectedPaneTitle = EXPECTED_TARGET_PANES[i];
const actualPaneTitle = paneTitles[i];
ok(actualPaneTitle.startsWith(expectedPaneTitle),
`Expected debug target category found: ${ expectedPaneTitle }`);
}
await removeTab(tab);
});

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

@ -267,3 +267,20 @@ async function selectRuntime(deviceName, name, document) {
function getToolbox(win) {
return gDevTools.getToolboxes().find(toolbox => toolbox.win === win);
}
/**
* Open the performance profiler dialog. Assumes the client is a mocked remote runtime
* client.
*/
async function openProfilerDialog(client, doc) {
const onProfilerLoaded = new Promise(r => {
client.loadPerformanceProfiler = r;
});
info("Click on the Profile Runtime button");
const profileButton = doc.querySelector(".js-profile-runtime-button");
profileButton.click();
info("Wait for the loadPerformanceProfiler callback to be executed on client-wrapper");
return onProfilerLoaded;
}

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

@ -306,3 +306,8 @@ about-debugging-profiler-dialog-title = Performance Profiler
# The "Learn more" link points to MDN.
# https://developer.mozilla.org/docs/Tools/about:debugging#Enabling_add-on_debugging
about-debugging-extension-debug-setting-label = Enable extension debugging <a>Learn more</a>
# Clicking on the header of a debug target category will expand or collapse the debug
# target items in the category. This text is used as title attribute of the header,
# to describe this feature.
about-debugging-collapse-expand-debug-targets = Collapse / expand

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

@ -10,7 +10,6 @@ const { createFactory, createElement } = require("devtools/client/shared/vendor/
const { Provider } = require("devtools/client/shared/vendor/react-redux");
loader.lazyRequireGetter(this, "ChangesContextMenu", "devtools/client/inspector/changes/ChangesContextMenu");
loader.lazyRequireGetter(this, "prettifyCSS", "devtools/shared/inspector/css-logic", true);
loader.lazyRequireGetter(this, "clipboardHelper", "devtools/shared/platform/clipboard");
const ChangesApp = createFactory(require("./components/ChangesApp"));
@ -158,8 +157,7 @@ class ChangesView {
async copyRule(ruleId) {
const rule = await this.inspector.pageStyle.getRule(ruleId);
const text = await rule.getRuleText();
const prettyCSS = prettifyCSS(text);
clipboardHelper.copyString(prettyCSS);
clipboardHelper.copyString(text);
}
/**

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

@ -12,7 +12,6 @@ const { LocalizationHelper } = require("devtools/shared/l10n");
loader.lazyRequireGetter(this, "Menu", "devtools/client/framework/menu");
loader.lazyRequireGetter(this, "MenuItem", "devtools/client/framework/menu-item");
loader.lazyRequireGetter(this, "copyLongString", "devtools/client/inspector/shared/utils", true);
loader.lazyRequireGetter(this, "clipboardHelper", "devtools/shared/platform/clipboard");
loader.lazyGetter(this, "TOOLBOX_L10N", function() {
@ -101,21 +100,13 @@ class MarkupContextMenu {
* Copy the innerHTML of the selected Node to the clipboard.
*/
_copyInnerHTML() {
if (!this.selection.isNode()) {
return;
}
copyLongString(this.walker.innerHTML(this.selection.nodeFront));
this.markup.copyInnerHTML();
}
/**
* Copy the outerHTML of the selected Node to the clipboard.
*/
_copyOuterHTML() {
if (!this.selection.isNode()) {
return;
}
this.markup.copyOuterHTML();
}

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

@ -23,12 +23,13 @@ const RootContainer = require("devtools/client/inspector/markup/views/root-conta
loader.lazyRequireGetter(this, "MarkupContextMenu", "devtools/client/inspector/markup/markup-context-menu");
loader.lazyRequireGetter(this, "SlottedNodeContainer", "devtools/client/inspector/markup/views/slotted-node-container");
loader.lazyRequireGetter(this, "copyLongString", "devtools/client/inspector/shared/utils", true);
loader.lazyRequireGetter(this, "getLongString", "devtools/client/inspector/shared/utils", true);
loader.lazyRequireGetter(this, "openContentLink", "devtools/client/shared/link", true);
loader.lazyRequireGetter(this, "HTMLTooltip", "devtools/client/shared/widgets/tooltip/HTMLTooltip", true);
loader.lazyRequireGetter(this, "UndoStack", "devtools/client/shared/undo", true);
loader.lazyRequireGetter(this, "clipboardHelper", "devtools/shared/platform/clipboard");
loader.lazyRequireGetter(this, "beautify", "devtools/shared/jsbeautify/beautify");
loader.lazyRequireGetter(this, "getTabPrefs", "devtools/shared/indentation", true);
const INSPECTOR_L10N =
new LocalizationHelper("devtools/client/locales/inspector.properties");
@ -46,6 +47,7 @@ const DRAG_DROP_HEIGHT_TO_SPEED_MIN = 0.5;
const DRAG_DROP_HEIGHT_TO_SPEED_MAX = 1;
const ATTR_COLLAPSE_ENABLED_PREF = "devtools.markup.collapseAttributes";
const ATTR_COLLAPSE_LENGTH_PREF = "devtools.markup.collapseAttributeLength";
const BEAUTIFY_HTML_ON_COPY_PREF = "devtools.markup.beautifyOnCopy";
/**
* Vocabulary for the purposes of this file:
@ -802,7 +804,7 @@ MarkupView.prototype = {
switch (node.nodeType) {
case nodeConstants.ELEMENT_NODE :
copyLongString(this.walker.outerHTML(node));
copyLongHTMLString(this.walker.outerHTML(node));
break;
case nodeConstants.COMMENT_NODE :
getLongString(node.getNodeValue()).then(comment => {
@ -815,6 +817,17 @@ MarkupView.prototype = {
}
},
/**
* Copy the innerHTML of the selected Node to the clipboard.
*/
copyInnerHTML: function() {
if (!this.inspector.selection.isNode()) {
return;
}
copyLongHTMLString(this.walker.innerHTML(this.inspector.selection.nodeFront));
},
/**
* Given a type and link found in a node's attribute in the markup-view,
* attempt to follow that link (which may result in opening a new tab, the
@ -1467,12 +1480,7 @@ MarkupView.prototype = {
walkerPromise = this.walker.innerHTML(node);
}
return walkerPromise.then(longstr => {
return longstr.string().then(html => {
longstr.release().catch(console.error);
return html;
});
});
return getLongString(walkerPromise);
},
/**
@ -2188,6 +2196,33 @@ MarkupView.prototype = {
},
};
/**
* Copy the content of a longString containing HTML code to the clipboard.
* The string is retrieved, and possibly beautified if the user has the right pref set and
* then placed in the clipboard.
*
* @param {Promise} longStringActorPromise
* The promise expected to resolve a LongStringActor instance
*/
async function copyLongHTMLString(longStringActorPromise) {
let string = await getLongString(longStringActorPromise);
if (Services.prefs.getBoolPref(BEAUTIFY_HTML_ON_COPY_PREF)) {
const { indentUnit, indentWithTabs } = getTabPrefs();
string = beautify.html(string, {
// eslint-disable-next-line camelcase
preserve_newlines: false,
// eslint-disable-next-line camelcase
indent_size: indentWithTabs ? 1 : indentUnit,
// eslint-disable-next-line camelcase
indent_char: indentWithTabs ? "\t" : " ",
unformatted: [],
});
}
clipboardHelper.copyString(string);
}
/**
* Map a number from one range to another.
*/

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

@ -99,6 +99,8 @@ skip-if = os == "mac" # Full keyboard navigation on OSX only works if Full Keybo
[browser_markup_anonymous_02.js]
[browser_markup_anonymous_03.js]
[browser_markup_anonymous_04.js]
[browser_markup_copy_html.js]
subsuite = clipboard
[browser_markup_copy_image_data.js]
subsuite = clipboard
skip-if = (os == 'linux' && bits == 32 && debug) # bug 1328915, disable linux32 debug devtools for timeouts

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

@ -0,0 +1,83 @@
/* vim: set ts=2 et sw=2 tw=80: */
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
// Test the copy inner and outer html menu options.
// The nicely formatted HTML code.
const FORMATTED_HTML =
`<body>
<style>
div {
color: red;
}
span {
text-decoration: underline;
}
</style>
<div>
<span>
<em>Hello</em>
</span>
</div>
<script>
console.log("Hello!");
</script>
</body>`;
// The inner HTML of the body node from the code above.
const FORMATTED_INNER_HTML = FORMATTED_HTML.replace(/<\/*body>/g, "").trim()
.replace(/^ /gm, "");
// The formatted outer HTML, using tabs rather than spaces.
const TABS_FORMATTED_HTML = FORMATTED_HTML.replace(/[ ]{2}/g, "\t");
// The formatted outer HTML, using 3 spaces instead of 2.
const THREE_SPACES_FORMATTED_HTML = FORMATTED_HTML.replace(/[ ]{2}/g, " ");
// Uglify the formatted code by removing all spaces and line breaks.
const UGLY_HTML = FORMATTED_HTML.replace(/[\r\n\s]+/g, "");
// And here is the inner html of the body node from the ugly code above.
const UGLY_INNER_HTML = UGLY_HTML.replace(/<\/*body>/g, "");
add_task(async function() {
// Load the ugly code in a new tab and open the inspector.
const { inspector } = await openInspectorForURL(
"data:text/html;charset=utf-8," + encodeURIComponent(UGLY_HTML));
info("Get the inner and outer html copy menu items");
const allMenuItems = openContextMenuAndGetAllItems(inspector);
const outerHtmlMenu = allMenuItems.find(({ id }) => id === "node-menu-copyouter");
const innerHtmlMenu = allMenuItems.find(({ id }) => id === "node-menu-copyinner");
info("Try to copy the outer html");
await waitForClipboardPromise(() => outerHtmlMenu.click(), UGLY_HTML);
info("Try to copy the inner html");
await waitForClipboardPromise(() => innerHtmlMenu.click(), UGLY_INNER_HTML);
info("Set the pref for beautifying html on copy");
await pushPref("devtools.markup.beautifyOnCopy", true);
info("Try to copy the beautified outer html");
await waitForClipboardPromise(() => outerHtmlMenu.click(), FORMATTED_HTML);
info("Try to copy the beautified inner html");
await waitForClipboardPromise(() => innerHtmlMenu.click(), FORMATTED_INNER_HTML);
info("Set the pref to stop expanding tabs into spaces");
await pushPref("devtools.editor.expandtab", false);
info("Check that the beautified outer html uses tabs");
await waitForClipboardPromise(() => outerHtmlMenu.click(), TABS_FORMATTED_HTML);
info("Set the pref to expand tabs to 3 spaces");
await pushPref("devtools.editor.expandtab", true);
await pushPref("devtools.editor.tabsize", 3);
info("Try to copy the beautified outer html");
await waitForClipboardPromise(() => outerHtmlMenu.click(), THREE_SPACES_FORMATTED_HTML);
});

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

@ -8,6 +8,7 @@ const { editableField } = require("devtools/client/shared/inplace-editor");
const { LocalizationHelper } = require("devtools/shared/l10n");
loader.lazyRequireGetter(this, "getAutocompleteMaxWidth", "devtools/client/inspector/markup/utils", true);
loader.lazyRequireGetter(this, "getLongString", "devtools/client/inspector/shared/utils", true);
const INSPECTOR_L10N =
new LocalizationHelper("devtools/client/locales/inspector.properties");
@ -42,15 +43,11 @@ function TextEditor(container, node, type) {
if (!commit) {
return;
}
this.node.getNodeValue().then(longstr => {
longstr.string().then(oldValue => {
longstr.release().catch(console.error);
this.container.undo.do(() => {
this.node.setNodeValue(val);
}, () => {
this.node.setNodeValue(oldValue);
});
getLongString(this.node.getNodeValue()).then(oldValue => {
this.container.undo.do(() => {
this.node.setNodeValue(val);
}, () => {
this.node.setNodeValue(oldValue);
});
});
},
@ -98,12 +95,7 @@ TextEditor.prototype = {
},
update: function() {
let longstr = null;
this.node.getNodeValue().then(ret => {
longstr = ret;
return longstr.string();
}).then(str => {
longstr.release().catch(console.error);
getLongString(this.node.getNodeValue()).then(str => {
this.value.textContent = str;
const isWhitespace = !/[^\s]/.exec(str);

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

@ -11,7 +11,6 @@ const promise = require("promise");
loader.lazyRequireGetter(this, "KeyCodes", "devtools/client/shared/keycodes", true);
loader.lazyRequireGetter(this, "getCSSLexer", "devtools/shared/css/lexer", true);
loader.lazyRequireGetter(this, "parseDeclarations", "devtools/shared/css/parsing-utils", true);
loader.lazyRequireGetter(this, "clipboardHelper", "devtools/shared/platform/clipboard");
const HTML_NS = "http://www.w3.org/1999/xhtml";
@ -83,21 +82,6 @@ function blurOnMultipleProperties(cssProperties) {
};
}
/**
* Copy the content of a longString (via a promise resolving a
* LongStringActor) to the clipboard.
*
* @param {Promise} longStringActorPromise
* promise expected to resolve a LongStringActor instance
* @return {Promise} promise resolving (with no argument) when the
* string is sent to the clipboard
*/
function copyLongString(longStringActorPromise) {
return getLongString(longStringActorPromise).then(string => {
clipboardHelper.copyString(string);
}).catch(console.error);
}
/**
* Create a child element with a set of attributes.
*
@ -228,7 +212,6 @@ function translateNodeFrontToGrip(nodeFront) {
exports.advanceValidate = advanceValidate;
exports.appendText = appendText;
exports.blurOnMultipleProperties = blurOnMultipleProperties;
exports.copyLongString = copyLongString;
exports.createChild = createChild;
exports.getLongString = getLongString;
exports.getSelectorFromGrip = getSelectorFromGrip;

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

@ -89,7 +89,6 @@ devtools.jar:
skin/images/checkbox.svg (themes/images/checkbox.svg)
skin/images/filters.svg (themes/images/filters.svg)
skin/images/filter-swatch.svg (themes/images/filter-swatch.svg)
skin/images/aboutdebugging-collapse-icon.svg (themes/images/aboutdebugging-collapse-icon.svg)
skin/images/aboutdebugging-connect-icon.svg (themes/images/aboutdebugging-connect-icon.svg)
skin/images/aboutdebugging-firefox-aurora.svg (themes/images/aboutdebugging-firefox-aurora.svg)
skin/images/aboutdebugging-firefox-beta.svg (themes/images/aboutdebugging-firefox-beta.svg)

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

@ -93,6 +93,9 @@ pref("devtools.markup.collapseAttributes", true);
// Length to collapse attributes
pref("devtools.markup.collapseAttributeLength", 120);
// Whether to auto-beautify the HTML on copy.
pref("devtools.markup.beautifyOnCopy", false);
// DevTools default color unit
pref("devtools.defaultColorUnit", "authored");

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

@ -1,8 +0,0 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<svg width="16" height="16" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg" fill="context-fill #0b0b0b">
<path d="M4 12.5l8-5-8-5v10zm-1 0v-10a1 1 0 0 1 1.53-.848l8 5a1 1 0 0 1 0 1.696l-8 5A1 1 0 0 1 3 12.5z"
transform="rotate(90, 7.5, 8)"
fill-rule="evenodd"/>
</svg>

До

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

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

@ -23,6 +23,8 @@ loader.lazyRequireGetter(this, "isCssPropertyKnown",
"devtools/server/actors/css-properties", true);
loader.lazyRequireGetter(this, "parseNamedDeclarations",
"devtools/shared/css/parsing-utils", true);
loader.lazyRequireGetter(this, "prettifyCSS",
"devtools/shared/inspector/css-logic", true);
loader.lazyRequireGetter(this, "UPDATE_PRESERVING_RULES",
"devtools/server/actors/stylesheets", true);
loader.lazyRequireGetter(this, "UPDATE_GENERAL",
@ -1397,13 +1399,18 @@ var StyleRuleActor = protocol.ActorClassWithSpec(styleRuleSpec, {
* authored form is available, this also sets |this.authoredText|.
* The authored text will include invalid and otherwise ignored
* properties.
*
* @param {Boolean} skipCache
* If a value for authoredText was previously found and cached,
* ignore it and parse the stylehseet again. The authoredText
* may be outdated if a descendant of this rule has changed.
*/
getAuthoredCssText: function() {
getAuthoredCssText: function(skipCache = false) {
if (!this.canSetRuleText || !SUPPORTED_RULE_TYPES.includes(this.type)) {
return Promise.resolve("");
}
if (typeof this.authoredText === "string") {
if (typeof this.authoredText === "string" && !skipCache) {
return Promise.resolve(this.authoredText);
}
@ -1424,29 +1431,37 @@ var StyleRuleActor = protocol.ActorClassWithSpec(styleRuleSpec, {
* method includes the CSS selectors and at-rules (@media, @supports, @keyframes, etc.)
*
* If the rule type is unrecongized, the promise resolves to an empty string.
* If the rule is an element inline style, the promise resolves to the text content of
* If the rule is an element inline style, the promise resolves with the generated
* selector that uniquely identifies the element and with the rule body consisting of
* the element's style attribute.
*
* @return {String}
*/
getRuleText: async function() {
if (this.type === ELEMENT_STYLE) {
return Promise.resolve(this.rawNode.getAttribute("style"));
}
if (!SUPPORTED_RULE_TYPES.includes(this.type)) {
// Bail out if the rule is not supported or not an element inline style.
if (![...SUPPORTED_RULE_TYPES, ELEMENT_STYLE].includes(this.type)) {
return Promise.resolve("");
}
const ruleBodyText = await this.getAuthoredCssText();
const { str: stylesheetText } = await this.sheetActor.getText();
const [start, end] = getSelectorOffsets(stylesheetText, this.line, this.column);
const selectorText = stylesheetText.substring(start, end);
let ruleBodyText;
let selectorText;
let text;
// For element inline styles, use the style attribute and generated unique selector.
if (this.type === ELEMENT_STYLE) {
ruleBodyText = this.rawNode.getAttribute("style");
selectorText = this.metadata.selector;
} else {
// Get the rule's authored text and skip any cached value.
ruleBodyText = await this.getAuthoredCssText(true);
const { str: stylesheetText } = await this.sheetActor.getText();
const [start, end] = getSelectorOffsets(stylesheetText, this.line, this.column);
selectorText = stylesheetText.substring(start, end);
}
// CSS rule type as a string "@media", "@supports", "@keyframes", etc.
const typeName = CSSRuleTypeName[this.type];
let text;
// When dealing with at-rules, getSelectorOffsets() will not return the rule type.
// We prepend it ourselves.
if (typeName) {
@ -1455,7 +1470,8 @@ var StyleRuleActor = protocol.ActorClassWithSpec(styleRuleSpec, {
text = `${selectorText} {${ruleBodyText}}`;
}
return text;
const prettyCSS = prettifyCSS(text);
return Promise.resolve(prettyCSS);
},
/**

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

@ -1341,7 +1341,9 @@ Document::Document(const char* aContentType)
mIgnoreOpensDuringUnloadCounter(0),
mDocLWTheme(Doc_Theme_Uninitialized),
mSavedResolution(1.0f),
mPendingInitialTranslation(false) {
mPendingInitialTranslation(false),
mGeneration(0),
mCachedTabSizeGeneration(0) {
MOZ_LOG(gDocumentLeakPRLog, LogLevel::Debug, ("DOCUMENT %p created", this));
SetIsInDocument();
@ -12549,6 +12551,24 @@ bool Document::StorageAccessSandboxed() const {
(GetSandboxFlags() & SANDBOXED_STORAGE_ACCESS) != 0;
}
bool Document::GetCachedSizes(nsTabSizes* aSizes) {
if (mCachedTabSizeGeneration == 0 ||
GetGeneration() != mCachedTabSizeGeneration) {
return false;
}
aSizes->mDom += mCachedTabSizes.mDom;
aSizes->mStyle += mCachedTabSizes.mStyle;
aSizes->mOther += mCachedTabSizes.mOther;
return true;
}
void Document::SetCachedSizes(nsTabSizes* aSizes) {
mCachedTabSizes.mDom = aSizes->mDom;
mCachedTabSizes.mStyle = aSizes->mStyle;
mCachedTabSizes.mOther = aSizes->mOther;
mCachedTabSizeGeneration = GetGeneration();
}
already_AddRefed<nsAtom> Document::GetContentLanguageAsAtomForStyle() const {
nsAutoString contentLang;
GetContentLanguage(contentLang);

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

@ -1490,6 +1490,21 @@ class Document : public nsINode,
// flag.
bool StorageAccessSandboxed() const;
// Increments the document generation.
inline void Changed() { ++mGeneration; }
// Returns the current generation.
inline int32_t GetGeneration() const { return mGeneration; }
// Adds cached sizes values to aSizes if there's any
// cached value and if the document generation hasn't
// changed since the cache was created.
// Returns true if sizes were added.
bool GetCachedSizes(nsTabSizes* aSizes);
// Sets the cache sizes for the current generation.
void SetCachedSizes(nsTabSizes* aSizes);
protected:
friend class nsUnblockOnloadEvent;
@ -4641,6 +4656,13 @@ class Document : public nsINode,
bool mPendingInitialTranslation;
// Document generation. Gets incremented everytime it changes.
int32_t mGeneration;
// Cached TabSizes values for the document.
int32_t mCachedTabSizeGeneration;
nsTabSizes mCachedTabSizes;
public:
// Needs to be public because the bindings code pokes at it.
js::ExpandoAndGeneration mExpandoAndGeneration;

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

@ -136,6 +136,7 @@ void nsNodeUtils::CharacterDataWillChange(
void nsNodeUtils::CharacterDataChanged(nsIContent* aContent,
const CharacterDataChangeInfo& aInfo) {
Document* doc = aContent->OwnerDoc();
doc->Changed();
IMPL_MUTATION_NOTIFICATION(CharacterDataChanged, aContent, (aContent, aInfo),
IsRemoveNotification::No);
}
@ -152,6 +153,7 @@ void nsNodeUtils::AttributeChanged(Element* aElement, int32_t aNameSpaceID,
nsAtom* aAttribute, int32_t aModType,
const nsAttrValue* aOldValue) {
Document* doc = aElement->OwnerDoc();
doc->Changed();
IMPL_MUTATION_NOTIFICATION(
AttributeChanged, aElement,
(aElement, aNameSpaceID, aAttribute, aModType, aOldValue),
@ -170,7 +172,7 @@ void nsNodeUtils::AttributeSetToCurrentValue(Element* aElement,
void nsNodeUtils::ContentAppended(nsIContent* aContainer,
nsIContent* aFirstNewContent) {
Document* doc = aContainer->OwnerDoc();
doc->Changed();
IMPL_MUTATION_NOTIFICATION(ContentAppended, aContainer, (aFirstNewContent),
IsRemoveNotification::No);
}
@ -188,6 +190,7 @@ void nsNodeUtils::ContentInserted(nsINode* aContainer, nsIContent* aChild) {
MOZ_ASSERT(aContainer->IsContent() || aContainer->IsDocument(),
"container must be an nsIContent or an Document");
Document* doc = aContainer->OwnerDoc();
doc->Changed();
IMPL_MUTATION_NOTIFICATION(ContentInserted, aContainer, (aChild),
IsRemoveNotification::No);
}
@ -197,6 +200,7 @@ void nsNodeUtils::ContentRemoved(nsINode* aContainer, nsIContent* aChild,
MOZ_ASSERT(aContainer->IsContent() || aContainer->IsDocument(),
"container must be an nsIContent or an Document");
Document* doc = aContainer->OwnerDoc();
doc->Changed();
MOZ_ASSERT(aChild->GetParentNode() == aContainer,
"We expect the parent link to be still around at this point");
IMPL_MUTATION_NOTIFICATION(ContentRemoved, aContainer,

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

@ -1585,7 +1585,9 @@ class WebGLContext : public nsICanvasRenderingContextInternal,
public:
// returns true if the extension has been enabled by calling getExtension.
bool IsExtensionEnabled(WebGLExtensionID ext) const;
bool IsExtensionEnabled(const WebGLExtensionID ext) const {
return mExtensions[ext];
}
protected:
// returns true if the extension is supported for this caller type (this

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

@ -70,10 +70,6 @@ namespace mozilla {
return sExtensionNamesEnumeratedArray[ext];
}
bool WebGLContext::IsExtensionEnabled(WebGLExtensionID ext) const {
return mExtensions[ext];
}
bool WebGLContext::IsExtensionSupported(dom::CallerType callerType,
WebGLExtensionID ext) const {
bool allowPrivilegedExts = false;

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

@ -45,7 +45,7 @@ class Interval {
: mStart(std::forward<StartArg>(aStart)),
mEnd(std::forward<EndArg>(aEnd)),
mFuzz() {
MOZ_ASSERT(aStart <= aEnd);
MOZ_DIAGNOSTIC_ASSERT(mStart <= mEnd, "Invalid Interval");
}
template <typename StartArg, typename EndArg, typename FuzzArg>
@ -53,7 +53,7 @@ class Interval {
: mStart(std::forward<StartArg>(aStart)),
mEnd(std::forward<EndArg>(aEnd)),
mFuzz(std::forward<FuzzArg>(aFuzz)) {
MOZ_ASSERT(aStart <= aEnd);
MOZ_DIAGNOSTIC_ASSERT(mStart <= mEnd, "Invalid Interval");
}
Interval(const SelfType& aOther)

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

@ -86,6 +86,8 @@ bool AudioData::SetTrimWindow(const media::TimeInterval& aTrim) {
// Overflow.
return false;
}
MOZ_DIAGNOSTIC_ASSERT(trimAfter.value() >= trimBefore.value(),
"Something went wrong with trimming value");
if (!mTrimWindow && trimBefore == 0 && trimAfter == originalFrames) {
// Nothing to change, abort early to prevent rounding errors.
return true;
@ -93,7 +95,11 @@ bool AudioData::SetTrimWindow(const media::TimeInterval& aTrim) {
mTrimWindow = Some(aTrim);
mDataOffset = trimBefore.value() * mChannels;
MOZ_DIAGNOSTIC_ASSERT(mDataOffset <= mAudioData.Length(),
"Data offset outside original buffer");
mFrames = (trimAfter - trimBefore).value();
MOZ_DIAGNOSTIC_ASSERT(mFrames <= originalFrames,
"More frames than found in container");
mTime = mOriginalTime + FramesToTimeUnit(trimBefore.value(), mRate);
mDuration = FramesToTimeUnit(mFrames, mRate);

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

@ -182,7 +182,7 @@ class AlignedBuffer {
static size_t AlignmentPaddingSize() { return AlignmentOffset() * 2; }
void PopFront(size_t aSize) {
MOZ_ASSERT(mLength >= aSize);
MOZ_DIAGNOSTIC_ASSERT(mLength >= aSize, "Popping too many frames");
PodMove(mData, mData + aSize, mLength - aSize);
mLength -= aSize;
}

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

@ -1291,20 +1291,13 @@ class MediaDecoderStateMachine::AccurateSeekingState
nsresult DropAudioUpToSeekTarget(AudioData* aAudio) {
MOZ_ASSERT(aAudio && mSeekJob.mTarget->IsAccurate());
auto sampleDuration =
FramesToTimeUnit(aAudio->Frames(), Info().mAudio.mRate);
if (!sampleDuration.IsValid()) {
return NS_ERROR_DOM_MEDIA_OVERFLOW_ERR;
}
auto audioTime = aAudio->mTime;
if (audioTime + sampleDuration <= mSeekJob.mTarget->GetTime()) {
if (mSeekJob.mTarget->GetTime() >= aAudio->GetEndTime()) {
// Our seek target lies after the frames in this AudioData. Don't
// push it onto the audio queue, and keep decoding forwards.
return NS_OK;
}
if (audioTime > mSeekJob.mTarget->GetTime()) {
if (aAudio->mTime > mSeekJob.mTarget->GetTime()) {
// The seek target doesn't lie in the audio block just after the last
// audio frames we've seen which were before the seek target. This
// could have been the first audio data we've seen after seek, i.e. the
@ -1318,14 +1311,6 @@ class MediaDecoderStateMachine::AccurateSeekingState
return NS_OK;
}
// The seek target lies somewhere in this AudioData's frames, strip off
// any frames which lie before the seek target, so we'll begin playback
// exactly at the seek target.
NS_ASSERTION(mSeekJob.mTarget->GetTime() >= audioTime,
"Target must at or be after data start.");
NS_ASSERTION(mSeekJob.mTarget->GetTime() < audioTime + sampleDuration,
"Data must end after target.");
bool ok = aAudio->SetTrimWindow(
{mSeekJob.mTarget->GetTime(), aAudio->GetEndTime()});
if (!ok) {

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

@ -5,7 +5,7 @@ random == bug-364968.html bug-364968-ref.html
== mozsetimageelement-02.html about:blank
== image-outside-document-invalidate.html about:blank
== canvas-outside-document-invalidate-01.html about:blank
fails-if(azureSkia) fails-if(cocoaWidget) == canvas-outside-document-invalidate-02.html about:blank # See bug 666800
fails-if(azureSkia&&!(webrender&&winWidget)) fails-if(cocoaWidget) == canvas-outside-document-invalidate-02.html about:blank # See bug 666800
#fails with Skia due to Skia bug http://code.google.com/p/skia/issues/detail?id=568
fuzzy-if(webrender&&!gtkWidget,117-129,47-54) == element-paint-simple.html element-paint-simple-ref.html
== element-paint-repeated.html element-paint-repeated-ref.html

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

@ -60,91 +60,93 @@ def method(prop):
return prop.camel_case[1:]
return prop.camel_case
# Colors, integers and lengths are easy as well.
#
# TODO(emilio): This will go away once the rest of the longhands have been
# moved or perhaps using a blacklist for the ones with non-layout-dependence
# but other non-trivial dependence like scrollbar colors.
SERIALIZED_PREDEFINED_TYPES = [
"Appearance",
"AlignContent",
"AlignItems",
"AlignSelf",
"BackgroundRepeat",
"BackgroundSize",
"BorderImageRepeat",
"BorderStyle",
"BreakBetween",
"BreakWithin",
"Clear",
"ClipRectOrAuto",
"Color",
"Content",
"CounterIncrement",
"CounterReset",
"Cursor",
"FillRule",
"Float",
"FontFamily",
"FontFeatureSettings",
"FontLanguageOverride",
"FontSize",
"FontSizeAdjust",
"FontStretch",
"FontStyle",
"FontSynthesis",
"FontVariant",
"FontVariantAlternates",
"FontVariantEastAsian",
"FontVariantLigatures",
"FontVariantNumeric",
"FontVariationSettings",
"FontWeight",
"Integer",
"ImageLayer",
"JustifyContent",
"JustifyItems",
"JustifySelf",
"Length",
"LengthPercentage",
"NonNegativeLength",
"NonNegativeLengthPercentage",
"NonNegativeLengthPercentageOrAuto",
"ListStyleType",
"OffsetPath",
"Opacity",
"OutlineStyle",
"OverflowWrap",
"Position",
"Quotes",
"Resize",
"Rotate",
"Scale",
"TextAlign",
"Translate",
"TimingFunction",
"TransformOrigin",
"TransformStyle",
"UserSelect",
"background::BackgroundSize",
"basic_shape::ClippingShape",
"basic_shape::FloatAreaShape",
"position::HorizontalPosition",
"position::VerticalPosition",
"url::ImageUrlOrNone",
"Appearance",
"OverscrollBehavior",
"OverflowAnchor",
"OverflowClipBox",
"ScrollSnapAlign",
"ScrollSnapType",
"Float",
"Overflow",
"BorderImageSlice",
"NonNegativeLengthOrNumberRect",
"NonNegativeLengthOrNumber",
"ZIndex",
"Perspective",
# TODO(emilio): Get this to zero.
LONGHANDS_NOT_SERIALIZED_WITH_SERVO = [
"animation-delay",
"animation-duration",
"animation-iteration-count",
"animation-name",
"border-bottom-left-radius",
"border-bottom-right-radius",
"border-end-end-radius",
"border-end-start-radius",
"border-image-width",
"border-spacing",
"border-start-end-radius",
"border-start-start-radius",
"border-top-left-radius",
"border-top-right-radius",
"border-image-width",
"border-spacing",
"box-shadow",
"caret-color",
"color",
"column-count",
"column-gap",
"column-rule-width",
"column-width",
"contain",
"display",
"fill",
"fill-opacity",
"filter",
"flex-basis",
"flex-grow",
"flex-shrink",
"grid-auto-columns",
"grid-auto-flow",
"grid-auto-rows",
"grid-column-end",
"grid-column-start",
"grid-row-end",
"grid-row-start",
"grid-template-areas",
"initial-letter",
"letter-spacing",
"marker-end",
"marker-mid",
"marker-start",
"max-block-size",
"max-height",
"max-inline-size",
"max-width",
"min-block-size",
"min-height",
"min-inline-size",
"min-width",
"-moz-binding",
"-moz-box-flex",
"-moz-force-broken-image-icon",
"-moz-osx-font-smoothing",
"-moz-outline-radius-bottomleft",
"-moz-outline-radius-bottomright",
"-moz-outline-radius-topleft",
"-moz-outline-radius-topright",
"outline-width",
"paint-order",
"row-gap",
"scrollbar-color",
"scroll-snap-points-x",
"scroll-snap-points-y",
"stroke",
"stroke-dasharray",
"stroke-dashoffset",
"stroke-miterlimit",
"stroke-opacity",
"stroke-width",
"text-decoration-line",
"text-emphasis-position",
"text-emphasis-style",
"text-overflow",
"text-shadow",
"touch-action",
"transition-delay",
"transition-duration",
"transition-property",
"vertical-align",
"-webkit-text-stroke-width",
"will-change",
"word-spacing",
]
def serialized_by_servo(prop):
@ -160,10 +162,7 @@ def serialized_by_servo(prop):
# resistfingerprinting stuff.
if prop.keyword and prop.name != "-moz-osx-font-smoothing":
return True
if prop.predefined_type in SERIALIZED_PREDEFINED_TYPES:
return True
# TODO(emilio): Enable the rest of the longhands.
return False
return prop.name not in LONGHANDS_NOT_SERIALIZED_WITH_SERVO
def exposed_on_getcs(prop):
if prop.type() == "longhand":

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

@ -7708,6 +7708,246 @@ if (IsCSSPropertyPrefEnabled("layout.css.scroll-snap.enabled")) {
};
}
if (IsCSSPropertyPrefEnabled("layout.css.scroll-snap-v1.enabled")) {
gCSSProperties["scroll-snap-align"] = {
domProp: "scrollSnapAlign",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "none" ],
other_values: [ "start", "end", "center", "start none", "center end",
"start start" ],
invalid_values: [ "auto", "start invalid", "start end center" ]
};
gCSSProperties["scroll-margin"] = {
domProp: "scrollMargin",
inherited: false,
type: CSS_TYPE_TRUE_SHORTHAND,
subproperties: [ "scroll-margin-top",
"scroll-margin-right",
"scroll-margin-bottom",
"scroll-margin-left" ],
initial_values: [ "0" ],
other_values: [ "-10px", "calc(2em + 3ex)", "1px 2px", "1px 2px 3px",
"1px 2px 3px 4px" ],
invalid_values: [ "auto", "20%", "-30%", "1px 2px 3px 4px 5px" ],
};
gCSSProperties["scroll-margin-top"] = {
domProp: "scrollMarginTop",
inherited: false,
type: CSS_TYPE_LONGHAND,
applies_to_first_letter: true,
applies_to_first_line: true,
initial_values: [ "0" ],
other_values: [ "-10px", "calc(2em + 3ex)" ],
invalid_values: [ "auto", "20%", "-30%", "1px 2px" ],
};
gCSSProperties["scroll-margin-right"] = {
domProp: "scrollMarginRight",
inherited: false,
type: CSS_TYPE_LONGHAND,
applies_to_first_letter: true,
applies_to_first_line: true,
initial_values: [ "0" ],
other_values: [ "-10px", "calc(2em + 3ex)" ],
invalid_values: [ "auto", "20%", "-30%", "1px 2px" ],
};
gCSSProperties["scroll-margin-bottom"] = {
domProp: "scrollMarginBottom",
inherited: false,
type: CSS_TYPE_LONGHAND,
applies_to_first_letter: true,
applies_to_first_line: true,
initial_values: [ "0" ],
other_values: [ "-10px", "calc(2em + 3ex)" ],
invalid_values: [ "auto", "20%", "-30%", "1px 2px" ],
};
gCSSProperties["scroll-margin-left"] = {
domProp: "scrollMarginLeft",
inherited: false,
type: CSS_TYPE_LONGHAND,
applies_to_first_letter: true,
applies_to_first_line: true,
initial_values: [ "0" ],
other_values: [ "-10px", "calc(2em + 3ex)" ],
invalid_values: [ "auto", "20%", "-30%", "1px 2px" ],
};
gCSSProperties["scroll-margin-inline"] = {
domProp: "scrollMarginInline",
inherited: false,
type: CSS_TYPE_TRUE_SHORTHAND,
subproperties: [ "scroll-margin-inline-start",
"scroll-margin-inline-end" ],
initial_values: [ "0" ],
other_values: [ "-10px", "calc(2em + 3ex)", "1px 2px" ],
invalid_values: [ "auto", "20%", "-30%", "1px 2px 3px" ],
};
gCSSProperties["scroll-margin-inline-start"] = {
domProp: "scrollMarginInlineStart",
inherited: false,
type: CSS_TYPE_LONGHAND,
logical: true,
applies_to_first_letter: true,
applies_to_first_line: true,
initial_values: [ "0" ],
other_values: [ "-10px", "calc(2em + 3ex)" ],
invalid_values: [ "auto", "20%", "-30%", "1px 2px" ],
};
gCSSProperties["scroll-margin-inline-end"] = {
domProp: "scrollMarginInlineEnd",
inherited: false,
type: CSS_TYPE_LONGHAND,
logical: true,
applies_to_first_letter: true,
applies_to_first_line: true,
initial_values: [ "0" ],
other_values: [ "-10px", "calc(2em + 3ex)" ],
invalid_values: [ "auto", "20%", "-30%", "1px 2px" ],
};
gCSSProperties["scroll-margin-block"] = {
domProp: "scrollMarginBlock",
inherited: false,
type: CSS_TYPE_TRUE_SHORTHAND,
subproperties: [ "scroll-margin-block-start",
"scroll-margin-block-end" ],
initial_values: [ "0" ],
other_values: [ "-10px", "calc(2em + 3ex)", "1px 2px" ],
invalid_values: [ "auto", "20%", "-30%", "1px 2px 3px" ],
};
gCSSProperties["scroll-margin-block-start"] = {
domProp: "scrollMarginBlockStart",
inherited: false,
type: CSS_TYPE_LONGHAND,
logical: true,
applies_to_first_letter: true,
applies_to_first_line: true,
initial_values: [ "0" ],
other_values: [ "-10px", "calc(2em + 3ex)" ],
invalid_values: [ "auto", "20%", "-30%", "1px 2px" ],
};
gCSSProperties["scroll-margin-block-end"] = {
domProp: "scrollMarginBlockEnd",
inherited: false,
type: CSS_TYPE_LONGHAND,
logical: true,
applies_to_first_letter: true,
applies_to_first_line: true,
initial_values: [ "0" ],
other_values: [ "-10px", "calc(2em + 3ex)" ],
invalid_values: [ "auto", "20%", "-30%", "1px 2px" ],
};
gCSSProperties["scroll-padding"] = {
domProp: "scrollPadding",
inherited: false,
type: CSS_TYPE_TRUE_SHORTHAND,
subproperties: [ "scroll-padding-top",
"scroll-padding-right",
"scroll-padding-bottom",
"scroll-padding-left" ],
initial_values: [ "auto" ],
other_values: [ "10px", "0", "20%", "calc(2em + 3ex)", "1px 2px",
"1px 2px 3%", "1px 2px 3% 4px", "1px auto" ],
invalid_values: [ "20", "-20px" ]
};
gCSSProperties["scroll-padding-top"] = {
domProp: "scrollPaddingTop",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "auto" ],
other_values: [ "0", "10px", "20%", "calc(2em + 3ex)", "calc(50% + 60px)",
"calc(-50px)" ],
invalid_values: [ "20", "-20px" ],
};
gCSSProperties["scroll-padding-right"] = {
domProp: "scrollPaddingRight",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "auto" ],
other_values: [ "0", "10px", "20%", "calc(2em + 3ex)", "calc(50% + 60px)",
"calc(-50px)" ],
invalid_values: [ "20", "-20px" ],
};
gCSSProperties["scroll-padding-bottom"] = {
domProp: "scrollPaddingBottom",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "auto" ],
other_values: [ "0", "10px", "20%", "calc(2em + 3ex)", "calc(50% + 60px)",
"calc(-50px)" ],
invalid_values: [ "20", "-20px" ],
};
gCSSProperties["scroll-padding-left"] = {
domProp: "scrollPaddingLeft",
inherited: false,
type: CSS_TYPE_LONGHAND,
initial_values: [ "auto" ],
other_values: [ "0", "10px", "20%", "calc(2em + 3ex)", "calc(50% + 60px)",
"calc(-50px)" ],
invalid_values: [ "20", "-20px" ],
};
gCSSProperties["scroll-padding-inline"] = {
domProp: "scrollPaddingInline",
inherited: false,
type: CSS_TYPE_TRUE_SHORTHAND,
subproperties: [ "scroll-padding-inline-start",
"scroll-padding-inline-end" ],
initial_values: [ "auto", "auto auto" ],
other_values: [ "10px", "0", "20%", "calc(2em + 3ex)", "1px 2px",
"1px auto" ],
invalid_values: [ "20", "-20px" ]
};
gCSSProperties["scroll-padding-inline-start"] = {
domProp: "scrollPaddingInlineStart",
inherited: false,
type: CSS_TYPE_LONGHAND,
logical: true,
initial_values: [ "auto" ],
other_values: [ "0", "10px", "20%", "calc(2em + 3ex)", "calc(50% + 60px)",
"calc(-50px)" ],
invalid_values: [ "20", "-20px" ],
};
gCSSProperties["scroll-padding-inline-end"] = {
domProp: "scrollPaddingInlineEnd",
inherited: false,
type: CSS_TYPE_LONGHAND,
logical: true,
initial_values: [ "auto" ],
other_values: [ "0", "10px", "20%", "calc(2em + 3ex)", "calc(50% + 60px)",
"calc(-50px)" ],
invalid_values: [ "20", "-20px" ],
};
gCSSProperties["scroll-padding-block"] = {
domProp: "scrollPaddingBlock",
inherited: false,
type: CSS_TYPE_TRUE_SHORTHAND,
subproperties: [ "scroll-padding-block-start",
"scroll-padding-block-end" ],
initial_values: [ "auto", "auto auto" ],
other_values: [ "10px", "0", "20%", "calc(2em + 3ex)", "1px 2px",
"1px auto" ],
invalid_values: [ "20", "-20px" ]
};
gCSSProperties["scroll-padding-block-start"] = {
domProp: "scrollPaddingBlockStart",
inherited: false,
type: CSS_TYPE_LONGHAND,
logical: true,
initial_values: [ "auto" ],
other_values: [ "0", "10px", "20%", "calc(2em + 3ex)", "calc(50% + 60px)",
"calc(-50px)" ],
invalid_values: [ "20", "-20px" ],
};
gCSSProperties["scroll-padding-block-end"] = {
domProp: "scrollPaddingBlockEnd",
inherited: false,
type: CSS_TYPE_LONGHAND,
logical: true,
initial_values: [ "auto" ],
other_values: [ "0", "10px", "20%", "calc(2em + 3ex)", "calc(50% + 60px)",
"calc(-50px)" ],
invalid_values: [ "20", "-20px" ],
};
}
if (IsCSSPropertyPrefEnabled("layout.css.prefixes.webkit")) {
gCSSProperties["-webkit-animation"] = {
domProp: "webkitAnimation",

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

@ -331,6 +331,37 @@ if (IsCSSPropertyPrefEnabled("layout.css.scrollbar-color.enabled")) {
];
}
if (IsCSSPropertyPrefEnabled("layout.css.scroll-snap-v1.enabled")) {
supported_properties["scroll-margin-top"] = [
test_length_transition,
];
supported_properties["scroll-margin-right"] = [
test_length_transition,
];
supported_properties["scroll-margin-bottom"] = [
test_length_transition,
];
supported_properties["scroll-margin-left"] = [
test_length_transition,
];
supported_properties["scroll-padding-top"] = [
test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped,
];
supported_properties["scroll-padding-right"] = [
test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped,
];
supported_properties["scroll-padding-bottom"] = [
test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped,
];
supported_properties["scroll-padding-left"] = [
test_length_transition, test_percent_transition,
test_length_clamped, test_percent_clamped,
];
}
// For properties which are well-tested by web-platform-tests, we don't need to
// test animations/transitions again on them.
var skipped_transitionable_properties = [
@ -345,6 +376,10 @@ for (const logical_side of ["inline-start", "inline-end", "block-start", "block-
supported_properties["margin-" + logical_side] = supported_properties["margin-top"];
supported_properties["padding-" + logical_side] = supported_properties["padding-top"];
supported_properties["inset-" + logical_side] = supported_properties["top"];
if (IsCSSPropertyPrefEnabled("layout.css.scroll-snap-v1.enabled")) {
supported_properties["scroll-margin-" + logical_side] = supported_properties["scroll-margin-top"];
supported_properties["scroll-padding-" + logical_side] = supported_properties["scroll-padding-top"];
}
}
for (const logical_size of ["inline", "block"]) {

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

@ -114,13 +114,13 @@ public class FilePicker implements BundleEventListener {
private static String[] getPermissionsForMimeType(final String mimeType) {
if (mimeType.startsWith("audio/")) {
return new String[] { Manifest.permission.READ_EXTERNAL_STORAGE };
return new String[] { Manifest.permission.WRITE_EXTERNAL_STORAGE };
} else if (mimeType.startsWith("image/")) {
return new String[] { Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE };
return new String[] { Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE };
} else if (mimeType.startsWith("video/")) {
return new String[] { Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE };
return new String[] { Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE };
}
return new String[] { Manifest.permission.CAMERA, Manifest.permission.READ_EXTERNAL_STORAGE };
return new String[] { Manifest.permission.CAMERA, Manifest.permission.WRITE_EXTERNAL_STORAGE };
}
private static boolean hasPermissionsForMimeType(final String mimeType, final String[] availPermissions) {

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

@ -133,6 +133,10 @@ def ensure_environment(repo_url=None, repo_rev=None, repo_type=None):
def main(args):
parser = OptionParser()
parser.add_option('--vcs', dest='vcs',
default='hg',
help='VCS (hg or git) to use for downloading the source code. '
'Uses hg if omitted.')
parser.add_option('-r', '--repo-url', dest='repo_url',
default='https://hg.mozilla.org/mozilla-central/',
help='Base URL of source control repository where bootstrap files can '
@ -163,7 +167,8 @@ def main(args):
print('\n')
print(e)
return 1
dasboot = cls(choice=options.application_choice, no_interactive=options.no_interactive)
dasboot = cls(choice=options.application_choice, no_interactive=options.no_interactive,
vcs=options.vcs)
dasboot.bootstrap()
return 0

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

@ -235,13 +235,15 @@ class Bootstrapper(object):
"""Main class that performs system bootstrap."""
def __init__(self, finished=FINISHED, choice=None, no_interactive=False,
hg_configure=False, no_system_changes=False, mach_context=None):
hg_configure=False, no_system_changes=False, mach_context=None,
vcs=None):
self.instance = None
self.finished = finished
self.choice = choice
self.hg_configure = hg_configure
self.no_system_changes = no_system_changes
self.mach_context = mach_context
self.vcs = vcs
cls = None
args = {'no_interactive': no_interactive,
'no_system_changes': no_system_changes}
@ -452,8 +454,9 @@ class Bootstrapper(object):
hg=self.instance.which('hg'))
(checkout_type, checkout_root) = r
# Possibly configure Mercurial, but not if the current checkout is Git.
if hg_installed and state_dir_available and checkout_type != 'git':
# Possibly configure Mercurial, but not if the current checkout or repo
# type is Git.
if hg_installed and state_dir_available and (checkout_type == 'hg' or self.vcs == 'hg'):
configure_hg = False
if not self.instance.no_interactive:
choice = self.instance.prompt_int(prompt=CONFIGURE_MERCURIAL,
@ -466,8 +469,8 @@ class Bootstrapper(object):
if configure_hg:
configure_mercurial(self.instance.which('hg'), state_dir)
# Offer to configure Git, if the current checkout is Git.
elif self.instance.which('git') and checkout_type == 'git':
# Offer to configure Git, if the current checkout or repo type is Git.
elif self.instance.which('git') and (checkout_type == 'git' or self.vcs == 'git'):
should_configure_git = False
if not self.instance.no_interactive:
choice = self.instance.prompt_int(prompt=CONFIGURE_GIT,
@ -487,12 +490,12 @@ class Bootstrapper(object):
if checkout_type:
have_clone = True
elif hg_installed and not self.instance.no_interactive:
elif hg_installed and not self.instance.no_interactive and self.vcs == 'hg':
dest = self.input_clone_dest()
if dest:
have_clone = hg_clone_firefox(self.instance.which('hg'), dest)
checkout_root = dest
elif self.instance.which('git') and checkout_type == 'git':
elif self.instance.which('git') and self.vcs == 'git':
dest = self.input_clone_dest(False)
if dest:
git = self.instance.which('git')
@ -685,15 +688,16 @@ def update_git_tools(git, root_state_dir, top_src_dir):
"""Update git tools, hooks and extensions"""
# Bug 1481425 - delete the git-mozreview
# commit message hook in .git/hooks dir
mozreview_commit_hook = os.path.join(top_src_dir, '.git/hooks/commit-msg')
if os.path.exists(mozreview_commit_hook):
with open(mozreview_commit_hook, 'rb') as f:
contents = f.read()
if top_src_dir:
mozreview_commit_hook = os.path.join(top_src_dir, '.git/hooks/commit-msg')
if os.path.exists(mozreview_commit_hook):
with open(mozreview_commit_hook, 'rb') as f:
contents = f.read()
if b'MozReview' in contents:
print('removing git-mozreview commit message hook...')
os.remove(mozreview_commit_hook)
print('git-mozreview commit message hook removed.')
if b'MozReview' in contents:
print('removing git-mozreview commit message hook...')
os.remove(mozreview_commit_hook)
print('git-mozreview commit message hook removed.')
# Ensure git-cinnabar is up to date.
cinnabar_dir = os.path.join(root_state_dir, 'git-cinnabar')

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

@ -39,6 +39,6 @@
logical=side[1],
logical_group="scroll-padding",
spec="https://drafts.csswg.org/css-scroll-snap-1/#propdef-scroll-padding-%s" % side[0],
animation_value_type="ComputedValue",
animation_value_type="NonNegativeLengthPercentageOrAuto",
)}
% endfor

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

@ -19,6 +19,7 @@ apps = chrome
page_timeout = 900000 # 15 min
page_cycles = 1
apps = geckoview
disabled = Bug 1524495
[raptor-unity-webgl-refbrow]
page_timeout = 900000 # 15 min

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

@ -126,13 +126,17 @@ def test_get_raptor_test_list_chrome(create_args):
assert test_list[0]['name'] == 'raptor-speedometer-chrome'
def test_get_raptor_test_list_geckoview(create_args):
# Commented test_get_raptor_test_list_geckoview
# in order to disable raptor-unity-webgl-geckoview - Bug 1524495
"""
def test_get_raptor_test_list_geckoview(create_args):
args = create_args(app="geckoview",
test="raptor-unity-webgl")
test="raptor-unity-webgl")
test_list = get_raptor_test_list(args, mozinfo.os)
assert len(test_list) == 1
assert test_list[0]['name'] == 'raptor-unity-webgl-geckoview'
"""
def test_get_raptor_test_list_gecko_profiling(create_args):

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

@ -1,10 +1,7 @@
[fetch-csp.https.html]
[Verify CSP control of fetch() in a Service Worker]
expected:
if (os == "linux") and debug and not webrender and e10s and not sw-e10s: FAIL
if (os == "linux") and debug and not webrender and not e10s: FAIL
if (os == "linux") and debug and webrender: FAIL
if (os == "linux") and not debug: FAIL
if (os == "linux"): FAIL
if (os == "win"): FAIL
if (os == "mac"): FAIL
if (os == "android"): FAIL

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

@ -60,22 +60,41 @@ nsTArray<RefPtr<PerformanceInfoPromise>> CollectPerformanceInfo() {
return promises;
}
nsresult GetTabSizes(nsGlobalWindowOuter* aWindow, nsTabSizes* aSizes) {
void AddWindowTabSizes(nsGlobalWindowOuter* aWindow, nsTabSizes* aSizes) {
Document* document = aWindow->GetDocument();
if (document && document->GetCachedSizes(aSizes)) {
// We got a cached version
return;
}
// We measure the sizes on a fresh nsTabSizes instance
// because we want to cache the value and aSizes might
// already have some values from other windows.
nsTabSizes sizes;
// Measure the window.
SizeOfState state(moz_malloc_size_of);
nsWindowSizes windowSizes(state);
aWindow->AddSizeOfIncludingThis(windowSizes);
// Measure the inner window, if there is one.
nsGlobalWindowInner* inner = aWindow->GetCurrentInnerWindowInternal();
if (inner != nullptr) {
inner->AddSizeOfIncludingThis(windowSizes);
}
windowSizes.addToTabSizes(&sizes);
if (document) {
document->SetCachedSizes(&sizes);
}
aSizes->mDom += sizes.mDom;
aSizes->mStyle += sizes.mStyle;
aSizes->mOther += sizes.mOther;
}
nsresult GetTabSizes(nsGlobalWindowOuter* aWindow, nsTabSizes* aSizes) {
// Add the window (and inner window) sizes. Might be cached.
AddWindowTabSizes(aWindow, aSizes);
windowSizes.addToTabSizes(aSizes);
nsDOMWindowList* frames = aWindow->GetFrames();
uint32_t length = frames->GetLength();
// Measure this window's descendents.
for (uint32_t i = 0; i < length; i++) {
nsCOMPtr<nsPIDOMWindowOuter> child = frames->IndexedGetter(i);

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

@ -796,6 +796,17 @@ devtools.main:
extra_keys:
page_type: Type of page the user navigates to (this-firefox, connect, runtime)
session_id: The start time of the session in milliseconds since epoch (Unix Timestamp) e.g. 1396381378123.
show_profiler:
objects: ["aboutdebugging"]
bug_numbers: [1521511]
notification_emails: ["dev-developer-tools@lists.mozilla.org", "hkirschner@mozilla.com"]
record_in_processes: ["main"]
description: User has clicked on the "Open Profiler" button in a runtime page of about:debugging
release_channel_collection: opt-out
expiry_version: never
extra_keys:
runtime_id: Random id generated to track events related to a single runtime
session_id: The start time of the session in milliseconds since epoch (Unix Timestamp) e.g. 1396381378123.
sidepanel_changed:
objects: ["inspector", "netmonitor"]
bug_numbers: [1463083, 1463169]
@ -832,6 +843,18 @@ devtools.main:
time_open: Time open.
os: The OS name and version e.g. "Linux 4.4.0-1014-aws", "Darwin 14.5.0", "Windows_NT 6.1.7601" or "Windows_NT 10.0.15063." This can be used to make sense of data when a feature is only available from a particular operating system build number.
session_id: The start time of the session in milliseconds since epoch (Unix Timestamp) e.g. 1396381378123.
update_conn_prompt:
objects: ["aboutdebugging"]
bug_numbers: [1521511]
notification_emails: ["dev-developer-tools@lists.mozilla.org", "hkirschner@mozilla.com"]
record_in_processes: ["main"]
description: User has clicked on the "Enable/Disable connection prompt" button in a runtime page of about:debugging
release_channel_collection: opt-out
expiry_version: never
extra_keys:
prompt_enabled: True if the user enables the prompt, false otherwise.
runtime_id: Random id generated to track events related to a single runtime
session_id: The start time of the session in milliseconds since epoch (Unix Timestamp) e.g. 1396381378123.
security.ui.certerror:
load:

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

@ -9,6 +9,7 @@
#include <stdint.h>
#include "mozilla/dom/EventTarget.h"
#include "mozilla/layers/LayersTypes.h"
#include "mozilla/EventForwards.h"
#include "mozilla/TimeStamp.h"
#include "nsCOMPtr.h"
@ -478,7 +479,8 @@ class WidgetEvent : public WidgetEventTime {
mLastRefPoint(0, 0),
mFocusSequenceNumber(0),
mSpecifiedEventType(nullptr),
mPath(nullptr) {
mPath(nullptr),
mLayersId(layers::LayersId{0}) {
MOZ_COUNT_CTOR(WidgetEvent);
mFlags.Clear();
mFlags.mIsTrusted = aIsTrusted;
@ -570,6 +572,11 @@ class WidgetEvent : public WidgetEventTime {
nsTArray<EventTargetChainItem>* mPath;
// The LayersId of the content process that this event should be
// dispatched to. This field is only used in the chrome process
// and doesn't get remoted to child processes.
layers::LayersId mLayersId;
dom::EventTarget* GetDOMEventTarget() const;
dom::EventTarget* GetCurrentDOMEventTarget() const;
dom::EventTarget* GetOriginalDOMEventTarget() const;
@ -580,6 +587,7 @@ class WidgetEvent : public WidgetEventTime {
mRefPoint = aEvent.mRefPoint;
// mLastRefPoint doesn't need to be copied.
mFocusSequenceNumber = aEvent.mFocusSequenceNumber;
// mLayersId intentionally not copied, since it's not used within content
AssignEventTime(aEvent);
// mFlags should be copied manually if it's necessary.
mSpecifiedEventType = aEvent.mSpecifiedEventType;

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

@ -23,7 +23,11 @@ using namespace dom;
InputData::~InputData() {}
InputData::InputData(InputType aInputType)
: mInputType(aInputType), mTime(0), mFocusSequenceNumber(0), modifiers(0) {}
: mInputType(aInputType),
mTime(0),
mFocusSequenceNumber(0),
mLayersId{0},
modifiers(0) {}
InputData::InputData(InputType aInputType, uint32_t aTime, TimeStamp aTimeStamp,
Modifiers aModifiers)
@ -31,6 +35,7 @@ InputData::InputData(InputType aInputType, uint32_t aTime, TimeStamp aTimeStamp,
mTime(aTime),
mTimeStamp(aTimeStamp),
mFocusSequenceNumber(0),
mLayersId{0},
modifiers(aModifiers) {}
SingleTouchData::SingleTouchData(int32_t aIdentifier,

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

@ -89,6 +89,10 @@ class InputData {
// content, and focus can be reconfirmed for async keyboard scrolling.
uint64_t mFocusSequenceNumber;
// The LayersId of the content process that the corresponding WidgetEvent
// should be dispatched to.
layers::LayersId mLayersId;
Modifiers modifiers;
INPUTDATA_AS_CHILD_TYPE(MultiTouchInput, MULTITOUCH_INPUT)

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

@ -1092,6 +1092,7 @@ struct ParamTraits<mozilla::InputData> {
WriteParam(aMsg, aParam.mTimeStamp);
WriteParam(aMsg, aParam.modifiers);
WriteParam(aMsg, aParam.mFocusSequenceNumber);
WriteParam(aMsg, aParam.mLayersId);
}
static bool Read(const Message* aMsg, PickleIterator* aIter,
@ -1100,7 +1101,8 @@ struct ParamTraits<mozilla::InputData> {
ReadParam(aMsg, aIter, &aResult->mTime) &&
ReadParam(aMsg, aIter, &aResult->mTimeStamp) &&
ReadParam(aMsg, aIter, &aResult->modifiers) &&
ReadParam(aMsg, aIter, &aResult->mFocusSequenceNumber);
ReadParam(aMsg, aIter, &aResult->mFocusSequenceNumber) &&
ReadParam(aMsg, aIter, &aResult->mLayersId);
}
};