зеркало из https://github.com/mozilla/gecko-dev.git
Merge m-c to autoland, a=merge
MozReview-Commit-ID: D76dMYwFRUQ
This commit is contained in:
Коммит
30d9ef4d29
|
@ -569,25 +569,12 @@ var Output = {
|
|||
}
|
||||
},
|
||||
|
||||
get androidBridge() {
|
||||
delete this.androidBridge;
|
||||
if (Utils.MozBuildApp === 'mobile/android') {
|
||||
this.androidBridge = Services.androidBridge;
|
||||
} else {
|
||||
this.androidBridge = null;
|
||||
}
|
||||
return this.androidBridge;
|
||||
},
|
||||
|
||||
Android: function Android(aDetails, aBrowser) {
|
||||
const ANDROID_VIEW_TEXT_CHANGED = 0x10;
|
||||
const ANDROID_VIEW_TEXT_SELECTION_CHANGED = 0x2000;
|
||||
|
||||
if (!this.androidBridge) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (let androidEvent of aDetails) {
|
||||
androidEvent.type = 'Accessibility:Event';
|
||||
if (androidEvent.bounds) {
|
||||
androidEvent.bounds = AccessFu.adjustContentBounds(
|
||||
androidEvent.bounds, aBrowser);
|
||||
|
@ -607,9 +594,8 @@ var Output = {
|
|||
androidEvent.brailleOutput);
|
||||
break;
|
||||
}
|
||||
let win = Utils.win;
|
||||
let view = win && win.QueryInterface(Ci.nsIAndroidView);
|
||||
view.dispatch('Accessibility:Event', androidEvent);
|
||||
|
||||
Utils.win.WindowEventDispatcher.sendRequest(androidEvent);
|
||||
}
|
||||
},
|
||||
|
||||
|
@ -805,9 +791,7 @@ var Input = {
|
|||
|
||||
if (Utils.MozBuildApp == 'mobile/android') {
|
||||
// Return focus to native Android browser chrome.
|
||||
let win = Utils.win;
|
||||
let view = win && win.QueryInterface(Ci.nsIAndroidView);
|
||||
view.dispatch('ToggleChrome:Focus');
|
||||
Utils.win.WindowEventDispatcher.dispatch('ToggleChrome:Focus');
|
||||
}
|
||||
break;
|
||||
case aEvent.DOM_VK_RETURN:
|
||||
|
|
|
@ -315,7 +315,7 @@ AndroidPresenter.prototype.actionInvoked =
|
|||
|
||||
// Checkable objects use TalkBack's text derived from the event state,
|
||||
// so we don't populate the text here.
|
||||
let text = '';
|
||||
let text = null;
|
||||
if (!state.contains(States.CHECKABLE)) {
|
||||
text = Utils.localize(UtteranceGenerator.genForAction(aObject,
|
||||
aActionName));
|
||||
|
|
|
@ -492,7 +492,6 @@
|
|||
@RESPATH@/components/nsWebHandlerApp.js
|
||||
@RESPATH@/components/satchel.manifest
|
||||
@RESPATH@/components/nsFormAutoComplete.js
|
||||
@RESPATH@/components/nsFormHistory.js
|
||||
@RESPATH@/components/FormHistoryStartup.js
|
||||
@RESPATH@/components/nsInputListAutoComplete.js
|
||||
@RESPATH@/components/formautofill.manifest
|
||||
|
|
|
@ -2143,12 +2143,16 @@
|
|||
<versionRange maxVersion="13.0.0.302" minVersion="13.0.0.302" severity="0" vulnerabilitystatus="1"/>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p1495" os="Linux">
|
||||
<match exp="" name="name"/>
|
||||
<match exp="libflashplayer\.so" name="filename"/>
|
||||
<match exp="" name="description"/>
|
||||
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
|
||||
<versionRange maxVersion="24.0.0.186" minVersion="23.0.0.207" severity="0" vulnerabilitystatus="1"/>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p1420">
|
||||
<pluginItem blockID="p1420" os="">
|
||||
<match exp="" name="name"/>
|
||||
<match exp="(NPSWF32.*\.dll)|(NPSWF64.*\.dll)|(Flash\ Player\.plugin)" name="filename"/>
|
||||
<match exp="" name="description"/>
|
||||
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
|
||||
<versionRange maxVersion="23.0.0.205" minVersion="23.0.0.185" severity="0" vulnerabilitystatus="1"/>
|
||||
</pluginItem>
|
||||
|
@ -2202,7 +2206,9 @@
|
|||
<versionRange maxVersion="*" minVersion="0"/>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p1419" os="Linux">
|
||||
<match exp="" name="name"/>
|
||||
<match exp="libflashplayer\.so" name="filename"/>
|
||||
<match exp="" name="description"/>
|
||||
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
|
||||
<versionRange maxVersion="11.2.202.643" minVersion="11.2.202.637" severity="0" vulnerabilitystatus="1"/>
|
||||
</pluginItem>
|
||||
|
@ -2459,8 +2465,10 @@
|
|||
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
|
||||
<versionRange maxVersion="18.0.0.232" minVersion="18.0.0.204" severity="0" vulnerabilitystatus="1"/>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p1274">
|
||||
<pluginItem blockID="p1274" os="">
|
||||
<match exp="" name="name"/>
|
||||
<match exp="(NPSWF32.*\.dll)|(NPSWF64.*\.dll)|(Flash\ Player\.plugin)" name="filename"/>
|
||||
<match exp="" name="description"/>
|
||||
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
|
||||
<versionRange maxVersion="22.0.0.211" minVersion="22.0.0.192" severity="0" vulnerabilitystatus="1"/>
|
||||
</pluginItem>
|
||||
|
@ -2571,8 +2579,10 @@
|
|||
</targetApplication>
|
||||
</versionRange>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p1494">
|
||||
<pluginItem blockID="p1494" os="">
|
||||
<match exp="" name="name"/>
|
||||
<match exp="(NPSWF32.*\.dll)|(NPSWF64.*\.dll)|(Flash\ Player\.plugin)" name="filename"/>
|
||||
<match exp="" name="description"/>
|
||||
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
|
||||
<versionRange maxVersion="24.0.0.186" minVersion="23.0.0.207" severity="0" vulnerabilitystatus="1"/>
|
||||
</pluginItem>
|
||||
|
@ -2640,8 +2650,10 @@
|
|||
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
|
||||
<versionRange maxVersion="18.0.0.352" minVersion="18.0.0.343" severity="0" vulnerabilitystatus="1"/>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p160">
|
||||
<pluginItem blockID="p160" os="">
|
||||
<match exp="" name="name"/>
|
||||
<match exp="NPSWF32\.dll" name="filename"/>
|
||||
<match exp="" name="description"/>
|
||||
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
|
||||
<versionRange maxVersion="10.2.9999" minVersion="0" severity="0" vulnerabilitystatus="1">
|
||||
<targetApplication id="{ec8030f7-c20a-464f-9b0e-13a3a9e97384}">
|
||||
|
@ -2810,7 +2822,9 @@
|
|||
<match exp="NPFFAddOn.dll" name="filename"/>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p1421" os="Linux">
|
||||
<match exp="" name="name"/>
|
||||
<match exp="libflashplayer\.so" name="filename"/>
|
||||
<match exp="" name="description"/>
|
||||
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
|
||||
<versionRange maxVersion="23.0.0.207" minVersion="11.2.202.643" severity="0" vulnerabilitystatus="1"/>
|
||||
</pluginItem>
|
||||
|
@ -3006,8 +3020,10 @@
|
|||
<infoURL>https://get.adobe.com/reader</infoURL>
|
||||
<versionRange maxVersion="15.006.30174" minVersion="15.006.30174" severity="0" vulnerabilitystatus="1"/>
|
||||
</pluginItem>
|
||||
<pluginItem blockID="p1422">
|
||||
<pluginItem blockID="p1422" os="">
|
||||
<match exp="" name="name"/>
|
||||
<match exp="(NPSWF32.*\.dll)|(NPSWF64.*\.dll)|(Flash\ Player\.plugin)" name="filename"/>
|
||||
<match exp="" name="description"/>
|
||||
<infoURL>https://get.adobe.com/flashplayer/</infoURL>
|
||||
<versionRange maxVersion="23.0.0.207" minVersion="23.0.0.205" severity="0" vulnerabilitystatus="1"/>
|
||||
</pluginItem>
|
||||
|
|
|
@ -1,9 +1,8 @@
|
|||
/* Any copyright is dedicated to the Public Domain.
|
||||
http://creativecommons.org/publicdomain/zero/1.0/ */
|
||||
|
||||
// This test checks that a <select> with an <optgroup> opens and can be navigated
|
||||
// in a child process. This is different than single-process as a <menulist> is used
|
||||
// to implement the dropdown list.
|
||||
// This test tests <select> in a child process. This is different than
|
||||
// single-process as a <menulist> is used to implement the dropdown list.
|
||||
|
||||
requestLongerTimeout(2);
|
||||
|
||||
|
@ -851,3 +850,35 @@ add_task(function* test_colors_applied_to_popup() {
|
|||
yield hideSelectPopup(selectPopup, "escape");
|
||||
yield BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
||||
// This test checks that the popup is closed when the select element is blurred.
|
||||
add_task(function* test_blur_hides_popup() {
|
||||
const pageUrl = "data:text/html," + escape(PAGECONTENT_SMALL);
|
||||
let tab = yield BrowserTestUtils.openNewForegroundTab(gBrowser, pageUrl);
|
||||
|
||||
yield ContentTask.spawn(tab.linkedBrowser, null, function*() {
|
||||
content.addEventListener("blur", function(event) {
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
}, true);
|
||||
|
||||
content.document.getElementById("one").focus();
|
||||
});
|
||||
|
||||
let menulist = document.getElementById("ContentSelectDropdown");
|
||||
let selectPopup = menulist.menupopup;
|
||||
|
||||
yield openSelectPopup(selectPopup);
|
||||
|
||||
let popupHiddenPromise = BrowserTestUtils.waitForEvent(selectPopup, "popuphidden");
|
||||
|
||||
yield ContentTask.spawn(tab.linkedBrowser, null, function*() {
|
||||
content.document.getElementById("one").blur();
|
||||
});
|
||||
|
||||
yield popupHiddenPromise;
|
||||
|
||||
ok(true, "Blur closed popup");
|
||||
|
||||
yield BrowserTestUtils.removeTab(tab);
|
||||
});
|
||||
|
|
|
@ -33,9 +33,10 @@
|
|||
"size": 1020700
|
||||
},
|
||||
{
|
||||
"size": 57060,
|
||||
"version": "https://github.com/andreas56/libdmg-hfsplus rev 81dd75fd1549b24bf8af9736ac25518b367e6b63",
|
||||
"size": 62032,
|
||||
"visibility": "public",
|
||||
"digest": "9649ca595f4cf088d118da26201f92cc94cda7af49c7c48112ee31cd13c83b2935b3e145de9dd78060cff2480b4c2e7ff5fb24235876956fed13c87852071998",
|
||||
"digest": "9073c41034784eb8823ec817aed42bbc65c8da63ad3fac572726fa48b36320ee302ca8f51b23576e7fdbeec6ab300610d0c58bbd9c52024577dfdb13d95aa2ec",
|
||||
"algorithm": "sha512",
|
||||
"unpack": true,
|
||||
"filename": "dmg.tar.xz"
|
||||
|
|
|
@ -465,7 +465,6 @@
|
|||
@RESPATH@/components/nsWebHandlerApp.js
|
||||
@RESPATH@/components/satchel.manifest
|
||||
@RESPATH@/components/nsFormAutoComplete.js
|
||||
@RESPATH@/components/nsFormHistory.js
|
||||
@RESPATH@/components/FormHistoryStartup.js
|
||||
@RESPATH@/components/nsInputListAutoComplete.js
|
||||
@RESPATH@/components/formautofill.manifest
|
||||
|
|
|
@ -10,6 +10,8 @@
|
|||
"use strict";
|
||||
|
||||
const EventEmitter = require("devtools/shared/event-emitter");
|
||||
const {colorUtils} = require("devtools/shared/css/color");
|
||||
|
||||
const XHTML_NS = "http://www.w3.org/1999/xhtml";
|
||||
|
||||
/**
|
||||
|
@ -63,8 +65,35 @@ function ColorWidget(parentEl, rgb) {
|
|||
<div class="colorwidget-alpha-handle colorwidget-slider-control"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="colorwidget-value">
|
||||
<select class="colorwidget-select">
|
||||
<option value="hex">Hex</option>
|
||||
<option value="rgba">RGBA</option>
|
||||
<option value="hsla">HSLA</option>
|
||||
</select>
|
||||
<div class="colorwidget-hex">
|
||||
<input class="colorwidget-hex-input"/>
|
||||
</div>
|
||||
<div class="colorwidget-rgba colorwidget-hidden">
|
||||
<input class="colorwidget-rgba-r" data-id="r" />
|
||||
<input class="colorwidget-rgba-g" data-id="g" />
|
||||
<input class="colorwidget-rgba-b" data-id="b" />
|
||||
<input class="colorwidget-rgba-a" data-id="a" />
|
||||
</div>
|
||||
<div class="colorwidget-hsla colorwidget-hidden">
|
||||
<input class="colorwidget-hsla-h" data-id="h" />
|
||||
<input class="colorwidget-hsla-s" data-id="s" />
|
||||
<input class="colorwidget-hsla-l" data-id="l" />
|
||||
<input class="colorwidget-hsla-a" data-id="a" />
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
this.onSelectValueChange = this.onSelectValueChange.bind(this);
|
||||
this.onHexInputChange = this.onHexInputChange.bind(this);
|
||||
this.onRgbaInputChange = this.onRgbaInputChange.bind(this);
|
||||
this.onHslaInputChange = this.onHslaInputChange.bind(this);
|
||||
|
||||
this.onElementClick = this.onElementClick.bind(this);
|
||||
this.element.addEventListener("click", this.onElementClick);
|
||||
|
||||
|
@ -83,6 +112,31 @@ function ColorWidget(parentEl, rgb) {
|
|||
this.alphaSliderHelper = this.element.querySelector(".colorwidget-alpha-handle");
|
||||
ColorWidget.draggable(this.alphaSliderInner, this.onAlphaSliderMove.bind(this));
|
||||
|
||||
this.colorSelect = this.element.querySelector(".colorwidget-select");
|
||||
this.colorSelect.addEventListener("change", this.onSelectValueChange);
|
||||
|
||||
this.hexValue = this.element.querySelector(".colorwidget-hex");
|
||||
this.hexValueInput = this.element.querySelector(".colorwidget-hex-input");
|
||||
this.hexValueInput.addEventListener("input", this.onHexInputChange);
|
||||
|
||||
this.rgbaValue = this.element.querySelector(".colorwidget-rgba");
|
||||
this.rgbaValueInputs = {
|
||||
r: this.element.querySelector(".colorwidget-rgba-r"),
|
||||
g: this.element.querySelector(".colorwidget-rgba-g"),
|
||||
b: this.element.querySelector(".colorwidget-rgba-b"),
|
||||
a: this.element.querySelector(".colorwidget-rgba-a"),
|
||||
};
|
||||
this.rgbaValue.addEventListener("input", this.onRgbaInputChange);
|
||||
|
||||
this.hslaValue = this.element.querySelector(".colorwidget-hsla");
|
||||
this.hslaValueInputs = {
|
||||
h: this.element.querySelector(".colorwidget-hsla-h"),
|
||||
s: this.element.querySelector(".colorwidget-hsla-s"),
|
||||
l: this.element.querySelector(".colorwidget-hsla-l"),
|
||||
a: this.element.querySelector(".colorwidget-hsla-a"),
|
||||
};
|
||||
this.hslaValue.addEventListener("input", this.onHslaInputChange);
|
||||
|
||||
if (rgb) {
|
||||
this.rgb = rgb;
|
||||
this.updateUI();
|
||||
|
@ -137,6 +191,10 @@ ColorWidget.rgbToHsv = function (r, g, b, a) {
|
|||
return [h, s, v, a];
|
||||
};
|
||||
|
||||
ColorWidget.hslToCssString = function (h, s, l, a) {
|
||||
return `hsla(${h}, ${s}%, ${l}%, ${a})`;
|
||||
};
|
||||
|
||||
ColorWidget.draggable = function (element, onmove, onstart, onstop) {
|
||||
onmove = onmove || function () {};
|
||||
onstart = onstart || function () {};
|
||||
|
@ -210,6 +268,9 @@ ColorWidget.draggable = function (element, onmove, onstart, onstop) {
|
|||
ColorWidget.prototype = {
|
||||
set rgb(color) {
|
||||
this.hsv = ColorWidget.rgbToHsv(color[0], color[1], color[2], color[3]);
|
||||
|
||||
let { h, s, l } = new colorUtils.CssColor(this.rgbCssString)._getHSLATuple();
|
||||
this.hsl = [h, s, l, color[3]];
|
||||
},
|
||||
|
||||
get rgb() {
|
||||
|
@ -250,6 +311,7 @@ ColorWidget.prototype = {
|
|||
|
||||
onSliderMove: function (dragX, dragY) {
|
||||
this.hsv[0] = (dragY / this.slideHeight);
|
||||
this.hsl[0] = (dragY / this.slideHeight) * 360;
|
||||
this.updateUI();
|
||||
this.onChange();
|
||||
},
|
||||
|
@ -257,12 +319,130 @@ ColorWidget.prototype = {
|
|||
onDraggerMove: function (dragX, dragY) {
|
||||
this.hsv[1] = dragX / this.dragWidth;
|
||||
this.hsv[2] = (this.dragHeight - dragY) / this.dragHeight;
|
||||
|
||||
this.hsl[2] = ((2 - this.hsv[1]) * this.hsv[2] / 2);
|
||||
if (this.hsl[2] && this.hsl[2] < 1) {
|
||||
this.hsl[1] = this.hsv[1] * this.hsv[2] /
|
||||
(this.hsl[2] < 0.5 ? this.hsl[2] * 2 : 2 - this.hsl[2] * 2);
|
||||
this.hsl[1] = this.hsl[1] * 100;
|
||||
}
|
||||
this.hsl[2] = this.hsl[2] * 100;
|
||||
|
||||
this.updateUI();
|
||||
this.onChange();
|
||||
},
|
||||
|
||||
onAlphaSliderMove: function (dragX, dragY) {
|
||||
this.hsv[3] = dragX / this.alphaSliderWidth;
|
||||
this.hsl[3] = dragX / this.alphaSliderWidth;
|
||||
this.updateUI();
|
||||
this.onChange();
|
||||
},
|
||||
|
||||
onSelectValueChange: function (event) {
|
||||
const selection = event.target.value;
|
||||
this.colorSelect.classList.remove("colorwidget-select-spacing");
|
||||
this.hexValue.classList.add("colorwidget-hidden");
|
||||
this.rgbaValue.classList.add("colorwidget-hidden");
|
||||
this.hslaValue.classList.add("colorwidget-hidden");
|
||||
|
||||
switch (selection) {
|
||||
case "hex":
|
||||
this.hexValue.classList.remove("colorwidget-hidden");
|
||||
break;
|
||||
case "rgba":
|
||||
this.colorSelect.classList.add("colorwidget-select-spacing");
|
||||
this.rgbaValue.classList.remove("colorwidget-hidden");
|
||||
break;
|
||||
case "hsla":
|
||||
this.colorSelect.classList.add("colorwidget-select-spacing");
|
||||
this.hslaValue.classList.remove("colorwidget-hidden");
|
||||
break;
|
||||
}
|
||||
},
|
||||
|
||||
onHexInputChange: function (event) {
|
||||
const hex = event.target.value;
|
||||
const color = new colorUtils.CssColor(hex, true);
|
||||
if (!color.rgba) {
|
||||
return;
|
||||
}
|
||||
|
||||
const { r, g, b, a } = color._getRGBATuple();
|
||||
this.rgb = [r, g, b, a];
|
||||
this.updateUI();
|
||||
this.onChange();
|
||||
},
|
||||
|
||||
onRgbaInputChange: function (event) {
|
||||
const field = event.target.dataset.id;
|
||||
const value = event.target.value.toString();
|
||||
if (!value || isNaN(value) || value.endsWith(".")) {
|
||||
return;
|
||||
}
|
||||
|
||||
let rgb = this.rgb;
|
||||
|
||||
switch (field) {
|
||||
case "r":
|
||||
rgb[0] = value;
|
||||
break;
|
||||
case "g":
|
||||
rgb[1] = value;
|
||||
break;
|
||||
case "b":
|
||||
rgb[2] = value;
|
||||
break;
|
||||
case "a":
|
||||
rgb[3] = Math.min(value, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
this.rgb = rgb;
|
||||
|
||||
this.updateUI();
|
||||
this.onChange();
|
||||
},
|
||||
|
||||
onHslaInputChange: function (event) {
|
||||
const field = event.target.dataset.id;
|
||||
let value = event.target.value.toString();
|
||||
if ((field === "s" || field === "l") && !value.endsWith("%")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (value.endsWith("%")) {
|
||||
value = value.substring(0, value.length - 1);
|
||||
}
|
||||
|
||||
if (!value || isNaN(value) || value.endsWith(".")) {
|
||||
return;
|
||||
}
|
||||
|
||||
const hsl = this.hsl;
|
||||
|
||||
switch (field) {
|
||||
case "h":
|
||||
hsl[0] = value;
|
||||
break;
|
||||
case "s":
|
||||
hsl[1] = value;
|
||||
break;
|
||||
case "l":
|
||||
hsl[2] = value;
|
||||
break;
|
||||
case "a":
|
||||
hsl[3] = Math.min(value, 1);
|
||||
break;
|
||||
}
|
||||
|
||||
const cssString = ColorWidget.hslToCssString(hsl[0], hsl[1], hsl[2], hsl[3]);
|
||||
const { r, g, b, a } = new colorUtils.CssColor(cssString)._getRGBATuple();
|
||||
|
||||
this.rgb = [r, g, b, a];
|
||||
|
||||
this.hsl = hsl;
|
||||
|
||||
this.updateUI();
|
||||
this.onChange();
|
||||
},
|
||||
|
@ -307,6 +487,24 @@ ColorWidget.prototype = {
|
|||
let alphaSliderX = (this.hsv[3] * this.alphaSliderWidth) -
|
||||
(this.alphaSliderHelperWidth / 2);
|
||||
this.alphaSliderHelper.style.left = alphaSliderX + "px";
|
||||
|
||||
const color = new colorUtils.CssColor(this.rgbCssString);
|
||||
|
||||
// Updating the hex field
|
||||
this.hexValueInput.value = color.hex;
|
||||
|
||||
// Updating the RGBA fields
|
||||
const rgb = this.rgb;
|
||||
this.rgbaValueInputs.r.value = rgb[0];
|
||||
this.rgbaValueInputs.g.value = rgb[1];
|
||||
this.rgbaValueInputs.b.value = rgb[2];
|
||||
this.rgbaValueInputs.a.value = parseFloat(rgb[3].toFixed(1));
|
||||
|
||||
// Updating the HSLA fields
|
||||
this.hslaValueInputs.h.value = this.hsl[0];
|
||||
this.hslaValueInputs.s.value = this.hsl[1] + "%";
|
||||
this.hslaValueInputs.l.value = this.hsl[2] + "%";
|
||||
this.hslaValueInputs.a.value = parseFloat(this.hsl[3].toFixed(1));
|
||||
},
|
||||
|
||||
updateUI: function () {
|
||||
|
|
|
@ -153,3 +153,59 @@ http://www.briangrinstead.com/blog/keep-aspect-ratio-with-html-and-css */
|
|||
left: -3px;
|
||||
right: -3px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Color Widget Editor
|
||||
*/
|
||||
|
||||
.colorwidget-value {
|
||||
position: relative;
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
||||
/**
|
||||
* Color Widget Select
|
||||
*/
|
||||
|
||||
.colorwidget-select {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.colorwidget-select-spacing {
|
||||
letter-spacing: 40px;
|
||||
}
|
||||
|
||||
.colorwidget-select-spacing option {
|
||||
letter-spacing: initial;
|
||||
}
|
||||
|
||||
/**
|
||||
* Color Widget Inputs
|
||||
*/
|
||||
|
||||
.colorwidget-hidden {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.colorwidget-hex,
|
||||
.colorwidget-rgba,
|
||||
.colorwidget-hsla {
|
||||
width: 200px;
|
||||
font-size: 0;
|
||||
}
|
||||
|
||||
.colorwidget-hex-input {
|
||||
width: 192px;
|
||||
}
|
||||
|
||||
.colorwidget-rgba-r,
|
||||
.colorwidget-rgba-g,
|
||||
.colorwidget-rgba-b,
|
||||
.colorwidget-rgba-a,
|
||||
.colorwidget-hsla-h,
|
||||
.colorwidget-hsla-s,
|
||||
.colorwidget-hsla-l,
|
||||
.colorwidget-hsla-a {
|
||||
width: 42px;
|
||||
margin: 0;
|
||||
}
|
|
@ -74,13 +74,13 @@ SwatchColorPickerTooltip.prototype = Heritage.extend(SwatchBasedEditorTooltip.pr
|
|||
eyedropper.style.pointerEvents = "auto";
|
||||
container.appendChild(eyedropper);
|
||||
|
||||
this.tooltip.setContent(container, { width: 218, height: 224 });
|
||||
|
||||
let spectrum;
|
||||
if (NEW_COLOR_WIDGET) {
|
||||
this.tooltip.setContent(container, { width: 218, height: 271 });
|
||||
const {ColorWidget} = require("devtools/client/shared/widgets/ColorWidget");
|
||||
spectrum = new ColorWidget(spectrumNode, color);
|
||||
} else {
|
||||
this.tooltip.setContent(container, { width: 218, height: 224 });
|
||||
spectrum = new Spectrum(spectrumNode, color);
|
||||
}
|
||||
|
||||
|
|
|
@ -408,6 +408,23 @@ CssColor.prototype = {
|
|||
return tuple;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns a HSLA 4-Tuple representation of a color or transparent as
|
||||
* appropriate.
|
||||
*/
|
||||
_getHSLATuple: function () {
|
||||
let {r, g, b, a} = colorToRGBA(this.authored, this.cssColor4);
|
||||
|
||||
let [h, s, l] = rgbToHsl([r, g, b]);
|
||||
|
||||
return {
|
||||
h,
|
||||
s,
|
||||
l,
|
||||
a: parseFloat(a.toFixed(1))
|
||||
};
|
||||
},
|
||||
|
||||
_hsl: function (maybeAlpha) {
|
||||
if (this.lowerCased.startsWith("hsl(") && maybeAlpha === undefined) {
|
||||
// We can use it as-is.
|
||||
|
|
|
@ -12607,7 +12607,7 @@ nsDocShell::LoadHistoryEntry(nsISHEntry* aEntry, uint32_t aLoadType)
|
|||
MOZ_ASSERT(triggeringPrincipal,
|
||||
"need a valid triggeringPrincipal to load from history");
|
||||
if (!triggeringPrincipal) {
|
||||
return NS_ERROR_FAILURE;
|
||||
triggeringPrincipal = nsContentUtils::GetSystemPrincipal();
|
||||
}
|
||||
|
||||
// Passing nullptr as aSourceDocShell gives the same behaviour as before
|
||||
|
|
|
@ -13,6 +13,8 @@
|
|||
#include "nsGlobalWindow.h"
|
||||
#include "nsString.h"
|
||||
#include "xpcpublic.h" // For xpc::NativeGlobal
|
||||
#include "mozilla/EffectSet.h"
|
||||
#include "mozilla/dom/KeyframeEffectReadOnly.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -83,4 +85,17 @@ AnimationUtils::IsCoreAPIEnabledForCaller(dom::CallerType aCallerType)
|
|||
return IsCoreAPIEnabled() || aCallerType == dom::CallerType::System;
|
||||
}
|
||||
|
||||
/* static */ bool
|
||||
AnimationUtils::EffectSetContainsAnimatedScale(EffectSet& aEffects,
|
||||
const nsIFrame* aFrame)
|
||||
{
|
||||
for (const dom::KeyframeEffectReadOnly* effect : aEffects) {
|
||||
if (effect->ContainsAnimatedScale(aFrame)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -14,11 +14,13 @@
|
|||
|
||||
class nsIContent;
|
||||
class nsIDocument;
|
||||
class nsIFrame;
|
||||
struct JSContext;
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
class ComputedTimingFunction;
|
||||
class EffectSet;
|
||||
|
||||
class AnimationUtils
|
||||
{
|
||||
|
@ -73,6 +75,13 @@ public:
|
|||
* true or the caller is chrome.
|
||||
*/
|
||||
static bool IsCoreAPIEnabledForCaller(dom::CallerType aCallerType);
|
||||
|
||||
/**
|
||||
* Returns true if the given EffectSet contains a current effect that animates
|
||||
* scale. |aFrame| is used for calculation of scale values.
|
||||
*/
|
||||
static bool EffectSetContainsAnimatedScale(EffectSet& aEffects,
|
||||
const nsIFrame* aFrame);
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -1763,5 +1763,54 @@ KeyframeEffectReadOnly::NeedsBaseStyle(nsCSSPropertyID aProperty) const
|
|||
return false;
|
||||
}
|
||||
|
||||
bool
|
||||
KeyframeEffectReadOnly::ContainsAnimatedScale(const nsIFrame* aFrame) const
|
||||
{
|
||||
if (!IsCurrent()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (const AnimationProperty& prop : mProperties) {
|
||||
if (prop.mProperty != eCSSProperty_transform) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (NeedsBaseStyle(prop.mProperty)) {
|
||||
StyleAnimationValue baseStyle =
|
||||
EffectCompositor::GetBaseStyle(prop.mProperty, aFrame);
|
||||
MOZ_ASSERT(!baseStyle.IsNull(), "The base value should be set");
|
||||
if (baseStyle.IsNull()) {
|
||||
// If we failed to get the base style, we consider it has scale value
|
||||
// here for the safety.
|
||||
return true;
|
||||
}
|
||||
gfxSize size = baseStyle.GetScaleValue(aFrame);
|
||||
if (size != gfxSize(1.0f, 1.0f)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
// This is actually overestimate because there are some cases that combining
|
||||
// the base value and from/to value produces 1:1 scale. But it doesn't
|
||||
// really matter.
|
||||
for (const AnimationPropertySegment& segment : prop.mSegments) {
|
||||
if (!segment.mFromValue.IsNull()) {
|
||||
gfxSize from = segment.mFromValue.GetScaleValue(aFrame);
|
||||
if (from != gfxSize(1.0f, 1.0f)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
if (!segment.mToValue.IsNull()) {
|
||||
gfxSize to = segment.mToValue.GetScaleValue(aFrame);
|
||||
if (to != gfxSize(1.0f, 1.0f)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -288,6 +288,10 @@ public:
|
|||
// needs a base style to composite with.
|
||||
bool NeedsBaseStyle(nsCSSPropertyID aProperty) const;
|
||||
|
||||
// Returns true if the effect is current state and has scale animation.
|
||||
// |aFrame| is used for calculation of scale values.
|
||||
bool ContainsAnimatedScale(const nsIFrame* aFrame) const;
|
||||
|
||||
protected:
|
||||
KeyframeEffectReadOnly(nsIDocument* aDocument,
|
||||
const Maybe<OwningAnimationTarget>& aTarget,
|
||||
|
|
|
@ -44,6 +44,7 @@
|
|||
|
||||
class nsIFrame;
|
||||
class nsIDOMMozNamedAttrMap;
|
||||
class nsIMozBrowserFrame;
|
||||
class nsIURI;
|
||||
class nsIScrollableFrame;
|
||||
class nsAttrValueOrString;
|
||||
|
@ -339,6 +340,16 @@ public:
|
|||
*/
|
||||
virtual bool IsInteractiveHTMLContent(bool aIgnoreTabindex) const;
|
||||
|
||||
/**
|
||||
* Returns |this| as an nsIMozBrowserFrame* if the element is a frame or
|
||||
* iframe element.
|
||||
*
|
||||
* We have this method, rather than using QI, so that we can use it during
|
||||
* the servo traversal, where we can't QI DOM nodes because of non-thread-safe
|
||||
* refcounts.
|
||||
*/
|
||||
virtual nsIMozBrowserFrame* GetAsMozBrowserFrame() { return nullptr; }
|
||||
|
||||
/**
|
||||
* Is the attribute named stored in the mapped attributes?
|
||||
*
|
||||
|
|
|
@ -33,6 +33,7 @@
|
|||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsNullPrincipal.h"
|
||||
#include "ScriptSettings.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/dom/LocationBinding.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
@ -699,9 +700,17 @@ Location::SetProtocol(const nsAString& aProtocol)
|
|||
return rv;
|
||||
}
|
||||
|
||||
rv = uri->SetScheme(NS_ConvertUTF16toUTF8(aProtocol));
|
||||
nsAString::const_iterator start, end;
|
||||
aProtocol.BeginReading(start);
|
||||
aProtocol.EndReading(end);
|
||||
nsAString::const_iterator iter(start);
|
||||
Unused << FindCharInReadable(':', iter, end);
|
||||
|
||||
rv = uri->SetScheme(NS_ConvertUTF16toUTF8(Substring(start, iter)));
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
// Oh, I wish nsStandardURL returned NS_ERROR_MALFORMED_URI for _all_ the
|
||||
// malformed cases, not just some of them!
|
||||
return NS_ERROR_DOM_SYNTAX_ERR;
|
||||
}
|
||||
nsAutoCString newSpec;
|
||||
rv = uri->GetSpec(newSpec);
|
||||
|
@ -711,9 +720,29 @@ Location::SetProtocol(const nsAString& aProtocol)
|
|||
// We may want a new URI class for the new URI, so recreate it:
|
||||
rv = NS_NewURI(getter_AddRefs(uri), newSpec);
|
||||
if (NS_FAILED(rv)) {
|
||||
if (rv == NS_ERROR_MALFORMED_URI) {
|
||||
rv = NS_ERROR_DOM_SYNTAX_ERR;
|
||||
}
|
||||
return rv;
|
||||
}
|
||||
|
||||
bool isHttp;
|
||||
rv = uri->SchemeIs("http", &isHttp);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
bool isHttps;
|
||||
rv = uri->SchemeIs("https", &isHttps);
|
||||
if (NS_WARN_IF(NS_FAILED(rv))) {
|
||||
return rv;
|
||||
}
|
||||
|
||||
if (!isHttp && !isHttps) {
|
||||
// No-op, per spec.
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
return SetURI(uri);
|
||||
}
|
||||
|
||||
|
|
|
@ -1229,7 +1229,7 @@ BeaconStreamListener::OnDataAvailable(nsIRequest *aRequest,
|
|||
|
||||
bool
|
||||
Navigator::SendBeacon(const nsAString& aUrl,
|
||||
const Nullable<ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams>& aData,
|
||||
const Nullable<fetch::BodyInit>& aData,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
if (aData.IsNull()) {
|
||||
|
|
|
@ -9,6 +9,7 @@
|
|||
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/dom/BindingDeclarations.h"
|
||||
#include "mozilla/dom/Fetch.h"
|
||||
#include "mozilla/dom/Nullable.h"
|
||||
#include "mozilla/ErrorResult.h"
|
||||
#include "nsIDOMNavigator.h"
|
||||
|
@ -226,7 +227,7 @@ public:
|
|||
Presentation* GetPresentation(ErrorResult& aRv);
|
||||
|
||||
bool SendBeacon(const nsAString& aUrl,
|
||||
const Nullable<ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams>& aData,
|
||||
const Nullable<fetch::BodyInit>& aData,
|
||||
ErrorResult& aRv);
|
||||
|
||||
void MozGetUserMedia(const MediaStreamConstraints& aConstraints,
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
#include "nsUnicharUtils.h"
|
||||
#include "mozilla/MemoryReporting.h"
|
||||
#include "mozilla/ServoBindingTypes.h"
|
||||
#include "mozilla/ServoStyleSet.h"
|
||||
#include "mozilla/DeclarationBlockInlines.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsReadableUtils.h"
|
||||
|
@ -647,7 +648,15 @@ nsAttrValue::ToString(nsAString& aResult) const
|
|||
if (DeclarationBlock* decl = container->mValue.mCSSDeclaration) {
|
||||
decl->ToString(aResult);
|
||||
}
|
||||
const_cast<nsAttrValue*>(this)->SetMiscAtomOrString(&aResult);
|
||||
|
||||
// We can reach this during parallel style traversal. If that happens,
|
||||
// don't cache the string. The TLS overhead should't hurt us here, since
|
||||
// main thread consumers will subsequently use the cache, and
|
||||
// off-main-thread consumers only reach this in the rare case of selector
|
||||
// matching on the "style" attribute.
|
||||
if (!ServoStyleSet::IsInServoTraversal()) {
|
||||
const_cast<nsAttrValue*>(this)->SetMiscAtomOrString(&aResult);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -4037,6 +4037,10 @@ nsIDocument::GetRootElement() const
|
|||
Element*
|
||||
nsDocument::GetRootElementInternal() const
|
||||
{
|
||||
// We invoke GetRootElement() immediately before the servo traversal, so we
|
||||
// should always have a cache hit from Servo.
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
||||
// Loop backwards because any non-elements, such as doctypes and PIs
|
||||
// are likely to appear before the root element.
|
||||
uint32_t i;
|
||||
|
|
|
@ -88,6 +88,7 @@
|
|||
#include "mozilla/Telemetry.h"
|
||||
#include "mozilla/dom/HTMLObjectElementBinding.h"
|
||||
#include "mozilla/dom/HTMLSharedObjectElement.h"
|
||||
#include "mozilla/dom/HTMLObjectElement.h"
|
||||
#include "nsChannelClassifier.h"
|
||||
|
||||
#ifdef XP_WIN
|
||||
|
@ -97,13 +98,6 @@
|
|||
#endif
|
||||
#endif // XP_WIN
|
||||
|
||||
#ifdef XP_MACOSX
|
||||
// HandlePluginCrashed() and HandlePluginInstantiated() needed from here to
|
||||
// fix bug 1147521. Should later be replaced by proper interface methods,
|
||||
// maybe on nsIObjectLoadingContext.
|
||||
#include "mozilla/dom/HTMLObjectElement.h"
|
||||
#endif
|
||||
|
||||
static NS_DEFINE_CID(kAppShellCID, NS_APPSHELL_CID);
|
||||
|
||||
static const char *kPrefJavaMIME = "plugin.java.mime";
|
||||
|
@ -3018,7 +3012,7 @@ nsObjectLoadingContent::LoadFallback(FallbackType aType, bool aNotify) {
|
|||
// Fixup mFallbackType
|
||||
//
|
||||
nsCOMPtr<nsIContent> thisContent =
|
||||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
||||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
||||
NS_ASSERTION(thisContent, "must be a content");
|
||||
|
||||
if (!thisContent->IsHTMLElement() || mContentType.IsEmpty()) {
|
||||
|
@ -3031,8 +3025,10 @@ nsObjectLoadingContent::LoadFallback(FallbackType aType, bool aNotify) {
|
|||
// child embeds as we find them in the upcoming loop.
|
||||
mType = eType_Null;
|
||||
|
||||
// Do a breadth-first traverse of node tree with the current element as root,
|
||||
// looking for the first embed we can find.
|
||||
bool thisIsObject = thisContent->IsHTMLElement(nsGkAtoms::object);
|
||||
|
||||
// Do a depth-first traverse of node tree with the current element as root,
|
||||
// looking for <embed> or <object> elements that might now need to load.
|
||||
nsTArray<nsINodeList*> childNodes;
|
||||
if ((thisContent->IsHTMLElement(nsGkAtoms::object) ||
|
||||
thisContent->IsHTMLElement(nsGkAtoms::applet)) &&
|
||||
|
@ -3048,10 +3044,11 @@ nsObjectLoadingContent::LoadFallback(FallbackType aType, bool aNotify) {
|
|||
nsStyleUtil::IsSignificantChild(child, true, false)) {
|
||||
aType = eFallbackAlternate;
|
||||
}
|
||||
if (child->IsHTMLElement(nsGkAtoms::embed) &&
|
||||
thisContent->IsHTMLElement(nsGkAtoms::object)) {
|
||||
HTMLSharedObjectElement* object = static_cast<HTMLSharedObjectElement*>(child);
|
||||
if (object) {
|
||||
if (thisIsObject) {
|
||||
if (child->IsHTMLElement(nsGkAtoms::embed)) {
|
||||
HTMLSharedObjectElement* embed = static_cast<HTMLSharedObjectElement*>(child);
|
||||
embed->StartObjectLoad(true, true);
|
||||
} else if (auto object = HTMLObjectElement::FromContent(child)) {
|
||||
object->StartObjectLoad(true, true);
|
||||
}
|
||||
}
|
||||
|
@ -3817,6 +3814,38 @@ nsObjectLoadingContent::MaybeFireErrorEvent()
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
nsObjectLoadingContent::BlockEmbedOrObjectContentLoading()
|
||||
{
|
||||
nsCOMPtr<nsIContent> thisContent =
|
||||
do_QueryInterface(static_cast<nsIImageLoadingContent*>(this));
|
||||
if (!thisContent->IsHTMLElement(nsGkAtoms::embed) &&
|
||||
!thisContent->IsHTMLElement(nsGkAtoms::object)) {
|
||||
// Doesn't apply to other elements (i.e. <applet>)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Traverse up the node tree to see if we have any ancestors that may block us
|
||||
// from loading
|
||||
for (nsIContent* parent = thisContent->GetParent();
|
||||
parent;
|
||||
parent = parent->GetParent()) {
|
||||
if (parent->IsAnyOfHTMLElements(nsGkAtoms::video, nsGkAtoms::audio)) {
|
||||
return true;
|
||||
}
|
||||
// If we have an ancestor that is an object with a source, it'll have an
|
||||
// associated displayed type. If that type is not null, don't load content
|
||||
// for the embed.
|
||||
if (HTMLObjectElement* object = HTMLObjectElement::FromContent(parent)) {
|
||||
uint32_t type = object->DisplayedType();
|
||||
if (type != eType_Null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
// SetupProtoChainRunner implementation
|
||||
nsObjectLoadingContent::SetupProtoChainRunner::SetupProtoChainRunner(
|
||||
nsObjectLoadingContent* aContent)
|
||||
|
|
|
@ -334,6 +334,21 @@ class nsObjectLoadingContent : public nsImageLoadingContent
|
|||
*/
|
||||
virtual nsContentPolicyType GetContentPolicyType() const = 0;
|
||||
|
||||
/**
|
||||
* Decides whether we should load <embed>/<object> node content.
|
||||
*
|
||||
* If this is an <embed> or <object> node there are cases in which we should
|
||||
* not try to load the content:
|
||||
*
|
||||
* - If the node is the child of a media element
|
||||
* - If the node is the child of an <object> node that already has
|
||||
* content being loaded.
|
||||
*
|
||||
* In these cases, this function will return false, which will cause
|
||||
* us to skip calling LoadObject.
|
||||
*/
|
||||
bool BlockEmbedOrObjectContentLoading();
|
||||
|
||||
private:
|
||||
|
||||
// Object parameter changes returned by UpdateObjectParameters
|
||||
|
|
|
@ -1,12 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/REC-html401-19991224/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Bug 1263696 - iframe that should not be loaded</title>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
parent.SimpleTest.ok(false, "this iframe should not load");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -1,13 +0,0 @@
|
|||
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
|
||||
"http://www.w3.org/TR/REC-html401-19991224/strict.dtd">
|
||||
<html>
|
||||
<head>
|
||||
<title>Bug 1263696 - iframe that should be loaded</title>
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
parent.index = parent.index + 1;
|
||||
parent.SimpleTest.ok(true, "this iframe should load");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
|
@ -125,8 +125,6 @@ support-files =
|
|||
file_bug902350_frame.html
|
||||
file_bug907892.html
|
||||
file_bug945152.jar
|
||||
file_bug1263696_frame_pass.html
|
||||
file_bug1263696_frame_fail.html
|
||||
file_bug1274806.html
|
||||
file_general_document.html
|
||||
file_htmlserializer_1.html
|
||||
|
@ -587,7 +585,6 @@ skip-if = toolkit == 'android'
|
|||
[test_bug1238440.html]
|
||||
[test_bug1250148.html]
|
||||
[test_bug1259588.html]
|
||||
[test_bug1263696.html]
|
||||
[test_bug1268962.html]
|
||||
[test_bug1274806.html]
|
||||
[test_bug1281963.html]
|
||||
|
|
|
@ -1,53 +0,0 @@
|
|||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta><charset="utf-8"/>
|
||||
<title>Test Embed/Object Node Conflicts</title>
|
||||
<script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<script type="application/javascript" src="plugin-utils.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
<script type="application/javascript">
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
var index = 0;
|
||||
function startTest() {
|
||||
is(index, 12, "Should have loaded all passing frames.");
|
||||
SimpleTest.finish();
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body onload="startTest()">
|
||||
<object data="file_bug1263696_frame_pass.html" style="width: 100px; height: 100px">
|
||||
<embed type="text/html" src="file_bug1263696_frame_fail.html" />
|
||||
</object>
|
||||
<object style="width: 100px; height: 100px" data="data:application/x-does-not-exist,test">
|
||||
<embed type="text/html" src="file_bug1263696_frame_pass.html" />
|
||||
</object>
|
||||
<object style="width: 100px; height: 100px" data="data:application/x-does-not-exist,test">
|
||||
<div></div>
|
||||
<embed type="text/html" src="file_bug1263696_frame_pass.html" />
|
||||
</object>
|
||||
<object style="width: 100px; height: 100px" data="data:application/x-does-not-exist,test">
|
||||
<div>
|
||||
<embed type="text/html" src="file_bug1263696_frame_pass.html" />
|
||||
</div>
|
||||
</object>
|
||||
<object style="width: 100px; height: 100px" data="data:application/x-does-not-exist,test">
|
||||
<embed type="text/html" src="file_bug1263696_frame_pass.html" />
|
||||
<embed type="text/html" src="file_bug1263696_frame_pass.html" />
|
||||
<object data="file_bug1263696_frame_pass.html">
|
||||
<embed type="text/html" src="file_bug1263696_frame_fail.html" />
|
||||
</object>
|
||||
<object data="data:application/x-does-not-exist,test">
|
||||
<embed type="text/html" src="file_bug1263696_frame_pass.html" />
|
||||
</object>
|
||||
</object>
|
||||
<div>
|
||||
<object data="file_bug1263696_frame_pass.html" style="width: 100px; height: 100px"></object>
|
||||
<embed type="text/html" src="file_bug1263696_frame_pass.html" />
|
||||
</div>
|
||||
<div>
|
||||
<embed type="text/html" src="file_bug1263696_frame_pass.html" />
|
||||
<object data="file_bug1263696_frame_pass.html" style="width: 100px; height: 100px"></object>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -480,7 +480,7 @@ WorkerFetchResolver::FlushConsoleReport()
|
|||
}
|
||||
|
||||
nsresult
|
||||
ExtractByteStreamFromBody(const OwningArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams& aBodyInit,
|
||||
ExtractByteStreamFromBody(const fetch::OwningBodyInit& aBodyInit,
|
||||
nsIInputStream** aStream,
|
||||
nsCString& aContentTypeWithCharset,
|
||||
uint64_t& aContentLength)
|
||||
|
@ -533,7 +533,7 @@ ExtractByteStreamFromBody(const OwningArrayBufferOrArrayBufferViewOrBlobOrFormDa
|
|||
}
|
||||
|
||||
nsresult
|
||||
ExtractByteStreamFromBody(const ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams& aBodyInit,
|
||||
ExtractByteStreamFromBody(const fetch::BodyInit& aBodyInit,
|
||||
nsIInputStream** aStream,
|
||||
nsCString& aContentTypeWithCharset,
|
||||
uint64_t& aContentLength)
|
||||
|
|
|
@ -27,10 +27,10 @@ class nsIGlobalObject;
|
|||
namespace mozilla {
|
||||
namespace dom {
|
||||
|
||||
class ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams;
|
||||
class BlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString;
|
||||
class BlobImpl;
|
||||
class InternalRequest;
|
||||
class OwningArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams;
|
||||
class OwningBlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString;
|
||||
class RequestOrUSVString;
|
||||
enum class CallerType : uint32_t;
|
||||
|
||||
|
@ -46,13 +46,18 @@ FetchRequest(nsIGlobalObject* aGlobal, const RequestOrUSVString& aInput,
|
|||
nsresult
|
||||
UpdateRequestReferrer(nsIGlobalObject* aGlobal, InternalRequest* aRequest);
|
||||
|
||||
namespace fetch {
|
||||
typedef BlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString BodyInit;
|
||||
typedef OwningBlobOrArrayBufferViewOrArrayBufferOrFormDataOrURLSearchParamsOrUSVString OwningBodyInit;
|
||||
};
|
||||
|
||||
/*
|
||||
* Creates an nsIInputStream based on the fetch specifications 'extract a byte
|
||||
* stream algorithm' - http://fetch.spec.whatwg.org/#concept-bodyinit-extract.
|
||||
* Stores content type in out param aContentType.
|
||||
*/
|
||||
nsresult
|
||||
ExtractByteStreamFromBody(const OwningArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams& aBodyInit,
|
||||
ExtractByteStreamFromBody(const fetch::OwningBodyInit& aBodyInit,
|
||||
nsIInputStream** aStream,
|
||||
nsCString& aContentType,
|
||||
uint64_t& aContentLength);
|
||||
|
@ -61,7 +66,7 @@ ExtractByteStreamFromBody(const OwningArrayBufferOrArrayBufferViewOrBlobOrFormDa
|
|||
* Non-owning version.
|
||||
*/
|
||||
nsresult
|
||||
ExtractByteStreamFromBody(const ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams& aBodyInit,
|
||||
ExtractByteStreamFromBody(const fetch::BodyInit& aBodyInit,
|
||||
nsIInputStream** aStream,
|
||||
nsCString& aContentType,
|
||||
uint64_t& aContentLength);
|
||||
|
|
|
@ -547,11 +547,9 @@ Request::Constructor(const GlobalObject& aGlobal,
|
|||
}
|
||||
|
||||
if (aInit.mBody.WasPassed()) {
|
||||
const Nullable<OwningArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams>& bodyInitNullable =
|
||||
aInit.mBody.Value();
|
||||
const Nullable<fetch::OwningBodyInit>& bodyInitNullable = aInit.mBody.Value();
|
||||
if (!bodyInitNullable.IsNull()) {
|
||||
const OwningArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams& bodyInit =
|
||||
bodyInitNullable.Value();
|
||||
const fetch::OwningBodyInit& bodyInit = bodyInitNullable.Value();
|
||||
nsCOMPtr<nsIInputStream> stream;
|
||||
nsAutoCString contentTypeWithCharset;
|
||||
uint64_t contentLengthUnused;
|
||||
|
|
|
@ -104,7 +104,7 @@ Response::Redirect(const GlobalObject& aGlobal, const nsAString& aUrl,
|
|||
return nullptr;
|
||||
}
|
||||
|
||||
Optional<ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams> body;
|
||||
Optional<fetch::BodyInit> body;
|
||||
ResponseInit init;
|
||||
init.mStatus = aStatus;
|
||||
RefPtr<Response> r = Response::Constructor(aGlobal, body, init, aRv);
|
||||
|
@ -125,7 +125,7 @@ Response::Redirect(const GlobalObject& aGlobal, const nsAString& aUrl,
|
|||
|
||||
/*static*/ already_AddRefed<Response>
|
||||
Response::Constructor(const GlobalObject& aGlobal,
|
||||
const Optional<ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams>& aBody,
|
||||
const Optional<fetch::BodyInit>& aBody,
|
||||
const ResponseInit& aInit, ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsIGlobalObject> global = do_QueryInterface(aGlobal.GetAsSupports());
|
||||
|
|
|
@ -114,7 +114,7 @@ public:
|
|||
|
||||
static already_AddRefed<Response>
|
||||
Constructor(const GlobalObject& aGlobal,
|
||||
const Optional<ArrayBufferOrArrayBufferViewOrBlobOrFormDataOrUSVStringOrURLSearchParams>& aBody,
|
||||
const Optional<fetch::BodyInit>& aBody,
|
||||
const ResponseInit& aInit, ErrorResult& rv);
|
||||
|
||||
nsIGlobalObject* GetParentObject() const
|
||||
|
|
|
@ -42,7 +42,7 @@ struct ChromeFilePropertyBag;
|
|||
struct FilePropertyBag;
|
||||
class BlobImpl;
|
||||
class File;
|
||||
class OwningArrayBufferOrArrayBufferViewOrBlobOrUSVString;
|
||||
class OwningArrayBufferViewOrArrayBufferOrBlobOrUSVString;
|
||||
class Promise;
|
||||
|
||||
class Blob : public nsIDOMBlob
|
||||
|
@ -59,7 +59,7 @@ public:
|
|||
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
|
||||
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS_AMBIGUOUS(Blob, nsIDOMBlob)
|
||||
|
||||
typedef OwningArrayBufferOrArrayBufferViewOrBlobOrUSVString BlobPart;
|
||||
typedef OwningArrayBufferViewOrArrayBufferOrBlobOrUSVString BlobPart;
|
||||
|
||||
// This creates a Blob or a File based on the type of BlobImpl.
|
||||
static Blob*
|
||||
|
|
|
@ -99,6 +99,10 @@ FileCreatorHelper::FileCreatorHelper(Promise* aPromise,
|
|||
MOZ_ASSERT(aPromise);
|
||||
}
|
||||
|
||||
FileCreatorHelper::~FileCreatorHelper()
|
||||
{
|
||||
}
|
||||
|
||||
void
|
||||
FileCreatorHelper::SendRequest(nsIFile* aFile,
|
||||
const ChromeFilePropertyBag& aBag,
|
||||
|
|
|
@ -72,7 +72,7 @@ private:
|
|||
BlobImpl** aBlobImpl);
|
||||
|
||||
FileCreatorHelper(Promise* aPromise, nsPIDOMWindowInner* aWindow);
|
||||
~FileCreatorHelper() = default;
|
||||
~FileCreatorHelper();
|
||||
|
||||
void
|
||||
SendRequest(nsIFile* aFile, const ChromeFilePropertyBag& aBag,
|
||||
|
|
|
@ -2433,11 +2433,8 @@ HTMLInputElement::GetMaximum() const
|
|||
Decimal
|
||||
HTMLInputElement::GetStepBase() const
|
||||
{
|
||||
MOZ_ASSERT(mType == NS_FORM_INPUT_NUMBER ||
|
||||
mType == NS_FORM_INPUT_DATE ||
|
||||
mType == NS_FORM_INPUT_TIME ||
|
||||
mType == NS_FORM_INPUT_MONTH ||
|
||||
mType == NS_FORM_INPUT_WEEK ||
|
||||
MOZ_ASSERT(IsDateTimeInputType(mType) ||
|
||||
mType == NS_FORM_INPUT_NUMBER ||
|
||||
mType == NS_FORM_INPUT_RANGE,
|
||||
"Check that kDefaultStepBase is correct for this new type");
|
||||
|
||||
|
@ -8671,6 +8668,7 @@ HTMLInputElement::GetStepScaleFactor() const
|
|||
case NS_FORM_INPUT_RANGE:
|
||||
return kStepScaleFactorNumberRange;
|
||||
case NS_FORM_INPUT_TIME:
|
||||
case NS_FORM_INPUT_DATETIME_LOCAL:
|
||||
return kStepScaleFactorTime;
|
||||
case NS_FORM_INPUT_MONTH:
|
||||
return kStepScaleFactorMonth;
|
||||
|
@ -8695,6 +8693,7 @@ HTMLInputElement::GetDefaultStep() const
|
|||
case NS_FORM_INPUT_RANGE:
|
||||
return kDefaultStep;
|
||||
case NS_FORM_INPUT_TIME:
|
||||
case NS_FORM_INPUT_DATETIME_LOCAL:
|
||||
return kDefaultStepTime;
|
||||
default:
|
||||
MOZ_ASSERT(false, "Unrecognized input type");
|
||||
|
|
|
@ -1070,11 +1070,7 @@ protected:
|
|||
/**
|
||||
* Returns if the step attribute apply for the current type.
|
||||
*/
|
||||
bool DoesStepApply() const
|
||||
{
|
||||
// TODO: this is temporary until bug 888331 is fixed.
|
||||
return DoesMinMaxApply() && mType != NS_FORM_INPUT_DATETIME_LOCAL;
|
||||
}
|
||||
bool DoesStepApply() const { return DoesMinMaxApply(); }
|
||||
|
||||
/**
|
||||
* Returns if stepDown and stepUp methods apply for the current type.
|
||||
|
|
|
@ -79,7 +79,7 @@ HTMLObjectElement::DoneAddingChildren(bool aHaveNotified)
|
|||
// If we're already in a document, we need to trigger the load
|
||||
// Otherwise, BindToTree takes care of that.
|
||||
if (IsInComposedDoc()) {
|
||||
StartObjectLoad(aHaveNotified);
|
||||
StartObjectLoad(aHaveNotified, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -310,7 +310,8 @@ HTMLObjectElement::SetAttr(int32_t aNameSpaceID, nsIAtom *aName,
|
|||
// a document, just in case that the caller wants to set additional
|
||||
// attributes before inserting the node into the document.
|
||||
if (aNotify && IsInComposedDoc() && mIsDoneAddingChildren &&
|
||||
aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::data) {
|
||||
aNameSpaceID == kNameSpaceID_None && aName == nsGkAtoms::data &&
|
||||
!BlockEmbedOrObjectContentLoading()) {
|
||||
return LoadObject(aNotify, true);
|
||||
}
|
||||
|
||||
|
@ -327,7 +328,8 @@ HTMLObjectElement::UnsetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
|
|||
|
||||
// See comment in SetAttr
|
||||
if (aNotify && IsInComposedDoc() && mIsDoneAddingChildren &&
|
||||
aNameSpaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::data) {
|
||||
aNameSpaceID == kNameSpaceID_None && aAttribute == nsGkAtoms::data &&
|
||||
!BlockEmbedOrObjectContentLoading()) {
|
||||
return LoadObject(aNotify, true);
|
||||
}
|
||||
|
||||
|
@ -535,15 +537,16 @@ HTMLObjectElement::GetAttributeMappingFunction() const
|
|||
}
|
||||
|
||||
void
|
||||
HTMLObjectElement::StartObjectLoad(bool aNotify)
|
||||
HTMLObjectElement::StartObjectLoad(bool aNotify, bool aForce)
|
||||
{
|
||||
// BindToTree can call us asynchronously, and we may be removed from the tree
|
||||
// in the interim
|
||||
if (!IsInComposedDoc() || !OwnerDoc()->IsActive()) {
|
||||
if (!IsInComposedDoc() || !OwnerDoc()->IsActive() ||
|
||||
BlockEmbedOrObjectContentLoading()) {
|
||||
return;
|
||||
}
|
||||
|
||||
LoadObject(aNotify);
|
||||
LoadObject(aNotify, aForce);
|
||||
SetIsNetworkCreated(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ public:
|
|||
|
||||
nsresult CopyInnerTo(Element* aDest);
|
||||
|
||||
void StartObjectLoad() { StartObjectLoad(true); }
|
||||
void StartObjectLoad() { StartObjectLoad(true, false); }
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(HTMLObjectElement,
|
||||
nsGenericHTMLFormElement)
|
||||
|
@ -247,12 +247,12 @@ public:
|
|||
return GetContentDocument(aSubjectPrincipal);
|
||||
}
|
||||
|
||||
private:
|
||||
/**
|
||||
* Calls LoadObject with the correct arguments to start the plugin load.
|
||||
*/
|
||||
void StartObjectLoad(bool aNotify);
|
||||
void StartObjectLoad(bool aNotify, bool aForceLoad);
|
||||
|
||||
private:
|
||||
/**
|
||||
* Returns if the element is currently focusable regardless of it's tabindex
|
||||
* value. This is used to know the default tabindex value.
|
||||
|
|
|
@ -180,7 +180,7 @@ HTMLSharedObjectElement::SetAttr(int32_t aNameSpaceID, nsIAtom *aName,
|
|||
// attributes before inserting the node into the document.
|
||||
if (aNotify && IsInComposedDoc() && mIsDoneAddingChildren &&
|
||||
aNameSpaceID == kNameSpaceID_None && aName == URIAttrName()
|
||||
&& !BlockEmbedContentLoading()) {
|
||||
&& !BlockEmbedOrObjectContentLoading()) {
|
||||
return LoadObject(aNotify, true);
|
||||
}
|
||||
|
||||
|
@ -313,7 +313,7 @@ HTMLSharedObjectElement::StartObjectLoad(bool aNotify, bool aForceLoad)
|
|||
// BindToTree can call us asynchronously, and we may be removed from the tree
|
||||
// in the interim
|
||||
if (!IsInComposedDoc() || !OwnerDoc()->IsActive() ||
|
||||
BlockEmbedContentLoading()) {
|
||||
BlockEmbedOrObjectContentLoading()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -389,31 +389,5 @@ HTMLSharedObjectElement::GetContentPolicyType() const
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
HTMLSharedObjectElement::BlockEmbedContentLoading()
|
||||
{
|
||||
// Only check on embed elements
|
||||
if (!IsHTMLElement(nsGkAtoms::embed)) {
|
||||
return false;
|
||||
}
|
||||
// Traverse up the node tree to see if we have any ancestors that may block us
|
||||
// from loading
|
||||
for (nsIContent* parent = GetParent(); parent; parent = parent->GetParent()) {
|
||||
if (parent->IsAnyOfHTMLElements(nsGkAtoms::video, nsGkAtoms::audio)) {
|
||||
return true;
|
||||
}
|
||||
// If we have an ancestor that is an object with a source, it'll have an
|
||||
// associated displayed type. If that type is not null, don't load content
|
||||
// for the embed.
|
||||
if (HTMLObjectElement* object = HTMLObjectElement::FromContent(parent)) {
|
||||
uint32_t type = object->DisplayedType();
|
||||
if (type != eType_Null) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -220,21 +220,6 @@ private:
|
|||
|
||||
static void MapAttributesIntoRule(const nsMappedAttributes* aAttributes,
|
||||
GenericSpecifiedValues* aGenericData);
|
||||
|
||||
/**
|
||||
* Decides whether we should load embed node content.
|
||||
*
|
||||
* If this is an embed node there are cases in which we should not try to load
|
||||
* the content:
|
||||
*
|
||||
* - If the embed node is the child of a media element
|
||||
* - If the embed node is the child of an object node that already has
|
||||
* content being loaded.
|
||||
*
|
||||
* In these cases, this function will return false, which will cause
|
||||
* us to skip calling LoadObject.
|
||||
*/
|
||||
bool BlockEmbedContentLoading();
|
||||
};
|
||||
|
||||
} // namespace dom
|
||||
|
|
|
@ -453,18 +453,28 @@ nsGenericHTMLFrameElement::IsHTMLFocusable(bool aWithMouse,
|
|||
return false;
|
||||
}
|
||||
|
||||
static bool sMozBrowserFramesEnabled = false;
|
||||
#ifdef DEBUG
|
||||
static bool sBoolVarCacheInitialized = false;
|
||||
#endif
|
||||
|
||||
void
|
||||
nsGenericHTMLFrameElement::InitStatics()
|
||||
{
|
||||
MOZ_ASSERT(!sBoolVarCacheInitialized);
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
Preferences::AddBoolVarCache(&sMozBrowserFramesEnabled,
|
||||
"dom.mozBrowserFramesEnabled");
|
||||
#ifdef DEBUG
|
||||
sBoolVarCacheInitialized = true;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
nsGenericHTMLFrameElement::BrowserFramesEnabled()
|
||||
{
|
||||
static bool sMozBrowserFramesEnabled = false;
|
||||
static bool sBoolVarCacheInitialized = false;
|
||||
|
||||
if (!sBoolVarCacheInitialized) {
|
||||
sBoolVarCacheInitialized = true;
|
||||
Preferences::AddBoolVarCache(&sMozBrowserFramesEnabled,
|
||||
"dom.mozBrowserFramesEnabled");
|
||||
}
|
||||
|
||||
MOZ_ASSERT(sBoolVarCacheInitialized);
|
||||
return sMozBrowserFramesEnabled;
|
||||
}
|
||||
|
||||
|
|
|
@ -71,6 +71,8 @@ public:
|
|||
|
||||
virtual int32_t TabIndexDefault() override;
|
||||
|
||||
virtual nsIMozBrowserFrame* GetAsMozBrowserFrame() override { return this; }
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(nsGenericHTMLFrameElement,
|
||||
nsGenericHTMLElement)
|
||||
|
||||
|
@ -86,6 +88,7 @@ public:
|
|||
void PresetOpenerWindow(mozIDOMWindowProxy* aOpenerWindow,
|
||||
mozilla::ErrorResult& aRv);
|
||||
|
||||
static void InitStatics();
|
||||
static bool BrowserFramesEnabled();
|
||||
|
||||
/**
|
||||
|
|
|
@ -31,8 +31,7 @@ var data = [
|
|||
{ type: 'month', apply: true },
|
||||
{ type: 'week', apply: true },
|
||||
{ type: 'time', apply: true },
|
||||
// TODO: temporary set to false until bug 888331 is fixed.
|
||||
{ type: 'datetime-local', apply: false },
|
||||
{ type: 'datetime-local', apply: true },
|
||||
{ type: 'number', apply: true },
|
||||
{ type: 'range', apply: true },
|
||||
{ type: 'color', apply: false },
|
||||
|
@ -950,7 +949,104 @@ for (var test of data) {
|
|||
|
||||
break;
|
||||
case 'datetime-local':
|
||||
// TODO: this is temporary until bug 888331 is fixed.
|
||||
// When step is invalid, every datetime is valid
|
||||
input.step = 0;
|
||||
input.value = '2017-02-06T12:00';
|
||||
checkValidity(input, true, apply);
|
||||
|
||||
input.step = 'foo';
|
||||
input.value = '1970-01-01T00:00';
|
||||
checkValidity(input, true, apply);
|
||||
|
||||
input.step = '-1';
|
||||
input.value = '1969-12-12 00:10';
|
||||
checkValidity(input, true, apply);
|
||||
|
||||
input.removeAttribute('step');
|
||||
input.value = '1500-01-01T12:00';
|
||||
checkValidity(input, true, apply);
|
||||
|
||||
input.step = 'any';
|
||||
input.value = '1966-12-12T12:00';
|
||||
checkValidity(input, true, apply);
|
||||
|
||||
input.step = 'ANY';
|
||||
input.value = '2017-01-01 12:00';
|
||||
checkValidity(input, true, apply);
|
||||
|
||||
// When min is set to a valid datetime, there is a step base.
|
||||
input.min = '2017-01-01T00:00:00';
|
||||
input.step = '2';
|
||||
input.value = '2017-01-01T00:00:02';
|
||||
checkValidity(input, true, apply);
|
||||
|
||||
input.value = '2017-01-01T00:00:03';
|
||||
checkValidity(input, false, apply,
|
||||
{ low: "2017-01-01T00:00:02", high: "2017-01-01T00:00:04" });
|
||||
|
||||
input.min = '2017-01-01T00:00:05';
|
||||
input.value = '2017-01-01T00:00:08';
|
||||
checkValidity(input, false, apply,
|
||||
{ low: "2017-01-01T00:00:07", high: "2017-01-01T00:00:09" });
|
||||
|
||||
input.min = '2000-01-01T00:00';
|
||||
input.step = '120';
|
||||
input.value = '2000-01-01T00:02';
|
||||
checkValidity(input, true, apply);
|
||||
|
||||
// Without any step attribute the datetime is valid
|
||||
input.removeAttribute('step');
|
||||
checkValidity(input, true, apply);
|
||||
|
||||
input.min = '1950-01-01T00:00';
|
||||
input.step = '129600'; // 1.5 day
|
||||
input.value = '1950-01-02T00:00';
|
||||
checkValidity(input, false, apply,
|
||||
{ low: "1950-01-01T00:00", high: "1950-01-02T12:00" });
|
||||
|
||||
input.step = '259200'; // 3 days
|
||||
input.value = '1950-01-04T12:00';
|
||||
checkValidity(input, false, apply,
|
||||
{ low: "1950-01-04T00:00", high: "1950-01-07T00:00" });
|
||||
|
||||
input.value = '1950-01-10T00:00';
|
||||
checkValidity(input, true, apply);
|
||||
|
||||
input.step = '0.5'; // half a second
|
||||
input.value = '1950-01-01T00:00:00.123';
|
||||
checkValidity(input, false, apply,
|
||||
{ low: "1950-01-01T00:00", high: "1950-01-01T00:00:00.500" });
|
||||
|
||||
input.value = '2000-01-01T12:30:30.600';
|
||||
checkValidity(input, false, apply,
|
||||
{ low: "2000-01-01T12:30:30.500", high: "2000-01-01T12:30:31" });
|
||||
|
||||
input.value = '1950-01-05T00:00:00.500';
|
||||
checkValidity(input, true, apply);
|
||||
|
||||
input.step = '2.1';
|
||||
input.min = '1991-01-01T12:00';
|
||||
input.value = '1991-01-01T12:00';
|
||||
checkValidity(input, true, apply);
|
||||
|
||||
input.value = '1991-01-01T12:00:03';
|
||||
checkValidity(input, false, apply,
|
||||
{ low: "1991-01-01T12:00:02.100", high: "1991-01-01T12:00:04.200" });
|
||||
|
||||
input.value = '1991-01-01T12:00:06.3';
|
||||
checkValidity(input, true, apply);
|
||||
|
||||
input.step = '2.1';
|
||||
input.min = '1969-12-20T10:00:05';
|
||||
input.value = '1969-12-20T10:00:05';
|
||||
checkValidity(input, true, apply);
|
||||
|
||||
input.value = '1969-12-20T10:00:08';
|
||||
checkValidity(input, false, apply,
|
||||
{ low: "1969-12-20T10:00:07.100", high: "1969-12-20T10:00:09.200" });
|
||||
|
||||
input.value = '1969-12-20T10:00:09.200';
|
||||
checkValidity(input, true, apply);
|
||||
|
||||
break;
|
||||
default:
|
||||
|
|
|
@ -52,13 +52,8 @@ function checkAvailability()
|
|||
["time", true],
|
||||
["month", true],
|
||||
["week", true],
|
||||
["color", false],
|
||||
];
|
||||
|
||||
var todoList =
|
||||
[
|
||||
["datetime", true],
|
||||
["datetime-local", true],
|
||||
["color", false],
|
||||
];
|
||||
|
||||
var element = document.createElement("input");
|
||||
|
@ -82,27 +77,6 @@ function checkAvailability()
|
|||
}
|
||||
is(exceptionCaught, !data[1], "stepUp() availability is not correct");
|
||||
}
|
||||
|
||||
for (data of todoList) {
|
||||
var exceptionCaught = false;
|
||||
element.type = data[0];
|
||||
try {
|
||||
element.stepDown();
|
||||
} catch (e) {
|
||||
exceptionCaught = true;
|
||||
}
|
||||
todo_is(exceptionCaught, !data[1],
|
||||
"stepDown() availability is not correct");
|
||||
|
||||
exceptionCaught = false;
|
||||
try {
|
||||
element.stepUp();
|
||||
} catch (e) {
|
||||
exceptionCaught = true;
|
||||
}
|
||||
todo_is(exceptionCaught, !data[1],
|
||||
"stepUp() availability is not correct");
|
||||
}
|
||||
}
|
||||
|
||||
function checkStepDown()
|
||||
|
@ -509,6 +483,80 @@ function checkStepDown()
|
|||
[ '2016-W01', 'AnY', null, null, 1, null, true ],
|
||||
[ '2016-W01', 'aNy', null, null, 1, null, true ],
|
||||
]},
|
||||
{ type: 'datetime-local', data: [
|
||||
// Regular case.
|
||||
[ '2017-02-07T09:30', null, null, null, null, '2017-02-07T09:29', false ],
|
||||
// Argument testing.
|
||||
[ '2017-02-07T09:30', null, null, null, 1, '2017-02-07T09:29', false ],
|
||||
[ '2017-02-07T09:30', null, null, null, 5, '2017-02-07T09:25', false ],
|
||||
[ '2017-02-07T09:30', null, null, null, -1, '2017-02-07T09:31', false ],
|
||||
[ '2017-02-07T09:30', null, null, null, 0, '2017-02-07T09:30', false ],
|
||||
// hour/minutes/seconds wrapping.
|
||||
[ '2000-01-01T05:00', null, null, null, null, '2000-01-01T04:59', false ],
|
||||
[ '2000-01-01T05:00:00', 1, null, null, null, '2000-01-01T04:59:59', false ],
|
||||
[ '2000-01-01T05:00:00', 0.1, null, null, null, '2000-01-01T04:59:59.900', false ],
|
||||
[ '2000-01-01T05:00:00', 0.01, null, null, null, '2000-01-01T04:59:59.990', false ],
|
||||
[ '2000-01-01T05:00:00', 0.001, null, null, null, '2000-01-01T04:59:59.999', false ],
|
||||
// month/year wrapping.
|
||||
[ '2012-08-01T12:00', null, null, null, 1440, '2012-07-31T12:00', false ],
|
||||
[ '1969-01-02T12:00', null, null, null, 5760, '1968-12-29T12:00', false ],
|
||||
[ '1969-12-31T00:00', null, null, null, -1440, '1970-01-01T00:00', false ],
|
||||
[ '2012-02-29T00:00', null, null, null, -1440, '2012-03-01T00:00', false ],
|
||||
// stepDown() on '00:00' gives '23:59'.
|
||||
[ '2017-02-07T00:00', null, null, null, 1, '2017-02-06T23:59', false ],
|
||||
[ '2017-02-07T00:00', null, null, null, 3, '2017-02-06T23:57', false ],
|
||||
// Some random step values..
|
||||
[ '2017-02-07T16:07', '0.5', null, null, null, '2017-02-07T16:06:59.500', false ],
|
||||
[ '2017-02-07T16:07', '2', null, null, null, '2017-02-07T16:06:58', false ],
|
||||
[ '2017-02-07T16:07', '0.25', null, null, 4, '2017-02-07T16:06:59', false ],
|
||||
[ '2017-02-07T16:07', '1.1', '2017-02-07T16:00', null, 1, '2017-02-07T16:06:59.100', false ],
|
||||
[ '2017-02-07T16:07', '1.1', '2017-02-07T16:00', null, 2, '2017-02-07T16:06:58', false ],
|
||||
[ '2017-02-07T16:07', '1.1', '2017-02-07T16:00', null, 10, '2017-02-07T16:06:49.200', false ],
|
||||
[ '2017-02-07T16:07', '129600', '2017-02-01T00:00', null, 2, '2017-02-05T12:00', false ],
|
||||
// step = 0 isn't allowed (-> step = 1).
|
||||
[ '2017-02-07T10:15', '0', null, null, null, '2017-02-07T10:14', false ],
|
||||
// step < 0 isn't allowed (-> step = 1).
|
||||
[ '2017-02-07T10:15', '-1', null, null, null, '2017-02-07T10:14', false ],
|
||||
// step = NaN isn't allowed (-> step = 1).
|
||||
[ '2017-02-07T10:15', 'foo', null, null, null, '2017-02-07T10:14', false ],
|
||||
// Min values testing.
|
||||
[ '2012-02-02T17:02', '60', 'foo', null, 2, '2012-02-02T17:00', false ],
|
||||
[ '2012-02-02T17:10', '60', '2012-02-02T17:09', null, null, '2012-02-02T17:09', false ],
|
||||
[ '2012-02-02T17:10', '60', '2012-02-02T17:10', null, null, '2012-02-02T17:10', false ],
|
||||
[ '2012-02-02T17:10', '60', '2012-02-02T17:30', null, 1, '2012-02-02T17:10', false ],
|
||||
[ '2012-02-02T17:10', '180', '2012-02-02T17:05', null, null, '2012-02-02T17:08', false ],
|
||||
[ '2012-02-03T20:05', '86400', '2012-02-02T17:05', null, null, '2012-02-03T17:05', false ],
|
||||
[ '2012-02-03T18:00', '129600', '2012-02-01T00:00', null, null, '2012-02-02T12:00', false ],
|
||||
// Max values testing.
|
||||
[ '2012-02-02T17:15', '60', null, 'foo', null, '2012-02-02T17:14', false ],
|
||||
[ '2012-02-02T17:15', null, null, '2012-02-02T17:20', null, '2012-02-02T17:14', false ],
|
||||
[ '2012-02-02T17:15', null, null, '2012-02-02T17:15', null, '2012-02-02T17:14', false ],
|
||||
[ '2012-02-02T17:15', null, null, '2012-02-02T17:13', 4, '2012-02-02T17:11', false ],
|
||||
[ '2012-02-02T17:15', '120', null, '2012-02-02T17:13', 3, '2012-02-02T17:09', false ],
|
||||
[ '2012-02-03T20:05', '86400', null, '2012-02-03T20:05', null, '2012-02-02T20:05', false ],
|
||||
[ '2012-02-03T18:00', '129600', null, '2012-02-03T20:00', null, '2012-02-02T06:00', false ],
|
||||
// Step mismatch.
|
||||
[ '2017-02-07T17:19', '120', '2017-02-07T17:10', null, null, '2017-02-07T17:18', false ],
|
||||
[ '2017-02-07T17:19', '120', '2017-02-07T17:10', null, 2, '2017-02-07T17:16', false ],
|
||||
[ '2017-02-07T17:19', '120', '2017-02-07T17:18', '2017-02-07T17:25', null, '2017-02-07T17:18', false ],
|
||||
[ '2017-02-07T17:19', '120', null, null, null, '2017-02-07T17:17', false ],
|
||||
[ '2017-02-07T17:19', '180', null, null, null, '2017-02-07T17:16', false ],
|
||||
[ '2017-02-07T17:19', '172800', '2017-02-02T17:19', '2017-02-10T17:19', null, '2017-02-06T17:19', false ],
|
||||
// Clamping.
|
||||
[ '2017-02-07T17:22', null, null, '2017-02-07T17:11', null, '2017-02-07T17:11', false ],
|
||||
[ '2017-02-07T17:22', '120', '2017-02-07T17:20', '2017-02-07T17:22', null, '2017-02-07T17:20', false ],
|
||||
[ '2017-02-07T17:22', '300', '2017-02-07T17:12', '2017-02-07T17:20', 10, '2017-02-07T17:12', false ],
|
||||
[ '2017-02-07T17:22', '300', '2017-02-07T17:18', '2017-02-07T17:20', 2, '2017-02-07T17:18', false ],
|
||||
[ '2017-02-07T17:22', '600', '2017-02-02T17:00', '2017-02-07T17:00', 15, '2017-02-07T15:00', false ],
|
||||
[ '2017-02-07T17:22', '600', '2017-02-02T17:00', '2017-02-07T17:00', 2, '2017-02-07T17:00', false ],
|
||||
// value = "" (NaN).
|
||||
[ '', null, null, null, null, '1969-12-31T23:59', false ],
|
||||
// With step = 'any'.
|
||||
[ '2017-02-07T15:20', 'any', null, null, 1, null, true ],
|
||||
[ '2017-02-07T15:20', 'ANY', null, null, 1, null, true ],
|
||||
[ '2017-02-07T15:20', 'AnY', null, null, 1, null, true ],
|
||||
[ '2017-02-07T15:20', 'aNy', null, null, 1, null, true ],
|
||||
]},
|
||||
];
|
||||
|
||||
for (var test of testData) {
|
||||
|
@ -958,6 +1006,78 @@ function checkStepUp()
|
|||
[ '2016-W01', 'AnY', null, null, 1, null, true ],
|
||||
[ '2016-W01', 'aNy', null, null, 1, null, true ],
|
||||
]},
|
||||
{ type: 'datetime-local', data: [
|
||||
// Regular case.
|
||||
[ '2017-02-07T17:09', null, null, null, null, '2017-02-07T17:10', false ],
|
||||
// Argument testing.
|
||||
[ '2017-02-07T17:10', null, null, null, 1, '2017-02-07T17:11', false ],
|
||||
[ '2017-02-07T17:10', null, null, null, 5, '2017-02-07T17:15', false ],
|
||||
[ '2017-02-07T17:10', null, null, null, -1, '2017-02-07T17:09', false ],
|
||||
[ '2017-02-07T17:10', null, null, null, 0, '2017-02-07T17:10', false ],
|
||||
// hour/minutes/seconds wrapping.
|
||||
[ '2000-01-01T04:59', null, null, null, null, '2000-01-01T05:00', false ],
|
||||
[ '2000-01-01T04:59:59', 1, null, null, null, '2000-01-01T05:00', false ],
|
||||
[ '2000-01-01T04:59:59.900', 0.1, null, null, null, '2000-01-01T05:00', false ],
|
||||
[ '2000-01-01T04:59:59.990', 0.01, null, null, null, '2000-01-01T05:00', false ],
|
||||
[ '2000-01-01T04:59:59.999', 0.001, null, null, null, '2000-01-01T05:00', false ],
|
||||
// month/year wrapping.
|
||||
[ '2012-07-31T12:00', null, null, null, 1440, '2012-08-01T12:00', false ],
|
||||
[ '1968-12-29T12:00', null, null, null, 5760, '1969-01-02T12:00', false ],
|
||||
[ '1970-01-01T00:00', null, null, null, -1440, '1969-12-31T00:00', false ],
|
||||
[ '2012-03-01T00:00', null, null, null, -1440, '2012-02-29T00:00', false ],
|
||||
// stepUp() on '23:59' gives '00:00'.
|
||||
[ '2017-02-07T23:59', null, null, null, 1, '2017-02-08T00:00', false ],
|
||||
[ '2017-02-07T23:59', null, null, null, 3, '2017-02-08T00:02', false ],
|
||||
// Some random step values..
|
||||
[ '2017-02-07T17:40', '0.5', null, null, null, '2017-02-07T17:40:00.500', false ],
|
||||
[ '2017-02-07T17:40', '2', null, null, null, '2017-02-07T17:40:02', false ],
|
||||
[ '2017-02-07T17:40', '0.25', null, null, 4, '2017-02-07T17:40:01', false ],
|
||||
[ '2017-02-07T17:40', '1.1', '2017-02-07T17:00', null, 1, '2017-02-07T17:40:00.200', false ],
|
||||
[ '2017-02-07T17:40', '1.1', '2017-02-07T17:00', null, 2, '2017-02-07T17:40:01.300', false ],
|
||||
[ '2017-02-07T17:40', '1.1', '2017-02-07T17:00', null, 10, '2017-02-07T17:40:10.100', false ],
|
||||
[ '2017-02-07T17:40', '129600', '2017-02-01T00:00', null, 2, '2017-02-10T00:00', false ],
|
||||
// step = 0 isn't allowed (-> step = 1).
|
||||
[ '2017-02-07T17:39', '0', null, null, null, '2017-02-07T17:40', false ],
|
||||
// step < 0 isn't allowed (-> step = 1).
|
||||
[ '2017-02-07T17:39', '-1', null, null, null, '2017-02-07T17:40', false ],
|
||||
// step = NaN isn't allowed (-> step = 1).
|
||||
[ '2017-02-07T17:39', 'foo', null, null, null, '2017-02-07T17:40', false ],
|
||||
// Min values testing.
|
||||
[ '2012-02-02T17:00', '60', 'foo', null, 2, '2012-02-02T17:02', false ],
|
||||
[ '2012-02-02T17:10', '60', '2012-02-02T17:10', null, null, '2012-02-02T17:11', false ],
|
||||
[ '2012-02-02T17:10', '60', '2012-02-02T17:30', null, 1, '2012-02-02T17:30', false ],
|
||||
[ '2012-02-02T17:10', '180', '2012-02-02T17:05', null, null, '2012-02-02T17:11', false ],
|
||||
[ '2012-02-02T17:10', '86400', '2012-02-02T17:05', null, null, '2012-02-03T17:05', false ],
|
||||
[ '2012-02-02T17:10', '129600', '2012-02-01T00:00', null, null, '2012-02-04T00:00', false ],
|
||||
// Max values testing.
|
||||
[ '2012-02-02T17:15', '60', null, 'foo', null, '2012-02-02T17:16', false ],
|
||||
[ '2012-02-02T17:15', null, null, '2012-02-02T17:20', null, '2012-02-02T17:16', false ],
|
||||
[ '2012-02-02T17:15', null, null, '2012-02-02T17:15', null, '2012-02-02T17:15', false ],
|
||||
[ '2012-02-02T17:15', null, null, '2012-02-02T17:13', 4, '2012-02-02T17:15', false ],
|
||||
[ '2012-02-02T20:05', '86400', null, '2012-02-03T20:05', null, '2012-02-03T20:05', false ],
|
||||
[ '2012-02-02T18:00', '129600', null, '2012-02-04T20:00', null, '2012-02-04T06:00', false ],
|
||||
// Step mismatch.
|
||||
[ '2017-02-07T17:19', '120', '2017-02-07T17:10', null, null, '2017-02-07T17:20', false ],
|
||||
[ '2017-02-07T17:19', '120', '2017-02-07T17:10', null, 2, '2017-02-07T17:22', false ],
|
||||
[ '2017-02-07T17:19', '120', '2017-02-07T17:18', '2017-02-07T17:25', null, '2017-02-07T17:20', false ],
|
||||
[ '2017-02-07T17:19', '120', null, null, null, '2017-02-07T17:21', false ],
|
||||
[ '2017-02-07T17:19', '180', null, null, null, '2017-02-07T17:22', false ],
|
||||
[ '2017-02-03T17:19', '172800', '2017-02-02T17:19', '2017-02-10T17:19', null, '2017-02-04T17:19', false ],
|
||||
// Clamping.
|
||||
[ '2017-02-07T17:22', null, null, '2017-02-07T17:11', null, '2017-02-07T17:22', false ],
|
||||
[ '2017-02-07T17:22', '120', '2017-02-07T17:20', '2017-02-07T17:22', null, '2017-02-07T17:22', false ],
|
||||
[ '2017-02-07T17:22', '300', '2017-02-07T17:12', '2017-02-07T17:20', 10, '2017-02-07T17:22', false ],
|
||||
[ '2017-02-07T17:22', '300', '2017-02-07T17:18', '2017-02-07T17:20', 2, '2017-02-07T17:22', false ],
|
||||
[ '2017-02-06T17:22', '600', '2017-02-02T17:00', '2017-02-07T17:20', 15, '2017-02-06T19:50', false ],
|
||||
[ '2017-02-06T17:22', '600', '2017-02-02T17:10', '2017-02-07T17:20', 2, '2017-02-06T17:40', false ],
|
||||
// value = "" (NaN).
|
||||
[ '', null, null, null, null, '1970-01-01T00:01', false ],
|
||||
// With step = 'any'.
|
||||
[ '2017-02-07T17:30', 'any', null, null, 1, null, true ],
|
||||
[ '2017-02-07T17:30', 'ANY', null, null, 1, null, true ],
|
||||
[ '2017-02-07T17:30', 'AnY', null, null, 1, null, true ],
|
||||
[ '2017-02-07T17:30', 'aNy', null, null, 1, null, true ],
|
||||
]},
|
||||
];
|
||||
|
||||
for (var test of testData) {
|
||||
|
|
|
@ -42,6 +42,7 @@ const char* mozilla::dom::ContentPrefs::gInitPrefs[] = {
|
|||
"dom.ipc.processPriorityManager.backgroundPerceivableGracePeriodMS",
|
||||
"dom.max_chrome_script_run_time",
|
||||
"dom.max_script_run_time",
|
||||
"dom.mozBrowserFramesEnabled",
|
||||
"dom.performance.enable_notify_performance_timing",
|
||||
"dom.performance.enable_user_timing_logging",
|
||||
"dom.storage.testing",
|
||||
|
|
|
@ -160,7 +160,7 @@ parent:
|
|||
|
||||
async ReturnSitesWithData(nsCString[] aSites, uint64_t aCallbackId);
|
||||
|
||||
sync GetKeyState(int32_t aVirtKey)
|
||||
intr GetKeyState(int32_t aVirtKey)
|
||||
returns (int16_t aState);
|
||||
|
||||
intr NPN_SetValue_NPPVpluginRequiresAudioDeviceChanges(bool shouldRegister)
|
||||
|
|
|
@ -2118,7 +2118,7 @@ PMCGetKeyState(int aVirtKey)
|
|||
PluginModuleChild* chromeInstance = PluginModuleChild::GetChrome();
|
||||
if (chromeInstance) {
|
||||
int16_t ret = 0;
|
||||
if (chromeInstance->SendGetKeyState(aVirtKey, &ret)) {
|
||||
if (chromeInstance->CallGetKeyState(aVirtKey, &ret)) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3403,19 +3403,19 @@ PluginModuleChromeParent::RecvProfile(const nsCString& aProfile)
|
|||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
PluginModuleParent::RecvGetKeyState(const int32_t& aVirtKey, int16_t* aRet)
|
||||
PluginModuleParent::AnswerGetKeyState(const int32_t& aVirtKey, int16_t* aRet)
|
||||
{
|
||||
return IPC_FAIL_NO_REASON(this);
|
||||
}
|
||||
|
||||
mozilla::ipc::IPCResult
|
||||
PluginModuleChromeParent::RecvGetKeyState(const int32_t& aVirtKey,
|
||||
PluginModuleChromeParent::AnswerGetKeyState(const int32_t& aVirtKey,
|
||||
int16_t* aRet)
|
||||
{
|
||||
#if defined(XP_WIN)
|
||||
*aRet = ::GetKeyState(aVirtKey);
|
||||
return IPC_OK();
|
||||
#else
|
||||
return PluginModuleParent::RecvGetKeyState(aVirtKey, aRet);
|
||||
return PluginModuleParent::AnswerGetKeyState(aVirtKey, aRet);
|
||||
#endif
|
||||
}
|
||||
|
|
|
@ -213,7 +213,7 @@ protected:
|
|||
|
||||
virtual mozilla::ipc::IPCResult RecvProfile(const nsCString& aProfile) override { return IPC_OK(); }
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvGetKeyState(const int32_t& aVirtKey, int16_t* aRet) override;
|
||||
virtual mozilla::ipc::IPCResult AnswerGetKeyState(const int32_t& aVirtKey, int16_t* aRet) override;
|
||||
|
||||
virtual mozilla::ipc::IPCResult RecvReturnClearSiteData(const NPError& aRv,
|
||||
const uint64_t& aCallbackId) override;
|
||||
|
@ -507,7 +507,7 @@ class PluginModuleChromeParent
|
|||
RecvProfile(const nsCString& aProfile) override;
|
||||
|
||||
virtual mozilla::ipc::IPCResult
|
||||
RecvGetKeyState(const int32_t& aVirtKey, int16_t* aRet) override;
|
||||
AnswerGetKeyState(const int32_t& aVirtKey, int16_t* aRet) override;
|
||||
|
||||
private:
|
||||
virtual void
|
||||
|
|
|
@ -124,7 +124,9 @@ skip-if = true # Bug 596491
|
|||
[test_pluginstream_asfileonly.html]
|
||||
[test_pluginstream_err.html]
|
||||
[test_pluginstream_geturl.html]
|
||||
skip-if = true # Bug 1267432
|
||||
[test_pluginstream_geturlnotify.html]
|
||||
skip-if = true # Bug 1267432
|
||||
[test_pluginstream_newstream.html]
|
||||
[test_pluginstream_post.html]
|
||||
[test_pluginstream_poststream.html]
|
||||
|
|
|
@ -170,16 +170,16 @@ function finishTests() {
|
|||
</a>
|
||||
<p id="display"></p>
|
||||
<div id="content">
|
||||
<object data="http://mochi.test:8888/tests/dom/tests/mochitest/general/res0.resource"> <!-- same origin, no header -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res0.resource"> <!-- cross origin, no header -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res1.resource"> <!-- cross origin, Timing-Allow-Origin: * header -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res2.resource"> <!-- cross origin redirect to test2.example.com, no header -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res3.resource"> <!-- cross origin, Timing-Allow-Origin: http://mochi.test:8888 header -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res4.resource"> <!-- cross origin redirect to mochi.test:8888/.../res1.resource, Timing-Allow-Origin: * -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res5.resource"> <!-- cross origin, Timing-Allow-Origin: http://mochi.test:8889 -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res6.resource"> <!-- cross origin, Timing-Allow-Origin: "" (empty string) -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res7.resource"> <!-- cross origin, Timing-Allow-Origin: http://mochi.test:8888 http://test1.com header -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res8.resource"> <!-- double cross origin redirect -->
|
||||
<object data="http://mochi.test:8888/tests/dom/tests/mochitest/general/res0.resource"></object> <!-- same origin, no header -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res0.resource"></object> <!-- cross origin, no header -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res1.resource"></object> <!-- cross origin, Timing-Allow-Origin: * header -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res2.resource"></object> <!-- cross origin redirect to test2.example.com, no header -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res3.resource"></object> <!-- cross origin, Timing-Allow-Origin: http://mochi.test:8888 header -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res4.resource"></object> <!-- cross origin redirect to mochi.test:8888/.../res1.resource, Timing-Allow-Origin: * -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res5.resource"></object> <!-- cross origin, Timing-Allow-Origin: http://mochi.test:8889 -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res6.resource"></object> <!-- cross origin, Timing-Allow-Origin: "" (empty string) -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res7.resource"></object> <!-- cross origin, Timing-Allow-Origin: http://mochi.test:8888 http://test1.com header -->
|
||||
<object data="http://test1.example.com/tests/dom/tests/mochitest/general/res8.resource"></object> <!-- double cross origin redirect -->
|
||||
<script type="text/javascript" src="http://mochi.test:8888/tests/dom/tests/mochitest/general/resource_timing.js"></script> <!-- same origin script -->
|
||||
</div>
|
||||
</body>
|
||||
|
|
|
@ -168,7 +168,7 @@ SimpleTest.waitForFocus(runTest);
|
|||
<button id="b2" label="Button"/>
|
||||
<button id="b3" label="Button"/>
|
||||
|
||||
<iframe id="child" src="data:text/html,<html><style>* { outline: none; -moz-appearance: none; } %23elem:focus { outline: 2px solid red; } %23elem:-moz-focusring { outline: 1px solid blue; }</style><div id='container'></html>"/>
|
||||
<iframe id="child" src="data:text/html,<html><style>* { outline: none; -moz-appearance: none; min-width:10px; min-height:10px; } %23elem:focus { outline: 2px solid red; } %23elem:-moz-focusring { outline: 1px solid blue; }</style><div id='container'></html>"/>
|
||||
|
||||
<body xmlns="http://www.w3.org/1999/xhtml" style="height: 300px; overflow: auto;"/>
|
||||
|
||||
|
|
|
@ -151,6 +151,12 @@ public:
|
|||
GetHref(aRetval, aRv);
|
||||
}
|
||||
|
||||
void
|
||||
ToJSON(nsAString& aResult, ErrorResult& aRv) const
|
||||
{
|
||||
GetHref(aResult, aRv);
|
||||
}
|
||||
|
||||
// URLSearchParamsObserver
|
||||
void
|
||||
URLSearchParamsUpdated(URLSearchParams* aSearchParams) override;
|
||||
|
|
|
@ -450,5 +450,11 @@
|
|||
url = new URL("data:text/html,<a href=\"http://example.org/?q\">Link</a>");
|
||||
is(url.href, "data:text/html,<a%20href=\"http://example.org/?q\">Link</a>");
|
||||
</script>
|
||||
|
||||
<script>
|
||||
var u = new URL('http://www.example.org');
|
||||
ok(u.toJSON(), 'http://www.example.org', "URL.toJSON()");
|
||||
is(JSON.stringify(u), "\"http://www.example.org/\"", "JSON.stringify(u) works");
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -4,13 +4,13 @@
|
|||
* You can obtain one at http://mozilla.org/MPL/2.0/.
|
||||
*
|
||||
* The origin of this IDL file is
|
||||
* http://dev.w3.org/2006/webapi/FileAPI/#blob
|
||||
* https://w3c.github.io/FileAPI/#blob
|
||||
*
|
||||
* Copyright © 2012 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C
|
||||
* liability, trademark and document use rules apply.
|
||||
*/
|
||||
|
||||
typedef (ArrayBuffer or ArrayBufferView or Blob or USVString) BlobPart;
|
||||
typedef (BufferSource or Blob or USVString) BlobPart;
|
||||
|
||||
[Constructor(optional sequence<BlobPart> blobParts,
|
||||
optional BlobPropertyBag options),
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
*/
|
||||
|
||||
typedef object JSON;
|
||||
typedef (ArrayBuffer or ArrayBufferView or Blob or FormData or USVString or URLSearchParams) BodyInit;
|
||||
typedef (Blob or BufferSource or FormData or URLSearchParams or USVString) BodyInit;
|
||||
|
||||
[NoInterfaceObject, Exposed=(Window,Worker)]
|
||||
interface Body {
|
||||
|
|
|
@ -25,5 +25,5 @@ interface MediaKeys {
|
|||
MediaKeySession createSession(optional MediaKeySessionType sessionType = "temporary");
|
||||
|
||||
[NewObject]
|
||||
Promise<void> setServerCertificate((ArrayBufferView or ArrayBuffer) serverCertificate);
|
||||
Promise<void> setServerCertificate(BufferSource serverCertificate);
|
||||
};
|
||||
|
|
|
@ -44,9 +44,12 @@ interface URL {
|
|||
attribute USVString pathname;
|
||||
[Throws]
|
||||
attribute USVString search;
|
||||
readonly attribute URLSearchParams searchParams;
|
||||
[SameObject] readonly attribute URLSearchParams searchParams;
|
||||
[Throws]
|
||||
attribute USVString hash;
|
||||
|
||||
[Throws]
|
||||
USVString toJSON();
|
||||
};
|
||||
|
||||
partial interface URL {
|
||||
|
|
|
@ -1864,7 +1864,11 @@ XMLHttpRequestMainThread::OnDataAvailable(nsIRequest *request,
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
ChangeState(State::loading);
|
||||
return request->Cancel(NS_OK);
|
||||
|
||||
// Cancel() must be called with an error. We use
|
||||
// NS_ERROR_FILE_ALREADY_EXISTS to know that we've aborted the operation
|
||||
// just because we can retrieve the File from the channel directly.
|
||||
return request->Cancel(NS_ERROR_FILE_ALREADY_EXISTS);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2194,7 +2198,10 @@ XMLHttpRequestMainThread::OnStopRequest(nsIRequest *request, nsISupports *ctxt,
|
|||
|
||||
bool waitingForBlobCreation = false;
|
||||
|
||||
if (NS_SUCCEEDED(status) &&
|
||||
// If we have this error, we have to deal with a file: URL + responseType =
|
||||
// blob. We have this error because we canceled the channel. The status will
|
||||
// be set to NS_OK.
|
||||
if (status == NS_ERROR_FILE_ALREADY_EXISTS &&
|
||||
(mResponseType == XMLHttpRequestResponseType::Blob ||
|
||||
mResponseType == XMLHttpRequestResponseType::Moz_blob)) {
|
||||
nsCOMPtr<nsIFile> file;
|
||||
|
@ -2224,41 +2231,48 @@ XMLHttpRequestMainThread::OnStopRequest(nsIRequest *request, nsISupports *ctxt,
|
|||
|
||||
FileCreationHandler::Create(promise, this);
|
||||
waitingForBlobCreation = true;
|
||||
status = NS_OK;
|
||||
|
||||
NS_ASSERTION(mResponseBody.IsEmpty(), "mResponseBody should be empty");
|
||||
NS_ASSERTION(mResponseText.IsEmpty(), "mResponseText should be empty");
|
||||
}
|
||||
}
|
||||
|
||||
if (NS_SUCCEEDED(status) &&
|
||||
(mResponseType == XMLHttpRequestResponseType::Blob ||
|
||||
mResponseType == XMLHttpRequestResponseType::Moz_blob) &&
|
||||
!waitingForBlobCreation) {
|
||||
// Smaller files may be written in cache map instead of separate files.
|
||||
// Also, no-store response cannot be written in persistent cache.
|
||||
nsAutoCString contentType;
|
||||
mChannel->GetContentType(contentType);
|
||||
|
||||
if (mResponseType == XMLHttpRequestResponseType::Blob) {
|
||||
// mBlobStorage can be null if the channel is non-file non-cacheable
|
||||
// and if the response length is zero.
|
||||
MaybeCreateBlobStorage();
|
||||
mBlobStorage->GetBlobWhenReady(GetOwner(), contentType, this);
|
||||
waitingForBlobCreation = true;
|
||||
} else {
|
||||
// No local file.
|
||||
|
||||
// Smaller files may be written in cache map instead of separate files.
|
||||
// Also, no-store response cannot be written in persistent cache.
|
||||
nsAutoCString contentType;
|
||||
mChannel->GetContentType(contentType);
|
||||
|
||||
if (mResponseType == XMLHttpRequestResponseType::Blob) {
|
||||
// mBlobStorage can be null if the channel is non-file non-cacheable
|
||||
// and if the response length is zero.
|
||||
MaybeCreateBlobStorage();
|
||||
mBlobStorage->GetBlobWhenReady(GetOwner(), contentType, this);
|
||||
waitingForBlobCreation = true;
|
||||
} else {
|
||||
// mBlobSet can be null if the channel is non-file non-cacheable
|
||||
// and if the response length is zero.
|
||||
if (!mBlobSet) {
|
||||
mBlobSet = new BlobSet();
|
||||
}
|
||||
|
||||
ErrorResult error;
|
||||
nsTArray<RefPtr<BlobImpl>> subImpls(mBlobSet->GetBlobImpls());
|
||||
RefPtr<BlobImpl> blobImpl =
|
||||
MultipartBlobImpl::Create(Move(subImpls),
|
||||
NS_ConvertASCIItoUTF16(contentType),
|
||||
error);
|
||||
mBlobSet = nullptr;
|
||||
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
return error.StealNSResult();
|
||||
}
|
||||
|
||||
mResponseBlob = Blob::Create(GetOwner(), blobImpl);
|
||||
// mBlobSet can be null if the channel is non-file non-cacheable
|
||||
// and if the response length is zero.
|
||||
if (!mBlobSet) {
|
||||
mBlobSet = new BlobSet();
|
||||
}
|
||||
|
||||
ErrorResult error;
|
||||
nsTArray<RefPtr<BlobImpl>> subImpls(mBlobSet->GetBlobImpls());
|
||||
RefPtr<BlobImpl> blobImpl =
|
||||
MultipartBlobImpl::Create(Move(subImpls),
|
||||
NS_ConvertASCIItoUTF16(contentType),
|
||||
error);
|
||||
mBlobSet = nullptr;
|
||||
|
||||
if (NS_WARN_IF(error.Failed())) {
|
||||
return error.StealNSResult();
|
||||
}
|
||||
|
||||
mResponseBlob = Blob::Create(GetOwner(), blobImpl);
|
||||
}
|
||||
|
||||
NS_ASSERTION(mResponseBody.IsEmpty(), "mResponseBody should be empty");
|
||||
|
|
|
@ -1315,12 +1315,6 @@ EventRunnable::WorkerRun(JSContext* aCx, WorkerPrivate* aWorkerPrivate)
|
|||
return true;
|
||||
}
|
||||
|
||||
JS::Rooted<JSString*> type(aCx,
|
||||
JS_NewUCStringCopyN(aCx, mType.get(), mType.Length()));
|
||||
if (!type) {
|
||||
return false;
|
||||
}
|
||||
|
||||
XMLHttpRequestEventTarget* target;
|
||||
if (mUploadEvent) {
|
||||
target = xhr->GetUploadObjectNoCreate();
|
||||
|
|
|
@ -674,13 +674,10 @@ EditorBase::DoTransaction(nsITransaction* aTxn)
|
|||
{
|
||||
if (mPlaceHolderBatch && !mPlaceHolderTxn) {
|
||||
nsCOMPtr<nsIAbsorbingTransaction> placeholderTransaction =
|
||||
new PlaceholderTransaction();
|
||||
new PlaceholderTransaction(*this, mPlaceHolderName, Move(mSelState));
|
||||
|
||||
// Save off weak reference to placeholder transaction
|
||||
mPlaceHolderTxn = do_GetWeakReference(placeholderTransaction);
|
||||
placeholderTransaction->Init(mPlaceHolderName, mSelState, this);
|
||||
// placeholder txn took ownership of this pointer
|
||||
mSelState = nullptr;
|
||||
|
||||
// QI to an nsITransaction since that's what DoTransaction() expects
|
||||
nsCOMPtr<nsITransaction> transaction =
|
||||
|
@ -925,7 +922,7 @@ EditorBase::BeginPlaceHolderTransaction(nsIAtom* aName)
|
|||
mPlaceHolderName = aName;
|
||||
RefPtr<Selection> selection = GetSelection();
|
||||
if (selection) {
|
||||
mSelState = new SelectionState();
|
||||
mSelState = MakeUnique<SelectionState>();
|
||||
mSelState->SaveSelection(selection);
|
||||
// Composition transaction can modify multiple nodes and it merges text
|
||||
// node for ime into single text node.
|
||||
|
@ -989,7 +986,6 @@ EditorBase::EndPlaceHolderTransaction()
|
|||
if (mPlaceHolderName == nsGkAtoms::IMETxnName) {
|
||||
mRangeUpdater.DropSelectionState(*mSelState);
|
||||
}
|
||||
delete mSelState;
|
||||
mSelState = nullptr;
|
||||
}
|
||||
// We might have never made a placeholder if no action took place.
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
#include "mozilla/OwningNonNull.h" // for OwningNonNull
|
||||
#include "mozilla/SelectionState.h" // for RangeUpdater, etc.
|
||||
#include "mozilla/StyleSheet.h" // for StyleSheet
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "mozilla/dom/Text.h"
|
||||
#include "nsCOMPtr.h" // for already_AddRefed, nsCOMPtr
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
|
@ -996,7 +997,7 @@ protected:
|
|||
// Name of placeholder transaction.
|
||||
nsIAtom* mPlaceHolderName;
|
||||
// Saved selection state for placeholder transaction batching.
|
||||
SelectionState* mSelState;
|
||||
mozilla::UniquePtr<SelectionState> mSelState;
|
||||
nsString* mPhonetic;
|
||||
// IME composition this is not null between compositionstart and
|
||||
// compositionend.
|
||||
|
|
|
@ -16,13 +16,14 @@
|
|||
#include "mozilla/EditorUtils.h"
|
||||
#include "mozilla/HTMLEditor.h"
|
||||
#include "mozilla/MathAlgorithms.h"
|
||||
#include "mozilla/Move.h"
|
||||
#include "mozilla/Preferences.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "mozilla/Unused.h"
|
||||
#include "mozilla/dom/Selection.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/OwningNonNull.h"
|
||||
#include "mozilla/mozalloc.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsAString.h"
|
||||
#include "nsAlgorithm.h"
|
||||
#include "nsCRT.h"
|
||||
|
@ -4508,20 +4509,21 @@ HTMLEditRules::CreateStyleForInsertText(Selection& aSelection,
|
|||
NS_ENSURE_STATE(rootElement);
|
||||
|
||||
// process clearing any styles first
|
||||
nsAutoPtr<PropItem> item(mHTMLEditor->mTypeInState->TakeClearProperty());
|
||||
UniquePtr<PropItem> item =
|
||||
Move(mHTMLEditor->mTypeInState->TakeClearProperty());
|
||||
while (item && node != rootElement) {
|
||||
NS_ENSURE_STATE(mHTMLEditor);
|
||||
nsresult rv =
|
||||
mHTMLEditor->ClearStyle(address_of(node), &offset,
|
||||
item->tag, &item->attr);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
item = mHTMLEditor->mTypeInState->TakeClearProperty();
|
||||
item = Move(mHTMLEditor->mTypeInState->TakeClearProperty());
|
||||
weDidSomething = true;
|
||||
}
|
||||
|
||||
// then process setting any styles
|
||||
int32_t relFontSize = mHTMLEditor->mTypeInState->TakeRelativeFontSize();
|
||||
item = mHTMLEditor->mTypeInState->TakeSetProperty();
|
||||
item = Move(mHTMLEditor->mTypeInState->TakeSetProperty());
|
||||
|
||||
if (item || relFontSize) {
|
||||
// we have at least one style to add; make a new text node to insert style
|
||||
|
|
|
@ -280,7 +280,7 @@ HTMLEditor::Init(nsIDOMDocument* aDoc,
|
|||
}
|
||||
|
||||
// Init the HTML-CSS utils
|
||||
mCSSEditUtils = new CSSEditUtils(this);
|
||||
mCSSEditUtils = MakeUnique<CSSEditUtils>(this);
|
||||
|
||||
// disable links
|
||||
nsCOMPtr<nsIPresShell> presShell = GetPresShell();
|
||||
|
|
|
@ -10,11 +10,11 @@
|
|||
#include "mozilla/CSSEditUtils.h"
|
||||
#include "mozilla/StyleSheet.h"
|
||||
#include "mozilla/TextEditor.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/File.h"
|
||||
|
||||
#include "nsAttrName.h"
|
||||
#include "nsAutoPtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsIContentFilter.h"
|
||||
#include "nsICSSLoaderObserver.h"
|
||||
|
@ -822,7 +822,7 @@ protected:
|
|||
bool mCRInParagraphCreatesParagraph;
|
||||
|
||||
bool mCSSAware;
|
||||
nsAutoPtr<CSSEditUtils> mCSSEditUtils;
|
||||
UniquePtr<CSSEditUtils> mCSSEditUtils;
|
||||
|
||||
// Used by GetFirstSelectedCell and GetNextSelectedCell
|
||||
int32_t mSelectedCellIndex;
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
#include "CompositionTransaction.h"
|
||||
#include "mozilla/EditorBase.h"
|
||||
#include "mozilla/dom/Selection.h"
|
||||
#include "mozilla/Move.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsQueryObject.h"
|
||||
|
||||
|
@ -15,13 +16,18 @@ namespace mozilla {
|
|||
|
||||
using namespace dom;
|
||||
|
||||
PlaceholderTransaction::PlaceholderTransaction()
|
||||
PlaceholderTransaction::PlaceholderTransaction(
|
||||
EditorBase& aEditorBase,
|
||||
nsIAtom* aName,
|
||||
UniquePtr<SelectionState> aSelState)
|
||||
: mAbsorb(true)
|
||||
, mForwarding(nullptr)
|
||||
, mCompositionTransaction(nullptr)
|
||||
, mCommitted(false)
|
||||
, mEditorBase(nullptr)
|
||||
, mStartSel(Move(aSelState))
|
||||
, mEditorBase(aEditorBase)
|
||||
{
|
||||
mName = aName;
|
||||
}
|
||||
|
||||
PlaceholderTransaction::~PlaceholderTransaction()
|
||||
|
@ -54,19 +60,6 @@ NS_INTERFACE_MAP_END_INHERITING(EditAggregateTransaction)
|
|||
NS_IMPL_ADDREF_INHERITED(PlaceholderTransaction, EditAggregateTransaction)
|
||||
NS_IMPL_RELEASE_INHERITED(PlaceholderTransaction, EditAggregateTransaction)
|
||||
|
||||
NS_IMETHODIMP
|
||||
PlaceholderTransaction::Init(nsIAtom* aName,
|
||||
SelectionState* aSelState,
|
||||
EditorBase* aEditorBase)
|
||||
{
|
||||
NS_ENSURE_TRUE(aEditorBase && aSelState, NS_ERROR_NULL_POINTER);
|
||||
|
||||
mName = aName;
|
||||
mStartSel = aSelState;
|
||||
mEditorBase = aEditorBase;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
PlaceholderTransaction::DoTransaction()
|
||||
{
|
||||
|
@ -83,7 +76,7 @@ PlaceholderTransaction::UndoTransaction()
|
|||
NS_ENSURE_TRUE(mStartSel, NS_ERROR_NULL_POINTER);
|
||||
|
||||
// now restore selection
|
||||
RefPtr<Selection> selection = mEditorBase->GetSelection();
|
||||
RefPtr<Selection> selection = mEditorBase.GetSelection();
|
||||
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
|
||||
return mStartSel->RestoreSelection(selection);
|
||||
}
|
||||
|
@ -96,7 +89,7 @@ PlaceholderTransaction::RedoTransaction()
|
|||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
// now restore selection
|
||||
RefPtr<Selection> selection = mEditorBase->GetSelection();
|
||||
RefPtr<Selection> selection = mEditorBase.GetSelection();
|
||||
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
|
||||
return mEndSel.RestoreSelection(selection);
|
||||
}
|
||||
|
@ -261,7 +254,7 @@ PlaceholderTransaction::Commit()
|
|||
nsresult
|
||||
PlaceholderTransaction::RememberEndingSelection()
|
||||
{
|
||||
RefPtr<Selection> selection = mEditorBase->GetSelection();
|
||||
RefPtr<Selection> selection = mEditorBase.GetSelection();
|
||||
NS_ENSURE_TRUE(selection, NS_ERROR_NULL_POINTER);
|
||||
mEndSel.SaveSelection(selection);
|
||||
return NS_OK;
|
||||
|
|
|
@ -8,12 +8,12 @@
|
|||
|
||||
#include "EditAggregateTransaction.h"
|
||||
#include "mozilla/EditorUtils.h"
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "nsIAbsorbingTransaction.h"
|
||||
#include "nsIDOMNode.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsWeakPtr.h"
|
||||
#include "nsWeakReference.h"
|
||||
#include "nsAutoPtr.h"
|
||||
|
||||
namespace mozilla {
|
||||
|
||||
|
@ -33,7 +33,8 @@ class PlaceholderTransaction final : public EditAggregateTransaction,
|
|||
public:
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
PlaceholderTransaction();
|
||||
PlaceholderTransaction(EditorBase& aEditorBase, nsIAtom* aName,
|
||||
UniquePtr<SelectionState> aSelState);
|
||||
|
||||
NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(PlaceholderTransaction,
|
||||
EditAggregateTransaction)
|
||||
|
@ -46,9 +47,6 @@ public:
|
|||
|
||||
// ------------ nsIAbsorbingTransaction -----------------------
|
||||
|
||||
NS_IMETHOD Init(nsIAtom* aName, SelectionState* aSelState,
|
||||
EditorBase* aEditorBase) override;
|
||||
|
||||
NS_IMETHOD GetTxnName(nsIAtom** aName) override;
|
||||
|
||||
NS_IMETHOD StartSelectionEquals(SelectionState* aSelState,
|
||||
|
@ -80,11 +78,11 @@ protected:
|
|||
// restore the selection properly.
|
||||
|
||||
// Use a pointer because this is constructed before we exist.
|
||||
nsAutoPtr<SelectionState> mStartSel;
|
||||
UniquePtr<SelectionState> mStartSel;
|
||||
SelectionState mEndSel;
|
||||
|
||||
// The editor for this transaction.
|
||||
EditorBase* mEditorBase;
|
||||
EditorBase& mEditorBase;
|
||||
};
|
||||
|
||||
} // namespace mozilla
|
||||
|
|
|
@ -193,7 +193,7 @@ TypeInState::ClearProp(nsIAtom* aProp,
|
|||
* TakeClearProperty() hands back next property item on the clear list.
|
||||
* Caller assumes ownership of PropItem and must delete it.
|
||||
*/
|
||||
PropItem*
|
||||
UniquePtr<PropItem>
|
||||
TypeInState::TakeClearProperty()
|
||||
{
|
||||
size_t count = mClearedArray.Length();
|
||||
|
@ -204,14 +204,14 @@ TypeInState::TakeClearProperty()
|
|||
--count; // indices are zero based
|
||||
PropItem* propItem = mClearedArray[count];
|
||||
mClearedArray.RemoveElementAt(count);
|
||||
return propItem;
|
||||
return UniquePtr<PropItem>(propItem);
|
||||
}
|
||||
|
||||
/**
|
||||
* TakeSetProperty() hands back next poroperty item on the set list.
|
||||
* Caller assumes ownership of PropItem and must delete it.
|
||||
*/
|
||||
PropItem*
|
||||
UniquePtr<PropItem>
|
||||
TypeInState::TakeSetProperty()
|
||||
{
|
||||
size_t count = mSetArray.Length();
|
||||
|
@ -221,7 +221,7 @@ TypeInState::TakeSetProperty()
|
|||
count--; // indices are zero based
|
||||
PropItem* propItem = mSetArray[count];
|
||||
mSetArray.RemoveElementAt(count);
|
||||
return propItem;
|
||||
return UniquePtr<PropItem>(propItem);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#ifndef TypeInState_h
|
||||
#define TypeInState_h
|
||||
|
||||
#include "mozilla/UniquePtr.h"
|
||||
#include "nsCOMPtr.h"
|
||||
#include "nsCycleCollectionParticipant.h"
|
||||
#include "nsISelectionListener.h"
|
||||
|
@ -63,13 +64,13 @@ public:
|
|||
* TakeClearProperty() hands back next property item on the clear list.
|
||||
* Caller assumes ownership of PropItem and must delete it.
|
||||
*/
|
||||
PropItem* TakeClearProperty();
|
||||
UniquePtr<PropItem> TakeClearProperty();
|
||||
|
||||
/**
|
||||
* TakeSetProperty() hands back next property item on the set list.
|
||||
* Caller assumes ownership of PropItem and must delete it.
|
||||
*/
|
||||
PropItem* TakeSetProperty();
|
||||
UniquePtr<PropItem> TakeSetProperty();
|
||||
|
||||
/**
|
||||
* TakeRelativeFontSize() hands back relative font value, which is then
|
||||
|
|
|
@ -35,9 +35,6 @@ public:
|
|||
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IABSORBINGTRANSACTION_IID)
|
||||
|
||||
NS_IMETHOD Init(nsIAtom* aName, mozilla::SelectionState* aSelState,
|
||||
mozilla::EditorBase* aEditorBase) = 0;
|
||||
|
||||
NS_IMETHOD EndPlaceHolderBatch()=0;
|
||||
|
||||
NS_IMETHOD GetTxnName(nsIAtom **aName)=0;
|
||||
|
|
|
@ -88,7 +88,7 @@ fails == 642800.html 642800.html
|
|||
fails == selection_visibility_after_reframe.html selection_visibility_after_reframe.html
|
||||
fails == selection_visibility_after_reframe-2.html selection_visibility_after_reframe-2.html
|
||||
fails == selection_visibility_after_reframe-3.html selection_visibility_after_reframe-3.html
|
||||
fails == 672709.html 672709.html
|
||||
== 672709.html 672709.html
|
||||
fails == 338427-1.html 338427-1.html
|
||||
fails == 674212-spellcheck.html 674212-spellcheck.html
|
||||
fails == 338427-2.html 338427-2.html
|
||||
|
|
|
@ -2427,6 +2427,13 @@ public:
|
|||
Mutated();
|
||||
}
|
||||
|
||||
virtual void SetStyles(const BorderStyles& aBorderStyles)
|
||||
{
|
||||
MOZ_LAYERS_LOG_IF_SHADOWABLE(this, ("Layer::Mutated(%p) Widths", this));
|
||||
PodCopy(&mBorderStyles[0], &aBorderStyles[0], 4);
|
||||
Mutated();
|
||||
}
|
||||
|
||||
MOZ_LAYER_DECL_NAME("BorderLayer", TYPE_BORDER)
|
||||
|
||||
virtual void ComputeEffectiveTransforms(const gfx::Matrix4x4& aTransformToSurface) override
|
||||
|
@ -2454,6 +2461,7 @@ protected:
|
|||
LayerRect mRect;
|
||||
BorderCorners mCorners;
|
||||
BorderWidths mWidths;
|
||||
BorderStyles mBorderStyles;
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
|
@ -249,6 +249,7 @@ typedef gfx::Matrix4x4Typed<CSSTransformedLayerPixel, ParentLayerPixel> AsyncTra
|
|||
typedef Array<gfx::Color, 4> BorderColors;
|
||||
typedef Array<LayerSize, 4> BorderCorners;
|
||||
typedef Array<LayerCoord, 4> BorderWidths;
|
||||
typedef Array<uint8_t, 4> BorderStyles;
|
||||
|
||||
// This is used to communicate Layers across IPC channels. The Handle is valid
|
||||
// for layers in the same PLayerTransaction. Handles are created by ClientLayerManager,
|
||||
|
|
|
@ -311,14 +311,14 @@ void Axis::EndTouch(uint32_t aTimestampMs) {
|
|||
mAxisLocked = false;
|
||||
mVelocity = 0;
|
||||
int count = 0;
|
||||
while (!mVelocityQueue.IsEmpty()) {
|
||||
uint32_t timeDelta = (aTimestampMs - mVelocityQueue[0].first);
|
||||
for (const auto& e : mVelocityQueue) {
|
||||
uint32_t timeDelta = (aTimestampMs - e.first);
|
||||
if (timeDelta < gfxPrefs::APZVelocityRelevanceTime()) {
|
||||
count++;
|
||||
mVelocity += mVelocityQueue[0].second;
|
||||
mVelocity += e.second;
|
||||
}
|
||||
mVelocityQueue.RemoveElementAt(0);
|
||||
}
|
||||
mVelocityQueue.Clear();
|
||||
if (count > 1) {
|
||||
mVelocity /= count;
|
||||
}
|
||||
|
@ -333,9 +333,7 @@ void Axis::CancelGesture() {
|
|||
AXIS_LOG("%p|%s cancelling touch, clearing velocity queue\n",
|
||||
mAsyncPanZoomController, Name());
|
||||
mVelocity = 0.0f;
|
||||
while (!mVelocityQueue.IsEmpty()) {
|
||||
mVelocityQueue.RemoveElementAt(0);
|
||||
}
|
||||
mVelocityQueue.Clear();
|
||||
}
|
||||
|
||||
bool Axis::CanScroll() const {
|
||||
|
|
|
@ -107,9 +107,9 @@ asserts-if(stylo,1) load 766452-1.html # bug 1324700
|
|||
load 766452-2.html
|
||||
load 768079-1.html
|
||||
asserts-if(stylo,2) load 783041-1.html # bug 1324661
|
||||
load 783041-2.html
|
||||
asserts-if(stylo,1) load 783041-3.html # bug 1324671
|
||||
load 783041-4.html
|
||||
asserts-if(stylo,2) load 783041-2.html # bug 1324661
|
||||
asserts-if(stylo,3) load 783041-3.html # bug 1324671
|
||||
asserts-if(stylo,2) load 783041-4.html # bug 1324661
|
||||
load 798853.html # bug 868792
|
||||
load 805760-1.html
|
||||
skip-if(Android) load 815489.html # bug 1216304
|
||||
|
|
|
@ -230,11 +230,17 @@ nsIconChannel::AsyncOpen(nsIStreamListener* aListener,
|
|||
|
||||
nsCOMPtr<nsIInputStream> inStream;
|
||||
nsresult rv = MakeInputStream(getter_AddRefs(inStream), true);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
mCallbacks = nullptr;
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Init our stream pump
|
||||
rv = mPump->Init(inStream, int64_t(-1), int64_t(-1), 0, 0, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
mCallbacks = nullptr;
|
||||
return rv;
|
||||
}
|
||||
|
||||
rv = mPump->AsyncRead(this, ctxt);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
|
@ -244,6 +250,8 @@ nsIconChannel::AsyncOpen(nsIStreamListener* aListener,
|
|||
if (mLoadGroup) {
|
||||
mLoadGroup->AddRequest(this, nullptr);
|
||||
}
|
||||
} else {
|
||||
mCallbacks = nullptr;
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
@ -254,7 +262,10 @@ nsIconChannel::AsyncOpen2(nsIStreamListener* aListener)
|
|||
{
|
||||
nsCOMPtr<nsIStreamListener> listener = aListener;
|
||||
nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
mCallbacks = nullptr;
|
||||
return rv;
|
||||
}
|
||||
return AsyncOpen(listener, nullptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -245,12 +245,14 @@ nsIconChannel::AsyncOpen(nsIStreamListener* aListener,
|
|||
nsCOMPtr<nsIInputStream> inStream;
|
||||
nsresult rv = MakeInputStream(getter_AddRefs(inStream), true);
|
||||
if (NS_FAILED(rv)) {
|
||||
mCallbacks = nullptr;
|
||||
return rv;
|
||||
}
|
||||
|
||||
// Init our streampump
|
||||
rv = mPump->Init(inStream, int64_t(-1), int64_t(-1), 0, 0, false);
|
||||
if (NS_FAILED(rv)) {
|
||||
mCallbacks = nullptr;
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -262,7 +264,10 @@ nsIconChannel::AsyncOpen(nsIStreamListener* aListener,
|
|||
if (mLoadGroup) {
|
||||
mLoadGroup->AddRequest(this, nullptr);
|
||||
}
|
||||
} else {
|
||||
mCallbacks = nullptr;
|
||||
}
|
||||
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
@ -271,7 +276,10 @@ nsIconChannel::AsyncOpen2(nsIStreamListener* aListener)
|
|||
{
|
||||
nsCOMPtr<nsIStreamListener> listener = aListener;
|
||||
nsresult rv = nsContentSecurityManager::doContentSecurityCheck(this, listener);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (NS_FAILED(rv)) {
|
||||
mCallbacks = nullptr;
|
||||
return rv;
|
||||
}
|
||||
return AsyncOpen(listener, nullptr);
|
||||
}
|
||||
|
||||
|
|
|
@ -60,15 +60,6 @@ LocaleService::GetAppLocales(nsTArray<nsCString>& aRetVal)
|
|||
aRetVal = mAppLocales;
|
||||
}
|
||||
|
||||
void
|
||||
LocaleService::GetAppLocale(nsACString& aRetVal)
|
||||
{
|
||||
if (mAppLocales.IsEmpty()) {
|
||||
ReadAppLocales(mAppLocales);
|
||||
}
|
||||
aRetVal = mAppLocales[0];
|
||||
}
|
||||
|
||||
void
|
||||
LocaleService::Refresh()
|
||||
{
|
||||
|
@ -111,8 +102,11 @@ LocaleService::GetAppLocales(JSContext* aCtx, JS::MutableHandleValue aRetVal)
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
LocaleService::GetAppLocale(JSContext* aCtx, nsACString& aRetVal)
|
||||
LocaleService::GetAppLocale(nsACString& aRetVal)
|
||||
{
|
||||
GetAppLocale(aRetVal);
|
||||
if (mAppLocales.IsEmpty()) {
|
||||
ReadAppLocales(mAppLocales);
|
||||
}
|
||||
aRetVal = mAppLocales[0];
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
|
@ -57,30 +57,13 @@ public:
|
|||
* Example: ["en-US", "de", "pl", "sr-Cyrl", "zh-Hans-HK"]
|
||||
*
|
||||
* Usage:
|
||||
* nsTArray<nsCString> appLocales;
|
||||
* LocaleService::GetInstance()->GetAppLocales(appLocales);
|
||||
* nsTArray<nsCString> appLocales;
|
||||
* LocaleService::GetInstance()->GetAppLocales(appLocales);
|
||||
*
|
||||
* (See mozILocaleService.idl for a JS-callable version of this.)
|
||||
*/
|
||||
void GetAppLocales(nsTArray<nsCString>& aRetVal);
|
||||
|
||||
/**
|
||||
* Returns the best locale that the application should be localized to.
|
||||
*
|
||||
* The result is a valid locale IDs and it should be
|
||||
* used for all APIs that do not handle language negotiation.
|
||||
*
|
||||
* Where possible, GetAppLocales should be preferred over this API and
|
||||
* all callsites should handle some form of "best effort" language
|
||||
* negotiation to respect user preferences in case the use case does
|
||||
* not have data for the first locale in the list.
|
||||
*
|
||||
* Example: "zh-Hans-HK"
|
||||
*
|
||||
* Usage:
|
||||
* nsAutoCString appLocale;
|
||||
* LocaleService::GetInstance()->GetAppLocale(appLocale);
|
||||
*/
|
||||
void GetAppLocale(nsACString& aRetVal);
|
||||
|
||||
/**
|
||||
* Triggers a refresh of the language negotiation process.
|
||||
*
|
||||
|
|
|
@ -8,6 +8,9 @@ XPCSHELL_TESTS_MANIFESTS += ['tests/unit/xpcshell.ini']
|
|||
|
||||
if CONFIG['ENABLE_INTL_API']:
|
||||
SOURCES += ['OSPreferences.cpp']
|
||||
EXPORTS.mozilla.intl += [
|
||||
'OSPreferences.h',
|
||||
]
|
||||
|
||||
toolkit = CONFIG['MOZ_WIDGET_TOOLKIT']
|
||||
|
||||
|
@ -40,7 +43,7 @@ EXPORTS += [
|
|||
]
|
||||
|
||||
EXPORTS.mozilla.intl += [
|
||||
'LocaleService.h'
|
||||
'LocaleService.h',
|
||||
]
|
||||
|
||||
UNIFIED_SOURCES += [
|
||||
|
|
|
@ -16,6 +16,32 @@
|
|||
[scriptable, uuid(C27F8983-B48B-4D1A-92D7-FEB8106F212D)]
|
||||
interface mozILocaleService : nsISupports
|
||||
{
|
||||
/**
|
||||
* Returns a list of locales that the application should be localized to.
|
||||
*
|
||||
* The result is a sorted list of valid locale IDs and it should be
|
||||
* used for all APIs that accept list of locales, like ECMA402 and L10n APIs.
|
||||
*
|
||||
* This API always returns at least one locale.
|
||||
*
|
||||
* Example: ["en-US", "de", "pl", "sr-Cyrl", "zh-Hans-HK"]
|
||||
*
|
||||
* (See LocaleService.h for a more C++-friendly version of this.)
|
||||
*/
|
||||
[implicit_jscontext] jsval getAppLocales();
|
||||
[implicit_jscontext] ACString getAppLocale();
|
||||
|
||||
/**
|
||||
* Returns the best locale that the application should be localized to.
|
||||
*
|
||||
* The result is a valid locale ID and it should be
|
||||
* used for all APIs that do not handle language negotiation.
|
||||
*
|
||||
* Where possible, getAppLocales() should be preferred over this API and
|
||||
* all callsites should handle some form of "best effort" language
|
||||
* negotiation to respect user preferences in case the use case does
|
||||
* not have data for the first locale in the list.
|
||||
*
|
||||
* Example: "zh-Hans-HK"
|
||||
*/
|
||||
ACString getAppLocale();
|
||||
};
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "LocaleService.h"
|
||||
#include "mozilla/intl/LocaleService.h"
|
||||
#include "mozilla/Services.h"
|
||||
#include "nsIToolkitChromeRegistry.h"
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "OSPreferences.h"
|
||||
#include "mozilla/intl/OSPreferences.h"
|
||||
|
||||
using namespace mozilla::intl;
|
||||
|
||||
|
|
|
@ -14,8 +14,4 @@ if CONFIG['ENABLE_INTL_API']:
|
|||
'TestOSPreferences.cpp',
|
||||
]
|
||||
|
||||
LOCAL_INCLUDES += [
|
||||
'/intl/locale',
|
||||
]
|
||||
|
||||
FINAL_LIBRARY = 'xul-gtest'
|
||||
|
|
|
@ -46,7 +46,7 @@ struct ForEachTrackedOptimizationTypeInfoOp;
|
|||
// contents to become out of date.
|
||||
class JS_PUBLIC_API(ProfilingFrameIterator)
|
||||
{
|
||||
JSRuntime* rt_;
|
||||
JSContext* cx_;
|
||||
uint32_t sampleBufferGen_;
|
||||
js::Activation* activation_;
|
||||
|
||||
|
|
|
@ -142,8 +142,6 @@ FOR_EACH_PUBLIC_TAGGED_GC_POINTER_TYPE(DECLARE_IS_HEAP_CONSTRUCTIBLE_TYPE)
|
|||
template <typename T, typename Wrapper>
|
||||
class PersistentRootedBase : public MutableWrappedPtrOperations<T, Wrapper> {};
|
||||
|
||||
static void* const ConstNullValue = nullptr;
|
||||
|
||||
namespace gc {
|
||||
struct Cell;
|
||||
template<typename T>
|
||||
|
@ -471,7 +469,8 @@ class MOZ_NONHEAP_CLASS Handle : public js::HandleBase<T, Handle<T>>
|
|||
MOZ_IMPLICIT Handle(decltype(nullptr)) {
|
||||
static_assert(mozilla::IsPointer<T>::value,
|
||||
"nullptr_t overload not valid for non-pointer types");
|
||||
ptr = reinterpret_cast<const T*>(&js::ConstNullValue);
|
||||
static void* const ConstNullValue = nullptr;
|
||||
ptr = reinterpret_cast<const T*>(&ConstNullValue);
|
||||
}
|
||||
|
||||
MOZ_IMPLICIT Handle(MutableHandle<T> handle) {
|
||||
|
|
|
@ -2155,7 +2155,7 @@ SetJitCompilerOption(JSContext* cx, unsigned argc, Value* vp)
|
|||
if ((opt == JSJITCOMPILER_BASELINE_ENABLE || opt == JSJITCOMPILER_ION_ENABLE) &&
|
||||
number == 0)
|
||||
{
|
||||
js::jit::JitActivationIterator iter(cx->runtime());
|
||||
js::jit::JitActivationIterator iter(cx);
|
||||
if (!iter.done()) {
|
||||
JS_ReportErrorASCII(cx, "Can't turn off JITs with JIT code on the stack.");
|
||||
return false;
|
||||
|
|
|
@ -7932,18 +7932,11 @@ Parser<ParseHandler>::unaryExpr(YieldHandling yieldHandling, TripledotHandling t
|
|||
return null();
|
||||
}
|
||||
|
||||
TokenKind nextSameLine = TOK_EOF;
|
||||
if (!tokenStream.peekTokenSameLine(&nextSameLine, TokenStream::Operand))
|
||||
Node kid = unaryExpr(yieldHandling, tripledotHandling, possibleError, invoked);
|
||||
if (!kid)
|
||||
return null();
|
||||
if (nextSameLine != TOK_EOL) {
|
||||
Node kid = unaryExpr(yieldHandling, tripledotHandling, possibleError, invoked);
|
||||
if (!kid)
|
||||
return null();
|
||||
pc->lastAwaitOffset = begin;
|
||||
return newAwaitExpression(begin, kid);
|
||||
}
|
||||
error(JSMSG_LINE_BREAK_AFTER_AWAIT);
|
||||
return null();
|
||||
pc->lastAwaitOffset = begin;
|
||||
return newAwaitExpression(begin, kid);
|
||||
}
|
||||
|
||||
default: {
|
||||
|
|
|
@ -47,6 +47,7 @@ class MOZ_RAII AutoTraceSession
|
|||
|
||||
JS::HeapState prevState;
|
||||
AutoGeckoProfilerEntry pseudoFrame;
|
||||
JSRuntime::AutoProhibitActiveContextChange prohibitActiveContextChange;
|
||||
};
|
||||
|
||||
class MOZ_RAII AutoPrepareForTracing
|
||||
|
|
|
@ -985,7 +985,7 @@ class GCRuntime
|
|||
UnprotectedData<JS::Zone*> systemZone;
|
||||
|
||||
// List of all zone groups (protected by the GC lock).
|
||||
ActiveThreadData<ZoneGroupVector> groups;
|
||||
ActiveThreadOrGCTaskData<ZoneGroupVector> groups;
|
||||
|
||||
// The unique atoms zone, which has no zone group.
|
||||
WriteOnceData<Zone*> atomsZone;
|
||||
|
|
|
@ -546,7 +546,7 @@ void
|
|||
js::Nursery::collect(JS::gcreason::Reason reason)
|
||||
{
|
||||
MOZ_ASSERT(!TlsContext.get()->suppressGC);
|
||||
MOZ_RELEASE_ASSERT(TlsContext.get() == zoneGroup()->context);
|
||||
MOZ_RELEASE_ASSERT(zoneGroup()->ownedByCurrentThread());
|
||||
|
||||
if (!isEnabled() || isEmpty()) {
|
||||
// Our barriers are not always exact, and there may be entries in the
|
||||
|
@ -727,7 +727,7 @@ js::Nursery::doCollection(JS::gcreason::Reason reason,
|
|||
|
||||
// Update any slot or element pointers whose destination has been tenured.
|
||||
maybeStartProfile(ProfileKey::UpdateJitActivations);
|
||||
js::jit::UpdateJitActivationsForMinorGC(rt, &mover);
|
||||
js::jit::UpdateJitActivationsForMinorGC(zoneGroup(), &mover);
|
||||
forwardedBuffers.finish();
|
||||
maybeEndProfile(ProfileKey::UpdateJitActivations);
|
||||
|
||||
|
|
|
@ -325,9 +325,12 @@ js::gc::GCRuntime::traceRuntimeCommon(JSTracer* trc, TraceOrMarkRuntime traceOrM
|
|||
{
|
||||
gcstats::AutoPhase ap(stats(), gcstats::PHASE_MARK_STACK);
|
||||
|
||||
// Trace active interpreter and JIT stack roots.
|
||||
TraceInterpreterActivations(rt, trc);
|
||||
jit::TraceJitActivations(rt, trc);
|
||||
JSContext* cx = TlsContext.get();
|
||||
for (const CooperatingContext& target : rt->cooperatingContexts()) {
|
||||
// Trace active interpreter and JIT stack roots.
|
||||
TraceInterpreterActivations(cx, target, trc);
|
||||
jit::TraceJitActivations(cx, target, trc);
|
||||
}
|
||||
|
||||
// Trace legacy C stack roots.
|
||||
AutoGCRooter::traceAll(trc);
|
||||
|
|
|
@ -358,12 +358,6 @@ Zone::notifyObservingDebuggers()
|
|||
}
|
||||
}
|
||||
|
||||
bool
|
||||
js::ZonesIter::atAtomsZone(JSRuntime* rt)
|
||||
{
|
||||
return rt->isAtomsZone(*it);
|
||||
}
|
||||
|
||||
bool
|
||||
Zone::isOnList() const
|
||||
{
|
||||
|
|
104
js/src/gc/Zone.h
104
js/src/gc/Zone.h
|
@ -602,6 +602,39 @@ struct Zone : public JS::shadow::Zone,
|
|||
|
||||
namespace js {
|
||||
|
||||
// Iterate over all zone groups except those which may be in use by parse
|
||||
// threads. Pretty soon this will exclude zone groups in use by parse threads
|
||||
// (as for ZonesIter), i.e. the zone groups in use by cooperating threads,
|
||||
// except that right now parse threads use zones in the same zone group as
|
||||
// cooperating threads (bug 1323066).
|
||||
class ZoneGroupsIter
|
||||
{
|
||||
gc::AutoEnterIteration iterMarker;
|
||||
ZoneGroup** it;
|
||||
ZoneGroup** end;
|
||||
|
||||
public:
|
||||
explicit ZoneGroupsIter(JSRuntime* rt) : iterMarker(&rt->gc) {
|
||||
it = rt->gc.groups.ref().begin();
|
||||
end = rt->gc.groups.ref().end();
|
||||
}
|
||||
|
||||
bool done() const { return it == end; }
|
||||
|
||||
void next() {
|
||||
MOZ_ASSERT(!done());
|
||||
it++;
|
||||
}
|
||||
|
||||
ZoneGroup* get() const {
|
||||
MOZ_ASSERT(!done());
|
||||
return *it;
|
||||
}
|
||||
|
||||
operator ZoneGroup*() const { return get(); }
|
||||
ZoneGroup* operator->() const { return get(); }
|
||||
};
|
||||
|
||||
// Using the atoms zone without holding the exclusive access lock is dangerous
|
||||
// because worker threads may be using it simultaneously. Therefore, it's
|
||||
// better to skip the atoms zone when iterating over zones. If you need to
|
||||
|
@ -611,34 +644,24 @@ enum ZoneSelector {
|
|||
SkipAtoms
|
||||
};
|
||||
|
||||
class ZonesIter
|
||||
// Iterate over all zones in one zone group.
|
||||
class ZonesInGroupIter
|
||||
{
|
||||
gc::AutoEnterIteration iterMarker;
|
||||
JSRuntime* rt;
|
||||
JS::Zone** it;
|
||||
JS::Zone** end;
|
||||
|
||||
public:
|
||||
ZonesIter(JSRuntime* rt, ZoneSelector selector) : iterMarker(&rt->gc), rt(rt) {
|
||||
if (selector == WithAtoms && rt->gc.atomsZone)
|
||||
it = const_cast<JS::Zone**>(&rt->gc.atomsZone.ref());
|
||||
else
|
||||
it = rt->zoneGroupFromAnyThread()->zones().begin();
|
||||
end = rt->zoneGroupFromAnyThread()->zones().end();
|
||||
explicit ZonesInGroupIter(ZoneGroup* group) : iterMarker(&group->runtime->gc) {
|
||||
it = group->zones().begin();
|
||||
end = group->zones().end();
|
||||
}
|
||||
|
||||
bool atAtomsZone(JSRuntime* rt);
|
||||
|
||||
bool done() const { return it == end; }
|
||||
|
||||
void next() {
|
||||
MOZ_ASSERT(!done());
|
||||
do {
|
||||
if (it == &rt->gc.atomsZone.ref())
|
||||
it = rt->zoneGroupFromAnyThread()->zones().begin();
|
||||
else
|
||||
it++;
|
||||
} while (!done() && (*it)->usedByExclusiveThread);
|
||||
it++;
|
||||
}
|
||||
|
||||
JS::Zone* get() const {
|
||||
|
@ -650,6 +673,55 @@ class ZonesIter
|
|||
JS::Zone* operator->() const { return get(); }
|
||||
};
|
||||
|
||||
// Iterate over all zones in the runtime, except those which may be in use by
|
||||
// parse threads.
|
||||
class ZonesIter
|
||||
{
|
||||
ZoneGroupsIter group;
|
||||
Maybe<ZonesInGroupIter> zone;
|
||||
JS::Zone* atomsZone;
|
||||
|
||||
public:
|
||||
ZonesIter(JSRuntime* rt, ZoneSelector selector)
|
||||
: group(rt), atomsZone(selector == WithAtoms ? rt->gc.atomsZone.ref() : nullptr)
|
||||
{
|
||||
if (!atomsZone && !done())
|
||||
next();
|
||||
}
|
||||
|
||||
bool atAtomsZone(JSRuntime* rt) const {
|
||||
return !!atomsZone;
|
||||
}
|
||||
|
||||
bool done() const { return !atomsZone && group.done(); }
|
||||
|
||||
void next() {
|
||||
MOZ_ASSERT(!done());
|
||||
if (atomsZone)
|
||||
atomsZone = nullptr;
|
||||
while (!group.done()) {
|
||||
if (zone.isSome())
|
||||
zone.ref().next();
|
||||
else
|
||||
zone.emplace(group);
|
||||
if (zone.ref().done()) {
|
||||
zone.reset();
|
||||
group.next();
|
||||
} else if (!zone.ref().get()->usedByExclusiveThread) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JS::Zone* get() const {
|
||||
MOZ_ASSERT(!done());
|
||||
return atomsZone ? atomsZone : zone.ref().get();
|
||||
}
|
||||
|
||||
operator JS::Zone*() const { return get(); }
|
||||
JS::Zone* operator->() const { return get(); }
|
||||
};
|
||||
|
||||
struct CompartmentsInZoneIter
|
||||
{
|
||||
explicit CompartmentsInZoneIter(JS::Zone* zone) : zone(zone) {
|
||||
|
|
|
@ -14,7 +14,7 @@ namespace js {
|
|||
|
||||
ZoneGroup::ZoneGroup(JSRuntime* runtime)
|
||||
: runtime(runtime),
|
||||
context(TlsContext.get()),
|
||||
ownerContext_(TlsContext.get()),
|
||||
enterCount(this, 1),
|
||||
zones_(),
|
||||
nursery_(this, this),
|
||||
|
@ -25,9 +25,7 @@ ZoneGroup::ZoneGroup(JSRuntime* runtime)
|
|||
ionBailAfter_(this, 0),
|
||||
#endif
|
||||
jitZoneGroup(this, nullptr),
|
||||
debuggerList_(this),
|
||||
profilingScripts(this, false),
|
||||
scriptAndCountsVector(this, nullptr)
|
||||
debuggerList_(this)
|
||||
{}
|
||||
|
||||
bool
|
||||
|
@ -56,12 +54,12 @@ void
|
|||
ZoneGroup::enter()
|
||||
{
|
||||
JSContext* cx = TlsContext.get();
|
||||
if (context == cx) {
|
||||
if (ownerContext().context() == cx) {
|
||||
MOZ_ASSERT(enterCount);
|
||||
} else {
|
||||
JSContext* old = context.exchange(cx);
|
||||
MOZ_RELEASE_ASSERT(old == nullptr);
|
||||
MOZ_ASSERT(ownerContext().context() == nullptr);
|
||||
MOZ_ASSERT(enterCount == 0);
|
||||
ownerContext_ = CooperatingContext(cx);
|
||||
}
|
||||
enterCount++;
|
||||
}
|
||||
|
@ -72,13 +70,14 @@ ZoneGroup::leave()
|
|||
MOZ_ASSERT(ownedByCurrentThread());
|
||||
MOZ_ASSERT(enterCount);
|
||||
if (--enterCount == 0)
|
||||
context = nullptr;
|
||||
ownerContext_ = CooperatingContext(nullptr);
|
||||
}
|
||||
|
||||
bool
|
||||
ZoneGroup::ownedByCurrentThread()
|
||||
{
|
||||
return context == TlsContext.get();
|
||||
MOZ_ASSERT(TlsContext.get());
|
||||
return ownerContext().context() == TlsContext.get();
|
||||
}
|
||||
|
||||
} // namespace js
|
||||
|
|
|
@ -11,6 +11,7 @@
|
|||
|
||||
#include "gc/Statistics.h"
|
||||
#include "vm/Caches.h"
|
||||
#include "vm/Stack.h"
|
||||
|
||||
namespace js {
|
||||
|
||||
|
@ -20,8 +21,6 @@ class AutoKeepAtoms;
|
|||
|
||||
typedef Vector<JS::Zone*, 4, SystemAllocPolicy> ZoneVector;
|
||||
|
||||
using ScriptAndCountsVector = GCVector<ScriptAndCounts, 0, SystemAllocPolicy>;
|
||||
|
||||
// Zone groups encapsulate data about a group of zones that are logically
|
||||
// related in some way. Currently, each runtime has a single zone group, and
|
||||
// all zones except the atoms zone (which has no group) are in that group.
|
||||
|
@ -42,12 +41,17 @@ class ZoneGroup
|
|||
public:
|
||||
JSRuntime* const runtime;
|
||||
|
||||
private:
|
||||
// The context with exclusive access to this zone group.
|
||||
mozilla::Atomic<JSContext*, mozilla::ReleaseAcquire> context;
|
||||
UnprotectedData<CooperatingContext> ownerContext_;
|
||||
|
||||
// The number of times the context has entered this zone group.
|
||||
ZoneGroupData<size_t> enterCount;
|
||||
|
||||
public:
|
||||
CooperatingContext& ownerContext() { return ownerContext_.ref(); }
|
||||
void* addressOfOwnerContext() { return &ownerContext_.ref().cx; }
|
||||
|
||||
void enter();
|
||||
void leave();
|
||||
bool ownedByCurrentThread();
|
||||
|
@ -124,12 +128,6 @@ class ZoneGroup
|
|||
ZoneGroupData<mozilla::LinkedList<js::Debugger>> debuggerList_;
|
||||
public:
|
||||
mozilla::LinkedList<js::Debugger>& debuggerList() { return debuggerList_.ref(); }
|
||||
|
||||
/* If true, new scripts must be created with PC counter information. */
|
||||
ZoneGroupOrIonCompileData<bool> profilingScripts;
|
||||
|
||||
/* Strong references on scripts held for PCCount profiling API. */
|
||||
ZoneGroupData<JS::PersistentRooted<ScriptAndCountsVector>*> scriptAndCountsVector;
|
||||
};
|
||||
|
||||
class MOZ_RAII AutoAccessZoneGroup
|
||||
|
|
|
@ -157,7 +157,7 @@ NativeRegExpMacroAssembler::GenerateCode(JSContext* cx, bool match_only)
|
|||
// avoid failing repeatedly when the regex code is called from Ion JIT code,
|
||||
// see bug 1208819.
|
||||
Label stack_ok;
|
||||
void* context_addr = &cx->zone()->group()->context;
|
||||
void* context_addr = cx->zone()->group()->addressOfOwnerContext();
|
||||
masm.loadPtr(AbsoluteAddress(context_addr), temp0);
|
||||
Address limit_addr(temp0, offsetof(JSContext, jitStackLimitNoInterrupt));
|
||||
masm.branchStackPtrRhs(Assembler::Below, limit_addr, &stack_ok);
|
||||
|
@ -466,7 +466,7 @@ NativeRegExpMacroAssembler::GenerateCode(JSContext* cx, bool match_only)
|
|||
Address backtrackStackBaseAddress(temp2, offsetof(FrameData, backtrackStackBase));
|
||||
masm.subPtr(backtrackStackBaseAddress, backtrack_stack_pointer);
|
||||
|
||||
void* context_addr = &cx->zone()->group()->context;
|
||||
void* context_addr = cx->zone()->group()->addressOfOwnerContext();
|
||||
size_t baseOffset = offsetof(JSContext, regexpStack) + RegExpStack::offsetOfBase();
|
||||
masm.loadPtr(AbsoluteAddress(context_addr), temp1);
|
||||
masm.loadPtr(Address(temp1, baseOffset), temp1);
|
||||
|
@ -548,7 +548,7 @@ NativeRegExpMacroAssembler::Backtrack()
|
|||
|
||||
// Check for an interrupt.
|
||||
Label noInterrupt;
|
||||
void* contextAddr = &cx->zone()->group()->context;
|
||||
void* contextAddr = cx->zone()->group()->addressOfOwnerContext();
|
||||
masm.loadPtr(AbsoluteAddress(contextAddr), temp0);
|
||||
masm.branch32(Assembler::Equal, Address(temp0, offsetof(JSContext, interrupt_)), Imm32(0),
|
||||
&noInterrupt);
|
||||
|
@ -1109,7 +1109,7 @@ NativeRegExpMacroAssembler::CheckBacktrackStackLimit()
|
|||
JitSpew(SPEW_PREFIX "CheckBacktrackStackLimit");
|
||||
|
||||
Label no_stack_overflow;
|
||||
void* context_addr = &cx->zone()->group()->context;
|
||||
void* context_addr = cx->zone()->group()->addressOfOwnerContext();
|
||||
size_t limitOffset = offsetof(JSContext, regexpStack) + RegExpStack::offsetOfLimit();
|
||||
masm.loadPtr(AbsoluteAddress(context_addr), temp1);
|
||||
masm.branchPtr(Assembler::AboveOrEqual, Address(temp1, limitOffset),
|
||||
|
|
|
@ -3,4 +3,6 @@
|
|||
if (this.Intl) {
|
||||
addIntlExtras(Intl);
|
||||
addIntlExtras(Intl);
|
||||
} else {
|
||||
throw new Error();
|
||||
}
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче