Merge mozilla-central to fx-team

This commit is contained in:
Carsten "Tomcat" Book 2016-05-10 12:15:50 +02:00
Родитель 2226e6e2d2 e07e80ac43
Коммит 6deb1d00c9
620 изменённых файлов: 32484 добавлений и 5609 удалений

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

@ -6356,13 +6356,6 @@ function checkEmptyPageOrigin(browser = gBrowser.selectedBrowser,
return false;
}
let contentPrincipal = browser.contentPrincipal;
if (gMultiProcessBrowser && browser.isRemoteBrowser &&
!contentPrincipal && uri.spec == "about:blank") {
// Need to specialcase this because of how stopping an about:blank
// load from chrome on e10s causes a permanently null contentPrincipal,
// see bug 1249362.
return true;
}
// Not all principals have URIs...
if (contentPrincipal.URI) {
// A manually entered about:blank URI is slightly magical:

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

@ -1,5 +1,5 @@
[DEFAULT]
skip-if = buildapp == 'mulet' || e10s
skip-if = buildapp == 'mulet' || e10s # Bug 1270943
support-files =
head.js
chat.html

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

@ -422,7 +422,7 @@ skip-if = os == "linux" || os == "mac" # No tabs in titlebar on linux
# Disabled on OS X because of bug 967917
[browser_tabfocus.js]
[browser_tabkeynavigation.js]
skip-if = (os == "mac" && !e10s)
skip-if = (os == "mac" && !e10s) # Bug 1237713 - OSX eats keypresses for some reason
[browser_tabopen_reflows.js]
[browser_tabs_close_beforeunload.js]
support-files =

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

@ -3,7 +3,7 @@
add_task(function* test_keyword_bookmarklet() {
let bm = yield PlacesUtils.bookmarks.insert({ parentGuid: PlacesUtils.bookmarks.unfiledGuid,
title: "bookmarklet",
url: "javascript:1;" });
url: "javascript:'1';" });
let tab = gBrowser.selectedTab = gBrowser.addTab();
registerCleanupFunction (function* () {
gBrowser.removeTab(tab);
@ -20,7 +20,7 @@ add_task(function* test_keyword_bookmarklet() {
let originalPrincipalURI = yield getPrincipalURI();
yield PlacesUtils.keywords.insert({ keyword: "bm", url: "javascript:1;" })
yield PlacesUtils.keywords.insert({ keyword: "bm", url: "javascript:'1';" })
// Enter bookmarklet keyword in the URL bar
gURLBar.value = "bm";

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

@ -19,7 +19,7 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=676619
download="just some video" id="link3">Download "just some video"</a></li>
<li><a href="data:text/plain,test"
download="with-target.txt" id="link4">Download "with-target.txt"</a></li>
<li><a href="javascript:1+2"
<li><a href="javascript:(1+2)+''"
download="javascript.txt" id="link5">Download "javascript.txt"</a></li>
</ul>
<script>

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

@ -25,4 +25,4 @@ support-files =
[test_bug364677.html]
[test_bug395533.html]
[test_offlineNotification.html]
skip-if = buildapp == 'mulet' || e10s # Bug 1066070 - I don't think either popup notifications nor addon install stuff works?
skip-if = buildapp == 'mulet' || e10s # Mulet: Bug 1066070; e10s: Bug 1257785

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

@ -1,2 +1,2 @@
<script>var q = 1;</script>
<script>var q = "1";</script>
<a href="javascript:q">Click me</a>

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

@ -9,6 +9,7 @@ support-files =
[browser_aboutURLs.js]
[browser_usercontext.js]
[browser_usercontextid_tabdrop.js]
skip-if = os == "mac" || os == "win" # Intermittent failure - bug 1268276
[browser_windowName.js]
[browser_windowOpen.js]
[browser_serviceworkers.js]

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

@ -36,7 +36,7 @@ add_task(function* test() {
// reflect the received message on title
let receiveMsg = ContentTask.spawn(receiver.browser, channelName,
function (name) {
return new Promise(resolve => {
return new content.window.wrappedJSObject.Promise(resolve => {
content.window.bc = new content.window.BroadcastChannel(name);
content.window.bc.onmessage = function (e) {
content.document.title += e.data;

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

@ -23,15 +23,10 @@ function openTabInUserContext(uri, userContextId) {
add_task(function* setup() {
// make sure userContext is enabled.
SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true]
]});
});
add_task(function* cleanup() {
// make sure we don't leave any prefs set for the next tests
registerCleanupFunction(function() {
SpecialPowers.popPrefEnv();
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true]
]}, resolve);
});
});

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

@ -27,15 +27,10 @@ function openTabInUserContext(uri, userContextId) {
add_task(function* setup() {
// make sure userContext is enabled.
SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true]
]});
});
add_task(function* cleanup() {
// make sure we don't leave any prefs set for the next tests
registerCleanupFunction(function() {
SpecialPowers.popPrefEnv();
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true]
]}, resolve);
});
});

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

@ -13,16 +13,11 @@ const BASE_URI = "http://mochi.test:8888/browser/browser/components/"
add_task(function* setup() {
// make sure userContext is enabled.
SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true],
["browser.link.open_newwindow", 3],
]});
});
add_task(function* cleanup() {
// make sure we don't leave any prefs set for the next tests
registerCleanupFunction(function() {
SpecialPowers.popPrefEnv();
yield new Promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["privacy.userContext.enabled", true],
["browser.link.open_newwindow", 3],
]}, resolve);
});
});

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

