Merge inbound to m-c. a=merge

This commit is contained in:
Ryan VanderMeulen 2015-02-18 20:29:54 -05:00
commit a411359369
278 changed files with 3364 additions and 3587 deletions

View File

@ -548,15 +548,12 @@ GenericProtocolHandler.prototype = {
return uri;
},
newChannel: function GPH_newChannel(aUri) {
newChannel2: function GPH_newChannel(aUri, aLoadInfo) {
var inner = aUri.QueryInterface(Ci.nsINestedURI).innerURI;
var channel = Cc["@mozilla.org/network/io-service;1"].
getService(Ci.nsIIOService).newChannelFromURI2(inner,
null, // aLoadingNode
Services.scriptSecurityManager.getSystemPrincipal(),
null, // aTriggeringPrincipal
Ci.nsILoadInfo.SEC_NORMAL,
Ci.nsIContentPolicy.TYPE_OTHER);
getService(Ci.nsIIOService).
newChannelFromURIWithLoadInfo(inner, aLoadInfo);
if (channel instanceof Components.interfaces.nsIHttpChannel)
// Set this so we know this is supposed to be a feed
channel.setRequestHeader("X-Moz-Is-Feed", "1", false);
@ -564,6 +561,7 @@ GenericProtocolHandler.prototype = {
return channel;
},
QueryInterface: function GPH_QueryInterface(iid) {
if (iid.equals(Ci.nsIProtocolHandler) ||
iid.equals(Ci.nsISupports))

View File

@ -119,6 +119,13 @@ XPCOMUtils.defineLazyModuleGetter(this, "UpdateChannel",
"resource://gre/modules/UpdateChannel.jsm");
#endif
#if defined(MOZ_UPDATE_CHANNEL) && MOZ_UPDATE_CHANNEL != release
#define MOZ_DEBUG_UA // Shorthand define for subsequent conditional sections.
XPCOMUtils.defineLazyModuleGetter(this, "UserAgentOverrides",
"resource://gre/modules/UserAgentOverrides.jsm");
#endif
XPCOMUtils.defineLazyGetter(this, "ShellService", function() {
try {
return Cc["@mozilla.org/browser/shell-service;1"].
@ -138,9 +145,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "WebChannel",
XPCOMUtils.defineLazyModuleGetter(this, "ReaderParent",
"resource:///modules/ReaderParent.jsm");
XPCOMUtils.defineLazyModuleGetter(this, "AddonWatcher",
"resource://gre/modules/AddonWatcher.jsm");
const PREF_PLUGINS_NOTIFYUSER = "plugins.update.notifyUser";
const PREF_PLUGINS_UPDATEURL = "plugins.update.url";
@ -567,76 +571,6 @@ BrowserGlue.prototype = {
this._distributionCustomizer.applyPrefDefaults();
},
_notifySlowAddon: function BG_notifySlowAddon(addonId) {
let addonCallback = function(addon) {
if (!addon) {
Cu.reportError("couldn't look up addon: " + addonId);
return;
}
let win = RecentWindow.getMostRecentBrowserWindow();
if (!win) {
return;
}
let brandBundle = win.document.getElementById("bundle_brand");
let brandShortName = brandBundle.getString("brandShortName");
let message = win.gNavigatorBundle.getFormattedString("addonwatch.slow", [addon.name, brandShortName]);
let notificationBox = win.document.getElementById("global-notificationbox");
let notificationId = 'addon-slow:' + addonId;
let notification = notificationBox.getNotificationWithValue(notificationId);
if(notification) {
notification.label = message;
} else {
let buttons = [
{
label: win.gNavigatorBundle.getFormattedString("addonwatch.disable.label", [addon.name]),
accessKey: win.gNavigatorBundle.getString("addonwatch.disable.accesskey"),
callback: function() {
addon.userDisabled = true;
if (addon.pendingOperations != addon.PENDING_NONE) {
let restartMessage = win.gNavigatorBundle.getFormattedString("addonwatch.restart.message", [addon.name, brandShortName]);
let restartButton = [
{
label: win.gNavigatorBundle.getFormattedString("addonwatch.restart.label", [brandShortName]),
accessKey: win.gNavigatorBundle.getString("addonwatch.restart.accesskey"),
callback: function() {
let appStartup = Cc["@mozilla.org/toolkit/app-startup;1"]
.getService(Ci.nsIAppStartup);
appStartup.quit(appStartup.eForceQuit | appStartup.eRestart);
}
}
];
const priority = notificationBox.PRIORITY_WARNING_MEDIUM;
notificationBox.appendNotification(restartMessage, "restart-" + addonId, "",
priority, restartButton);
}
}
},
{
label: win.gNavigatorBundle.getString("addonwatch.ignoreSession.label"),
accessKey: win.gNavigatorBundle.getString("addonwatch.ignoreSession.accesskey"),
callback: function() {
AddonWatcher.ignoreAddonForSession(addonId);
}
},
{
label: win.gNavigatorBundle.getString("addonwatch.ignorePerm.label"),
accessKey: win.gNavigatorBundle.getString("addonwatch.ignorePerm.accesskey"),
callback: function() {
AddonWatcher.ignoreAddonPermanently(addonId);
}
},
];
const priority = notificationBox.PRIORITY_WARNING_MEDIUM;
notificationBox.appendNotification(message, notificationId, "",
priority, buttons);
}
};
AddonManager.getAddonByID(addonId, addonCallback);
},
// runs on startup, before the first command line handler is invoked
// (i.e. before the first window is opened)
_finalUIStartup: function BG__finalUIStartup() {
@ -684,9 +618,12 @@ BrowserGlue.prototype = {
Services.prefs.addObserver(POLARIS_ENABLED, this, false);
#endif
Services.obs.notifyObservers(null, "browser-ui-startup-complete", "");
#ifdef MOZ_DEBUG_UA
UserAgentOverrides.init();
DebugUserAgent.init();
#endif
AddonWatcher.init(this._notifySlowAddon);
Services.obs.notifyObservers(null, "browser-ui-startup-complete", "");
},
_checkForOldBuildUpdates: function () {
@ -917,6 +854,9 @@ BrowserGlue.prototype = {
if (Services.prefs.getBoolPref("dom.identity.enabled")) {
SignInToWebsiteUX.uninit();
}
#endif
#ifdef MOZ_DEBUG_UA
UserAgentOverrides.uninit();
#endif
webrtcUI.uninit();
FormValidationHandler.uninit();
@ -2835,3 +2775,36 @@ let globalMM = Cc["@mozilla.org/globalmessagemanager;1"].getService(Ci.nsIMessag
globalMM.addMessageListener("UITour:onPageEvent", function(aMessage) {
UITour.onPageEvent(aMessage, aMessage.data);
});
#ifdef MOZ_DEBUG_UA
// Modify the user agent string for specific domains
// to route debug information through their logging.
var DebugUserAgent = {
DEBUG_UA: null,
DOMAINS: [
'youtube.com',
'www.youtube.com',
'youtube-nocookie.com',
'www.youtube-nocookie.com',
],
init: function() {
// Only run if the MediaSource Extension API is available.
if (!Services.prefs.getBoolPref("media.mediasource.enabled")) {
return;
}
// Install our override filter.
UserAgentOverrides.addComplexOverride(this.onRequest.bind(this));
let ua = Cc["@mozilla.org/network/protocol;1?name=http"]
.getService(Ci.nsIHttpProtocolHandler).userAgent;
this.DEBUG_UA = ua + " Build/" + Services.appinfo.appBuildID;
},
onRequest: function(channel, defaultUA) {
if (this.DOMAINS.indexOf(channel.URI.host) != -1) {
return this.DEBUG_UA;
}
return null;
},
};
#endif // MOZ_DEBUG_UA

View File

@ -16,6 +16,12 @@ add_task(function* () {
"rc4.example.com": "security-state-weak",
};
yield new promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [
["security.tls.insecure_fallback_hosts", "rc4.example.com"]
]}, resolve);
});
let [tab, debuggee, monitor] = yield initNetMonitor(CUSTOM_GET_URL);
let { $, EVENTS, NetMonitorView } = monitor.panelWin;
let { RequestsMenu } = NetMonitorView;

View File

@ -40,9 +40,12 @@ add_task(function* () {
let { RequestsMenu, NetworkDetails } = NetMonitorView;
RequestsMenu.lazyUpdate = false;
info("Enabling SSLv3 for the test.");
info("Enabling SSLv3 and RC4 for the test.");
yield new promise(resolve => {
SpecialPowers.pushPrefEnv({"set": [["security.tls.version.min", 0]]}, resolve);
SpecialPowers.pushPrefEnv({"set": [
["security.tls.version.min", 0],
["security.tls.insecure_fallback_hosts", "rc4.example.com,ssl3rc4.example.com"]
]}, resolve);
});
let cipher = $("#security-warning-cipher");

View File

@ -7,6 +7,7 @@
function test() {
let { FrameNode } = devtools.require("devtools/shared/profiler/tree-model");
let { CATEGORY_OTHER } = devtools.require("devtools/shared/profiler/global");
let frame1 = new FrameNode({
location: "hello/<.world (http://foo/bar.js:123:987)",
@ -132,7 +133,7 @@ function test() {
location: "Foo::Bar::Baz",
line: 456,
column: 123,
category: 8
category: CATEGORY_OTHER
});
is(frame6.getInfo().nodeType, "Frame",

View File

@ -6,6 +6,8 @@
* creates the correct column structure after expanding some of the nodes.
*/
let { CATEGORY_MASK } = devtools.require("devtools/shared/profiler/global");
function test() {
let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
@ -126,33 +128,33 @@ function test() {
let gSamples = [{
time: 5,
frames: [
{ category: 8, location: "(root)" },
{ category: 8, location: "A (http://foo/bar/baz:12)" },
{ category: 16, location: "B (http://foo/bar/baz:34)" },
{ category: 32, location: "C (http://foo/bar/baz:56)" }
{ category: CATEGORY_MASK('other'), location: "(root)" },
{ category: CATEGORY_MASK('other'), location: "A (http://foo/bar/baz:12)" },
{ category: CATEGORY_MASK('css'), location: "B (http://foo/bar/baz:34)" },
{ category: CATEGORY_MASK('js'), location: "C (http://foo/bar/baz:56)" }
]
}, {
time: 5 + 1,
frames: [
{ category: 8, location: "(root)" },
{ category: 8, location: "A (http://foo/bar/baz:12)" },
{ category: 16, location: "B (http://foo/bar/baz:34)" },
{ category: 64, location: "D (http://foo/bar/baz:78)" }
{ category: CATEGORY_MASK('other'), location: "(root)" },
{ category: CATEGORY_MASK('other'), location: "A (http://foo/bar/baz:12)" },
{ category: CATEGORY_MASK('css'), location: "B (http://foo/bar/baz:34)" },
{ category: CATEGORY_MASK('gc', 1), location: "D (http://foo/bar/baz:78)" }
]
}, {
time: 5 + 1 + 2,
frames: [
{ category: 8, location: "(root)" },
{ category: 8, location: "A (http://foo/bar/baz:12)" },
{ category: 16, location: "B (http://foo/bar/baz:34)" },
{ category: 64, location: "D (http://foo/bar/baz:78)" }
{ category: CATEGORY_MASK('other'), location: "(root)" },
{ category: CATEGORY_MASK('other'), location: "A (http://foo/bar/baz:12)" },
{ category: CATEGORY_MASK('css'), location: "B (http://foo/bar/baz:34)" },
{ category: CATEGORY_MASK('gc', 1), location: "D (http://foo/bar/baz:78)" }
]
}, {
time: 5 + 1 + 2 + 7,
frames: [
{ category: 8, location: "(root)" },
{ category: 8, location: "A (http://foo/bar/baz:12)" },
{ category: 128, location: "E (http://foo/bar/baz:90)" },
{ category: 256, location: "F (http://foo/bar/baz:99)" }
{ category: CATEGORY_MASK('other'), location: "(root)" },
{ category: CATEGORY_MASK('other'), location: "A (http://foo/bar/baz:12)" },
{ category: CATEGORY_MASK('gc', 2), location: "E (http://foo/bar/baz:90)" },
{ category: CATEGORY_MASK('network'), location: "F (http://foo/bar/baz:99)" }
]
}];

View File

@ -6,6 +6,8 @@
* creates the correct DOM nodes in the correct order.
*/
let { CATEGORY_MASK } = devtools.require("devtools/shared/profiler/global");
function test() {
let { ThreadNode } = devtools.require("devtools/shared/profiler/tree-model");
let { CallView } = devtools.require("devtools/shared/profiler/tree-view");
@ -90,34 +92,33 @@ function test() {
let gSamples = [{
time: 5,
frames: [
{ category: 8, location: "(root)" },
{ category: 8, location: "A (http://foo/bar/baz:12)" },
{ category: 16, location: "B (http://foo/bar/baz:34)" },
{ category: 32, location: "C (http://foo/bar/baz:56)" }
{ category: CATEGORY_MASK('other'), location: "(root)" },
{ category: CATEGORY_MASK('other'), location: "A (http://foo/bar/baz:12)" },
{ category: CATEGORY_MASK('css'), location: "B (http://foo/bar/baz:34)" },
{ category: CATEGORY_MASK('js'), location: "C (http://foo/bar/baz:56)" }
]
}, {
time: 5 + 1,
frames: [
{ category: 8, location: "(root)" },
{ category: 8, location: "A (http://foo/bar/baz:12)" },
{ category: 16, location: "B (http://foo/bar/baz:34)" },
{ category: 64, location: "D (http://foo/bar/baz:78)" }
{ category: CATEGORY_MASK('other'), location: "(root)" },
{ category: CATEGORY_MASK('other'), location: "A (http://foo/bar/baz:12)" },
{ category: CATEGORY_MASK('css'), location: "B (http://foo/bar/baz:34)" },
{ category: CATEGORY_MASK('gc', 1), location: "D (http://foo/bar/baz:78)" }
]
}, {
time: 5 + 1 + 2,
frames: [
{ category: 8, location: "(root)" },
{ category: 8, location: "A (http://foo/bar/baz:12)" },
{ category: 16, location: "B (http://foo/bar/baz:34)" },
{ category: 64, location: "D (http://foo/bar/baz:78)" }
{ category: CATEGORY_MASK('other'), location: "(root)" },
{ category: CATEGORY_MASK('other'), location: "A (http://foo/bar/baz:12)" },
{ category: CATEGORY_MASK('css'), location: "B (http://foo/bar/baz:34)" },
{ category: CATEGORY_MASK('gc', 1), location: "D (http://foo/bar/baz:78)" }
]
}, {
time: 5 + 1 + 2 + 7,
frames: [
{ category: 8, location: "(root)" },
{ category: 8, location: "A (http://foo/bar/baz:12)" },
{ category: 128, location: "E (http://foo/bar/baz:90)" },
{ category: 256, location: "F (http://foo/bar/baz:99)" }
{ category: CATEGORY_MASK('other'), location: "(root)" },
{ category: CATEGORY_MASK('other'), location: "A (http://foo/bar/baz:12)" },
{ category: CATEGORY_MASK('gc', 2), location: "E (http://foo/bar/baz:90)" },
{ category: CATEGORY_MASK('network'), location: "F (http://foo/bar/baz:99)" }
]
}];

View File

@ -33,25 +33,70 @@ const CATEGORIES = [
* To be kept in sync with the js::ProfileEntry::Category in ProfilingStack.h
*/
const CATEGORY_MAPPINGS = {
"8": CATEGORIES[0], // js::ProfileEntry::Category::OTHER
"16": CATEGORIES[1], // js::ProfileEntry::Category::CSS
"32": CATEGORIES[2], // js::ProfileEntry::Category::JS
"64": CATEGORIES[3], // js::ProfileEntry::Category::GC
"128": CATEGORIES[3], // js::ProfileEntry::Category::CC
"256": CATEGORIES[4], // js::ProfileEntry::Category::NETWORK
"512": CATEGORIES[5], // js::ProfileEntry::Category::GRAPHICS
"1024": CATEGORIES[6], // js::ProfileEntry::Category::STORAGE
"2048": CATEGORIES[7], // js::ProfileEntry::Category::EVENTS
"16": CATEGORIES[0], // js::ProfileEntry::Category::OTHER
"32": CATEGORIES[1], // js::ProfileEntry::Category::CSS
"64": CATEGORIES[2], // js::ProfileEntry::Category::JS
"128": CATEGORIES[3], // js::ProfileEntry::Category::GC
"256": CATEGORIES[3], // js::ProfileEntry::Category::CC
"512": CATEGORIES[4], // js::ProfileEntry::Category::NETWORK
"1024": CATEGORIES[5], // js::ProfileEntry::Category::GRAPHICS
"2048": CATEGORIES[6], // js::ProfileEntry::Category::STORAGE
"4096": CATEGORIES[7], // js::ProfileEntry::Category::EVENTS
};
/**
* Get the numeric bitmask (or set of masks) for the given category
* abbreviation. See CATEGORIES and CATEGORY_MAPPINGS above.
*
* CATEGORY_MASK can be called with just a name if it is expected that the
* category is mapped to by exactly one bitmask. If the category is mapped
* to by multiple masks, CATEGORY_MASK for that name must be called with
* an additional argument specifying the desired id (in ascending order).
*/
const [CATEGORY_MASK, CATEGORY_MASK_LIST] = (function () {
let mappings = {};
for (let category of CATEGORIES) {
let numList = Object.keys(CATEGORY_MAPPINGS)
.filter(k => CATEGORY_MAPPINGS[k] == category)
.map(k => +k);
numList.sort();
mappings[category.abbrev] = numList;
}
return [
function (name, num) {
if (!(name in mappings)) {
throw new Error(`Category abbreviation '${name}' does not exist.`);
}
if (arguments.length == 1) {
if (mappings[name].length != 1) {
throw new Error(`Expected exactly one category number for '${name}'.`);
}
return mappings[name][0];
}
if (num > mappings[name].length) {
throw new Error(`Num '${num}' too high for category '${name}'.`);
}
return mappings[name][num - 1];
},
function (name) {
if (!(name in mappings)) {
throw new Error(`Category abbreviation '${name}' does not exist.`);
}
return mappings[name];
}
];
})();
// Human-readable "other" category bitmask. Older Geckos don't have all the
// necessary instrumentation in the sampling profiler backend for creating
// a categories graph, in which case we default to the "other" category.
const CATEGORY_OTHER = 8;
const CATEGORY_OTHER = CATEGORY_MASK('other');
// Human-readable JIT category bitmask. Certain pseudo-frames in a sample,
// like "EnterJIT", don't have any associated `cateogry` information.
const CATEGORY_JIT = 32;
const CATEGORY_JIT = CATEGORY_MASK('js');
// Exported symbols.
exports.L10N = L10N;
@ -59,3 +104,5 @@ exports.CATEGORIES = CATEGORIES;
exports.CATEGORY_MAPPINGS = CATEGORY_MAPPINGS;
exports.CATEGORY_OTHER = CATEGORY_OTHER;
exports.CATEGORY_JIT = CATEGORY_JIT;
exports.CATEGORY_MASK = CATEGORY_MASK;
exports.CATEGORY_MASK_LIST = CATEGORY_MASK_LIST;

View File

@ -82,29 +82,26 @@ let inputTests = [
output: "/foobar/",
inspectable: true,
},
// 9
{
input: "Symbol()",
output: "Symbol()"
},
// 10
{
input: "Symbol('foo')",
output: "Symbol(foo)"
},
// 11
{
input: "Symbol.iterator",
output: "Symbol(Symbol.iterator)"
},
];
if (typeof Symbol !== "undefined") {
inputTests.push(
// 9
{
input: "Symbol()",
output: "Symbol()"
},
// 10
{
input: "Symbol('foo')",
output: "Symbol(foo)"
},
// 11
{
input: "Symbol.iterator",
output: "Symbol(Symbol.iterator)"
});
}
longString = initialString = null;
function test() {

View File

@ -40,17 +40,6 @@ addonDownloadRestart=Restart Download;Restart Downloads
addonDownloadRestart.accessKey=R
addonDownloadCancelTooltip=Cancel
addonwatch.slow=%S might be making %S run slowly
addonwatch.disable.label=Disable %S
addonwatch.disable.accesskey=D
addonwatch.ignoreSession.label=Ignore for now
addonwatch.ignoreSession.accesskey=I
addonwatch.ignorePerm.label=Ignore permanently
addonwatch.ignorePerm.accesskey=p
addonwatch.restart.message=To disable %S you must restart %S
addonwatch.restart.label=Restart %s
addonwatch.restart.accesskey=R
# LOCALIZATION NOTE (addonsInstalled, addonsInstalledNeedsRestart):
# Semicolon-separated list of plural forms. See:
# http://developer.mozilla.org/en/docs/Localization_and_Plurals

View File

@ -33,7 +33,7 @@ ifdef MOZ_SOURCE_STAMP
DEFINES += -DMOZ_SOURCE_STAMP='$(MOZ_SOURCE_STAMP)'
endif
ifdef MOZILLA_OFFICIAL
ifdef MOZ_INCLUDE_SOURCE_INFO
source_repo ?= $(call getSourceRepo,$(topsrcdir)/$(MOZ_BUILD_APP)/..)
ifneq (,$(source_repo))
DEFINES += -DMOZ_SOURCE_REPO='$(source_repo)'

View File

@ -2304,6 +2304,11 @@ ia64*-hpux*)
dnl Probably also a compiler bug, but what can you do?
PROFILE_USE_LDFLAGS="-LTCG:PGUPDATE"
LDFLAGS="$LDFLAGS -DYNAMICBASE"
if test "$_CC_MAJOR_VERSION" = "18" -a "$_CC_BUILD_VERSION" = "31101"; then
dnl Use MaxILKSize as a workaround for LNK1248 in VS2013update4
dnl See https://connect.microsoft.com/VisualStudio/feedback/details/1044914/fatal-error-lnk1248
LDFLAGS="$LDFLAGS -MaxILKSize:2147483647"
fi
dnl Minimum reqiurement of Gecko is VS2010 or later which supports
dnl both SSSE3 and SSE4.1.
HAVE_TOOLCHAIN_SUPPORT_MSSSE3=1
@ -8694,6 +8699,13 @@ AC_SUBST(MOZ_PKG_SPECIAL)
AC_SUBST(MOZILLA_OFFICIAL)
# Build revisions should always be present in official builds
if test "$MOZILLA_OFFICIAL"; then
MOZ_INCLUDE_SOURCE_INFO=1
fi
AC_SUBST(MOZ_INCLUDE_SOURCE_INFO)
AC_DEFINE_UNQUOTED(MOZ_TELEMETRY_DISPLAY_REV, 2)
AC_SUBST(MOZ_TELEMETRY_DISPLAY_REV)

View File

@ -20,7 +20,6 @@ XPIDL_SOURCES += [
'nsIDownloadHistory.idl',
'nsIGlobalHistory2.idl',
'nsILoadContext.idl',
'nsILoadInfo.idl',
'nsIPrivacyTransitionObserver.idl',
'nsIReflowObserver.idl',
'nsIRefreshURI.idl',
@ -45,12 +44,10 @@ EXPORTS += [
EXPORTS.mozilla += [
'IHistory.h',
'LoadContext.h',
'LoadInfo.h',
]
UNIFIED_SOURCES += [
'LoadContext.cpp',
'LoadInfo.cpp',
'nsAboutRedirector.cpp',
'nsDefaultURIFixup.cpp',
'nsDocShell.cpp',

View File

@ -2439,6 +2439,20 @@ Navigator::HasTVSupport(JSContext* aCx, JSObject* aGlobal)
return status == nsIPrincipal::APP_STATUS_CERTIFIED;
}
/* static */
bool
Navigator::IsE10sEnabled(JSContext* aCx, JSObject* aGlobal)
{
return XRE_GetProcessType() == GeckoProcessType_Content;
}
bool
Navigator::MozE10sEnabled()
{
// This will only be called if IsE10sEnabled() is true.
return true;
}
/* static */
already_AddRefed<nsPIDOMWindow>
Navigator::GetWindowFromGlobal(JSObject* aGlobal)

View File

@ -287,6 +287,8 @@ public:
ErrorResult& aRv);
void GetLanguages(nsTArray<nsString>& aLanguages);
bool MozE10sEnabled();
static void GetAcceptLanguages(nsTArray<nsString>& aLanguages);
// WebIDL helper methods
@ -315,6 +317,8 @@ public:
static bool HasTVSupport(JSContext* aCx, JSObject* aGlobal);
static bool IsE10sEnabled(JSContext* aCx, JSObject* aGlobal);
nsPIDOMWindow* GetParentObject() const
{
return GetWindow();

View File

@ -2204,8 +2204,11 @@ DOMGCSliceCallback(JSRuntime *aRt, JS::GCProgress aProgress, const JS::GCDescrip
nsJSContext::KillFullGCTimer();
// Avoid shrinking during heavy activity, which is suggested by
// compartment GC.
nsJSContext::PokeShrinkGCBuffers();
// compartment GC. We don't need to shrink after a shrinking GC as this
// happens automatically in this case.
if (aDesc.invocationKind_ == GC_NORMAL) {
nsJSContext::PokeShrinkGCBuffers();
}
}
if (ShouldTriggerCC(nsCycleCollector_suspectedCount())) {

View File

@ -71,3 +71,4 @@ MSG_DEF(MSG_INVALID_ZOOMANDPAN_VALUE_ERROR, 0, JSEXN_RANGEERR, "Invalid zoom and
MSG_DEF(MSG_INVALID_TRANSFORM_ANGLE_ERROR, 0, JSEXN_RANGEERR, "Invalid transform angle.")
MSG_DEF(MSG_INVALID_RESPONSE_STATUSCODE_ERROR, 0, JSEXN_RANGEERR, "Invalid response status code.")
MSG_DEF(MSG_INVALID_REDIRECT_STATUSCODE_ERROR, 0, JSEXN_RANGEERR, "Invalid redirect status code.")
MSG_DEF(MSG_RESPONSE_URL_IS_NULL, 0, JSEXN_TYPEERR, "Cannot set Response.finalURL when Response.url is null.")

View File

@ -539,7 +539,24 @@ BrowserElementParent.prototype = {
return this._frameLoader.visible;
},
getChildProcessOffset: function() {
let offset = { x: 0, y: 0 };
let tabParent = this._frameLoader.tabParent;
if (tabParent) {
let offsetX = {};
let offsetY = {};
tabParent.getChildProcessOffset(offsetX, offsetY);
offset.x = offsetX.value;
offset.y = offsetY.value;
}
return offset;
},
sendMouseEvent: defineNoReturnMethod(function(type, x, y, button, clickCount, modifiers) {
let offset = this.getChildProcessOffset();
x += offset.x;
y += offset.y;
this._sendAsyncMsg("send-mouse-event", {
"type": type,
"x": x,
@ -567,6 +584,13 @@ BrowserElementParent.prototype = {
count,
modifiers);
} else {
let offset = this.getChildProcessOffset();
for (var i = 0; i < touchesX.length; i++) {
touchesX[i] += offset.x;
}
for (var i = 0; i < touchesY.length; i++) {
touchesY[i] += offset.y;
}
this._sendAsyncMsg("send-touch-event", {
"type": type,
"identifiers": identifiers,

View File

@ -12,9 +12,26 @@ function runTest() {
var iframe = document.createElement("iframe");
iframe.setAttribute('mozbrowser', 'true');
document.body.appendChild(iframe);
var x = 10;
var y = 10;
// First we force a reflow so that getChildProcessOffset actually returns
// meaningful data.
iframe.getBoundingClientRect();
// We need to make sure the event coordinates are actually inside the iframe,
// relative to the chome window.
var tabParent = SpecialPowers.wrap(iframe)
.QueryInterface(SpecialPowers.Ci.nsIFrameLoaderOwner)
.frameLoader.tabParent;
if (tabParent) {
let offsetX = {};
let offsetY = {};
tabParent.getChildProcessOffset(offsetX, offsetY);
x -= offsetX.value;
y -= offsetY.value;
}
iframe.addEventListener("mozbrowserloadend", function onloadend(e) {
iframe.sendMouseEvent("mousedown", 10, 10, 0, 1, 0);
iframe.sendMouseEvent("mousedown", x, y, 0, 1, 0);
});
iframe.addEventListener("mozbrowserlocationchange", function onlocchange(e) {
@ -24,11 +41,11 @@ function runTest() {
switch (a.hash) {
case "#mousedown":
ok(true, "Receive a mousedown event.");
iframe.sendMouseEvent("mousemove", 10, 10, 0, 0, 0);
iframe.sendMouseEvent("mousemove", x, y, 0, 0, 0);
break;
case "#mousemove":
ok(true, "Receive a mousemove event.");
iframe.sendMouseEvent("mouseup", 10, 10, 0, 1, 0);
iframe.sendMouseEvent("mouseup", x, y, 0, 1, 0);
break;
case "#mouseup":
ok(true, "Receive a mouseup event.");
@ -36,7 +53,7 @@ function runTest() {
case "#click":
ok(true, "Receive a click event.");
if (SpecialPowers.getIntPref("dom.w3c_touch_events.enabled") != 0) {
iframe.sendTouchEvent("touchstart", [1], [10], [10], [2], [2],
iframe.sendTouchEvent("touchstart", [1], [x], [y], [2], [2],
[20], [0.5], 1, 0);
} else {
iframe.removeEventListener('mozbrowserlocationchange', onlocchange);
@ -45,16 +62,16 @@ function runTest() {
break;
case "#touchstart":
ok(true, "Receive a touchstart event.");
iframe.sendTouchEvent("touchmove", [1], [10], [10], [2], [2],
iframe.sendTouchEvent("touchmove", [1], [x], [y], [2], [2],
[20], [0.5], 1, 0);
case "#touchmove":
ok(true, "Receive a touchmove event.");
iframe.sendTouchEvent("touchend", [1], [10], [10], [2], [2],
iframe.sendTouchEvent("touchend", [1], [x], [y], [2], [2],
[20], [0.5], 1, 0);
break;
case "#touchend":
ok(true, "Receive a touchend event.");
iframe.sendTouchEvent("touchcancel", [1], [10], [10], [2], [2],
iframe.sendTouchEvent("touchcancel", [1], [x], [y], [2], [2],
[20], [0.5], 1, 0);
iframe.removeEventListener('mozbrowserlocationchange', onlocchange);
SimpleTest.finish();

View File

@ -517,9 +517,11 @@ already_AddRefed<InternalResponse>
FetchDriver::BeginAndGetFilteredResponse(InternalResponse* aResponse)
{
MOZ_ASSERT(aResponse);
nsAutoCString reqURL;
mRequest->GetURL(reqURL);
aResponse->SetUrl(reqURL);
if (!aResponse->FinalURL()) {
nsAutoCString reqURL;
mRequest->GetURL(reqURL);
aResponse->SetUrl(reqURL);
}
// FIXME(nsm): Handle mixed content check, step 7 of fetch.

View File

@ -14,6 +14,7 @@ namespace dom {
InternalResponse::InternalResponse(uint16_t aStatus, const nsACString& aStatusText)
: mType(ResponseType::Default)
, mFinalURL(false)
, mStatus(aStatus)
, mStatusText(aStatusText)
, mHeaders(new InternalHeaders(HeadersGuardEnum::Response))
@ -26,6 +27,7 @@ InternalResponse::InternalResponse(const InternalResponse& aOther)
: mType(aOther.mType)
, mTerminationReason(aOther.mTerminationReason)
, mURL(aOther.mURL)
, mFinalURL(aOther.mFinalURL)
, mStatus(aOther.mStatus)
, mStatusText(aOther.mStatusText)
, mBody(aOther.mBody)

View File

@ -76,6 +76,18 @@ public:
mURL.Assign(aURL);
}
bool
FinalURL() const
{
return mFinalURL;
}
void
SetFinalURL(bool aFinalURL)
{
mFinalURL = aFinalURL;
}
uint16_t
GetStatus() const
{
@ -120,6 +132,7 @@ private:
ResponseType mType;
nsCString mTerminationReason;
nsCString mURL;
bool mFinalURL;
const uint16_t mStatus;
const nsCString mStatusText;
nsRefPtr<InternalHeaders> mHeaders;

View File

@ -215,5 +215,18 @@ Response::Headers_()
return mHeaders;
}
void
Response::SetFinalURL(bool aFinalURL, ErrorResult& aRv)
{
nsCString url;
mInternalResponse->GetUrl(url);
if (url.IsEmpty()) {
aRv.ThrowTypeError(MSG_RESPONSE_URL_IS_NULL);
return;
}
mInternalResponse->SetFinalURL(aFinalURL);
}
} // namespace dom
} // namespace mozilla

View File

@ -56,6 +56,15 @@ public:
aUrl.AsAString() = NS_ConvertUTF8toUTF16(url);
}
bool
GetFinalURL(ErrorResult& aRv) const
{
return mInternalResponse->FinalURL();
}
void
SetFinalURL(bool aFinalURL, ErrorResult& aRv);
uint16_t
Status() const
{

View File

@ -311,21 +311,29 @@ nsHTMLDNSPrefetch::nsDeferrals::SubmitQueue()
// Only prefetch here if request was deferred and deferral not cancelled
if (link && link->HasDeferredDNSPrefetchRequest()) {
nsCOMPtr<nsIURI> hrefURI(link ? link->GetURI() : nullptr);
if (hrefURI)
hrefURI->GetAsciiHost(hostName);
bool isLocalResource = false;
nsresult rv;
if (!hostName.IsEmpty()) {
hostName.Truncate();
if (hrefURI) {
hrefURI->GetAsciiHost(hostName);
rv = NS_URIChainHasFlags(hrefURI,
nsIProtocolHandler::URI_IS_LOCAL_RESOURCE,
&isLocalResource);
}
if (!hostName.IsEmpty() && NS_SUCCEEDED(rv) && !isLocalResource) {
if (IsNeckoChild()) {
gNeckoChild->SendHTMLDNSPrefetch(NS_ConvertUTF8toUTF16(hostName),
mEntries[mTail].mFlags);
} else {
nsCOMPtr<nsICancelable> tmpOutstanding;
nsresult rv = sDNSService->AsyncResolve(hostName,
mEntries[mTail].mFlags
| nsIDNSService::RESOLVE_SPECULATE,
sDNSListener, nullptr,
getter_AddRefs(tmpOutstanding));
rv = sDNSService->AsyncResolve(hostName,
mEntries[mTail].mFlags
| nsIDNSService::RESOLVE_SPECULATE,
sDNSListener, nullptr,
getter_AddRefs(tmpOutstanding));
// Tell link that deferred prefetch was requested
if (NS_SUCCEEDED(rv))
link->OnDNSPrefetchRequested();

View File

@ -5,7 +5,7 @@
#include "domstubs.idl"
[scriptable, uuid(30361a5b-a3b8-4dbc-b464-e08761abb123)]
[scriptable, uuid(b19038ba-0d75-40d2-be35-742e26d33bf9)]
interface nsITabParent : nsISupports
{
void injectTouchEvent(in AString aType,
@ -19,6 +19,8 @@ interface nsITabParent : nsISupports
in uint32_t count,
in long aModifiers);
void getChildProcessOffset(out int32_t aCssX, out int32_t aCssY);
readonly attribute boolean useAsyncPanZoom;
void setIsDocShellActive(in bool aIsActive);

View File

@ -1160,23 +1160,21 @@ bool TabParent::SendRealMouseEvent(WidgetMouseEvent& event)
return SendRealMouseButtonEvent(event);
}
CSSPoint TabParent::AdjustTapToChildWidget(const CSSPoint& aPoint)
LayoutDeviceToCSSScale
TabParent::GetLayoutDeviceToCSSScale()
{
nsCOMPtr<nsIContent> content = do_QueryInterface(mFrameElement);
nsIDocument* doc = (content ? content->OwnerDoc() : nullptr);
nsIPresShell* shell = (doc ? doc->GetShell() : nullptr);
nsPresContext* ctx = (shell ? shell->GetPresContext() : nullptr);
return LayoutDeviceToCSSScale(ctx
? (float)ctx->AppUnitsPerDevPixel() / nsPresContext::AppUnitsPerCSSPixel()
: 0.0f);
}
if (!content || !content->OwnerDoc()) {
return aPoint;
}
nsIDocument* doc = content->OwnerDoc();
if (!doc || !doc->GetShell()) {
return aPoint;
}
nsPresContext* presContext = doc->GetShell()->GetPresContext();
return aPoint + CSSPoint(
presContext->DevPixelsToFloatCSSPixels(mChildProcessOffsetAtTouchStart.x),
presContext->DevPixelsToFloatCSSPixels(mChildProcessOffsetAtTouchStart.y));
CSSPoint TabParent::AdjustTapToChildWidget(const CSSPoint& aPoint)
{
return aPoint + (LayoutDevicePoint(mChildProcessOffsetAtTouchStart) * GetLayoutDeviceToCSSScale());
}
bool TabParent::SendHandleSingleTap(const CSSPoint& aPoint, const ScrollableLayerGuid& aGuid)
@ -1759,6 +1757,18 @@ TabParent::RecvEnableDisableCommands(const nsString& aAction,
return true;
}
NS_IMETHODIMP
TabParent::GetChildProcessOffset(int32_t* aOutCssX, int32_t* aOutCssY)
{
NS_ENSURE_ARG(aOutCssX);
NS_ENSURE_ARG(aOutCssY);
CSSPoint offset = LayoutDevicePoint(GetChildProcessOffset())
* GetLayoutDeviceToCSSScale();
*aOutCssX = offset.x;
*aOutCssY = offset.y;
return NS_OK;
}
LayoutDeviceIntPoint
TabParent::GetChildProcessOffset()
{

View File

@ -264,6 +264,7 @@ public:
bool MapEventCoordinatesForChildProcess(mozilla::WidgetEvent* aEvent);
void MapEventCoordinatesForChildProcess(const LayoutDeviceIntPoint& aOffset,
mozilla::WidgetEvent* aEvent);
LayoutDeviceToCSSScale GetLayoutDeviceToCSSScale();
virtual bool RecvRequestNativeKeyBindings(const mozilla::WidgetKeyboardEvent& aEvent,
MaybeNativeKeyBinding* aBindings) MOZ_OVERRIDE;

View File

@ -205,7 +205,7 @@ public:
jni::Object::LocalRef buffer(env);
NS_ENSURE_SUCCESS_VOID(aFormat->GetByteBuffer(NS_LITERAL_STRING("csd-0"), &buffer));
if (!buffer) {
if (!buffer && aConfig.audio_specific_config->Length() >= 2) {
csd0[0] = (*aConfig.audio_specific_config)[0];
csd0[1] = (*aConfig.audio_specific_config)[1];

View File

@ -247,4 +247,14 @@ void GonkAudioDecoderManager::ReleaseAudioBuffer() {
}
}
nsresult
GonkAudioDecoderManager::Flush()
{
GonkDecoderManager::Flush();
status_t err = mDecoder->flush();
if (err != OK) {
return NS_ERROR_FAILURE;
}
return NS_OK;
}
} // namespace mozilla

View File

@ -32,6 +32,8 @@ public:
virtual nsresult Output(int64_t aStreamOffset,
nsRefPtr<MediaData>& aOutput) MOZ_OVERRIDE;
virtual nsresult Flush() MOZ_OVERRIDE;
protected:
virtual bool PerformFormatSpecificProcess(mp4_demuxer::MP4Sample* aSample) MOZ_OVERRIDE;

View File

@ -234,7 +234,7 @@ GonkMediaDataDecoder::Flush()
// it's executing at all. Note the MP4Reader ignores all output while
// flushing.
mTaskQueue->Flush();
mDrainComplete = false;
return mManager->Flush();
}

View File

@ -224,25 +224,15 @@ GStreamerFormatHelper::IsBlacklistEnabled()
}
/* static */ bool
GStreamerFormatHelper::IsPluginFeatureBlacklisted(GstPluginFeature *aFeature,
FactoryType aTypes)
GStreamerFormatHelper::IsPluginFeatureBlacklisted(GstPluginFeature *aFeature)
{
if (!IsBlacklistEnabled()) {
return false;
}
const gchar *className =
gst_element_factory_get_klass(GST_ELEMENT_FACTORY_CAST(aFeature));
const gchar *factoryName =
gst_plugin_feature_get_name(aFeature);
if ((!(aTypes & FactoryTypeDecoder) && strstr(className, "Decoder")) ||
(!(aTypes & FactoryTypeDemuxer) && strstr(className, "Demuxer")) ||
(!(aTypes & FactoryTypeParser) && strstr(className, "Parser"))) {
return false;
}
for (unsigned int i = 0; i < G_N_ELEMENTS(sPluginBlacklist); i++) {
if (!strcmp(factoryName, sPluginBlacklist[i])) {
return true;
@ -258,8 +248,16 @@ static gboolean FactoryFilter(GstPluginFeature *aFeature, gpointer)
return FALSE;
}
return !GStreamerFormatHelper::IsPluginFeatureBlacklisted(aFeature,
(FactoryType)(FactoryTypeDecoder|FactoryTypeDemuxer));
const gchar *className =
gst_element_factory_get_klass(GST_ELEMENT_FACTORY_CAST(aFeature));
if (!strstr(className, "Decoder") && !strstr(className, "Demux")) {
return FALSE;
}
return
gst_plugin_feature_get_rank(aFeature) >= GST_RANK_MARGINAL &&
!GStreamerFormatHelper::IsPluginFeatureBlacklisted(aFeature);
}
/**

View File

@ -13,13 +13,6 @@
namespace mozilla {
enum FactoryType {
FactoryTypeDecoder = 1 << 0,
FactoryTypeDemuxer = 1 << 1,
FactoryTypeParser = 1 << 2,
FactoryTypeAll = FactoryTypeDecoder|FactoryTypeDemuxer|FactoryTypeParser
};
class GStreamerFormatHelper {
/* This class can be used to query the GStreamer registry for the required
* demuxers/decoders from nsHTMLMediaElement::CanPlayType.
@ -37,8 +30,7 @@ class GStreamerFormatHelper {
bool CanHandleCodecCaps(GstCaps* aCaps);
static bool IsBlacklistEnabled();
static bool IsPluginFeatureBlacklisted(GstPluginFeature *aFeature,
FactoryType aTypes = FactoryTypeAll);
static bool IsPluginFeatureBlacklisted(GstPluginFeature *aFeature);
static GstCaps* ConvertFormatsToCaps(const char* aMIMEType,
const nsAString* aCodecs);

View File

@ -87,67 +87,6 @@ ToCryptoString(CryptoSample& aCrypto)
return res;
}
TEST(MP4Demuxer, CENC)
{
nsRefPtr<MP4DemuxerBinding> b = new MP4DemuxerBinding("short-cenc.mp4");
MonitorAutoLock mon(b->mMonitor);
MP4Demuxer* d = b->demuxer;
EXPECT_TRUE(d->Init());
const char* video[] = {
"1 16 7e571d017e571d017e571d017e571d01 00000000000000000000000000000000 5,686 5,388",
"1 16 7e571d017e571d017e571d017e571d01 00000000000000000000000000000044 5,717",
"1 16 7e571d017e571d017e571d017e571d01 00000000000000000000000000000071 5,613",
"1 16 7e571d017e571d017e571d017e571d01 00000000000000000000000000000098 5,196",
"1 16 7e571d017e571d017e571d017e571d01 000000000000000000000000000000a5 5,213",
"1 16 7e571d017e571d017e571d017e571d01 000000000000000000000000000000b3 5,213",
"1 16 7e571d017e571d017e571d017e571d01 000000000000000000000000000000c1 5,384",
"1 16 7e571d017e571d017e571d017e571d01 000000000000000000000000000000d9 5,256",
"1 16 7e571d017e571d017e571d017e571d01 000000000000000000000000000000e9 5,245",
"1 16 7e571d017e571d017e571d017e571d01 000000000000000000000000000000f9 5,251",
};
MP4Sample* sample;
size_t i = 0;
while (!!(sample = d->DemuxVideoSample())) {
nsCString text = ToCryptoString(sample->crypto);
EXPECT_STREQ(video[i++], text.get());
}
EXPECT_EQ(ArrayLength(video), i);
const char* audio[] = {
"1 16 7e571d027e571d027e571d027e571d02 00000000000000000000000000000000 0,371",
"1 16 7e571d027e571d027e571d027e571d02 00000000000000000000000000000018 0,372",
"1 16 7e571d027e571d027e571d027e571d02 00000000000000000000000000000030 0,371",
"1 16 7e571d027e571d027e571d027e571d02 00000000000000000000000000000048 0,372",
"1 16 7e571d027e571d027e571d027e571d02 00000000000000000000000000000060 0,371",
"1 16 7e571d027e571d027e571d027e571d02 00000000000000000000000000000078 0,372",
"1 16 7e571d027e571d027e571d027e571d02 00000000000000000000000000000090 0,371",
"1 16 7e571d027e571d027e571d027e571d02 000000000000000000000000000000a8 0,372",
"1 16 7e571d027e571d027e571d027e571d02 000000000000000000000000000000c0 0,371",
"1 16 7e571d027e571d027e571d027e571d02 000000000000000000000000000000d8 0,372",
"1 16 7e571d027e571d027e571d027e571d02 000000000000000000000000000000f0 0,371",
"1 16 7e571d027e571d027e571d027e571d02 00000000000000000000000000000108 0,372",
"1 16 7e571d027e571d027e571d027e571d02 00000000000000000000000000000120 0,371",
"1 16 7e571d027e571d027e571d027e571d02 00000000000000000000000000000138 0,372",
"1 16 7e571d027e571d027e571d027e571d02 00000000000000000000000000000150 0,371",
"1 16 7e571d027e571d027e571d027e571d02 00000000000000000000000000000168 0,372",
"1 16 7e571d027e571d027e571d027e571d02 00000000000000000000000000000180 0,371",
"1 16 7e571d027e571d027e571d027e571d02 00000000000000000000000000000198 0,372",
"1 16 7e571d027e571d027e571d027e571d02 000000000000000000000000000001b0 0,371",
"1 16 7e571d027e571d027e571d027e571d02 000000000000000000000000000001c8 0,372",
"1 16 7e571d027e571d027e571d027e571d02 000000000000000000000000000001e0 0,371",
};
i = 0;
while (!!(sample = d->DemuxAudioSample())) {
nsCString text = ToCryptoString(sample->crypto);
EXPECT_STREQ(audio[i++], text.get());
}
EXPECT_EQ(ArrayLength(audio), i);
}
TEST(MP4Demuxer, CENCFrag)
{
nsRefPtr<MP4DemuxerBinding> b = new MP4DemuxerBinding("gizmo-frag.mp4");

View File

@ -25,7 +25,6 @@ if CONFIG['MOZ_WEBM_ENCODER']:
TEST_HARNESS_FILES.gtest += [
'../test/gizmo-frag.mp4',
'../test/gizmo.mp4',
'../test/short-cenc.mp4',
'dash_dashinit.mp4',
'mediasource_test.mp4',
'test.webm',

View File

@ -645,29 +645,6 @@ var gMetadataTests = [
// Test files for Encrypted Media Extensions
var gEMETests = [
{
name:"short-cenc.mp4",
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
keys: {
// "keyid" : "key"
"7e571d017e571d017e571d017e571d01" : "7e5711117e5711117e5711117e571111",
"7e571d027e571d027e571d027e571d02" : "7e5722227e5722227e5722227e572222",
},
sessionType:"temporary",
duration:0.47
},
{
name:"short-cenc.mp4",
type:"video/mp4; codecs=\"avc1.64000d,mp4a.40.2\"",
keys: {
// "keyid" : "key"
"7e571d017e571d017e571d017e571d01" : "7e5711117e5711117e5711117e571111",
"7e571d027e571d027e571d027e571d02" : "7e5722227e5722227e5722227e572222",
},
sessionType:"temporary",
duration:0.47,
crossOrigin:true,
},
{
name:"gizmo-frag-cencinit.mp4",
fragments: [ "gizmo-frag-cencinit.mp4", "gizmo-frag-cenc1.m4s", "gizmo-frag-cenc2.m4s" ],

View File

@ -233,7 +233,6 @@ support-files =
seek_with_sound.ogg^headers^
sine.webm
sine.webm^headers^
short-cenc.mp4
short-video.ogv
short-video.ogv^headers^
small-shot-mp3.mp4

Binary file not shown.

View File

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
This XML file describes the encryption applied to short-cenc.mp4. To generate
short-cenc, run the following command:
MP4Box -crypt short-cenc.xml -out short-cenc.mp4 short.mp4
-->
<GPACDRM type="CENC AES-CTR">
<DRMInfo type="pssh" version="1">
<!--
SystemID specified in
https://dvcs.w3.org/hg/html-media/raw-file/tip/encrypted-media/cenc-format.html
-->
<BS ID128="1077efecc0b24d02ace33c1e52e2fb4b" />
<!-- Number of KeyIDs = 2 -->
<BS bits="32" value="2" />
<!-- KeyID -->
<BS ID128="0x7e571d017e571d017e571d017e571d01" />
<BS ID128="0x7e571d027e571d027e571d027e571d02" />
</DRMInfo>
<CrypTrack trackID="1" isEncrypted="1" IV_size="16" saiSavedBox="senc"
first_IV="0x00000000000000000000000000000000">
<key KID="0x7e571d017e571d017e571d017e571d01"
value="0x7e5711117e5711117e5711117e571111" />
</CrypTrack>
<CrypTrack trackID="2" isEncrypted="1" IV_size="16" saiSavedBox="senc"
first_IV="0x00000000000000000000000000000000">
<key KID="0x7e571d027e571d027e571d027e571d02"
value="0x7e5722227e5722227e5722227e572222" />
</CrypTrack>
</GPACDRM>

View File

@ -537,9 +537,9 @@ AngleOfVector(const Point& aVector)
}
static float
AngleOfVectorF(const Point& aVector)
AngleOfVector(const Point& cp1, const Point& cp2)
{
return static_cast<float>(AngleOfVector(aVector));
return static_cast<float>(AngleOfVector(cp1 - cp2));
}
void
@ -573,7 +573,7 @@ SVGPathData::GetMarkerPositioningData(nsTArray<nsSVGMark> *aMarks) const
{
case PATHSEG_CLOSEPATH:
segEnd = pathStart;
segStartAngle = segEndAngle = AngleOfVectorF(segEnd - segStart);
segStartAngle = segEndAngle = AngleOfVector(segEnd, segStart);
break;
case PATHSEG_MOVETO_ABS:
@ -586,7 +586,7 @@ SVGPathData::GetMarkerPositioningData(nsTArray<nsSVGMark> *aMarks) const
pathStart = segEnd;
// If authors are going to specify multiple consecutive moveto commands
// with markers, me might as well make the angle do something useful:
segStartAngle = segEndAngle = AngleOfVectorF(segEnd - segStart);
segStartAngle = segEndAngle = AngleOfVector(segEnd, segStart);
i += 2;
break;
@ -597,7 +597,7 @@ SVGPathData::GetMarkerPositioningData(nsTArray<nsSVGMark> *aMarks) const
} else {
segEnd = segStart + Point(mData[i], mData[i+1]);
}
segStartAngle = segEndAngle = AngleOfVectorF(segEnd - segStart);
segStartAngle = segEndAngle = AngleOfVector(segEnd, segStart);
i += 2;
break;
@ -615,14 +615,10 @@ SVGPathData::GetMarkerPositioningData(nsTArray<nsSVGMark> *aMarks) const
segEnd = segStart + Point(mData[i+4], mData[i+5]);
}
prevCP = cp2;
if (cp1 == segStart) {
cp1 = cp2;
}
if (cp2 == segEnd) {
cp2 = cp1;
}
segStartAngle = AngleOfVectorF(cp1 - segStart);
segEndAngle = AngleOfVectorF(segEnd - cp2);
segStartAngle =
AngleOfVector(cp1 == segStart ? (cp1 == cp2 ? segEnd : cp2) : cp1, segStart);
segEndAngle =
AngleOfVector(segEnd, cp2 == segEnd ? (cp1 == cp2 ? segStart : cp1) : cp2);
i += 6;
break;
}
@ -630,7 +626,7 @@ SVGPathData::GetMarkerPositioningData(nsTArray<nsSVGMark> *aMarks) const
case PATHSEG_CURVETO_QUADRATIC_ABS:
case PATHSEG_CURVETO_QUADRATIC_REL:
{
Point cp1, cp2; // control points
Point cp1; // control point
if (segType == PATHSEG_CURVETO_QUADRATIC_ABS) {
cp1 = Point(mData[i], mData[i+1]);
segEnd = Point(mData[i+2], mData[i+3]);
@ -639,8 +635,8 @@ SVGPathData::GetMarkerPositioningData(nsTArray<nsSVGMark> *aMarks) const
segEnd = segStart + Point(mData[i+2], mData[i+3]);
}
prevCP = cp1;
segStartAngle = AngleOfVectorF(cp1 - segStart);
segEndAngle = AngleOfVectorF(segEnd - cp1);
segStartAngle = AngleOfVector(cp1 == segStart ? segEnd : cp1, segStart);
segEndAngle = AngleOfVector(segEnd, cp1 == segEnd ? segStart : cp1);
i += 4;
break;
}
@ -680,7 +676,7 @@ SVGPathData::GetMarkerPositioningData(nsTArray<nsSVGMark> *aMarks) const
if (rx == 0.0 || ry == 0.0) {
// F.6.6 step 1 - straight line or coincidental points
segStartAngle = segEndAngle = AngleOfVectorF(segEnd - segStart);
segStartAngle = segEndAngle = AngleOfVector(segEnd, segStart);
i += 7;
break;
}
@ -755,7 +751,7 @@ SVGPathData::GetMarkerPositioningData(nsTArray<nsSVGMark> *aMarks) const
} else {
segEnd = segStart + Point(mData[i++], 0.0f);
}
segStartAngle = segEndAngle = AngleOfVectorF(segEnd - segStart);
segStartAngle = segEndAngle = AngleOfVector(segEnd, segStart);
break;
case PATHSEG_LINETO_VERTICAL_ABS:
@ -765,7 +761,7 @@ SVGPathData::GetMarkerPositioningData(nsTArray<nsSVGMark> *aMarks) const
} else {
segEnd = segStart + Point(0.0f, mData[i++]);
}
segStartAngle = segEndAngle = AngleOfVectorF(segEnd - segStart);
segStartAngle = segEndAngle = AngleOfVector(segEnd, segStart);
break;
case PATHSEG_CURVETO_CUBIC_SMOOTH_ABS:
@ -782,14 +778,10 @@ SVGPathData::GetMarkerPositioningData(nsTArray<nsSVGMark> *aMarks) const
segEnd = segStart + Point(mData[i+2], mData[i+3]);
}
prevCP = cp2;
if (cp1 == segStart) {
cp1 = cp2;
}
if (cp2 == segEnd) {
cp2 = cp1;
}
segStartAngle = AngleOfVectorF(cp1 - segStart);
segEndAngle = AngleOfVectorF(segEnd - cp2);
segStartAngle =
AngleOfVector(cp1 == segStart ? (cp1 == cp2 ? segEnd : cp2) : cp1, segStart);
segEndAngle =
AngleOfVector(segEnd, cp2 == segEnd ? (cp1 == cp2 ? segStart : cp1) : cp2);
i += 4;
break;
}
@ -799,15 +791,14 @@ SVGPathData::GetMarkerPositioningData(nsTArray<nsSVGMark> *aMarks) const
{
Point cp1 = SVGPathSegUtils::IsQuadraticType(prevSegType) ?
segStart * 2 - prevCP : segStart;
Point cp2;
if (segType == PATHSEG_CURVETO_QUADRATIC_SMOOTH_ABS) {
segEnd = Point(mData[i], mData[i+1]);
} else {
segEnd = segStart + Point(mData[i], mData[i+1]);
}
prevCP = cp1;
segStartAngle = AngleOfVectorF(cp1 - segStart);
segEndAngle = AngleOfVectorF(segEnd - cp1);
segStartAngle = AngleOfVector(cp1 == segStart ? segEnd : cp1, segStart);
segEndAngle = AngleOfVector(segEnd, cp1 == segEnd ? segStart : cp1);
i += 2;
break;
}

View File

@ -42,11 +42,11 @@ if (OfflineTest.setup()) {
updateStateChanged: function (aUpdate, aState) {
switch(aState) {
case Ci.nsIOfflineCacheUpdateObserver.STATE_ERROR:
aUpdate.removeObserver(this);
errorReceived = true;
OfflineTest.ok(true, "Expected error. Update canceled");
break;
case Ci.nsIOfflineCacheUpdateObserver.STATE_FINISHED:
aUpdate.removeObserver(this);
OfflineTest.ok(errorReceived,
"Finished after receiving the expected error");
finish();

View File

@ -88,6 +88,7 @@ var ecmaGlobals =
{name: "Atomics", nightly: true},
"StopIteration",
"String",
"Symbol",
"SyntaxError",
{name: "TypedObject", nightly: true},
"TypeError",
@ -102,12 +103,6 @@ var ecmaGlobals =
// IMPORTANT: Do not change the list above without review from
// a JavaScript Engine peer!
// Symbol is conditionally defined.
// If it's defined, insert "Symbol" before "SyntaxError".
if (typeof Symbol === "function") {
ecmaGlobals.splice(ecmaGlobals.indexOf("SyntaxError"), 0, "Symbol");
}
// IMPORTANT: Do not change the list below without review from a DOM peer,
// except to remove items from it!
//

View File

@ -420,3 +420,10 @@ partial interface Navigator {
optional sequence<MediaKeySystemOptions> supportedConfigurations);
};
#endif
#ifdef NIGHTLY_BUILD
partial interface Navigator {
[Func="Navigator::IsE10sEnabled"]
readonly attribute boolean mozE10sEnabled;
};
#endif

View File

@ -18,6 +18,8 @@ interface Response {
readonly attribute ResponseType type;
readonly attribute USVString url;
[Throws]
attribute boolean finalURL;
readonly attribute unsigned short status;
readonly attribute boolean ok;
readonly attribute ByteString statusText;

View File

@ -66,6 +66,25 @@ function testOk() {
ok(!r4.ok, "Response with status 302 should have ok false");
}
// It is not possible to test setting finalURL until we have ServiceWorker
// interception. This is because synthetic Responses do not have a url, the url
// is set based on the request, so a SW could initiate a fetch() on behalf of
// a client and set the resulting Response's finalURL before returning it to
// the client, in which case the "set response's url to request's url" from the
// client's point of view would not happen. A test for this will be added by
// Bug 1134352.
function testFinalURL() {
var r1 = new Response();
ok(!r1.finalURL, "Response.finalURL is false by default.");
try {
r1.finalURL = true;
ok(false, "Setting Response.finalURL of Response with null url should fail.");
} catch(e) {
ok(true, "Setting Response.finalURL of Response with null url should fail.");
}
}
function testBodyUsed() {
var res = new Response("Sample body");
ok(!res.bodyUsed, "bodyUsed is initially false.");
@ -153,6 +172,7 @@ onmessage = function() {
testClone();
testRedirect();
testOk();
testFinalURL();
Promise.resolve()
.then(testBodyCreation)

View File

@ -62,6 +62,7 @@ var ecmaGlobals =
{name: "Atomics", nightly: true},
"StopIteration",
"String",
"Symbol",
"SyntaxError",
{name: "TypedObject", nightly: true},
"TypeError",
@ -76,12 +77,6 @@ var ecmaGlobals =
// IMPORTANT: Do not change the list above without review from
// a JavaScript Engine peer!
// Symbol is conditionally defined.
// If it's defined, insert "Symbol" before "SyntaxError".
if (typeof Symbol === "function") {
ecmaGlobals.splice(ecmaGlobals.indexOf("SyntaxError"), 0, "Symbol");
}
// IMPORTANT: Do not change the list below without review from a DOM peer!
var interfaceNamesInGlobalScope =
[

View File

@ -86,7 +86,6 @@ public:
TextureChild()
: mForwarder(nullptr)
, mTextureClient(nullptr)
, mKeep(nullptr)
, mIPCOpen(false)
{
}
@ -135,7 +134,7 @@ private:
RefPtr<CompositableForwarder> mForwarder;
RefPtr<TextureClient> mWaitForRecycle;
TextureClient* mTextureClient;
KeepAlive* mKeep;
UniquePtr<KeepAlive> mKeep;
bool mIPCOpen;
friend class TextureClient;
@ -154,7 +153,7 @@ TextureChild::ActorDestroy(ActorDestroyReason why)
mTextureClient->mActor = nullptr;
}
mWaitForRecycle = nullptr;
delete mKeep;
mKeep = nullptr;
}
// static
@ -496,11 +495,11 @@ TextureClient::~TextureClient()
}
void
TextureClient::KeepUntilFullDeallocation(KeepAlive* aKeep)
TextureClient::KeepUntilFullDeallocation(UniquePtr<KeepAlive> aKeep)
{
MOZ_ASSERT(mActor);
MOZ_ASSERT(!mActor->mKeep);
mActor->mKeep = aKeep;
mActor->mKeep = Move(aKeep);
}
void TextureClient::ForceRemove(bool sync)

View File

@ -403,7 +403,7 @@ public:
* It's a temporary hack to ensure that DXGI textures don't get destroyed
* between serialization and deserialization.
*/
void KeepUntilFullDeallocation(KeepAlive* aKeep);
void KeepUntilFullDeallocation(UniquePtr<KeepAlive> aKeep);
/**
* Create and init the TextureChild/Parent IPDL actor pair.

View File

@ -179,9 +179,9 @@ TextureClientD3D11::~TextureClientD3D11()
{
if (mActor) {
if (mTexture) {
KeepUntilFullDeallocation(new TKeepAlive<ID3D10Texture2D>(mTexture10));
KeepUntilFullDeallocation(MakeUnique<TKeepAlive<ID3D10Texture2D>>(mTexture10));
} else if (mTexture10) {
KeepUntilFullDeallocation(new TKeepAlive<ID3D11Texture2D>(mTexture));
KeepUntilFullDeallocation(MakeUnique<TKeepAlive<ID3D11Texture2D>>(mTexture));
}
}
#ifdef DEBUG

View File

@ -739,7 +739,7 @@ SharedTextureClientD3D9::SharedTextureClientD3D9(ISurfaceAllocator* aAllocator,
SharedTextureClientD3D9::~SharedTextureClientD3D9()
{
if (mTexture && mActor) {
KeepUntilFullDeallocation(new TKeepAlive<IDirect3DTexture9>(mTexture));
KeepUntilFullDeallocation(MakeUnique<TKeepAlive<IDirect3DTexture9>>(mTexture));
}
if (mTexture) {
gfxWindowsPlatform::sD3D9SharedTextureUsed -= mDesc.Width * mDesc.Height * 4;

View File

@ -266,7 +266,9 @@ public:
mTexture = aTexture;
mHandle = aSharedHandle;
mDesc = aDesc;
gfxWindowsPlatform::sD3D9SharedTextureUsed += mDesc.Width * mDesc.Height * 4;
if (mTexture) {
gfxWindowsPlatform::sD3D9SharedTextureUsed += mDesc.Width * mDesc.Height * 4;
}
}
virtual gfx::IntSize GetSize() const

Binary file not shown.

After

Width:  |  Height:  |  Size: 634 B

View File

@ -0,0 +1,6 @@
<html>
<body onload="opener.doTest();">
<img id="left" style="width: 201px; height: 201px;" src="bug1132427.gif">
<img id="right" src="bug1132427.gif">
</body>
</html>

View File

@ -28,6 +28,8 @@ support-files =
rillybad.jpg
transparent.gif
transparent.png
bug1132427.html
bug1132427.gif
[test_animSVGImage.html]
[test_animSVGImage2.html]
@ -50,3 +52,4 @@ disabled = bug 1101415
[test_undisplayed_iframe.html]
disabled = bug 1060869
[test_xultree_animation.xhtml]
[test_bug1132427.html]

View File

@ -0,0 +1,96 @@
<!DOCTYPE HTML>
<html>
<head>
<title>Test for scrolling selection into view</title>
<script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="text/javascript" src="chrome://mochikit/content/tests/SimpleTest/WindowSnapshot.js"></script>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
</head>
<body>
<pre id="test">
<script class="testbody" type="text/javascript">
// We open a window which contains two copies of the same gif. One at a scaled size, one at the
// natural image size. We rely on the bug only showing up in the scaled image. The gif has three
// frames and a delay of 100ms. The first is all white. The second has a very small update area
// in the upper left, it changes the pixels to slightly off white. The third changes all the
// pixels to blue. When the bug appears we only update the upper left pixels when looping around
// from the last frame to the first frame. We compare a middle pixel of the two images to make
// sure that they are the same at 100ms for a second. If the bug appears then the middle pixel
// on the scaled image will always be blue and so should not match the middle pixel on the
// unscaled image which should be white two thirds of the time. If the timers fire at bad times
// and only fire when both frames are displaying blue we won't be able to detect this bug and the
// test will pass without testing anything important, but that's not a big deal. That should be
// rare enough, and the next time the test is run will should do proper testing.
SimpleTest.waitForExplicitFinish();
addLoadEvent(openWindow);
var win = null;
function openWindow() {
win = window.open("bug1132427.html",
"", "scrollbars=yes,toolbar,menubar,width=600,height=800");
win.addEventListener("load", doTest, false);
win.focus();
}
function doTest() {
setTimeout(continueTest, 1000);
}
function checkPixel(canvas, context, x1, y1, x2, y2) {
var pix = context.getImageData(0, 0, canvas.width, canvas.height).data;
for (var i = 0; i < 4; i++) {
is(pix[4 * (y1 * canvas.width + x1) + i], pix[4 * (y2 * canvas.width + x2) + i], "pixels should match");
}
}
var iterationsLeft = 10;
function continueTest() {
// we need to drawWindow the chrome window so we can get a dump of the retained widget layers
// if we have to repaint to fulfill this drawWindow request then it will be impossible to
// observe the bug
var chromewin = win.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIWebNavigation)
.QueryInterface(Components.interfaces.nsIDocShellTreeItem)
.rootTreeItem
.QueryInterface(Components.interfaces.nsIInterfaceRequestor)
.getInterface(Components.interfaces.nsIDOMWindow);
var el = window.document.createElementNS("http://www.w3.org/1999/xhtml", "canvas");
el.width = chromewin.innerWidth;
el.height = chromewin.innerHeight;
var ctx = el.getContext("2d");
// pass the correct flags so we don't have to flush the retained layers
ctx.drawWindow(chromewin, 0, 0, chromewin.innerWidth, chromewin.innerHeight, "rgba(0,0,0,0)",
ctx.DRAWWINDOW_USE_WIDGET_LAYERS | ctx.DRAWWINDOW_DRAW_VIEW | ctx.DRAWWINDOW_DRAW_CARET);
var leftbox = win.document.getElementById("left").getBoundingClientRect();
var rightbox = win.document.getElementById("right").getBoundingClientRect();
// this is actually chrome on left and right, but in practice we have none so it doesn't matter
var chromeleft = win.outerWidth - win.innerWidth;
// this is actually chrome on top and bottom, but bottom chrome is usually small to none and we have
// 100px to spare in hitting the middle of the image elements (they are 200x200)
var chrometop = win.outerHeight - win.innerHeight;
// compare the middle of the two image elements
checkPixel(el, ctx, chromeleft + leftbox.left + Math.floor(leftbox.width/2), chrometop + leftbox.top + Math.floor(leftbox.height/2),
chromeleft + rightbox.left + Math.floor(rightbox.width/2), chrometop + rightbox.top + Math.floor(rightbox.height/2));
iterationsLeft--;
if (iterationsLeft > 0) {
// now test 100ms later, we should have the next frame of the gif then
setTimeout(continueTest, 100);
} else {
win.close();
SimpleTest.finish();
}
}
</script>
</pre>
</body>
</html>

View File

@ -80,9 +80,47 @@ nsHyphenator::Hyphenate(const nsAString& aString,
}
if (inWord) {
const char16_t *begin = aString.BeginReading();
NS_ConvertUTF16toUTF8 utf8(begin + wordStart,
wordLimit - wordStart);
// Convert the word to utf-8 for libhyphen, lowercasing it as we go
// so that it will match the (lowercased) patterns (bug 1105644).
nsAutoCString utf8;
const char16_t* const begin = aString.BeginReading();
const char16_t *cur = begin + wordStart;
const char16_t *end = begin + wordLimit;
while (cur < end) {
uint32_t ch = *cur++;
if (NS_IS_HIGH_SURROGATE(ch)) {
if (cur < end && NS_IS_LOW_SURROGATE(*cur)) {
ch = SURROGATE_TO_UCS4(ch, *cur++);
} else {
ch = 0xfffd; // unpaired surrogate, treat as REPLACEMENT CHAR
}
} else if (NS_IS_LOW_SURROGATE(ch)) {
ch = 0xfffd; // unpaired surrogate
}
// XXX What about language-specific casing? Consider Turkish I/i...
// In practice, it looks like the current patterns will not be
// affected by this, as they treat dotted and undotted i similarly.
ch = ToLowerCase(ch);
if (ch < 0x80) { // U+0000 - U+007F
utf8.Append(ch);
} else if (ch < 0x0800) { // U+0100 - U+07FF
utf8.Append(0xC0 | (ch >> 6));
utf8.Append(0x80 | (0x003F & ch));
} else if (ch < 0x10000) { // U+0800 - U+D7FF,U+E000 - U+FFFF
utf8.Append(0xE0 | (ch >> 12));
utf8.Append(0x80 | (0x003F & (ch >> 6)));
utf8.Append(0x80 | (0x003F & ch));
} else {
utf8.Append(0xF0 | (ch >> 18));
utf8.Append(0x80 | (0x003F & (ch >> 12)));
utf8.Append(0x80 | (0x003F & (ch >> 6)));
utf8.Append(0x80 | (0x003F & ch));
}
}
nsAutoTArray<char,200> utf8hyphens;
utf8hyphens.SetLength(utf8.Length() + 5);
char **rep = nullptr;

View File

@ -263,9 +263,10 @@ enum GCProgress {
struct JS_PUBLIC_API(GCDescription) {
bool isCompartment_;
JSGCInvocationKind invocationKind_;
explicit GCDescription(bool isCompartment)
: isCompartment_(isCompartment) {}
GCDescription(bool isCompartment, JSGCInvocationKind kind)
: isCompartment_(isCompartment), invocationKind_(kind) {}
char16_t *formatMessage(JSRuntime *rt) const;
char16_t *formatJSON(JSRuntime *rt, uint64_t timestamp) const;

View File

@ -1017,23 +1017,24 @@ Select(JSContext *cx, unsigned argc, Value *vp)
template<class VElem, unsigned NumElem>
static bool
TypedArrayFromArgs(JSContext *cx, const CallArgs &args,
MutableHandle<TypedArrayObject*> typedArray, int32_t *byteStart)
MutableHandleObject typedArray, int32_t *byteStart)
{
if (!args[0].isObject())
return ErrorBadArgs(cx);
JSObject &argobj = args[0].toObject();
if (!argobj.is<TypedArrayObject>())
if (!IsAnyTypedArray(&argobj))
return ErrorBadArgs(cx);
typedArray.set(&argobj.as<TypedArrayObject>());
typedArray.set(&argobj);
int32_t index;
if (!ToInt32(cx, args[1], &index))
return false;
*byteStart = index * typedArray->bytesPerElement();
if (*byteStart < 0 || (uint32_t(*byteStart) + NumElem * sizeof(VElem)) > typedArray->byteLength())
*byteStart = index * AnyTypedArrayBytesPerElement(typedArray);
if (*byteStart < 0 ||
(uint32_t(*byteStart) + NumElem * sizeof(VElem)) > AnyTypedArrayByteLength(typedArray))
{
// Keep in sync with AsmJS OnOutOfBounds function.
JS_ReportErrorNumber(cx, js_GetErrorMessage, nullptr, JSMSG_BAD_INDEX);
@ -1054,7 +1055,7 @@ Load(JSContext *cx, unsigned argc, Value *vp)
return ErrorBadArgs(cx);
int32_t byteStart;
Rooted<TypedArrayObject*> typedArray(cx);
RootedObject typedArray(cx);
if (!TypedArrayFromArgs<Elem, NumElem>(cx, args, &typedArray, &byteStart))
return false;
@ -1064,7 +1065,7 @@ Load(JSContext *cx, unsigned argc, Value *vp)
if (!result)
return false;
Elem *src = reinterpret_cast<Elem*>(static_cast<char*>(typedArray->viewData()) + byteStart);
Elem *src = reinterpret_cast<Elem*>(static_cast<char*>(AnyTypedArrayViewData(typedArray)) + byteStart);
Elem *dst = reinterpret_cast<Elem*>(result->typedMem());
memcpy(dst, src, sizeof(Elem) * NumElem);
@ -1083,7 +1084,7 @@ Store(JSContext *cx, unsigned argc, Value *vp)
return ErrorBadArgs(cx);
int32_t byteStart;
Rooted<TypedArrayObject*> typedArray(cx);
RootedObject typedArray(cx);
if (!TypedArrayFromArgs<Elem, NumElem>(cx, args, &typedArray, &byteStart))
return false;
@ -1091,7 +1092,7 @@ Store(JSContext *cx, unsigned argc, Value *vp)
return ErrorBadArgs(cx);
Elem *src = TypedObjectMemory<Elem*>(args[2]);
Elem *dst = reinterpret_cast<Elem*>(static_cast<char*>(typedArray->viewData()) + byteStart);
Elem *dst = reinterpret_cast<Elem*>(static_cast<char*>(AnyTypedArrayViewData(typedArray)) + byteStart);
memcpy(dst, src, sizeof(Elem) * NumElem);
args.rval().setObject(args[2].toObject());

View File

@ -111,29 +111,22 @@ $SOURCE/js/src/configure $CONFIGURE_ARGS --enable-nspr-build --prefix=$OBJDIR/di
$MAKE -s -w -j4 || exit 2
cp -p $SOURCE/build/unix/run-mozilla.sh $OBJDIR/dist/bin
# The root analysis tests run in a special GC Zeal mode and disable ASLR to
# make tests reproducible.
COMMAND_PREFIX=''
# On Linux, disable ASLR to make shell builds a bit more reproducible.
if type setarch >/dev/null 2>&1; then
COMMAND_PREFIX="setarch $(uname -m) -R "
fi
if [[ "$VARIANT" = "rootanalysis" ]]; then
export JS_GC_ZEAL=7
# rootanalysis builds are currently only done on Linux, which should have
# setarch, but just in case we enable them on another platform:
if type setarch >/dev/null 2>&1; then
COMMAND_PREFIX="setarch $(uname -m) -R "
fi
elif [[ "$VARIANT" = "generational" ]]; then
# Generational is currently being used for compacting GC
export JS_GC_ZEAL=14
# Ignore timeouts from tests that are known to take too long with this zeal mode
export JITTEST_EXTRA_ARGS=--ignore-timeouts=$ABSDIR/cgc-jittest-timeouts.txt
# rootanalysis builds are currently only done on Linux, which should have
# setarch, but just in case we enable them on another platform:
if type setarch >/dev/null 2>&1; then
COMMAND_PREFIX="setarch $(uname -m) -R "
fi
fi
$COMMAND_PREFIX $MAKE check || exit 1

View File

@ -6292,7 +6292,10 @@ Parser<ParseHandler>::assignExpr(InvokedPrediction invoked)
if (!checkAndMarkAsAssignmentLhs(lhs, flavor))
return null();
bool saved = pc->inDeclDestructuring;
pc->inDeclDestructuring = false;
Node rhs = assignExpr();
pc->inDeclDestructuring = saved;
if (!rhs)
return null();

View File

@ -1005,7 +1005,7 @@ Statistics::beginSlice(const ZoneGCStats &zoneStats, JSGCInvocationKind gckind,
bool wasFullGC = zoneStats.isCollectingAllZones();
if (sliceCallback)
(*sliceCallback)(runtime, first ? JS::GC_CYCLE_BEGIN : JS::GC_SLICE_BEGIN,
JS::GCDescription(!wasFullGC));
JS::GCDescription(!wasFullGC, gckind));
}
}
@ -1029,7 +1029,7 @@ Statistics::endSlice()
bool wasFullGC = zoneStats.isCollectingAllZones();
if (sliceCallback)
(*sliceCallback)(runtime, last ? JS::GC_CYCLE_END : JS::GC_SLICE_END,
JS::GCDescription(!wasFullGC));
JS::GCDescription(!wasFullGC, gckind));
}
/* Do this after the slice callback since it uses these values. */

View File

@ -0,0 +1,10 @@
var a = 10;
function f1(a,
[b=(assertEq(a, 1), a=2, 42)],
{c:c=(assertEq(a, 2), a=3, 43)}) {
assertEq(a, 3);
assertEq(b, 42);
assertEq(c, 43);
}
f1(1, [], {});
assertEq(a, 10);

View File

@ -44,15 +44,13 @@ function getActualBirds() {
var code = `
"use asm";
var toF = global.Math.fround;
var u8 = new global.Uint8Array(buffer);
var f32 = new global.Float32Array(buffer);
const maxBirds = 100000;
const maxBirdsx4 = 400000;
const maxBirdsx4Plus4 = 400004;
const maxBirdsx4Plus8 = 400008;
const maxBirdsx4Plus12 = 400012;
const maxBirdsx8 = 800000;
const accelMask = 0x3c;
const mk2 = 0x000ffffc;
const mk4 = 0x000ffff0;
const getMaxPos = 1000.0;
const getAccelDataSteps = imp.accelDataSteps | 0;
@ -68,6 +66,8 @@ var code = `
var f4mul = f4.mul;
var f4greaterThan = f4.greaterThan;
var f4splat = f4.splat;
var f4load = f4.load;
var f4store = f4.store;
const zerox4 = f4(0.0,0.0,0.0,0.0);
@ -110,15 +110,8 @@ var code = `
for (i = 0; (i | 0) < (len | 0); i = (i + 16) | 0) {
accelIndex = 0;
// Work around unimplemented Float32x4Array
newPosx4 = f4(toF(f32[(i & mk2) >> 2]),
toF(f32[(i & mk2) + 4 >> 2]),
toF(f32[(i & mk2) + 8 >> 2]),
toF(f32[(i & mk2) + 12 >> 2]));
newVelx4 = f4(toF(f32[(i & mk2) + maxBirdsx4 >> 2]),
toF(f32[(i & mk2) + maxBirdsx4Plus4 >> 2]),
toF(f32[(i & mk2) + maxBirdsx4Plus8 >> 2]),
toF(f32[(i & mk2) + maxBirdsx4Plus12 >> 2]));
newPosx4 = f4load(u8, i & mk4);
newVelx4 = f4load(u8, (i & mk4) + maxBirdsx4);
for (a = 0; (a | 0) < (steps | 0); a = (a + 1) | 0) {
accel = toF(f32[(accelIndex & accelMask) + maxBirdsx8 >> 2]);
accelx4 = f4splat(accel);
@ -135,15 +128,8 @@ var code = `
newVelx4 = f4select(cmpx4, newVelTruex4, newVelx4);
}
}
// Work around unimplemented Float32x4Array
f32[(i & mk2) >> 2] = newPosx4.x;
f32[(i & mk2) + 4 >> 2] = newPosx4.y;
f32[(i & mk2) + 8 >> 2] = newPosx4.z;
f32[(i & mk2) + 12 >> 2] = newPosx4.w;
f32[(i & mk2) + maxBirdsx4 >> 2] = newVelx4.x;
f32[(i & mk2) + maxBirdsx4Plus4 >> 2] = newVelx4.y;
f32[(i & mk2) + maxBirdsx4Plus8 >> 2] = newVelx4.z;
f32[(i & mk2) + maxBirdsx4Plus12 >> 2] = newVelx4.w;
f4store(u8, i & mk4, newPosx4);
f4store(u8, (i & mk4) + maxBirdsx4, newVelx4);
}
}

View File

@ -151,10 +151,8 @@ assertEq(f(40), INT32_MAX + 1 | 0);
function testBadConversions(f) {
valueToConvert = {valueOf: function () { throw "FAIL"; }};
assertThrowsValue(() => f(40), "FAIL");
if (typeof Symbol === "function") {
valueToConvert = Symbol();
assertThrowsInstanceOf(() => f(40), TypeError);
}
valueToConvert = Symbol();
assertThrowsInstanceOf(() => f(40), TypeError);
}
testBadConversions(f);

View File

@ -116,11 +116,9 @@ assertAsmLinkFail(asmCompile('glob','foreign', USE_ASM + 'var i = foreign.x|0; f
assertEq(asmLink(asmCompile('glob','foreign', USE_ASM + 'var i = foreign.x|0; function f() { return i|0} return f'), null, {x:"blah"})(), 0);
assertEq(asmLink(asmCompile('glob','foreign', USE_ASM + 'var i = +foreign.x; function f() { return +i} return f'), null, {x:"blah"})(), NaN);
assertEq(asmLink(asmCompile('glob','foreign', USE_ASM + 'var tof = glob.Math.fround; var i = tof(foreign.x); function f() { return +i} return f'), this, {x:"blah"})(), NaN);
if (typeof Symbol === "function") {
assertThrowsInstanceOf(() => asmCompile('glob','foreign',USE_ASM + 'var i = foreign.x|0; function f() { return i|0} return f')(null, {x:Symbol("blah")}), TypeError);
assertThrowsInstanceOf(() => asmCompile('glob','foreign',USE_ASM + 'var i = +foreign.x; function f() { return +i} return f')(null, {x:Symbol("blah")}), TypeError);
assertThrowsInstanceOf(() => asmCompile('glob','foreign',USE_ASM + 'var tof = glob.Math.fround; var i = tof(foreign.x); function f() { return +i} return f')(this, {x:Symbol("blah")}), TypeError);
}
assertThrowsInstanceOf(() => asmCompile('glob','foreign',USE_ASM + 'var i = foreign.x|0; function f() { return i|0} return f')(null, {x:Symbol("blah")}), TypeError);
assertThrowsInstanceOf(() => asmCompile('glob','foreign',USE_ASM + 'var i = +foreign.x; function f() { return +i} return f')(null, {x:Symbol("blah")}), TypeError);
assertThrowsInstanceOf(() => asmCompile('glob','foreign',USE_ASM + 'var tof = glob.Math.fround; var i = tof(foreign.x); function f() { return +i} return f')(this, {x:Symbol("blah")}), TypeError);
// Temporary workaround; this test can be removed when Emscripten is fixed and
// the fix has propagated out to most apps:

View File

@ -1,6 +1,5 @@
function f() {
if (typeof Symbol === "function")
return Object(Symbol());
return Object(Symbol());
}
for (var i = 0; i < 4; i++) {

View File

@ -17,8 +17,7 @@ check(false);
check(1);
check(NaN);
check("ok");
if (typeof Symbol === "function")
check(Symbol("ok"));
check(Symbol("ok"));
// A Debugger.Object that belongs to a different Debugger object is invalid.
var g = newGlobal();

View File

@ -18,8 +18,7 @@ g.eval("" +
obj[" "] = 3;
obj[""] = 4;
obj[0] = 5;
if (typeof Symbol === "function")
obj[Symbol.for("moon")] = 6;
obj[Symbol.for("moon")] = 6;
return obj;
})
g.eval("fill(this);\n" +
@ -31,6 +30,5 @@ for (var names of [withNames, globalNames]) {
assertEq(names.indexOf(" "), -1);
assertEq(names.indexOf(""), -1);
assertEq(names.indexOf("0"), -1);
if (typeof Symbol === "function")
assertEq(names.indexOf(Symbol.for("moon")), -1);
assertEq(names.indexOf(Symbol.for("moon")), -1);
}

View File

@ -22,9 +22,7 @@ g.eval("function f() { debugger; }");
hits = 0;
g.eval("args = []; f();");
g.eval("this.f();");
g.eval("var world = 'world'; " +
"if (typeof Symbol === 'function') " +
" Symbol('world'); " +
g.eval("var world = Symbol('world'); " +
"args = ['hello', world, 3.14, true, false, null, undefined]; " +
"f('hello', world, 3.14, true, false, null, undefined);");
g.eval("f.apply(undefined, args);");

View File

@ -15,9 +15,7 @@ g.eval("function f(obj, expected) { debugger; }");
g.eval("f(new Number(-0), '0');");
g.eval("f(new String('ok'), 'ok');");
if (typeof Symbol === "function") {
g.eval("f(Symbol('still ok'), 'Symbol(still ok)');");
g.eval("f(Object(Symbol('still ok')), 'Symbol(still ok)');");
}
g.eval("f(Symbol('still ok'), 'Symbol(still ok)');");
g.eval("f(Object(Symbol('still ok')), 'Symbol(still ok)');");
g.eval("f({toString: function () { return f; }}, f);");
assertEq(hits, typeof Symbol === "function" ? 5 : 3);
assertEq(hits, 5);

View File

@ -12,6 +12,5 @@ dbg.onDebuggerStatement = function (frame) {
hits++;
};
g.eval("function f() { debugger; }");
var symbolExpr = typeof Symbol === "function" ? "Symbol('alpha')" : "'alpha'";
g.eval("f(undefined, -0, NaN, '\uffff', " + symbolExpr + ", Array.prototype, Math, f);");
g.eval("f(undefined, -0, NaN, '\uffff', Symbol('alpha'), Array.prototype, Math, f);");
assertEq(hits, 1);

View File

@ -23,8 +23,7 @@ test(null);
test(false);
test(1);
test("stringy");
if (typeof Symbol === "function")
test(Symbol("symbolic"));
test(Symbol("symbolic"));
test({});
test([]);

View File

@ -16,11 +16,9 @@ g.eval("Number.prototype.f = f; v = 3.14; v.f();");
g.eval("f.call(v);");
g.eval("String.prototype.f = f; v = 'hello'; v.f();");
g.eval("f.call(v);");
if (typeof Symbol === "function") {
g.eval("Symbol.prototype.f = f; v = Symbol('world'); v.f();");
g.eval("f.call(v);");
}
g.eval("Symbol.prototype.f = f; v = Symbol('world'); v.f();");
g.eval("f.call(v);");
g.eval("v = undefined; f.call(v);");
g.eval("v = null; f.call(v);");
assertEq(hits, typeof Symbol === "function" ? 10 : 8);
assertEq(hits, 10);

View File

@ -21,11 +21,9 @@ g.eval("Number.prototype.f = f; v = 3.14; v.f();");
g.eval("f.call(v);");
g.eval("String.prototype.f = f; v = 'hello'; v.f();");
g.eval("f.call(v);");
if (typeof Symbol === "function") {
g.eval("Symbol.prototype.f = f; v = Symbol('world'); v.f();");
g.eval("f.call(v);");
}
g.eval("Symbol.prototype.f = f; v = Symbol('world'); v.f();");
g.eval("f.call(v);");
g.eval("v = undefined; f.call(v);");
g.eval("v = null; f.call(v);");
assertEq(hits, typeof Symbol === "function" ? 10 : 8);
assertEq(hits, 10);

View File

@ -26,10 +26,8 @@ test("[0, 1, 2]");
test("[,,,,,]");
test("/a*a/");
test("function () {}");
if (typeof Symbol === "function") {
test("(function () {\n" +
" var x = {};\n" +
" x[Symbol()] = 1; x[Symbol.for('moon')] = 2; x[Symbol.iterator] = 3;\n" +
" return x;\n" +
"})()");
}
test("(function () {\n" +
" var x = {};\n" +
" x[Symbol()] = 1; x[Symbol.for('moon')] = 2; x[Symbol.iterator] = 3;\n" +
" return x;\n" +
"})()");

View File

@ -4,8 +4,7 @@ var g = newGlobal();
var dbg = Debugger();
var gobj = dbg.addDebuggee(g);
g.p = {xyzzy: 8}; // makes a cross-compartment wrapper
if (typeof Symbol === "function")
g.p[Symbol.for("plugh")] = 9;
g.p[Symbol.for("plugh")] = 9;
var wp = gobj.getOwnPropertyDescriptor("p").value;
var names = wp.getOwnPropertyNames();
assertEq(names.length, 1);

View File

@ -38,7 +38,5 @@ assertEq(gw.makeDebuggeeValue(null), null);
assertEq(gw.makeDebuggeeValue(1729), 1729);
assertEq(gw.makeDebuggeeValue(Math.PI), Math.PI);
assertEq(gw.makeDebuggeeValue(undefined), undefined);
if (typeof Symbol === "function") {
var s = g.eval("Symbol('Stavromula Beta')");
assertEq(gw.makeDebuggeeValue(s), s);
}
var s = g.eval("Symbol('Stavromula Beta')");
assertEq(gw.makeDebuggeeValue(s), s);

View File

@ -1,5 +1,3 @@
if (typeof Symbol === "function") {
gczeal(4);
var symbols = [Symbol(), Symbol("comet"), Symbol.for("moon"), Symbol.iterator, 0];
for (var a of symbols) {}
}
gczeal(4);
var symbols = [Symbol(), Symbol("comet"), Symbol.for("moon"), Symbol.iterator, 0];
for (var a of symbols) {}

View File

@ -1,5 +1,4 @@
x = function() {};
y = new WeakMap;
selectforgc({});;
if (typeof Symbol === "function")
y.set(x, Symbol());
y.set(x, Symbol());

View File

@ -1,8 +1,6 @@
if (typeof Symbol === "function") {
gczeal(9);
Symbol.for("a");
gcslice(1);
var a = Symbol.for("a");
gcslice();
print(Symbol.keyFor(a));
}
gczeal(9);
Symbol.for("a");
gcslice(1);
var a = Symbol.for("a");
gcslice();
print(Symbol.keyFor(a));

View File

@ -42,10 +42,8 @@ Match.Pattern([{node: {}, edge: "shape"},
.assert(findPath(o, o));
print(findPath(o, o).map((e) => e.edge).toString());
if (typeof Symbol === "function") {
// Check that we can generate ubi::Nodes for Symbols.
var so = { sym: Symbol() };
Match.Pattern([{node: {}, edge: "sym" }])
.assert(findPath(so, so.sym));
print(findPath(so, so.sym).map((e) => e.edge).toString());
}
// Check that we can generate ubi::Nodes for Symbols.
var so = { sym: Symbol() };
Match.Pattern([{node: {}, edge: "sym" }])
.assert(findPath(so, so.sym));
print(findPath(so, so.sym).map((e) => e.edge).toString());

View File

@ -1,16 +1,13 @@
// |jit-test| error: TypeError
if (typeof Symbol === "function") {
g = (function() {
var Int32ArrayView = new Int32Array();
function f() {
Int32ArrayView[Symbol() >> 2]
}
return f;
})();
try {
g();
} catch (e) {}
g = (function() {
var Int32ArrayView = new Int32Array();
function f() {
Int32ArrayView[Symbol() >> 2]
}
return f;
})();
try {
g();
} else {
throw new TypeError("pass");
}
} catch (e) {}
g();

View File

@ -37,6 +37,12 @@
}))
})();
//
(function() {
// bug 1134298
for (var k = 0; k < 1; k++) {
Math.fround(Math.ceil(Math.fround(Math.acos(3.0))))
}
})();
})();
//
// ION TESTS

View File

@ -1,29 +1,27 @@
// test against future pic support for symbols
if (typeof Symbol === "function") {
// assignments to watched objects must not be cached
var obj = {};
var x = Symbol.for("x");
obj[x] = 0;
var hits = 0;
obj.watch(x, function (id, oldval, newval) { hits++; return newval; });
for (var i = 0; i < 10; i++)
obj[x] = i;
assertEq(hits, 10);
// assignments to watched objects must not be cached
var obj = {};
var x = Symbol.for("x");
obj[x] = 0;
var hits = 0;
obj.watch(x, function (id, oldval, newval) { hits++; return newval; });
for (var i = 0; i < 10; i++)
obj[x] = i;
assertEq(hits, 10);
// assignments to watched properties via ++ must not be cached
hits = 0;
for (var i = 0; i < 10; i++)
obj[x]++;
assertEq(hits, 10);
// assignments to watched properties via ++ must not be cached
hits = 0;
for (var i = 0; i < 10; i++)
obj[x]++;
assertEq(hits, 10);
// adding assignment + watchpoint vs. caching
hits = 0;
obj = {};
obj.watch(x, function (id, oldval, newval) { hits++; return newval; });
for (var i = 0; i < 10; i++) {
obj[x] = 1;
delete obj[x];
}
assertEq(hits, 10);
// adding assignment + watchpoint vs. caching
hits = 0;
obj = {};
obj.watch(x, function (id, oldval, newval) { hits++; return newval; });
for (var i = 0; i < 10; i++) {
obj[x] = 1;
delete obj[x];
}
assertEq(hits, 10);

View File

@ -15,10 +15,7 @@ function testProxy(p, key) {
assertEq(desc.configurable, true);
}
var keys = ['foo'];
if (typeof Symbol === "function")
keys.push(Symbol("quux"));
for (var key of keys) {
for (var key of ['foo', Symbol("quux")]) {
target = {};
testProxy(new Proxy(target, {}), key);
target = {};

View File

@ -23,15 +23,11 @@ var desc = {
configurable: true
};
function quux() {
return typeof Symbol === "function" ? Symbol.for('quux') : 'quux';
}
for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy]) {
var log = [];
Object.defineProperty(p, 'foo', desc);
Object.defineProperty(p, quux(), desc);
Object.defineProperty(p, Symbol.for('quux'), desc);
assertEq(log.length, 2);
assertEq(log[0], 'foo');
assertEq(log[1], quux());
assertEq(log[1], Symbol.for('quux'));
}

View File

@ -5,10 +5,8 @@ for (let p of [new Proxy(target, {}), Proxy.revocable(target, {}).proxy]) {
assertEq(p['foo'], 'bar');
}
if (typeof Symbol === "function") {
var s = Symbol.for("moon");
var obj = {};
obj[s] = "dust";
for (let p of [new Proxy(obj, {}), Proxy.revocable(obj, {}).proxy])
assertEq(p[s], "dust");
}
var s = Symbol.for("moon");
var obj = {};
obj[s] = "dust";
for (let p of [new Proxy(obj, {}), Proxy.revocable(obj, {}).proxy])
assertEq(p[s], "dust");

View File

@ -4,10 +4,7 @@
* as the third argument
*/
var target = {};
var keys = ['foo'];
if (typeof Symbol === "function")
keys.push(Symbol.iterator);
for (var key of keys) {
for (var key of ['foo', Symbol.iterator]) {
handler = {};
for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy]) {
handler.get =

View File

@ -1,9 +1,7 @@
// Return the trap result
var target = { foo: 'bar' };
if (typeof Symbol === "function") {
var s1 = Symbol("moon"), s2 = Symbol("sun");
target[s1] = "wrong";
}
var s1 = Symbol("moon"), s2 = Symbol("sun");
target[s1] = "wrong";
var handler = { };
for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy]) {
@ -13,8 +11,6 @@ for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).prox
handler.get = (() => undefined);
assertEq(p.foo, undefined);
if (typeof Symbol === "function") {
handler.get = (() => s2);
assertEq(p[s1], s2);
}
handler.get = (() => s2);
assertEq(p[s1], s2);
}

View File

@ -21,8 +21,7 @@ var objCD = Object.create(objAB, {
}
});
if (typeof Symbol === "function")
objCD[Symbol("moon")] = "something";
objCD[Symbol("moon")] = "something";
for (let p of [new Proxy(objCD, {}), Proxy.revocable(objCD, {}).proxy]) {
var names = Object.getOwnPropertyNames(p);
assertEq(names.length, 2);

View File

@ -14,6 +14,5 @@ for (let p of [new Proxy(target, {}), Proxy.revocable(target, {}).proxy]) {
assertEq('foo' in p, true);
assertEq('bar' in p, true);
assertEq('baz' in p, false);
if (typeof Symbol === "function")
assertEq(Symbol() in p, false);
assertEq(Symbol() in p, false);
}

View File

@ -3,10 +3,7 @@
* argument, and the name of the property as the second argument
*/
var target = {};
var keys = ['foo'];
if (typeof Symbol === "function")
keys.push(Symbol('bar'));
for (var key of keys) {
for (var key of ['foo', Symbol('bar')]) {
var called;
var handler = {
has: function (target1, name) {

View File

@ -9,6 +9,5 @@ var handler = { has: () => false };
for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy]) {
assertEq('foo' in p, false);
if (typeof Symbol === "function")
assertEq(Symbol.iterator in p, false);
assertEq(Symbol.iterator in p, false);
}

View File

@ -9,19 +9,16 @@ var descs = {
configurable: true
}
};
if (typeof Symbol === "function")
descs[Symbol.for("quux")] = {configurable: true};
descs[Symbol.for("quux")] = {configurable: true};
var target = Object.create(proto, descs);
for (let p of [new Proxy(target, {}), Proxy.revocable(target, {}).proxy]) {
assertEq(({}).hasOwnProperty.call(p, 'foo'), false);
assertEq(({}).hasOwnProperty.call(p, 'bar'), true);
assertEq(({}).hasOwnProperty.call(p, 'quux'), false);
if (typeof Symbol === "function") {
assertEq(({}).hasOwnProperty.call(p, Symbol('quux')), false);
assertEq(({}).hasOwnProperty.call(p, 'Symbol(quux)'), false);
assertEq(({}).hasOwnProperty.call(p, Symbol.for('quux')), true);
}
assertEq(({}).hasOwnProperty.call(p, Symbol('quux')), false);
assertEq(({}).hasOwnProperty.call(p, 'Symbol(quux)'), false);
assertEq(({}).hasOwnProperty.call(p, Symbol.for('quux')), true);
}
// Make sure only the getOwnPropertyDescriptor trap is called, and not the has

View File

@ -10,11 +10,9 @@ for (let p of [new Proxy(target, {}), Proxy.revocable(target, {}).proxy]) {
p['foo'] = 'buz';
assertEq(target.foo, 'buz');
if (typeof Symbol === "function") {
var sym = Symbol.for('quux');
p[sym] = sym;
assertEq(target[sym], sym);
// Reset for second iteration
target[sym] = undefined;
}
var sym = Symbol.for('quux');
p[sym] = sym;
assertEq(target[sym], sym);
// Reset for second iteration
target[sym] = undefined;
}

View File

@ -4,10 +4,7 @@
* third argument, and the receiver as the fourth argument
*/
var target = {};
var keys = ['foo'];
if (typeof Symbol === "function")
keys.push(Symbol.for('quux'));
for (var key of keys) {
for (var key of ['foo', Symbol.for('quux')]) {
var handler = { };
for (let p of [new Proxy(target, handler), Proxy.revocable(target, handler).proxy]) {
handler.set = function (target1, name, val, receiver) {

View File

@ -1,10 +1,7 @@
load(libdir + "asserts.js");
// Throw a TypeError if the trap sets a non-writable, non-configurable property
var keys = ['foo'];
if (typeof Symbol === "function")
keys.push(Symbol.for('quux'));
for (var key of keys) {
for (var key of ['foo', Symbol.for('quux')]) {
var target = {};
Object.defineProperty(target, key, {
value: 'bar',

View File

@ -14,24 +14,22 @@ assertNotDeepEq(undefined, null);
assertNotDeepEq({}, null);
// symbols
if (typeof Symbol === "function") {
assertDeepEq(Symbol(), Symbol());
assertNotDeepEq(Symbol(), Symbol(""));
assertDeepEq(Symbol("tweedledum"), Symbol("tweedledum"));
assertNotDeepEq(Symbol("tweedledum"), Symbol("alice"));
assertNotDeepEq(Symbol("what-its-called"), Symbol.for("what-its-called"));
assertNotDeepEq(Symbol.iterator, Symbol.for("Symbol.iterator"));
assertDeepEq([Symbol(), Symbol(), Symbol()],
[Symbol(), Symbol(), Symbol()]);
var sym = Symbol();
assertDeepEq([sym, sym], [sym, sym]);
assertNotDeepEq([sym, sym], [Symbol(), Symbol()]);
assertNotDeepEq([sym, sym], [Symbol(), sym]);
var obj1 = {}, obj2 = {};
obj1[Symbol("x")] = "y";
obj2[Symbol("x")] = "y";
assertDeepEq(obj1, obj2);
}
assertDeepEq(Symbol(), Symbol());
assertNotDeepEq(Symbol(), Symbol(""));
assertDeepEq(Symbol("tweedledum"), Symbol("tweedledum"));
assertNotDeepEq(Symbol("tweedledum"), Symbol("alice"));
assertNotDeepEq(Symbol("what-its-called"), Symbol.for("what-its-called"));
assertNotDeepEq(Symbol.iterator, Symbol.for("Symbol.iterator"));
assertDeepEq([Symbol(), Symbol(), Symbol()],
[Symbol(), Symbol(), Symbol()]);
var sym = Symbol();
assertDeepEq([sym, sym], [sym, sym]);
assertNotDeepEq([sym, sym], [Symbol(), Symbol()]);
assertNotDeepEq([sym, sym], [Symbol(), sym]);
var obj1 = {}, obj2 = {};
obj1[Symbol("x")] = "y";
obj2[Symbol("x")] = "y";
assertDeepEq(obj1, obj2);
// objects
assertDeepEq({}, {});

View File

@ -1,12 +1,6 @@
function sym() {
return typeof Symbol === "function" ? Symbol() : "non-symbol";
}
function f(x, y) {
return x == y;
}
f(1.1, 2.2);
for (var i=0; i<5; i++)
f(1, sym());
f(1, Symbol());

Some files were not shown because too many files have changed in this diff Show More