Merge mozilla-central to inbound. a=merge CLOSED TREE

This commit is contained in:
Margareta Eliza Balazs 2018-07-18 12:42:29 +03:00
Родитель 56d700c398 fb3762edac
Коммит 42e6813f3f
48 изменённых файлов: 835 добавлений и 370 удалений

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

@ -120,16 +120,12 @@ let propNameWhitelist = [
platforms: ["win", "macosx"],
isFromDevTools: false},
// These properties *are* actually referenced. Need to find why
// their reference isn't getting counted.
// These variables are used in a shorthand, but the CSS parser deletes the values
// when expanding the shorthands. See https://github.com/w3c/csswg-drafts/issues/2515
{propName: "--bezier-diagonal-color",
isFromDevTools: true},
{propName: "--bezier-grid-color",
isFromDevTools: true},
// Bug 1476322 - Doesn't parse CSSKeyframeRules
{propName: "--tracking-protection-shield-color",
isFromDevTools: false},
];
// Add suffix to stylesheets' URI so that we always load them here and
@ -256,15 +252,15 @@ let customPropsToReferencesMap = new Map();
function processCSSRules(sheet) {
for (let rule of sheet.cssRules) {
if (rule instanceof CSSMediaRule) {
if (rule instanceof CSSConditionRule || rule instanceof CSSKeyframesRule) {
processCSSRules(rule);
continue;
}
if (!(rule instanceof CSSStyleRule))
if (!(rule instanceof CSSStyleRule) && !(rule instanceof CSSKeyframeRule))
continue;
// Extract urls from the css text.
// Note: CSSStyleRule.cssText always has double quotes around URLs even
// Note: CSSRule.cssText always has double quotes around URLs even
// when the original CSS file didn't.
let urls = rule.cssText.match(/url\("[^"]*"\)/g);
// Extract props by searching all "--" preceeded by "var(" or a non-word

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

@ -458,14 +458,7 @@ this.browserAction = class extends ExtensionAPI {
node.removeAttribute("badgeStyle");
}
let {style, legacy} = this.iconData.get(tabData.icon);
const LEGACY_CLASS = "toolbarbutton-legacy-addon";
if (legacy) {
node.classList.add(LEGACY_CLASS);
} else {
node.classList.remove(LEGACY_CLASS);
}
let style = this.iconData.get(tabData.icon);
node.setAttribute("style", style);
};
if (sync) {
@ -476,47 +469,30 @@ this.browserAction = class extends ExtensionAPI {
}
getIconData(icons) {
let baseSize = 16;
let {icon, size} = IconDetails.getPreferredIcon(icons, this.extension, baseSize);
let legacy = false;
// If the best available icon size is not divisible by 16, check if we have
// an 18px icon to fall back to, and trim off the padding instead.
if (size % 16 && typeof icon === "string" && !icon.endsWith(".svg")) {
let result = IconDetails.getPreferredIcon(icons, this.extension, 18);
if (result.size % 18 == 0) {
baseSize = 18;
icon = result.icon;
legacy = true;
}
}
let getIcon = (size, theme) => {
let {icon} = IconDetails.getPreferredIcon(icons, this.extension, size);
let getIcon = (icon, theme) => {
if (typeof icon === "object") {
return IconDetails.escapeUrl(icon[theme]);
}
return IconDetails.escapeUrl(icon);
};
let getStyle = (name, size) => {
let getStyle = (name, icon) => {
return `
--webextension-${name}: url("${getIcon(size, "default")}");
--webextension-${name}-light: url("${getIcon(size, "light")}");
--webextension-${name}-dark: url("${getIcon(size, "dark")}");
--webextension-${name}: url("${getIcon(icon, "default")}");
--webextension-${name}-light: url("${getIcon(icon, "light")}");
--webextension-${name}-dark: url("${getIcon(icon, "dark")}");
`;
};
let style = `
${getStyle("menupanel-image", 32)}
${getStyle("menupanel-image-2x", 64)}
${getStyle("toolbar-image", baseSize)}
${getStyle("toolbar-image-2x", baseSize * 2)}
let icon16 = IconDetails.getPreferredIcon(icons, this.extension, 16).icon;
let icon32 = IconDetails.getPreferredIcon(icons, this.extension, 32).icon;
let icon64 = IconDetails.getPreferredIcon(icons, this.extension, 64).icon;
return `
${getStyle("menupanel-image", icon32)}
${getStyle("menupanel-image-2x", icon64)}
${getStyle("toolbar-image", icon16)}
${getStyle("toolbar-image-2x", icon32)}
`;
return {style, legacy};
}
/**

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

@ -111,7 +111,6 @@ add_task(async function testDetailsObjects() {
// Various resolutions
{details: {"path": {"18": "a.png", "36": "a-x2.png"}},
legacy: true,
resolutions: {
"1": browser.runtime.getURL("data/a.png"),
"2": browser.runtime.getURL("data/a-x2.png")}},
@ -139,7 +138,6 @@ add_task(async function testDetailsObjects() {
"36": "36.png",
"48": "48.png",
"128": "128.png"}},
legacy: true,
resolutions: {
"1": browser.runtime.getURL("data/18.png"),
"2": browser.runtime.getURL("data/36.png")},
@ -206,7 +204,6 @@ add_task(async function testDetailsObjects() {
for (let [idx, icon] of iconDetails.entries()) {
tests.push({
index: idx,
legacy: !!icon.legacy,
menuResolutions: icon.menuResolutions,
resolutions: icon.resolutions,
});
@ -289,9 +286,6 @@ add_task(async function testDetailsObjects() {
is(getListStyleImage(browserActionButton), imageURL, `browser action has the correct image at ${resolution}x resolution`);
is(getListStyleImage(pageActionImage), imageURL, `page action has the correct image at ${resolution}x resolution`);
let isLegacy = browserActionButton.classList.contains("toolbarbutton-legacy-addon");
is(isLegacy, test.legacy, "Legacy class should be present?");
await SpecialPowers.popPrefEnv();
}

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

@ -7,7 +7,7 @@
<Description>Chambers 21st Century Dictionary Search</Description>
<InputEncoding>UTF-8</InputEncoding>
<Image width="16" height="16">data:image/x-icon;base64,AAABAAIAICAAAAEAIAAsAwAAJgAAABAQAAABACAAPwIAAFIDAACJUE5HDQoaCgAAAA1JSERSAAAAIAAAACAIBgAAAHN6evQAAALzSURBVFiF7ddNqBVlHMfxz5nqHpN8y7DyqjTYG2RwQWKCW5uiRRD2CkGbIl1IOxdBGFKgQRgkWC2iRUG1bBG0iUyCopgKJSyNskYjKiz0Kr1crzanxfMYc+fOOZ5z4tQi/6vhef7z/L4zz8v/9/B/j9agL+RJmuAiLMHF8fk3HMWvOJ6VxalKfgttzGRlUQ4NkCfpJbgFt+J6LMeCOPjJKD6Fb7APu7EHV2MLHs/K4ouBAfIknY97sRFrMYaf8DE+ww9YEaHWRrAEJ5Cjg5uxLiuLXfXxzz+L+DiexAOYH7/0ZezEl1lZnKzkjuHKmLsBl+K22N3BqiaNrgB5kq7E87gjftEMnsXTWVmcqOdnZTGD/XmSPoH38AwmYnerm1bSRXwxtlfE4U1sbxKvgfwZf/V6fF7purwvgLjKN+KeSv9RPJeVxVQv8RrIHjyGI7FpvC8ArIkAY5W2D/Bpv+KVeBuvoMSKPEnbPQHi1z9o9oLpYFdWFn8Mqp6VxWm8hINYink9AYQtdLvZ23Ma+wcVr8S3eEc4tBacDeAGrK61TeH7YdXj6fcCNuHnen99a9xo9twTtt/0sAAR4gAONPX9/Qfi/F/2T4SGieoUtLHyvwTodlq1ceG/AdDBqYacRUKxGTnANL5ryJmHa0YOkJVFB4caclq4KU/SC0YKEOMj/N6QN2nu+TASgL2a9+s47oz2aqQAv+AtoXjU8x425FrIk7SVJ+lknqRX9ASI6+B1fN0wzlXYHL3CoDEpOKm7egLEOIgd5q6FFu7HtjxJl/WjmifpWJ6k6/Ci4B3fqOc0zmk0ok/hEXNrw2m8i634JFqxpvcn8JBgaA9hQ1YWe/sCiIMsxOYIMaeMCk5nt2BWvoptqwQbPiE45CV4H5uaxHsCRIg27sOjglM6ryGtI7hlwrF9ZsxjeE3wkV3LeT/3gpZQpO4WfOJ1WNwFZgY/Cn/mVXxYte5DAdRgFgoH0rVCjViOZcKtqBAW2j4crl7PzkWv+AufXtBu3nNrKQAAAABJRU5ErkJggolQTkcNChoKAAAADUlIRFIAAAAQAAAAEAgGAAAAH/P/YQAAAgZJREFUOI2Nk7FrU1EUxn/n3PdSFYOCowX7koY4FAdbkUKFig5OIojF1UVwFbcKxsH/QF3sII4RRJwEhSpoadJYHSpYrEYDIlSDUCvSJu8eh7ynaQziN9zpnu9+3+/eC10ykDI4/k/ye0mHBQxgkWhfSzkpWM6QQLB1RJcs3nhohIUMwbuDrHwxEO0drmp0eVNZwuyEiCya2GMPP73ZNTSzrCr3Nmnn+6ao6NDNuhasqtH13rzPKGbnJXr0WvNWIToCUAanZVCAqsud24W7sEr7g3qZBqgxGhpojdFwguXvmDu9jm+YkwLAmdR9jsHtFY1evdVhq2h0O3XvTlBjNOykzF2s6NCVdE/QYRAeAkY2MAwa/ZCP8aIFYF5nMrR2AkyBDwBCZ7nA1FnnPtpb4nWpA3tlDVhL2FkngbEtJSmwG+BuHwMBsz/kDRKAJnyOMTwGJgeSBL5flV4pQBDryxhrtjvW48/JjwjYLJNBTwUnYMnpAqAGOsb7Bsj9AYQQ2RGqTQMc5Um7DM6SgwTiOQb3LrjoPGmFq6m7d6Uf+HoGQbGz8xrdeEMxOwWxJHWqQe6Yk+COh28AJVBJoqmAXyAqesfMgMlEFqVJ/BXjqSFqYvsFAi9cGo/rD0qgJfDdn0kFvDEZ1NzHU97kOGbDCHswVk1sVnzr1mE+NdO9fxFNu/5LvS/0F8COyR9a0q7OAAAAAElFTkSuQmCC</Image>
<Url type="text/html" method="GET" template="http://www.chambers.co.uk/search/" resultdomain="chambers.co.uk" rel="searchform">
<Url type="text/html" method="GET" template="https://chambers.co.uk/search/" resultdomain="chambers.co.uk" rel="searchform">
<Param name="query" value="{searchTerms}"/>
<Param name="title" value="21st"/>
<Param name="sourceid" value="Mozilla-search"/>

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

@ -51,6 +51,7 @@
function MenuItem({
accelerator = null,
accesskey = null,
l10nID = null,
checked = false,
click = () => {},
disabled = false,
@ -63,6 +64,7 @@ function MenuItem({
} = { }) {
this.accelerator = accelerator;
this.accesskey = accesskey;
this.l10nID = l10nID;
this.checked = checked;
this.click = click;
this.disabled = disabled;

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

@ -136,26 +136,15 @@ Menu.prototype._createMenuItems = function(parent) {
const menu = doc.createElementNS(XUL_NS, "menu");
menu.appendChild(menupopup);
menu.setAttribute("label", item.label);
if (item.disabled) {
menu.setAttribute("disabled", "true");
}
if (item.accelerator) {
menu.setAttribute("acceltext", item.accelerator);
}
if (item.accesskey) {
menu.setAttribute("accesskey", item.accesskey);
}
if (item.id) {
menu.id = item.id;
}
applyItemAttributesToNode(item, menu);
parent.appendChild(menu);
} else if (item.type === "separator") {
const menusep = doc.createElementNS(XUL_NS, "menuseparator");
parent.appendChild(menusep);
} else {
const menuitem = doc.createElementNS(XUL_NS, "menuitem");
menuitem.setAttribute("label", item.label);
applyItemAttributesToNode(item, menuitem);
menuitem.addEventListener("command", () => {
item.click();
});
@ -163,28 +152,6 @@ Menu.prototype._createMenuItems = function(parent) {
item.hover();
});
if (item.type === "checkbox") {
menuitem.setAttribute("type", "checkbox");
}
if (item.type === "radio") {
menuitem.setAttribute("type", "radio");
}
if (item.disabled) {
menuitem.setAttribute("disabled", "true");
}
if (item.checked) {
menuitem.setAttribute("checked", "true");
}
if (item.accelerator) {
menuitem.setAttribute("acceltext", item.accelerator);
}
if (item.accesskey) {
menuitem.setAttribute("accesskey", item.accesskey);
}
if (item.id) {
menuitem.id = item.id;
}
parent.appendChild(menuitem);
}
});
@ -202,4 +169,33 @@ Menu.buildFromTemplate = () => {
throw Error("Not implemented");
};
function applyItemAttributesToNode(item, node) {
if (item.l10nID) {
node.setAttribute("data-l10n-id", item.l10nID);
} else {
node.setAttribute("label", item.label);
if (item.accelerator) {
node.setAttribute("acceltext", item.accelerator);
}
if (item.accesskey) {
node.setAttribute("accesskey", item.accesskey);
}
}
if (item.type === "checkbox") {
node.setAttribute("type", "checkbox");
}
if (item.type === "radio") {
node.setAttribute("type", "radio");
}
if (item.disabled) {
node.setAttribute("disabled", "true");
}
if (item.checked) {
node.setAttribute("checked", "true");
}
if (item.id) {
node.id = item.id;
}
}
module.exports = Menu;

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

@ -65,6 +65,9 @@ async function testMenuPopup(toolbox) {
label: "Disabled Item",
disabled: true,
}),
new MenuItem({
l10nID: "foo",
}),
];
for (const item of MENU_ITEMS) {
@ -102,6 +105,8 @@ async function testMenuPopup(toolbox) {
is(menuItems[3].getAttribute("label"), MENU_ITEMS[3].label, "Correct label");
is(menuItems[3].getAttribute("disabled"), "true", "disabled attr menuitem");
is(menuItems[4].getAttribute("data-l10n-id"), MENU_ITEMS[4].l10nID, "Correct localization attribute");
await once(menu, "open");
const closed = once(menu, "close");
EventUtils.synthesizeMouseAtCenter(menuItems[0], {}, toolbox.win);
@ -127,7 +132,7 @@ async function testSubmenu(toolbox) {
},
}));
menu.append(new MenuItem({
label: "Submenu parent",
l10nID: "submenu-parent",
submenu: submenu,
}));
menu.append(new MenuItem({
@ -145,8 +150,9 @@ async function testSubmenu(toolbox) {
const menus = toolbox.doc.querySelectorAll("#menu-popup > menu");
is(menus.length, 2, "Correct number of menus");
is(menus[0].getAttribute("label"), "Submenu parent", "Correct label");
ok(!menus[0].hasAttribute("label"), "No label: should be set by localization");
ok(!menus[0].hasAttribute("disabled"), "Correct disabled state");
is(menus[0].getAttribute("data-l10n-id"), "submenu-parent", "Correct localization attribute");
is(menus[1].getAttribute("accesskey"), "A", "Correct accesskey");
ok(menus[1].hasAttribute("disabled"), "Correct disabled state");

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

@ -178,8 +178,6 @@ class FontInspector {
let out = value;
// Computed style for reference node used for conversion of "em", "rem", "%".
let computedStyle;
// Raw DOM node of selected element used for conversion of "vh", "vw", "vmin", "vmax".
let rawNode;
if (unit === "in") {
out = fromPx
@ -233,36 +231,31 @@ class FontInspector {
: value * parseFloat(computedStyle["font-size"].value);
}
if (unit === "vh") {
rawNode = await node.rawNode();
out = fromPx
? value * 100 / rawNode.ownerGlobal.innerHeight
: value / 100 * rawNode.ownerGlobal.innerHeight;
}
if (unit === "vh" || unit === "vw" || unit === "vmin" || unit === "vmax") {
const dim = await node.getOwnerGlobalDimensions();
if (unit === "vw") {
rawNode = await node.rawNode();
out = fromPx
? value * 100 / rawNode.ownerGlobal.innerWidth
: value / 100 * rawNode.ownerGlobal.innerWidth;
}
if (unit === "vmin") {
rawNode = await node.rawNode();
out = fromPx
? value * 100 / Math.min(
rawNode.ownerGlobal.innerWidth, rawNode.ownerGlobal.innerHeight)
: value / 100 * Math.min(
rawNode.ownerGlobal.innerWidth, rawNode.ownerGlobal.innerHeight);
}
if (unit === "vmax") {
rawNode = await node.rawNode();
out = fromPx
? value * 100 / Math.max(
rawNode.ownerGlobal.innerWidth, rawNode.ownerGlobal.innerHeight)
: value / 100 * Math.max(
rawNode.ownerGlobal.innerWidth, rawNode.ownerGlobal.innerHeight);
// The getOwnerGlobalDimensions() method does not exist on the NodeFront API spec
// prior to Firefox 63. In that case, return a 1-to-1 conversion which isn't a
// correct conversion, but doesn't break the font editor either.
if (!dim || !dim.innerWidth || !dim.innerHeight) {
out = value;
} else if (unit === "vh") {
out = fromPx
? value * 100 / dim.innerHeight
: value / 100 * dim.innerHeight;
} else if (unit === "vw") {
out = fromPx
? value * 100 / dim.innerWidth
: value / 100 * dim.innerWidth;
} else if (unit === "vmin") {
out = fromPx
? value * 100 / Math.min(dim.innerWidth, dim.innerHeight)
: value / 100 * Math.min(dim.innerWidth, dim.innerHeight);
} else if (unit === "vmax") {
out = fromPx
? value * 100 / Math.max(dim.innerWidth, dim.innerHeight)
: value / 100 * Math.max(dim.innerWidth, dim.innerHeight);
}
}
// Return rounded pixel values. Limit other values to 3 decimals.
@ -728,12 +721,8 @@ class FontInspector {
let unit = fromUnit;
if (toUnit && fromUnit) {
try {
value = await this.convertUnits(value, fromUnit, toUnit);
unit = toUnit;
} catch (err) {
// Silent error
}
value = await this.convertUnits(value, fromUnit, toUnit);
unit = toUnit;
}
this.onFontPropertyUpdate(property, value, unit);

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

@ -11,6 +11,8 @@
windowtype="devtools:webconsole"
width="900" height="350"
persist="screenX screenY width height sizemode">
<link rel="localization" href="toolkit/main-window/editmenu.ftl"/>
<script type="text/javascript" src="chrome://global/content/l10n.js"></script>
<popupset></popupset>
<iframe src="index.html" flex="1"></iframe>
</window>

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

@ -163,6 +163,7 @@ class App extends Component {
}),
JSTerm({
hud,
serviceContainer,
onPaste: this.onPaste,
codeMirrorEnabled: jstermCodeMirror,
}),

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

@ -70,6 +70,8 @@ class JSTerm extends Component {
history: PropTypes.object.isRequired,
// Console object.
hud: PropTypes.object.isRequired,
// Needed for opening context menu
serviceContainer: PropTypes.object.isRequired,
// Handler for clipboard 'paste' event (also used for 'drop' event, callback).
onPaste: PropTypes.func,
codeMirrorEnabled: PropTypes.bool,
@ -97,6 +99,7 @@ class JSTerm extends Component {
this._keyPress = this._keyPress.bind(this);
this._inputEventHandler = this._inputEventHandler.bind(this);
this._blurEventHandler = this._blurEventHandler.bind(this);
this.onContextMenu = this.onContextMenu.bind(this);
this.SELECTED_FRAME = -1;
@ -129,14 +132,6 @@ class JSTerm extends Component {
*/
this.lastInputValue = "";
/**
* Tells if the autocomplete popup was navigated since the last open.
*
* @private
* @type boolean
*/
this._autocompletePopupNavigated = false;
this.autocompletePopup = null;
this.inputNode = null;
this.completeNode = null;
@ -192,9 +187,9 @@ class JSTerm extends Component {
return "CodeMirror.Pass";
}
if (this._autocompletePopupNavigated &&
this.autocompletePopup.isOpen &&
this.autocompletePopup.selectedIndex > -1
if (
this.autocompletePopup.isOpen
&& this.autocompletePopup.selectedIndex > -1
) {
return this.acceptProposedCompletion();
}
@ -231,9 +226,6 @@ class JSTerm extends Component {
let inputUpdated;
if (this.autocompletePopup.isOpen) {
inputUpdated = this.complete(this.COMPLETE_BACKWARD);
if (inputUpdated) {
this._autocompletePopupNavigated = true;
}
} else if (this.canCaretGoPrevious()) {
inputUpdated = this.historyPeruse(HISTORY_BACK);
}
@ -248,9 +240,6 @@ class JSTerm extends Component {
let inputUpdated;
if (this.autocompletePopup.isOpen) {
inputUpdated = this.complete(this.COMPLETE_FORWARD);
if (inputUpdated) {
this._autocompletePopupNavigated = true;
}
} else if (this.canCaretGoNext()) {
inputUpdated = this.historyPeruse(HISTORY_FORWARD);
}
@ -271,12 +260,9 @@ class JSTerm extends Component {
"Right": () => {
const haveSuggestion =
this.autocompletePopup.isOpen || this.lastCompletion.value;
const useCompletion =
this.canCaretGoNext() || this._autocompletePopupNavigated;
if (
haveSuggestion &&
useCompletion &&
this.complete(this.COMPLETE_HINT_ONLY) &&
this.lastCompletion.value &&
this.acceptProposedCompletion()
@ -334,9 +320,7 @@ class JSTerm extends Component {
"PageUp": () => {
if (this.autocompletePopup.isOpen) {
if (this.complete(this.COMPLETE_PAGEUP)) {
this._autocompletePopupNavigated = true;
}
this.complete(this.COMPLETE_PAGEUP);
return null;
}
@ -345,9 +329,7 @@ class JSTerm extends Component {
"PageDown": () => {
if (this.autocompletePopup.isOpen) {
if (this.complete(this.COMPLETE_PAGEDOWN)) {
this._autocompletePopupNavigated = true;
}
this.complete(this.COMPLETE_PAGEDOWN);
return null;
}
@ -845,7 +827,7 @@ class JSTerm extends Component {
break;
case KeyCodes.DOM_VK_RETURN:
if (this._autocompletePopupNavigated &&
if (
this.autocompletePopup.isOpen &&
this.autocompletePopup.selectedIndex > -1) {
this.acceptProposedCompletion();
@ -858,9 +840,6 @@ class JSTerm extends Component {
case KeyCodes.DOM_VK_UP:
if (this.autocompletePopup.isOpen) {
inputUpdated = this.complete(this.COMPLETE_BACKWARD);
if (inputUpdated) {
this._autocompletePopupNavigated = true;
}
} else if (this.canCaretGoPrevious()) {
inputUpdated = this.historyPeruse(HISTORY_BACK);
}
@ -872,9 +851,6 @@ class JSTerm extends Component {
case KeyCodes.DOM_VK_DOWN:
if (this.autocompletePopup.isOpen) {
inputUpdated = this.complete(this.COMPLETE_FORWARD);
if (inputUpdated) {
this._autocompletePopupNavigated = true;
}
} else if (this.canCaretGoNext()) {
inputUpdated = this.historyPeruse(HISTORY_FORWARD);
}
@ -886,9 +862,6 @@ class JSTerm extends Component {
case KeyCodes.DOM_VK_PAGE_UP:
if (this.autocompletePopup.isOpen) {
inputUpdated = this.complete(this.COMPLETE_PAGEUP);
if (inputUpdated) {
this._autocompletePopupNavigated = true;
}
} else {
this.hud.outputScroller.scrollTop =
Math.max(0,
@ -902,9 +875,6 @@ class JSTerm extends Component {
case KeyCodes.DOM_VK_PAGE_DOWN:
if (this.autocompletePopup.isOpen) {
inputUpdated = this.complete(this.COMPLETE_PAGEDOWN);
if (inputUpdated) {
this._autocompletePopupNavigated = true;
}
} else {
this.hud.outputScroller.scrollTop =
Math.min(this.hud.outputScroller.scrollHeight,
@ -944,17 +914,13 @@ class JSTerm extends Component {
break;
case KeyCodes.DOM_VK_RIGHT:
const cursorAtTheEnd = this.inputNode.selectionStart ==
this.inputNode.selectionEnd &&
this.inputNode.selectionStart ==
inputValue.length;
const haveSuggestion = this.autocompletePopup.isOpen ||
this.lastCompletion.value;
const useCompletion = cursorAtTheEnd || this._autocompletePopupNavigated;
if (haveSuggestion && useCompletion &&
this.complete(this.COMPLETE_HINT_ONLY) &&
this.lastCompletion.value &&
this.acceptProposedCompletion()) {
const haveSuggestion = this.autocompletePopup.isOpen || this.lastCompletion.value;
if (
haveSuggestion &&
this.complete(this.COMPLETE_HINT_ONLY) &&
this.lastCompletion.value &&
this.acceptProposedCompletion()
) {
event.preventDefault();
}
if (this.autocompletePopup.isOpen) {
@ -1301,7 +1267,7 @@ class JSTerm extends Component {
value: inputValue,
matchProp: lastPart,
};
if (items.length > 1 && !popup.isOpen) {
if (items.length > 0 && !popup.isOpen) {
let popupAlignElement;
let xOffset;
let yOffset;
@ -1321,12 +1287,11 @@ class JSTerm extends Component {
if (popupAlignElement) {
popup.openPopup(popupAlignElement, xOffset, yOffset);
this._autocompletePopupNavigated = false;
}
} else if (items.length < 2 && popup.isOpen) {
} else if (items.length === 0 && popup.isOpen) {
popup.hidePopup();
this._autocompletePopupNavigated = false;
}
if (items.length == 1) {
popup.selectedIndex = 0;
}
@ -1381,7 +1346,6 @@ class JSTerm extends Component {
this.focus();
});
this.autocompletePopup.hidePopup();
this._autocompletePopupNavigated = false;
}
}
}
@ -1506,6 +1470,17 @@ class JSTerm extends Component {
.paddingLeft.replace(/[^0-9.]/g, "") - 4;
}
onContextMenu(e) {
// The toolbox does it's own edit menu handling with
// toolbox-textbox-context-popup and friends. For now, fall
// back to use that if running inside the toolbox, but use our
// own menu when running in the Browser Console (see Bug 1476097).
if (this.props.hud.isBrowserConsole &&
Services.prefs.getBoolPref("devtools.browserconsole.html")) {
this.props.serviceContainer.openEditContextMenu(e);
}
}
destroy() {
this.clearCompletion();
@ -1548,6 +1523,7 @@ class JSTerm extends Component {
key: "jsterm-container",
style: {direction: "ltr"},
"aria-live": "off",
onContextMenu: this.onContextMenu,
ref: node => {
this.node = node;
},
@ -1584,6 +1560,7 @@ class JSTerm extends Component {
},
onPaste: onPaste,
onDrop: onPaste,
onContextMenu: this.onContextMenu,
})
)
);

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

@ -9,6 +9,8 @@
persist="screenX screenY width height sizemode">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<link rel="localization" href="toolkit/main-window/editmenu.ftl"/>
<link rel="stylesheet" href="chrome://global/skin/"/>
<link rel="stylesheet" href="chrome://devtools/skin/widgets.css"/>
<link rel="stylesheet" href="chrome://devtools/skin/webconsole.css"/>
<link rel="stylesheet" href="chrome://devtools/skin/components-frame.css"/>
@ -18,6 +20,7 @@
<link rel="stylesheet" href="resource://devtools/client/shared/components/NotificationBox.css"/>
<link rel="stylesheet" href="chrome://devtools/content/netmonitor/src/assets/styles/httpi.css"/>
<script type="text/javascript" src="chrome://global/content/l10n.js"></script>
<script src="chrome://devtools/content/shared/theme-switching.js"></script>
<script type="application/javascript"
src="resource://devtools/client/webconsole/main.js"></script>

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

@ -11,6 +11,9 @@ const TEST_URI = "http://example.com/browser/devtools/client/webconsole/" +
add_task(async function() {
// Enable net messages in the console for this test.
await pushPref("devtools.browserconsole.filter.net", true);
// These are required for testing the text input in the browser console:
await pushPref("devtools.browserconsole.html", true);
await pushPref("devtools.chrome.enabled", true);
await addTab(TEST_URI);
const hud = await HUDService.toggleBrowserConsole();
@ -56,6 +59,19 @@ add_task(async function() {
is(getSimplifiedContextMenu(menuPopup).join("\n"), expectedContextMenu.join("\n"),
"The context menu has the expected entries for a simple log message");
menuPopup = await openContextMenu(hud, hud.jsterm.inputNode);
expectedContextMenu = [
"#editmenu-undo (editmenu-undo) [disabled]",
"#editmenu-cut (editmenu-cut)",
"#editmenu-copy (editmenu-copy)",
"#editmenu-paste (editmenu-paste)",
"#editmenu-delete (editmenu-delete) [disabled]",
"#editmenu-selectAll (editmenu-select-all) [disabled]",
];
is(getL10NContextMenu(menuPopup).join("\n"), expectedContextMenu.join("\n"),
"The context menu has the correct edit menu items");
await hideContextMenu(hud);
});
@ -67,6 +83,15 @@ function addPrefBasedEntries(expectedEntries) {
return expectedEntries;
}
function getL10NContextMenu(popupElement) {
return [...popupElement.querySelectorAll("menuitem")]
.map(entry => {
const l10nID = entry.getAttribute("data-l10n-id");
const disabled = entry.hasAttribute("disabled");
return `#${entry.id} (${l10nID})${disabled ? " [disabled]" : ""}`;
});
}
function getSimplifiedContextMenu(popupElement) {
return [...popupElement.querySelectorAll("menuitem")]
.map(entry => {

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

@ -50,15 +50,18 @@ async function performTests() {
info("press Return and wait for popup to hide");
const onPopUpClose = popup.once("popup-closed");
executeSoon(() => EventUtils.synthesizeKey("KEY_Enter"));
EventUtils.synthesizeKey("KEY_Enter");
await onPopUpClose;
ok(!popup.isOpen, "popup is not open after KEY_Enter");
is(jsterm.getInputValue(), "", "inputNode is empty after KEY_Enter");
is(jsterm.getInputValue(), "window.testBugA",
"input was completed with the first item of the popup");
ok(!getJsTermCompletionValue(jsterm), "completeNode is empty");
EventUtils.synthesizeKey("KEY_Enter");
is(jsterm.getInputValue(), "", "input is empty after KEY_Enter");
const state = ui.consoleOutput.getStore().getState();
const entries = getHistoryEntries(state);
is(entries[entries.length - 1], "window.testBug",
"jsterm history is correct");
is(entries[entries.length - 1], "window.testBugA", "jsterm history is correct");
}

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

@ -19,11 +19,14 @@ add_task(async function() {
async function performTests() {
const {jsterm, ui} = await openNewTabAndConsole(TEST_URI);
const {autocompletePopup} = jsterm;
// Test typing 'docu'.
await jstermSetValueAndComplete(jsterm, "docu");
is(jsterm.getInputValue(), "docu", "'docu' completion (input.value)");
checkJsTermCompletionValue(jsterm, " ment", "'docu' completion (completeNode)");
is(autocompletePopup.items.length, 1, "autocomplete popup has 1 item");
ok(autocompletePopup.isOpen, "autocomplete popup is open with 1 item");
// Test typing 'docu' and press tab.
await jstermSetValueAndComplete(jsterm, "docu", undefined, jsterm.COMPLETE_FORWARD);

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

@ -181,3 +181,78 @@ function createContextMenu(hud, parentNode, {
}
exports.createContextMenu = createContextMenu;
/**
* Return an 'edit' menu for a input field. This integrates directly
* with docshell commands to provide the right enabled state and editor
* functionality.
*
* You'll need to call menu.popup() yourself, this just returns the Menu instance.
*
* @returns {Menu}
*/
function createEditContextMenu() {
const docshell = window.QueryInterface(Ci.nsIInterfaceRequestor)
.getInterface(Ci.nsIWebNavigation)
.QueryInterface(Ci.nsIDocShell);
const menu = new Menu({
id: "webconsole-menu"
});
menu.append(new MenuItem({
id: "editmenu-undo",
l10nID: "editmenu-undo",
disabled: !docshell.isCommandEnabled("cmd_undo"),
click: () => {
docshell.doCommand("cmd_undo");
},
}));
menu.append(new MenuItem({
type: "separator"
}));
menu.append(new MenuItem({
id: "editmenu-cut",
l10nID: "editmenu-cut",
disabled: !docshell.isCommandEnabled("cmd_cut"),
click: () => {
docshell.doCommand("cmd_cut");
},
}));
menu.append(new MenuItem({
id: "editmenu-copy",
l10nID: "editmenu-copy",
disabled: !docshell.isCommandEnabled("cmd_copy"),
click: () => {
docshell.doCommand("cmd_copy");
},
}));
menu.append(new MenuItem({
id: "editmenu-paste",
l10nID: "editmenu-paste",
disabled: !docshell.isCommandEnabled("cmd_paste"),
click: () => {
docshell.doCommand("cmd_paste");
},
}));
menu.append(new MenuItem({
id: "editmenu-delete",
l10nID: "editmenu-delete",
disabled: !docshell.isCommandEnabled("cmd_delete"),
click: () => {
docshell.doCommand("cmd_delete");
},
}));
menu.append(new MenuItem({
type: "separator"
}));
menu.append(new MenuItem({
id: "editmenu-selectAll",
l10nID: "editmenu-select-all",
disabled: !docshell.isCommandEnabled("cmd_selectAll"),
click: () => {
docshell.doCommand("cmd_selectAll");
},
}));
return menu;
}
exports.createEditContextMenu = createEditContextMenu;

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

@ -8,7 +8,7 @@ const ReactDOM = require("devtools/client/shared/vendor/react-dom");
const { Provider } = require("devtools/client/shared/vendor/react-redux");
const actions = require("devtools/client/webconsole/actions/index");
const { createContextMenu } = require("devtools/client/webconsole/utils/context-menu");
const { createContextMenu, createEditContextMenu } = require("devtools/client/webconsole/utils/context-menu");
const { configureStore } = require("devtools/client/webconsole/store");
const { isPacketPrivate } = require("devtools/client/webconsole/utils/messages");
const { getAllMessagesById, getMessage } = require("devtools/client/webconsole/selectors/messages");
@ -160,6 +160,16 @@ WebConsoleOutputWrapper.prototype = {
return menu;
};
serviceContainer.openEditContextMenu = (e) => {
const { screenX, screenY } = e;
const menu = createEditContextMenu();
// Emit the "menu-open" event for testing.
menu.once("open", () => this.emit("menu-open"));
menu.popup(screenX, screenY, { doc: this.owner.chromeWindow.document });
return menu;
};
if (this.toolbox) {
Object.assign(serviceContainer, {
onViewSourceInDebugger: frame => {

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

@ -672,6 +672,19 @@ const NodeActor = protocol.ActorClassWithSpec(nodeSpec, {
current = current.parentNode;
}
return "rgba(255, 255, 255, 1)";
},
/**
* Returns an object with the width and height of the node's owner window.
*
* @return {Object}
*/
getOwnerGlobalDimensions: function() {
const win = this.rawNode.ownerGlobal;
return {
innerWidth: win.innerWidth,
innerHeight: win.innerHeight,
};
}
});

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

@ -17,6 +17,13 @@ types.addDictType("imageData", {
size: "json"
});
types.addDictType("windowDimensions", {
// The window innerWidth
innerWidth: "nullable:number",
// The window innerHeight
innerHeight: "nullable:number",
});
/**
* Returned from any call that might return a node that isn't connected to root
* by nodes the child has seen, such as querySelector.
@ -123,6 +130,10 @@ const nodeSpec = generateActorSpec({
value: RetVal("string")
}
},
getOwnerGlobalDimensions: {
request: {},
response: RetVal("windowDimensions")
}
}
});

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

@ -7868,6 +7868,23 @@ nsContentUtils::IsFileImage(nsIFile* aFile, nsACString& aType)
return StringBeginsWith(aType, NS_LITERAL_CSTRING("image/"));
}
nsresult
nsContentUtils::CalculateBufferSizeForImage(const uint32_t& aStride,
const IntSize& aImageSize,
const SurfaceFormat& aFormat,
size_t* aMaxBufferSize,
size_t* aUsedBufferSize)
{
CheckedInt32 requiredBytes =
CheckedInt32(aStride) * CheckedInt32(aImageSize.height);
if (!requiredBytes.isValid()) {
return NS_ERROR_FAILURE;
}
*aMaxBufferSize = requiredBytes.value();
*aUsedBufferSize = *aMaxBufferSize - aStride + (aImageSize.width * BytesPerPixel(aFormat));
return NS_OK;
}
nsresult
nsContentUtils::DataTransferItemToImage(const IPCDataTransferItem& aItem,
imgIContainer** aContainer)
@ -7883,6 +7900,21 @@ nsContentUtils::DataTransferItemToImage(const IPCDataTransferItem& aItem,
Shmem data = aItem.data().get_Shmem();
// Validate shared memory buffer size
size_t imageBufLen = 0;
size_t maxBufLen = 0;
nsresult rv = CalculateBufferSizeForImage(imageDetails.stride(),
size,
imageDetails.format(),
&maxBufLen,
&imageBufLen);
if (NS_FAILED(rv)) {
return rv;
}
if (imageBufLen > data.Size<uint8_t>()) {
return NS_ERROR_FAILURE;
}
RefPtr<DataSourceSurface> image =
CreateDataSourceSurfaceFromData(size,
imageDetails.format(),
@ -8233,21 +8265,18 @@ GetSurfaceDataImpl(mozilla::gfx::DataSourceSurface* aSurface,
return GetSurfaceDataContext::NullValue();
}
mozilla::gfx::IntSize size = aSurface->GetSize();
mozilla::CheckedInt32 requiredBytes =
mozilla::CheckedInt32(map.mStride) * mozilla::CheckedInt32(size.height);
if (!requiredBytes.isValid()) {
size_t bufLen = 0;
size_t maxBufLen = 0;
nsresult rv = nsContentUtils::CalculateBufferSizeForImage(map.mStride,
aSurface->GetSize(),
aSurface->GetFormat(),
&maxBufLen,
&bufLen);
if (NS_FAILED(rv)) {
aSurface->Unmap();
return GetSurfaceDataContext::NullValue();
}
size_t maxBufLen = requiredBytes.value();
mozilla::gfx::SurfaceFormat format = aSurface->GetFormat();
// Surface data handling is totally nuts. This is the magic one needs to
// know to access the data.
size_t bufLen = maxBufLen - map.mStride + (size.width * BytesPerPixel(format));
// nsDependentCString wants null-terminated string.
typename GetSurfaceDataContext::ReturnType surfaceData = aContext.Allocate(maxBufLen + 1);
if (GetSurfaceDataContext::GetBuffer(surfaceData)) {

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

@ -1160,11 +1160,17 @@ public:
*/
static bool DevToolsEnabled(JSContext* aCx);
static nsresult CalculateBufferSizeForImage(const uint32_t& aStride,
const mozilla::gfx::IntSize& aImageSize,
const mozilla::gfx::SurfaceFormat& aFormat,
size_t* aMaxBufferSize,
size_t* aUsedBufferSize);
private:
/**
* Fill (with the parameters given) the localized string named |aKey| in
* properties file |aFile|.
*/
private:
static nsresult FormatLocalizedString(PropertiesFile aFile,
const char* aKey,
const char16_t** aParams,

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

@ -10444,9 +10444,7 @@ nsCSSFrameConstructor::WrapFramesInFirstLineFrame(
{
// Find the part of aFrameItems that we want to put in the first-line
nsFrameList::FrameLinkEnumerator link(aFrameItems);
while (!link.AtEnd() && link.NextFrame()->IsInlineOutside()) {
link.Next();
}
FindFirstBlock(link);
nsFrameList firstLineChildren = aFrameItems.ExtractHead(link);

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

@ -584,7 +584,8 @@ public:
WritingMode GetWritingMode() const { return mWM; }
uint8_t GetAlignSelf() const { return mAlignSelf; }
uint8_t GetAlignSelf() const { return mAlignSelf; }
uint8_t GetAlignSelfFlags() const { return mAlignSelfFlags; }
// Returns the flex factor (flex-grow or flex-shrink), depending on
// 'aIsUsingFlexGrow'.
@ -878,6 +879,7 @@ protected:
uint8_t mAlignSelf; // My "align-self" computed value (with "auto"
// swapped out for parent"s "align-items" value,
// in our constructor).
uint8_t mAlignSelfFlags; // Flags for 'align-self' (safe/unsafe/legacy)
};
/**
@ -1941,7 +1943,8 @@ FlexItem::FlexItem(ReflowInput& aFlexItemReflowInput,
mAlignSelf = NS_STYLE_ALIGN_STRETCH;
}
// XXX strip off the <overflow-position> bit until we implement that
// Store and strip off the <overflow-position> bits
mAlignSelfFlags = mAlignSelf & NS_STYLE_ALIGN_FLAG_BITS;
mAlignSelf &= ~NS_STYLE_ALIGN_FLAG_BITS;
}
@ -2923,6 +2926,10 @@ MainAxisPositionTracker::
mNumPackingSpacesRemaining(0),
mJustifyContent(aJustifyContent)
{
// Extract the flag portion of mJustifyContent and strip off the flag bits
uint8_t justifyContentFlags = mJustifyContent & NS_STYLE_JUSTIFY_FLAG_BITS;
mJustifyContent &= ~NS_STYLE_JUSTIFY_FLAG_BITS;
// 'normal' behaves as 'stretch', and 'stretch' behaves as 'flex-start',
// in the main axis
// https://drafts.csswg.org/css-align-3/#propdef-justify-content
@ -2931,9 +2938,6 @@ MainAxisPositionTracker::
mJustifyContent = NS_STYLE_JUSTIFY_FLEX_START;
}
// XXX strip off the <overflow-position> bit until we implement that
mJustifyContent &= ~NS_STYLE_JUSTIFY_FLAG_BITS;
// mPackingSpaceRemaining is initialized to the container's main size. Now
// we'll subtract out the main sizes of our flex items, so that it ends up
// with the *actual* amount of packing space.
@ -2949,6 +2953,11 @@ MainAxisPositionTracker::
if (mPackingSpaceRemaining <= 0) {
// No available packing space to use for resolving auto margins.
mNumAutoMarginsInMainAxis = 0;
// If packing space is negative and <overflow-position> is set to 'safe'
// all justify options fall back to 'start'
if (justifyContentFlags & NS_STYLE_JUSTIFY_SAFE) {
mJustifyContent = NS_STYLE_JUSTIFY_START;
}
}
// If packing space is negative or we only have one item, 'space-between'
@ -3104,14 +3113,15 @@ CrossAxisPositionTracker::
{
MOZ_ASSERT(aFirstLine, "null first line pointer");
// Extract and strip the flag bits from alignContent
uint8_t alignContentFlags = mAlignContent & NS_STYLE_ALIGN_FLAG_BITS;
mAlignContent &= ~NS_STYLE_ALIGN_FLAG_BITS;
// 'normal' behaves as 'stretch'
if (mAlignContent == NS_STYLE_ALIGN_NORMAL) {
mAlignContent = NS_STYLE_ALIGN_STRETCH;
}
// XXX strip of the <overflow-position> bit until we implement that
mAlignContent &= ~NS_STYLE_ALIGN_FLAG_BITS;
const bool isSingleLine =
NS_STYLE_FLEX_WRAP_NOWRAP == aReflowInput.mStylePosition->mFlexWrap;
if (isSingleLine) {
@ -3158,6 +3168,13 @@ CrossAxisPositionTracker::
"GenerateFlexLines should've produced at least 1 line");
mPackingSpaceRemaining -= aCrossGapSize * (numLines - 1);
// If <overflow-position> is 'safe' and packing space is negative
// all align options fall back to 'start'
if ((alignContentFlags & NS_STYLE_ALIGN_SAFE) &&
mPackingSpaceRemaining < 0) {
mAlignContent = NS_STYLE_ALIGN_START;
}
// If packing space is negative, 'space-between' and 'stretch' behave like
// 'flex-start', and 'space-around' and 'space-evenly' behave like 'center'.
// In those cases, it's simplest to just pretend we have a different
@ -3516,6 +3533,14 @@ SingleLineCrossAxisPositionTracker::
}
}
// 'align-self' falls back to 'flex-start' if it is 'center'/'flex-end' and we
// have cross axis overflow
// XXX we should really be falling back to 'start' as of bug 1472843
if (aLine.GetLineCrossSize() < aItem.GetOuterCrossSize(mAxis) &&
(aItem.GetAlignSelfFlags() & NS_STYLE_ALIGN_SAFE)) {
alignSelf = NS_STYLE_ALIGN_FLEX_START;
}
switch (alignSelf) {
case NS_STYLE_ALIGN_SELF_START:
case NS_STYLE_ALIGN_SELF_END:

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

@ -0,0 +1,73 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0
-->
<html>
<head>
<title>Reference: Testing safe overflow-position for align-content, justify-content, and align-items in flex containers</title>
<link rel="author" title="Mihir Iyer" href="mailto:miyer@mozilla.com">
<meta charset="utf-8">
<style>
.flex {
display: flex;
width: 85px;
height: 65px;
border: 1px solid black;
align-content: flex-end;
justify-content: center;
align-items: center;
float: left;
clear: both;
margin-top: 100px;
}
.rowNoWrap {
flex-flow: row nowrap;
}
.columnNoWrap {
flex-flow: column wrap;
}
.item {
border: 1px solid blue;
background: lightblue;
width: 28px;
height: 28px;
flex-shrink: 0;
}
.bigItem {
border: 1px solid blue;
background: lightblue;
width: 28px;
height: 90px;
flex-shrink: 0;
}
.alignContentStart {
align-content: start;
}
.justifyContentStart {
justify-content: start;
}
.alignSelfStart {
align-self: start;
}
</style>
</head>
<body>
<div class="flex rowNoWrap justifyContentStart">
<div class="item"></div>
<div class="item"></div>
<div class="bigItem alignSelfStart"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
<div class="flex columnNoWrap alignContentStart">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
</body>
</html>

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

@ -0,0 +1,66 @@
<!DOCTYPE html>
<!--
Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0
-->
<html>
<head>
<title>CSS Test: Testing safe overflow-position for align-content, justify-content, and align-items in flex containers</title>
<link rel="author" title="Mihir Iyer" href="mailto:miyer@mozilla.com">
<link rel="help" href="https://drafts.csswg.org/css-align-3/#overflow-values">
<link rel="match" href="flexbox-safe-overflow-position-001-ref.html">
<meta charset="utf-8">
<style>
.flex {
display: flex;
width: 85px;
height: 65px;
border: 1px solid black;
align-content: safe flex-end;
justify-content: safe center;
align-items: safe center;
float: left;
clear: both;
margin-top: 100px;
}
.rowNoWrap {
flex-flow: row nowrap;
}
.columnNoWrap {
flex-flow: column wrap;
}
.item {
border: 1px solid blue;
background: lightblue;
width: 28px;
height: 28px;
flex-shrink: 0;
}
.bigItem {
border: 1px solid blue;
background: lightblue;
width: 28px;
height: 90px;
flex-shrink: 0;
}
</style>
</head>
<body>
<div class="flex rowNoWrap">
<div class="item"></div>
<div class="item"></div>
<div class="bigItem"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
<div class="flex columnNoWrap">
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
<div class="item"></div>
</div>
</body>
</html>

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

@ -214,6 +214,9 @@ fails == flexbox-min-height-auto-002b.html flexbox-min-height-auto-002-ref.html
== flexbox-root-node-001a.html flexbox-root-node-001-ref.html
== flexbox-root-node-001b.html flexbox-root-node-001-ref.html
# Tests for <overflow-position> "safe" keyword in CSS Alignment properties
== flexbox-safe-overflow-position-001.html flexbox-safe-overflow-position-001-ref.html
# Tests for sizing of flex containers, e.g. under min/max size constraints
== flexbox-sizing-horiz-001.xhtml flexbox-sizing-horiz-001-ref.xhtml
== flexbox-sizing-horiz-002.xhtml flexbox-sizing-horiz-002-ref.xhtml

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

@ -467,7 +467,7 @@ int nr_transport_addr_is_teredo(nr_transport_addr *addr)
case NR_IPV6:
{
UINT4* addrTop = (UINT4*)(addr->u.addr6.sin6_addr.s6_addr);
if ((*addrTop & htonl(0xFFFF0000)) == htonl(0x20010000))
if ((*addrTop & htonl(0xFFFFFFFF)) == htonl(0x20010000))
return(1);
}
break;

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

@ -3050,6 +3050,7 @@ const std::string kBasicAudioVideoDataOffer =
"a=rtcp-fb:97 nack pli" CRLF
"a=rtcp-fb:97 ccm fir" CRLF
"a=rtcp-fb:* ccm tmmbr" CRLF
"a=rtcp-fb:120 transport-cc" CRLF
"a=setup:actpass" CRLF
"a=rtcp-mux" CRLF
"m=application 9 DTLS/SCTP 5000" CRLF
@ -3136,7 +3137,13 @@ TEST_P(NewSdpTest, CheckRtcpFb) {
auto& video_attrs = mSdp->GetMediaSection(1).GetAttributeList();
ASSERT_TRUE(video_attrs.HasAttribute(SdpAttribute::kRtcpFbAttribute));
auto& rtcpfbs = video_attrs.GetRtcpFb().mFeedbacks;
ASSERT_EQ(20U, rtcpfbs.size());
if (IsParsingWithSipccParser()) {
ASSERT_EQ(20U, rtcpfbs.size());
} else {
ASSERT_EQ(21U, rtcpfbs.size());
}
CheckRtcpFb(rtcpfbs[0], "120", SdpRtcpFbAttributeList::kAck, "rpsi");
CheckRtcpFb(rtcpfbs[1], "120", SdpRtcpFbAttributeList::kAck, "app", "foo");
CheckRtcpFb(rtcpfbs[2], "120", SdpRtcpFbAttributeList::kNack, "");
@ -3157,6 +3164,10 @@ TEST_P(NewSdpTest, CheckRtcpFb) {
CheckRtcpFb(rtcpfbs[17], "97", SdpRtcpFbAttributeList::kNack, "pli");
CheckRtcpFb(rtcpfbs[18], "97", SdpRtcpFbAttributeList::kCcm, "fir");
CheckRtcpFb(rtcpfbs[19], "*", SdpRtcpFbAttributeList::kCcm, "tmmbr");
if (!IsParsingWithSipccParser()) {
CheckRtcpFb(rtcpfbs[20], "120", SdpRtcpFbAttributeList::kTransCC, "");
}
}
TEST_P(NewSdpTest, CheckRtcp) {

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

@ -91,7 +91,6 @@ RsdparsaSdp::AddMediaSection(SdpMediaSection::MediaType mediaType,
protocol,addrType,rustAddr);
if (NS_SUCCEEDED(nr)) {
std::cout << "Hello World" << std::endl;
size_t level = mMediaSections.values.size();
RsdparsaSessionHandle newSessHandle(sdp_new_reference(mSession.get()));

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

@ -1062,7 +1062,7 @@ class SdpRtcpFbAttributeList : public SdpAttribute
public:
SdpRtcpFbAttributeList() : SdpAttribute(kRtcpFbAttribute) {}
enum Type { kAck, kApp, kCcm, kNack, kTrrInt, kRemb };
enum Type { kAck, kApp, kCcm, kNack, kTrrInt, kRemb, kTransCC };
static const char* pli;
static const char* sli;
@ -1116,6 +1116,9 @@ inline std::ostream& operator<<(std::ostream& os,
case SdpRtcpFbAttributeList::kRemb:
os << "goog-remb";
break;
case SdpRtcpFbAttributeList::kTransCC:
os << "transport-cc";
break;
default:
MOZ_ASSERT(false);
os << "?";

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

@ -159,7 +159,6 @@ pub unsafe extern "C" fn sdp_add_media_section(session: *mut SdpSession,
38 => SdpProtocolValue::UdpDtlsSctp, // Protocol::kUdpDtlsSctp
39 => SdpProtocolValue::TcpDtlsSctp, // Protocol::kTcpDtlsSctp
_ => {
println!("INVALID PROTOCOL");
return NS_ERROR_INVALID_ARG;
}
};

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

@ -12,6 +12,7 @@ import java.util.GregorianCalendar;
import org.mozilla.gecko.AppConstants;
import org.mozilla.gecko.util.GeckoBundle;
import org.mozilla.gecko.widget.AllCapsTextView;
import org.mozilla.gecko.widget.FocusableDatePicker;
import org.mozilla.gecko.widget.DateTimePicker;
import android.content.Context;
@ -180,7 +181,8 @@ public abstract class PromptInput {
@Override
public View getView(Context context) throws UnsupportedOperationException {
if (mType.equals("date")) {
DatePicker input = new DatePicker(context);
// FocusableDatePicker allow us to have priority in responding to scroll events.
DatePicker input = new FocusableDatePicker(context);
try {
if (!TextUtils.isEmpty(mValue)) {
GregorianCalendar calendar = new GregorianCalendar();

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

@ -0,0 +1,49 @@
/* -*- Mode: Java; c-basic-offset: 4; tab-width: 20; indent-tabs-mode: nil; -*-
* 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/. */
package org.mozilla.gecko.widget;
import android.annotation.SuppressLint;
import android.content.Context;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.ViewParent;
import android.widget.DatePicker;
/**
* This is based on the platform's {@link DatePicker}.<br>
* The only difference is that it will prevent it's parent from receiving touch events.
*/
public class FocusableDatePicker extends DatePicker {
public FocusableDatePicker(Context context) {
super(context);
}
public FocusableDatePicker(Context context, AttributeSet attrs) {
super(context, attrs);
}
public FocusableDatePicker(Context context, AttributeSet attrs, int defStyleAttr) {
super(context, attrs, defStyleAttr);
}
@SuppressLint("NewApi")
public FocusableDatePicker(Context context, AttributeSet attrs, int defStyleAttr, int defStyleRes) {
super(context, attrs, defStyleAttr, defStyleRes);
}
@Override
public boolean onInterceptTouchEvent(MotionEvent ev) {
ViewParent parentView = getParent();
if (ev.getActionMasked() == MotionEvent.ACTION_DOWN) {
if (parentView != null) {
parentView.requestDisallowInterceptTouchEvent(true);
}
}
return false;
}
}

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

@ -169,7 +169,7 @@ class PageAction extends EventEmitter {
// Bug 1372783: Why is this contentWindow.devicePixelRatio, while
// convertImageURLToDataURL uses browserWindow.devicePixelRatio?
let {icon} = IconDetails.getPreferredIcon(this.defaults.icons, this.extension,
18 * contentWindow.devicePixelRatio);
16 * contentWindow.devicePixelRatio);
let browserWindow = Services.wm.getMostRecentWindow("navigator:browser");
return IconDetails.convertImageURLToDataURL(icon, contentWindow, browserWindow).then(dataURI => {

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

@ -349,15 +349,10 @@ impl<T: ?Sized> Arc<T> {
#[inline]
pub fn is_unique(&self) -> bool {
// We can use Relaxed here, but the justification is a bit subtle.
// See the extensive discussion in [1] for why this needs to be Acquire.
//
// The reason to use Acquire would be to synchronize with other threads
// that are modifying the refcount with Release, i.e. to ensure that
// their writes to memory guarded by this refcount are flushed. However,
// we know that threads only modify the contents of the Arc when they
// observe the refcount to be 1, and no other thread could observe that
// because we're holding one strong reference here.
self.inner().count.load(Relaxed) == 1
// [1] https://github.com/servo/servo/issues/21186
self.inner().count.load(Acquire) == 1
}
}

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

@ -973,6 +973,7 @@ linux64-ccov/debug:
- linux64-clang
- linux64-rust
- linux64-gcc
- linux64-sccache
linux64-ccov/opt:
description: "Linux64-CCov Opt"
@ -1002,6 +1003,7 @@ linux64-ccov/opt:
- linux64-clang
- linux64-rust
- linux64-gcc
- linux64-sccache
linux64-add-on-devel/opt:
description: "Linux64 add-on-devel"

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

@ -104,6 +104,7 @@ test-verify:
.*-jsdcov/.*: []
.*-asan/.*: []
# do not run on beta or release: usually just confirms earlier results
.*-msvc/.*: ['mozilla-central', 'try']
default: ['trunk', 'try']
tier: 2
mozharness:
@ -148,6 +149,7 @@ test-verify-gpu:
.*-jsdcov/.*: []
.*-asan/.*: []
# do not run on beta or release: usually just confirms earlier results
.*-msvc/.*: ['mozilla-central', 'try']
default: ['trunk', 'try']
tier: 2
mozharness:

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

@ -32,6 +32,7 @@ talos-bcv:
run-on-projects:
by-test-platform:
.*-qr/.*: [] # this test is not useful with webrender
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
tier:
by-test-platform:
@ -49,6 +50,7 @@ talos-bcv-profiling:
run-on-projects:
by-test-platform:
.*-qr/.*: [] # this test is not useful with webrender
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
tier:
by-test-platform:
@ -64,7 +66,10 @@ talos-chrome:
description: "Talos chrome"
try-name: chromez
treeherder-symbol: T(c)
run-on-projects: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
max-run-time: 1200
mozharness:
extra-options:
@ -74,7 +79,10 @@ talos-chrome-profiling:
description: "Talos profiling chrome"
try-name: chromez-profiling
treeherder-symbol: T-P(c)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
max-run-time: 1200
mozharness:
extra-options:
@ -92,6 +100,7 @@ talos-damp:
run-on-projects:
by-test-platform:
linux64-ccov/.*: ['try'] # Bug 1407593
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
mozharness:
extra-options:
@ -101,7 +110,10 @@ talos-damp-profiling:
description: "Talos profiling devtools"
try-name: damp-profiling
treeherder-symbol: T-P(damp)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
max-run-time: 1200
mozharness:
extra-options:
@ -112,7 +124,10 @@ talos-dromaeojs:
description: "Talos dromaeojs"
try-name: dromaeojs
treeherder-symbol: T(d)
run-on-projects: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
max-run-time: 2100
mozharness:
extra-options:
@ -122,7 +137,10 @@ talos-dromaeojs-profiling:
description: "Talos profiling dromaeojs"
try-name: dromaeojs-profiling
treeherder-symbol: T-P(d)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
max-run-time: 2100
mozharness:
extra-options:
@ -134,7 +152,10 @@ talos-flex:
try-name: flex
treeherder-symbol: T(f)
tier: 3
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
max-run-time: 1800
mozharness:
extra-options:
@ -144,7 +165,10 @@ talos-g1:
description: "Talos g1"
try-name: g1
treeherder-symbol: T(g1)
run-on-projects: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
max-run-time:
by-test-platform:
linux64.*: 2700
@ -157,7 +181,10 @@ talos-g1-profiling:
description: "Talos profiling g1"
try-name: g1-profiling
treeherder-symbol: T-P(g1)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
max-run-time:
by-test-platform:
linux64.*: 2700
@ -171,7 +198,10 @@ talos-g3:
description: "Talos g3"
try-name: g3
treeherder-symbol: T(g3)
run-on-projects: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
max-run-time: 900
mozharness:
extra-options:
@ -181,7 +211,10 @@ talos-g3-profiling:
description: "Talos profiling g3"
try-name: g3-profiling
treeherder-symbol: T-P(g3)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
max-run-time: 900
mozharness:
extra-options:
@ -192,7 +225,10 @@ talos-g4:
description: "Talos g4"
try-name: g4
treeherder-symbol: T(g4)
run-on-projects: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
max-run-time:
by-test-platform:
linux64.*: 1500
@ -205,7 +241,10 @@ talos-g4-profiling:
description: "Talos profiling g4"
try-name: g4-profiling
treeherder-symbol: T-P(g4)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
mozharness:
extra-options:
- --suite=g4
@ -219,7 +258,10 @@ talos-g5:
description: "Talos g5"
try-name: g5
treeherder-symbol: T(g5)
run-on-projects: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
mozharness:
extra-options:
- --suite=g5
@ -232,7 +274,10 @@ talos-g5-profiling:
description: "Talos profiling g5"
try-name: g5-profiling
treeherder-symbol: T-P(g5)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
mozharness:
extra-options:
- --suite=g5
@ -246,7 +291,10 @@ talos-h1:
description: "Talos h1"
try-name: h1
treeherder-symbol: T(h1)
run-on-projects: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
mozharness:
extra-options:
- --suite=h1
@ -263,7 +311,10 @@ talos-h2:
by-test-platform:
linux64.*: 900
default: 7200
run-on-projects: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
mozharness:
extra-options:
- --suite=h2
@ -272,7 +323,10 @@ talos-motionmark:
description: "Talos motionmark"
try-name: motionmark
treeherder-symbol: T(mm)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
max-run-time: 3600
tier:
by-test-platform:
@ -287,7 +341,10 @@ talos-motionmark-profiling:
description: "Talos profiling motionmark"
try-name: motionmark-profiling
treeherder-symbol: T-P(mm)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
max-run-time: 3600
tier:
by-test-platform:
@ -303,7 +360,10 @@ talos-other:
description: "Talos other"
try-name: other
treeherder-symbol: T(o)
run-on-projects: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
max-run-time: 1500
mozharness:
extra-options:
@ -313,7 +373,10 @@ talos-other-profiling:
description: "Talos profiling other"
try-name: other-profiling
treeherder-symbol: T-P(o)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
max-run-time: 1500
mozharness:
extra-options:
@ -324,7 +387,10 @@ talos-perf-reftest:
description: "Talos perf-reftest"
try-name: perf-reftest
treeherder-symbol: T(p)
run-on-projects: ['mozilla-central', 'mozilla-inbound', 'autoland', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'mozilla-inbound', 'autoland', 'try']
max-run-time: 1200
mozharness:
extra-options:
@ -334,7 +400,10 @@ talos-perf-reftest-profiling:
description: "Talos profiling perf-reftest"
try-name: perf-reftest-profiling
treeherder-symbol: T-P(p)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
max-run-time: 1200
mozharness:
extra-options:
@ -345,7 +414,10 @@ talos-perf-reftest-singletons:
description: "Talos perf-reftest singletons"
try-name: perf-reftest-singletons
treeherder-symbol: T(ps)
run-on-projects: ['mozilla-central', 'mozilla-inbound', 'autoland', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'mozilla-inbound', 'autoland', 'try']
max-run-time: 1200
mozharness:
extra-options:
@ -355,7 +427,10 @@ talos-perf-reftest-singletons-profiling:
description: "Talos profiling perf-reftest singletons"
try-name: perf-reftest-singletons-profiling
treeherder-symbol: T-P(ps)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
max-run-time: 1200
mozharness:
extra-options:
@ -366,7 +441,10 @@ talos-speedometer:
description: "Talos speedometer"
try-name: speedometer
treeherder-symbol: T(sp)
run-on-projects: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
max-run-time: 1500
mozharness:
extra-options:
@ -376,7 +454,10 @@ talos-speedometer-profiling:
description: "Talos profiling speedometer"
try-name: speedometer-profiling
treeherder-symbol: T-P(sp)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
max-run-time: 1500
mozharness:
extra-options:
@ -387,7 +468,10 @@ talos-svgr:
description: "Talos svgr"
try-name: svgr
treeherder-symbol: T(s)
run-on-projects: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
max-run-time: 1800
mozharness:
extra-options:
@ -397,7 +481,10 @@ talos-svgr-profiling:
description: "Talos profiling svgr"
try-name: svgr-profiling
treeherder-symbol: T-P(s)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
max-run-time: 1800
mozharness:
extra-options:
@ -408,7 +495,10 @@ talos-tp5o:
description: "Talos tp5o"
try-name: tp5o
treeherder-symbol: T(tp)
run-on-projects: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
max-run-time: 1800
mozharness:
extra-options:
@ -418,7 +508,10 @@ talos-tp5o-profiling:
description: "Talos profiling tp5o"
try-name: tp5o-profiling
treeherder-symbol: T-P(tp)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
max-run-time: 1800
mozharness:
extra-options:
@ -429,7 +522,10 @@ talos-tp6:
description: "Talos tp6"
try-name: tp6
treeherder-symbol: T(tp6)
run-on-projects: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
max-run-time: 1200
mozharness:
extra-options:
@ -439,7 +535,10 @@ talos-tp6-profiling:
description: "Talos profiling tp6"
try-name: tp6-profiling
treeherder-symbol: T-P(tp6)
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
max-run-time: 1200
mozharness:
extra-options:
@ -454,6 +553,7 @@ talos-tp6-stylo-threads:
run-on-projects:
by-test-platform:
macosx.*: ['mozilla-beta', 'autoland', 'try']
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
mozharness:
extra-options:
@ -467,6 +567,7 @@ talos-tps:
run-on-projects:
by-test-platform:
linux64-ccov/.*: ['try'] # Bug 1407593
windows.*msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
default: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
mozharness:
extra-options:
@ -477,7 +578,10 @@ talos-tps-profiling:
try-name: tps-profiling
treeherder-symbol: T-P(tps)
max-run-time: 900
run-on-projects: ['mozilla-central', 'try']
run-on-projects:
by-test-platform:
windows.*msvc/.*: ['mozilla-central', 'try']
default: ['mozilla-central', 'try']
mozharness:
extra-options:
- --suite=tps
@ -490,7 +594,8 @@ talos-xperf:
virtualization: virtual
run-on-projects:
by-test-platform:
windows7-32.*: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
windows7-32-msvc/.*: ['mozilla-beta', 'mozilla-central', 'try']
windows7-32(-pgo)?/.*: ['mozilla-beta', 'mozilla-central', 'mozilla-inbound', 'autoland', 'try']
default: []
tier:
by-test-platform:

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

@ -168,6 +168,7 @@ test-verify-wpt:
.*-jsdcov/.*: []
.*-asan/.*: []
# do not run on beta or release: usually just confirms earlier results
.*-msvc/.*: ['mozilla-central', 'try']
default: ['trunk', 'try']
tier: 2
mozharness:

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

@ -1,8 +1,8 @@
#!/bin/bash
set -x -e -v
# 0.2.6 + a few fixes
SCCACHE_REVISION=9f4c18b4a6300e3a9250a09811cc985311c20217
# 0.2.7 + --coverage suppport
SCCACHE_REVISION=1ab9a33e8d328941acc23c74c949b765f975f309
# This script is for building sccache

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

@ -1517,7 +1517,7 @@ let IconDetails = {
return {size, icon: DEFAULT};
},
convertImageURLToDataURL(imageURL, contentWindow, browserWindow, size = 18) {
convertImageURLToDataURL(imageURL, contentWindow, browserWindow, size = 16) {
return new Promise((resolve, reject) => {
let image = new contentWindow.Image();
image.onload = function() {

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

@ -928,82 +928,6 @@ nsNavHistory::hasHistoryEntries()
}
namespace {
class InvalidateAllFrecenciesCallback : public AsyncStatementCallback
{
public:
InvalidateAllFrecenciesCallback()
{
}
NS_IMETHOD HandleCompletion(uint16_t aReason) override
{
if (aReason == REASON_FINISHED) {
nsNavHistory *navHistory = nsNavHistory::GetHistoryService();
NS_ENSURE_STATE(navHistory);
navHistory->NotifyManyFrecenciesChanged();
}
return NS_OK;
}
};
} // namespace
nsresult
nsNavHistory::invalidateFrecencies(const nsCString& aPlaceIdsQueryString)
{
// Exclude place: queries by setting their frecency to zero.
nsCString invalidFrecenciesSQLFragment(
"UPDATE moz_places SET frecency = "
);
if (!aPlaceIdsQueryString.IsEmpty())
invalidFrecenciesSQLFragment.AppendLiteral("NOTIFY_FRECENCY(");
invalidFrecenciesSQLFragment.AppendLiteral(
"(CASE "
"WHEN url_hash BETWEEN hash('place', 'prefix_lo') AND "
"hash('place', 'prefix_hi') "
"THEN 0 "
"ELSE -1 "
"END) "
);
if (!aPlaceIdsQueryString.IsEmpty()) {
invalidFrecenciesSQLFragment.AppendLiteral(
", url, guid, hidden, last_visit_date) "
);
}
invalidFrecenciesSQLFragment.AppendLiteral(
"WHERE frecency > 0 "
);
if (!aPlaceIdsQueryString.IsEmpty()) {
invalidFrecenciesSQLFragment.AppendLiteral("AND id IN(");
invalidFrecenciesSQLFragment.Append(aPlaceIdsQueryString);
invalidFrecenciesSQLFragment.Append(')');
}
RefPtr<InvalidateAllFrecenciesCallback> cb =
aPlaceIdsQueryString.IsEmpty() ? new InvalidateAllFrecenciesCallback()
: nullptr;
nsCOMPtr<mozIStorageAsyncStatement> stmt = mDB->GetAsyncStatement(
invalidFrecenciesSQLFragment
);
NS_ENSURE_STATE(stmt);
nsCOMPtr<mozIStoragePendingStatement> ps;
nsresult rv = stmt->ExecuteAsync(cb, getter_AddRefs(ps));
NS_ENSURE_SUCCESS(rv, rv);
// Trigger frecency updates for affected origins.
nsCOMPtr<mozIStorageAsyncStatement> updateOriginFrecenciesStmt =
mDB->GetAsyncStatement("DELETE FROM moz_updateoriginsupdate_temp");
NS_ENSURE_STATE(updateOriginFrecenciesStmt);
rv = updateOriginFrecenciesStmt->ExecuteAsync(nullptr, getter_AddRefs(ps));
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}
// Call this method before visiting a URL in order to help determine the
// transition type of the visit.
//

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

@ -172,16 +172,6 @@ public:
*/
nsresult UpdateFrecency(int64_t aPlaceId);
/**
* Invalidate the frecencies of a list of places, so they will be recalculated
* at the first idle-daily notification.
*
* @param aPlacesIdsQueryString
* Query string containing list of places to be invalidated. If it's
* an empty string all places will be invalidated.
*/
nsresult invalidateFrecencies(const nsCString& aPlaceIdsQueryString);
/**
* These functions return non-owning references to the locale-specific
* objects for places components.

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

@ -28,9 +28,9 @@ add_task(async function test_nsNavHistory_UpdateFrecency() {
await promise;
});
// nsNavHistory::invalidateFrecencies for particular pages
add_task(async function test_nsNavHistory_invalidateFrecencies_somePages() {
let url = Services.io.newURI("http://test-nsNavHistory-invalidateFrecencies-somePages.com/");
// History.jsm invalidateFrecencies()
add_task(async function test_invalidateFrecencies() {
let url = Services.io.newURI("http://test-invalidateFrecencies.com/");
// Bookmarking the URI is enough to add it to moz_places, and importantly, it
// means that removeByFilter doesn't remove it from moz_places, so its
// frecency is able to be changed.
@ -44,8 +44,8 @@ add_task(async function test_nsNavHistory_invalidateFrecencies_somePages() {
await promise;
});
// nsNavHistory::invalidateFrecencies for all pages
add_task(async function test_nsNavHistory_invalidateFrecencies_allPages() {
// History.jsm clear()
add_task(async function test_clear() {
await Promise.all([onManyFrecenciesChanged(), PlacesUtils.history.clear()]);
});

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

@ -22,6 +22,8 @@ XPCOMUtils.defineLazyGetter(this, "jexl", () => {
preferenceIsUserSet: PreferenceFilters.preferenceIsUserSet,
preferenceExists: PreferenceFilters.preferenceExists,
keys,
length,
mapToProperty
});
jexl.addBinaryOp("intersect", 40, operatorIntersect);
return jexl;
@ -48,6 +50,26 @@ function keys(obj) {
return Object.keys(obj);
}
/**
* Return the length of an array
* @param {Array} arr
* @return {number}
*/
function length(arr) {
return Array.isArray(arr) ? arr.length : undefined;
}
/**
* Given an input array and property name, return an array with each element of
* the original array replaced with the given property of that element.
* @param {Array} arr
* @param {string} prop
* @return {Array}
*/
function mapToProperty(arr, prop) {
return Array.isArray(arr) ? arr.map(elem => elem[prop]) : undefined;
}
/**
* Find all the values that are present in both lists. Returns undefined if
* the arguments are not both Arrays.

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

@ -158,6 +158,85 @@ add_task(async function testKeys() {
equal(pong, 2, "Properties are not reifed");
});
add_task(async function testLength() {
equal(
await FilterExpressions.eval("[1, null, {a: 2, b: 3}, Infinity]|length"),
4,
"length returns the length of the array it's applied to"
);
equal(
await FilterExpressions.eval("[]|length"),
0,
"length is zero for an empty array"
);
// Should be undefined for non-Arrays
equal(
await FilterExpressions.eval("5|length"),
undefined,
"length is undefined when applied to numbers"
);
equal(
await FilterExpressions.eval("null|length"),
undefined,
"length is undefined when applied to null"
);
equal(
await FilterExpressions.eval("undefined|length"),
undefined,
"length is undefined when applied to undefined"
);
equal(
await FilterExpressions.eval("{a: 1, b: 2, c: 3}|length"),
undefined,
"length is undefined when applied to non-Array objects"
);
});
add_task(async function testMapToProperty() {
Assert.deepEqual(
await FilterExpressions.eval('[{a: 1}, {a: {b: 10}}, {a: [5,6,7,8]}]|mapToProperty("a")'),
[1, {b: 10}, [5, 6, 7, 8]],
"mapToProperty returns an array of values when applied to an array of objects all with the property defined"
);
Assert.deepEqual(
await FilterExpressions.eval('[]|mapToProperty("a")'),
[],
"mapToProperty returns an empty array when applied to an empty array"
);
Assert.deepEqual(
await FilterExpressions.eval('[{a: 1}, {b: 2}, {a: 3}]|mapToProperty("a")'),
[1, undefined, 3],
"mapToProperty returns an array with undefined entries where the property is undefined"
);
// Should be undefined for non-Arrays
equal(
await FilterExpressions.eval('5|mapToProperty("a")'),
undefined,
"mapToProperty returns undefined when applied numbers"
);
equal(
await FilterExpressions.eval('null|mapToProperty("a")'),
undefined,
"mapToProperty returns undefined when applied null"
);
equal(
await FilterExpressions.eval('undefined|mapToProperty("a")'),
undefined,
"mapToProperty returns undefined when applied undefined"
);
equal(
await FilterExpressions.eval('{a: 1, b: 2, c: 3}|mapToProperty("a")'),
undefined,
"mapToProperty returns undefined when applied non-Array objects"
);
});
// intersect tests
add_task(async function testIntersect() {
let val;

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

@ -272,7 +272,7 @@ GetCharacterCodeName(const char16_t* aChars, uint32_t aLength)
if (!aLength) {
return EmptyCString();
}
nsAutoCString result;
nsCString result;
for (uint32_t i = 0; i < aLength; ++i) {
if (!result.IsEmpty()) {
result.AppendLiteral(", ");
@ -291,7 +291,7 @@ GetCharacterCodeName(const UniCharsAndModifiers& aUniCharsAndModifiers)
if (aUniCharsAndModifiers.IsEmpty()) {
return EmptyCString();
}
nsAutoCString result;
nsCString result;
for (uint32_t i = 0; i < aUniCharsAndModifiers.Length(); i++) {
if (!result.IsEmpty()) {
result.AppendLiteral(", ");
@ -578,7 +578,7 @@ private:
static const nsCString
ToString(const MSG& aMSG)
{
nsAutoCString result;
nsCString result;
result.AssignLiteral("{ message=");
result.Append(GetMessageName(aMSG.message).get());
result.AppendLiteral(", ");
@ -641,7 +641,7 @@ ToString(const UniCharsAndModifiers& aUniCharsAndModifiers)
if (aUniCharsAndModifiers.IsEmpty()) {
return NS_LITERAL_CSTRING("{}");
}
nsAutoCString result;
nsCString result;
result.AssignLiteral("{ ");
result.Append(GetCharacterCodeName(aUniCharsAndModifiers.CharAt(0)));
for (size_t i = 1; i < aUniCharsAndModifiers.Length(); ++i) {
@ -664,7 +664,7 @@ ToString(const UniCharsAndModifiers& aUniCharsAndModifiers)
const nsCString
ToString(const ModifierKeyState& aModifierKeyState)
{
nsAutoCString result;
nsCString result;
result.AssignLiteral("{ ");
result.Append(GetModifiersName(aModifierKeyState.GetModifiers()).get());
result.AppendLiteral(" }");
@ -2857,7 +2857,7 @@ GetResultOfInSendMessageEx()
if (!ret) {
return NS_LITERAL_CSTRING("ISMEX_NOSEND");
}
nsAutoCString result;
nsCString result;
if (ret & ISMEX_CALLBACK) {
result = "ISMEX_CALLBACK";
}
@ -4197,7 +4197,7 @@ KeyboardLayout::GetLayoutName(HKL aLayout) const
}
if (NS_WARN_IF((layout & 0xF000) != 0xF000)) {
nsAutoCString result;
nsCString result;
result.AppendPrintf("Odd HKL: 0x%08X",
reinterpret_cast<uintptr_t>(aLayout));
return result;

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

@ -68,7 +68,7 @@ HandleSeparator(nsCString& aDesc)
static const nsCString
GetFindFlagName(DWORD aFindFlag)
{
nsAutoCString description;
nsCString description;
if (!aFindFlag) {
description.AppendLiteral("no flags (0)");
return description;
@ -162,7 +162,7 @@ GetCLSIDNameStr(REFCLSID aCLSID)
return EmptyCString();
}
nsAutoCString result;
nsCString result;
result = NS_ConvertUTF16toUTF8(str);
::CoTaskMemFree(str);
return result;
@ -291,7 +291,7 @@ GetRIIDNameStr(REFIID aRIID)
nsAutoString key(L"Interface\\");
key += str;
nsAutoCString result;
nsCString result;
wchar_t buf[256];
if (WinUtils::GetRegistryKey(HKEY_CLASSES_ROOT, key.get(), nullptr,
buf, sizeof(buf))) {
@ -371,7 +371,7 @@ GetTextStoreReturnValueName(HRESULT aResult)
static const nsCString
GetSinkMaskNameStr(DWORD aSinkMask)
{
nsAutoCString description;
nsCString description;
if (aSinkMask & TS_AS_TEXT_CHANGE) {
description.AppendLiteral("TS_AS_TEXT_CHANGE");
}
@ -408,7 +408,7 @@ GetActiveSelEndName(TsActiveSelEnd aSelEnd)
static const nsCString
GetLockFlagNameStr(DWORD aLockFlags)
{
nsAutoCString description;
nsCString description;
if ((aLockFlags & TS_LF_READWRITE) == TS_LF_READWRITE) {
description.AppendLiteral("TS_LF_READWRITE");
} else if (aLockFlags & TS_LF_READ) {
@ -507,7 +507,7 @@ GetClauseAttrName(TF_DA_ATTR_INFO aAttr)
static nsCString
GetDisplayAttrStr(const TF_DISPLAYATTRIBUTE& aDispAttr)
{
nsAutoCString str;
nsCString str;
str = "crText:{ ";
str += GetColorName(aDispAttr.crText);
str += " }, crBk:{ ";
@ -549,7 +549,7 @@ GetMouseButtonsName(int16_t aButtons)
if (!aButtons) {
return NS_LITERAL_CSTRING("no buttons");
}
nsAutoCString names;
nsCString names;
if (aButtons & WidgetMouseEventBase::eLeftButtonFlag) {
names = "LeftButton";
}
@ -578,7 +578,7 @@ GetModifiersName(Modifiers aModifiers)
if (aModifiers == MODIFIER_NONE) {
return NS_LITERAL_CSTRING("no modifiers");
}
nsAutoCString names;
nsCString names;
if (aModifiers & MODIFIER_ALT) {
names = NS_DOM_KEYNAME_ALT;
}