@ -1,8 +1,9 @@
/* globals Cu, XPCOMUtils, Preferences, is, registerCleanupFunction, NewTabWebChannel, PlacesTestUtils */
/* globals Cu, XPCOMUtils, Preferences, is, registerCleanupFunction, NewTabWebChannel, PlacesTestUtils, Task */
"use strict";
Cu.import("resource://gre/modules/Preferences.jsm");
Cu.import("resource://gre/modules/Task.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "NewTabWebChannel",
"resource:///modules/NewTabWebChannel.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "NewTabMessages",
@ -10,25 +11,27 @@ XPCOMUtils.defineLazyModuleGetter(this, "NewTabMessages",
XPCOMUtils.defineLazyModuleGetter(this, "PlacesTestUtils",
"resource://testing-common/PlacesTestUtils.jsm");
function setup() {
let setup = Task.async(function*() {
Preferences.set("browser.newtabpage.enhanced", true);
Preferences.set("browser.newtabpage.remote.mode", "test");
Preferences.set("browser.newtabpage.remote", true);
NewTabMessages.init();
}
yield PlacesTestUtils.clearHistory();
});
function cleanup() {
let cleanup = Task.async(function*() {
NewTabMessages.uninit();
Preferences.set("browser.newtabpage.remote", false);
Preferences.set("browser.newtabpage.remote.mode", "production");
}
});
registerCleanupFunction(cleanup);
/*
* Sanity tests for pref messages
*/
add_task(function* prefMessages_request() {
setup();
yield setup();
let testURL = "https://example.com/browser/browser/components/newtab/tests/browser/newtabmessages_prefs.html";
let tabOptions = {
@ -54,14 +57,14 @@ add_task(function* prefMessages_request() {
Preferences.set("browser.newtabpage.enhanced", false);
yield prefChangeAck;
});
cleanup();
yield cleanup();
});
/*
* Sanity tests for preview messages
*/
add_task(function* previewMessages_request() {
setup();
yield setup();
var oldEnabledPref = Services.prefs.getBoolPref("browser.pagethumbnails.capturing_disabled");
Services.prefs.setBoolPref("browser.pagethumbnails.capturing_disabled", false);
@ -82,7 +85,7 @@ add_task(function* previewMessages_request() {
yield BrowserTestUtils.withNewTab(tabOptions, function*() {
yield previewResponseAck;
});
cleanup();
yield cleanup();
Services.prefs.setBoolPref("browser.pagethumbnails.capturing_disabled", oldEnabledPref);
});
@ -90,7 +93,7 @@ add_task(function* previewMessages_request() {
* Sanity tests for places messages
*/
add_task(function* placesMessages_request() {
setup();
yield setup();
let testURL = "https://example.com/browser/browser/components/newtab/tests/browser/newtabmessages_places.html";
// url prefix for test history population
@ -139,16 +142,16 @@ add_task(function* placesMessages_request() {
let placesResponseAck = new Promise(resolve => {
NewTabWebChannel.once("numItemsAck", (_, msg) => {
ok(true, "a request response has been received");
is(msg.data, visits.length + 1, "received an expect number of history items");
is(msg.data, visits.length + 1, "received an expected number of history items");
resolve();
});
});
yield BrowserTestUtils.withNewTab(tabOptions, function*() {
yield placesResponseAck;
ok(true, "a change response has been received");
let placesChangeAck = new Promise(resolve => {
NewTabWebChannel.once("clearHistoryAck", (_, msg) => {
ok(true, "a change response has been received");
is(msg.data, "clearHistory", "a clear history message has been received");
resolve();
});
@ -156,5 +159,5 @@ add_task(function* placesMessages_request() {
yield PlacesTestUtils.clearHistory();
yield placesChangeAck;
});
cleanup();
yield cleanup();
});

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

@ -4,7 +4,6 @@ support-files = head.js
[browser_forbidden.js]
[browser_bug400731.js]
[browser_bug415846.js]
skip-if = os == "mac" || e10s
# Disabled on Mac because of its bizarre special-and-unique
# snowflake of a help menu.
# Disabled on Mac because of its bizarre special-and-unique snowflake of a help menu.
skip-if = os == "mac" || e10s # e10s: Bug 1248632
[browser_whitelisted.js]

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

@ -103,7 +103,7 @@ skip-if = buildapp == 'mulet'
[browser_pending_tabs.js]
[browser_privatetabs.js]
[browser_purge_shistory.js]
skip-if = e10s
skip-if = e10s # Bug 1271024
[browser_replace_load.js]
[browser_restore_redirect.js]
[browser_scrollPositions.js]
@ -205,7 +205,6 @@ skip-if = true # Needs to be rewritten as Marionette test, bug 995916
[browser_739531.js]
[browser_739805.js]
[browser_819510_perwindowpb.js]
skip-if = os == "linux" || e10s # Linux: Intermittent failures, bug 894063; e10s: Bug 1079073
# Disabled for frequent intermittent failures
[browser_464620_a.js]

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

@ -3,6 +3,9 @@
// Test opening default mochitest-normal-private-normal-private windows
// (saving the state with last window being private)
requestLongerTimeout(2);
add_task(function* test_1() {
let win = yield promiseNewWindowLoaded();
win.gBrowser.addTab("http://www.example.com/1");

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

@ -9,6 +9,5 @@ support-files =
[browser_translation_bing.js]
[browser_translation_yandex.js]
[browser_translation_telemetry.js]
skip-if = e10s
[browser_translation_infobar.js]
[browser_translation_exceptions.js]

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

@ -196,7 +196,7 @@ was trying to connect. -->
<!ENTITY certerror.pagetitle1 "Insecure Connection">
<!ENTITY certerror.whatShouldIDo.badStsCertExplanation "This site uses HTTP
Strict Transport Security (HSTS) to specify that &brandShortName; only connect
Strict Transport Security (HSTS) to specify that &brandShortName; may only connect
to it securely. As a result, it is not possible to add an exception for this
certificate.">
<!ENTITY certerror.copyToClipboard.label "Copy text to clipboard">

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

@ -133,9 +133,11 @@ let LaterRun = {
if (pageData.url) {
let uri = null;
try {
uri = Services.io.newURI(pageData.url.trim(), null, null);
let urlString = Services.urlFormatter.formatURL(pageData.url.trim());
uri = Services.io.newURI(urlString, null, null);
} catch (ex) {
Cu.reportError("Invalid LaterRun page URL " + pageData.url + " ignored.");
continue;
}
if (!uri.schemeIs("https")) {
Cu.reportError("Insecure LaterRun page URL " + uri.spec + " ignored.");

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

@ -9,9 +9,11 @@ Components.utils.import("resource://gre/modules/Services.jsm");
Components.utils.import("resource:///modules/LaterRun.jsm");
Services.prefs.setBoolPref(kEnabledPref, true);
Components.utils.import("resource://testing-common/AppInfo.jsm");
updateAppInfo();
add_task(function* test_page_applies() {
Services.prefs.setCharPref(kPagePrefRoot + "test_LaterRun_unittest.url", "https://www.mozilla.org/");
Services.prefs.setCharPref(kPagePrefRoot + "test_LaterRun_unittest.url", "https://www.mozilla.org/%VENDOR%/%NAME%/%ID%/%VERSION%/");
Services.prefs.setIntPref(kPagePrefRoot + "test_LaterRun_unittest.minimumHoursSinceInstall", 10);
Services.prefs.setIntPref(kPagePrefRoot + "test_LaterRun_unittest.minimumSessionCount", 3);
@ -25,7 +27,12 @@ add_task(function* test_page_applies() {
Assert.equal(page.minimumHoursSinceInstall, 10, "Needs to have 10 hours since install");
Assert.equal(page.minimumSessionCount, 3, "Needs to have 3 sessions");
Assert.equal(page.requireBoth, false, "Either requirement is enough");
Assert.equal(page.url, "https://www.mozilla.org/", "URL is stored correctly");
let expectedURL = "https://www.mozilla.org/" +
Services.appinfo.vendor + "/" +
Services.appinfo.name + "/" +
Services.appinfo.ID + "/" +
Services.appinfo.version + "/";
Assert.equal(page.url, expectedURL, "URL is stored correctly");
Assert.ok(page.applies({hoursSinceInstall: 1, sessionCount: 3}),
"Applies when session count has been met.");

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

@ -1,3 +1,4 @@
altgraph.pth:python/altgraph
marionette_driver.pth:testing/marionette/client
browsermobproxy.pth:testing/marionette/harness/marionette/runner/mixins/browsermob-proxy-py
wptserve.pth:testing/web-platform/tests/tools/wptserve
@ -13,6 +14,7 @@ optional:setup.py:python/psutil:build_ext:--inplace
optional:psutil.pth:python/psutil
which.pth:python/which
ply.pth:other-licenses/ply/
macholib.pth:python/macholib
mock.pth:python/mock-1.0.0
mozilla.pth:build
mozilla.pth:config

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

@ -39,7 +39,6 @@ support-files =
[browser_canvas-frontend-img-thumbnails-01.js]
[browser_canvas-frontend-img-thumbnails-02.js]
[browser_canvas-frontend-open.js]
skip-if = e10s # bug 1102301 - leaks while running as a standalone directory in e10s mode
[browser_canvas-frontend-record-01.js]
[browser_canvas-frontend-record-02.js]
[browser_canvas-frontend-record-03.js]

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

@ -1,6 +1,6 @@
[DEFAULT]
skip-if = e10s # Bug 1034511
tags = devtools
skip-if = e10s # Bug ?????? - devtools tests disabled with e10s
subsuite = devtools
support-files =
head.js
@ -9,9 +9,9 @@ support-files =
[browser_cmd_addon.js]
[browser_cmd_calllog.js]
skip-if = true || e10s # Bug 845831
skip-if = true # Bug 845831
[browser_cmd_calllog_chrome.js]
skip-if = true || e10s # Bug 845831
skip-if = true # Bug 845831
[browser_cmd_appcache_invalid.js]
support-files =
browser_cmd_appcache_invalid_appcache.appcache
@ -55,6 +55,7 @@ support-files =
browser_cmd_csscoverage_sheetC.css
browser_cmd_csscoverage_sheetD.css
[browser_cmd_folder.js]
skip-if = (e10s && debug) # Bug 1034511 (docShell leaks on debug)
[browser_cmd_highlight_01.js]
[browser_cmd_highlight_02.js]
[browser_cmd_highlight_03.js]
@ -62,6 +63,7 @@ support-files =
support-files =
browser_cmd_inject.html
[browser_cmd_csscoverage_util.js]
skip-if = (e10s && debug) # Bug 1034511 (docShell leaks on debug)
[browser_cmd_jsb.js]
support-files =
browser_cmd_jsb_script.jsi
@ -91,7 +93,7 @@ support-files =
[browser_gcli_completion1.js]
[browser_gcli_completion2.js]
[browser_gcli_date.js]
skip-if = true || e10s # Disabled until TZ bug is fixed
skip-if = true # Bug 934098
[browser_gcli_exec.js]
[browser_gcli_fail.js]
[browser_gcli_file.js]

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

@ -84,6 +84,7 @@ skip-if = buildapp == 'mulet'
[browser_ua_emulation.js]
[browser_timelineMarkers-01.js]
[browser_timelineMarkers-02.js]
skip-if = true # Bug 1220415
[browser_timelineMarkers-03.js]
[browser_timelineMarkers-04.js]
[browser_timelineMarkers-05.js]

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

@ -138,6 +138,53 @@ static bool sDoNotTrackEnabled = false;
static bool sVibratorEnabled = false;
static uint32_t sMaxVibrateMS = 0;
static uint32_t sMaxVibrateListLen = 0;
static const char* kVibrationPermissionType = "vibration";
static void
AddPermission(nsIPrincipal* aPrincipal, const char* aType, uint32_t aPermission,
uint32_t aExpireType, int64_t aExpireTime)
{
MOZ_ASSERT(aType);
MOZ_ASSERT(aPrincipal);
nsCOMPtr<nsIPermissionManager> permMgr = services::GetPermissionManager();
if (!permMgr) {
return;
}
permMgr->AddFromPrincipal(aPrincipal, aType, aPermission, aExpireType,
aExpireTime);
}
static uint32_t
GetPermission(nsPIDOMWindowInner* aWindow, const char* aType)
{
MOZ_ASSERT(aType);
uint32_t permission = nsIPermissionManager::UNKNOWN_ACTION;
nsCOMPtr<nsIPermissionManager> permMgr = services::GetPermissionManager();
if (!permMgr) {
return permission;
}
permMgr->TestPermissionFromWindow(aWindow, aType, &permission);
return permission;
}
static uint32_t
GetPermission(nsIPrincipal* aPrincipal, const char* aType)
{
MOZ_ASSERT(aType);
MOZ_ASSERT(aPrincipal);
uint32_t permission = nsIPermissionManager::UNKNOWN_ACTION;
nsCOMPtr<nsIPermissionManager> permMgr = services::GetPermissionManager();
if (!permMgr) {
return permission;
}
permMgr->TestPermissionFromPrincipal(aPrincipal, aType, &permission);
return permission;
}
/* static */
void
@ -875,6 +922,47 @@ Navigator::RemoveIdleObserver(MozIdleObserver& aIdleObserver, ErrorResult& aRv)
}
}
void
Navigator::SetVibrationPermission(bool aPermitted, bool aPersistent)
{
MOZ_ASSERT(NS_IsMainThread());
nsTArray<uint32_t> pattern;
pattern.SwapElements(mRequestedVibrationPattern);
if (!mWindow) {
return;
}
nsCOMPtr<nsIDocument> doc = mWindow->GetExtantDoc();
if (!MayVibrate(doc)) {
return;
}
if (aPermitted) {
// Add a listener to cancel the vibration if the document becomes hidden,
// and remove the old visibility listener, if there was one.
if (!gVibrateWindowListener) {
// If gVibrateWindowListener is null, this is the first time we've vibrated,
// and we need to register a listener to clear gVibrateWindowListener on
// shutdown.
ClearOnShutdown(&gVibrateWindowListener);
} else {
gVibrateWindowListener->RemoveListener();
}
gVibrateWindowListener = new VibrateWindowListener(mWindow, doc);
hal::Vibrate(pattern, mWindow);
}
if (aPersistent) {
AddPermission(doc->NodePrincipal(), kVibrationPermissionType,
aPermitted ? nsIPermissionManager::ALLOW_ACTION :
nsIPermissionManager::DENY_ACTION,
nsIPermissionManager::EXPIRE_SESSION, 0);
}
}
bool
Navigator::Vibrate(uint32_t aDuration)
{
@ -886,6 +974,8 @@ Navigator::Vibrate(uint32_t aDuration)
bool
Navigator::Vibrate(const nsTArray<uint32_t>& aPattern)
{
MOZ_ASSERT(NS_IsMainThread());
if (!mWindow) {
return false;
}
@ -903,9 +993,7 @@ Navigator::Vibrate(const nsTArray<uint32_t>& aPattern)
}
for (size_t i = 0; i < pattern.Length(); ++i) {
if (pattern[i] > sMaxVibrateMS) {
pattern[i] = sMaxVibrateMS;
}
pattern[i] = std::min(sMaxVibrateMS, pattern[i]);
}
// The spec says we check sVibratorEnabled after we've done the sanity
@ -914,21 +1002,28 @@ Navigator::Vibrate(const nsTArray<uint32_t>& aPattern)
return true;
}
// Add a listener to cancel the vibration if the document becomes hidden,
// and remove the old visibility listener, if there was one.
mRequestedVibrationPattern.SwapElements(pattern);
uint32_t permission = GetPermission(mWindow, kVibrationPermissionType);
if (!gVibrateWindowListener) {
// If gVibrateWindowListener is null, this is the first time we've vibrated,
// and we need to register a listener to clear gVibrateWindowListener on
// shutdown.
ClearOnShutdown(&gVibrateWindowListener);
if (permission == nsIPermissionManager::ALLOW_ACTION ||
mRequestedVibrationPattern.IsEmpty() ||
(mRequestedVibrationPattern.Length() == 1 &&
mRequestedVibrationPattern[0] == 0)) {
// Always allow cancelling vibration and respect session permissions.
SetVibrationPermission(true /* permitted */, false /* persistent */);
return true;
}
else {
gVibrateWindowListener->RemoveListener();
}
gVibrateWindowListener = new VibrateWindowListener(mWindow, doc);
hal::Vibrate(pattern, mWindow);
nsCOMPtr<nsIObserverService> obs = services::GetObserverService();
if (!obs || permission == nsIPermissionManager::DENY_ACTION) {
// Abort without observer service or on denied session permission.
SetVibrationPermission(false /* permitted */, false /* persistent */);
return true;
}
// Request user permission.
obs->NotifyObservers(ToSupports(this), "Vibration:Request", nullptr);
return true;
}
@ -2184,12 +2279,7 @@ Navigator::CheckPermission(nsPIDOMWindowInner* aWindow, const char* aType)
return false;
}
nsCOMPtr<nsIPermissionManager> permMgr =
services::GetPermissionManager();
NS_ENSURE_TRUE(permMgr, false);
uint32_t permission = nsIPermissionManager::DENY_ACTION;
permMgr->TestPermissionFromWindow(aWindow, aType, &permission);
uint32_t permission = GetPermission(aWindow, aType);
return permission == nsIPermissionManager::ALLOW_ACTION;
}
@ -2244,14 +2334,9 @@ Navigator::HasWifiManagerSupport(JSContext* /* unused */,
// and test directly with permission manager.
nsIPrincipal* principal = nsContentUtils::ObjectPrincipal(aGlobal);
uint32_t permission = GetPermission(principal, "wifi-manage");
nsCOMPtr<nsIPermissionManager> permMgr =
services::GetPermissionManager();
NS_ENSURE_TRUE(permMgr, false);
uint32_t permission = nsIPermissionManager::DENY_ACTION;
permMgr->TestPermissionFromPrincipal(principal, "wifi-manage", &permission);
return nsIPermissionManager::ALLOW_ACTION == permission;
return permission == nsIPermissionManager::ALLOW_ACTION;
}
#ifdef MOZ_NFC
@ -2293,12 +2378,8 @@ Navigator::HasMobileIdSupport(JSContext* aCx, JSObject* aGlobal)
}
nsIPrincipal* principal = doc->NodePrincipal();
uint32_t permission = GetPermission(principal, "mobileid");
nsCOMPtr<nsIPermissionManager> permMgr = services::GetPermissionManager();
NS_ENSURE_TRUE(permMgr, false);
uint32_t permission = nsIPermissionManager::UNKNOWN_ACTION;
permMgr->TestPermissionFromPrincipal(principal, "mobileid", &permission);
return permission == nsIPermissionManager::PROMPT_ACTION ||
permission == nsIPermissionManager::ALLOW_ACTION;
}

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

@ -193,6 +193,7 @@ public:
bool Vibrate(uint32_t aDuration);
bool Vibrate(const nsTArray<uint32_t>& aDuration);
void SetVibrationPermission(bool aPermitted, bool aPersistent);
uint32_t MaxTouchPoints();
void GetAppCodeName(nsString& aAppCodeName, ErrorResult& aRv)
{
@ -396,6 +397,7 @@ private:
RefPtr<Presentation> mPresentation;
nsTArray<RefPtr<Promise> > mVRGetDevicesPromises;
nsTArray<uint32_t> mRequestedVibrationPattern;
};
} // namespace dom

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

@ -212,7 +212,9 @@ WindowNamedPropertiesHandler::ownPropNames(JSContext* aCx,
return true;
}
nsHTMLDocument* document = static_cast<nsHTMLDocument*>(htmlDoc.get());
document->GetSupportedNames(flags, names);
// Document names are enumerable, so we want to get them no matter what flags
// is.
document->GetSupportedNames(names);
JS::AutoIdVector docProps(aCx);
if (!AppendNamedPropertyIds(aCx, aProxy, names, false, docProps)) {

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

@ -537,12 +537,8 @@ nsContentList::NamedItem(const nsAString& aName, bool aDoFlush)
}
void
nsContentList::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames)
nsContentList::GetSupportedNames(nsTArray<nsString>& aNames)
{
if (!(aFlags & JSITER_HIDDEN)) {
return;
}
BringSelfUpToDate(true);
AutoTArray<nsIAtom*, 8> atoms;

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

@ -291,8 +291,7 @@ public:
aFound = !!item;
return item;
}
virtual void GetSupportedNames(unsigned aFlags,
nsTArray<nsString>& aNames) override;
virtual void GetSupportedNames(nsTArray<nsString>& aNames) override;
// nsContentList public methods
uint32_t Length(bool aDoFlush);

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

@ -163,20 +163,9 @@ nsDOMAttributeMap::NamedGetter(const nsAString& aAttrName, bool& aFound)
return GetAttribute(ni);
}
bool
nsDOMAttributeMap::NameIsEnumerable(const nsAString& aName)
{
return false;
}
void
nsDOMAttributeMap::GetSupportedNames(unsigned aFlags,
nsTArray<nsString>& aNames)
nsDOMAttributeMap::GetSupportedNames(nsTArray<nsString>& aNames)
{
if (!(aFlags & JSITER_HIDDEN)) {
return;
}
// For HTML elements in HTML documents, only include names that are still the
// same after ASCII-lowercasing, since our named getter will end up
// ASCII-lowercasing the given string.

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

@ -139,7 +139,6 @@ public:
// WebIDL
Attr* GetNamedItem(const nsAString& aAttrName);
Attr* NamedGetter(const nsAString& aAttrName, bool& aFound);
bool NameIsEnumerable(const nsAString& aName);
already_AddRefed<Attr>
RemoveNamedItem(mozilla::dom::NodeInfo* aNodeInfo, ErrorResult& aError);
already_AddRefed<Attr>
@ -159,7 +158,7 @@ public:
ErrorResult& aError);
void
GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames);
GetSupportedNames(nsTArray<nsString>& aNames);
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;

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

@ -1295,9 +1295,9 @@ nsDOMWindowUtils::SendSimpleGestureEvent(const nsAString& aType,
WidgetSimpleGestureEvent event(true, msg, widget);
event.mModifiers = nsContentUtils::GetWidgetModifiers(aModifiers);
event.direction = aDirection;
event.delta = aDelta;
event.clickCount = aClickCount;
event.mDirection = aDirection;
event.mDelta = aDelta;
event.mClickCount = aClickCount;
event.mTime = PR_IntervalNow();
nsPresContext* presContext = GetPresContext();
@ -3781,6 +3781,18 @@ nsDOMWindowUtils::AskPermission(nsIContentPermissionRequest* aRequest)
return nsContentPermissionUtils::AskPermission(aRequest, window->GetCurrentInnerWindow());
}
NS_IMETHODIMP
nsDOMWindowUtils::GetElementsRestyled(uint64_t* aResult)
{
nsPresContext* presContext = GetPresContext();
if (!presContext) {
return NS_ERROR_NOT_AVAILABLE;
}
*aResult = presContext->ElementsRestyledCount();
return NS_OK;
}
NS_IMETHODIMP
nsDOMWindowUtils::GetFramesConstructed(uint64_t* aResult)
{

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

@ -156,7 +156,6 @@ nsJSUtils::EvaluateString(JSContext* aCx,
"Caller must own error reporting");
MOZ_ASSERT_IF(aCompileOptions.versionSet,
aCompileOptions.version != JSVERSION_UNKNOWN);
MOZ_ASSERT_IF(aEvaluateOptions.coerceToString, !aCompileOptions.noScriptRval);
MOZ_ASSERT(aCx == nsContentUtils::GetCurrentJSContext());
MOZ_ASSERT(aSrcBuf.get());
MOZ_ASSERT(js::GetGlobalForObjectCrossCompartment(aEvaluationGlobal) ==
@ -211,13 +210,6 @@ nsJSUtils::EvaluateString(JSContext* aCx,
} else if (ok) {
ok = JS::Evaluate(aCx, scopeChain, aCompileOptions, aSrcBuf, aRetValue);
}
if (ok && aEvaluateOptions.coerceToString && !aRetValue.isUndefined()) {
JS::Rooted<JS::Value> value(aCx, aRetValue);
JSString* str = JS::ToString(aCx, value);
ok = !!str;
aRetValue.set(ok ? JS::StringValue(str) : JS::UndefinedValue());
}
}
if (!ok) {

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

@ -65,18 +65,11 @@ public:
JSObject** aFunctionObject);
struct MOZ_STACK_CLASS EvaluateOptions {
bool coerceToString;
JS::AutoObjectVector scopeChain;
explicit EvaluateOptions(JSContext* cx)
: coerceToString(false)
, scopeChain(cx)
: scopeChain(cx)
{}
EvaluateOptions& setCoerceToString(bool aCoerce) {
coerceToString = aCoerce;
return *this;
}
};
// aEvaluationGlobal is the global to evaluate in. The return value

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

@ -122,12 +122,6 @@ nsMimeTypeArray::NamedGetter(const nsAString& aName, bool &aFound)
return nullptr;
}
bool
nsMimeTypeArray::NameIsEnumerable(const nsAString& aName)
{
return true;
}
uint32_t
nsMimeTypeArray::Length()
{
@ -137,7 +131,7 @@ nsMimeTypeArray::Length()
}
void
nsMimeTypeArray::GetSupportedNames(unsigned, nsTArray< nsString >& aRetval)
nsMimeTypeArray::GetSupportedNames(nsTArray< nsString >& aRetval)
{
EnsurePluginMimeTypes();

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

@ -35,9 +35,8 @@ public:
nsMimeType* NamedItem(const nsAString& name);
nsMimeType* IndexedGetter(uint32_t index, bool &found);
nsMimeType* NamedGetter(const nsAString& name, bool &found);
bool NameIsEnumerable(const nsAString& name);
uint32_t Length();
void GetSupportedNames(unsigned, nsTArray< nsString >& retval);
void GetSupportedNames(nsTArray<nsString>& retval);
protected:
virtual ~nsMimeTypeArray();

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

@ -224,12 +224,6 @@ nsPluginArray::NamedGetter(const nsAString& aName, bool &aFound)
return plugin;
}
bool
nsPluginArray::NameIsEnumerable(const nsAString& aName)
{
return true;
}
uint32_t
nsPluginArray::Length()
{
@ -243,7 +237,7 @@ nsPluginArray::Length()
}
void
nsPluginArray::GetSupportedNames(unsigned, nsTArray<nsString>& aRetval)
nsPluginArray::GetSupportedNames(nsTArray<nsString>& aRetval)
{
aRetval.Clear();
@ -419,12 +413,6 @@ nsPluginElement::NamedGetter(const nsAString& aName, bool &aFound)
return nullptr;
}
bool
nsPluginElement::NameIsEnumerable(const nsAString& aName)
{
return true;
}
uint32_t
nsPluginElement::Length()
{
@ -434,7 +422,7 @@ nsPluginElement::Length()
}
void
nsPluginElement::GetSupportedNames(unsigned, nsTArray<nsString>& retval)
nsPluginElement::GetSupportedNames(nsTArray<nsString>& retval)
{
EnsurePluginMimeTypes();

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

@ -49,9 +49,8 @@ public:
void Refresh(bool aReloadDocuments);
nsPluginElement* IndexedGetter(uint32_t aIndex, bool &aFound);
nsPluginElement* NamedGetter(const nsAString& aName, bool &aFound);
bool NameIsEnumerable(const nsAString& aName);
uint32_t Length();
void GetSupportedNames(unsigned, nsTArray<nsString>& aRetval);
void GetSupportedNames(nsTArray<nsString>& aRetval);
private:
virtual ~nsPluginArray();
@ -91,9 +90,8 @@ public:
nsMimeType* NamedItem(const nsAString& name);
nsMimeType* IndexedGetter(uint32_t index, bool &found);
nsMimeType* NamedGetter(const nsAString& name, bool &found);
bool NameIsEnumerable(const nsAString& aName);
uint32_t Length();
void GetSupportedNames(unsigned, nsTArray<nsString>& retval);
void GetSupportedNames(nsTArray<nsString>& retval);
nsTArray<RefPtr<nsMimeType> >& MimeTypes();

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

@ -16,16 +16,13 @@ support-files =
[browser_bug593387.js]
[browser_bug902350.js]
tags = mcb
[browser_bug1011748.js]
[browser_bug1058164.js]
[browser_messagemanager_loadprocessscript.js]
[browser_messagemanager_targetframeloader.js]
[browser_messagemanager_unload.js]
[browser_pagehide_on_tab_close.js]
skip-if = e10s # this tests non-e10s behavior. it's not expected to work in e10s.
[browser_messagemanager_unload.js]
[browser_state_notifications.js]
# skip-if = e10s # Bug ?????? - content-document-* notifications come while document's URI is still about:blank, but test expects real URL.
skip-if = true # Intermittent failures - bug 987493. Restore the skip-if above once fixed
[browser_bug1058164.js]
skip-if = true # Bug 1271028
[browser_use_counters.js]
[browser_bug1238440.js]
skip-if = e10s
[browser_bug1011748.js]

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

@ -1,76 +0,0 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
"use strict";
Components.utils.import("resource://gre/modules/NetUtil.jsm");
Components.utils.import("resource://gre/modules/FileUtils.jsm");
waitForExplicitFinish();
const PAGE = "data:text/html,<html><body><input type=\"file\"/></body></html>";
function writeFile(file, text) {
return new Promise((resolve) => {
let converter = Components.classes["@mozilla.org/intl/scriptableunicodeconverter"]
.createInstance(Components.interfaces.nsIScriptableUnicodeConverter);
converter.charset = "UTF-8";
let ostream = FileUtils.openSafeFileOutputStream(file);
let istream = converter.convertToInputStream(text);
NetUtil.asyncCopy(istream, ostream, function(status) {
if (!Components.isSuccessCode(status)) throw 'fail';
resolve();
});
});
}
function runFileReader(input, status) {
return new Promise((resolve) => {
let fr = new FileReader();
fr.onload = function() {
ok(status, "FileReader called onload");
resolve();
}
fr.onerror = function(e) {
e.preventDefault();
ok(!status, "FileReader called onerror");
resolve();
}
fr.readAsArrayBuffer(input);
});
}
add_task(function() {
info("Creating a temporary file...");
let file = FileUtils.getFile("TmpD", ["bug1238440.txt"]);
yield writeFile(file, "hello world");
info("Opening a tab...");
let tab = gBrowser.addTab(PAGE);
gBrowser.selectedTab = tab;
let browser = tab.linkedBrowser;
yield BrowserTestUtils.browserLoaded(browser);
info("Populating the form...");
let doc = browser.contentDocument;
let input = doc.querySelector('input');
input.value = file.path;
info("Running the FileReader...");
yield runFileReader(input.files[0], true);
info("Writing the temporary file again...");
yield writeFile(file, "hello world-----------------------------");
info("Running the FileReader again...");
yield runFileReader(input.files[0], false);
info("Closing the tab...");
gBrowser.removeTab(gBrowser.selectedTab);
ok(true, "we didn't crash.");
});

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

@ -270,7 +270,12 @@ support-files =
!/dom/html/test/form_submit_server.sjs
!/dom/security/test/cors/file_CrossSiteXHR_server.sjs
!/image/test/mochitest/blue.png
script_bug1238440.js
[test_anchor_area_referrer.html]
[test_anchor_area_referrer_changing.html]
[test_anchor_area_referrer_invalid.html]
[test_anchor_area_referrer_rel.html]
[test_anonymousContent_api.html]
[test_anonymousContent_append_after_reflow.html]
[test_anonymousContent_canvas.html]
@ -299,127 +304,14 @@ skip-if = buildapp == 'mulet'
[test_audioNotificationWithEarlyPlay.html]
tags = audiochannel
skip-if = buildapp == 'mulet'
[test_bug1091883.html]
[test_bug116083.html]
[test_bug793311.html]
[test_bug913761.html]
[test_bug976673.html]
[test_bug978522.html]
[test_bug979109.html]
[test_bug989665.html]
[test_bug999456.html]
[test_bug1022229.html]
[test_bug1043106.html]
[test_bug1060938.html]
[test_bug1064481.html]
[test_clearTimeoutIntervalNoArg.html]
[test_consoleEmptyStack.html]
[test_constructor-assignment.html]
[test_constructor.html]
[test_dialogArguments.html]
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e10s # showmodaldialog
[test_document.all_unqualified.html]
[test_domcursor.html]
[test_domrequest.html]
[test_domwindowutils.html]
[test_e4x_for_each.html]
[test_error.html]
[test_getTranslationNodes.html]
[test_getTranslationNodes_limit.html]
[test_gsp-qualified.html]
[test_gsp-quirks.html]
[test_gsp-standards.html]
[test_getFeature_with_perm.html]
[test_getFeature_without_perm.html]
[test_hasFeature.html]
[test_history_document_open.html]
[test_history_state_null.html]
[test_Image_constructor.html]
[test_innersize_scrollport.html]
[test_messagemanager_targetchain.html]
[test_named_frames.html]
[test_navigator_hardwareConcurrency.html]
[test_navigator_resolve_identity.html]
[test_navigator_language.html]
[test_noAudioNotification.html]
tags = audiochannel
[test_noAudioNotificationOnMutedElement.html]
tags = audiochannel
[test_noAudioNotificationOnMutedOrVolume0Element.html]
tags = audiochannel
[test_noAudioNotificationOnVolume0Element.html]
tags = audiochannel
[test_noWebAudioNotification.html]
tags = audiochannel
[test_openDialogChromeOnly.html]
[test_open_null_features.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Fails on b2g-desktop, tracked in bug 1011874
[test_postMessage_solidus.html]
[test_pluginAudioNotification.html]
tags = audiochannel
skip-if = (buildapp == 'b2g' || buildapp == 'mulet' || toolkit == 'android') # Plugins don't work on Android and/or B2G/Mulet
[test_screen_orientation.html]
[test_orientation_alternate.html]
skip-if = toolkit != 'gonk'
[test_orientation_frame.html]
skip-if = toolkit != 'gonk'
[test_orientation_frame_lock.html]
skip-if = toolkit != 'gonk'
[test_orientation_sandbox_no_lock.html]
skip-if = toolkit != 'gonk'
[test_settimeout_extra_arguments.html]
[test_settimeout_inner.html]
[test_setting_opener.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
[test_simplecontentpolicy.html]
skip-if = e10s || buildapp == 'b2g' # Bug 1156489.
[test_url.html]
[test_url_data.html]
[test_url_empty_port.html]
[test_url_malformedHost.html]
[test_urlExceptions.html]
[test_urlSearchParams.html]
[test_urlSearchParams_utf8.html]
[test_urlutils_stringify.html]
[test_webaudioNotification.html]
tags = audiochannel
skip-if = buildapp == 'mulet'
[test_webaudioNotificationStopOnNavigation.html]
tags = audiochannel
skip-if = buildapp == 'mulet'
[test_window_constructor.html]
[test_window_cross_origin_props.html]
[test_window_define_symbol.html]
[test_window_enumeration.html]
[test_window_extensible.html]
[test_window_indexing.html]
[test_window_named_frame_enumeration.html]
[test_window_orientation.html]
skip-if = toolkit != 'gonk'
[test_writable-replaceable.html]
[test_navigatorPrefOverride.html]
[test_EventSource_redirects.html]
[test_NodeIterator_basics_filters.xhtml]
[test_NodeIterator_mutations_1.xhtml]
[test_NodeIterator_mutations_2.html]
[test_NodeIterator_mutations_3.html]
[test_XHR.html]
[test_XHRDocURI.html]
[test_XHRResponseURL.html]
[test_XHRSendData.html]
[test_XHR_anon.html]
[test_XHR_header.html]
[test_XHR_onuploadprogress.html]
[test_XHR_parameters.html]
skip-if = buildapp == 'b2g' # b2g(86 total, 4 failing - testing mozAnon - got false, expected true) b2g-debug(86 total, 4 failing - testing mozAnon - got false, expected true) b2g-desktop(86 total, 4 failing - testing mozAnon - got false, expected true)
[test_XHR_system.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(12 total, 2 failing - .mozSystem == true - got false, expected true + ) b2g-desktop(12 total, 2 failing - .mozSystem == true - got false, expected true + )
[test_XHR_timeout.html]
skip-if = buildapp == 'b2g' || (android_version == '18' && debug) # b2g(flaky on B2G, bug 960743) b2g-debug(flaky on B2G, bug 960743) b2g-desktop(flaky on B2G, bug 960743)
support-files = test_XHR_timeout.js
[test_base.xhtml]
[test_blobconstructor.html]
[test_blob_fragment_and_query.html]
[test_blobconstructor.html]
[test_bug5141.html]
[test_bug28293.html]
[test_bug28293.xhtml]
[test_bug51034.html]
[test_bug116083.html]
[test_bug166235.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(clipboard undefined) b2g-debug(clipboard undefined) b2g-desktop(clipboard undefined)
[test_bug199959.html]
@ -431,8 +323,6 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' # b2g(clipboard undefined) b
[test_bug276037-1.html]
[test_bug276037-2.xhtml]
[test_bug282547.html]
[test_bug28293.html]
[test_bug28293.xhtml]
[test_bug298064.html]
[test_bug300992.html]
[test_bug311681.xml]
@ -547,6 +437,9 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop spec
[test_bug435425.html]
[test_bug444030.xhtml]
[test_bug444322.html]
[test_bug444546.html]
disabled = Disabled for now. Mochitest isn't reliable enough for these.
support-files = bug444546.sjs
[test_bug444722.html]
[test_bug448993.html]
[test_bug450160.html]
@ -586,15 +479,16 @@ skip-if = buildapp == 'b2g'
[test_bug499656.html]
[test_bug499656.xhtml]
[test_bug500937.html]
[test_bug503473.html]
disabled = Disabled due to making the harness time out
support-files = file_bug503473-frame.sjs
[test_bug503481.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_bug503481b.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_bug505783.html]
skip-if = toolkit == 'android' #TIMED_OUT
[test_bug51034.html]
[test_bug513194.html]
[test_bug5141.html]
[test_bug514487.html]
[test_bug515401.html]
[test_bug518104.html]
@ -706,10 +600,12 @@ skip-if = os == "mac" # fails intermittently - bug 1101288
[test_bug750096.html]
[test_bug753278.html]
[test_bug761120.html]
[test_bug769117.html]
[test_bug782342.html]
[test_bug787778.html]
[test_bug789315.html]
[test_bug789856.html]
[test_bug793311.html]
[test_bug804395.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #bug 901343, specialpowers.wrap issue createsystemxhr
[test_bug809003.html]
@ -734,27 +630,51 @@ skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #bug 901343, specialpowers.wr
[test_bug895974.html]
[test_bug902847.html]
[test_bug907892.html]
[test_bug913761.html]
[test_bug922681.html]
[test_bug927196.html]
[test_bug962251.html]
[test_bug976673.html]
[test_bug978522.html]
[test_bug979109.html]
[test_bug982153.html]
[test_bug989665.html]
[test_bug999456.html]
[test_bug1022229.html]
[test_bug1025933.html]
[test_bug1037687.html]
[test_bug1043106.html]
[test_bug1057176.html]
[test_bug1060938.html]
[test_bug1064481.html]
[test_bug1070015.html]
[test_bug1075702.html]
[test_bug1081686.html]
skip-if = buildapp == 'b2g' || toolkit == 'android'
[test_bug1091883.html]
[test_bug1101364.html]
skip-if = buildapp == 'b2g' || toolkit == 'android'
[test_bug1118689.html]
skip-if = buildapp == 'b2g'
[test_bug1126851.html]
skip-if = buildapp == 'b2g'
[test_bug1163743.html]
[test_bug1165501.html]
[test_img_referrer.html]
[test_anchor_area_referrer.html]
[test_anchor_area_referrer_changing.html]
[test_anchor_area_referrer_invalid.html]
[test_anchor_area_referrer_rel.html]
[test_iframe_referrer.html]
[test_iframe_referrer_changing.html]
[test_iframe_referrer_invalid.html]
[test_bug1187157.html]
[test_bug1198095.html]
[test_bug1238440.html]
[test_bug1240471.html]
[test_bug1250148.html]
[test_bug1259588.html]
[test_bug1263696.html]
[test_caretPositionFromPoint.html]
[test_change_policy.html]
skip-if = buildapp == 'b2g' #no ssl support
[test_classList.html]
# This test fails on the Mac for some reason
[test_clearTimeoutIntervalNoArg.html]
[test_consoleEmptyStack.html]
[test_constructor-assignment.html]
[test_constructor.html]
[test_copyimage.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') || (toolkit != 'cocoa' && toolkit != 'gonk' && toolkit != 'gtk2' && toolkit != 'gtk3' && toolkit != 'windows') #b2g-desktop(Bug 931116, b2g desktop specific, initial triage)
[test_copypaste.html]
@ -763,23 +683,59 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 904183 # b2g(clipboard
skip-if = buildapp == 'b2g' || toolkit == 'android' #bug 904183 # b2g(bug 904183) b2g-debug(bug 904183) b2g-desktop(bug 904183)
[test_createHTMLDocument.html]
[test_declare_stylesheet_obsolete.html]
[test_dialogArguments.html]
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' || e10s # showmodaldialog
[test_document.all_iteration.html]
[test_document.all_unqualified.html]
[test_document_constructor.html]
[test_document_importNode_document.html]
[test_document_register.html]
[test_domcursor.html]
[test_domparser_null_char.html]
[test_domparsing.html]
[test_elementTraversal.html]
[test_domrequest.html]
[test_domwindowutils.html]
[test_e4x_for_each.html]
[test_element.matches.html]
[test_element_closest.html]
[test_elementTraversal.html]
[test_encodeToStringWithMaxLength.html]
[test_error.html]
[test_EventSource_redirects.html]
[test_explicit_user_agent.html]
[test_file_from_blob.html]
[test_file_negative_date.html]
[test_fileapi.html]
[test_fileapi_slice.html]
skip-if = (toolkit == 'android') || e10s # Android: Bug 775227, e10s: Bug 1226477
[test_frameLoader_switchProcess.html]
skip-if = e10s || os != 'linux' || buildapp != 'browser' # Already tests multiprocess
[test_getAttribute_after_createAttribute.html]
[test_getElementById.html]
[test_getFeature_with_perm.html]
[test_getFeature_without_perm.html]
[test_getTranslationNodes.html]
[test_getTranslationNodes_limit.html]
[test_gsp-qualified.html]
[test_gsp-quirks.html]
[test_gsp-standards.html]
[test_hasFeature.html]
[test_history_document_open.html]
[test_history_state_null.html]
[test_html_colors_quirks.html]
[test_html_colors_standards.html]
[test_html_in_xhr.html]
[test_htmlcopyencoder.html]
[test_htmlcopyencoder.xhtml]
[test_iframe_referrer.html]
[test_iframe_referrer_changing.html]
[test_iframe_referrer_invalid.html]
[test_Image_constructor.html]
[test_img_referrer.html]
[test_innersize_scrollport.html]
[test_integer_attr_with_leading_zero.html]
[test_ipc_messagemanager_blob.html]
[test_messagemanager_targetchain.html]
[test_meta_viewport0.html]
skip-if = (os != 'b2g' && os != 'android') # meta-viewport tag support is mobile-only
[test_meta_viewport1.html]
@ -796,23 +752,74 @@ skip-if = (os != 'b2g' && os != 'android') # meta-viewport tag support is mob
skip-if = (os != 'b2g' && os != 'android') # meta-viewport tag support is mobile-only
[test_meta_viewport7.html]
skip-if = (os != 'b2g' && os != 'android') # meta-viewport tag support is mobile-only
[test_mozbrowser_apis_allowed.html]
[test_mozbrowser_apis_blocked.html]
[test_mozfiledataurl.html]
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android' #TIMED_OUT
[test_mozMatchesSelector.html]
[test_mutationobserver_anonymous.html]
[test_mutationobservers.html]
skip-if = buildapp == 'b2g' # b2g(bug 901385, showmodaldialog) b2g-debug(bug 901385, showmodaldialog) b2g-desktop(bug 901385, showmodaldialog)
[test_named_frames.html]
[test_navigator_hardwareConcurrency.html]
[test_navigator_resolve_identity.html]
[test_navigator_language.html]
[test_navigatorPrefOverride.html]
[test_noAudioNotification.html]
tags = audiochannel
[test_noAudioNotificationOnMutedElement.html]
tags = audiochannel
[test_noAudioNotificationOnMutedOrVolume0Element.html]
tags = audiochannel
[test_noAudioNotificationOnVolume0Element.html]
tags = audiochannel
[test_NodeIterator_basics_filters.xhtml]
[test_NodeIterator_mutations_1.xhtml]
[test_NodeIterator_mutations_2.html]
[test_NodeIterator_mutations_3.html]
[test_nodelist_holes.html]
[test_nonascii_blob_url.html]
[test_noWebAudioNotification.html]
tags = audiochannel
[test_open_null_features.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') # Fails on b2g-desktop, tracked in bug 1011874
[test_openDialogChromeOnly.html]
[test_orientation_alternate.html]
skip-if = toolkit != 'gonk'
[test_orientation_frame.html]
skip-if = toolkit != 'gonk'
[test_orientation_frame_lock.html]
skip-if = toolkit != 'gonk'
[test_orientation_sandbox_no_lock.html]
skip-if = toolkit != 'gonk'
[test_performance_observer.html]
[test_performance_user_timing.html]
[test_plugin_freezing.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' #CLICK_TO_PLAY
[test_pluginAudioNotification.html]
tags = audiochannel
skip-if = (buildapp == 'b2g' || buildapp == 'mulet' || toolkit == 'android') # Plugins don't work on Android and/or B2G/Mulet
[test_postMessage_solidus.html]
[test_postMessages.html]
support-files = worker_postMessages.js
[test_processing_instruction_update_stylesheet.xhtml]
[test_progress_events_for_gzip_data.html]
[test_range_bounds.html]
skip-if = toolkit == 'android'
[test_reentrant_flush.html]
skip-if = toolkit == 'android'
[test_referrer_redirect.html]
[test_root_iframe.html]
[test_screen_orientation.html]
[test_script_loader_crossorigin_data_url.html]
[test_setInterval_uncatchable_exception.html]
skip-if = debug == false
[test_settimeout_extra_arguments.html]
[test_settimeout_inner.html]
[test_setting_opener.html]
skip-if = (buildapp == 'b2g' && toolkit != 'gonk') #Bug 931116, b2g desktop specific, initial triage
[test_simplecontentpolicy.html]
skip-if = e10s || buildapp == 'b2g' # Bug 1156489.
[test_sync_xhr_timer.xhtml]
skip-if = toolkit == 'android'
[test_text_wholeText.html]
@ -820,11 +827,34 @@ skip-if = toolkit == 'android'
[test_textnode_split_in_selection.html]
[test_title.html]
[test_treewalker_nextsibling.xml]
[test_url.html]
[test_url_data.html]
[test_url_empty_port.html]
[test_url_malformedHost.html]
[test_urlExceptions.html]
[test_urlSearchParams.html]
[test_urlSearchParams_utf8.html]
[test_urlutils_stringify.html]
[test_user_select.html]
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android'
[test_viewport_scroll.html]
[test_viewsource_forbidden_in_object.html]
[test_w3element_traversal.html]
[test_w3element_traversal.xhtml]
[test_w3element_traversal_svg.html]
[test_warning_for_blocked_cross_site_request.html]
[test_webaudioNotification.html]
tags = audiochannel
skip-if = buildapp == 'mulet'
[test_webaudioNotificationStopOnNavigation.html]
tags = audiochannel
skip-if = buildapp == 'mulet'
[test_websocket_basic.html]
skip-if = buildapp == 'b2g' || toolkit == 'android'
[test_websocket_hello.html]
skip-if = buildapp == 'b2g' || toolkit == 'android'
[test_websocket_permessage_deflate.html]
skip-if = buildapp == 'b2g' || toolkit == 'android'
[test_websocket1.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' # TC: Bug 1144079 - Re-enable Mulet mochitests and reftests taskcluster-specific disables.
[test_websocket2.html]
@ -835,70 +865,41 @@ skip-if = buildapp == 'b2g' || toolkit == 'android' # TC: Bug 1144079 - Re-enabl
skip-if = buildapp == 'b2g' || toolkit == 'android' # TC: Bug 1144079 - Re-enable Mulet mochitests and reftests taskcluster-specific disables.
[test_websocket5.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' # TC: Bug 1144079 - Re-enable Mulet mochitests and reftests taskcluster-specific disables.
[test_websocket_basic.html]
skip-if = buildapp == 'b2g' || toolkit == 'android'
[test_websocket_hello.html]
skip-if = buildapp == 'b2g' || toolkit == 'android'
[test_websocket_permessage_deflate.html]
skip-if = buildapp == 'b2g' || toolkit == 'android'
[test_window_constructor.html]
[test_window_cross_origin_props.html]
[test_window_define_nonconfigurable.html]
skip-if = release_build
[test_window_define_symbol.html]
[test_window_element_enumeration.html]
[test_window_enumeration.html]
[test_window_extensible.html]
[test_window_indexing.html]
[test_window_named_frame_enumeration.html]
[test_window_orientation.html]
skip-if = toolkit != 'gonk'
[test_window_proto.html]
[test_writable-replaceable.html]
[test_x-frame-options.html]
[test_xbl_userdata.xhtml]
[test_XHR.html]
[test_xhr_abort_after_load.html]
skip-if = toolkit == 'android'
[test_XHR_anon.html]
[test_xhr_forbidden_headers.html]
[test_XHR_header.html]
[test_XHR_onuploadprogress.html]
[test_XHR_parameters.html]
skip-if = buildapp == 'b2g' # b2g(86 total, 4 failing - testing mozAnon - got false, expected true) b2g-debug(86 total, 4 failing - testing mozAnon - got false, expected true) b2g-desktop(86 total, 4 failing - testing mozAnon - got false, expected true)
[test_xhr_progressevents.html]
skip-if = toolkit == 'android'
[test_xhr_send.html]
[test_xhr_send_readystate.html]
[test_XHR_system.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(12 total, 2 failing - .mozSystem == true - got false, expected true + ) b2g-desktop(12 total, 2 failing - .mozSystem == true - got false, expected true + )
[test_XHR_timeout.html]
skip-if = buildapp == 'b2g' || (android_version == '18' && debug) # b2g(flaky on B2G, bug 960743) b2g-debug(flaky on B2G, bug 960743) b2g-desktop(flaky on B2G, bug 960743)
support-files = test_XHR_timeout.js
[test_xhr_withCredentials.html]
[test_file_from_blob.html]
[test_warning_for_blocked_cross_site_request.html]
[test_bug444546.html]
disabled = Disabled for now. Mochitest isn't reliable enough for these.
support-files = bug444546.sjs
[test_bug503473.html]
disabled = Disabled due to making the harness time out
support-files = file_bug503473-frame.sjs
[test_bug1025933.html]
[test_bug1037687.html]
[test_element.matches.html]
[test_user_select.html]
skip-if = buildapp == 'mulet' || buildapp == 'b2g' || toolkit == 'android'
[test_bug1081686.html]
skip-if = buildapp == 'b2g' || toolkit == 'android'
[test_window_define_nonconfigurable.html]
skip-if = release_build
[test_root_iframe.html]
[test_performance_observer.html]
[test_performance_user_timing.html]
[test_bug1126851.html]
skip-if = buildapp == 'b2g'
[test_bug1118689.html]
skip-if = buildapp == 'b2g'
[test_integer_attr_with_leading_zero.html]
[test_getAttribute_after_createAttribute.html]
[test_script_loader_crossorigin_data_url.html]
[test_file_negative_date.html]
[test_nonascii_blob_url.html]
[test_window_element_enumeration.html]
[test_referrer_redirect.html]
[test_postMessages.html]
support-files = worker_postMessages.js
[test_window_proto.html]
[test_frameLoader_switchProcess.html]
skip-if = e10s || os != 'linux' || buildapp != 'browser'
[test_explicit_user_agent.html]
[test_change_policy.html]
skip-if = buildapp == 'b2g' #no ssl support
[test_document.all_iteration.html]
[test_bug1198095.html]
[test_bug1187157.html]
[test_bug769117.html]
[test_bug1250148.html]
[test_bug1240471.html]
[test_mozbrowser_apis_allowed.html]
[test_mozbrowser_apis_blocked.html]
[test_document_register.html]
[test_bug962251.html]
[test_bug1259588.html]
[test_bug1263696.html]
[test_XHRDocURI.html]
[test_XHRResponseURL.html]
[test_XHRSendData.html]

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

@ -0,0 +1,31 @@
var { classes: Cc, interfaces: Ci, utils: Cu } = Components;
Cu.importGlobalProperties(["File"]);
var tmpFile;
function writeFile(text, answer) {
var stream = Cc["@mozilla.org/network/file-output-stream;1"]
.createInstance(Ci.nsIFileOutputStream);
stream.init(tmpFile, 0x02 | 0x08 | 0x10, 0o600, 0);
stream.write(text, text.length);
stream.close();
sendAsyncMessage(answer, {
file: new File(tmpFile)
});
}
addMessageListener("file.open", function (e) {
tmpFile = Cc["@mozilla.org/file/directory_service;1"]
.getService(Ci.nsIDirectoryService)
.QueryInterface(Ci.nsIProperties)
.get('TmpD', Ci.nsIFile)
tmpFile.append('foo.txt');
tmpFile.createUnique(Ci.nsIFile.FILE_TYPE, 0o600);
writeFile("hello world", "file.opened");
});
addMessageListener("file.change", function (e) {
writeFile("hello world---------------", "file.changed");
});

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

@ -0,0 +1,88 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>Test - bug 1238440</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<input type="file" id="file" />
<script type="application/javascript">
var script;
function step_createScript() {
info("Creating script...");
var url = SimpleTest.getTestFileURL("script_bug1238440.js");
script = SpecialPowers.loadChromeScript(url);
next();
}
function step_destroyScript() {
info("Destroying script...");
script.destroy();
next();
}
function step_createFile() {
info("Creating file...");
function onOpened(message) {
var fileList = document.getElementById('file');
SpecialPowers.wrap(fileList).mozSetFileArray([message.file]);
ok(!!message.file, "File created and set");
next();
}
script.addMessageListener("file.opened", onOpened);
script.sendAsyncMessage("file.open");
}
function step_changeFile() {
info("Changing file...");
script.addMessageListener("file.changed", next);
script.sendAsyncMessage("file.change");
}
function step_fileReader(status) {
var fr = new FileReader();
fr.onload = function() {
is(status, true, "onload called!");
next();
}
fr.onerror = function(e) {
e.preventDefault();
is(status, false, "onerror called!");
next();
}
fr.readAsArrayBuffer(document.getElementById("file").files[0]);
}
var steps = [
step_createScript,
step_createFile,
function() { step_fileReader(true); },
step_changeFile,
function() { step_fileReader(false); },
step_destroyScript,
];
function next() {
if (!steps.length) {
SimpleTest.finish();
return;
}
var step = steps.shift();
step();
}
SimpleTest.waitForExplicitFinish();
next();
</script>
</body>
</html>

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

@ -1439,6 +1439,11 @@ DOMInterfaces = {
'headerFile': 'WebGLExtensions.h'
},
'EXT_color_buffer_float': {
'nativeType': 'mozilla::WebGLExtensionEXTColorBufferFloat',
'headerFile': 'WebGLExtensions.h'
},
'WEBGL_draw_buffers': {
'nativeType': 'mozilla::WebGLExtensionDrawBuffers',
'headerFile': 'WebGLExtensions.h'

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

@ -10975,15 +10975,11 @@ class CGDOMJSProxyHandler_getOwnPropDescriptor(ClassMethod):
if self.descriptor.supportsNamedProperties():
operations = self.descriptor.operations
readonly = toStringBool(operations['NamedSetter'] is None)
enumerable = (
"self->NameIsEnumerable(Constify(%s))" %
# First [0] means first (and only) signature, [1] means
# "arguments" as opposed to return type, [0] means first (and
# only) argument.
operations['NamedGetter'].signatures()[0][1][0].identifier.name)
fillDescriptor = (
"FillPropertyDescriptor(desc, proxy, %s, %s);\n"
"return true;\n" % (readonly, enumerable))
"return true;\n" %
(readonly,
toStringBool(self.descriptor.namedPropertiesEnumerable)))
templateValues = {'jsvalRef': 'desc.value()', 'jsvalHandle': 'desc.value()',
'obj': 'proxy', 'successCode': fillDescriptor}
@ -11299,14 +11295,17 @@ class CGDOMJSProxyHandler_ownPropNames(ClassMethod):
shadow = "false"
addNames = fill(
"""
nsTArray<nsString> names;
UnwrapProxy(proxy)->GetSupportedNames(flags, names);
UnwrapProxy(proxy)->GetSupportedNames(names);
if (!AppendNamedPropertyIds(cx, proxy, names, ${shadow}, props)) {
return false;
}
""",
shadow=shadow)
if not self.descriptor.namedPropertiesEnumerable:
addNames = CGIfWrapper(CGGeneric(addNames),
"flags & JSITER_HIDDEN").define()
addNames = "\n" + addNames
else:
addNames = ""
@ -14127,7 +14126,7 @@ class CGBindingImplClass(CGClass):
[]),
{"infallible": True}))
# And if we support named properties we need to be able to
# enumerate the supported names and test whether they're enumerable.
# enumerate the supported names.
if descriptor.supportsNamedProperties():
self.methodDecls.append(
CGNativeMember(
@ -14135,20 +14134,7 @@ class CGBindingImplClass(CGClass):
"GetSupportedNames",
(IDLSequenceType(None,
BuiltinTypes[IDLBuiltinType.Types.domstring]),
# Let's use unsigned long for the type here, though really
# it's just a C++ "unsigned"...
[FakeArgument(BuiltinTypes[IDLBuiltinType.Types.unsigned_long],
FakeMember(),
name="aFlags")]),
{"infallible": True}))
self.methodDecls.append(
CGNativeMember(
descriptor, FakeMember(),
"NameIsEnumerable",
(BuiltinTypes[IDLBuiltinType.Types.boolean],
[FakeArgument(BuiltinTypes[IDLBuiltinType.Types.domstring],
FakeMember(),
name="aName")]),
[]),
{"infallible": True}))
wrapArgs = [Argument('JSContext*', 'aCx'),

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

@ -810,6 +810,20 @@ class Descriptor(DescriptorProvider):
return (self.interface.getExtendedAttribute("Global") or
self.interface.getExtendedAttribute("PrimaryGlobal"))
@property
def namedPropertiesEnumerable(self):
"""
Returns whether this interface should have enumerable named properties
"""
assert self.proxy
assert self.supportsNamedProperties()
iface = self.interface
while iface:
if iface.getExtendedAttribute("LegacyUnenumerableNamedProperties"):
return False
iface = iface.parent
return True
# Some utility methods
def getTypesFromDescriptor(descriptor):

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

@ -1078,6 +1078,23 @@ class IDLInterface(IDLObjectWithScope, IDLExposureMixins):
specialMembersSeen[memberType] = member
if self.getExtendedAttribute("LegacyUnenumerableNamedProperties"):
# Check that we have a named getter.
if "named getters" not in specialMembersSeen:
raise WebIDLError(
"Interface with [LegacyUnenumerableNamedProperties] does "
"not have a named getter",
[self.location])
ancestor = self.parent
while ancestor:
if ancestor.getExtendedAttribute("LegacyUnenumerableNamedProperties"):
raise WebIDLError(
"Interface with [LegacyUnenumerableNamedProperties] "
"inherits from another interface with "
"[LegacyUnenumerableNamedProperties]",
[self.location, ancestor.location])
ancestor = ancestor.parent
if self._isOnGlobalProtoChain:
# Make sure we have no named setters, creators, or deleters
for memberType in ["setter", "creator", "deleter"]:
@ -1465,6 +1482,7 @@ class IDLInterface(IDLObjectWithScope, IDLExposureMixins):
identifier == "UnsafeInPrerendering" or
identifier == "LegacyEventInit" or
identifier == "ProbablyShortLivingObject" or
identifier == "LegacyUnenumerableNamedProperties" or
identifier == "NonOrdinaryGetPrototypeOf"):
# Known extended attributes that do not take values
if not attr.noArguments():

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

@ -0,0 +1,64 @@
def WebIDLTest(parser, harness):
parser.parse(
"""
interface Foo {};
[LegacyUnenumerableNamedProperties]
interface Bar : Foo {
getter long(DOMString name);
};
interface Baz : Bar {
getter long(DOMString name);
};
""");
results = parser.finish();
harness.check(len(results), 3, "Should have three interfaces")
parser = parser.reset()
threw = False
try:
parser.parse("""
[LegacyUnenumerableNamedProperties]
interface NoNamedGetter {
};
""")
results = parser.finish()
except Exception, x:
threw = True
harness.ok(threw, "Should have thrown.")
parser = parser.reset()
threw = False
try:
parser.parse("""
[LegacyUnenumerableNamedProperties=Foo]
interface ShouldNotHaveArg {
getter long(DOMString name);
};
""")
results = parser.finish()
except Exception, x:
threw = True
harness.ok(threw, "Should have thrown.")
parser = parser.reset()
threw = False
try:
parser.parse("""
[LegacyUnenumerableNamedProperties]
interface Foo {
getter long(DOMString name);
};
interface Bar : Foo {};
[LegacyUnenumerableNamedProperties]
interface Baz : Bar {
getter long(DOMString name);
};
""")
results = parser.finish()
except Exception, x:
threw = True
harness.ok(threw, "Should have thrown.")

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

@ -1137,8 +1137,7 @@ public:
virtual nsISupports* GetParentObject();
void NamedGetter(const nsAString&, bool&, nsAString&);
bool NameIsEnumerable(const nsAString&);
void GetSupportedNames(unsigned, nsTArray<nsString>&);
void GetSupportedNames(nsTArray<nsString>&);
};
class TestIndexedGetterAndSetterAndNamedGetterInterface : public nsISupports,
@ -1151,8 +1150,7 @@ public:
virtual nsISupports* GetParentObject();
void NamedGetter(const nsAString&, bool&, nsAString&);
bool NameIsEnumerable(const nsAString&);
void GetSupportedNames(unsigned, nsTArray<nsString>&);
void GetSupportedNames(nsTArray<nsString>&);
int32_t IndexedGetter(uint32_t, bool&);
void IndexedSetter(uint32_t, int32_t);
uint32_t Length();
@ -1169,10 +1167,9 @@ public:
uint32_t IndexedGetter(uint32_t, bool&);
void NamedGetter(const nsAString&, bool&, nsAString&);
bool NameIsEnumerable(const nsAString&);
void NamedItem(const nsAString&, nsAString&);
uint32_t Length();
void GetSupportedNames(unsigned, nsTArray<nsString>&);
void GetSupportedNames(nsTArray<nsString>&);
};
class TestIndexedSetterInterface : public nsISupports,
@ -1201,8 +1198,7 @@ public:
void NamedSetter(const nsAString&, TestIndexedSetterInterface&);
TestIndexedSetterInterface* NamedGetter(const nsAString&, bool&);
bool NameIsEnumerable(const nsAString&);
void GetSupportedNames(unsigned, nsTArray<nsString>&);
void GetSupportedNames(nsTArray<nsString>&);
};
class TestIndexedAndNamedSetterInterface : public nsISupports,
@ -1219,9 +1215,8 @@ public:
uint32_t Length();
void NamedSetter(const nsAString&, TestIndexedSetterInterface&);
TestIndexedSetterInterface* NamedGetter(const nsAString&, bool&);
bool NameIsEnumerable(const nsAString&);
void SetNamedItem(const nsAString&, TestIndexedSetterInterface&);
void GetSupportedNames(unsigned, nsTArray<nsString>&);
void GetSupportedNames(nsTArray<nsString>&);
};
class TestIndexedAndNamedGetterAndSetterInterface : public TestIndexedSetterInterface
@ -1230,14 +1225,13 @@ public:
uint32_t IndexedGetter(uint32_t, bool&);
uint32_t Item(uint32_t);
void NamedGetter(const nsAString&, bool&, nsAString&);
bool NameIsEnumerable(const nsAString&);
void NamedItem(const nsAString&, nsAString&);
void IndexedSetter(uint32_t, int32_t&);
void IndexedSetter(uint32_t, const nsAString&) = delete;
void NamedSetter(const nsAString&, const nsAString&);
void Stringify(nsAString&);
uint32_t Length();
void GetSupportedNames(unsigned, nsTArray<nsString>&);
void GetSupportedNames(nsTArray<nsString>&);
};
class TestCppKeywordNamedMethodsInterface : public nsISupports,
@ -1299,8 +1293,7 @@ public:
void NamedDeleter(const nsAString&, bool&);
long NamedGetter(const nsAString&, bool&);
bool NameIsEnumerable(const nsAString&);
void GetSupportedNames(unsigned, nsTArray<nsString>&);
void GetSupportedNames(nsTArray<nsString>&);
};
class TestNamedDeleterWithRetvalInterface : public nsISupports,
@ -1315,10 +1308,9 @@ public:
bool NamedDeleter(const nsAString&, bool&);
bool NamedDeleter(const nsAString&) = delete;
long NamedGetter(const nsAString&, bool&);
bool NameIsEnumerable(const nsAString&);
bool DelNamedItem(const nsAString&);
bool DelNamedItem(const nsAString&, bool&) = delete;
void GetSupportedNames(unsigned, nsTArray<nsString>&);
void GetSupportedNames(nsTArray<nsString>&);
};
class TestIndexedAndNamedDeleterInterface : public nsISupports,
@ -1337,10 +1329,9 @@ public:
void NamedDeleter(const nsAString&, bool&);
void NamedDeleter(const nsAString&) = delete;
long NamedGetter(const nsAString&, bool&);
bool NameIsEnumerable(const nsAString&);
void DelNamedItem(const nsAString&);
void DelNamedItem(const nsAString&, bool&) = delete;
void GetSupportedNames(unsigned, nsTArray<nsString>&);
void GetSupportedNames(nsTArray<nsString>&);
};
class TestParentInterface : public nsISupports,

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

@ -239,10 +239,10 @@ CameraRecorderProfiles::~CameraRecorderProfiles()
}
void
CameraRecorderProfiles::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames)
CameraRecorderProfiles::GetSupportedNames(nsTArray<nsString>& aNames)
{
DOM_CAMERA_LOGT("%s:%d : this=%p, flags=0x%x\n",
__func__, __LINE__, this, aFlags);
DOM_CAMERA_LOGT("%s:%d : this=%p\n",
__func__, __LINE__, this);
if (!mCameraControl) {
aNames.Clear();
return;
@ -275,15 +275,6 @@ CameraRecorderProfiles::NamedGetter(const nsAString& aName, bool& aFound)
return profile;
}
bool
CameraRecorderProfiles::NameIsEnumerable(const nsAString& aName)
{
DOM_CAMERA_LOGT("%s:%d : this=%p, name='%s' (always returns true)\n",
__func__, __LINE__, this, NS_ConvertUTF16toUTF8(aName).get());
return true;
}
void
CameraRecorderProfiles::OnHardwareClosed()
{

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

@ -161,8 +161,7 @@ public:
virtual JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) override;
CameraRecorderProfile* NamedGetter(const nsAString& aName, bool& aFound);
bool NameIsEnumerable(const nsAString& aName);
void GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames);
void GetSupportedNames(nsTArray<nsString>& aNames);
virtual void OnHardwareClosed();

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

@ -71,7 +71,7 @@ static const gl::GLFeature kRequiredFeatures[] = {
gl::GLFeature::gpu_shader4,
gl::GLFeature::instanced_arrays,
gl::GLFeature::instanced_non_arrays,
gl::GLFeature::map_buffer_range,
gl::GLFeature::map_buffer_range, // Used by GetBufferSubData.
gl::GLFeature::occlusion_query2,
gl::GLFeature::packed_depth_stencil,
gl::GLFeature::query_objects,
@ -85,7 +85,6 @@ static const gl::GLFeature kRequiredFeatures[] = {
gl::GLFeature::texture_3D_compressed,
gl::GLFeature::texture_3D_copy,
gl::GLFeature::texture_float,
gl::GLFeature::texture_float_linear,
gl::GLFeature::texture_half_float,
gl::GLFeature::texture_half_float_linear,
gl::GLFeature::texture_non_power_of_two,

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

@ -32,6 +32,7 @@ WebGLContext::GetExtensionString(WebGLExtensionID ext)
WEBGL_EXTENSION_IDENTIFIER(ANGLE_instanced_arrays)
WEBGL_EXTENSION_IDENTIFIER(EXT_blend_minmax)
WEBGL_EXTENSION_IDENTIFIER(EXT_color_buffer_float)
WEBGL_EXTENSION_IDENTIFIER(EXT_color_buffer_half_float)
WEBGL_EXTENSION_IDENTIFIER(EXT_frag_depth)
WEBGL_EXTENSION_IDENTIFIER(EXT_shader_texture_lod)
@ -119,8 +120,6 @@ WebGLContext::IsExtensionSupported(WebGLExtensionID ext) const
// OES_
case WebGLExtensionID::OES_texture_float_linear:
return gl->IsSupported(gl::GLFeature::texture_float_linear);
case WebGLExtensionID::OES_texture_half_float_linear:
return gl->IsSupported(gl::GLFeature::texture_half_float_linear);
// WEBGL_
case WebGLExtensionID::WEBGL_color_buffer_float:
@ -151,7 +150,18 @@ WebGLContext::IsExtensionSupported(WebGLExtensionID ext) const
break;
}
if (!IsWebGL2()) {
if (IsWebGL2()) {
// WebGL2-only extensions
switch (ext) {
// EXT_
case WebGLExtensionID::EXT_color_buffer_float:
return WebGLExtensionEXTColorBufferFloat::IsSupported(this);
default:
// For warnings-as-errors.
break;
}
} else {
// WebGL1-only extensions
switch (ext) {
// ANGLE_
@ -177,6 +187,8 @@ WebGLContext::IsExtensionSupported(WebGLExtensionID ext) const
return WebGLExtensionTextureFloat::IsSupported(this);
case WebGLExtensionID::OES_texture_half_float:
return WebGLExtensionTextureHalfFloat::IsSupported(this);
case WebGLExtensionID::OES_texture_half_float_linear:
return gl->IsSupported(gl::GLFeature::texture_half_float_linear);
case WebGLExtensionID::OES_vertex_array_object:
return true;
@ -331,6 +343,9 @@ WebGLContext::EnableExtension(WebGLExtensionID ext)
case WebGLExtensionID::EXT_blend_minmax:
obj = new WebGLExtensionBlendMinMax(this);
break;
case WebGLExtensionID::EXT_color_buffer_float:
obj = new WebGLExtensionEXTColorBufferFloat(this);
break;
case WebGLExtensionID::EXT_color_buffer_half_float:
obj = new WebGLExtensionColorBufferHalfFloat(this);
break;

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

@ -0,0 +1,51 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "WebGLExtensions.h"
#include "GLContext.h"
#include "mozilla/dom/WebGL2RenderingContextBinding.h"
#include "WebGLContext.h"
#include "WebGLFormats.h"
namespace mozilla {
WebGLExtensionEXTColorBufferFloat::WebGLExtensionEXTColorBufferFloat(WebGLContext* webgl)
: WebGLExtensionBase(webgl)
{
MOZ_ASSERT(IsSupported(webgl), "Don't construct extension if unsupported.");
auto& fua = webgl->mFormatUsage;
auto fnUpdateUsage = [&fua](GLenum sizedFormat, webgl::EffectiveFormat effFormat) {
auto usage = fua->EditUsage(effFormat);
usage->isRenderable = true;
fua->AllowRBFormat(sizedFormat, usage);
};
#define FOO(x) fnUpdateUsage(LOCAL_GL_ ## x, webgl::EffectiveFormat::x)
FOO(R16F);
FOO(RG16F);
FOO(RGBA16F);
FOO(R32F);
FOO(RG32F);
FOO(RGBA32F);
FOO(R11F_G11F_B10F);
#undef FOO
}
/*static*/ bool
WebGLExtensionEXTColorBufferFloat::IsSupported(const WebGLContext* webgl)
{
const gl::GLContext* gl = webgl->GL();
return gl->IsSupported(gl::GLFeature::EXT_color_buffer_float);
}
IMPL_WEBGL_EXTENSION_GOOP(WebGLExtensionEXTColorBufferFloat, EXT_color_buffer_float)
} // namespace mozilla

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

@ -153,6 +153,18 @@ public:
DECL_WEBGL_EXTENSION_GOOP
};
class WebGLExtensionEXTColorBufferFloat
: public WebGLExtensionBase
{
public:
explicit WebGLExtensionEXTColorBufferFloat(WebGLContext*);
virtual ~WebGLExtensionEXTColorBufferFloat() { }
static bool IsSupported(const WebGLContext*);
DECL_WEBGL_EXTENSION_GOOP
};
class WebGLExtensionFragDepth
: public WebGLExtensionBase
{

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

@ -10,6 +10,7 @@
#include "mozilla/dom/WebGL2RenderingContextBinding.h"
#include "mozilla/dom/WebGLRenderingContextBinding.h"
#include "mozilla/RefPtr.h"
#include "nsPrintfCString.h"
#include "WebGLActiveInfo.h"
#include "WebGLContext.h"
#include "WebGLShader.h"

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

@ -139,6 +139,7 @@ enum class WebGLTexDimensions : uint8_t {
enum class WebGLExtensionID : uint8_t {
ANGLE_instanced_arrays,
EXT_blend_minmax,
EXT_color_buffer_float,
EXT_color_buffer_half_float,
EXT_frag_depth,
EXT_sRGB,

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

@ -112,6 +112,7 @@ UNIFIED_SOURCES += [
'WebGLExtensionDisjointTimerQuery.cpp',
'WebGLExtensionDrawBuffers.cpp',
'WebGLExtensionElementIndexUint.cpp',
'WebGLExtensionEXTColorBufferFloat.cpp',
'WebGLExtensionFragDepth.cpp',
'WebGLExtensionInstancedArrays.cpp',
'WebGLExtensionLoseContext.cpp',

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

@ -43,7 +43,7 @@ NS_INTERFACE_MAP_END_INHERITING(MouseEvent)
uint32_t
SimpleGestureEvent::AllowedDirections()
{
return mEvent->AsSimpleGestureEvent()->allowedDirections;
return mEvent->AsSimpleGestureEvent()->mAllowedDirections;
}
NS_IMETHODIMP
@ -57,14 +57,14 @@ SimpleGestureEvent::GetAllowedDirections(uint32_t* aAllowedDirections)
NS_IMETHODIMP
SimpleGestureEvent::SetAllowedDirections(uint32_t aAllowedDirections)
{
mEvent->AsSimpleGestureEvent()->allowedDirections = aAllowedDirections;
mEvent->AsSimpleGestureEvent()->mAllowedDirections = aAllowedDirections;
return NS_OK;
}
uint32_t
SimpleGestureEvent::Direction()
{
return mEvent->AsSimpleGestureEvent()->direction;
return mEvent->AsSimpleGestureEvent()->mDirection;
}
NS_IMETHODIMP
@ -78,7 +78,7 @@ SimpleGestureEvent::GetDirection(uint32_t* aDirection)
double
SimpleGestureEvent::Delta()
{
return mEvent->AsSimpleGestureEvent()->delta;
return mEvent->AsSimpleGestureEvent()->mDelta;
}
NS_IMETHODIMP
@ -92,7 +92,7 @@ SimpleGestureEvent::GetDelta(double* aDelta)
uint32_t
SimpleGestureEvent::ClickCount()
{
return mEvent->AsSimpleGestureEvent()->clickCount;
return mEvent->AsSimpleGestureEvent()->mClickCount;
}
NS_IMETHODIMP
@ -131,10 +131,10 @@ SimpleGestureEvent::InitSimpleGestureEvent(const nsAString& aTypeArg,
aMetaKeyArg, aButton, aRelatedTarget);
WidgetSimpleGestureEvent* simpleGestureEvent = mEvent->AsSimpleGestureEvent();
simpleGestureEvent->allowedDirections = aAllowedDirectionsArg;
simpleGestureEvent->direction = aDirectionArg;
simpleGestureEvent->delta = aDeltaArg;
simpleGestureEvent->clickCount = aClickCountArg;
simpleGestureEvent->mAllowedDirections = aAllowedDirectionsArg;
simpleGestureEvent->mDirection = aDirectionArg;
simpleGestureEvent->mDelta = aDeltaArg;
simpleGestureEvent->mClickCount = aClickCountArg;
}
} // namespace dom

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

@ -139,7 +139,7 @@ skip-if = buildapp == 'b2g' # b2g(failing when the test gets moved around, and o
[test_bug946632.html]
skip-if = buildapp == 'b2g' || (e10s && os == "mac") # bug 1252273
[test_bug967796.html]
skip-if = toolkit == "gonk" || e10s
skip-if = toolkit == "gonk" || e10s # bug 1251659
[test_bug985988.html]
[test_bug998809.html]
[test_bug1017086_disable.html]

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

@ -160,12 +160,8 @@ HTMLAllCollection::NamedGetter(const nsAString& aID,
}
void
HTMLAllCollection::GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames)
HTMLAllCollection::GetSupportedNames(nsTArray<nsString>& aNames)
{
if (!(aFlags & JSITER_HIDDEN)) {
return;
}
// XXXbz this is very similar to nsContentList::GetSupportedNames,
// but has to check IsAllNamedElement for the name case.
AutoTArray<nsIAtom*, 8> atoms;

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

@ -62,11 +62,7 @@ public:
void NamedGetter(const nsAString& aName,
bool& aFound,
Nullable<OwningNodeOrHTMLCollection>& aResult);
void GetSupportedNames(unsigned aFlags, nsTArray<nsString>& aNames);
bool NameIsEnumerable(const nsAString& aName)
{
return false;
}
void GetSupportedNames(nsTArray<nsString>& aNames);
void LegacyCall(JS::Handle<JS::Value>, const nsAString& aName,
Nullable<OwningNodeOrHTMLCollection>& aResult)
{

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

@ -390,13 +390,8 @@ HTMLFormControlsCollection::NamedGetter(const nsAString& aName,
}
void
HTMLFormControlsCollection::GetSupportedNames(unsigned aFlags,
nsTArray<nsString>& aNames)
HTMLFormControlsCollection::GetSupportedNames(nsTArray<nsString>& aNames)
{
if (!(aFlags & JSITER_HIDDEN)) {
return;
}
FlushPendingNotifications();
// Just enumerate mNameLookupTable. This won't guarantee order, but
// that's OK, because the HTML5 spec doesn't define an order for

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

@ -53,8 +53,7 @@ public:
bool dummy;
NamedGetter(aName, dummy, aResult);
}
virtual void GetSupportedNames(unsigned aFlags,
nsTArray<nsString>& aNames) override;
virtual void GetSupportedNames(nsTArray<nsString>& aNames) override;
nsresult AddElementToTable(nsGenericHTMLFormElement* aChild,
const nsAString& aName);

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

@ -1538,14 +1538,8 @@ HTMLFormElement::NamedGetter(const nsAString& aName, bool &aFound)
return nullptr;
}
bool
HTMLFormElement::NameIsEnumerable(const nsAString& aName)
{
return true;
}
void
HTMLFormElement::GetSupportedNames(unsigned, nsTArray<nsString >& aRetval)
HTMLFormElement::GetSupportedNames(nsTArray<nsString >& aRetval)
{
// TODO https://www.w3.org/Bugs/Public/show_bug.cgi?id=22320
}

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

@ -393,9 +393,7 @@ public:
already_AddRefed<nsISupports>
NamedGetter(const nsAString& aName, bool &aFound);
bool NameIsEnumerable(const nsAString& aName);
void GetSupportedNames(unsigned, nsTArray<nsString >& aRetval);
void GetSupportedNames(nsTArray<nsString>& aRetval);
static int32_t
CompareFormControlPosition(Element* aElement1, Element* aElement2,

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

@ -1908,6 +1908,14 @@ public:
mElement->AddDecoderPrincipalChangeObserver(this);
}
void Destroy() override
{
MOZ_ASSERT(mElement);
DebugOnly<bool> res = mElement->RemoveDecoderPrincipalChangeObserver(this);
NS_ASSERTION(res, "Removing decoder principal changed observer failed. "
"Had it already been removed?");
}
MediaSourceEnum GetMediaSource() const override
{
return MediaSourceEnum::Other;
@ -1944,11 +1952,6 @@ public:
protected:
virtual ~CaptureStreamTrackSource()
{
if (mElement) {
DebugOnly<bool> res = mElement->RemoveDecoderPrincipalChangeObserver(this);
NS_ASSERTION(res, "Removing decoder principal changed observer failed. "
"Had it already been removed?");
}
}
RefPtr<HTMLMediaElement> mElement;

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

@ -280,13 +280,8 @@ HTMLOptionsCollection::NamedItem(const nsAString& aName,
}
void
HTMLOptionsCollection::GetSupportedNames(unsigned aFlags,
nsTArray<nsString>& aNames)
HTMLOptionsCollection::GetSupportedNames(nsTArray<nsString>& aNames)
{
if (!(aFlags & JSITER_HIDDEN)) {
return;
}
AutoTArray<nsIAtom*, 8> atoms;
for (uint32_t i = 0; i < mElements.Length(); ++i) {
HTMLOptionElement* content = mElements.ElementAt(i);

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

@ -154,8 +154,7 @@ public:
{
aError = SetOption(aIndex, aOption);
}
virtual void GetSupportedNames(unsigned aFlags,
nsTArray<nsString>& aNames) override;
virtual void GetSupportedNames(nsTArray<nsString>& aNames) override;
private:
/** The list of options (holds strong references). This is infallible, so

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

@ -288,7 +288,7 @@ HTMLPropertiesCollection::CrawlSubtree(Element* aElement)
}
void
HTMLPropertiesCollection::GetSupportedNames(unsigned, nsTArray<nsString>& aNames)
HTMLPropertiesCollection::GetSupportedNames(nsTArray<nsString>& aNames)
{
EnsureFresh();
mNames->CopyList(aNames);

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

@ -90,17 +90,12 @@ public:
aFound = IsSupportedNamedProperty(aName);
return aFound ? NamedItem(aName) : nullptr;
}
bool NameIsEnumerable(const nsAString& aName)
{
return true;
}
DOMStringList* Names()
{
EnsureFresh();
return mNames;
}
virtual void GetSupportedNames(unsigned,
nsTArray<nsString>& aNames) override;
virtual void GetSupportedNames(nsTArray<nsString>& aNames) override;
NS_DECL_NSIDOMHTMLCOLLECTION

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

@ -41,8 +41,7 @@ public:
virtual Element*
GetFirstNamedElement(const nsAString& aName, bool& aFound) override;
virtual void GetSupportedNames(unsigned aFlags,
nsTArray<nsString>& aNames) override;
virtual void GetSupportedNames(nsTArray<nsString>& aNames) override;
NS_IMETHOD ParentDestroyed();
@ -236,18 +235,13 @@ TableRowsCollection::GetFirstNamedElement(const nsAString& aName, bool& aFound)
}
void
TableRowsCollection::GetSupportedNames(unsigned aFlags,
nsTArray<nsString>& aNames)
TableRowsCollection::GetSupportedNames(nsTArray<nsString>& aNames)
{
if (!(aFlags & JSITER_HIDDEN)) {
return;
}
DO_FOR_EACH_ROWGROUP(
nsTArray<nsString> names;
nsCOMPtr<nsIHTMLCollection> coll = do_QueryInterface(rows);
if (coll) {
coll->GetSupportedNames(aFlags, names);
coll->GetSupportedNames(names);
for (uint32_t i = 0; i < names.Length(); ++i) {
if (!aNames.Contains(names[i])) {
aNames.AppendElement(names[i]);

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

@ -89,12 +89,6 @@ nsDOMStringMap::NamedGetter(const nsAString& aProp, bool& found,
found = mElement->GetAttr(attr, aResult);
}
bool
nsDOMStringMap::NameIsEnumerable(const nsAString& aName)
{
return true;
}
void
nsDOMStringMap::NamedSetter(const nsAString& aProp,
const nsAString& aValue,
@ -149,7 +143,7 @@ nsDOMStringMap::NamedDeleter(const nsAString& aProp, bool& found)
}
void
nsDOMStringMap::GetSupportedNames(unsigned, nsTArray<nsString>& aNames)
nsDOMStringMap::GetSupportedNames(nsTArray<nsString>& aNames)
{
uint32_t attrCount = mElement->GetAttrCount();

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

@ -42,8 +42,7 @@ public:
void NamedSetter(const nsAString& aProp, const nsAString& aValue,
mozilla::ErrorResult& rv);
void NamedDeleter(const nsAString& aProp, bool &found);
bool NameIsEnumerable(const nsAString& aName);
void GetSupportedNames(unsigned, nsTArray<nsString>& aNames);
void GetSupportedNames(nsTArray<nsString>& aNames);
js::ExpandoAndGeneration mExpandoAndGeneration;

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

@ -2325,14 +2325,8 @@ nsHTMLDocument::NamedGetter(JSContext* cx, const nsAString& aName, bool& aFound,
aRetval.set(&val.toObject());
}
bool
nsHTMLDocument::NameIsEnumerable(const nsAString& aName)
{
return true;
}
void
nsHTMLDocument::GetSupportedNames(unsigned, nsTArray<nsString>& aNames)
nsHTMLDocument::GetSupportedNames(nsTArray<nsString>& aNames)
{
for (auto iter = mIdentifierMap.Iter(); !iter.Done(); iter.Next()) {
nsIdentifierMapEntry* entry = iter.Get();

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

@ -174,8 +174,7 @@ public:
void NamedGetter(JSContext* cx, const nsAString& aName, bool& aFound,
JS::MutableHandle<JSObject*> aRetval,
mozilla::ErrorResult& rv);
bool NameIsEnumerable(const nsAString& aName);
void GetSupportedNames(unsigned, nsTArray<nsString>& aNames);
void GetSupportedNames(nsTArray<nsString>& aNames);
nsGenericHTMLElement *GetBody();
void SetBody(nsGenericHTMLElement* aBody, mozilla::ErrorResult& rv);
mozilla::dom::HTMLSharedElement *GetHead() {

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

@ -69,15 +69,10 @@ public:
{
return GetFirstNamedElement(aName, aFound);
}
bool NameIsEnumerable(const nsAString& aName)
{
return false;
}
virtual mozilla::dom::Element*
GetFirstNamedElement(const nsAString& aName, bool& aFound) = 0;
virtual void GetSupportedNames(unsigned aFlags,
nsTArray<nsString>& aNames) = 0;
virtual void GetSupportedNames(nsTArray<nsString>& aNames) = 0;
JSObject* GetWrapperPreserveColor()
{

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

@ -10,16 +10,16 @@ support-files =
[browser_bug592641.js]
[browser_bug649778.js]
skip-if = e10s # Bug ?????? - leaked until shutdown [nsGlobalWindow #16 about:blank]
skip-if = e10s # Bug 1271025
[browser_bug1081537.js]
[browser_bug1108547.js]
support-files =
file_bug1108547-1.html
file_bug1108547-2.html
file_bug1108547-3.html
[browser_content_contextmenu_userinput.js]
[browser_DOMDocElementInserted.js]
[browser_fullscreen-api-keys.js]
tags = fullscreen
[browser_fullscreen-contextmenu-esc.js]
tags = fullscreen
[browser_content_contextmenu_userinput.js]

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

@ -1781,6 +1781,17 @@ interface nsIDOMWindowUtils : nsISupports {
*/
void askPermission(in nsIContentPermissionRequest aRequest);
/**
* Number of elements restyled for the curent document.
*
* Note that during a restyle operation we may restyle an element more
* than once (e.g., for an inline that contains blocks). This also
* counts restyling of pseudo-elements and anonymous boxes.
*
* May throw NS_ERROR_NOT_AVAILABLE.
*/
readonly attribute unsigned long long elementsRestyled;
/**
* Number of frames constructed (excluding breaking) for the curent
* document.

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

@ -270,13 +270,12 @@ nsresult nsJSThunk::EvaluateScript(nsIChannel *aChannel,
options.setFileAndLine(mURL.get(), 1)
.setVersion(JSVERSION_DEFAULT);
nsJSUtils::EvaluateOptions evalOptions(cx);
evalOptions.setCoerceToString(true);
rv = nsJSUtils::EvaluateString(cx, NS_ConvertUTF8toUTF16(script),
globalJSObject, options, evalOptions, &v);
if (NS_FAILED(rv) || !(v.isString() || v.isUndefined())) {
if (NS_FAILED(rv)) {
return NS_ERROR_MALFORMED_URI;
} else if (v.isUndefined()) {
} else if (!v.isString()) {
return NS_ERROR_DOM_RETVAL_UNDEFINED;
} else {
MOZ_ASSERT(rv != NS_SUCCESS_DOM_SCRIPT_EVALUATION_THREW,

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

@ -94,7 +94,7 @@ MediaDecodeAudioDataNoAudio=The buffer passed to decodeAudioData does not contai
# LOCALIZATION NOTE: Do not translate HTMLMediaElement and createMediaElementSource.
MediaElementAudioSourceNodeCrossOrigin=The HTMLMediaElement passed to createMediaElementSource has a cross-origin resource, the node will output silence.
# LOCALIZATION NOTE: Do not translate MediaStream and createMediaStreamSource.
MediaStreamAudioSourceNodeCrossOrigin=The MediaStream passed to createMediaStreamSource has a cross-origin resource, the node it will output silence.
MediaStreamAudioSourceNodeCrossOrigin=The MediaStream passed to createMediaStreamSource has a cross-origin resource, the node will output silence.
MediaLoadExhaustedCandidates=All candidate resources failed to load. Media load paused.
MediaLoadSourceMissingSrc=<source> element has no “src” attribute. Media resource load failed.
# LOCALIZATION NOTE: %1$S is the Http error code the server returned (e.g. 404, 500, etc), %2$S is the URL of the media resource which failed to load.

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

@ -1657,19 +1657,7 @@ MediaDecoder::SetCDMProxy(CDMProxy* aProxy)
{
MOZ_ASSERT(NS_IsMainThread());
RefPtr<CDMProxy> proxy = aProxy;
{
CDMCaps::AutoLock caps(aProxy->Capabilites());
if (!caps.AreCapsKnown()) {
RefPtr<MediaDecoder> self = this;
nsCOMPtr<nsIRunnable> r = NS_NewRunnableFunction([=] () {
self->mCDMProxyPromiseHolder.ResolveIfExists(proxy, __func__);
});
caps.CallOnMainThreadWhenCapsAvailable(r);
return;
}
}
mCDMProxyPromiseHolder.ResolveIfExists(proxy, __func__);
mCDMProxyPromiseHolder.ResolveIfExists(aProxy, __func__);
}
#endif

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

@ -507,7 +507,6 @@ public:
// End the Session directly if there is no ExtractRunnable.
DoSessionEndTask(NS_OK);
}
nsContentUtils::UnregisterShutdownObserver(this);
}
nsresult Pause()
@ -581,6 +580,13 @@ private:
MOZ_COUNT_DTOR(MediaRecorder::Session);
LOG(LogLevel::Debug, ("Session.~Session (%p)", this));
CleanupStreams();
if (mReadThread) {
mReadThread->Shutdown();
mReadThread = nullptr;
// Inside the if() so that if we delete after xpcom-shutdown's Observe(), we
// won't try to remove it after the observer service is shut down.
nsContentUtils::UnregisterShutdownObserver(this);
}
}
// Pull encoded media data from MediaEncoder and put into EncodedBufferCache.
// Destroy this session object in the end of this function.
@ -880,6 +886,7 @@ private:
mReadThread->Shutdown();
mReadThread = nullptr;
}
nsContentUtils::UnregisterShutdownObserver(this);
BreakCycle();
Stop();
}

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

@ -25,7 +25,17 @@ NS_IMPL_CYCLE_COLLECTING_RELEASE(MediaStreamTrackSource)
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(MediaStreamTrackSource)
NS_INTERFACE_MAP_ENTRY(nsISupports)
NS_INTERFACE_MAP_END
NS_IMPL_CYCLE_COLLECTION(MediaStreamTrackSource, mPrincipal)
NS_IMPL_CYCLE_COLLECTION_CLASS(MediaStreamTrackSource)
NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(MediaStreamTrackSource)
tmp->Destroy();
NS_IMPL_CYCLE_COLLECTION_UNLINK(mPrincipal)
NS_IMPL_CYCLE_COLLECTION_UNLINK_END
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(MediaStreamTrackSource)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE(mPrincipal)
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
already_AddRefed<Promise>
MediaStreamTrackSource::ApplyConstraints(nsPIDOMWindowInner* aWindow,

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

@ -66,6 +66,13 @@ public:
MOZ_COUNT_CTOR(MediaStreamTrackSource);
}
/**
* Use to clean up any resources that have to be cleaned before the
* destructor is called. It is often too late in the destructor because
* of garbage collection having removed the members already.
*/
virtual void Destroy() {}
/**
* Gets the source's MediaSourceEnum for usage by PeerConnections.
*/

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

@ -205,7 +205,7 @@ already_AddRefed<SharedThreadPool> GetMediaThreadPool(MediaThreadType aType)
}
return SharedThreadPool::
Get(nsDependentCString(name),
Preferences::GetUint("media.num-decode-threads", 12));
Preferences::GetUint("media.num-decode-threads", 4));
}
bool

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

@ -302,15 +302,6 @@ CDMCallbackProxy::KeyStatusChanged(const nsCString& aSessionId,
}
}
void
CDMCallbackProxy::SetCaps(uint64_t aCaps)
{
MOZ_ASSERT(mProxy->IsOnGMPThread());
CDMCaps::AutoLock caps(mProxy->Capabilites());
caps.SetCaps(aCaps);
}
void
CDMCallbackProxy::Decrypted(uint32_t aId,
GMPErr aResult,

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

@ -47,8 +47,6 @@ public:
const nsTArray<uint8_t>& aKeyId,
GMPMediaKeyStatus aStatus) override;
void SetCaps(uint64_t aCaps) override;
void Decrypted(uint32_t aId,
GMPErr aResult,
const nsTArray<uint8_t>& aDecryptedData) override;

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

@ -13,7 +13,6 @@ namespace mozilla {
CDMCaps::CDMCaps()
: mMonitor("CDMCaps")
, mCaps(0)
{
}
@ -33,13 +32,6 @@ CDMCaps::Unlock()
mMonitor.Unlock();
}
bool
CDMCaps::HasCap(uint64_t aCap)
{
mMonitor.AssertCurrentThreadOwns();
return (mCaps & aCap) == aCap;
}
CDMCaps::AutoLock::AutoLock(CDMCaps& aInstance)
: mData(aInstance)
{
@ -51,56 +43,6 @@ CDMCaps::AutoLock::~AutoLock()
mData.Unlock();
}
static void
TestCap(uint64_t aFlag,
uint64_t aCaps,
const nsACString& aCapName,
nsACString& aCapStr)
{
if (!(aFlag & aCaps)) {
return;
}
if (!aCapStr.IsEmpty()) {
aCapStr.AppendLiteral(",");
}
aCapStr.Append(aCapName);
}
nsCString
CapsToString(uint64_t aCaps)
{
nsCString capsStr;
TestCap(GMP_EME_CAP_DECRYPT_AUDIO, aCaps, NS_LITERAL_CSTRING("DecryptAudio"), capsStr);
TestCap(GMP_EME_CAP_DECRYPT_VIDEO, aCaps, NS_LITERAL_CSTRING("DecryptVideo"), capsStr);
TestCap(GMP_EME_CAP_DECRYPT_AND_DECODE_AUDIO, aCaps, NS_LITERAL_CSTRING("DecryptAndDecodeAudio"), capsStr);
TestCap(GMP_EME_CAP_DECRYPT_AND_DECODE_VIDEO, aCaps, NS_LITERAL_CSTRING("DecryptAndDecodeVideo"), capsStr);
return capsStr;
}
void
CDMCaps::AutoLock::SetCaps(uint64_t aCaps)
{
EME_LOG("SetCaps() %s", CapsToString(aCaps).get());
mData.mMonitor.AssertCurrentThreadOwns();
mData.mCaps = aCaps;
for (size_t i = 0; i < mData.mWaitForCaps.Length(); i++) {
NS_DispatchToMainThread(mData.mWaitForCaps[i], NS_DISPATCH_NORMAL);
}
mData.mWaitForCaps.Clear();
}
void
CDMCaps::AutoLock::CallOnMainThreadWhenCapsAvailable(nsIRunnable* aContinuation)
{
mData.mMonitor.AssertCurrentThreadOwns();
if (mData.mCaps) {
NS_DispatchToMainThread(aContinuation, NS_DISPATCH_NORMAL);
MOZ_ASSERT(mData.mWaitForCaps.IsEmpty());
} else {
mData.mWaitForCaps.AppendElement(aContinuation);
}
}
bool
CDMCaps::AutoLock::IsKeyUsable(const CencKeyId& aKeyId)
{
@ -177,49 +119,6 @@ CDMCaps::AutoLock::NotifyWhenKeyIdUsable(const CencKeyId& aKey,
mData.mWaitForKeys.AppendElement(WaitForKeys(aKey, aListener));
}
bool
CDMCaps::AutoLock::AreCapsKnown()
{
mData.mMonitor.AssertCurrentThreadOwns();
return mData.mCaps != 0;
}
bool
CDMCaps::AutoLock::CanRenderAudio()
{
return mData.HasCap(GMP_EME_CAP_RENDER_AUDIO);
}
bool
CDMCaps::AutoLock::CanRenderVideo()
{
return mData.HasCap(GMP_EME_CAP_RENDER_VIDEO);
}
bool
CDMCaps::AutoLock::CanDecryptAndDecodeAudio()
{
return mData.HasCap(GMP_EME_CAP_DECRYPT_AND_DECODE_AUDIO);
}
bool
CDMCaps::AutoLock::CanDecryptAndDecodeVideo()
{
return mData.HasCap(GMP_EME_CAP_DECRYPT_AND_DECODE_VIDEO);
}
bool
CDMCaps::AutoLock::CanDecryptAudio()
{
return mData.HasCap(GMP_EME_CAP_DECRYPT_AUDIO);
}
bool
CDMCaps::AutoLock::CanDecryptVideo()
{
return mData.HasCap(GMP_EME_CAP_DECRYPT_VIDEO);
}
void
CDMCaps::AutoLock::GetKeyStatusesForSession(const nsAString& aSessionId,
nsTArray<KeyStatus>& aOutKeyStatuses)

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

@ -18,8 +18,8 @@
namespace mozilla {
// CDM capabilities; what keys a CDMProxy can use, and whether it can decrypt, or
// decrypt-and-decode on a per stream basis. Must be locked to access state.
// CDM capabilities; what keys a CDMProxy can use.
// Must be locked to access state.
class CDMCaps {
public:
CDMCaps();
@ -55,10 +55,6 @@ public:
explicit AutoLock(CDMCaps& aKeyCaps);
~AutoLock();
// Returns true if the capabilities of the CDM are known, i.e. they have
// been reported by the CDM to Gecko.
bool AreCapsKnown();
bool IsKeyUsable(const CencKeyId& aKeyId);
// Returns true if key status changed,
@ -75,21 +71,6 @@ public:
// Returns true if a key status was changed.
bool RemoveKeysForSession(const nsString& aSessionId);
// Sets the capabilities of the CDM. aCaps is the logical OR of the
// GMP_EME_CAP_* flags from gmp-decryption.h.
void SetCaps(uint64_t aCaps);
bool CanRenderAudio();
bool CanRenderVideo();
bool CanDecryptAndDecodeAudio();
bool CanDecryptAndDecodeVideo();
bool CanDecryptAudio();
bool CanDecryptVideo();
void CallOnMainThreadWhenCapsAvailable(nsIRunnable* aContinuation);
// Notifies the SamplesWaitingForKey when key become usable.
void NotifyWhenKeyIdUsable(const CencKeyId& aKey,
SamplesWaitingForKey* aSamplesWaiting);
@ -101,7 +82,6 @@ public:
private:
void Lock();
void Unlock();
bool HasCap(uint64_t);
struct WaitForKeys {
WaitForKeys(const CencKeyId& aKeyId,
@ -119,9 +99,6 @@ private:
nsTArray<WaitForKeys> mWaitForKeys;
nsTArray<nsCOMPtr<nsIRunnable>> mWaitForCaps;
uint64_t mCaps;
// It is not safe to copy this object.
CDMCaps(const CDMCaps&) = delete;
CDMCaps& operator=(const CDMCaps&) = delete;

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

@ -193,7 +193,7 @@ GMPDecryptorChild::Decrypted(GMPBuffer* aBuffer, GMPErr aResult)
void
GMPDecryptorChild::SetCapabilities(uint64_t aCaps)
{
CALL_ON_GMP_THREAD(SendSetCaps, aCaps);
// Deprecated.
}
void

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

@ -343,19 +343,6 @@ GMPDecryptorParent::RecvKeyStatusChanged(const nsCString& aSessionId,
return true;
}
bool
GMPDecryptorParent::RecvSetCaps(const uint64_t& aCaps)
{
LOGD(("GMPDecryptorParent[%p]::RecvSetCaps(caps=0x%llx)", this, aCaps));
if (!mIsOpen) {
NS_WARNING("Trying to use a dead GMP decrypter!");
return false;
}
mCallback->SetCaps(aCaps);
return true;
}
bool
GMPDecryptorParent::RecvDecrypted(const uint32_t& aId,
const GMPErr& aErr,

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

@ -102,8 +102,6 @@ private:
const GMPErr& aErr,
InfallibleTArray<uint8_t>&& aBuffer) override;
bool RecvSetCaps(const uint64_t& aCaps) override;
bool RecvShutdown() override;
void ActorDestroy(ActorDestroyReason aWhy) override;

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

@ -48,8 +48,6 @@ public:
const nsTArray<uint8_t>& aKeyId,
GMPMediaKeyStatus aStatus) = 0;
virtual void SetCaps(uint64_t aCaps) = 0;
virtual void Decrypted(uint32_t aId,
GMPErr aResult,
const nsTArray<uint8_t>& aDecryptedData) = 0;

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

@ -81,8 +81,6 @@ parent:
async KeyStatusChanged(nsCString aSessionId, uint8_t[] aKey,
GMPMediaKeyStatus aStatus);
async SetCaps(uint64_t aCaps);
async Decrypted(uint32_t aId, GMPErr aResult, uint8_t[] aBuffer);
async Shutdown();

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

@ -105,32 +105,6 @@ enum GMPMediaKeyStatus {
// Time in milliseconds, as offset from epoch, 1 Jan 1970.
typedef int64_t GMPTimestamp;
// Capability definitions. The capabilities of the EME GMP are reported
// to Gecko by calling the GMPDecryptorCallback::SetCapabilities()
// callback and specifying the logical OR of the GMP_EME_CAP_* flags below.
//
// Note the DECRYPT and the DECRYPT_AND_DECODE are mutually exclusive;
// only one mode should be reported for each stream type, but different
// modes can be reported for different stream types.
//
// Note: Gecko does not currently support the caps changing at runtime.
// Set them once per plugin initialization, during the startup of
// the GMPDecryptor.
// Capability; CDM can decrypt encrypted buffers and return still
// compressed buffers back to Gecko for decompression there.
#define GMP_EME_CAP_DECRYPT_AUDIO (uint64_t(1) << 0)
#define GMP_EME_CAP_DECRYPT_VIDEO (uint64_t(1) << 1)
// Capability; CDM can decrypt and then decode encrypted buffers,
// and return decompressed samples to Gecko for playback.
#define GMP_EME_CAP_DECRYPT_AND_DECODE_AUDIO (uint64_t(1) << 2)
#define GMP_EME_CAP_DECRYPT_AND_DECODE_VIDEO (uint64_t(1) << 3)
// Capability; CDM can decrypt and then decode and render encrypted buffers
#define GMP_EME_CAP_RENDER_AUDIO (uint64_t(1) << 4)
#define GMP_EME_CAP_RENDER_VIDEO (uint64_t(1) << 5)
// Callbacks to be called from the CDM. Threadsafe.
class GMPDecryptorCallback {
public:
@ -212,12 +186,7 @@ public:
uint32_t aKeyIdLength,
GMPMediaKeyStatus aStatus) = 0;
// The CDM must report its capabilites of this CDM. aCaps should be a
// logical OR of the GMP_EME_CAP_* flags. The CDM *MUST* call this
// function and report whether it can decrypt and/or decode. Without
// this, Gecko does not know how to use the CDM and will not send
// samples to the CDM to decrypt or decrypt-and-decode mode. Note a
// CDM cannot change modes once playback has begun.
// DEPRECATED; this function has no affect.
virtual void SetCapabilities(uint64_t aCaps) = 0;
// Returns decrypted buffer to Gecko, or reports failure.
@ -258,13 +227,6 @@ public:
// Sets the callback to use with the decryptor to return results
// to Gecko.
//
// The CDM must also call GMPDecryptorCallback::SetCapabilities()
// exactly once during start up, to inform Gecko whether to use the CDM
// in decrypt or decrypt-and-decode mode.
//
// Note: GMPDecryptorCallback::SetCapabilities() must be called before
// Gecko will send any samples for decryption to the GMP.
virtual void Init(GMPDecryptorCallback* aCallback) = 0;
// Initiates the creation of a session given |aType| and |aInitData|, and

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

@ -39,8 +39,6 @@ WidevineDecryptor::Init(GMPDecryptorCallback* aCallback)
{
MOZ_ASSERT(aCallback);
mCallback = aCallback;
mCallback->SetCapabilities(GMP_EME_CAP_DECRYPT_AND_DECODE_VIDEO |
GMP_EME_CAP_DECRYPT_AUDIO);
}
static SessionType

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

@ -1349,7 +1349,6 @@ class GMPStorageTest : public GMPDecryptorProxyCallback
void KeyStatusChanged(const nsCString& aSessionId,
const nsTArray<uint8_t>& aKeyId,
GMPMediaKeyStatus aStatus) override { }
void SetCaps(uint64_t aCaps) override {}
void Decrypted(uint32_t aId,
GMPErr aResult,
const nsTArray<uint8_t>& aDecryptedData) override { }

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

@ -385,16 +385,8 @@ PDMFactory::GetDecoder(const nsACString& aMimeType,
void
PDMFactory::SetCDMProxy(CDMProxy* aProxy)
{
bool cdmDecodesAudio;
bool cdmDecodesVideo;
{
CDMCaps::AutoLock caps(aProxy->Capabilites());
cdmDecodesAudio = caps.CanDecryptAndDecodeAudio();
cdmDecodesVideo = caps.CanDecryptAndDecodeVideo();
}
RefPtr<PDMFactory> m = new PDMFactory();
mEMEPDM = new EMEDecoderModule(aProxy, m, cdmDecodesAudio, cdmDecodesVideo);
mEMEPDM = new EMEDecoderModule(aProxy, m);
}
#endif

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

@ -205,14 +205,9 @@ EMEMediaDataDecoderProxy::Shutdown()
return rv;
}
EMEDecoderModule::EMEDecoderModule(CDMProxy* aProxy,
PDMFactory* aPDM,
bool aCDMDecodesAudio,
bool aCDMDecodesVideo)
EMEDecoderModule::EMEDecoderModule(CDMProxy* aProxy, PDMFactory* aPDM)
: mProxy(aProxy)
, mPDM(aPDM)
, mCDMDecodesAudio(aCDMDecodesAudio)
, mCDMDecodesVideo(aCDMDecodesVideo)
{
}
@ -246,7 +241,8 @@ EMEDecoderModule::CreateVideoDecoder(const VideoInfo& aConfig,
{
MOZ_ASSERT(aConfig.mCrypto.mValid);
if (mCDMDecodesVideo) {
if (SupportsMimeType(aConfig.mMimeType, nullptr)) {
// GMP decodes. Assume that means it can decrypt too.
RefPtr<MediaDataDecoderProxy> wrapper = CreateDecoderWrapper(aCallback, mProxy, aVideoTaskQueue);
wrapper->SetProxyTarget(new EMEVideoDecoder(mProxy,
aConfig,
@ -284,7 +280,8 @@ EMEDecoderModule::CreateAudioDecoder(const AudioInfo& aConfig,
{
MOZ_ASSERT(aConfig.mCrypto.mValid);
if (mCDMDecodesAudio) {
if (SupportsMimeType(aConfig.mMimeType, nullptr)) {
// GMP decodes. Assume that means it can decrypt too.
RefPtr<MediaDataDecoderProxy> wrapper = CreateDecoderWrapper(aCallback, mProxy, aAudioTaskQueue);
wrapper->SetProxyTarget(new EMEAudioDecoder(mProxy,
aConfig,

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