This commit is contained in:
Wes Kocher 2016-08-10 16:55:48 -07:00
Родитель c1a786bb11 45e888ff26
Коммит 65ab32a8bb
306 изменённых файлов: 5633 добавлений и 1843 удалений

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

@ -1462,12 +1462,13 @@ DocAccessible::DoInitialUpdate()
ParentDocument()->FireDelayedEvent(reorderEvent);
}
TreeMutation mt(this);
uint32_t childCount = ChildCount();
for (uint32_t i = 0; i < childCount; i++) {
Accessible* child = GetChildAt(i);
RefPtr<AccShowEvent> event = new AccShowEvent(child);
FireDelayedEvent(event);
mt.AfterInsertion(child);
}
mt.Done();
}
void

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

@ -16,6 +16,7 @@
#include "nsCOMPtr.h"
#include "mozilla/dom/HTMLOptionElement.h"
#include "mozilla/dom/HTMLSelectElement.h"
#include "nsIComboboxControlFrame.h"
#include "nsContainerFrame.h"
#include "nsIListControlFrame.h"
@ -498,19 +499,15 @@ HTMLComboboxAccessible::SetCurrentItem(Accessible* aItem)
Accessible*
HTMLComboboxAccessible::SelectedOption() const
{
nsIFrame* frame = GetFrame();
nsIComboboxControlFrame* comboboxFrame = do_QueryFrame(frame);
if (!comboboxFrame)
return nullptr;
HTMLSelectElement* select = HTMLSelectElement::FromContent(mContent);
int32_t selectedIndex = select->SelectedIndex();
nsIListControlFrame* listControlFrame =
do_QueryFrame(comboboxFrame->GetDropDown());
if (listControlFrame) {
nsCOMPtr<nsIContent> activeOptionNode = listControlFrame->GetCurrentOption();
if (activeOptionNode) {
if (selectedIndex >= 0) {
HTMLOptionElement* option = select->Item(selectedIndex);
if (option) {
DocAccessible* document = Document();
if (document)
return document->GetAccessible(activeOptionNode);
return document->GetAccessible(option);
}
}

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

@ -47,13 +47,13 @@ B2GPresentationDevicePrompt.prototype = {
let device = self._getDeviceById(detail.deviceId);
if (!device) {
debug("cancel request because device is not found");
aRequest.cancel();
aRequest.cancel(Cr.NS_ERROR_DOM_NOT_FOUND_ERR);
}
aRequest.select(device);
break;
case "presentation-select-deny":
debug("request canceled by user");
aRequest.cancel();
aRequest.cancel(Cr.NS_ERROR_DOM_NOT_ALLOWED_ERR);
break;
}
});

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

@ -204,6 +204,13 @@ static int do_main(int argc, char* argv[], char* envp[], nsIFile *xreDirectory)
Output("Couldn't read application.ini");
return 255;
}
#if defined(HAS_DLL_BLOCKLIST)
// The dll blocklist operates in the exe vs. xullib. Pass a flag to
// xullib so automated tests can check the result once the browser
// is up and running.
appData->flags |=
DllBlocklist_CheckStatus() ? NS_XRE_DLL_BLOCKLIST_ENABLED : 0;
#endif
// xreDirectory already has a refcount from NS_NewLocalFile
appData->xreDirectory = xreDirectory;
int result = XRE_main(argc, argv, appData, mainFlags);
@ -232,6 +239,11 @@ static int do_main(int argc, char* argv[], char* envp[], nsIFile *xreDirectory)
// xreDirectory already has a refcount from NS_NewLocalFile
appData.xreDirectory = xreDirectory;
#if defined(HAS_DLL_BLOCKLIST)
appData.flags |=
DllBlocklist_CheckStatus() ? NS_XRE_DLL_BLOCKLIST_ENABLED : 0;
#endif
#if defined(XP_WIN) && defined(MOZ_SANDBOX)
sandbox::BrokerServices* brokerServices =
sandboxing::GetInitializedBrokerServices();

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

@ -67,7 +67,10 @@ var gEMEHandler = {
switch (status) {
case "available":
case "cdm-created":
this.showPopupNotificationForSuccess(browser, keySystem);
// Only show the chain icon for proprietary CDMs. Clearkey is not one.
if (keySystem != "org.w3.clearkey") {
this.showPopupNotificationForSuccess(browser, keySystem);
}
// ... and bail!
return;

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

@ -1419,14 +1419,21 @@ var BookmarkingUI = {
Services.prefs.removeObserver(this.RECENTLY_BOOKMARKED_PREF, prefObserver, false);
PlacesUtils.bookmarks.removeObserver(this._recentlyBookmarkedObserver);
this._recentlyBookmarkedObserver = null;
placesContextMenu.removeEventListener("popupshowing", onPlacesContextMenuShowing);
if (placesContextMenu) {
placesContextMenu.removeEventListener("popupshowing", onPlacesContextMenuShowing);
}
bookmarksMenu.removeEventListener("popuphidden", onBookmarksMenuHidden);
}
};
Services.prefs.addObserver(this.RECENTLY_BOOKMARKED_PREF, prefObserver, false);
PlacesUtils.bookmarks.addObserver(this._recentlyBookmarkedObserver, true);
placesContextMenu.addEventListener("popupshowing", onPlacesContextMenuShowing);
// The context menu doesn't exist in non-browser windows on Mac
if (placesContextMenu) {
placesContextMenu.addEventListener("popupshowing", onPlacesContextMenuShowing);
}
bookmarksMenu.addEventListener("popuphidden", onBookmarksMenuHidden);
},

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

