Merge mozilla-central to mozilla-inbound

This commit is contained in:
Carsten "Tomcat" Book 2016-11-22 16:28:50 +01:00
Родитель fea903381b 8b27dda5d1
Коммит e0f46513b6
284 изменённых файлов: 18155 добавлений и 20315 удалений

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

@ -11,4 +11,7 @@ module.exports = {
"env": {
"es6": true
},
"parserOptions": {
"ecmaVersion": 8,
},
};

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

@ -13,8 +13,7 @@ const { Rules } = require('../util/rules');
const { uuid } = require('../util/uuid');
const { WorkerChild } = require("./worker-child");
const { Cc, Ci, Cu } = require("chrome");
const { observe } = require("../event/chrome");
const { on } = require("../event/core");
const { on: onSystemEvent } = require("../system/events");
const appShell = Cc["@mozilla.org/appshell/appShellService;1"].getService(Ci.nsIAppShellService);
@ -96,6 +95,7 @@ const ChildPage = Class({
this.options.contentURL = url;
url = this.options.contentURL ? data.url(this.options.contentURL) : "about:blank";
this.webNav.loadURI(url, Ci.nsIWebNavigation.LOAD_FLAGS_NONE, null, null, null);
},
@ -121,14 +121,15 @@ const ChildPage = Class({
QueryInterface: XPCOMUtils.generateQI(["nsIWebProgressListener", "nsISupportsWeakReference"])
});
on(observe(DOC_INSERTED), "data", ({ target }) => {
let page = Array.from(pages.values()).find(p => p.contentWindow.document === target);
onSystemEvent(DOC_INSERTED, ({type, subject, data}) => {
let page = Array.from(pages.values()).find(p => p.contentWindow.document === subject);
if (!page)
return;
if (getAttachEventType(page.options) == DOC_INSERTED)
page.attachWorker();
});
}, true);
frames.port.on("sdk/frame/create", (frame, id, options) => {
new ChildPage(frame, id, options);

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

@ -29,7 +29,6 @@ skip-if = true
[page-mod-debugger-post.xpi]
[page-mod-debugger-pre.xpi]
[page-worker.xpi]
skip-if = true # Bug 1288619 and Bug 1288708
[places.xpi]
[predefined-id-with-at.xpi]
[preferences-branch.xpi]

Разница между файлами не показана из-за своего большого размера Загрузить разницу

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

@ -502,12 +502,10 @@ toolbar:not(#TabsToolbar) > #personal-bookmarks {
#PopupAutoComplete > richlistbox > richlistitem[originaltype="insecureWarning"] {
-moz-binding: url("chrome://global/content/bindings/autocomplete.xml#autocomplete-richlistitem-insecure-field");
height: auto;
background-color: #F6F6F6;
}
#PopupAutoComplete > richlistbox > richlistitem[originaltype="insecureWarning"] > .ac-site-icon {
display: initial;
list-style-image: url(chrome://browser/skin/connection-mixed-active-loaded.svg#icon);
}
#PopupAutoComplete > richlistbox > richlistitem[originaltype="insecureWarning"] > .ac-title > .ac-text-overflow-container > .ac-title-text {

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

@ -5405,6 +5405,8 @@
continue;
gClickAndHoldListenersOnElement.remove(parent);
parent.removeAttribute("type");
if (!parent.firstChild)
continue;
parent.firstChild.remove();
}
}

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

@ -12,6 +12,7 @@ add_task(function* test() {
let newTabButton = document.getAnonymousElementByAttribute(newTab, "anonid", "tabs-newtab-button");
ok(newTabButton, "New tab button exists");
ok(!newTabButton.hidden, "New tab button is visible");
yield BrowserTestUtils.waitForCondition(() => !!document.getAnonymousElementByAttribute(newTab, "anonid", "newtab-popup"), "Wait for popup to exist");
let popup = document.getAnonymousElementByAttribute(newTab, "anonid", "newtab-popup");
for (let i = 1; i <= 4; i++) {

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

@ -0,0 +1,154 @@
"use strict";
const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.import("resource://gre/modules/XPCOMUtils.jsm");
Cu.import("resource://gre/modules/Services.jsm");
this.EXPORTED_SYMBOLS = [
"SiteDataManager"
];
this.SiteDataManager = {
_qms: Services.qms,
_diskCache: Services.cache2.diskCacheStorage(Services.loadContextInfo.default, false),
_appCache: Cc["@mozilla.org/network/application-cache-service;1"].getService(Ci.nsIApplicationCacheService),
// A Map of sites using the persistent-storage API (have requested persistent-storage permission)
// Key is site's origin.
// Value is one object holding:
// - perm: persistent-storage permision; instance of nsIPermission
// - status: the permission granted/rejected status
// - quotaUsage: the usage of indexedDB and localStorage.
// - appCacheList: an array of app cache; instances of nsIApplicationCache
// - diskCacheList: an array. Each element is object holding metadata of http cache:
// - dataSize: that http cache size
// - idEnhance: the id extension of that http cache
_sites: new Map(),
_updateQuotaPromise: null,
_updateDiskCachePromise: null,
_quotaUsageRequests: null,
updateSites() {
// Clear old data and requests first
this._sites.clear();
this._cancelQuotaUpdate();
// Collect sites granted/rejected with the persistent-storage permission
let perm = null;
let status = null;
let e = Services.perms.enumerator;
while (e.hasMoreElements()) {
perm = e.getNext();
status = Services.perms.testExactPermissionFromPrincipal(perm.principal, "persistent-storage");
if (status === Ci.nsIPermissionManager.ALLOW_ACTION ||
status === Ci.nsIPermissionManager.DENY_ACTION) {
this._sites.set(perm.principal.origin, {
perm: perm,
status: status,
quotaUsage: 0,
appCacheList: [],
diskCacheList: []
});
}
}
this._updateQuota();
this._updateAppCache();
this._updateDiskCache();
},
_updateQuota() {
this._quotaUsageRequests = [];
let promises = [];
for (let [key, site] of this._sites) { // eslint-disable-line no-unused-vars
promises.push(new Promise(resolve => {
let callback = {
onUsageResult: function(request) {
site.quotaUsage = request.usage;
resolve();
}
};
// XXX: The work of integrating localStorage into Quota Manager is in progress.
// After the bug 742822 and 1286798 landed, localStorage usage will be included.
// So currently only get indexedDB usage.
this._quotaUsageRequests.push(
this._qms.getUsageForPrincipal(site.perm.principal, callback));
}));
}
this._updateQuotaPromise = Promise.all(promises);
},
_cancelQuotaUpdate() {
if (this._quotaUsageRequests) {
for (let request of this._quotaUsageRequests) {
request.cancel();
}
this._quotaUsageRequests = null;
}
},
_updateAppCache() {
let groups = this._appCache.getGroups();
for (let [key, site] of this._sites) { // eslint-disable-line no-unused-vars
for (let group of groups) {
let uri = Services.io.newURI(group, null, null);
if (site.perm.matchesURI(uri, true)) {
let cache = this._appCache.getActiveCache(group);
site.appCacheList.push(cache);
}
}
}
},
_updateDiskCache() {
this._updateDiskCachePromise = new Promise(resolve => {
if (this._sites.size) {
let sites = this._sites;
let visitor = {
onCacheEntryInfo: function(uri, idEnhance, dataSize) {
for (let [key, site] of sites) { // eslint-disable-line no-unused-vars
if (site.perm.matchesURI(uri, true)) {
site.diskCacheList.push({
dataSize,
idEnhance
});
break;
}
}
},
onCacheEntryVisitCompleted: function() {
resolve();
}
};
this._diskCache.asyncVisitStorage(visitor, true);
} else {
resolve();
}
});
},
getTotalUsage() {
return Promise.all([this._updateQuotaPromise, this._updateDiskCachePromise])
.then(() => {
let usage = 0;
for (let [key, site] of this._sites) { // eslint-disable-line no-unused-vars
let cache = null;
for (cache of site.appCacheList) {
usage += cache.usage;
}
for (cache of site.diskCacheList) {
usage += cache.dataSize;
}
usage += site.quotaUsage;
}
return usage;
});
},
};

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

@ -7,6 +7,9 @@ Components.utils.import("resource://gre/modules/DownloadUtils.jsm");
Components.utils.import("resource://gre/modules/LoadContextInfo.jsm");
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "SiteDataManager",
"resource:///modules/SiteDataManager.jsm");
const PREF_UPLOAD_ENABLED = "datareporting.healthreport.uploadEnabled";
var gAdvancedPane = {
@ -52,6 +55,11 @@ var gAdvancedPane = {
this.updateActualCacheSize();
this.updateActualAppCacheSize();
if (Services.prefs.getBoolPref("browser.storageManager.enabled")) {
SiteDataManager.updateSites();
this.updateTotalSiteDataSize();
}
setEventListener("layers.acceleration.disabled", "change",
gAdvancedPane.updateHardwareAcceleration);
setEventListener("advancedPrefs", "select",
@ -329,6 +337,18 @@ var gAdvancedPane = {
gSubDialog.open("chrome://browser/content/preferences/connection.xul");
},
updateTotalSiteDataSize: function() {
SiteDataManager.getTotalUsage()
.then(usage => {
let size = DownloadUtils.convertByteUnits(usage);
let prefStrBundle = document.getElementById("bundlePreferences");
let totalSiteDataSizeLabel = document.getElementById("totalSiteDataSize");
totalSiteDataSizeLabel.textContent = prefStrBundle.getFormattedString("totalSiteDataSize", size);
let siteDataGroup = document.getElementById("siteDataGroup");
siteDataGroup.hidden = false;
});
},
// Retrieves the amount of space currently used by disk cache
updateActualCacheSize: function()
{

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

@ -328,6 +328,15 @@
</vbox>
</hbox>
</groupbox>
<!-- Site Data -->
<groupbox id="siteDataGroup" hidden="true">
<caption><label>&siteData.label;</label></caption>
<hbox align="center">
<label id="totalSiteDataSize" flex="1"></label>
</hbox>
</groupbox>
</tabpanel>
<!-- Update -->

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

@ -18,5 +18,9 @@ if CONFIG['MOZ_WIDGET_TOOLKIT'] in ('windows', 'gtk2', 'gtk3', 'cocoa'):
JAR_MANIFESTS += ['jar.mn']
EXTRA_JS_MODULES += [
'SiteDataManager.jsm',
]
with Files('**'):
BUG_COMPONENT = ('Firefox', 'Preferences')

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

@ -2075,6 +2075,24 @@
<handler event="mousemove"><![CDATA[
let target = event.originalTarget;
// Handle mouseover on the add-engine menu button and its popup items.
if (target.getAttribute("anonid") == "addengine-menu-button" ||
(target.localName == "menuitem" &&
target.classList.contains("addengine-item"))) {
// Make the menu button visually selected. It's highlighted in the
// CSS when the popup is open, but the popup doesn't open until a
// short timeout has elapsed. Making the button visually selected now
// provides better feedback to the user.
let menuButton = document.getAnonymousElementByAttribute(
this, "anonid", "addengine-menu-button"
);
this._changeVisuallySelectedButton(menuButton);
this._addEngineMenuShouldBeOpen = true;
this._resetAddEngineMenuTimeout();
return;
}
if (target.localName != "button")
return;
@ -2092,26 +2110,22 @@
}
]]></handler>
<handler event="mouseenter"><![CDATA[
let target = event.originalTarget;
if (target.getAttribute("anonid") == "addengine-menu-button") {
this._addEngineMenuShouldBeOpen = true;
this._resetAddEngineMenuTimeout();
return;
}
]]></handler>
<handler event="mouseout"><![CDATA[
<handler event="mouseleave"><![CDATA[
let target = event.originalTarget;
if (target.getAttribute("anonid") == "addengine-menu-button") {
// Handle mouseout on the add-engine menu button and its popup items.
if (target.getAttribute("anonid") == "addengine-menu-button" ||
(target.localName == "menuitem" &&
target.classList.contains("addengine-item"))) {
// The menu button will appear selected since the mouse is either over
// it or over one of the menu items in the popup. Make it unselected.
this._changeVisuallySelectedButton(null);
this._addEngineMenuShouldBeOpen = false;
this._resetAddEngineMenuTimeout();
return;
}
]]></handler>
<handler event="mouseout"><![CDATA[
let target = event.originalTarget;
if (target.localName != "button") {
return;
}

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

@ -31,7 +31,7 @@ add_task(function* test() {
// Mouse over the menu button to open it.
let buttonPopup = menuButton.firstChild;
promise = promiseEvent(buttonPopup, "popupshown");
EventUtils.synthesizeMouse(menuButton, 5, 5, { type: "mouseover" });
EventUtils.synthesizeMouse(menuButton, 5, 5, { type: "mousemove" });
yield promise;
Assert.ok(menuButton.open, "Submenu should be open");

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

@ -29,8 +29,7 @@ if test "$OS_ARCH" = "WINNT"; then
fi
fi
if test "$MOZ_UPDATE_CHANNEL" = "default" -o \
"$MOZ_UPDATE_CHANNEL" = "nightly"; then
if test "$NIGHTLY_BUILD"; then
MOZ_RUST_URLPARSE=1
fi

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

@ -392,6 +392,7 @@ These should match what Safari and other Apple applications use on OS X Lion. --
<!ENTITY openCmd.commandkey "l">
<!ENTITY urlbar.placeholder2 "Search or enter address">
<!ENTITY urlbar.accesskey "d">
<!-- LOCALIZATION NOTE (urlbar.extension.label): Used to indicate that a selected autocomplete entry is provided by an extension. -->
<!ENTITY urlbar.extension.label "Extension:">
<!ENTITY urlbar.switchToTab.label "Switch to tab:">

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

@ -57,6 +57,9 @@
<!ENTITY offlineStorage2.label "Offline Web Content and User Data">
<!-- Site Data section manages sites using Storage API and is under Network -->
<!ENTITY siteData.label "Site Data">
<!-- LOCALIZATION NOTE:
The entities limitCacheSizeBefore.label and limitCacheSizeAfter.label appear on a single
line in preferences as follows:

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

@ -164,6 +164,13 @@ actualDiskCacheSizeCalculated=Calculating web content cache size…
# %2$S = unit (MB, KB, etc.)
actualAppCacheSize=Your application cache is currently using %1$S %2$S of disk space
####Preferences::Advanced::Network
#LOCALIZATION NOTE: The next string is for the total usage of site data.
# e.g., "The total usage is currently using 200 MB"
# %1$S = size
# %2$S = unit (MB, KB, etc.)
totalSiteDataSize=Your stored site data is currently using %1$S %2$S of disk space
syncUnlink.title=Do you want to unlink your device?
syncUnlink.label=This device will no longer be associated with your Sync account. All of your personal data, both on this device and in your Sync account, will remain intact.
syncUnlinkConfirm.label=Unlink

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

@ -266,8 +266,7 @@ menuitem[cmd="cmd_clearhistory"][disabled] {
color: HighlightText;
}
.addengine-item[type=menu][selected],
.addengine-item[type=menu][open] {
.addengine-item[type=menu][selected] {
color: inherit;
background-color: var(--arrowpanel-dimmed-further);
}

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

@ -247,8 +247,7 @@
color: HighlightText;
}
.addengine-item[type=menu][selected],
.addengine-item[type=menu][open] {
.addengine-item[type=menu][selected] {
color: inherit;
background-color: var(--arrowpanel-dimmed-further);
}

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

@ -20,3 +20,12 @@
#PopupAutoComplete > richlistbox {
padding: 0;
}
/* Insecure field warning */
#PopupAutoComplete > richlistbox > richlistitem[originaltype="insecureWarning"] {
background-color: #F6F6F6; /* Bug 1319176 */
}
#PopupAutoComplete > richlistbox > richlistitem[originaltype="insecureWarning"] > .ac-site-icon {
list-style-image: url(chrome://browser/skin/connection-mixed-active-loaded.svg#icon);
}

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

@ -135,6 +135,23 @@ a.button {
display: inline-block;
}
/**
* We want to hide the checkbox in lieu of the toggle-btn
* "slider toggle". We need to make the toggle keyboard
* focusable, however, which is not possible if it's
* display:none. We work around this by making the toggle
* invisible but still present in the display list, allowing
* it to receive keyboard events. When it is focused by keyboard,
* we use the -moz-focusring selector on the invisible checkbox
* to show a focus ring around the slider toggle.
*/
.toggle-input {
opacity: 0;
width: 0;
pointer-events: none;
position: absolute;
}
.toggle + .toggle-btn {
box-sizing: border-box;
cursor: pointer;

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

@ -259,8 +259,7 @@
color: HighlightText;
}
.addengine-item[type=menu][selected],
.addengine-item[type=menu][open] {
.addengine-item[type=menu][selected] {
color: inherit;
background-color: var(--arrowpanel-dimmed-further);
}

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

@ -40,6 +40,7 @@ buildscript {
}
// Provided in tree.
classpath 'com.jakewharton.sdkmanager:gradle-plugin:1.5.0-SNAPSHOT'
classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.1'
}
}

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

@ -0,0 +1 @@
[compare-mozconfigs-wrapper.py]

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

@ -38,8 +38,8 @@ for var in ('MOZ_CRASHREPORTER', 'MOZ_PROFILE_MIGRATOR',
DEFINES[var] = True
if CONFIG['MOZ_BUILD_APP'] == 'browser':
PYTHON_UNIT_TESTS += [
'compare-mozconfig/compare-mozconfigs-wrapper.py',
PYTHON_UNITTEST_MANIFESTS += [
'compare-mozconfig/python.ini',
]
if CONFIG['ENABLE_TESTS'] or CONFIG['MOZ_DMD']:

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

@ -32,12 +32,8 @@ if CONFIG['HOST_OS_ARCH'] != 'WINNT':
if CONFIG['MOZ_SYSTEM_ICU']:
DEFINES['MOZ_SYSTEM_ICU'] = True
PYTHON_UNIT_TESTS += [
'tests/test_mozbuild_reading.py',
'tests/unit-expandlibs.py',
'tests/unit-mozunit.py',
'tests/unit-nsinstall.py',
'tests/unit-printprereleasesuffix.py',
PYTHON_UNITTEST_MANIFESTS += [
'tests/python.ini',
]
if CONFIG['GNU_CC'] and CONFIG['MOZ_OPTIMIZE']:

5
config/tests/python.ini Normal file
Просмотреть файл

@ -0,0 +1,5 @@
[test_mozbuild_reading.py]
[unit-expandlibs.py]
[unit-mozunit.py]
[unit-nsinstall.py]
[unit-printprereleasesuffix.py]

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

@ -14,6 +14,7 @@ const { createFactories } = require("devtools/client/shared/components/reps/rep-
const TreeView = React.createFactory(require("devtools/client/shared/components/tree/tree-view"));
const { Rep } = createFactories(require("devtools/client/shared/components/reps/rep"));
const { Grip } = require("devtools/client/shared/components/reps/grip");
const { MODE } = require("devtools/client/shared/components/reps/constants");
// DOM Panel
const { GripProvider } = require("../grip-provider");
@ -70,7 +71,7 @@ var DomTree = React.createClass({
object: this.props.object,
provider: new GripProvider(this.props.grips, this.props.dispatch),
decorator: new DomDecorator(),
mode: "short",
mode: MODE.SHORT,
columns: columns,
renderValue: renderValue,
onFilter: this.onFilter

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

@ -104,6 +104,15 @@ function* testOptionsShortcut() {
function* testOptions() {
let tool = toolbox.getPanel("options");
panelWin = tool.panelWin;
// It's possible that the iframe for options hasn't fully loaded yet,
// and might be paint-suppressed, which means that clicking things
// might not work just yet. The "load" event is a good indication that
// we're ready to proceed.
if (tool.panelDoc.readyState != "complete") {
yield once(tool.panelWin, "load");
}
let prefNodes = tool.panelDoc.querySelectorAll(
"input[type=checkbox][data-pref]");

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

@ -11,6 +11,7 @@ define(function (require, exports, module) {
const { createFactories } = require("devtools/client/shared/components/reps/rep-utils");
const TreeView = createFactory(require("devtools/client/shared/components/tree/tree-view"));
const { Rep } = createFactories(require("devtools/client/shared/components/reps/rep"));
const { MODE } = require("devtools/client/shared/components/reps/constants");
const { SearchBox } = createFactories(require("./search-box"));
const { Toolbar, ToolbarButton } = createFactories(require("./reps/toolbar"));
@ -115,7 +116,7 @@ define(function (require, exports, module) {
// Render tree component.
return TreeView({
object: this.props.data,
mode: "tiny",
mode: MODE.TINY,
onFilter: this.onFilter,
columns: columns,
renderValue: this.renderValue,

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

@ -3,6 +3,10 @@
"use strict";
// On debug builds in particular, this test file seems to time out fairly
// frequently.
requestLongerTimeout(2);
// Check that when the viewport is resized, the computed-view refreshes.
const TEST_URI = "data:text/html;charset=utf-8,<html><style>" +

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

@ -12,6 +12,7 @@ define(function (require, exports, module) {
const React = require("devtools/client/shared/vendor/react");
const { createFactories } = require("./rep-utils");
const { Caption } = createFactories(require("./caption"));
const { MODE } = require("./constants");
// Shortcuts
const DOM = React.DOM;
@ -23,6 +24,11 @@ define(function (require, exports, module) {
let ArrayRep = React.createClass({
displayName: "ArrayRep",
propTypes: {
// @TODO Change this to Object.values once it's supported in Node's version of V8
mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])),
},
getTitle: function (object, context) {
return "[" + object.length + "]";
},
@ -40,13 +46,13 @@ define(function (require, exports, module) {
items.push(ItemRep({
object: value,
// Hardcode tiny mode to avoid recursive handling.
mode: "tiny",
mode: MODE.TINY,
delim: delim
}));
} catch (exc) {
items.push(ItemRep({
object: exc,
mode: "tiny",
mode: MODE.TINY,
delim: delim
}));
}
@ -111,20 +117,23 @@ define(function (require, exports, module) {
},
render: function () {
let mode = this.props.mode || "short";
let object = this.props.object;
let {
object,
mode = MODE.SHORT,
} = this.props;
let items;
let brackets;
let needSpace = function (space) {
return space ? { left: "[ ", right: " ]"} : { left: "[", right: "]"};
};
if (mode == "tiny") {
if (mode === MODE.TINY) {
let isEmpty = object.length === 0;
items = [DOM.span({className: "length"}, isEmpty ? "" : object.length)];
brackets = needSpace(false);
} else {
let max = (mode == "short") ? 3 : 10;
let max = (mode === MODE.SHORT) ? 3 : 10;
items = this.arrayIterator(object, max);
brackets = needSpace(items.length > 0);
}

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

@ -7,11 +7,10 @@
// Make this available to both AMD and CJS environments
define(function (require, exports, module) {
// ReactJS
// Dependencies
const React = require("devtools/client/shared/vendor/react");
const { isGrip, cropString, cropMultipleLines } = require("./rep-utils");
// Utils
const { MODE } = require("./constants");
const nodeConstants = require("devtools/shared/dom-node-constants");
// Shortcuts
@ -25,18 +24,20 @@ define(function (require, exports, module) {
propTypes: {
object: React.PropTypes.object.isRequired,
mode: React.PropTypes.string,
// @TODO Change this to Object.values once it's supported in Node's version of V8
mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])),
},
render: function () {
let {object} = this.props;
let mode = this.props.mode || "short";
let {
object,
mode = MODE.SHORT
} = this.props;
let {textContent} = object.preview;
if (mode === "tiny") {
if (mode === MODE.TINY) {
textContent = cropMultipleLines(textContent, 30);
} else if (mode === "short") {
} else if (mode === MODE.SHORT) {
textContent = cropString(textContent, 50);
}

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

@ -0,0 +1,15 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
// Make this available to both AMD and CJS environments
define(function (require, exports, module) {
module.exports = {
MODE: {
TINY: Symbol("TINY"),
SHORT: Symbol("SHORT"),
LONG: Symbol("LONG"),
}
};
});

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

@ -9,9 +9,10 @@
define(function (require, exports, module) {
// ReactJS
const React = require("devtools/client/shared/vendor/react");
const { isGrip } = require("./rep-utils");
// Utils
const { isGrip } = require("./rep-utils");
const { MODE } = require("./constants");
const nodeConstants = require("devtools/shared/dom-node-constants");
// Shortcuts
@ -25,7 +26,8 @@ define(function (require, exports, module) {
propTypes: {
object: React.PropTypes.object.isRequired,
mode: React.PropTypes.string,
// @TODO Change this to Object.values once it's supported in Node's version of V8
mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])),
},
getElements: function (grip, mode) {
@ -34,7 +36,7 @@ define(function (require, exports, module) {
className: "tag-name theme-fg-color3"
}, nodeName);
if (mode === "tiny") {
if (mode === MODE.TINY) {
let elements = [nodeNameElement];
if (attributes.id) {
elements.push(

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

@ -7,8 +7,9 @@
define(function (require, exports, module) {
// ReactJS
const React = require("devtools/client/shared/vendor/react");
// Dependencies
// Utils
const { isGrip } = require("./rep-utils");
const { MODE } = require("./constants");
// Shortcuts
const { span } = React.DOM;
@ -20,7 +21,8 @@ define(function (require, exports, module) {
propTypes: {
object: React.PropTypes.object.isRequired,
mode: React.PropTypes.string
// @TODO Change this to Object.values once it's supported in Node's version of V8
mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])),
},
render: function () {
@ -30,11 +32,11 @@ define(function (require, exports, module) {
? preview.name
: "Error";
let content = this.props.mode === "tiny"
let content = this.props.mode === MODE.TINY
? name
: `${name}: ${preview.message}`;
if (preview.stack && this.props.mode !== "tiny") {
if (preview.stack && this.props.mode !== MODE.TINY) {
/*
* Since Reps are used in the JSON Viewer, we can't localize
* the "Stack trace" label (defined in debugger.properties as

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

@ -12,6 +12,7 @@ define(function (require, exports, module) {
const React = require("devtools/client/shared/vendor/react");
const { createFactories, isGrip } = require("./rep-utils");
const { Caption } = createFactories(require("./caption"));
const { MODE } = require("./constants");
// Shortcuts
const { span } = React.DOM;
@ -25,7 +26,8 @@ define(function (require, exports, module) {
propTypes: {
object: React.PropTypes.object.isRequired,
mode: React.PropTypes.string,
// @TODO Change this to Object.values once it's supported in Node's version of V8
mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])),
provider: React.PropTypes.object,
},
@ -39,7 +41,7 @@ define(function (require, exports, module) {
getTitle: function (object, context) {
let objectLink = this.props.objectLink || span;
if (this.props.mode != "tiny") {
if (this.props.mode !== MODE.TINY) {
return objectLink({
object: object
}, object.class + " ");
@ -108,8 +110,10 @@ define(function (require, exports, module) {
},
render: function () {
let mode = this.props.mode || "short";
let object = this.props.object;
let {
object,
mode = MODE.SHORT
} = this.props;
let items;
let brackets;
@ -117,13 +121,13 @@ define(function (require, exports, module) {
return space ? { left: "[ ", right: " ]"} : { left: "[", right: "]"};
};
if (mode == "tiny") {
if (mode === MODE.TINY) {
let objectLength = this.getLength(object);
let isEmpty = objectLength === 0;
items = [span({className: "length"}, isEmpty ? "" : objectLength)];
brackets = needSpace(false);
} else {
let max = (mode == "short") ? 3 : 10;
let max = (mode === MODE.SHORT) ? 3 : 10;
items = this.arrayIterator(object, max);
brackets = needSpace(items.length > 0);
}
@ -170,7 +174,7 @@ define(function (require, exports, module) {
return (
span({},
Rep(Object.assign({}, this.props, {
mode: "tiny"
mode: MODE.TINY
})),
this.props.delim
)

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

@ -12,7 +12,7 @@ define(function (require, exports, module) {
const { createFactories, isGrip } = require("./rep-utils");
const { Caption } = createFactories(require("./caption"));
const { PropRep } = createFactories(require("./prop-rep"));
const { MODE } = require("./constants");
// Shortcuts
const { span } = React.DOM;
/**
@ -24,7 +24,8 @@ define(function (require, exports, module) {
propTypes: {
object: React.PropTypes.object,
mode: React.PropTypes.string,
// @TODO Change this to Object.values once it's supported in Node's version of V8
mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])),
},
getTitle: function (object) {
@ -111,7 +112,7 @@ define(function (require, exports, module) {
// Do not add a trailing comma on the last entry
// if there won't be a "more..." item.
delim: (i < indexes.length - 1 || indexes.length < entries.length) ? ", " : "",
mode: "tiny",
mode: MODE.TINY,
objectLink: this.props.objectLink,
});
});
@ -146,10 +147,10 @@ define(function (require, exports, module) {
render: function () {
let object = this.props.object;
let props = this.safeEntriesIterator(object,
(this.props.mode == "long") ? 10 : 3);
(this.props.mode === MODE.LONG) ? 10 : 3);
let objectLink = this.props.objectLink || span;
if (this.props.mode == "tiny") {
if (this.props.mode === MODE.TINY) {
return (
span({className: "objectBox objectBox-object"},
this.getTitle(object),

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

@ -13,6 +13,7 @@ define(function (require, exports, module) {
const { createFactories, isGrip } = require("./rep-utils");
const { Caption } = createFactories(require("./caption"));
const { PropRep } = createFactories(require("./prop-rep"));
const { MODE } = require("./constants");
// Shortcuts
const { span } = React.DOM;
@ -26,7 +27,8 @@ define(function (require, exports, module) {
propTypes: {
object: React.PropTypes.object.isRequired,
mode: React.PropTypes.string,
// @TODO Change this to Object.values once it's supported in Node's version of V8
mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])),
isInterestingProp: React.PropTypes.func
},
@ -55,7 +57,7 @@ define(function (require, exports, module) {
return [Rep({
object: object.preview.wrappedValue,
mode: this.props.mode || "tiny",
mode: this.props.mode || MODE.TINY,
defaultRep: Grip,
})];
}
@ -128,7 +130,7 @@ define(function (require, exports, module) {
let value = this.getPropValue(properties[name]);
props.push(PropRep(Object.assign({}, this.props, {
mode: "tiny",
mode: MODE.TINY,
name: name,
object: value,
equal: ": ",
@ -197,10 +199,10 @@ define(function (require, exports, module) {
render: function () {
let object = this.props.object;
let props = this.safePropIterator(object,
(this.props.mode == "long") ? 10 : 3);
(this.props.mode === MODE.LONG) ? 10 : 3);
let objectLink = this.props.objectLink || span;
if (this.props.mode == "tiny") {
if (this.props.mode === MODE.TINY) {
return (
span({className: "objectBox objectBox-object"},
this.getTitle(object),

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

@ -9,6 +9,7 @@ DevToolsModules(
'attribute.js',
'caption.js',
'comment-node.js',
'constants.js',
'date-time.js',
'document.js',
'element-node.js',

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

@ -12,6 +12,7 @@ define(function (require, exports, module) {
const { createFactories } = require("./rep-utils");
const { Caption } = createFactories(require("./caption"));
const { PropRep } = createFactories(require("./prop-rep"));
const { MODE } = require("./constants");
// Shortcuts
const { span } = React.DOM;
/**
@ -23,7 +24,8 @@ define(function (require, exports, module) {
propTypes: {
object: React.PropTypes.object,
mode: React.PropTypes.string,
// @TODO Change this to Object.values once it's supported in Node's version of V8
mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])),
},
getTitle: function (object) {
@ -97,7 +99,7 @@ define(function (require, exports, module) {
}
// Hardcode tiny mode to avoid recursive handling.
let mode = "tiny";
let mode = MODE.TINY;
try {
for (let name in object) {
@ -135,7 +137,7 @@ define(function (require, exports, module) {
let props = this.safePropIterator(object);
let objectLink = this.props.objectLink || span;
if (this.props.mode == "tiny" || !props.length) {
if (this.props.mode === MODE.TINY || !props.length) {
return (
span({className: "objectBox objectBox-object"},
objectLink({className: "objectTitle"}, this.getTitle(object))

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

@ -12,6 +12,7 @@ define(function (require, exports, module) {
// Dependencies
const { createFactories, isGrip } = require("./rep-utils");
const { PropRep } = createFactories(require("./prop-rep"));
const { MODE } = require("./constants");
// Shortcuts
const { span } = React.DOM;
@ -23,7 +24,8 @@ define(function (require, exports, module) {
propTypes: {
object: React.PropTypes.object.isRequired,
mode: React.PropTypes.string,
// @TODO Change this to Object.values once it's supported in Node's version of V8
mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])),
},
getTitle: function (object) {
@ -44,7 +46,7 @@ define(function (require, exports, module) {
return keys.map((key, i) => {
return PropRep(Object.assign({}, this.props, {
mode: "tiny",
mode: MODE.TINY,
name: `<${key}>`,
object: promiseState[key],
equal: ": ",
@ -58,7 +60,7 @@ define(function (require, exports, module) {
const {promiseState} = object;
let objectLink = this.props.objectLink || span;
if (this.props.mode == "tiny") {
if (this.props.mode === MODE.TINY) {
let { Rep } = createFactories(require("./rep"));
return (

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

@ -7,8 +7,11 @@
// Make this available to both AMD and CJS environments
define(function (require, exports, module) {
// Dependencies
const React = require("devtools/client/shared/vendor/react");
const { createFactories } = require("./rep-utils");
const { MODE } = require("./constants");
// Shortcuts
const { span } = React.DOM;
/**
@ -29,7 +32,8 @@ define(function (require, exports, module) {
equal: React.PropTypes.string,
// Delimiter character used to separate individual properties.
delim: React.PropTypes.string,
mode: React.PropTypes.string,
// @TODO Change this to Object.values once it's supported in Node's version of V8
mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])),
},
render: function () {
@ -44,7 +48,7 @@ define(function (require, exports, module) {
} else {
key = Rep({
object: this.props.name,
mode: this.props.mode || "tiny",
mode: this.props.mode || MODE.TINY,
defaultRep: Grip,
objectLink: this.props.objectLink,
});

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

@ -12,6 +12,7 @@ define(function (require, exports, module) {
const React = require("devtools/client/shared/vendor/react");
const { isGrip } = require("./rep-utils");
const { MODE } = require("./constants");
// Load all existing rep templates
const { Undefined } = require("./undefined");
@ -90,7 +91,8 @@ define(function (require, exports, module) {
propTypes: {
object: React.PropTypes.any,
defaultRep: React.PropTypes.object,
mode: React.PropTypes.string
// @TODO Change this to Object.values once it's supported in Node's version of V8
mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])),
},
render: function () {

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

@ -12,6 +12,7 @@ define(function (require, exports, module) {
// Reps
const { isGrip, cropString } = require("./rep-utils");
const { MODE } = require("./constants");
// Shortcuts
const DOM = React.DOM;
@ -24,7 +25,8 @@ define(function (require, exports, module) {
propTypes: {
object: React.PropTypes.object.isRequired,
mode: React.PropTypes.string,
// @TODO Change this to Object.values once it's supported in Node's version of V8
mode: React.PropTypes.oneOf(Object.keys(MODE).map(key => MODE[key])),
},
getTextContent: function (grip) {
@ -42,8 +44,10 @@ define(function (require, exports, module) {
},
render: function () {
let grip = this.props.object;
let mode = this.props.mode || "short";
let {
object: grip,
mode = MODE.SHORT,
} = this.props;
let baseConfig = {className: "objectBox objectBox-textNode"};
if (this.props.onDOMNodeMouseOver) {
@ -58,7 +62,7 @@ define(function (require, exports, module) {
});
}
if (mode == "tiny") {
if (mode === MODE.TINY) {
return DOM.span(baseConfig, this.getTitle(grip));
}

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

@ -206,7 +206,7 @@ function shallowRenderComponent(component, props) {
*/
function testRepRenderModes(modeTests, testName, componentUnderTest, gripStub) {
modeTests.forEach(({mode, expectedOutput, message}) => {
const modeString = typeof mode === "undefined" ? "no mode" : mode;
const modeString = typeof mode === "undefined" ? "no mode" : mode.toString();
if (!message) {
message = `${testName}: ${modeString} renders correctly.`;
}

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

@ -22,6 +22,7 @@ Test ArrayRep rep
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { ArrayRep } = browserRequire("devtools/client/shared/components/reps/array");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
let componentUnderTest = ArrayRep;
const maxLength = {
@ -65,15 +66,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -91,15 +92,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[3]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -117,15 +118,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultShortOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[${maxLength.short + 1}]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultShortOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: `[ ${Array(maxLength.short + 1).fill("\"foo\"").join(", ")} ]`,
}
];
@ -144,15 +145,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultShortOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[${maxLength.long + 1}]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultShortOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultLongOutput,
}
];
@ -171,15 +172,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[2]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -204,15 +205,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[1]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -233,15 +234,15 @@ window.onload = Task.async(function* () {
expectedOutput: shortOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[10]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: shortOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];

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

@ -22,6 +22,7 @@ window.onload = Task.async(function* () {
try {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { CommentNode } = browserRequire("devtools/client/shared/components/reps/comment-node");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
let gripStub = {
"type": "object",
@ -55,7 +56,7 @@ window.onload = Task.async(function* () {
// Test tiny rendering.
const tinyRenderedComponent = renderComponent(CommentNode.rep, {
object: gripStub,
mode: "tiny"
mode: MODE.TINY,
});
is(tinyRenderedComponent.textContent,
`<!-- test\\nand test\\na… test\\nand test -->`,
@ -64,7 +65,7 @@ window.onload = Task.async(function* () {
// Test long rendering.
const longRenderedComponent = renderComponent(CommentNode.rep, {
object: gripStub,
mode: "long"
mode: MODE.LONG,
});
is(longRenderedComponent.textContent, `<!-- ${gripStub.preview.textContent} -->`,
"CommentNode rep has expected text content in long mode");

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

@ -21,6 +21,7 @@ Test Element node rep
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { ElementNode } = browserRequire("devtools/client/shared/components/reps/element-node");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
try {
yield testBodyNode();
@ -51,7 +52,7 @@ window.onload = Task.async(function* () {
"Element node rep has expected text content for body node");
const tinyRenderedComponent = renderComponent(
ElementNode.rep, { object: stub, mode: "tiny" });
ElementNode.rep, { object: stub, mode: MODE.TINY });
is(tinyRenderedComponent.textContent, `body#body-id.body-class`,
"Element node rep has expected text content for body node in tiny mode");
}
@ -67,7 +68,7 @@ window.onload = Task.async(function* () {
"Element node rep has expected text content for document element node");
const tinyRenderedComponent = renderComponent(
ElementNode.rep, { object: stub, mode: "tiny" });
ElementNode.rep, { object: stub, mode: MODE.TINY });
is(tinyRenderedComponent.textContent, `html`,
"Element node rep has expected text content for document element in tiny mode");
}
@ -85,7 +86,7 @@ window.onload = Task.async(function* () {
"Element node rep has expected text content for element node");
const tinyRenderedComponent = renderComponent(
ElementNode.rep, { object: stub, mode: "tiny" });
ElementNode.rep, { object: stub, mode: MODE.TINY });
is(tinyRenderedComponent.textContent,
`input#newtab-customize-button.bar.baz`,
"Element node rep has expected text content for element node in tiny mode");
@ -103,7 +104,7 @@ window.onload = Task.async(function* () {
"Element node rep output element node with the class trailing spaces");
const tinyRenderedComponent = renderComponent(
ElementNode.rep, { object: stub, mode: "tiny" });
ElementNode.rep, { object: stub, mode: MODE.TINY });
is(tinyRenderedComponent.textContent,
`body#nightly-whatsnew.html-ltr`,
"Element node rep does not show leading nor trailing spaces " +
@ -118,7 +119,7 @@ window.onload = Task.async(function* () {
"Element node rep has expected text content for element node without attributes");
const tinyRenderedComponent = renderComponent(
ElementNode.rep, { object: stub, mode: "tiny" });
ElementNode.rep, { object: stub, mode: MODE.TINY });
is(tinyRenderedComponent.textContent, `p`,
"Element node rep has expected text content for element node without attributes");
}
@ -133,7 +134,7 @@ window.onload = Task.async(function* () {
"Element node rep has expected text content for node with lots of attributes");
const tinyRenderedComponent = renderComponent(
ElementNode.rep, { object: stub, mode: "tiny" });
ElementNode.rep, { object: stub, mode: MODE.TINY });
is(tinyRenderedComponent.textContent, `p#lots-of-attributes`,
"Element node rep has expected text content for node in tiny mode");
}
@ -151,7 +152,7 @@ window.onload = Task.async(function* () {
"Element node rep has expected text content for SVG element node");
const tinyRenderedComponent = renderComponent(
ElementNode.rep, { object: stub, mode: "tiny" });
ElementNode.rep, { object: stub, mode: MODE.TINY });
is(tinyRenderedComponent.textContent, `clipPath#clip.svg-element`,
"Element node rep has expected text content for SVG element node in tiny mode");
}
@ -169,7 +170,7 @@ window.onload = Task.async(function* () {
"Element node rep has expected text content for XHTML SVG element node");
const tinyRenderedComponent = renderComponent(
ElementNode.rep, { object: stub, mode: "tiny" });
ElementNode.rep, { object: stub, mode: MODE.TINY });
is(tinyRenderedComponent.textContent, `svg:circle.svg-element`,
"Element node rep has expected text content for XHTML SVG element in tiny mode");
}

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

@ -21,6 +21,7 @@ Test Error rep
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { ErrorRep } = browserRequire("devtools/client/shared/components/reps/error");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
try {
// Test errors with different properties
@ -56,7 +57,8 @@ window.onload = Task.async(function* () {
"@debugger eval code:1:13\n",
"Error Rep has expected text content for a simple error");
const tinyRenderedComponent = renderComponent(ErrorRep.rep, {object: stub, mode: "tiny"});
const tinyRenderedComponent = renderComponent(
ErrorRep.rep, {object: stub, mode: MODE.TINY});
is(tinyRenderedComponent.textContent,
"Error",
"Error Rep has expected text content for a simple error in tiny mode");
@ -87,7 +89,8 @@ window.onload = Task.async(function* () {
"@debugger eval code:8:1\n",
"Error Rep has expected text content for an error with a multiple line");
const tinyRenderedComponent = renderComponent(ErrorRep.rep, {object: stub, mode: "tiny"});
const tinyRenderedComponent = renderComponent(
ErrorRep.rep, {object: stub, mode: MODE.TINY});
is(tinyRenderedComponent.textContent,
"Error",
"Error Rep has expected text content for an error with a multiple line in tiny mode");
@ -104,7 +107,8 @@ window.onload = Task.async(function* () {
"Error: Error message",
"Error Rep has expected text content for an error without stacktrace");
const tinyRenderedComponent = renderComponent(ErrorRep.rep, {object: stub, mode: "tiny"});
const tinyRenderedComponent = renderComponent(
ErrorRep.rep, {object: stub, mode: MODE.TINY});
is(tinyRenderedComponent.textContent,
"Error",
"Error Rep has expected text content for an error without stacktrace in tiny mode");
@ -124,7 +128,8 @@ window.onload = Task.async(function* () {
"@debugger eval code:10:13\n",
"Error Rep has expected text content for an EvalError");
const tinyRenderedComponent = renderComponent(ErrorRep.rep, {object: stub, mode: "tiny"});
const tinyRenderedComponent = renderComponent(
ErrorRep.rep, {object: stub, mode: MODE.TINY});
is(tinyRenderedComponent.textContent,
"EvalError",
"Error Rep has expected text content for an EvalError in tiny mode");
@ -144,7 +149,8 @@ window.onload = Task.async(function* () {
"@debugger eval code:11:13\n",
"Error Rep has expected text content for an InternalError");
const tinyRenderedComponent = renderComponent(ErrorRep.rep, {object: stub, mode: "tiny"});
const tinyRenderedComponent = renderComponent(
ErrorRep.rep, {object: stub, mode: MODE.TINY});
is(tinyRenderedComponent.textContent,
"InternalError",
"Error Rep has expected text content for an InternalError in tiny mode");
@ -164,7 +170,8 @@ window.onload = Task.async(function* () {
"@debugger eval code:12:13\n",
"Error Rep has expected text content for RangeError");
const tinyRenderedComponent = renderComponent(ErrorRep.rep, {object: stub, mode: "tiny"});
const tinyRenderedComponent = renderComponent(
ErrorRep.rep, {object: stub, mode: MODE.TINY});
is(tinyRenderedComponent.textContent,
"RangeError",
"Error Rep has expected text content for RangeError in tiny mode");
@ -184,7 +191,8 @@ window.onload = Task.async(function* () {
"@debugger eval code:13:13\n",
"Error Rep has expected text content for ReferenceError");
const tinyRenderedComponent = renderComponent(ErrorRep.rep, {object: stub, mode: "tiny"});
const tinyRenderedComponent = renderComponent(
ErrorRep.rep, {object: stub, mode: MODE.TINY});
is(tinyRenderedComponent.textContent,
"ReferenceError",
"Error Rep has expected text content for ReferenceError in tiny mode");
@ -204,7 +212,8 @@ window.onload = Task.async(function* () {
"@debugger eval code:14:13\n",
"Error Rep has expected text content for SyntaxError");
const tinyRenderedComponent = renderComponent(ErrorRep.rep, {object: stub, mode: "tiny"});
const tinyRenderedComponent = renderComponent(
ErrorRep.rep, {object: stub, mode: MODE.TINY});
is(tinyRenderedComponent.textContent,
"SyntaxError",
"SyntaxError Rep has expected text content for SyntaxError in tiny mode");
@ -224,7 +233,8 @@ window.onload = Task.async(function* () {
"@debugger eval code:15:13\n",
"Error Rep has expected text content for TypeError");
const tinyRenderedComponent = renderComponent(ErrorRep.rep, {object: stub, mode: "tiny"});
const tinyRenderedComponent = renderComponent(
ErrorRep.rep, {object: stub, mode: MODE.TINY});
is(tinyRenderedComponent.textContent,
"TypeError",
"Error Rep has expected text content for a TypeError in tiny mode");
@ -244,7 +254,8 @@ window.onload = Task.async(function* () {
"@debugger eval code:16:13\n",
"Error Rep has expected text content for URIError");
const tinyRenderedComponent = renderComponent(ErrorRep.rep, {object: stub, mode: "tiny"});
const tinyRenderedComponent = renderComponent(
ErrorRep.rep, {object: stub, mode: MODE.TINY});
is(tinyRenderedComponent.textContent,
"URIError",
"Error Rep has expected text content for URIError in tiny mode");

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

@ -19,6 +19,7 @@ Test GripArray rep
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { GripArray } = browserRequire("devtools/client/shared/components/reps/grip-array");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
let componentUnderTest = GripArray;
const maxLength = {
@ -41,9 +42,7 @@ window.onload = Task.async(function* () {
yield testOnMouseOver();
yield testOnMouseOut();
} catch(e) {
} catch (e) {
ok(false, "Got an error: " + DevToolsUtils.safeErrorString(e));
} finally {
SimpleTest.finish();
@ -67,15 +66,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -95,15 +94,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[3]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -123,15 +122,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[${maxLength.short + 1}]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: `Array [ ${Array(maxLength.short + 1).fill("\"test string\"").join(", ")} ]`,
}
];
@ -152,15 +151,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultShortOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[${maxLength.long + 1}]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultShortOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultLongOutput
}
];
@ -180,15 +179,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[1]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -208,15 +207,15 @@ window.onload = Task.async(function* () {
expectedOutput: shortOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[11]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: shortOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -235,15 +234,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[3]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -262,15 +261,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[3]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -294,15 +293,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `[5]`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: longOutput,
}
];

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

@ -21,6 +21,7 @@ Test GripMap rep
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { GripMap } = browserRequire("devtools/client/shared/components/reps/grip-map");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const componentUnderTest = GripMap;
@ -57,15 +58,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: "Map",
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -86,15 +87,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: "Map",
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -120,15 +121,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: "WeakMap",
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -149,15 +150,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: "Map",
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -183,15 +184,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Map`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: longOutput,
}
];
@ -215,15 +216,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Map`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: longOutput,
}
];

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

@ -19,6 +19,7 @@ Test grip rep
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { Grip } = browserRequire("devtools/client/shared/components/reps/grip");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const componentUnderTest = Grip;
@ -67,15 +68,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Object`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -101,15 +102,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Boolean`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -135,15 +136,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Number`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -169,15 +170,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `String`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -203,15 +204,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Proxy`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -237,15 +238,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `ArrayBuffer`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -271,15 +272,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `SharedArrayBuffer`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -299,15 +300,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Object`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -335,15 +336,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Object`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: longOutput,
}
];
@ -376,15 +377,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Object`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -404,15 +405,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Object`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -432,15 +433,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Object`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -461,15 +462,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Object`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: longOutput,
}
];

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

@ -19,6 +19,7 @@ Test Obj rep
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { Obj } = browserRequire("devtools/client/shared/components/reps/object");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const componentUnderTest = Obj;
@ -57,15 +58,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: defaultOutput,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -85,15 +86,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Object`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -114,15 +115,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Object`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -140,15 +141,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Object`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -173,15 +174,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Object`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -204,15 +205,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Object`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];

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

@ -21,6 +21,7 @@ Test Promise rep
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { PromiseRep } = browserRequire("devtools/client/shared/components/reps/promise");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
const componentUnderTest = PromiseRep;
@ -54,15 +55,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Promise { "pending" }`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -88,15 +89,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Promise { "fulfilled" }`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -122,15 +123,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Promise { "fulfilled" }`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -157,15 +158,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Promise { "fulfilled" }`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -192,15 +193,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: `Promise { "fulfilled" }`,
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];

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

@ -21,6 +21,7 @@ Test text-node rep
window.onload = Task.async(function* () {
let { Rep } = browserRequire("devtools/client/shared/components/reps/rep");
let { TextNode } = browserRequire("devtools/client/shared/components/reps/text-node");
const { MODE } = browserRequire("devtools/client/shared/components/reps/constants");
let gripStubs = new Map();
gripStubs.set("testRendering", {
@ -68,15 +69,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: "#text",
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];
@ -94,15 +95,15 @@ window.onload = Task.async(function* () {
expectedOutput: defaultOutput,
},
{
mode: "tiny",
mode: MODE.TINY,
expectedOutput: "#text",
},
{
mode: "short",
mode: MODE.SHORT,
expectedOutput: defaultOutput,
},
{
mode: "long",
mode: MODE.LONG,
expectedOutput: defaultOutput,
}
];

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

@ -772,12 +772,19 @@
filter: var(--icon-filter);
width: 16px;
height: 16px;
opacity: 0.8;
}
#requests-menu-network-summary-button > .summary-info-text {
opacity: 0.8;
margin-inline-start: 0.5em;
}
#requests-menu-network-summary-button:hover > .summary-info-icon,
#requests-menu-network-summary-button:hover > .summary-info-text {
opacity: 1;
}
/* Performance analysis view */
#network-statistics-toolbar {

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

@ -9,6 +9,7 @@ const React = require("devtools/client/shared/vendor/react");
const { createFactories, parseURLEncodedText } = require("devtools/client/shared/components/reps/rep-utils");
const TreeView = React.createFactory(require("devtools/client/shared/components/tree/tree-view"));
const { Rep } = createFactories(require("devtools/client/shared/components/reps/rep"));
const { MODE } = require("devtools/client/shared/components/reps/constants");
// Network
const NetInfoParams = React.createFactory(require("./net-info-params"));
@ -76,7 +77,7 @@ var PostTab = React.createClass({
content: TreeView({
columns: [{id: "value"}],
object: json,
mode: "tiny",
mode: MODE.TINY,
renderValue: props => Rep(Object.assign({}, props, {
cropLimit: 50,
})),

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

@ -9,6 +9,7 @@ const React = require("devtools/client/shared/vendor/react");
const { createFactories } = require("devtools/client/shared/components/reps/rep-utils");
const TreeView = React.createFactory(require("devtools/client/shared/components/tree/tree-view"));
const { Rep } = createFactories(require("devtools/client/shared/components/reps/rep"));
const { MODE } = require("devtools/client/shared/components/reps/constants");
// Network
const SizeLimit = React.createFactory(require("./size-limit"));
@ -104,7 +105,7 @@ var ResponseTab = React.createClass({
content: TreeView({
columns: [{id: "value"}],
object: json,
mode: "tiny",
mode: MODE.TINY,
renderValue: props => Rep(Object.assign({}, props, {
cropLimit: 50,
})),

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

@ -12,6 +12,7 @@ const {
const { ObjectClient } = require("devtools/shared/client/main");
const actions = require("devtools/client/webconsole/new-console-output/actions/messages");
const {l10n} = require("devtools/client/webconsole/new-console-output/utils/messages");
const { MODE } = require("devtools/client/shared/components/reps/constants");
const GripMessageBody = createFactory(require("devtools/client/webconsole/new-console-output/components/grip-message-body"));
const TABLE_ROW_MAX_ITEMS = 1000;
@ -59,7 +60,7 @@ const ConsoleTable = createClass({
{},
GripMessageBody({
grip: item[key],
mode: "short",
mode: MODE.SHORT,
})
)
);

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

@ -22,6 +22,7 @@ const { Rep } = createFactories(require("devtools/client/shared/components/reps/
const StringRep = createFactories(require("devtools/client/shared/components/reps/string").StringRep).rep;
const VariablesViewLink = createFactory(require("devtools/client/webconsole/new-console-output/components/variables-view-link"));
const { Grip } = require("devtools/client/shared/components/reps/grip");
const { MODE } = require("devtools/client/shared/components/reps/constants");
GripMessageBody.displayName = "GripMessageBody";
@ -38,7 +39,7 @@ GripMessageBody.propTypes = {
};
GripMessageBody.defaultProps = {
mode: "long",
mode: MODE.LONG,
};
function GripMessageBody(props) {

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

@ -15,8 +15,9 @@ class L10n {
return "XHR";
case "webConsoleMoreInfoLabel":
return "Learn More";
default:
return str;
}
return str;
}
getFormatStr(str) {

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

@ -7,17 +7,20 @@ const requireHacker = require("require-hacker");
requireHacker.global_hook("default", path => {
switch (path) {
// For Enzyme
case "react-dom":
case "react-dom/server":
return `const React = require('react-dev'); module.exports = React`;
return `const React = require('devtools/client/shared/vendor/react-dev'); module.exports = React`;
case "react-addons-test-utils":
return `const React = require('react-dev'); module.exports = React.addons.TestUtils`;
return `const React = require('devtools/client/shared/vendor/react-dev'); module.exports = React.addons.TestUtils`;
case "react-redux":
return `const ReactRedux = require('devtools/client/shared/vendor/react-redux'); module.exports = ReactRedux`;
// Use react-dev. This would be handled by browserLoader in Firefox.
case "react":
case "devtools/client/shared/vendor/react":
return `const React = require('react-dev'); module.exports = React`;
return `const React = require('devtools/client/shared/vendor/react-dev'); module.exports = React`;
// For Rep's use of AMD
case "devtools/client/shared/vendor/react.default":
return `const React = require('react-dev'); module.exports = React`;
return `const React = require('devtools/client/shared/vendor/react-dev'); module.exports = React`;
}
// Some modules depend on Chrome APIs which don't work in mocha. When such a module

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

@ -5,6 +5,7 @@
"amd-loader": "0.0.5",
"babel-preset-es2015": "^6.6.0",
"babel-register": "^6.7.2",
"cross-env": "^3.1.3",
"enzyme": "^2.4.1",
"expect": "^1.16.0",
"jsdom": "^9.4.1",
@ -15,6 +16,6 @@
},
"scripts": {
"postinstall": "cd ../ && npm install && cd webconsole",
"test": "NODE_PATH=`pwd`/../../../:`pwd`/../../../devtools/client/shared/vendor/ mocha new-console-output/test/**/*.test.js --compilers js:babel-register -r jsdom-global/register -r ./new-console-output/test/requireHelper.js"
"test": "cross-env NODE_PATH=../../../ mocha new-console-output/test/**/*.test.js --compilers js:babel-register -r jsdom-global/register -r ./new-console-output/test/require-helper.js"
}
}

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

@ -268,6 +268,10 @@ function normalizeCssData(db) {
// Fill in any missing DB information from the static database.
db = Object.assign({}, CSS_PROPERTIES_DB, db);
let missingSupports = !db.properties.color.supports;
let missingValues = !db.properties.color.values;
let missingSubproperties = !db.properties.background.subproperties;
for (let name in db.properties) {
// Skip the current property if we can't find it in CSS_PROPERTIES_DB.
if (typeof CSS_PROPERTIES_DB.properties[name] !== "object") {
@ -275,15 +279,15 @@ function normalizeCssData(db) {
}
// Add "supports" information to the css properties if it's missing.
if (!db.properties.color.supports) {
if (missingSupports) {
db.properties[name].supports = CSS_PROPERTIES_DB.properties[name].supports;
}
// Add "values" information to the css properties if it's missing.
if (!db.properties.color.values) {
if (missingValues) {
db.properties[name].values = CSS_PROPERTIES_DB.properties[name].values;
}
// Add "subproperties" information to the css properties if it's missing.
if (!db.properties.background.subproperties) {
if (missingSubproperties) {
db.properties[name].subproperties =
CSS_PROPERTIES_DB.properties[name].subproperties;
}

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

@ -144,8 +144,8 @@ if CONFIG['MOZ_BUILD_APP'] in ['browser', 'mobile/android', 'xulrunner']:
DEFINES['HAVE_SIDEBAR'] = True
PYTHON_UNIT_TESTS += [
'mozwebidlcodegen/test/test_mozwebidlcodegen.py',
PYTHON_UNITTEST_MANIFESTS += [
'mozwebidlcodegen/test/python.ini',
]
if CONFIG['GNU_CXX']:

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

@ -0,0 +1 @@
[test_mozwebidlcodegen.py]

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

@ -34,6 +34,45 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(ImageBitmap)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
/*
* This helper function is used to notify DOM that aBytes memory is allocated
* here so that we could trigger GC appropriately.
*/
static void
RegisterAllocation(nsIGlobalObject* aGlobal, size_t aBytes)
{
AutoJSAPI jsapi;
if (jsapi.Init(aGlobal)) {
JS_updateMallocCounter(jsapi.cx(), aBytes);
}
}
static void
RegisterAllocation(nsIGlobalObject* aGlobal, SourceSurface* aSurface)
{
// Calculate how many bytes are used.
const int bytesPerPixel = BytesPerPixel(aSurface->GetFormat());
const size_t bytes =
aSurface->GetSize().height * aSurface->GetSize().width * bytesPerPixel;
// Register.
RegisterAllocation(aGlobal, bytes);
}
static void
RegisterAllocation(nsIGlobalObject* aGlobal, layers::Image* aImage)
{
// Calculate how many bytes are used.
if (aImage->GetFormat() == mozilla::ImageFormat::PLANAR_YCBCR) {
RegisterAllocation(aGlobal, aImage->AsPlanarYCbCrImage()->GetDataSize());
} else if (aImage->GetFormat() == mozilla::ImageFormat::NV_IMAGE) {
RegisterAllocation(aGlobal, aImage->AsNVImage()->GetBufferSize());
} else {
RefPtr<SourceSurface> surface = aImage->GetAsSourceSurface();
RegisterAllocation(aGlobal, surface);
}
}
/*
* If either aRect.width or aRect.height are negative, then return a new IntRect
* which represents the same rectangle as the aRect does but with positive width
@ -707,6 +746,9 @@ ImageBitmap::CreateFromCloneData(nsIGlobalObject* aGlobal,
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data,
aData->mIsPremultipliedAlpha);
// Report memory allocation.
RegisterAllocation(aGlobal, aData->mSurface);
ret->mIsCroppingAreaOutSideOfSourceImage =
aData->mIsCroppingAreaOutSideOfSourceImage;
@ -741,6 +783,10 @@ ImageBitmap::CreateFromOffscreenCanvas(nsIGlobalObject* aGlobal,
CreateImageFromSurface(surface);
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data);
// Report memory allocation.
RegisterAllocation(aGlobal, surface);
return ret.forget();
}
@ -865,6 +911,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLCanvasElement& aCanvas
// If the HTMLCanvasElement's rendering context is WebGL, then the snapshot
// we got from the HTMLCanvasElement is a DataSourceSurface which is a copy
// of the rendering context. We handle cropping in this case.
bool needToReportMemoryAllocation = false;
if ((aCanvasEl.GetCurrentContextType() == CanvasContextType::WebGL1 ||
aCanvasEl.GetCurrentContextType() == CanvasContextType::WebGL2) &&
aCropRect.isSome()) {
@ -875,6 +922,7 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLCanvasElement& aCanvas
RefPtr<DataSourceSurface> dataSurface = surface->GetDataSurface();
croppedSurface = CropAndCopyDataSourceSurface(dataSurface, cropRect);
cropRect.MoveTo(0, 0);
needToReportMemoryAllocation = true;
}
else {
croppedSurface = surface;
@ -895,6 +943,11 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, HTMLCanvasElement& aCanvas
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data);
// Report memory allocation if needed.
if (needToReportMemoryAllocation) {
RegisterAllocation(aGlobal, croppedSurface);
}
// Set the picture rectangle.
if (ret && aCropRect.isSome()) {
ret->SetPictureRect(cropRect, aRv);
@ -958,6 +1011,9 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, ImageData& aImageData,
// ImageData's underlying data is not alpha-premultiplied.
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data, false);
// Report memory allocation.
RegisterAllocation(aGlobal, data);
// The cropping information has been handled in the CreateImageFromRawData()
// function.
@ -999,6 +1055,9 @@ ImageBitmap::CreateInternal(nsIGlobalObject* aGlobal, CanvasRenderingContext2D&
RefPtr<ImageBitmap> ret = new ImageBitmap(aGlobal, data);
// Report memory allocation.
RegisterAllocation(aGlobal, surface);
// Set the picture rectangle.
if (ret && aCropRect.isSome()) {
ret->SetPictureRect(aCropRect.ref(), aRv);
@ -1240,6 +1299,9 @@ protected:
}
}
// Report memory allocation.
RegisterAllocation(mGlobalObject, imageBitmap->mData);
mPromise->MaybeResolve(imageBitmap);
return true;
}
@ -1524,6 +1586,9 @@ ImageBitmap::ReadStructuredClone(JSContext* aCx,
if (!GetOrCreateDOMReflector(aCx, imageBitmap, &value)) {
return nullptr;
}
// Report memory allocation.
RegisterAllocation(aParent, aClonedSurfaces[aIndex]);
}
return &(value.toObject());
@ -2112,6 +2177,9 @@ ImageBitmap::Create(nsIGlobalObject* aGlobal,
// Assume the data from an external buffer is not alpha-premultiplied.
RefPtr<ImageBitmap> imageBitmap = new ImageBitmap(aGlobal, data, false);
// Report memory allocation.
RegisterAllocation(aGlobal, data);
// We don't need to call SetPictureRect() here because there is no cropping
// supported and the ImageBitmap's mPictureRect is the size of the source
// image in default

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

@ -95,7 +95,12 @@ AccurateSeekTask::CalculateNewCurrentTime() const
// For the fast seek, we update the newCurrentTime with the decoded audio and
// video samples, set it to be the one which is closet to the seekTime.
if (mTarget.IsFast()) {
MOZ_ASSERT(mSeekedAudioData || mSeekedVideoData);
// A situation that both audio and video approaches the end.
if (!mSeekedAudioData && !mSeekedVideoData) {
return seekTime;
}
const int64_t audioStart = mSeekedAudioData ? mSeekedAudioData->mTime : INT64_MAX;
const int64_t videoStart = mSeekedVideoData ? mSeekedVideoData->mTime : INT64_MAX;
const int64_t audioGap = std::abs(audioStart - seekTime);

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

@ -152,14 +152,6 @@ public:
MOZ_CRASH();
}
// By default, the reader return the decoded data. Some readers support
// retuning demuxed data.
virtual bool IsDemuxOnlySupported() const { return false; }
// Configure the reader to return demuxed or decoded data
// upon calls to Request{Audio,Video}Data.
virtual void SetDemuxOnly(bool /*aDemuxedOnly*/) {}
// The default implementation of AsyncReadMetadata is implemented in terms of
// synchronous ReadMetadata() calls. Implementations may also
// override AsyncReadMetadata to create a more proper async implementation.

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

@ -487,13 +487,13 @@ public:
void HandleAudioDecoded(MediaData* aAudio) override
{
mMaster->Push(aAudio, MediaData::AUDIO_DATA);
mMaster->Push(aAudio);
MaybeFinishDecodeFirstFrame();
}
void HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart) override
{
mMaster->Push(aVideo, MediaData::VIDEO_DATA);
mMaster->Push(aVideo);
MaybeFinishDecodeFirstFrame();
}
@ -584,13 +584,13 @@ public:
void HandleAudioDecoded(MediaData* aAudio) override
{
mMaster->Push(aAudio, MediaData::AUDIO_DATA);
mMaster->Push(aAudio);
MaybeStopPrerolling();
}
void HandleVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStart) override
{
mMaster->Push(aVideo, MediaData::VIDEO_DATA);
mMaster->Push(aVideo);
MaybeStopPrerolling();
CheckSlowDecoding(aDecodeStart);
}
@ -878,13 +878,13 @@ private:
mSeekTaskRequest.Complete();
if (aValue.mSeekedAudioData) {
mMaster->Push(aValue.mSeekedAudioData, MediaData::AUDIO_DATA);
mMaster->Push(aValue.mSeekedAudioData);
mMaster->mDecodedAudioEndTime = std::max(
aValue.mSeekedAudioData->GetEndTime(), mMaster->mDecodedAudioEndTime);
}
if (aValue.mSeekedVideoData) {
mMaster->Push(aValue.mSeekedVideoData, MediaData::VIDEO_DATA);
mMaster->Push(aValue.mSeekedVideoData);
mMaster->mDecodedVideoEndTime = std::max(
aValue.mSeekedVideoData->GetEndTime(), mMaster->mDecodedVideoEndTime);
}
@ -967,7 +967,7 @@ public:
{
// This might be the sample we need to exit buffering.
// Schedule Step() to check it.
mMaster->Push(aAudio, MediaData::AUDIO_DATA);
mMaster->Push(aAudio);
mMaster->ScheduleStateMachine();
}
@ -975,7 +975,7 @@ public:
{
// This might be the sample we need to exit buffering.
// Schedule Step() to check it.
mMaster->Push(aVideo, MediaData::VIDEO_DATA);
mMaster->Push(aVideo);
mMaster->ScheduleStateMachine();
}
@ -1930,7 +1930,7 @@ MediaDecoderStateMachine::OnAudioDecoded(MediaData* aAudio)
}
void
MediaDecoderStateMachine::Push(MediaData* aSample, MediaData::Type aSampleType)
MediaDecoderStateMachine::Push(MediaData* aSample)
{
MOZ_ASSERT(OnTaskQueue());
MOZ_ASSERT(aSample);
@ -1946,9 +1946,8 @@ MediaDecoderStateMachine::Push(MediaData* aSample, MediaData::Type aSampleType)
// to reach playing.
aSample->As<VideoData>()->mFrameID = ++mCurrentFrameID;
VideoQueue().Push(aSample);
} else {
// TODO: Handle MediaRawData, determine which queue should be pushed.
}
DispatchDecodeTasksIfNeeded();
}

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

@ -326,8 +326,6 @@ private:
// be held.
bool IsPlaying() const;
// TODO: Those callback function may receive demuxed-only data.
// Need to figure out a suitable API name for this case.
void OnAudioDecoded(MediaData* aAudio);
void OnVideoDecoded(MediaData* aVideo, TimeStamp aDecodeStartTime);
void OnNotDecoded(MediaData::Type aType, const MediaResult& aError);
@ -346,8 +344,7 @@ protected:
// Inserts MediaData* samples into their respective MediaQueues.
// aSample must not be null.
void Push(MediaData* aSample, MediaData::Type aSampleType);
void Push(MediaData* aSample);
void OnAudioPopped(const RefPtr<MediaData>& aSample);
void OnVideoPopped(const RefPtr<MediaData>& aSample);

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

@ -437,7 +437,6 @@ MediaFormatReader::MediaFormatReader(AbstractMediaDecoder* aDecoder,
, mPreviousDecodedKeyframeTime_us(sNoPreviousDecodedKeyframe)
, mInitDone(false)
, mTrackDemuxersMayBlock(false)
, mDemuxOnly(false)
, mSeekScheduled(false)
, mVideoFrameContainer(aVideoFrameContainer)
, mDecoderFactory(new DecoderFactory(this))
@ -1328,18 +1327,9 @@ MediaFormatReader::HandleDemuxedSamples(TrackType aTrack,
aA.mStats.mParsedFrames++;
}
if (mDemuxOnly) {
ReturnOutput(sample, aTrack);
} else {
DecodeDemuxedSamples(aTrack, sample);
}
DecodeDemuxedSamples(aTrack, sample);
decoder.mQueuedSamples.RemoveElementAt(0);
if (mDemuxOnly) {
// If demuxed-only case, ReturnOutput will resolve with one demuxed data.
// Then we should stop doing the iteration.
return;
}
samplesPending = true;
}
}
@ -1640,29 +1630,25 @@ MediaFormatReader::ReturnOutput(MediaData* aData, TrackType aTrack)
aData->mTime, aData->GetEndTime());
if (aTrack == TrackInfo::kAudioTrack) {
if (aData->mType != MediaData::RAW_DATA) {
AudioData* audioData = static_cast<AudioData*>(aData);
AudioData* audioData = static_cast<AudioData*>(aData);
if (audioData->mChannels != mInfo.mAudio.mChannels ||
audioData->mRate != mInfo.mAudio.mRate) {
LOG("change of audio format (rate:%d->%d). "
"This is an unsupported configuration",
mInfo.mAudio.mRate, audioData->mRate);
mInfo.mAudio.mRate = audioData->mRate;
mInfo.mAudio.mChannels = audioData->mChannels;
}
if (audioData->mChannels != mInfo.mAudio.mChannels ||
audioData->mRate != mInfo.mAudio.mRate) {
LOG("change of audio format (rate:%d->%d). "
"This is an unsupported configuration",
mInfo.mAudio.mRate, audioData->mRate);
mInfo.mAudio.mRate = audioData->mRate;
mInfo.mAudio.mChannels = audioData->mChannels;
}
mAudio.ResolvePromise(aData, __func__);
} else if (aTrack == TrackInfo::kVideoTrack) {
if (aData->mType != MediaData::RAW_DATA) {
VideoData* videoData = static_cast<VideoData*>(aData);
VideoData* videoData = static_cast<VideoData*>(aData);
if (videoData->mDisplay != mInfo.mVideo.mDisplay) {
LOG("change of video display size (%dx%d->%dx%d)",
mInfo.mVideo.mDisplay.width, mInfo.mVideo.mDisplay.height,
videoData->mDisplay.width, videoData->mDisplay.height);
mInfo.mVideo.mDisplay = videoData->mDisplay;
}
if (videoData->mDisplay != mInfo.mVideo.mDisplay) {
LOG("change of video display size (%dx%d->%dx%d)",
mInfo.mVideo.mDisplay.width, mInfo.mVideo.mDisplay.height,
videoData->mDisplay.width, videoData->mDisplay.height);
mInfo.mVideo.mDisplay = videoData->mDisplay;
}
mVideo.ResolvePromise(aData, __func__);
}

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

@ -74,20 +74,6 @@ public:
bool IsWaitForDataSupported() const override { return true; }
RefPtr<WaitForDataPromise> WaitForData(MediaData::Type aType) override;
// MediaFormatReader supports demuxed-only mode.
bool IsDemuxOnlySupported() const override { return true; }
void SetDemuxOnly(bool aDemuxedOnly) override
{
if (OnTaskQueue()) {
mDemuxOnly = aDemuxedOnly;
return;
}
nsCOMPtr<nsIRunnable> r = NewRunnableMethod<bool>(
this, &MediaDecoderReader::SetDemuxOnly, aDemuxedOnly);
OwnerThread()->Dispatch(r.forget());
}
bool UseBufferingHeuristics() const override
{
return mTrackDemuxersMayBlock;
@ -548,9 +534,6 @@ private:
// Set to true if any of our track buffers may be blocking.
bool mTrackDemuxersMayBlock;
// Set the demuxed-only flag.
Atomic<bool> mDemuxOnly;
// Seeking objects.
void SetSeekTarget(const SeekTarget& aTarget);
bool IsSeeking() const { return mPendingSeekTime.isSome(); }

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

@ -427,6 +427,7 @@ RTCPeerConnection.prototype = {
this.makeGetterSetterEH("onremovestream");
this.makeGetterSetterEH("ondatachannel");
this.makeGetterSetterEH("oniceconnectionstatechange");
this.makeGetterSetterEH("onicegatheringstatechange");
this.makeGetterSetterEH("onidentityresult");
this.makeGetterSetterEH("onpeeridentity");
this.makeGetterSetterEH("onidpassertionerror");
@ -1213,6 +1214,7 @@ RTCPeerConnection.prototype = {
changeIceGatheringState: function(state) {
this._iceGatheringState = state;
_globalPCList.notifyLifecycleObservers(this, "icegatheringstatechange");
this.dispatchEvent(new this._win.Event("icegatheringstatechange"));
},
changeIceConnectionState: function(state) {
@ -1423,6 +1425,9 @@ PeerConnectionObserver.prototype = {
handleIceConnectionStateChange: function(iceConnectionState) {
let pc = this._dompc;
if (pc.iceConnectionState === iceConnectionState) {
return;
}
if (pc.iceConnectionState === 'new') {
var checking_histogram = Services.telemetry.getHistogramById("WEBRTC_ICE_CHECKING_RATE");
if (iceConnectionState === 'checking') {
@ -1455,15 +1460,19 @@ PeerConnectionObserver.prototype = {
// new The object was just created, and no networking has occurred
// yet.
//
// gathering The ICE engine is in the process of gathering candidates for
// gathering The ICE agent is in the process of gathering candidates for
// this RTCPeerConnection.
//
// complete The ICE engine has completed gathering. Events such as adding
// complete The ICE agent has completed gathering. Events such as adding
// a new interface or a new TURN server will cause the state to
// go back to gathering.
//
handleIceGatheringStateChange: function(gatheringState) {
this._dompc.changeIceGatheringState(gatheringState);
let pc = this._dompc;
if (pc.iceGatheringState === gatheringState) {
return;
}
pc.changeIceGatheringState(gatheringState);
},
onStateChange: function(state) {

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

@ -1,248 +0,0 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "gtest/gtest.h"
#include "mozilla/dom/HTMLMediaElement.h"
#include "mozilla/Preferences.h"
#include "mozilla/TaskQueue.h"
#include "ImageContainer.h"
#include "Layers.h"
#include "MediaData.h"
#include "MediaFormatReader.h"
#include "MP4Decoder.h"
#include "MockMediaDecoderOwner.h"
#include "MockMediaResource.h"
#include "VideoFrameContainer.h"
using namespace mozilla;
using namespace mozilla::dom;
class MockMP4Decoder : public MP4Decoder
{
public:
MockMP4Decoder()
: MP4Decoder(new MockMediaDecoderOwner())
{}
// Avoid the assertion.
AbstractCanonical<media::NullableTimeUnit>* CanonicalDurationOrNull() override
{
return nullptr;
}
};
class MediaFormatReaderBinding
{
public:
NS_INLINE_DECL_THREADSAFE_REFCOUNTING(MediaFormatReaderBinding);
RefPtr<MockMP4Decoder> mDecoder;
RefPtr<MockMediaResource> mResource;
RefPtr<MediaDecoderReader> mReader;
RefPtr<TaskQueue> mTaskQueue;
explicit MediaFormatReaderBinding(const char* aFileName = "gizmo.mp4")
: mDecoder(new MockMP4Decoder())
, mResource(new MockMediaResource(aFileName))
, mReader(new MediaFormatReader(mDecoder,
new MP4Demuxer(mResource),
new VideoFrameContainer(
(HTMLMediaElement*)(0x1),
layers::LayerManager::CreateImageContainer(
layers::ImageContainer::ASYNCHRONOUS))
))
, mTaskQueue(new TaskQueue(GetMediaThreadPool(MediaThreadType::PLAYBACK)))
{
}
bool Init() {
// Init Resource.
nsresult rv = mResource->Open(nullptr);
if (NS_FAILED(rv)) {
return false;
}
mDecoder->SetResource(mResource);
// Init Reader.
rv = mReader->Init();
if (NS_FAILED(rv)) {
return false;
}
return true;
}
void OnMetadataReadAudio(MetadataHolder* aMetadata)
{
EXPECT_TRUE(aMetadata);
mReader->RequestAudioData()
->Then(mReader->OwnerThread(), __func__, this,
&MediaFormatReaderBinding::OnAudioRawDataDemuxed,
&MediaFormatReaderBinding::OnNotDemuxed);
}
void OnMetadataReadVideo(MetadataHolder* aMetadata)
{
EXPECT_TRUE(aMetadata);
mReader->RequestVideoData(true, 0)
->Then(mReader->OwnerThread(), __func__, this,
&MediaFormatReaderBinding::OnVideoRawDataDemuxed,
&MediaFormatReaderBinding::OnNotDemuxed);
}
void OnMetadataNotRead(const MediaResult& aError) {
EXPECT_TRUE(false);
ReaderShutdown();
}
void OnAudioRawDataDemuxed(MediaData* aAudioSample)
{
EXPECT_TRUE(aAudioSample);
EXPECT_EQ(MediaData::RAW_DATA, aAudioSample->mType);
ReaderShutdown();
}
void OnVideoRawDataDemuxed(MediaData* aVideoSample)
{
EXPECT_TRUE(aVideoSample);
EXPECT_EQ(MediaData::RAW_DATA, aVideoSample->mType);
ReaderShutdown();
}
void OnNotDemuxed(const MediaResult& aReason)
{
EXPECT_TRUE(false);
ReaderShutdown();
}
void ReaderShutdown()
{
RefPtr<MediaFormatReaderBinding> self = this;
mReader->Shutdown()
->Then(mTaskQueue, __func__,
[self]() {
self->mTaskQueue->BeginShutdown();
},
[self]() {
EXPECT_TRUE(false);
self->mTaskQueue->BeginShutdown();
}); //Then
}
template<class Function>
void RunTestAndWait(Function&& aFunction)
{
RefPtr<Runnable> r = NS_NewRunnableFunction(Forward<Function>(aFunction));
mTaskQueue->Dispatch(r.forget());
mTaskQueue->AwaitShutdownAndIdle();
}
private:
~MediaFormatReaderBinding()
{
mDecoder->Shutdown();
}
};
template <typename T>
T GetPref(const char* aPrefKey);
template <>
bool GetPref<bool>(const char* aPrefKey)
{
return Preferences::GetBool(aPrefKey);
}
template <typename T>
void SetPref(const char* a, T value);
template <>
void SetPref<bool>(const char* aPrefKey, bool aValue)
{
Unused << Preferences::SetBool(aPrefKey, aValue);
}
template <typename T>
class PreferencesRAII
{
public:
explicit PreferencesRAII(const char* aPrefKey, T aValue)
: mPrefKey(aPrefKey)
{
mDefaultPref = GetPref<T>(aPrefKey);
SetPref(aPrefKey, aValue);
}
~PreferencesRAII()
{
SetPref(mPrefKey, mDefaultPref);
}
private:
T mDefaultPref;
const char* mPrefKey;
};
TEST(MediaFormatReader, RequestAudioRawData)
{
PreferencesRAII<bool> pref =
PreferencesRAII<bool>("media.use-blank-decoder",
true);
RefPtr<MediaFormatReaderBinding> b = new MediaFormatReaderBinding();
if (!b->Init())
{
EXPECT_TRUE(false);
// Stop the test since initialization failed.
return;
}
if (!b->mReader->IsDemuxOnlySupported())
{
EXPECT_TRUE(false);
// Stop the test since the reader cannot support demuxed-only demand.
return;
}
// Switch to demuxed-only mode.
b->mReader->SetDemuxOnly(true);
// To ensure the MediaDecoderReader::InitializationTask and
// MediaDecoderReader::SetDemuxOnly can be done.
NS_ProcessNextEvent();
auto testCase = [b]() {
InvokeAsync(b->mReader->OwnerThread(),
b->mReader.get(),
__func__,
&MediaDecoderReader::AsyncReadMetadata)
->Then(b->mReader->OwnerThread(), __func__, b.get(),
&MediaFormatReaderBinding::OnMetadataReadAudio,
&MediaFormatReaderBinding::OnMetadataNotRead);
};
b->RunTestAndWait(testCase);
}
TEST(MediaFormatReader, RequestVideoRawData)
{
PreferencesRAII<bool> pref =
PreferencesRAII<bool>("media.use-blank-decoder",
true);
RefPtr<MediaFormatReaderBinding> b = new MediaFormatReaderBinding();
if (!b->Init())
{
EXPECT_TRUE(false);
// Stop the test since initialization failed.
return;
}
if (!b->mReader->IsDemuxOnlySupported())
{
EXPECT_TRUE(false);
// Stop the test since the reader cannot support demuxed-only demand.
return;
}
// Switch to demuxed-only mode.
b->mReader->SetDemuxOnly(true);
// To ensure the MediaDecoderReader::InitializationTask and
// MediaDecoderReader::SetDemuxOnly can be done.
NS_ProcessNextEvent();
auto testCase = [b]() {
InvokeAsync(b->mReader->OwnerThread(),
b->mReader.get(),
__func__,
&MediaDecoderReader::AsyncReadMetadata)
->Then(b->mReader->OwnerThread(), __func__, b.get(),
&MediaFormatReaderBinding::OnMetadataReadVideo,
&MediaFormatReaderBinding::OnMetadataNotRead);
};
b->RunTestAndWait(testCase);
}

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

@ -17,7 +17,6 @@ UNIFIED_SOURCES += [
'TestIntervalSet.cpp',
'TestMediaDataDecoder.cpp',
'TestMediaEventSource.cpp',
#'TestMediaFormatReader.cpp', disabled for bug 1316792, will be removed in bug 1318225
'TestMozPromise.cpp',
'TestMP3Demuxer.cpp',
'TestMP4Demuxer.cpp',

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

@ -1,5 +1,14 @@
// Helpers for Media Source Extensions tests
var gMSETestPrefs = [
[ "media.mediasource.enabled", true ]
];
// Called before runWithMSE() to set the prefs before running MSE tests.
function addMSEPrefs(...prefs) {
gMSETestPrefs = gMSETestPrefs.concat(prefs);
}
function runWithMSE(testFunction) {
function bootstrapTest() {
var ms = new MediaSource();
@ -17,10 +26,7 @@ function runWithMSE(testFunction) {
}
addLoadEvent(function () {
SpecialPowers.pushPrefEnv({"set": [
[ "media.mediasource.enabled", true ],
]},
bootstrapTest);
SpecialPowers.pushPrefEnv({"set": gMSETestPrefs}, bootstrapTest);
});
}

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

@ -31,46 +31,46 @@ function fillUpSourceBuffer(sourceBuffer, doAppendDataFunc, onCaughtExceptionCal
});
}
addMSEPrefs(
["media.mediasource.eviction_threshold.audio", 524288],
["media.dormant-on-pause-timeout-ms", -1] // FIXME: bug 1319292
);
runWithMSE(function(ms, el) {
el.controls = true;
once(ms, 'sourceopen').then(function() {
ok(true, "Receive a sourceopen event");
SpecialPowers.pushPrefEnv({
"set": [
["media.mediasource.eviction_threshold.audio", 524288],
]
}, function() {
let audiosb = ms.addSourceBuffer("audio/mp4");
audiosb.mode = "sequence";
fetchAndLoad(audiosb, 'bipbop/bipbop_audio', ['init'], '.mp4')
.then(function() {
fetchWithXHR('bipbop/bipbop_audio1.m4s', function(audioBuffer) {
fillUpSourceBuffer(audiosb,
function() { // doAppendDataFunc
audiosb.appendBuffer(audioBuffer);
},
function(ex) { // onCaughtExceptionCallback
is(ex.name, 'QuotaExceededError', "QuotaExceededError thrown");
is(audiosb.buffered.end(0), el.duration, "Duration is end of buffered range");
let seekTime = audiosb.buffered.end(0) / 2;
el.currentTime = seekTime;
once(el, 'seeked', () => {
is(el.currentTime, seekTime, "correctly seeked to " + seekTime);
try {
audiosb.appendBuffer(audioBuffer);
} catch(ex) {
ok(false, "Shouldn't throw another time when data can be evicted");
el.mozDumpDebugInfo();
SimpleTest.finish();
return;
}
once(audiosb, 'update', () => {
ok(true, "appendBuffer succeeded");
SimpleTest.finish();
});
let audiosb = ms.addSourceBuffer("audio/mp4");
audiosb.mode = "sequence";
fetchAndLoad(audiosb, 'bipbop/bipbop_audio', ['init'], '.mp4')
.then(function() {
fetchWithXHR('bipbop/bipbop_audio1.m4s', function(audioBuffer) {
fillUpSourceBuffer(audiosb,
function() { // doAppendDataFunc
audiosb.appendBuffer(audioBuffer);
},
function(ex) { // onCaughtExceptionCallback
is(ex.name, 'QuotaExceededError', "QuotaExceededError thrown");
is(audiosb.buffered.end(0), el.duration, "Duration is end of buffered range");
let seekTime = audiosb.buffered.end(0) / 2;
el.currentTime = seekTime;
once(el, 'seeked', () => {
dump("dump: seeked to " + seekTime);
is(el.currentTime, seekTime, "correctly seeked to " + seekTime);
try {
audiosb.appendBuffer(audioBuffer);
} catch(ex) {
ok(false, "Shouldn't throw another time when data can be evicted");
el.mozDumpDebugInfo();
SimpleTest.finish();
return;
}
once(audiosb, 'update', () => {
ok(true, "appendBuffer succeeded");
SimpleTest.finish();
});
});
});
});
});
});
});
});

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

@ -21,6 +21,9 @@ SimpleTest.waitForExplicitFinish();
// 6. Add 1.6s of data once video element fired waiting, that canplay is fired once readyState is HAVE_FUTURE_DATA.
// 7. Finally load data to the end and ensure that canplaythrough is fired and that readyState is now HAVE_ENOUGH_DATA
// FIXME: bug 1319293
addMSEPrefs(["media.dormant-on-pause-timeout-ms", -1]);
runWithMSE(function(ms, el) {
el.controls = true;
once(ms, 'sourceopen').then(function() {

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

@ -11,6 +11,9 @@
SimpleTest.waitForExplicitFinish();
// FIXME: bug 1319295
addMSEPrefs(["media.dormant-on-pause-timeout-ms", -1]);
var receivedSourceOpen = false;
runWithMSE(function(ms, v) {
ms.addEventListener("sourceopen", function() {

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

@ -791,6 +791,13 @@ function PeerConnectionWrapper(label, configuration) {
}
};
this._pc.onicegatheringstatechange = e => {
isnot(typeof this._pc.iceGatheringState, "undefined",
"iceGetheringState should not be undefined");
var gatheringState = this._pc.iceGatheringState;
info(this + ": onicegatheringstatechange fired, new state is: " + gatheringState);
};
createOneShotEventWrapper(this, this._pc, 'datachannel');
this._pc.addEventListener('datachannel', e => {
var wrapper = new DataChannelWrapper(e.channel, this);
@ -1284,11 +1291,8 @@ PeerConnectionWrapper.prototype = {
this._pc.onicecandidate = () =>
ok(false, this.label + " received ICE candidate after end of trickle");
info(this.label + ": received end of trickle ICE event");
/* Bug 1193731. Accroding to WebRTC spec 4.3.1 the ICE Agent first sets
* the gathering state to completed (step 3.) before sending out the
* null newCandidate in step 4. */
todo(this._pc.iceGatheringState === 'completed',
"ICE gathering state has reached completed");
ok(this._pc.iceGatheringState === 'complete',
"ICE gathering state has reached complete");
resolveEndOfTrickle(this.label);
return;
}

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

@ -352,7 +352,7 @@ UDPSocketParent::RecvOutgoingData(const UDPData& aData,
// Sending unallowed data, kill content.
if (NS_WARN_IF(NS_FAILED(rv)) || !allowed) {
return IPC_FAIL_NO_REASON(this);
return IPC_FAIL(this, "Content tried to send non STUN packet");
}
}

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

@ -61,23 +61,44 @@ run-sequentially = This will delete all existing push subscriptions.
[test_register_5xxCode_http2.js]
[test_updateRecordNoEncryptionKeys_http2.js]
[test_register_success_http2.js]
skip-if = !hasNode
# This used to be hasNode, but that caused too many issues with tests being
# silently disabled, so now we explicitly call out the platforms not known
# to have node installed.
skip-if = os == "android"
run-sequentially = node server exceptions dont replay well
[test_register_error_http2.js]
skip-if = !hasNode
# This used to be hasNode, but that caused too many issues with tests being
# silently disabled, so now we explicitly call out the platforms not known
# to have node installed.
skip-if = os == "android"
run-sequentially = node server exceptions dont replay well
[test_unregister_success_http2.js]
skip-if = !hasNode
# This used to be hasNode, but that caused too many issues with tests being
# silently disabled, so now we explicitly call out the platforms not known
# to have node installed.
skip-if = os == "android"
run-sequentially = node server exceptions dont replay well
[test_notification_http2.js]
skip-if = !hasNode
# This used to be hasNode, but that caused too many issues with tests being
# silently disabled, so now we explicitly call out the platforms not known
# to have node installed.
skip-if = os == "android"
run-sequentially = node server exceptions dont replay well
[test_registration_success_http2.js]
skip-if = !hasNode
# This used to be hasNode, but that caused too many issues with tests being
# silently disabled, so now we explicitly call out the platforms not known
# to have node installed.
skip-if = os == "android"
run-sequentially = node server exceptions dont replay well
[test_registration_error_http2.js]
skip-if = !hasNode
# This used to be hasNode, but that caused too many issues with tests being
# silently disabled, so now we explicitly call out the platforms not known
# to have node installed.
skip-if = os == "android"
run-sequentially = node server exceptions dont replay well
[test_clearAll_successful.js]
skip-if = !hasNode
# This used to be hasNode, but that caused too many issues with tests being
# silently disabled, so now we explicitly call out the platforms not known
# to have node installed.
skip-if = os == "android"
run-sequentially = This will delete all existing push subscriptions.

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

@ -780,21 +780,21 @@ var interfaceNamesInGlobalScope =
{name: "PresentationDeviceInfoManager",
disabled: true},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "Presentation", disabled: true},
{name: "Presentation", desktop: false, release: false },
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "PresentationAvailability", disabled: true},
{name: "PresentationAvailability", desktop: false, release: false },
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "PresentationConnection", disabled: true},
{name: "PresentationConnection", desktop: false, release: false},
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "PresentationConnectionAvailableEvent", disabled: true},
{name: "PresentationConnectionAvailableEvent", desktop: false, release: false },
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "PresentationConnectionClosedEvent", disabled: true},
{name: "PresentationConnectionCloseEvent", desktop: false, release: false },
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "PresentationConnectionList", disabled: true},
{name: "PresentationConnectionList", desktop: false, release: false },
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "PresentationReceiver", disabled: true},
{name: "PresentationReceiver", desktop: false, release: false },
// IMPORTANT: Do not change this list without review from a DOM peer!
{name: "PresentationRequest", disabled: true},
{name: "PresentationRequest", desktop: false, release: false },
// IMPORTANT: Do not change this list without review from a DOM peer!
"ProcessingInstruction",
// IMPORTANT: Do not change this list without review from a DOM peer!

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

@ -146,6 +146,7 @@ interface RTCPeerConnection : EventTarget {
attribute EventHandler ontrack; // replaces onaddtrack and onaddstream.
attribute EventHandler onremovestream;
attribute EventHandler oniceconnectionstatechange;
attribute EventHandler onicegatheringstatechange;
Promise<RTCStatsReport> getStats (optional MediaStreamTrack? selector);

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

@ -770,7 +770,10 @@ Factory::CreateWrappingDataSourceSurface(uint8_t *aData,
SourceSurfaceDeallocator aDeallocator /* = nullptr */,
void* aClosure /* = nullptr */)
{
if (!AllowedSurfaceSize(aSize)) {
// Just check for negative/zero size instead of the full AllowedSurfaceSize() - since
// the data is already allocated we do not need to check for a possible overflow - it
// already worked.
if (aSize.width <= 0 || aSize.height <= 0) {
return nullptr;
}
if (!aDeallocator && aClosure) {

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

@ -240,11 +240,10 @@ NS_IMETHODIMP nsTextToSubURI::UnEscapeURIForUI(const nsACString & aCharset,
nsresult rv = mozilla::Preferences::GetString("network.IDN.blacklist_chars",
&blacklist);
if (NS_SUCCEEDED(rv)) {
nsAString& chars = blacklist;
// we allow SPACE and IDEOGRAPHIC SPACE in this method
chars.StripChars(u" \u3000");
mUnsafeChars.AppendElements(static_cast<const char16_t*>(chars.Data()),
chars.Length());
blacklist.StripChars(u" \u3000");
mUnsafeChars.AppendElements(static_cast<const char16_t*>(blacklist.Data()),
blacklist.Length());
} else {
NS_WARNING("Failed to get the 'network.IDN.blacklist_chars' preference");
}

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

@ -22,9 +22,17 @@
// This macro checks that the _EVENT_SIZEOF_* constants defined in
// ipc/chromiume/src/third_party/<platform>/event2/event-config.h are correct.
#if defined(_EVENT_SIZEOF_SHORT)
#define CHECK_EVENT_SIZEOF(TYPE, type) \
static_assert(_EVENT_SIZEOF_##TYPE == sizeof(type), \
"bad _EVENT_SIZEOF_"#TYPE);
#elif defined(EVENT__SIZEOF_SHORT)
#define CHECK_EVENT_SIZEOF(TYPE, type) \
static_assert(EVENT__SIZEOF_##TYPE == sizeof(type), \
"bad EVENT__SIZEOF_"#TYPE);
#else
#error Cannot find libevent type sizes
#endif
CHECK_EVENT_SIZEOF(LONG, long);
CHECK_EVENT_SIZEOF(LONG_LONG, long long);

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

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<table><tbody></tbody><tfoot></tfoot></table>
<script>
document.body.offsetTop;
let parent = document.querySelector("table");
let comment = document.createComment("hello");
let footer = document.querySelector("tfoot");
parent.insertBefore(comment, footer);
</script>

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

@ -0,0 +1,10 @@
<!DOCTYPE html>
<html>
<table><tbody></tbody><tfoot></tfoot></table>
<script>
document.body.offsetTop;
let parent = document.querySelector("table");
let pi = document.createProcessingInstruction('xml-stylesheet', 'href="test.css"');
let footer = document.querySelector("tfoot");
parent.insertBefore(pi, footer);
</script>

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

@ -480,3 +480,5 @@ load 1297835.html
load 1288608.html
load 1299736-1.html
load 1308793.svg
load 1308848-1.html
load 1308848-2.html

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

@ -6564,6 +6564,12 @@ nsCSSFrameConstructor::IsValidSibling(nsIFrame* aSibling,
NS_NOTREACHED("Shouldn't happen");
return false;
}
if (aContent->IsNodeOfType(nsINode::eCOMMENT) ||
aContent->IsNodeOfType(nsINode::ePROCESSING_INSTRUCTION)) {
// Comments and processing instructions never have frames, so we
// should not try to generate style contexts for them.
return false;
}
// XXXbz when this code is killed, the state argument to
// ResolveStyleContext can be made non-optional.
RefPtr<nsStyleContext> styleContext =

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

@ -18,62 +18,6 @@
using namespace mozilla;
using namespace mozilla::gfx;
static void
PaintCheckMark(nsIFrame* aFrame,
DrawTarget* aDrawTarget,
const nsRect& aDirtyRect,
nsPoint aPt)
{
nsRect rect(aPt, aFrame->GetSize());
rect.Deflate(aFrame->GetUsedBorderAndPadding());
// Points come from the coordinates on a 7X7 unit box centered at 0,0
const int32_t checkPolygonX[] = { -3, -1, 3, 3, -1, -3 };
const int32_t checkPolygonY[] = { -1, 1, -3, -1, 3, 1 };
const int32_t checkNumPoints = sizeof(checkPolygonX) / sizeof(int32_t);
const int32_t checkSize = 9; // 2 units of padding on either side
// of the 7x7 unit checkmark
// Scale the checkmark based on the smallest dimension
nscoord paintScale = std::min(rect.width, rect.height) / checkSize;
nsPoint paintCenter(rect.x + rect.width / 2,
rect.y + rect.height / 2);
RefPtr<PathBuilder> builder = aDrawTarget->CreatePathBuilder();
nsPoint p = paintCenter + nsPoint(checkPolygonX[0] * paintScale,
checkPolygonY[0] * paintScale);
int32_t appUnitsPerDevPixel = aFrame->PresContext()->AppUnitsPerDevPixel();
builder->MoveTo(NSPointToPoint(p, appUnitsPerDevPixel));
for (int32_t polyIndex = 1; polyIndex < checkNumPoints; polyIndex++) {
p = paintCenter + nsPoint(checkPolygonX[polyIndex] * paintScale,
checkPolygonY[polyIndex] * paintScale);
builder->LineTo(NSPointToPoint(p, appUnitsPerDevPixel));
}
RefPtr<Path> path = builder->Finish();
aDrawTarget->Fill(path,
ColorPattern(ToDeviceColor(aFrame->StyleColor()->mColor)));
}
static void
PaintIndeterminateMark(nsIFrame* aFrame,
DrawTarget* aDrawTarget,
const nsRect& aDirtyRect,
nsPoint aPt)
{
int32_t appUnitsPerDevPixel = aFrame->PresContext()->AppUnitsPerDevPixel();
nsRect rect(aPt, aFrame->GetSize());
rect.Deflate(aFrame->GetUsedBorderAndPadding());
rect.y += (rect.height - rect.height/4) / 2;
rect.height /= 4;
Rect devPxRect = NSRectToSnappedRect(rect, appUnitsPerDevPixel, *aDrawTarget);
aDrawTarget->FillRect(
devPxRect, ColorPattern(ToDeviceColor(aFrame->StyleColor()->mColor)));
}
//------------------------------------------------------------
nsIFrame*
NS_NewGfxCheckboxControlFrame(nsIPresShell* aPresShell,
@ -104,29 +48,6 @@ nsGfxCheckboxControlFrame::AccessibleType()
}
#endif
//------------------------------------------------------------
void
nsGfxCheckboxControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsFormControlFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
// Get current checked state through content model.
if ((!IsChecked() && !IsIndeterminate()) || !IsVisibleForPainting(aBuilder))
return; // we're not checked or not visible, nothing to paint.
if (IsThemed())
return; // No need to paint the checkmark. The theme will do it.
aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(aBuilder, this,
IsIndeterminate()
? PaintIndeterminateMark : PaintCheckMark,
"CheckedCheckbox",
nsDisplayItem::TYPE_CHECKED_CHECKBOX));
}
//------------------------------------------------------------
bool
nsGfxCheckboxControlFrame::IsChecked()

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

@ -22,10 +22,6 @@ public:
}
#endif
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
#ifdef ACCESSIBILITY
virtual mozilla::a11y::AccType AccessibleType() override;
#endif

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

@ -40,54 +40,3 @@ nsGfxRadioControlFrame::AccessibleType()
return a11y::eHTMLRadioButtonType;
}
#endif
//--------------------------------------------------------------
// Draw the dot for a non-native radio button in the checked state.
static void
PaintCheckedRadioButton(nsIFrame* aFrame,
DrawTarget* aDrawTarget,
const nsRect& aDirtyRect,
nsPoint aPt)
{
// The dot is an ellipse 2px on all sides smaller than the content-box,
// drawn in the foreground color.
nsRect rect(aPt, aFrame->GetSize());
rect.Deflate(aFrame->GetUsedBorderAndPadding());
rect.Deflate(nsPresContext::CSSPixelsToAppUnits(2),
nsPresContext::CSSPixelsToAppUnits(2));
Rect devPxRect =
ToRect(nsLayoutUtils::RectToGfxRect(rect,
aFrame->PresContext()->AppUnitsPerDevPixel()));
ColorPattern color(ToDeviceColor(aFrame->StyleColor()->mColor));
RefPtr<PathBuilder> builder = aDrawTarget->CreatePathBuilder();
AppendEllipseToPath(builder, devPxRect.Center(), devPxRect.Size());
RefPtr<Path> ellipse = builder->Finish();
aDrawTarget->Fill(ellipse, color);
}
void
nsGfxRadioControlFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
nsFormControlFrame::BuildDisplayList(aBuilder, aDirtyRect, aLists);
if (!IsVisibleForPainting(aBuilder))
return;
if (IsThemed())
return; // The theme will paint the check, if any.
bool checked = true;
GetCurrentCheckState(&checked); // Get check state from the content model
if (!checked)
return;
aLists.Content()->AppendNewToTop(new (aBuilder)
nsDisplayGeneric(aBuilder, this, PaintCheckedRadioButton,
"CheckedRadioButton",
nsDisplayItem::TYPE_CHECKED_RADIOBUTTON));
}

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

@ -23,10 +23,6 @@ public:
#ifdef ACCESSIBILITY
virtual mozilla::a11y::AccType AccessibleType() override;
#endif
virtual void BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists) override;
};
#endif

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

@ -65,7 +65,7 @@ fuzzy(116,94) fuzzy-if(skiaContent&&dwrite,119,124) HTTP(..) == 1115916-1-vertic
skip-if(Android||(winWidget&&!/^Windows\x20NT\x205\.1/.test(http.oscpu))) == ua-style-sheet-textarea-1.html ua-style-sheet-textarea-1a-ref.html
skip-if(!(Android)) == ua-style-sheet-textarea-1.html ua-style-sheet-textarea-1b-ref.html
skip-if(!winWidget||/^Windows\x20NT\x205\.1/.test(http.oscpu)) == ua-style-sheet-textarea-1.html ua-style-sheet-textarea-1c-ref.html
== ua-style-sheet-checkbox-radio-1.html ua-style-sheet-checkbox-radio-1-ref.html
fuzzy-if(Android,1,15) == ua-style-sheet-checkbox-radio-1.html ua-style-sheet-checkbox-radio-1-ref.html
skip-if(Android) fuzzy-if(skiaContent&&!Android,2,6) == ua-style-sheet-button-1.html ua-style-sheet-button-1a-ref.html
skip-if(!(Android)) == ua-style-sheet-button-1.html ua-style-sheet-button-1b-ref.html
== ua-style-sheet-input-color-1.html ua-style-sheet-input-color-1-ref.html

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

@ -1590,7 +1590,7 @@ Declaration::AppendPropertyAndValueToString(nsCSSPropertyID aProperty,
else
aResult.Append(aValue);
if (GetPropertyIsImportantByID(aProperty)) {
aResult.AppendLiteral(" ! important");
aResult.AppendLiteral(" !important");
}
aResult.AppendLiteral("; ");
}
@ -1643,7 +1643,7 @@ Declaration::AppendVariableAndValueToString(const nsAString& aName,
}
if (important) {
aResult.AppendLiteral("! important");
aResult.AppendLiteral("!important");
}
aResult.AppendLiteral("; ");
}

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

@ -0,0 +1,20 @@
<!doctype html>
<html class="reftest-wait">
<title>Interpolation of decomposed matrices</title>
<style>
#target {
width: 100px; height: 100px;
background: blue;
animation: anim 0.1s cubic-bezier(0,1.5,1,1.5);
}
@keyframes anim {
from { transform: matrix(1, 0, 0, 1, 100, 200); }
to { transform: matrix(1, 0, 0, 1, 200, 100); }
}
</style>
<div id="target"></div>
<script>
document.getElementById("target").addEventListener("animationend", () => {
document.documentElement.classList.remove("reftest-wait");
}, false);
</script>

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