@ -735,7 +735,7 @@ nsContextMenu.prototype = {
if (this.isMediaURLReusable(mediaURL)) {
this.mediaURL = mediaURL;
}
if (this.target.isEncrypted) {
if (this._isProprietaryDRM()) {
this.onDRMMedia = true;
}
// Firefox always creates a HTMLVideoElement when loading an ogg file
@ -754,7 +754,7 @@ nsContextMenu.prototype = {
if (this.isMediaURLReusable(mediaURL)) {
this.mediaURL = mediaURL;
}
if (this.target.isEncrypted) {
if (this._isProprietaryDRM()) {
this.onDRMMedia = true;
}
}
@ -968,6 +968,11 @@ nsContextMenu.prototype = {
return aNode.spellcheck;
},
_isProprietaryDRM: function() {
return this.target.isEncrypted && this.target.mediaKeys &&
this.target.mediaKeys.keySystem != "org.w3.clearkey";
},
_openLinkInParameters : function (extra) {
let params = { charset: gContextMenuContentData.charSet,
referrerURI: gContextMenuContentData.documentURIObject,

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

@ -66,13 +66,19 @@ add_task(function* test_navigate_full_domain() {
gBrowser.removeTab(tab);
});
add_task(function* test_navigate_numbers() {
add_task(function* test_navigate_valid_numbers() {
let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
yield BrowserTestUtils.browserLoaded(tab.linkedBrowser);
yield* runURLBarSearchTest("1234", true, false);
yield* runURLBarSearchTest("1234", true, true);
gBrowser.removeTab(tab);
});
add_task(function* test_navigate_invalid_numbers() {
let tab = gBrowser.selectedTab = gBrowser.addTab("about:blank");
yield BrowserTestUtils.browserLoaded(tab.linkedBrowser);
yield* runURLBarSearchTest("123456789012345", true, false);
gBrowser.removeTab(tab);
});
function get_test_function_for_localhost_with_hostname(hostName, isPrivate) {
return function* test_navigate_single_host() {
const pref = "browser.fixup.domainwhitelist.localhost";

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

@ -122,7 +122,7 @@ var SessionStorageInternal = {
// There is no need to pass documentURI, it's only used to fill documentURI property of
// domstorage event, which in this case has no consumer. Prevention of events in case
// of missing documentURI will be solved in a followup bug to bug 600307.
let storage = storageManager.createStorage(window, principal, "", aDocShell.usePrivateBrowsing);
let storage = storageManager.createStorage(window, principal, "");
for (let key of Object.keys(data)) {
try {

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

@ -1724,7 +1724,7 @@ toolbarbutton.chevron > .toolbarbutton-icon {
}
.ctrlTab-preview-inner > .tabPreview-canvas {
box-shadow: 1px 1px 2px rgb(12%,12%,12%);
box-shadow: 1px 1px 2px hsl(0,0%,12%);
}
.ctrlTab-preview:not(#ctrlTab-showAll) > * > .ctrlTab-preview-inner > .tabPreview-canvas {

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

@ -3131,7 +3131,7 @@ menulist.translate-infobar-element > .menulist-dropmarker {
}
.ctrlTab-preview-inner > .tabPreview-canvas {
box-shadow: 1px 1px 2px rgb(12%,12%,12%);
box-shadow: 1px 1px 2px hsl(0,0%,12%);
}
.ctrlTab-preview:not(#ctrlTab-showAll) > * > .ctrlTab-preview-inner > .tabPreview-canvas {

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

@ -2378,7 +2378,7 @@ notification[value="translation"] {
}
.ctrlTab-preview-inner > .tabPreview-canvas {
box-shadow: 1px 1px 2px rgb(12%,12%,12%);
box-shadow: 1px 1px 2px hsl(0,0%,12%);
}
.ctrlTab-preview:not(#ctrlTab-showAll) > * > .ctrlTab-preview-inner > .tabPreview-canvas {

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

@ -565,6 +565,13 @@ BasePrincipal::GetUserContextId(uint32_t* aUserContextId)
return NS_OK;
}
NS_IMETHODIMP
BasePrincipal::GetPrivateBrowsingId(uint32_t* aPrivateBrowsingId)
{
*aPrivateBrowsingId = PrivateBrowsingId();
return NS_OK;
}
NS_IMETHODIMP
BasePrincipal::GetIsInIsolatedMozBrowserElement(bool* aIsInIsolatedMozBrowserElement)
{

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

@ -264,6 +264,7 @@ public:
NS_IMETHOD GetIsInIsolatedMozBrowserElement(bool* aIsInIsolatedMozBrowserElement) final;
NS_IMETHOD GetUnknownAppId(bool* aUnknownAppId) final;
NS_IMETHOD GetUserContextId(uint32_t* aUserContextId) final;
NS_IMETHOD GetPrivateBrowsingId(uint32_t* aPrivateBrowsingId) final;
virtual bool IsOnCSSUnprefixingWhitelist() override { return false; }
@ -277,6 +278,7 @@ public:
const PrincipalOriginAttributes& OriginAttributesRef() { return mOriginAttributes; }
uint32_t AppId() const { return mOriginAttributes.mAppId; }
uint32_t UserContextId() const { return mOriginAttributes.mUserContextId; }
uint32_t PrivateBrowsingId() const { return mOriginAttributes.mPrivateBrowsingId; }
bool IsInIsolatedMozBrowserElement() const { return mOriginAttributes.mInIsolatedMozBrowser; }
enum PrincipalKind {

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

@ -307,6 +307,13 @@ interface nsIPrincipal : nsISerializable
*/
[infallible] readonly attribute unsigned long userContextId;
/**
* Gets the id of the private browsing state of the context containing
* this principal. If the principal has a private browsing value of 0, it
* is not in private browsing.
*/
[infallible] readonly attribute unsigned long privateBrowsingId;
/**
* Returns true iff the principal is inside an isolated mozbrowser element.
* <iframe mozbrowser mozapp> and <xul:browser> are not considered to be

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

@ -41,7 +41,7 @@ def _nsinstall_internal(argv):
# implented.
def BadArg(option, opt, value, parser):
parser.error('option not supported: {0}'.format(opt))
p.add_option('-C', action="callback", metavar="CWD",
callback=BadArg,
help="NOT SUPPORTED")

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

@ -119,7 +119,7 @@ class TestNsinstall(unittest.TestCase):
def test_nsinstall_m(self):
"Test that nsinstall -m works (set mode)"
testfile = self.touch("testfile")
mode = 0600
mode = 0o600
os.chmod(testfile, mode)
testdir = self.mkdirs("testdir")
self.assertEqual(nsinstall(["-m", "{0:04o}"

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

@ -81,7 +81,7 @@ if __name__ == '__main__':
# Other things than us are going to run this file, so we need to give it
# executable permissions.
os.chmod('config.status', 0755)
os.chmod('config.status', 0o755)
if config.get('MOZ_BUILD_APP') != 'js' or config.get('JS_STANDALONE'):
os.environ['WRITE_MOZINFO'] = '1'
# Until we have access to the virtualenv from this script, execute

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

@ -11,13 +11,16 @@
"clearTimeout": true,
"console": true,
"CSS": true,
"DocumentFragment": true,
"DOMParser": true,
"dump": true,
"Element": true,
"exports": true,
"isWorker": true,
"indexedDB": true,
"loader": true,
"module": true,
"Node": true,
"reportError": true,
"require": true,
"setInterval": true,

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

@ -591,7 +591,7 @@ function pref(name, value) {
thePref.setDefault(value);
}
exports.Services = Services;
module.exports = Services;
// This is exported to silence eslint and, at some point, perhaps to
// provide it when loading devtools.js in order to install the default
// preferences.

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

@ -12,7 +12,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1265802
<script type="application/javascript;version=1.8">
"use strict";
var exports = {};
var exports = {}
var module = {exports};
</script>
<script type="application/javascript;version=1.8"

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

@ -12,7 +12,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1278473
<script type="application/javascript;version=1.8">
"use strict";
var exports = {};
var exports = {}
var module = {exports};
</script>
<script type="application/javascript;version=1.8"

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

@ -12,7 +12,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=1265808
<script type="application/javascript;version=1.8">
"use strict";
var exports = {};
var exports = {}
var module = {exports};
// Add some starter prefs.
localStorage.setItem("devtools.branch1.somebool", JSON.stringify({

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

@ -3,7 +3,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const {Ci} = require("chrome");
const EventEmitter = require("devtools/shared/event-emitter");
loader.lazyRequireGetter(this, "setNamedTimeout",
"devtools/client/shared/widgets/view-helpers", true);
@ -1350,17 +1349,17 @@ Column.prototype = {
// Only sort the array if we are sorting based on this column
if (this.sorted == 1) {
items.sort((a, b) => {
let val1 = (a[this.id] instanceof Ci.nsIDOMNode) ?
let val1 = (a[this.id] instanceof Node) ?
a[this.id].textContent : a[this.id];
let val2 = (b[this.id] instanceof Ci.nsIDOMNode) ?
let val2 = (b[this.id] instanceof Node) ?
b[this.id].textContent : b[this.id];
return val1 > val2;
});
} else if (this.sorted > 1) {
items.sort((a, b) => {
let val1 = (a[this.id] instanceof Ci.nsIDOMNode) ?
let val1 = (a[this.id] instanceof Node) ?
a[this.id].textContent : a[this.id];
let val2 = (b[this.id] instanceof Ci.nsIDOMNode) ?
let val2 = (b[this.id] instanceof Node) ?
b[this.id].textContent : b[this.id];
return val2 > val1;
});
@ -1504,18 +1503,18 @@ Cell.prototype = {
return;
}
if (this.wrapTextInElements && !(value instanceof Ci.nsIDOMNode)) {
if (this.wrapTextInElements && !(value instanceof Node)) {
let span = this.label.ownerDocument.createElementNS(HTML_NS, "span");
span.textContent = value;
value = span;
}
if (!(value instanceof Ci.nsIDOMNode) &&
if (!(value instanceof Node) &&
value.length > MAX_VISIBLE_STRING_SIZE) {
value = value .substr(0, MAX_VISIBLE_STRING_SIZE) + "\u2026";
}
if (value instanceof Ci.nsIDOMNode) {
if (value instanceof Node) {
this.label.removeAttribute("value");
while (this.label.firstChild) {

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

@ -5,8 +5,6 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
const { Ci } = require("chrome");
const PANE_APPEARANCE_DELAY = 50;
const PAGE_SIZE_ITEM_COUNT_RATIO = 5;
const WIDGET_FOCUSABLE_NODES = new Set(["vbox", "hbox"]);
@ -128,7 +126,7 @@ const ViewHelpers = exports.ViewHelpers = {
* called preventDefault.
*/
dispatchEvent: function (target, type, detail) {
if (!(target instanceof Ci.nsIDOMNode)) {
if (!(target instanceof Node)) {
// Event cancelled.
return true;
}
@ -190,9 +188,9 @@ const ViewHelpers = exports.ViewHelpers = {
* True if it's a node, false otherwise.
*/
isNode: function (object) {
return object instanceof Ci.nsIDOMNode ||
object instanceof Ci.nsIDOMElement ||
object instanceof Ci.nsIDOMDocumentFragment;
return object instanceof Node ||
object instanceof Element ||
object instanceof DocumentFragment;
},
/**
@ -792,12 +790,12 @@ const WidgetMethods = exports.WidgetMethods = {
// If the two items were constructed with prebuilt nodes as
// DocumentFragments, then those DocumentFragments are now
// empty and need to be reassembled.
if (firstPrebuiltTarget instanceof Ci.nsIDOMDocumentFragment) {
if (firstPrebuiltTarget instanceof DocumentFragment) {
for (let node of firstTarget.childNodes) {
firstPrebuiltTarget.appendChild(node.cloneNode(true));
}
}
if (secondPrebuiltTarget instanceof Ci.nsIDOMDocumentFragment) {
if (secondPrebuiltTarget instanceof DocumentFragment) {
for (let node of secondTarget.childNodes) {
secondPrebuiltTarget.appendChild(node.cloneNode(true));
}

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

@ -32,9 +32,9 @@ function initializeAutoCompletion(ctx, options = {}) {
Editor.keyFor("autocompletion", { noaccel: true });
if (ed.config.mode == Editor.modes.js) {
let defs = [
"./tern/browser",
"./tern/ecma5",
].map(require);
require("./tern/browser"),
require("./tern/ecma5"),
];
CM_TERN_SCRIPTS.forEach(ed.loadScript, ed);
win.tern = require("./tern/tern");

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

@ -234,6 +234,10 @@ const globals = exports.globals = {
.createInstance(Ci.nsIXMLHttpRequest);
},
Node: Ci.nsIDOMNode,
Element: Ci.nsIDOMElement,
DocumentFragment: Ci.nsIDOMDocumentFragment,
// Make sure `define` function exists. This allows defining some modules
// in AMD format while retaining CommonJS compatibility through this hook.
// JSON Viewer needs modules in AMD format, as it currently uses RequireJS

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

@ -2984,11 +2984,11 @@ nsDocShell::GetSessionStorageForPrincipal(nsIPrincipal* aPrincipal,
AssertOriginAttributesMatchPrivateBrowsing();
if (aCreate) {
return manager->CreateStorage(domWin->GetCurrentInnerWindow(), aPrincipal,
aDocumentURI, UsePrivateBrowsing(), aStorage);
aDocumentURI, aStorage);
}
return manager->GetStorage(domWin->GetCurrentInnerWindow(), aPrincipal,
UsePrivateBrowsing(), aStorage);
aStorage);
}
nsresult

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

@ -6,6 +6,7 @@
#include "domstubs.idl"
#include "nsIDocShellTreeItem.idl"
#include "nsIRequest.idl"
%{ C++
#include "js/TypeDecls.h"
@ -46,8 +47,6 @@ interface nsICommandManager;
interface nsICommandParams;
native TabChildRef(already_AddRefed<nsITabChild>);
typedef unsigned long nsLoadFlags;
[scriptable, builtinclass, uuid(049234fe-da10-478b-bc5d-bc6f9a1ba63d)]
interface nsIDocShell : nsIDocShellTreeItem
{

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

@ -130,45 +130,45 @@ var testcases = [ {
protocolChange: true,
}, {
input: "1.2.3",
fixedURI: "http://1.2.3/",
fixedURI: "http://1.2.0.3/",
protocolChange: true,
}, {
input: "1.2.3/",
fixedURI: "http://1.2.3/",
fixedURI: "http://1.2.0.3/",
protocolChange: true,
}, {
input: "1.2.3/foo",
fixedURI: "http://1.2.3/foo",
fixedURI: "http://1.2.0.3/foo",
protocolChange: true,
}, {
input: "1.2.3/123",
fixedURI: "http://1.2.3/123",
fixedURI: "http://1.2.0.3/123",
protocolChange: true,
}, {
input: "1.2.3:8000",
fixedURI: "http://1.2.3:8000/",
fixedURI: "http://1.2.0.3:8000/",
protocolChange: true,
}, {
input: "1.2.3:8000/",
fixedURI: "http://1.2.3:8000/",
fixedURI: "http://1.2.0.3:8000/",
protocolChange: true,
}, {
input: "1.2.3:8000/foo",
fixedURI: "http://1.2.3:8000/foo",
fixedURI: "http://1.2.0.3:8000/foo",
protocolChange: true,
}, {
input: "1.2.3:8000/123",
fixedURI: "http://1.2.3:8000/123",
fixedURI: "http://1.2.0.3:8000/123",
protocolChange: true,
}, {
input: "http://1.2.3",
fixedURI: "http://1.2.3/",
fixedURI: "http://1.2.0.3/",
}, {
input: "http://1.2.3/",
fixedURI: "http://1.2.3/",
fixedURI: "http://1.2.0.3/",
}, {
input: "http://1.2.3/foo",
fixedURI: "http://1.2.3/foo",
fixedURI: "http://1.2.0.3/foo",
}, {
input: "[::1]",
fixedURI: "http://[::1]/",
@ -222,8 +222,7 @@ var testcases = [ {
protocolChange: true
}, {
input: "1234",
fixedURI: "http://1234/",
alternateURI: "http://www.1234.com/",
fixedURI: "http://0.0.4.210/",
keywordLookup: true,
protocolChange: true,
affectedByDNSForSingleHosts: true,
@ -362,8 +361,7 @@ var testcases = [ {
affectedByDNSForSingleHosts: true,
}, {
input: "32.7",
fixedURI: "http://32.7/",
alternateURI: "http://www.32.7/",
fixedURI: "http://32.0.0.7/",
keywordLookup: true,
protocolChange: true,
affectedByDNSForSingleHosts: true,
@ -376,8 +374,7 @@ var testcases = [ {
affectedByDNSForSingleHosts: true,
}, {
input: "5/2",
fixedURI: "http://5/2",
alternateURI: "http://www.5.com/2",
fixedURI: "http://0.0.0.5/2",
keywordLookup: true,
protocolChange: true,
affectedByDNSForSingleHosts: true,

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

@ -1696,7 +1696,7 @@ Navigator::GetFeature(const nsAString& aName, ErrorResult& aRv)
return p.forget();
}
p->MaybeResolve(JS::UndefinedHandleValue);
p->MaybeResolveWithUndefined();
return p.forget();
}
@ -1795,12 +1795,12 @@ Navigator::HasFeature(const nsAString& aName, ErrorResult& aRv)
return p.forget();
}
p->MaybeResolve(JS::UndefinedHandleValue);
p->MaybeResolveWithUndefined();
return p.forget();
}
// resolve with <undefined> because the feature name is not supported
p->MaybeResolve(JS::UndefinedHandleValue);
p->MaybeResolveWithUndefined();
return p.forget();
}

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

@ -172,14 +172,14 @@ ScreenOrientation::LockOrientationTask::Run()
if (mDocument->Hidden()) {
// Active orientation lock is not the document's orientation lock.
mPromise->MaybeResolve(JS::UndefinedHandleValue);
mPromise->MaybeResolveWithUndefined();
mDocument->SetOrientationPendingPromise(nullptr);
return NS_OK;
}
if (mOrientationLock == eScreenOrientation_None) {
mScreenOrientation->UnlockDeviceOrientation();
mPromise->MaybeResolve(JS::UndefinedHandleValue);
mPromise->MaybeResolveWithUndefined();
mDocument->SetOrientationPendingPromise(nullptr);
return NS_OK;
}
@ -201,7 +201,7 @@ ScreenOrientation::LockOrientationTask::Run()
(mOrientationLock == eScreenOrientation_Default &&
mDocument->CurrentOrientationAngle() == 0)) {
// Orientation lock will not cause an orientation change.
mPromise->MaybeResolve(JS::UndefinedHandleValue);
mPromise->MaybeResolveWithUndefined();
mDocument->SetOrientationPendingPromise(nullptr);
}
@ -550,7 +550,7 @@ ScreenOrientation::Notify(const hal::ScreenConfiguration& aConfiguration)
Promise* pendingPromise = doc->GetOrientationPendingPromise();
if (pendingPromise) {
pendingPromise->MaybeResolve(JS::UndefinedHandleValue);
pendingPromise->MaybeResolveWithUndefined();
doc->SetOrientationPendingPromise(nullptr);
}
@ -636,7 +636,7 @@ ScreenOrientation::VisibleEventListener::HandleEvent(nsIDOMEvent* aEvent)
Promise* pendingPromise = doc->GetOrientationPendingPromise();
if (pendingPromise) {
pendingPromise->MaybeResolve(JS::UndefinedHandleValue);
pendingPromise->MaybeResolveWithUndefined();
doc->SetOrientationPendingPromise(nullptr);
}

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

@ -31,6 +31,7 @@ DOM4_MSG_DEF(TimeoutError, "The operation timed out.", NS_ERROR_DOM_TIMEOUT_ERR)
DOM4_MSG_DEF(InvalidNodeTypeError, "The supplied node is incorrect or has an incorrect ancestor for this operation.", NS_ERROR_DOM_INVALID_NODE_TYPE_ERR)
DOM4_MSG_DEF(DataCloneError, "The object could not be cloned.", NS_ERROR_DOM_DATA_CLONE_ERR)
DOM4_MSG_DEF(InvalidPointerId, "Invalid pointer id.", NS_ERROR_DOM_INVALID_POINTER_ERR)
DOM4_MSG_DEF(NotAllowedError, "The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.", NS_ERROR_DOM_NOT_ALLOWED_ERR)
/* XXX Should be JavaScript native TypeError */
DOM4_MSG_DEF(TypeError, "The method parameter is missing or invalid.", NS_ERROR_TYPE_ERR)
@ -161,3 +162,8 @@ DOM4_MSG_DEF(InvalidStateError, "A subscription with a different application ser
DOM_MSG_DEF(NS_ERROR_DOM_JS_EXCEPTION, "A callback threw an exception")
DOM_MSG_DEF(NS_ERROR_DOM_DOMEXCEPTION, "A DOMException was thrown")
/* Media errors */
DOM4_MSG_DEF(AbortError, "The fetching process for the media resource was aborted by the user agent at the user's request.", NS_ERROR_DOM_MEDIA_ABORT_ERR)
DOM4_MSG_DEF(NotAllowedError, "The play method is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.", NS_ERROR_DOM_MEDIA_NOT_ALLOWED_ERR)
DOM4_MSG_DEF(NotSupportedError, "The media resource indicated by the src attribute or assigned media provider object was not suitable.", NS_ERROR_DOM_MEDIA_NOT_SUPPORTED_ERR)

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

@ -279,6 +279,7 @@ bool nsContentUtils::sEncodeDecodeURLHash = false;
bool nsContentUtils::sGettersDecodeURLHash = false;
bool nsContentUtils::sPrivacyResistFingerprinting = false;
bool nsContentUtils::sSendPerformanceTimingNotifications = false;
bool nsContentUtils::sAppendLFInSerialization = false;
uint32_t nsContentUtils::sHandlingInputTimeout = 1000;
@ -593,6 +594,8 @@ nsContentUtils::Init()
"network.cookie.cookieBehavior",
nsICookieService::BEHAVIOR_ACCEPT);
Preferences::AddBoolVarCache(&sAppendLFInSerialization,
"dom.html_fragment_serialisation.appendLF");
#if !(defined(DEBUG) || defined(MOZ_ENABLE_JS_DUMP))
Preferences::AddBoolVarCache(&sDOMWindowDumpEnabled,
"browser.dom.window.dump.enabled");
@ -8979,12 +8982,12 @@ StartElement(Element* aContent, StringBuilder& aBuilder)
aBuilder.Append(">");
/*
// Per HTML spec we should append one \n if the first child of
// pre/textarea/listing is a textnode and starts with a \n.
// But because browsers haven't traditionally had that behavior,
// we're not changing our behavior either - yet.
if (aContent->IsHTMLElement()) {
if (nsContentUtils::AppendLFInSerialization() && aContent->IsHTMLElement()) {
if (localName == nsGkAtoms::pre || localName == nsGkAtoms::textarea ||
localName == nsGkAtoms::listing) {
nsIContent* fc = aContent->GetFirstChild();
@ -8997,7 +9000,7 @@ StartElement(Element* aContent, StringBuilder& aBuilder)
}
}
}
}*/
}
}
static inline bool

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

@ -1954,6 +1954,10 @@ public:
static already_AddRefed<mozilla::layers::LayerManager>
PersistentLayerManagerForDocument(nsIDocument *aDoc);
/* static */
static bool AppendLFInSerialization()
{ return sAppendLFInSerialization; }
/**
* Determine whether a content node is focused or not,
*
@ -2771,6 +2775,7 @@ private:
static bool sGettersDecodeURLHash;
static bool sPrivacyResistFingerprinting;
static bool sSendPerformanceTimingNotifications;
static bool sAppendLFInSerialization;
static uint32_t sCookiesLifetimePolicy;
static uint32_t sCookiesBehavior;

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

@ -10541,7 +10541,6 @@ nsGlobalWindow::GetSessionStorage(ErrorResult& aError)
nsCOMPtr<nsIDOMStorage> storage;
aError = storageManager->CreateStorage(AsInner(), principal, documentURI,
IsPrivateBrowsing(),
getter_AddRefs(storage));
if (aError.Failed()) {
return nullptr;
@ -10602,7 +10601,6 @@ nsGlobalWindow::GetLocalStorage(ErrorResult& aError)
nsCOMPtr<nsIDOMStorage> storage;
aError = storageManager->CreateStorage(AsInner(), principal, documentURI,
IsPrivateBrowsing(),
getter_AddRefs(storage));
if (aError.Failed()) {
return nullptr;
@ -11455,7 +11453,14 @@ nsGlobalWindow::Observe(nsISupports* aSubject, const char* aTopic,
return NS_OK;
}
if (changingStorage->IsPrivate() != IsPrivateBrowsing()) {
uint32_t privateBrowsingId = 0;
nsIPrincipal *storagePrincipal = changingStorage->GetPrincipal();
rv = storagePrincipal->GetPrivateBrowsingId(&privateBrowsingId);
if (NS_FAILED(rv)) {
return rv;
}
if ((privateBrowsingId > 0) != IsPrivateBrowsing()) {
return NS_OK;
}

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

@ -154,6 +154,17 @@ nsStyledElement::ReparseStyleAttribute(bool aForceInDataDoc)
return NS_OK;
}
nsICSSDeclaration*
nsStyledElement::GetExistingStyle()
{
Element::nsDOMSlots* slots = GetExistingDOMSlots();
if (!slots) {
return nullptr;
}
return slots->mStyle;
}
void
nsStyledElement::ParseStyleAttribute(const nsAString& aValue,
nsAttrValue& aResult,
@ -170,6 +181,7 @@ nsStyledElement::ParseStyleAttribute(const nsAString& aValue,
if (aForceInDataDoc ||
!doc->IsLoadedAsData() ||
GetExistingStyle() ||
doc->IsStaticDocument()) {
bool isCSS = true; // assume CSS until proven otherwise

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

@ -57,6 +57,8 @@ public:
protected:
nsICSSDeclaration* GetExistingStyle();
/**
* Parse a style attr value into a CSS rulestruct (or, if there is no
* document, leave it as a string) and return as nsAttrValue.

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

@ -13,7 +13,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=744830
<pre id="test">
<script type="application/javascript">
var t = document.getElementById('testnodes');
is(t.innerHTML,
is(t.innerHTML,
"<span>hi</span> there <!-- mon ami -->",
"comment nodes should be included");
@ -26,7 +26,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=744830
t.appendChild(document.createElement("textarea"));
t.firstChild.appendChild(document.createTextNode("\nhello"));
// This is the old behavior. Spec requires something else.
is(t.innerHTML, "<textarea>\nhello</textarea>",
is(t.innerHTML, "<textarea>\n\nhello</textarea>",
"No extra newlines should be inserted to the textarea!");
t.innerHTML = null;
@ -39,7 +39,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=744830
t.firstChild.textContent = "<foo>";
is(t.innerHTML, "<math>&lt;foo&gt;</math>");
// Prefix is serialized if element isn't HTML/SVG/MathML
// Prefix is serialized if element isn't HTML/SVG/MathML
t.innerHTML = null;
t.appendChild(document.createElementNS("http://www.example.org", "ex:example"));
t.firstChild.textContent = "<foo>";
@ -61,7 +61,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=744830
t.firstChild.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:bar", "http://bar");
is(t.innerHTML, '<example xml:lang="us-en" xlink:href="foo" xmlns="http://foo" xmlns:bar="http://bar">&lt;foo&gt;</example>');
t.firstChild.setAttributeNS("http://www.helloworldns.org", "hello:world", "!");
is(t.innerHTML, '<example xml:lang="us-en" xlink:href="foo" xmlns="http://foo" xmlns:bar="http://bar" hello:world="!">&lt;foo&gt;</example>');

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

@ -233,8 +233,7 @@ DOMInterfaces = {
'createImageData', 'getImageData'
],
'binaryNames': {
'mozImageSmoothingEnabled': 'imageSmoothingEnabled',
'mozFillRule': 'fillRule'
'mozImageSmoothingEnabled': 'imageSmoothingEnabled'
}
},

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

@ -406,7 +406,7 @@ BluetoothGattCharacteristic::WriteValue(const ArrayBuffer& aValue,
mValue.Clear();
mValue.AppendElements(aValue.Data(), aValue.Length());
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
return promise.forget();
}

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

@ -281,7 +281,7 @@ BluetoothGattDescriptor::WriteValue(
mValue.Clear();
mValue.AppendElements(aValue.Data(), aValue.Length());
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
return promise.forget();
}

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

@ -550,7 +550,7 @@ BluetoothGattServer::StopAdvertising(ErrorResult& aRv)
BT_ENSURE_TRUE_REJECT(mValid, promise, NS_ERROR_NOT_AVAILABLE);
if (mAdvertisingAppUuid.IsCleared()) {
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
return promise.forget();
}
@ -840,7 +840,7 @@ private:
{
mServer->mPendingService = nullptr;
mServer->mServices.AppendElement(mService);
mPromise->MaybeResolve(JS::UndefinedHandleValue);
mPromise->MaybeResolveWithUndefined();
}
void OnErrorFired() override

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

@ -253,7 +253,7 @@ BluetoothGattService::AddIncludedService(BluetoothGattService& aIncludedService,
NS_ERROR_UNEXPECTED);
mIncludedServices.AppendElement(&aIncludedService);
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
return promise.forget();
}

2
dom/cache/Cache.cpp поставляемый
Просмотреть файл

@ -586,7 +586,7 @@ Cache::AddAll(const GlobalObject& aGlobal,
return nullptr;
}
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
return promise.forget();
}

4
dom/cache/CacheOpChild.cpp поставляемый
Просмотреть файл

@ -128,7 +128,7 @@ CacheOpChild::Recv__delete__(const ErrorResult& aRv,
}
case CacheOpResult::TCachePutAllResult:
{
mPromise->MaybeResolve(JS::UndefinedHandleValue);
mPromise->MaybeResolveWithUndefined();
break;
}
case CacheOpResult::TCacheDeleteResult:
@ -212,7 +212,7 @@ void
CacheOpChild::HandleResponse(const CacheResponseOrVoid& aResponseOrVoid)
{
if (aResponseOrVoid.type() == CacheResponseOrVoid::Tvoid_t) {
mPromise->MaybeResolve(JS::UndefinedHandleValue);
mPromise->MaybeResolveWithUndefined();
return;
}

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

@ -1100,7 +1100,7 @@ nsDOMCameraControl::ReleaseHardware(ErrorResult& aRv)
if (!mCameraControl) {
// Always succeed if the camera instance is already closed.
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
return promise.forget();
}
@ -1291,7 +1291,7 @@ nsDOMCameraControl::OnHardwareStateChange(CameraControlListener::HardwareState a
if (!mSetInitialConfig) {
RefPtr<Promise> promise = mReleasePromise.forget();
if (promise) {
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
}
CameraClosedEventInit eventInit;
@ -1409,7 +1409,7 @@ nsDOMCameraControl::OnRecorderStateChange(CameraControlListener::RecorderState a
{
RefPtr<Promise> promise = mStartRecordingPromise.forget();
if (promise) {
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
}
state = NS_LITERAL_STRING("Started");
@ -1640,7 +1640,7 @@ nsDOMCameraControl::OnUserError(CameraControlListener::UserContext aContext, nsr
// This value indicates that the hardware is already closed; which for
// kInStopCamera, is not actually an error.
if (promise) {
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
}
return;

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

@ -1521,6 +1521,26 @@ CanvasRenderingContext2D::EnsureTarget(const gfx::Rect* aCoveredRect,
return mRenderingMode;
}
// If the next drawing command covers the entire canvas, we can skip copying
// from the previous frame and/or clearing the canvas.
gfx::Rect canvasRect(0, 0, mWidth, mHeight);
bool canDiscardContent = aCoveredRect &&
CurrentState().transform.TransformBounds(*aCoveredRect).Contains(canvasRect);
// If a clip is active we don't know for sure that the next drawing command
// will really cover the entire canvas.
for (const auto& style : mStyleStack) {
if (!canDiscardContent) {
break;
}
for (const auto& clipOrTransform : style.clipsAndTransforms) {
if (clipOrTransform.IsClip()) {
canDiscardContent = false;
break;
}
}
}
ScheduleStableStateCallback();
// we'll do a few extra things at the end of this method if we changed the
@ -1528,12 +1548,9 @@ CanvasRenderingContext2D::EnsureTarget(const gfx::Rect* aCoveredRect,
RefPtr<PersistentBufferProvider> oldBufferProvider = mBufferProvider;
if (mBufferProvider && mode == mRenderingMode) {
gfx::Rect rect(0, 0, mWidth, mHeight);
if (aCoveredRect && CurrentState().transform.TransformBounds(*aCoveredRect).Contains(rect)) {
mTarget = mBufferProvider->BorrowDrawTarget(IntRect());
} else {
mTarget = mBufferProvider->BorrowDrawTarget(IntRect(0, 0, mWidth, mHeight));
}
auto persistedRect = canDiscardContent ? IntRect()
: IntRect(0, 0, mWidth, mHeight);
mTarget = mBufferProvider->BorrowDrawTarget(persistedRect);
mode = mRenderingMode;
}
@ -1614,7 +1631,7 @@ CanvasRenderingContext2D::EnsureTarget(const gfx::Rect* aCoveredRect,
JS_updateMallocCounter(context, mWidth * mHeight * 4);
}
mTarget->ClearRect(gfx::Rect(Point(0, 0), Size(mWidth, mHeight)));
mTarget->ClearRect(canvasRect);
// Force a full layer transaction since we didn't have a layer before
// and now we might need one.
@ -1626,6 +1643,9 @@ CanvasRenderingContext2D::EnsureTarget(const gfx::Rect* aCoveredRect,
Redraw();
}
// Restore clips and transform.
mTarget->SetTransform(Matrix());
if (mTarget->GetBackendType() == gfx::BackendType::CAIRO) {
// Cairo doesn't play well with huge clips. When given a very big clip it
// will try to allocate big mask surface without taking the target
@ -1633,14 +1653,16 @@ CanvasRenderingContext2D::EnsureTarget(const gfx::Rect* aCoveredRect,
// This limits the clip extents to the size of the canvas.
// A fix in Cairo would probably be preferable, but requires somewhat
// invasive changes.
mTarget->PushClipRect(gfx::Rect(Point(0, 0), Size(mWidth, mHeight)));
mTarget->PushClipRect(canvasRect);
}
// Restore clip and transform.
for (uint32_t i = 0; i < mStyleStack.Length(); i++) {
mTarget->SetTransform(mStyleStack[i].transform);
for (uint32_t c = 0; c < mStyleStack[i].clipsPushed.Length(); c++) {
mTarget->PushClip(mStyleStack[i].clipsPushed[c]);
for (const auto& style : mStyleStack) {
for (const auto& clipOrTransform : style.clipsAndTransforms) {
if (clipOrTransform.IsClip()) {
mTarget->PushClip(clipOrTransform.clip);
} else {
mTarget->SetTransform(clipOrTransform.transform);
}
}
}
} else {
@ -1752,9 +1774,11 @@ CanvasRenderingContext2D::ReturnTarget()
{
if (mTarget && mBufferProvider && mTarget != sErrorTarget) {
CurrentState().transform = mTarget->GetTransform();
for (uint32_t i = 0; i < mStyleStack.Length(); i++) {
for (uint32_t c = 0; c < mStyleStack[i].clipsPushed.Length(); c++) {
mTarget->PopClip();
for (const auto& style : mStyleStack) {
for (const auto& clipOrTransform : style.clipsAndTransforms) {
if (clipOrTransform.IsClip()) {
mTarget->PopClip();
}
}
}
@ -1934,8 +1958,10 @@ CanvasRenderingContext2D::Restore()
TransformWillUpdate();
for (uint32_t i = 0; i < CurrentState().clipsPushed.Length(); i++) {
mTarget->PopClip();
for (const auto& clipOrTransform : CurrentState().clipsAndTransforms) {
if (clipOrTransform.IsClip()) {
mTarget->PopClip();
}
}
mStyleStack.RemoveElementAt(mStyleStack.Length() - 1);
@ -1958,10 +1984,8 @@ CanvasRenderingContext2D::Scale(double aX, double aY, ErrorResult& aError)
Matrix newMatrix = mTarget->GetTransform();
newMatrix.PreScale(aX, aY);
if (!newMatrix.IsFinite()) {
return;
}
mTarget->SetTransform(newMatrix);
SetTransformInternal(newMatrix);
}
void
@ -1974,10 +1998,8 @@ CanvasRenderingContext2D::Rotate(double aAngle, ErrorResult& aError)
}
Matrix newMatrix = Matrix::Rotation(aAngle) * mTarget->GetTransform();
if (!newMatrix.IsFinite()) {
return;
}
mTarget->SetTransform(newMatrix);
SetTransformInternal(newMatrix);
}
void
@ -1991,10 +2013,8 @@ CanvasRenderingContext2D::Translate(double aX, double aY, ErrorResult& aError)
Matrix newMatrix = mTarget->GetTransform();
newMatrix.PreTranslate(aX, aY);
if (!newMatrix.IsFinite()) {
return;
}
mTarget->SetTransform(newMatrix);
SetTransformInternal(newMatrix);
}
void
@ -2010,10 +2030,8 @@ CanvasRenderingContext2D::Transform(double aM11, double aM12, double aM21,
Matrix newMatrix(aM11, aM12, aM21, aM22, aDx, aDy);
newMatrix *= mTarget->GetTransform();
if (!newMatrix.IsFinite()) {
return;
}
mTarget->SetTransform(newMatrix);
SetTransformInternal(newMatrix);
}
void
@ -2028,11 +2046,26 @@ CanvasRenderingContext2D::SetTransform(double aM11, double aM12,
return;
}
Matrix matrix(aM11, aM12, aM21, aM22, aDx, aDy);
if (!matrix.IsFinite()) {
SetTransformInternal(Matrix(aM11, aM12, aM21, aM22, aDx, aDy));
}
void
CanvasRenderingContext2D::SetTransformInternal(const Matrix& aTransform)
{
if (!aTransform.IsFinite()) {
return;
}
mTarget->SetTransform(matrix);
// Save the transform in the clip stack to be able to replay clips properly.
auto& clipsAndTransforms = CurrentState().clipsAndTransforms;
if (clipsAndTransforms.IsEmpty() || clipsAndTransforms.LastElement().IsClip()) {
clipsAndTransforms.AppendElement(ClipState(aTransform));
} else {
// If the last item is a transform we can replace it instead of appending
// a new item.
clipsAndTransforms.LastElement().transform = aTransform;
}
mTarget->SetTransform(aTransform);
}
void
@ -2808,7 +2841,7 @@ CanvasRenderingContext2D::FillRect(double aX, double aY, double aW,
CompositionOp op = UsedOperation();
bool discardContent = PatternIsOpaque(Style::FILL)
&& (op == CompositionOp::OP_OVER || op == CompositionOp::OP_DEST_OUT);
&& (op == CompositionOp::OP_OVER || op == CompositionOp::OP_SOURCE);
const gfx::Rect fillRect(aX, aY, aW, aH);
EnsureTarget(discardContent ? &fillRect : nullptr);
@ -3102,7 +3135,7 @@ CanvasRenderingContext2D::Clip(const CanvasWindingRule& aWinding)
}
mTarget->PushClip(mPath);
CurrentState().clipsPushed.AppendElement(mPath);
CurrentState().clipsAndTransforms.AppendElement(ClipState(mPath));
}
void
@ -3117,7 +3150,7 @@ CanvasRenderingContext2D::Clip(const CanvasPath& aPath, const CanvasWindingRule&
}
mTarget->PushClip(gfxpath);
CurrentState().clipsPushed.AppendElement(gfxpath);
CurrentState().clipsAndTransforms.AppendElement(ClipState(gfxpath));
}
void

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

@ -574,6 +574,8 @@ protected:
static mozilla::gfx::DrawTarget* sErrorTarget;
void SetTransformInternal(const mozilla::gfx::Matrix& aTransform);
// Some helpers. Doesn't modify a color on failure.
void SetStyleFromUnion(const StringOrCanvasGradientOrCanvasPattern& aValue,
Style aWhichStyle);
@ -917,6 +919,22 @@ protected:
bool CheckSizeForSkiaGL(mozilla::gfx::IntSize aSize);
// A clip or a transform, recorded and restored in order.
struct ClipState {
explicit ClipState(mozilla::gfx::Path* aClip)
: clip(aClip)
{}
explicit ClipState(const mozilla::gfx::Matrix& aTransform)
: transform(aTransform)
{}
bool IsClip() const { return !!clip; }
RefPtr<mozilla::gfx::Path> clip;
mozilla::gfx::Matrix transform;
};
// state stack handling
class ContextState {
public:
@ -1009,7 +1027,7 @@ protected:
return std::min(SIGMA_MAX, shadowBlur / 2.0f);
}
nsTArray<RefPtr<mozilla::gfx::Path> > clipsPushed;
nsTArray<ClipState> clipsAndTransforms;
RefPtr<gfxFontGroup> fontGroup;
nsCOMPtr<nsIAtom> fontLanguage;

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

@ -16,7 +16,6 @@ skip-if(Android||B2G) skip-if(gtkWidget&&isDebugBuild) load 789933-1.html # bug
load 794463-1.html
load 802926-1.html
load 896047-1.html
load 896047-2.html
load 916128-1.html
load 934939-1.html
load 1099143-1.html

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

@ -203,7 +203,6 @@ disabled = bug 407107
[test_bitmaprenderer.html]
[test_bug232227.html]
[test_bug613794.html]
[test_bug753758.html]
[test_bug764125.html]
[test_bug856472.html]
[test_bug866575.html]

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

@ -119,6 +119,8 @@ HTMLFormElement::HTMLFormElement(already_AddRefed<mozilla::dom::NodeInfo>& aNode
mInvalidElementsCount(0),
mEverTriedInvalidSubmit(false)
{
// We start out valid.
AddStatesSilently(NS_EVENT_STATE_VALID);
}
HTMLFormElement::~HTMLFormElement()

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

@ -1468,7 +1468,7 @@ HTMLInputElement::AfterSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
}
} else if (MaxLengthApplies() && aName == nsGkAtoms::maxlength) {
UpdateTooLongValidityState();
} else if (aName == nsGkAtoms::pattern) {
} else if (aName == nsGkAtoms::pattern && !mParserCreating) {
UpdatePatternMismatchValidityState();
} else if (aName == nsGkAtoms::multiple) {
UpdateTypeMismatchValidityState();
@ -5612,25 +5612,16 @@ HTMLInputElement::SetSelectionRange(int32_t aSelectionStart,
const Optional<nsAString>& aDirection,
ErrorResult& aRv)
{
nsIFormControlFrame* formControlFrame = GetFormControlFrame(true);
nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
if (textControlFrame) {
// Default to forward, even if not specified.
// Note that we don't currently support directionless selections, so
// "none" is treated like "forward".
nsITextControlFrame::SelectionDirection dir = nsITextControlFrame::eForward;
if (aDirection.WasPassed() && aDirection.Value().EqualsLiteral("backward")) {
dir = nsITextControlFrame::eBackward;
}
if (!SupportsTextSelection()) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
aRv = textControlFrame->SetSelectionRange(aSelectionStart, aSelectionEnd, dir);
if (!aRv.Failed()) {
aRv = textControlFrame->ScrollSelectionIntoView();
RefPtr<AsyncEventDispatcher> asyncDispatcher =
new AsyncEventDispatcher(this, NS_LITERAL_STRING("select"),
true, false);
asyncDispatcher->PostDOMEvent();
}
nsresult rv = SetSelectionRange(aSelectionStart, aSelectionEnd,
aDirection.WasPassed() ? aDirection.Value() : NullString());
if (NS_FAILED(rv)) {
aRv.Throw(rv);
}
}
@ -5639,19 +5630,36 @@ HTMLInputElement::SetSelectionRange(int32_t aSelectionStart,
int32_t aSelectionEnd,
const nsAString& aDirection)
{
ErrorResult rv;
Optional<nsAString> direction;
direction = &aDirection;
nsresult rv = NS_OK;
nsIFormControlFrame* formControlFrame = GetFormControlFrame(true);
nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
if (textControlFrame) {
// Default to forward, even if not specified.
// Note that we don't currently support directionless selections, so
// "none" is treated like "forward".
nsITextControlFrame::SelectionDirection dir = nsITextControlFrame::eForward;
if (!aDirection.IsEmpty() && aDirection.EqualsLiteral("backward")) {
dir = nsITextControlFrame::eBackward;
}
SetSelectionRange(aSelectionStart, aSelectionEnd, direction, rv);
return rv.StealNSResult();
rv = textControlFrame->SetSelectionRange(aSelectionStart, aSelectionEnd, dir);
if (NS_SUCCEEDED(rv)) {
rv = textControlFrame->ScrollSelectionIntoView();
RefPtr<AsyncEventDispatcher> asyncDispatcher =
new AsyncEventDispatcher(this, NS_LITERAL_STRING("select"),
true, false);
asyncDispatcher->PostDOMEvent();
}
}
return rv;
}
void
HTMLInputElement::SetRangeText(const nsAString& aReplacement, ErrorResult& aRv)
{
if (!SupportsSetRangeText()) {
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
if (!SupportsTextSelection()) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
@ -5676,8 +5684,8 @@ HTMLInputElement::SetRangeText(const nsAString& aReplacement, uint32_t aStart,
ErrorResult& aRv, int32_t aSelectionStart,
int32_t aSelectionEnd)
{
if (!SupportsSetRangeText()) {
aRv.Throw(NS_ERROR_DOM_NOT_SUPPORTED_ERR);
if (!SupportsTextSelection()) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
@ -5763,21 +5771,20 @@ HTMLInputElement::SetRangeText(const nsAString& aReplacement, uint32_t aStart,
SetSelectionRange(aSelectionStart, aSelectionEnd, direction, aRv);
}
int32_t
Nullable<int32_t>
HTMLInputElement::GetSelectionStart(ErrorResult& aRv)
{
int32_t selEnd, selStart;
aRv = GetSelectionRange(&selStart, &selEnd);
if (aRv.Failed()) {
nsTextEditorState* state = GetEditorState();
if (state && state->IsSelectionCached()) {
aRv = NS_OK;
return state->GetSelectionProperties().GetStart();
}
if (!SupportsTextSelection()) {
return Nullable<int32_t>();
}
return selStart;
int32_t selStart;
nsresult rv = GetSelectionStart(&selStart);
if (NS_FAILED(rv)) {
aRv.Throw(rv);
}
return Nullable<int32_t>(selStart);
}
NS_IMETHODIMP
@ -5785,17 +5792,39 @@ HTMLInputElement::GetSelectionStart(int32_t* aSelectionStart)
{
NS_ENSURE_ARG_POINTER(aSelectionStart);
ErrorResult rv;
*aSelectionStart = GetSelectionStart(rv);
return rv.StealNSResult();
int32_t selEnd, selStart;
nsresult rv = GetSelectionRange(&selStart, &selEnd);
if (NS_FAILED(rv)) {
nsTextEditorState* state = GetEditorState();
if (state && state->IsSelectionCached()) {
*aSelectionStart = state->GetSelectionProperties().GetStart();
return NS_OK;
}
return rv;
}
*aSelectionStart = selStart;
return NS_OK;
}
void
HTMLInputElement::SetSelectionStart(int32_t aSelectionStart, ErrorResult& aRv)
HTMLInputElement::SetSelectionStart(const Nullable<int32_t>& aSelectionStart,
ErrorResult& aRv)
{
if (!SupportsTextSelection()) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
int32_t selStart = 0;
if (!aSelectionStart.IsNull()) {
selStart = aSelectionStart.Value();
}
nsTextEditorState* state = GetEditorState();
if (state && state->IsSelectionCached()) {
state->GetSelectionProperties().SetStart(aSelectionStart);
state->GetSelectionProperties().SetStart(selStart);
return;
}
@ -5811,7 +5840,7 @@ HTMLInputElement::SetSelectionStart(int32_t aSelectionStart, ErrorResult& aRv)
return;
}
start = aSelectionStart;
start = selStart;
if (end < start) {
end = start;
}
@ -5823,25 +5852,25 @@ NS_IMETHODIMP
HTMLInputElement::SetSelectionStart(int32_t aSelectionStart)
{
ErrorResult rv;
SetSelectionStart(aSelectionStart, rv);
Nullable<int32_t> selStart(aSelectionStart);
SetSelectionStart(selStart, rv);
return rv.StealNSResult();
}
int32_t
Nullable<int32_t>
HTMLInputElement::GetSelectionEnd(ErrorResult& aRv)
{
int32_t selStart, selEnd;
aRv = GetSelectionRange(&selStart, &selEnd);
if (aRv.Failed()) {
nsTextEditorState* state = GetEditorState();
if (state && state->IsSelectionCached()) {
aRv = NS_OK;
return state->GetSelectionProperties().GetEnd();
}
if (!SupportsTextSelection()) {
return Nullable<int32_t>();
}
return selEnd;
int32_t selEnd;
nsresult rv = GetSelectionEnd(&selEnd);
if (NS_FAILED(rv)) {
aRv.Throw(rv);
}
return Nullable<int32_t>(selEnd);
}
NS_IMETHODIMP
@ -5849,17 +5878,39 @@ HTMLInputElement::GetSelectionEnd(int32_t* aSelectionEnd)
{
NS_ENSURE_ARG_POINTER(aSelectionEnd);
ErrorResult rv;
*aSelectionEnd = GetSelectionEnd(rv);
return rv.StealNSResult();
int32_t selEnd, selStart;
nsresult rv = GetSelectionRange(&selStart, &selEnd);
if (NS_FAILED(rv)) {
nsTextEditorState* state = GetEditorState();
if (state && state->IsSelectionCached()) {
*aSelectionEnd = state->GetSelectionProperties().GetEnd();
return NS_OK;
}
return rv;
}
*aSelectionEnd = selEnd;
return NS_OK;
}
void
HTMLInputElement::SetSelectionEnd(int32_t aSelectionEnd, ErrorResult& aRv)
HTMLInputElement::SetSelectionEnd(const Nullable<int32_t>& aSelectionEnd,
ErrorResult& aRv)
{
if (!SupportsTextSelection()) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
int32_t selEnd = 0;
if (!aSelectionEnd.IsNull()) {
selEnd = aSelectionEnd.Value();
}
nsTextEditorState* state = GetEditorState();
if (state && state->IsSelectionCached()) {
state->GetSelectionProperties().SetEnd(aSelectionEnd);
state->GetSelectionProperties().SetEnd(selEnd);
return;
}
@ -5875,7 +5926,7 @@ HTMLInputElement::SetSelectionEnd(int32_t aSelectionEnd, ErrorResult& aRv)
return;
}
end = aSelectionEnd;
end = selEnd;
if (start > end) {
start = end;
}
@ -5887,7 +5938,8 @@ NS_IMETHODIMP
HTMLInputElement::SetSelectionEnd(int32_t aSelectionEnd)
{
ErrorResult rv;
SetSelectionEnd(aSelectionEnd, rv);
Nullable<int32_t> selEnd(aSelectionEnd);
SetSelectionEnd(selEnd, rv);
return rv.StealNSResult();
}
@ -5929,6 +5981,11 @@ DirectionToName(nsITextControlFrame::SelectionDirection dir, nsAString& aDirecti
void
HTMLInputElement::GetSelectionDirection(nsAString& aDirection, ErrorResult& aRv)
{
if (!SupportsTextSelection()) {
aDirection.SetIsVoid(true);
return;
}
nsresult rv = NS_ERROR_FAILURE;
nsIFormControlFrame* formControlFrame = GetFormControlFrame(true);
nsITextControlFrame* textControlFrame = do_QueryFrame(formControlFrame);
@ -5964,6 +6021,11 @@ HTMLInputElement::GetSelectionDirection(nsAString& aDirection)
void
HTMLInputElement::SetSelectionDirection(const nsAString& aDirection, ErrorResult& aRv)
{
if (!SupportsTextSelection()) {
aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
return;
}
nsTextEditorState* state = GetEditorState();
if (state && state->IsSelectionCached()) {
nsITextControlFrame::SelectionDirection dir = nsITextControlFrame::eNone;

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

@ -688,11 +688,11 @@ public:
// XPCOM Select() is OK
int32_t GetSelectionStart(ErrorResult& aRv);
void SetSelectionStart(int32_t aValue, ErrorResult& aRv);
Nullable<int32_t> GetSelectionStart(ErrorResult& aRv);
void SetSelectionStart(const Nullable<int32_t>& aValue, ErrorResult& aRv);
int32_t GetSelectionEnd(ErrorResult& aRv);
void SetSelectionEnd(int32_t aValue, ErrorResult& aRv);
Nullable<int32_t> GetSelectionEnd(ErrorResult& aRv);
void SetSelectionEnd(const Nullable<int32_t>& aValue, ErrorResult& aRv);
void GetSelectionDirection(nsAString& aValue, ErrorResult& aRv);
void SetSelectionDirection(const nsAString& aValue, ErrorResult& aRv);
@ -1481,9 +1481,9 @@ private:
}
/**
* Returns true if setRangeText can be called on element
* Returns true if selection methods can be called on element
*/
bool SupportsSetRangeText() const {
bool SupportsTextSelection() const {
return mType == NS_FORM_INPUT_TEXT || mType == NS_FORM_INPUT_SEARCH ||
mType == NS_FORM_INPUT_URL || mType == NS_FORM_INPUT_TEL ||
mType == NS_FORM_INPUT_PASSWORD || mType == NS_FORM_INPUT_NUMBER;

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

@ -5736,7 +5736,7 @@ HTMLMediaElement::SetMediaKeys(mozilla::dom::MediaKeys* aMediaKeys,
// 1. If mediaKeys and the mediaKeys attribute are the same object,
// return a resolved promise.
if (mMediaKeys == aMediaKeys) {
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
return promise.forget();
}
@ -5822,7 +5822,7 @@ HTMLMediaElement::SetMediaKeys(mozilla::dom::MediaKeys* aMediaKeys,
// 5.5 Let this object's attaching media keys value be false.
// 5.6 Resolve promise.
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
// 6. Return promise.
return promise.forget();

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

@ -661,38 +661,50 @@ HTMLTextAreaElement::GetSelectionStart(int32_t *aSelectionStart)
NS_ENSURE_ARG_POINTER(aSelectionStart);
ErrorResult error;
*aSelectionStart = GetSelectionStart(error);
Nullable<uint32_t> selStart(GetSelectionStart(error));
if (error.Failed()) {
return error.StealNSResult();
}
*aSelectionStart = int32_t(selStart.Value());
return error.StealNSResult();
}
uint32_t
Nullable<uint32_t>
HTMLTextAreaElement::GetSelectionStart(ErrorResult& aError)
{
int32_t selStart, selEnd;
nsresult rv = GetSelectionRange(&selStart, &selEnd);
if (NS_FAILED(rv) && mState.IsSelectionCached()) {
return mState.GetSelectionProperties().GetStart();
return Nullable<uint32_t>(mState.GetSelectionProperties().GetStart());
}
if (NS_FAILED(rv)) {
aError.Throw(rv);
}
return selStart;
return Nullable<uint32_t>(selStart);
}
NS_IMETHODIMP
HTMLTextAreaElement::SetSelectionStart(int32_t aSelectionStart)
{
ErrorResult error;
SetSelectionStart(aSelectionStart, error);
Nullable<uint32_t> selStart(aSelectionStart);
SetSelectionStart(selStart, error);
return error.StealNSResult();
}
void
HTMLTextAreaElement::SetSelectionStart(uint32_t aSelectionStart, ErrorResult& aError)
HTMLTextAreaElement::SetSelectionStart(const Nullable<uint32_t>& aSelectionStart,
ErrorResult& aError)
{
int32_t selStart = 0;
if (!aSelectionStart.IsNull()) {
selStart = aSelectionStart.Value();
}
if (mState.IsSelectionCached()) {
mState.GetSelectionProperties().SetStart(aSelectionStart);
mState.GetSelectionProperties().SetStart(selStart);
return;
}
@ -708,7 +720,7 @@ HTMLTextAreaElement::SetSelectionStart(uint32_t aSelectionStart, ErrorResult& aE
aError.Throw(rv);
return;
}
start = aSelectionStart;
start = selStart;
if (end < start) {
end = start;
}
@ -724,38 +736,50 @@ HTMLTextAreaElement::GetSelectionEnd(int32_t *aSelectionEnd)
NS_ENSURE_ARG_POINTER(aSelectionEnd);
ErrorResult error;
*aSelectionEnd = GetSelectionEnd(error);
return error.StealNSResult();
Nullable<uint32_t> selEnd(GetSelectionEnd(error));
if (error.Failed()) {
return error.StealNSResult();
}
*aSelectionEnd = int32_t(selEnd.Value());
return NS_OK;
}
uint32_t
Nullable<uint32_t>
HTMLTextAreaElement::GetSelectionEnd(ErrorResult& aError)
{
int32_t selStart, selEnd;
nsresult rv = GetSelectionRange(&selStart, &selEnd);
if (NS_FAILED(rv) && mState.IsSelectionCached()) {
return mState.GetSelectionProperties().GetEnd();
return Nullable<uint32_t>(mState.GetSelectionProperties().GetEnd());
}
if (NS_FAILED(rv)) {
aError.Throw(rv);
}
return selEnd;
return Nullable<uint32_t>(selEnd);
}
NS_IMETHODIMP
HTMLTextAreaElement::SetSelectionEnd(int32_t aSelectionEnd)
{
ErrorResult error;
SetSelectionEnd(aSelectionEnd, error);
Nullable<uint32_t> selEnd(aSelectionEnd);
SetSelectionEnd(selEnd, error);
return error.StealNSResult();
}
void
HTMLTextAreaElement::SetSelectionEnd(uint32_t aSelectionEnd, ErrorResult& aError)
HTMLTextAreaElement::SetSelectionEnd(const Nullable<uint32_t>& aSelectionEnd,
ErrorResult& aError)
{
int32_t selEnd = 0;
if (!aSelectionEnd.IsNull()) {
selEnd = aSelectionEnd.Value();
}
if (mState.IsSelectionCached()) {
mState.GetSelectionProperties().SetEnd(aSelectionEnd);
mState.GetSelectionProperties().SetEnd(selEnd);
return;
}
@ -771,7 +795,7 @@ HTMLTextAreaElement::SetSelectionEnd(uint32_t aSelectionEnd, ErrorResult& aError
aError.Throw(rv);
return;
}
end = aSelectionEnd;
end = selEnd;
if (start > end) {
start = end;
}
@ -848,7 +872,8 @@ HTMLTextAreaElement::SetSelectionDirection(const nsAString& aDirection)
}
void
HTMLTextAreaElement::SetSelectionDirection(const nsAString& aDirection, ErrorResult& aError)
HTMLTextAreaElement::SetSelectionDirection(const nsAString& aDirection,
ErrorResult& aError)
{
if (mState.IsSelectionCached()) {
nsITextControlFrame::SelectionDirection dir = nsITextControlFrame::eNone;

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

@ -269,10 +269,10 @@ public:
using nsIConstraintValidation::ReportValidity;
// nsIConstraintValidation::SetCustomValidity() is fine.
// XPCOM Select is fine
uint32_t GetSelectionStart(ErrorResult& aError);
void SetSelectionStart(uint32_t aSelectionStart, ErrorResult& aError);
uint32_t GetSelectionEnd(ErrorResult& aError);
void SetSelectionEnd(uint32_t aSelectionEnd, ErrorResult& aError);
Nullable<uint32_t> GetSelectionStart(ErrorResult& aError);
void SetSelectionStart(const Nullable<uint32_t>& aSelectionStart, ErrorResult& aError);
Nullable<uint32_t> GetSelectionEnd(ErrorResult& aError);
void SetSelectionEnd(const Nullable<uint32_t>& aSelectionEnd, ErrorResult& aError);
void GetSelectionDirection(nsAString& aDirection, ErrorResult& aError);
void SetSelectionDirection(const nsAString& aDirection, ErrorResult& aError);
void SetSelectionRange(uint32_t aSelectionStart, uint32_t aSelectionEnd, const Optional<nsAString>& aDirecton, ErrorResult& aError);

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

@ -61,7 +61,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=850364
} catch (ex) {
opThrows = true;
}
ok(opThrows, msg + " should throw NotSupportedError");
ok(opThrows, msg + " should throw InvalidStateError");
}
var numOfSelectCalls = 0, expectedNumOfSelectCalls = 0;
@ -77,7 +77,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=850364
} catch (ex) {
opThrows = true;
}
is(opThrows, false, msg + " should not throw NotSupportedError");
is(opThrows, false, msg + " should not throw InvalidStateError");
elem.addEventListener("select", function (aEvent) {
ok(true, "select event should be fired for " + aEvent.target.id);

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

@ -39,8 +39,7 @@ interface nsIDOMStorageManager : nsISupports
*/
nsIDOMStorage createStorage(in mozIDOMWindow aWindow,
in nsIPrincipal aPrincipal,
in DOMString aDocumentURI,
[optional] in bool aPrivate);
in DOMString aDocumentURI);
/**
* Returns instance of DOM storage object for given principal.
* If there is no storage managed for the scope, then null is returned and
@ -55,8 +54,7 @@ interface nsIDOMStorageManager : nsISupports
* Whether the demanding document is running in Private Browsing mode or not.
*/
nsIDOMStorage getStorage(in mozIDOMWindow aWindow,
in nsIPrincipal aPrincipal,
[optional] in bool aPrivate);
in nsIPrincipal aPrincipal);
/**
* Clones given storage into this storage manager.
@ -100,6 +98,5 @@ interface nsIDOMStorageManager : nsISupports
* or createStorage method instead.
*/
nsIDOMStorage getLocalStorageForPrincipal(in nsIPrincipal aPrincipal,
in DOMString aDocumentURI,
[optional] in bool aPrivate);
in DOMString aDocumentURI);
};

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

@ -844,7 +844,7 @@ MediaDecoder::AsyncResolveSeekDOMPromiseIfExists()
if (mSeekDOMPromise) {
RefPtr<dom::Promise> promise = mSeekDOMPromise;
nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([=] () {
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
});
AbstractThread::MainThread()->Dispatch(r.forget());
mSeekDOMPromise = nullptr;

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

@ -39,6 +39,11 @@ using mozilla::CheckedUint32;
// mozilla::Monitor non-reentrant.
namespace mozilla {
// EME Key System String.
static const char* const kEMEKeySystemClearkey = "org.w3.clearkey";
static const char* const kEMEKeySystemWidevine = "com.widevine.alpha";
static const char* const kEMEKeySystemPrimetime = "com.adobe.primetime";
/**
* ReentrantMonitorConditionallyEnter
*

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

@ -7,16 +7,13 @@
#ifndef EME_LOG_H_
#define EME_LOG_H_
#include "VideoUtils.h"
#include "mozilla/Logging.h"
#include "nsString.h"
#include "nsTArray.h"
namespace mozilla {
static const char* const kEMEKeySystemClearkey = "org.w3.clearkey";
static const char* const kEMEKeySystemWidevine = "com.widevine.alpha";
static const char* const kEMEKeySystemPrimetime = "com.adobe.primetime";
namespace dom {
class ArrayBufferViewOrArrayBuffer;
}

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

@ -338,7 +338,7 @@ MediaKeySession::Close(ErrorResult& aRv)
if (IsClosed() || !mKeys->GetCDMProxy()) {
EME_LOG("MediaKeySession[%p,'%s'] Close() already closed",
this, NS_ConvertUTF16toUTF8(mSessionId).get());
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
return promise.forget();
}
PromiseId pid = mKeys->StorePromise(promise);
@ -361,7 +361,7 @@ MediaKeySession::OnClosed()
mIsClosed = true;
mKeys->OnSessionClosed(this);
mKeys = nullptr;
mClosed->MaybeResolve(JS::UndefinedHandleValue);
mClosed->MaybeResolveWithUndefined();
}
bool

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

@ -283,7 +283,7 @@ MediaKeys::ResolvePromise(PromiseId aId)
mKeySessions.Put(session->GetSessionId(), session);
promise->MaybeResolve(session);
} else {
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
}
MOZ_ASSERT(!mPromises.Contains(aId));
}

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

@ -23,6 +23,7 @@
#endif
#include "GMPContentParent.h"
#include "MediaPrefs.h"
#include "VideoUtils.h"
#include "mozilla/dom/CrashReporterParent.h"
using mozilla::dom::CrashReporterParent;

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

@ -35,8 +35,6 @@ EXPORTS += [
'GMPAudioDecoderProxy.h',
'GMPAudioHost.h',
'GMPCallbackBase.h',
'GMPCDMCallbackProxy.h',
'GMPCDMProxy.h',
'GMPChild.h',
'GMPContentChild.h',
'GMPContentParent.h',
@ -73,6 +71,12 @@ EXPORTS += [
'GMPVideoPlaneImpl.h',
]
if CONFIG['MOZ_EME']:
EXPORTS += [
'GMPCDMCallbackProxy.h',
'GMPCDMProxy.h',
]
# We link GMPLoader into xul on B2G/Fennec as its code does not need to be
# covered by a DRM vendor's voucher.
if CONFIG['OS_TARGET'] == 'Android':
@ -87,8 +91,6 @@ UNIFIED_SOURCES += [
'GMPAudioDecoderChild.cpp',
'GMPAudioDecoderParent.cpp',
'GMPAudioHost.cpp',
'GMPCDMCallbackProxy.cpp',
'GMPCDMProxy.cpp',
'GMPChild.cpp',
'GMPContentChild.cpp',
'GMPContentParent.cpp',
@ -120,6 +122,12 @@ UNIFIED_SOURCES += [
'GMPVideoPlaneImpl.cpp',
]
if CONFIG['MOZ_EME']:
UNIFIED_SOURCES += [
'GMPCDMCallbackProxy.cpp',
'GMPCDMProxy.cpp',
]
DIRS += [
'rlz',
'widevine-adapter',

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

@ -5,6 +5,7 @@
#include "WidevineAdapter.h"
#include "content_decryption_module.h"
#include "VideoUtils.h"
#include "WidevineDecryptor.h"
#include "WidevineUtils.h"
#include "WidevineVideoDecoder.h"
@ -12,7 +13,6 @@
#include "gmp-api/gmp-decryption.h"
#include "gmp-api/gmp-video-codec.h"
#include "gmp-api/gmp-platform.h"
#include "mozilla/EMEUtils.h"
#include "mozilla/StaticPtr.h"
static const GMPPlatformAPI* sPlatform = nullptr;

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

@ -12,6 +12,7 @@
#include "mozilla/PodOperations.h"
#include "mozilla/Preferences.h"
#include "mozilla/SharedThreadPool.h"
#include "mozilla/Telemetry.h"
#include "mozilla/TimeStamp.h"
#include "MediaDataDemuxer.h"
#include "nsAutoRef.h"

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

@ -10,9 +10,9 @@
#include "GMPVideoDecoder.h"
#include "MediaDataDecoderProxy.h"
#include "MediaPrefs.h"
#include "VideoUtils.h"
#include "mozIGeckoMediaPluginService.h"
#include "nsServiceManagerUtils.h"
#include "mozilla/EMEUtils.h"
#include "mozilla/StaticMutex.h"
#include "gmp-audio-decode.h"
#include "gmp-video-decode.h"

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

@ -838,6 +838,7 @@ VideoStreamHelper.prototype = {
waitForFrames: function(canvas, timeout_value) {
var intervalId = this.startCapturingFrames();
timeout_value = timeout_value || 8000;
return addFinallyToPromise(timeout(
Promise.all([
@ -846,7 +847,7 @@ VideoStreamHelper.prototype = {
this._helper.waitForPixelColor(canvas, this._helper.red, 128,
canvas.id + " should become red")
]),
2000,
timeout_value,
"Timed out waiting for frames")).finally(() => clearInterval(intervalId));
},

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

@ -871,7 +871,7 @@ AudioContext::OnStateChanged(void* aPromise, AudioContextState aNewState)
if (aPromise) {
Promise* promise = reinterpret_cast<Promise*>(aPromise);
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
DebugOnly<bool> rv = mPromiseGripArray.RemoveElement(promise);
MOZ_ASSERT(rv, "Promise wasn't in the grip array?");
}

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

@ -364,7 +364,7 @@ MobileMessageCallback::NotifyGetSmscAddressFailed(int32_t aError)
NS_IMETHODIMP
MobileMessageCallback::NotifySetSmscAddress()
{
mPromise->MaybeResolve(JS::UndefinedHandleValue);
mPromise->MaybeResolveWithUndefined();
return NS_OK;
}

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

@ -198,7 +198,7 @@ UDPSocket::CloseWithReason(nsresult aReason)
if (mClosed) {
if (NS_SUCCEEDED(aReason)) {
mClosed->MaybeResolve(JS::UndefinedHandleValue);
mClosed->MaybeResolveWithUndefined();
} else {
mClosed->MaybeReject(aReason);
}
@ -469,7 +469,7 @@ UDPSocket::InitLocal(const nsAString& aLocalAddress,
return rv;
}
mOpened->MaybeResolve(JS::UndefinedHandleValue);
mOpened->MaybeResolveWithUndefined();
return NS_OK;
}
@ -736,7 +736,7 @@ UDPSocket::CallListenerOpened()
return NS_OK;
}
mOpened->MaybeResolve(JS::UndefinedHandleValue);
mOpened->MaybeResolveWithUndefined();
return NS_OK;
}

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

@ -2710,7 +2710,7 @@ Notification::ShowPersistentNotification(JSContext* aCx,
// "Otherwise, resolve promise with undefined."
// The Notification may still not be shown due to other errors, but the spec
// is not concerned with those.
p->MaybeResolve(JS::UndefinedHandleValue);
p->MaybeResolveWithUndefined();
RefPtr<Notification> notification =
CreateAndShow(aCx, aGlobal, aTitle, aOptions, aScope, aRv);

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

@ -173,9 +173,9 @@ PresentationDeviceRequest::CreateSessionInfo(nsIPresentationDevice* aDevice)
}
NS_IMETHODIMP
PresentationDeviceRequest::Cancel()
PresentationDeviceRequest::Cancel(nsresult aReason)
{
return mCallback->NotifyError(NS_ERROR_DOM_ABORT_ERR);
return mCallback->NotifyError(aReason);
}
/*

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

@ -29,9 +29,10 @@ interface nsIPresentationDeviceRequest : nsISupports
void select(in nsIPresentationDevice device);
/*
Callback after selection failed or canceled by user.
* Callback after selection failed or canceled by user.
* @param reason The error cause for canceling this request.
*/
void cancel();
void cancel(in nsresult reason);
};
/*

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

@ -209,8 +209,8 @@ const mockedDevicePrompt = {
simulateSelect: function() {
this._request.select(mockedDevice);
},
simulateCancel: function() {
this._request.cancel();
simulateCancel: function(result) {
this._request.cancel(result);
}
};
@ -393,8 +393,8 @@ addMessageListener('trigger-device-prompt-select', function() {
mockedDevicePrompt.simulateSelect();
});
addMessageListener('trigger-device-prompt-cancel', function() {
mockedDevicePrompt.simulateCancel();
addMessageListener('trigger-device-prompt-cancel', function(result) {
mockedDevicePrompt.simulateCancel(result);
});
addMessageListener('trigger-incoming-session-request', function(url) {

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

@ -56,7 +56,7 @@ function testStartConnectionCancelPrompt() {
gScript.addMessageListener('device-prompt', function devicePromptHandler() {
gScript.removeMessageListener('device-prompt', devicePromptHandler);
info("Device prompt is triggered.");
gScript.sendAsyncMessage('trigger-device-prompt-cancel');
gScript.sendAsyncMessage('trigger-device-prompt-cancel', SpecialPowers.Cr.NS_ERROR_DOM_NOT_ALLOWED_ERR);
});
request.start().then(
@ -65,7 +65,28 @@ function testStartConnectionCancelPrompt() {
aReject();
},
function(aError) {
is(aError.name, "AbortError", "AbortError is expected when the prompt is canceled.");
is(aError.name, "NotAllowedError", "NotAllowedError is expected when the prompt is canceled.");
aResolve();
}
);
});
}
function testStartConnectionNoDevice() {
return new Promise(function(aResolve, aReject) {
gScript.addMessageListener('device-prompt', function devicePromptHandler() {
gScript.removeMessageListener('device-prompt', devicePromptHandler);
info("Device prompt is triggered.");
gScript.sendAsyncMessage('trigger-device-prompt-cancel', SpecialPowers.Cr.NS_ERROR_DOM_NOT_FOUND_ERR);
});
request.start().then(
function(aConnection) {
ok(false, "|start| shouldn't succeed in this case.");
aReject();
},
function(aError) {
is(aError.name, "NotFoundError", "NotFoundError is expected when no available device.");
aResolve();
}
);
@ -361,6 +382,7 @@ function runTests() {
testCreateRequestWithEmptyURL().
then(setup).
then(testStartConnectionCancelPrompt).
then(testStartConnectionNoDevice).
then(testStartConnectionUnexpectedControlChannelCloseBeforeDataTransportInit).
then(testStartConnectionUnexpectedControlChannelCloseNoReasonBeforeDataTransportInit).
then(testStartConnectionUnexpectedControlChannelCloseBeforeDataTransportReady).

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

@ -925,6 +925,14 @@ Promise::MaybeReject(JSContext* aCx,
#endif // SPIDERMONKEY_PROMISE
void
Promise::MaybeResolveWithUndefined()
{
NS_ASSERT_OWNINGTHREAD(Promise);
MaybeResolve(JS::UndefinedHandleValue);
}
void
Promise::MaybeReject(const RefPtr<MediaStreamError>& aArg) {
NS_ASSERT_OWNINGTHREAD(Promise);
@ -948,7 +956,6 @@ Promise::MaybeRejectWithUndefined()
MaybeSomething(JS::UndefinedHandleValue, &Promise::MaybeReject);
}
#ifdef SPIDERMONKEY_PROMISE
void
Promise::ReportRejectedPromise(JSContext* aCx, JS::HandleObject aPromise)

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

@ -140,6 +140,8 @@ public:
MaybeSomething(aArg, &Promise::MaybeResolve);
}
void MaybeResolveWithUndefined();
inline void MaybeReject(nsresult aArg) {
MOZ_ASSERT(NS_FAILED(aArg));
MaybeSomething(aArg, &Promise::MaybeReject);

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

@ -44,14 +44,12 @@ DOMStorage::DOMStorage(nsPIDOMWindowInner* aWindow,
DOMStorageManager* aManager,
DOMStorageCache* aCache,
const nsAString& aDocumentURI,
nsIPrincipal* aPrincipal,
bool aIsPrivate)
nsIPrincipal* aPrincipal)
: mWindow(aWindow)
, mManager(aManager)
, mCache(aCache)
, mDocumentURI(aDocumentURI)
, mPrincipal(aPrincipal)
, mIsPrivate(aIsPrivate)
, mIsSessionOnly(false)
{
mCache->Preload();
@ -231,8 +229,6 @@ bool
DOMStorage::CanUseStorage(nsPIDOMWindowInner* aWindow, DOMStorage* aStorage)
{
// This method is responsible for correct setting of mIsSessionOnly.
// It doesn't work with mIsPrivate flag at all, since it is checked
// regardless mIsSessionOnly flag in DOMStorageCache code.
if (!mozilla::Preferences::GetBool(kStorageEnabled)) {
return false;
@ -282,6 +278,17 @@ DOMStorage::PrincipalEquals(nsIPrincipal* aPrincipal)
return PrincipalsEqual(mPrincipal, aPrincipal);
}
bool
DOMStorage::IsPrivate() const
{
uint32_t privateBrowsingId = 0;
nsresult rv = mPrincipal->GetPrivateBrowsingId(&privateBrowsingId);
if (NS_FAILED(rv)) {
return false;
}
return privateBrowsingId > 0;
}
bool
DOMStorage::CanAccess(nsIPrincipal* aPrincipal)
{

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

@ -54,17 +54,12 @@ public:
nsIPrincipal* GetPrincipal();
bool PrincipalEquals(nsIPrincipal* aPrincipal);
bool CanAccess(nsIPrincipal* aPrincipal);
bool IsPrivate()
{
return mIsPrivate;
}
DOMStorage(nsPIDOMWindowInner* aWindow,
DOMStorageManager* aManager,
DOMStorageCache* aCache,
const nsAString& aDocumentURI,
nsIPrincipal* aPrincipal,
bool aIsPrivate);
nsIPrincipal* aPrincipal);
// WebIDL
JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
@ -119,7 +114,7 @@ public:
static bool CanUseStorage(nsPIDOMWindowInner* aWindow,
DOMStorage* aStorage = nullptr);
bool IsPrivate() const { return mIsPrivate; }
bool IsPrivate() const;
bool IsSessionOnly() const { return mIsSessionOnly; }
bool IsForkOf(const DOMStorage* aOther) const
@ -143,9 +138,6 @@ private:
// been created for
nsCOMPtr<nsIPrincipal> mPrincipal;
// Whether this storage is running in private-browsing window.
bool mIsPrivate : 1;
// Whether storage is set to persist data only per session, may change
// dynamically and is set by CanUseStorage function that is called
// before any operation on the storage.

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

@ -101,7 +101,7 @@ public:
// The set of methods that are invoked by DOM storage web API.
// We are passing the DOMStorage object just to let the cache
// read properties like mPrivate and mSessionOnly.
// read properties like mPrincipal and mSessionOnly.
// Get* methods return error when load from the database has failed.
nsresult GetLength(const DOMStorage* aStorage, uint32_t* aRetval);
nsresult GetKey(const DOMStorage* aStorage, uint32_t index, nsAString& aRetval);

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

@ -310,7 +310,6 @@ DOMStorageManager::GetStorageInternal(bool aCreate,
mozIDOMWindow* aWindow,
nsIPrincipal* aPrincipal,
const nsAString& aDocumentURI,
bool aPrivate,
nsIDOMStorage** aRetval)
{
nsresult rv;
@ -361,7 +360,7 @@ DOMStorageManager::GetStorageInternal(bool aCreate,
nsCOMPtr<nsPIDOMWindowInner> inner = nsPIDOMWindowInner::From(aWindow);
nsCOMPtr<nsIDOMStorage> storage = new DOMStorage(
inner, this, cache, aDocumentURI, aPrincipal, aPrivate);
inner, this, cache, aDocumentURI, aPrincipal);
storage.forget(aRetval);
}
@ -371,29 +370,24 @@ DOMStorageManager::GetStorageInternal(bool aCreate,
NS_IMETHODIMP
DOMStorageManager::PrecacheStorage(nsIPrincipal* aPrincipal)
{
return GetStorageInternal(true, nullptr, aPrincipal, EmptyString(), false,
nullptr);
return GetStorageInternal(true, nullptr, aPrincipal, EmptyString(), nullptr);
}
NS_IMETHODIMP
DOMStorageManager::CreateStorage(mozIDOMWindow* aWindow,
nsIPrincipal* aPrincipal,
const nsAString& aDocumentURI,
bool aPrivate,
nsIDOMStorage** aRetval)
{
return GetStorageInternal(true, aWindow, aPrincipal, aDocumentURI, aPrivate,
aRetval);
return GetStorageInternal(true, aWindow, aPrincipal, aDocumentURI, aRetval);
}
NS_IMETHODIMP
DOMStorageManager::GetStorage(mozIDOMWindow* aWindow,
nsIPrincipal* aPrincipal,
bool aPrivate,
nsIDOMStorage** aRetval)
{
return GetStorageInternal(false, aWindow, aPrincipal, EmptyString(), aPrivate,
aRetval);
return GetStorageInternal(false, aWindow, aPrincipal, EmptyString(), aRetval);
}
NS_IMETHODIMP
@ -473,14 +467,13 @@ DOMStorageManager::CheckStorage(nsIPrincipal* aPrincipal,
NS_IMETHODIMP
DOMStorageManager::GetLocalStorageForPrincipal(nsIPrincipal* aPrincipal,
const nsAString& aDocumentURI,
bool aPrivate,
nsIDOMStorage** aRetval)
{
if (mType != LocalStorage) {
return NS_ERROR_UNEXPECTED;
}
return CreateStorage(nullptr, aPrincipal, aDocumentURI, aPrivate, aRetval);
return CreateStorage(nullptr, aPrincipal, aDocumentURI, aRetval);
}
void

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

@ -93,7 +93,6 @@ private:
mozIDOMWindow* aWindow,
nsIPrincipal* aPrincipal,
const nsAString& aDocumentURI,
bool aPrivate,
nsIDOMStorage** aRetval);
// Suffix->origin->cache map

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

@ -773,7 +773,7 @@ Telephony::EnumerateCallStateComplete()
HandleAudioAgentState();
if (mReadyPromise) {
mReadyPromise->MaybeResolve(JS::UndefinedHandleValue);
mReadyPromise->MaybeResolveWithUndefined();
}
if (NS_FAILED(mService->RegisterListener(mListener))) {

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

@ -24,7 +24,7 @@ TelephonyCallback::TelephonyCallback(Promise* aPromise)
NS_IMETHODIMP
TelephonyCallback::NotifySuccess()
{
mPromise->MaybeResolve(JS::UndefinedHandleValue);
mPromise->MaybeResolveWithUndefined();
return NS_OK;
}

Двоичные данные
dom/tests/mochitest/general/fail.png Normal file

Двоичный файл не отображается.

После

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

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

@ -1,6 +1,7 @@
[DEFAULT]
support-files =
497633.html
fail.png
file_bug628069.html
file_clonewrapper.html
file_domWindowUtils_scrollbarSize.html
@ -13,6 +14,7 @@ support-files =
image_50.png
image_100.png
image_200.png
pass.apng
performance_timeline_main_test.html
resource_timing_iframe.html
resource_timing_main_test.html
@ -139,3 +141,4 @@ skip-if = buildapp == 'b2g' || buildapp == 'mulet' || toolkit == 'android' # Mou
[test_WebKitCSSMatrix.html]
[test_resource_timing_frameset.html]
[test_bug1208217.html]
[test_picture_apng.html]

Двоичные данные
dom/tests/mochitest/general/pass.apng Normal file

Двоичный файл не отображается.

После

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

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

@ -0,0 +1,77 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Image srcset mutations</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
</head>
<script type="application/javascript">
"use strict";
window.onload = function() {
// Smoke test, check picture working as expected
const t0 = document.querySelector("#test0 img");
ok(t0.currentSrc.endsWith("apng"), `t0: expected pass.apng, got '${t0.currentSrc}'`);
// Test that the apng is selected over bogus types.
const t1 = document.querySelector("#test1 img");
ok(t1.currentSrc.endsWith("apng"), `t1: expected pass.apng, got '${t1.currentSrc}'`);
// Test that tree order precedence applies
const t2 = document.querySelector("#test2 img");
ok(t2.currentSrc.endsWith("apng"), `t2: expected pass.apng, got '${t2.currentSrc}'`);
// Test that apng doesn't alway win
const t3 = document.querySelector("#test3 img");
ok(t3.currentSrc.endsWith("apng"), `t3: expected pass.apng, got '${t3.currentSrc}'`);
// Test dynamically constructed picture, where apng is selected over a bogus
// source or the img src attribute
const pic = document.createElement("picture");
pic.id = "test4";
const t4 = document.createElement("img");
const bogusSource = document.createElement("source");
bogusSource.type = "bogus/bogus";
bogusSource.srcset = "fail.png";
const legitSource = document.createElement("source");
legitSource.type = "image/apng";
legitSource.srcset = "pass.apng";
pic.appendChild(bogusSource);
pic.appendChild(legitSource);
pic.appendChild(t4);
t4.src = "fail.png";
document.body.appendChild(pic);
t4.onload = ()=>{
ok(t4.currentSrc.endsWith("apng"), `t4: Expected pass.apng, got '${t4.currentSrc}'`);
SimpleTest.finish();
}
};
SimpleTest.waitForExplicitFinish();
</script>
<body>
<picture id="test0">
<srouce>
<img src="pass.apng">
</picture>
<picture id="test1">
<source type="bogus/type" srcset="fail.png">
<source type="image/apng" srcset="pass.apng">
<source type="image/jpeg" srcset="fail.png">
<img src="fail-fallback">
</picture>
<picture id="test2">
<source type="image/png" srcset="pass.apng">
<source srcset="fail.png">
<source type="bogus/type" srcset="fail.png">
<img src="fail-fallback">
</picture>
<picture id="test3">
<source type="image/jpeg" srcset="pass.apng">
<source type="image/apng" srcset="fail.png">
<img src="fail-fallback">
</picture>
</body>
</html>

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

@ -59,7 +59,7 @@ TVServiceSourceSetterCallback::NotifySuccess(nsIArray* aDataList)
return rv;
}
mPromise->MaybeResolve(JS::UndefinedHandleValue);
mPromise->MaybeResolveWithUndefined();
return NS_OK;
}
@ -124,7 +124,7 @@ TVServiceChannelScanCallback::NotifySuccess(nsIArray* aDataList)
mSource->SetIsScanning(mIsScanning);
mPromise->MaybeResolve(JS::UndefinedHandleValue);
mPromise->MaybeResolveWithUndefined();
return NS_OK;
}
@ -211,7 +211,7 @@ TVServiceChannelSetterCallback::NotifySuccess(nsIArray* aDataList)
return rv;
}
mPromise->MaybeResolve(JS::UndefinedHandleValue);
mPromise->MaybeResolveWithUndefined();
return NS_OK;
}
@ -434,7 +434,7 @@ TVServiceProgramGetterCallback::NotifySuccess(nsIArray* aDataList)
}
if (mIsSingular && length == 0) {
mPromise->MaybeResolve(JS::UndefinedHandleValue);
mPromise->MaybeResolveWithUndefined();
return NS_OK;
}

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

@ -153,8 +153,6 @@ interface CanvasRenderingContext2D {
[Throws]
attribute object mozCurrentTransformInverse;
attribute DOMString mozFillRule; /* "evenodd", "nonzero" (default) */
[Throws]
attribute any mozDash; /* default |null| */

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

@ -115,11 +115,11 @@ interface HTMLInputElement : HTMLElement {
[Throws]
// TODO: unsigned vs signed
attribute long selectionStart;
attribute long? selectionStart;
[Throws]
attribute long selectionEnd;
attribute long? selectionEnd;
[Throws]
attribute DOMString selectionDirection;
attribute DOMString? selectionDirection;
[Throws]
void setRangeText(DOMString replacement);
[Throws]

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

@ -59,11 +59,11 @@ interface HTMLTextAreaElement : HTMLElement {
void select();
[Throws]
attribute unsigned long selectionStart;
attribute unsigned long? selectionStart;
[Throws]
attribute unsigned long selectionEnd;
attribute unsigned long? selectionEnd;
[Throws]
attribute DOMString selectionDirection;
attribute DOMString? selectionDirection;
[Throws]
void setRangeText(DOMString replacement);
[Throws]

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

@ -97,7 +97,7 @@ class GetRunnable final : public Runnable
new ServiceWorkerWindowClient(promise->GetParentObject(), *mValue);
promise->MaybeResolve(windowClient.get());
} else {
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
}
mPromiseProxy->CleanUp();
return true;
@ -246,7 +246,7 @@ public:
MOZ_ASSERT(promise);
if (NS_SUCCEEDED(mResult)) {
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
} else {
promise->MaybeReject(NS_ERROR_DOM_INVALID_STATE_ERR);
}

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

@ -813,7 +813,7 @@ public:
swm->GetServiceWorkerRegistrationInfo(principal, uri);
if (!registration) {
mPromise->MaybeResolve(JS::UndefinedHandleValue);
mPromise->MaybeResolveWithUndefined();
return NS_OK;
}

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

@ -376,7 +376,7 @@ public:
void
UpdateSucceeded(ServiceWorkerRegistrationInfo* aRegistration) override
{
mPromise->MaybeResolve(JS::UndefinedHandleValue);
mPromise->MaybeResolveWithUndefined();
}
void
@ -418,7 +418,7 @@ public:
if (status.Failed()) {
promise->MaybeReject(status);
} else {
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
}
status.SuppressException();
mPromiseProxy->CleanUp();
@ -1119,7 +1119,7 @@ ServiceWorkerRegistrationWorkerThread::Update(ErrorResult& aRv)
// level script evaluation. See:
// https://github.com/slightlyoff/ServiceWorker/issues/800
if (worker->LoadScriptAsPartOfLoadingServiceWorkerScript()) {
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
return promise.forget();
}

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

@ -598,7 +598,7 @@ public:
aWorkerPrivate->AssertIsOnWorkerThread();
RefPtr<Promise> promise = mPromiseProxy->WorkerPromise();
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
// Release the reference on the worker thread.
mPromiseProxy->CleanUp();
@ -663,7 +663,7 @@ ServiceWorkerGlobalScope::SkipWaiting(ErrorResult& aRv)
RefPtr<PromiseWorkerProxy> promiseProxy =
PromiseWorkerProxy::Create(mWorkerPrivate, promise);
if (!promiseProxy) {
promise->MaybeResolve(JS::UndefinedHandleValue);
promise->MaybeResolveWithUndefined();
return promise.forget();
}

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

@ -82,7 +82,7 @@ needs-focus == spellcheck-non-latin-japanese.html spellcheck-non-latin-japanese-
needs-focus == spellcheck-non-latin-korean.html spellcheck-non-latin-korean-ref.html
== unneeded_scroll.html unneeded_scroll-ref.html
skip-if(B2G||Mulet) == caret_on_presshell_reinit.html caret_on_presshell_reinit-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
fuzzy-if(browserIsRemote,255,3) asserts-if(browserIsRemote,0-1) skip-if(B2G||Mulet) == caret_on_presshell_reinit-2.html caret_on_presshell_reinit-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
fuzzy-if(browserIsRemote,255,3) asserts-if(browserIsRemote,0-1) skip-if(B2G||Mulet) fuzzy-if(skiaContent,1,5) == caret_on_presshell_reinit-2.html caret_on_presshell_reinit-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
skip-if(B2G||Mulet) fuzzy-if(asyncPan&&!layersGPUAccelerated,102,2824) == 642800.html 642800-ref.html # Initial mulet triage: parity with B2G/B2G Desktop
== selection_visibility_after_reframe.html selection_visibility_after_reframe-ref.html
!= selection_visibility_after_reframe-2.html selection_visibility_after_reframe-ref.html

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