Merge inbound to m-c a=merge

This commit is contained in:
Wes Kocher 2014-06-05 18:31:10 -07:00
commit b7515a68a7
228 changed files with 3692 additions and 2876 deletions

View File

@ -979,6 +979,9 @@ pref("dom.wakelock.enabled", true);
// Disable touch caret by default
pref("touchcaret.enabled", false);
// Disable selection caret by default
pref("selectioncaret.enabled", false);
// Enable sync and mozId with Firefox Accounts.
#ifdef MOZ_SERVICES_FXACCOUNTS
pref("services.sync.fxaccounts.enabled", true);

View File

@ -283,11 +283,9 @@ select[disabled] > button {
*:-moz-any-link:active,
*[role=button]:active,
button:active,
input:active,
option:active,
select:active,
label:active,
textarea:active {
label:active {
background-color: rgba(141, 184, 216, 0.5);
}

View File

@ -272,7 +272,14 @@ Target.prototype = {
},
_send: function target_send(data) {
shell.sendEvent(this.frame, 'developer-hud-update', Cu.cloneInto(data, this.frame));
let frame = this.frame;
let systemapp = document.querySelector('#systemapp');
if (this.frame === systemapp) {
frame = getContentWindow();
}
shell.sendEvent(frame, 'developer-hud-update', Cu.cloneInto(data, target));
}
};

View File

@ -420,7 +420,24 @@ ContentPermissionPrompt.prototype = {
if (isApp) {
details.manifestURL = DOMApplicationRegistry.getManifestURLByLocalId(principal.appId);
}
SystemAppProxy.dispatchEvent(details);
// request.element is defined for OOP content, while request.window
// is defined for In-Process content.
// In both cases the message needs to be dispatched to the top-level
// <iframe mozbrowser> container in the system app.
// So the above code iterates over window.realFrameElement in order
// to crosss mozbrowser iframes boundaries and find the top-level
// one in the system app.
// window.realFrameElement will be |null| if the code try to cross
// content -> chrome boundaries.
let targetElement = request.element;
let targetWindow = request.window || targetElement.ownerDocument.defaultView;
while (targetWindow.realFrameElement) {
targetElement = targetWindow.realFrameElement;
targetWindow = targetElement.ownerDocument.defaultView;
}
SystemAppProxy.dispatchEvent(details, targetElement);
},
classID: Components.ID("{8c719f03-afe0-4aac-91ff-6c215895d467}"),

View File

@ -58,7 +58,10 @@ let SystemAppProxy = {
* @param noPending Set to true to emit this event even before the system
* app is ready.
*/
_sendCustomEvent: function systemApp_sendCustomEvent(type, details, noPending) {
_sendCustomEvent: function systemApp_sendCustomEvent(type,
details,
noPending,
target) {
let content = this._frame ? this._frame.contentWindow : null;
// If the system app isn't ready yet,
@ -80,14 +83,14 @@ let SystemAppProxy = {
}
event.initCustomEvent(type, true, false, payload);
content.dispatchEvent(event);
(target || content).dispatchEvent(event);
return event;
},
// Now deprecated, use sendCustomEvent with a custom event name
dispatchEvent: function systemApp_sendChromeEvent(details) {
return this._sendCustomEvent('mozChromeEvent', details);
dispatchEvent: function systemApp_sendChromeEvent(details, target) {
return this._sendCustomEvent('mozChromeEvent', details, false, target);
},
// Listen for dom events on the system app

View File

@ -8,6 +8,7 @@ Services.scriptloader.loadSubScript("resource://gre/modules/SystemAppProxy.jsm",
const { SystemAppProxy } = scope;
let frame;
let customEventTarget;
let index = -1;
function next() {
@ -47,6 +48,10 @@ function listener(event) {
} else if (n == 4) {
assert.equal(event.type, "mozChromeEvent");
assert.equal(event.detail.name, "fourth");
} else if (n == 5) {
assert.equal(event.type, "custom");
assert.equal(event.detail.name, "fifth");
assert.equal(event.target, customEventTarget);
next(); // call checkEventListening();
} else {
@ -79,6 +84,8 @@ let steps = [
frame = doc.createElement("iframe");
doc.documentElement.appendChild(frame);
customEventTarget = frame.contentDocument.body;
// Ensure that events are correctly sent to the frame.
// `listener` is going to call next()
frame.contentWindow.addEventListener("mozChromeEvent", listener);
@ -118,7 +125,8 @@ let steps = [
// they should be dispatched right away
SystemAppProxy._sendCustomEvent("custom", { name: "third" });
SystemAppProxy.dispatchEvent({ name: "fourth" });
// Once this 4th event is received, we will run checkEventListening
SystemAppProxy._sendCustomEvent("custom", { name: "fifth" }, false, customEventTarget);
// Once this 5th event is received, we will run checkEventListening
},
function checkEventListening() {

View File

@ -671,6 +671,18 @@
@BINPATH@/res/table-remove-row-active.gif
@BINPATH@/res/table-remove-row-hover.gif
@BINPATH@/res/table-remove-row.gif
@BINPATH@/res/text_caret.png
@BINPATH@/res/text_caret@1.5x.png
@BINPATH@/res/text_caret@2.25x.png
@BINPATH@/res/text_caret@2x.png
@BINPATH@/res/text_caret_tilt_left.png
@BINPATH@/res/text_caret_tilt_left@1.5x.png
@BINPATH@/res/text_caret_tilt_left@2.25x.png
@BINPATH@/res/text_caret_tilt_left@2x.png
@BINPATH@/res/text_caret_tilt_right.png
@BINPATH@/res/text_caret_tilt_right@1.5x.png
@BINPATH@/res/text_caret_tilt_right@2.25x.png
@BINPATH@/res/text_caret_tilt_right@2x.png
@BINPATH@/res/text_selection_handle.png
@BINPATH@/res/text_selection_handle@1.5.png
@BINPATH@/res/text_selection_handle@2.png

View File

@ -18,6 +18,7 @@
*/
Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
let {LoadContextInfo} = Cu.import("resource://gre/modules/LoadContextInfo.jsm", {});
XPCOMUtils.defineLazyModuleGetter(this, "FormHistory",
"resource://gre/modules/FormHistory.jsm");
@ -567,10 +568,14 @@ var gAllTests = [
pm.addFromPrincipal(principal, "offline-app", Ci.nsIOfflineCacheUpdateService.ALLOW_NO_WARN);
// Store something to the offline cache
const nsICache = Components.interfaces.nsICache;
var cs = Components.classes["@mozilla.org/network/cache-service;1"]
.getService(Components.interfaces.nsICacheService);
var session = cs.createSession(URL + "/manifest", nsICache.STORE_OFFLINE, nsICache.STREAM_BASED);
var appcacheserv = Cc["@mozilla.org/network/application-cache-service;1"]
.getService(Ci.nsIApplicationCacheService);
var appcachegroupid = appcacheserv.buildGroupID(makeURI(URL + "/manifest"), LoadContextInfo.default);
var appcache = appcacheserv.createApplicationCache(appcachegroupid);
var cacheserv = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
.getService(Ci.nsICacheStorageService);
var storage = cacheserv.appCacheStorage(LoadContextInfo.default, appcache);
// Open the dialog
let wh = new WindowHelper();
@ -587,27 +592,19 @@ var gAllTests = [
// Check if the cache has been deleted
var size = -1;
var visitor = {
visitDevice: function (deviceID, deviceInfo)
onCacheStorageInfo: function (aEntryCount, aConsumption, aCapacity, aDiskDirectory)
{
if (deviceID == "offline")
size = deviceInfo.totalSize;
// Do not enumerate entries
return false;
},
visitEntry: function (deviceID, entryInfo)
{
// Do not enumerate entries.
return false;
size = aConsumption;
}
};
cs.visitEntries(visitor);
storage.asyncVisitStorage(visitor, false);
// Offline cache visit happens synchronously, since it's forwarded to the old code
is(size, 0, "offline application cache entries evicted");
};
var cacheListener = {
onCacheEntryAvailable: function (entry, access, status) {
onCacheEntryCheck: function() { return Ci.nsICacheEntryOpenCallback.ENTRY_WANTED; },
onCacheEntryAvailable: function (entry, isnew, appcache, status) {
is(status, Cr.NS_OK);
var stream = entry.openOutputStream(0);
var content = "content";
@ -618,7 +615,7 @@ var gAllTests = [
}
};
session.asyncOpenCacheEntry(URL, nsICache.ACCESS_READ_WRITE, cacheListener);
storage.asyncOpenURI(makeURI(URL), "", Ci.nsICacheStorage.OPEN_TRUNCATE, cacheListener);
},
function () {
// Test for offline apps permission deletion

View File

@ -329,30 +329,21 @@ var gAdvancedPane = {
updateActualAppCacheSize: function ()
{
var visitor = {
visitDevice: function (deviceID, deviceInfo)
onCacheStorageInfo: function (aEntryCount, aConsumption, aCapacity, aDiskDirectory)
{
if (deviceID == "offline") {
var actualSizeLabel = document.getElementById("actualAppCacheSize");
var sizeStrings = DownloadUtils.convertByteUnits(deviceInfo.totalSize);
var prefStrBundle = document.getElementById("bundlePreferences");
var sizeStr = prefStrBundle.getFormattedString("actualAppCacheSize", sizeStrings);
actualSizeLabel.value = sizeStr;
}
// Do not enumerate entries
return false;
},
visitEntry: function (deviceID, entryInfo)
{
// Do not enumerate entries.
return false;
var actualSizeLabel = document.getElementById("actualAppCacheSize");
var sizeStrings = DownloadUtils.convertByteUnits(aConsumption);
var prefStrBundle = document.getElementById("bundlePreferences");
var sizeStr = prefStrBundle.getFormattedString("actualAppCacheSize", sizeStrings);
actualSizeLabel.value = sizeStr;
}
};
var cacheService =
Components.classes["@mozilla.org/network/cache-service;1"]
.getService(Components.interfaces.nsICacheService);
cacheService.visitEntries(visitor);
Components.classes["@mozilla.org/netwerk/cache-storage-service;1"]
.getService(Components.interfaces.nsICacheStorageService);
var storage = cacheService.appCacheStorage(LoadContextInfo.default, null);
storage.asyncVisitStorage(visitor, false);
},
updateCacheSizeUI: function (smartSizeEnabled)

View File

@ -314,30 +314,21 @@ var gAdvancedPane = {
updateActualAppCacheSize: function ()
{
var visitor = {
visitDevice: function (deviceID, deviceInfo)
onCacheStorageInfo: function (aEntryCount, aConsumption, aCapacity, aDiskDirectory)
{
if (deviceID == "offline") {
var actualSizeLabel = document.getElementById("actualAppCacheSize");
var sizeStrings = DownloadUtils.convertByteUnits(deviceInfo.totalSize);
var prefStrBundle = document.getElementById("bundlePreferences");
var sizeStr = prefStrBundle.getFormattedString("actualAppCacheSize", sizeStrings);
actualSizeLabel.textContent = sizeStr;
}
// Do not enumerate entries
return false;
},
visitEntry: function (deviceID, entryInfo)
{
// Do not enumerate entries.
return false;
var actualSizeLabel = document.getElementById("actualAppCacheSize");
var sizeStrings = DownloadUtils.convertByteUnits(aConsumption);
var prefStrBundle = document.getElementById("bundlePreferences");
var sizeStr = prefStrBundle.getFormattedString("actualAppCacheSize", sizeStrings);
actualSizeLabel.value = sizeStr;
}
};
var cacheService =
Components.classes["@mozilla.org/network/cache-service;1"]
.getService(Components.interfaces.nsICacheService);
cacheService.visitEntries(visitor);
Components.classes["@mozilla.org/netwerk/cache-storage-service;1"]
.getService(Components.interfaces.nsICacheStorageService);
var storage = cacheService.appCacheStorage(LoadContextInfo.default, null);
storage.asyncVisitStorage(visitor, false);
},
updateCacheSizeUI: function (smartSizeEnabled)

View File

@ -156,9 +156,16 @@ this.BingTranslation.prototype = {
let error = false;
for (let i = 0; i < len; i++) {
try {
bingRequest.translationData[i][0].parseResult(
results[i].firstChild.nodeValue
);
let result = results[i].firstChild.nodeValue;
let root = bingRequest.translationData[i][0];
if (root.isSimpleRoot) {
// Workaround for Bing's service problem in which "&" chars in
// plain-text TranslationItems are double-escaped.
result = result.replace("&amp;", "&", "g");
}
root.parseResult(result);
} catch (e) { error = true; }
}

View File

@ -29,6 +29,7 @@ const { classes: Cc, interfaces: Ci, utils: Cu } = Components;
let { XPCOMUtils } = Cu.import("resource://gre/modules/XPCOMUtils.jsm", {});
let { Services } = Cu.import("resource://gre/modules/Services.jsm", {});
let { LoadContextInfo } = Cu.import("resource://gre/modules/LoadContextInfo.jsm", {});
let { Promise: promise } = Cu.import("resource://gre/modules/Promise.jsm", {});
this.EXPORTED_SYMBOLS = ["AppCacheUtils"];
@ -247,37 +248,35 @@ AppCacheUtils.prototype = {
let entries = [];
Services.cache.visitEntries({
visitDevice: function(deviceID, deviceInfo) {
return true;
},
let appCacheStorage = Services.cache2.appCacheStorage(LoadContextInfo.default, null);
appCacheStorage.asyncVisitStorage({
onCacheStorageInfo: function() {},
visitEntry: function(deviceID, entryInfo) {
if (entryInfo.deviceID == "offline") {
let entry = {};
let lowerKey = entryInfo.key.toLowerCase();
onCacheEntryInfo: function(aURI, aIdEnhance, aDataSize, aFetchCount, aLastModifiedTime, aExpirationTime) {
let lowerKey = aURI.asciiSpec.toLowerCase();
if (searchTerm && lowerKey.indexOf(searchTerm.toLowerCase()) == -1) {
return true;
}
for (let [key, value] of Iterator(entryInfo)) {
if (key == "QueryInterface") {
continue;
}
if (key == "clientID") {
entry.key = entryInfo.key;
}
if (key == "expirationTime" || key == "lastFetched" || key == "lastModified") {
value = new Date(value * 1000);
}
entry[key] = value;
}
entries.push(entry);
if (searchTerm && lowerKey.indexOf(searchTerm.toLowerCase()) == -1) {
return;
}
if (aIdEnhance) {
aIdEnhance += ":";
}
let entry = {
"deviceID": "offline",
"key": aIdEnhance + aURI.asciiSpec,
"fetchCount": aFetchCount,
"lastFetched": null,
"lastModified": new Date(aLastModifiedTime * 1000),
"expirationTime": new Date(aExpirationTime * 1000),
"dataSize": aDataSize
};
entries.push(entry);
return true;
}
});
}, true);
if (entries.length === 0) {
throw new Error(l10n.GetStringFromName("noResults"));
@ -286,31 +285,11 @@ AppCacheUtils.prototype = {
},
viewEntry: function ACU_viewEntry(key) {
let uri;
Services.cache.visitEntries({
visitDevice: function(deviceID, deviceInfo) {
return true;
},
visitEntry: function(deviceID, entryInfo) {
if (entryInfo.deviceID == "offline" && entryInfo.key == key) {
uri = "about:cache-entry?client=" + entryInfo.clientID +
"&sb=1&key=" + entryInfo.key;
return false;
}
return true;
}
});
if (uri) {
let wm = Cc["@mozilla.org/appshell/window-mediator;1"]
.getService(Ci.nsIWindowMediator);
let win = wm.getMostRecentWindow("navigator:browser");
win.gBrowser.selectedTab = win.gBrowser.addTab(uri);
} else {
return l10n.GetStringFromName("entryNotFound");
}
let wm = Cc["@mozilla.org/appshell/window-mediator;1"]
.getService(Ci.nsIWindowMediator);
let win = wm.getMostRecentWindow("navigator:browser");
win.gBrowser.selectedTab = win.gBrowser.addTab(
"about:cache-entry?storage=appcache&context=&eid=&uri=" + key);
},
clearAll: function ACU_clearAll() {

View File

@ -6323,17 +6323,13 @@ if test "$MOZ_WEBAPP_RUNTIME"; then
AC_DEFINE(MOZ_WEBAPP_RUNTIME)
fi
AC_MSG_CHECKING([for tar archiver])
AC_CHECK_PROGS(TAR, gnutar gtar tar, "")
if test -z "$TAR"; then
AC_MSG_ERROR([no tar archiver found in \$PATH])
fi
AC_MSG_RESULT([$TAR])
AC_SUBST(TAR)
AC_MSG_CHECKING([for wget])
AC_CHECK_PROGS(WGET, wget, "")
AC_MSG_RESULT([$WGET])
AC_SUBST(WGET)
dnl ========================================================

View File

@ -440,6 +440,11 @@ TraceActiveWindowGlobal(const uint64_t& aId, nsGlobalWindow*& aWindow, void* aCl
if (aWindow->GetDocShell() && aWindow->IsOuterWindow()) {
TraceClosure* closure = static_cast<TraceClosure*>(aClosure);
aWindow->TraceGlobalJSObject(closure->mTrc);
EventListenerManager* elm = aWindow->GetExistingListenerManager();
if (elm) {
elm->TraceListeners(closure->mTrc);
}
#ifdef MOZ_XUL
nsIDocument* doc = aWindow->GetExtantDoc();
if (doc && doc->IsXUL()) {

View File

@ -3951,17 +3951,6 @@ nsDocument::InsertChildAt(nsIContent* aKid, uint32_t aIndex,
return doInsertChildAt(aKid, aIndex, aNotify, mChildren);
}
nsresult
nsDocument::AppendChildTo(nsIContent* aKid, bool aNotify)
{
// Make sure to _not_ call the subclass InsertChildAt here. If
// subclasses wanted to hook into this stuff, they would have
// overridden AppendChildTo.
// XXXbz maybe this should just be a non-virtual method on nsINode?
// Feels that way to me...
return nsDocument::InsertChildAt(aKid, GetChildCount(), aNotify);
}
void
nsDocument::RemoveChildAt(uint32_t aIndex, bool aNotify)
{

View File

@ -889,7 +889,6 @@ public:
virtual uint32_t GetChildCount() const MOZ_OVERRIDE;
virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
bool aNotify) MOZ_OVERRIDE;
virtual nsresult AppendChildTo(nsIContent* aKid, bool aNotify);
virtual void RemoveChildAt(uint32_t aIndex, bool aNotify) MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE
{

View File

@ -23,7 +23,6 @@
#include "nsGkAtoms.h"
#include "nsContentUtils.h"
#include "nsGenericDOMDataNode.h"
#include "nsLayoutUtils.h"
#include "nsTextFrame.h"
#include "nsFontFaceList.h"
#include "mozilla/dom/DocumentFragment.h"
@ -2792,10 +2791,11 @@ static nsresult GetPartialTextRect(nsLayoutUtils::RectCallback* aCallback,
return NS_OK;
}
static void CollectClientRects(nsLayoutUtils::RectCallback* aCollector,
nsRange* aRange,
nsINode* aStartParent, int32_t aStartOffset,
nsINode* aEndParent, int32_t aEndOffset)
/* static */ void
nsRange::CollectClientRects(nsLayoutUtils::RectCallback* aCollector,
nsRange* aRange,
nsINode* aStartParent, int32_t aStartOffset,
nsINode* aEndParent, int32_t aEndOffset)
{
// Hold strong pointers across the flush
nsCOMPtr<nsINode> startContainer = aStartParent;
@ -2826,7 +2826,7 @@ static void CollectClientRects(nsLayoutUtils::RectCallback* aCollector,
if (textFrame) {
int32_t outOffset;
nsIFrame* outFrame;
textFrame->GetChildFrameContainingOffset(aStartOffset, false,
textFrame->GetChildFrameContainingOffset(aStartOffset, false,
&outOffset, &outFrame);
if (outFrame) {
nsIFrame* relativeTo =

View File

@ -15,6 +15,7 @@
#include "nsINode.h"
#include "nsIDocument.h"
#include "nsIDOMNode.h"
#include "nsLayoutUtils.h"
#include "prmon.h"
#include "nsStubMutationObserver.h"
#include "nsWrapperCache.h"
@ -254,6 +255,11 @@ public:
static bool IsNodeSelected(nsINode* aNode, uint32_t aStartOffset,
uint32_t aEndOffset);
static void CollectClientRects(nsLayoutUtils::RectCallback* aCollector,
nsRange* aRange,
nsINode* aStartParent, int32_t aStartOffset,
nsINode* aEndParent, int32_t aEndOffset);
typedef nsTHashtable<nsPtrHashKey<nsRange> > RangeHashTable;
protected:
void RegisterCommonAncestor(nsINode* aNode);

View File

@ -15,6 +15,7 @@
#include "mozilla/css/Loader.h"
#include "mozilla/dom/Element.h"
#include "mozilla/dom/ShadowRoot.h"
#include "mozilla/Preferences.h"
#include "nsCSSStyleSheet.h"
#include "nsIContent.h"
#include "nsIDocument.h"
@ -120,6 +121,21 @@ nsStyleLinkElement::SetLineNumber(uint32_t aLineNumber)
mLineNumber = aLineNumber;
}
/* static */ bool
nsStyleLinkElement::IsImportEnabled()
{
static bool sAdded = false;
static bool sImportEnabled;
if (!sAdded) {
// This part runs only once because of the static flag.
Preferences::AddBoolVarCache(&sImportEnabled,
"dom.webcomponents.enabled",
false);
sAdded = true;
}
return sImportEnabled;
}
static uint32_t ToLinkMask(const nsAString& aLink)
{
if (aLink.EqualsLiteral("prefetch"))
@ -132,7 +148,7 @@ static uint32_t ToLinkMask(const nsAString& aLink)
return nsStyleLinkElement::eNEXT;
else if (aLink.EqualsLiteral("alternate"))
return nsStyleLinkElement::eALTERNATE;
else if (aLink.EqualsLiteral("import"))
else if (aLink.EqualsLiteral("import") && nsStyleLinkElement::IsImportEnabled())
return nsStyleLinkElement::eHTMLIMPORT;
else
return 0;

View File

@ -64,6 +64,8 @@ public:
// The return value is a bitwise or of 0 or more RelValues
static uint32_t ParseLinkTypes(const nsAString& aTypes);
static bool IsImportEnabled();
void UpdateStyleSheetInternal()
{
UpdateStyleSheetInternal(nullptr, nullptr);

View File

@ -72,6 +72,11 @@ WebGLBuffer::Validate(GLenum type, uint32_t max_allowed,
return mCache->Validate(type, max_allowed, first, count, out_upperBound);
}
bool
WebGLBuffer::IsElementArrayUsedWithMultipleTypes() const
{
return mCache->BeenUsedWithMultipleTypes();
}
JSObject*
WebGLBuffer::WrapObject(JSContext *cx) {

View File

@ -49,6 +49,8 @@ public:
bool Validate(GLenum type, uint32_t max_allowed, size_t first, size_t count,
uint32_t* out_upperBound);
bool IsElementArrayUsedWithMultipleTypes() const;
WebGLContext *GetParentObject() const {
return Context();
}

View File

@ -213,6 +213,14 @@ public:
void ErrorOutOfMemory(const char *fmt = 0, ...);
const char *ErrorName(GLenum error);
/**
* Return displayable name for GLenum.
* This version is like gl::GLenumToStr but with out the GL_ prefix to
* keep consistency with how errors are reported from WebGL.
*/
static const char *EnumName(GLenum glenum);
bool IsTextureFormatCompressed(GLenum format);
void DummyFramebufferOperation(const char *info);

View File

@ -260,6 +260,14 @@ WebGLContext::DrawElements_check(GLsizei count, GLenum type,
return false;
}
// Bug 1008310 - Check if buffer has been used with a different previous type
if (elemArrayBuffer.IsElementArrayUsedWithMultipleTypes()) {
GenerateWarning("%s: bound element array buffer previously used with a type other than "
"%s, this will affect performance.",
info,
WebGLContext::EnumName(type));
}
MakeContextCurrent();
if (mBoundFramebuffer) {

View File

@ -362,6 +362,64 @@ WebGLContext::ErrorName(GLenum error)
}
}
const char*
WebGLContext::EnumName(GLenum glenum)
{
switch (glenum) {
#define XX(x) case LOCAL_GL_##x: return #x
XX(ALPHA);
XX(ATC_RGB);
XX(ATC_RGBA_EXPLICIT_ALPHA);
XX(ATC_RGBA_INTERPOLATED_ALPHA);
XX(COMPRESSED_RGBA_PVRTC_2BPPV1);
XX(COMPRESSED_RGBA_PVRTC_4BPPV1);
XX(COMPRESSED_RGBA_S3TC_DXT1_EXT);
XX(COMPRESSED_RGBA_S3TC_DXT3_EXT);
XX(COMPRESSED_RGBA_S3TC_DXT5_EXT);
XX(COMPRESSED_RGB_PVRTC_2BPPV1);
XX(COMPRESSED_RGB_PVRTC_4BPPV1);
XX(COMPRESSED_RGB_S3TC_DXT1_EXT);
XX(DEPTH_COMPONENT);
XX(DEPTH_COMPONENT16);
XX(DEPTH_COMPONENT32);
XX(DEPTH_STENCIL);
XX(DEPTH24_STENCIL8);
XX(ETC1_RGB8_OES);
XX(FLOAT);
XX(HALF_FLOAT);
XX(LUMINANCE);
XX(LUMINANCE_ALPHA);
XX(RGB);
XX(RGB16F);
XX(RGB32F);
XX(RGBA);
XX(RGBA16F);
XX(RGBA32F);
XX(SRGB);
XX(SRGB_ALPHA);
XX(TEXTURE_2D);
XX(TEXTURE_3D);
XX(TEXTURE_CUBE_MAP);
XX(TEXTURE_CUBE_MAP_NEGATIVE_X);
XX(TEXTURE_CUBE_MAP_NEGATIVE_Y);
XX(TEXTURE_CUBE_MAP_NEGATIVE_Z);
XX(TEXTURE_CUBE_MAP_POSITIVE_X);
XX(TEXTURE_CUBE_MAP_POSITIVE_Y);
XX(TEXTURE_CUBE_MAP_POSITIVE_Z);
XX(UNSIGNED_BYTE);
XX(UNSIGNED_INT);
XX(UNSIGNED_INT_24_8);
XX(UNSIGNED_SHORT);
XX(UNSIGNED_SHORT_4_4_4_4);
XX(UNSIGNED_SHORT_5_5_5_1);
XX(UNSIGNED_SHORT_5_6_5);
#undef XX
}
return "[Unknown enum name]";
}
bool
WebGLContext::IsTextureFormatCompressed(GLenum format)
{

View File

@ -82,75 +82,13 @@ InfoFrom(WebGLTexImageFunc func)
}
/**
* Return displayable name for GLenum.
* This version is like gl::GLenumToStr but with out the GL_ prefix to
* keep consistency with how errors are reported from WebGL.
*/
static const char*
NameFrom(GLenum glenum)
{
switch (glenum) {
#define XX(x) case LOCAL_GL_##x: return #x
XX(ALPHA);
XX(ATC_RGB);
XX(ATC_RGBA_EXPLICIT_ALPHA);
XX(ATC_RGBA_INTERPOLATED_ALPHA);
XX(COMPRESSED_RGBA_PVRTC_2BPPV1);
XX(COMPRESSED_RGBA_PVRTC_4BPPV1);
XX(COMPRESSED_RGBA_S3TC_DXT1_EXT);
XX(COMPRESSED_RGBA_S3TC_DXT3_EXT);
XX(COMPRESSED_RGBA_S3TC_DXT5_EXT);
XX(COMPRESSED_RGB_PVRTC_2BPPV1);
XX(COMPRESSED_RGB_PVRTC_4BPPV1);
XX(COMPRESSED_RGB_S3TC_DXT1_EXT);
XX(DEPTH_COMPONENT);
XX(DEPTH_COMPONENT16);
XX(DEPTH_COMPONENT32);
XX(DEPTH_STENCIL);
XX(DEPTH24_STENCIL8);
XX(ETC1_RGB8_OES);
XX(FLOAT);
XX(HALF_FLOAT);
XX(LUMINANCE);
XX(LUMINANCE_ALPHA);
XX(RGB);
XX(RGB16F);
XX(RGB32F);
XX(RGBA);
XX(RGBA16F);
XX(RGBA32F);
XX(SRGB);
XX(SRGB_ALPHA);
XX(TEXTURE_2D);
XX(TEXTURE_3D);
XX(TEXTURE_CUBE_MAP);
XX(TEXTURE_CUBE_MAP_NEGATIVE_X);
XX(TEXTURE_CUBE_MAP_NEGATIVE_Y);
XX(TEXTURE_CUBE_MAP_NEGATIVE_Z);
XX(TEXTURE_CUBE_MAP_POSITIVE_X);
XX(TEXTURE_CUBE_MAP_POSITIVE_Y);
XX(TEXTURE_CUBE_MAP_POSITIVE_Z);
XX(UNSIGNED_BYTE);
XX(UNSIGNED_INT);
XX(UNSIGNED_INT_24_8);
XX(UNSIGNED_SHORT);
XX(UNSIGNED_SHORT_4_4_4_4);
XX(UNSIGNED_SHORT_5_5_5_1);
XX(UNSIGNED_SHORT_5_6_5);
#undef XX
}
return nullptr;
}
/**
* Same as ErrorInvalidEnum but uses NameFrom to print displayable
* Same as ErrorInvalidEnum but uses WebGLContext::EnumName to print displayable
* name for \a glenum.
*/
static void
ErrorInvalidEnumWithName(WebGLContext* ctx, const char* msg, GLenum glenum, WebGLTexImageFunc func)
{
const char* name = NameFrom(glenum);
const char* name = WebGLContext::EnumName(glenum);
if (name)
ctx->ErrorInvalidEnum("%s: %s %s", InfoFrom(func), msg, name);
else
@ -604,7 +542,7 @@ WebGLContext::ValidateTexImageFormat(GLenum format, WebGLTexImageFunc func)
bool validFormat = IsExtensionEnabled(WebGLExtensionID::WEBGL_depth_texture);
if (!validFormat)
ErrorInvalidEnum("%s: invalid format %s: need WEBGL_depth_texture enabled",
InfoFrom(func), NameFrom(format));
InfoFrom(func), WebGLContext::EnumName(format));
return validFormat;
}
@ -615,7 +553,7 @@ WebGLContext::ValidateTexImageFormat(GLenum format, WebGLTexImageFunc func)
bool validFormat = IsExtensionEnabled(WebGLExtensionID::EXT_sRGB);
if (!validFormat)
ErrorInvalidEnum("%s: invalid format %s: need EXT_sRGB enabled",
InfoFrom(func), NameFrom(format));
InfoFrom(func), WebGLContext::EnumName(format));
return validFormat;
}
@ -627,7 +565,7 @@ WebGLContext::ValidateTexImageFormat(GLenum format, WebGLTexImageFunc func)
bool validFormat = IsExtensionEnabled(WebGLExtensionID::WEBGL_compressed_texture_atc);
if (!validFormat)
ErrorInvalidEnum("%s: invalid format %s: need WEBGL_compressed_texture_atc enabled",
InfoFrom(func), NameFrom(format));
InfoFrom(func), WebGLContext::EnumName(format));
return validFormat;
}
@ -636,7 +574,7 @@ WebGLContext::ValidateTexImageFormat(GLenum format, WebGLTexImageFunc func)
bool validFormat = IsExtensionEnabled(WebGLExtensionID::WEBGL_compressed_texture_etc1);
if (!validFormat)
ErrorInvalidEnum("%s: invalid format %s: need WEBGL_compressed_texture_etc1 enabled",
InfoFrom(func), NameFrom(format));
InfoFrom(func), WebGLContext::EnumName(format));
return validFormat;
}
@ -649,7 +587,7 @@ WebGLContext::ValidateTexImageFormat(GLenum format, WebGLTexImageFunc func)
bool validFormat = IsExtensionEnabled(WebGLExtensionID::WEBGL_compressed_texture_pvrtc);
if (!validFormat)
ErrorInvalidEnum("%s: invalid format %s: need WEBGL_compressed_texture_pvrtc enabled",
InfoFrom(func), NameFrom(format));
InfoFrom(func), WebGLContext::EnumName(format));
return validFormat;
}
@ -662,7 +600,7 @@ WebGLContext::ValidateTexImageFormat(GLenum format, WebGLTexImageFunc func)
bool validFormat = IsExtensionEnabled(WebGLExtensionID::WEBGL_compressed_texture_s3tc);
if (!validFormat)
ErrorInvalidEnum("%s: invalid format %s: need WEBGL_compressed_texture_s3tc enabled",
InfoFrom(func), NameFrom(format));
InfoFrom(func), WebGLContext::EnumName(format));
return validFormat;
}
@ -716,7 +654,7 @@ WebGLContext::ValidateTexImageType(GLenum type, WebGLTexImageFunc func)
bool validType = IsExtensionEnabled(WebGLExtensionID::OES_texture_float);
if (!validType)
ErrorInvalidEnum("%s: invalid type %s: need OES_texture_float enabled",
InfoFrom(func), NameFrom(type));
InfoFrom(func), WebGLContext::EnumName(type));
return validType;
}
@ -725,7 +663,7 @@ WebGLContext::ValidateTexImageType(GLenum type, WebGLTexImageFunc func)
bool validType = IsExtensionEnabled(WebGLExtensionID::OES_texture_half_float);
if (!validType)
ErrorInvalidEnum("%s: invalid type %s: need OES_texture_half_float enabled",
InfoFrom(func), NameFrom(type));
InfoFrom(func), WebGLContext::EnumName(type));
return validType;
}
@ -737,7 +675,7 @@ WebGLContext::ValidateTexImageType(GLenum type, WebGLTexImageFunc func)
bool validType = IsExtensionEnabled(WebGLExtensionID::WEBGL_depth_texture);
if (!validType)
ErrorInvalidEnum("%s: invalid type %s: need WEBGL_depth_texture enabled",
InfoFrom(func), NameFrom(type));
InfoFrom(func), WebGLContext::EnumName(type));
return validType;
}
@ -1244,7 +1182,7 @@ WebGLContext::ValidateTexImageFormatAndType(GLenum format, GLenum type, WebGLTex
if (!validCombo)
ErrorInvalidOperation("%s: invalid combination of format %s and type %s",
InfoFrom(func), NameFrom(format), NameFrom(type));
InfoFrom(func), WebGLContext::EnumName(format), WebGLContext::EnumName(type));
return validCombo;
}
@ -1366,14 +1304,14 @@ WebGLContext::ValidateTexImage(GLuint dims, GLenum target,
WebGLTexture* tex = activeBoundTextureForTarget(target);
if (!tex) {
ErrorInvalidOperation("%s: no texture is bound to target %s",
info, NameFrom(target));
info, WebGLContext::EnumName(target));
return false;
}
if (IsSubFunc(func)) {
if (!tex->HasImageInfoAt(target, level)) {
ErrorInvalidOperation("%s: no texture image previously defined for target %s at level %d",
info, NameFrom(target), level);
info, WebGLContext::EnumName(target), level);
return false;
}
@ -1404,14 +1342,14 @@ WebGLContext::ValidateTexImage(GLuint dims, GLenum target,
format == LOCAL_GL_DEPTH_STENCIL))
{
ErrorInvalidOperation("%s: with format of %s target must be TEXTURE_2D",
info, NameFrom(format));
info, WebGLContext::EnumName(format));
return false;
}
/* Additional checks for compressed textures */
if (!IsAllowedFromSource(format, func)) {
ErrorInvalidOperation("%s: Invalid format %s for this operation",
info, NameFrom(format));
info, WebGLContext::EnumName(format));
return false;
}

View File

@ -604,4 +604,16 @@ WebGLElementArrayCache::SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf)
uint32TreeSize;
}
bool
WebGLElementArrayCache::BeenUsedWithMultipleTypes() const
{
// C++ Standard ($4.7)
// "If the source type is bool, the value false is converted to zero and
// the value true is converted to one."
const int num_types_used = (mUint8Tree != nullptr) +
(mUint16Tree != nullptr) +
(mUint32Tree != nullptr);
return num_types_used > 1;
}
} // end namespace mozilla

View File

@ -47,6 +47,8 @@ public:
size_t SizeOfIncludingThis(mozilla::MallocSizeOf aMallocSizeOf) const;
bool BeenUsedWithMultipleTypes() const;
private:
template<typename T>

View File

@ -289,7 +289,7 @@ HTMLLinkElement::UpdateImport()
return;
}
if (!Preferences::GetBool("dom.webcomponents.enabled")) {
if (!nsStyleLinkElement::IsImportEnabled()) {
// For now imports are hidden behind a pref...
return;
}

View File

@ -3,4 +3,4 @@ skip-if = e10s
support-files = seek.webm seek.webm^headers^
[test_MediaSource.html]
skip-if = buildapp == 'b2g' # b2g( ReferenceError: MediaSource is not defined) b2g-debug( ReferenceError: MediaSource is not defined) b2g-desktop( ReferenceError: MediaSource is not defined)
skip-if = buildapp == 'b2g' # b2g( ReferenceError: MediaSource is not defined)

View File

@ -22,8 +22,7 @@
# do ok(true, "Type not supported") and stop the test.
[DEFAULT]
#bug 918299
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug,b2g-desktop(bug 918299)
support-files =
320x240.ogv
320x240.ogv^headers^
@ -298,28 +297,43 @@ support-files =
[test_aspectratio_mp4.html]
[test_audio1.html]
[test_audio2.html]
[test_audioDocumentTitle.html]
skip-if = true # bug 475110
[test_autoplay.html]
[test_autoplay_contentEditable.html]
skip-if = buildapp == 'b2g' # bug 899074 - timeouts
[test_buffered.html]
skip-if = toolkit == 'android' || os == "win" || (toolkit == 'gonk' && !debug) # See bug 832768 and 864682, b2g(assertion failures)
[test_bug448534.html]
skip-if = buildapp == 'b2g' # b2g(Timed out, bug 894922? Bug 902677 is for the timing out of a lot of media tests) b2g-debug(Timed out, bug 894922? Bug 902677 is for the timing out of a lot of media tests) b2g-desktop(Timed out, bug 894922? Bug 902677 is for the timing out of a lot of media tests)
skip-if = buildapp == 'b2g' # b2g(Timed out, bug 894922? Bug 902677 is for the timing out of a lot of media tests)
[test_bug463162.xhtml]
[test_bug465498.html]
skip-if = os == "win" || (toolkit == 'gonk' && !debug) # See bug 832768 and 864682
[test_bug493187.html]
skip-if = os == "win" || (toolkit == 'gonk' && !debug) # See bug 707777
[test_bug495145.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(timed out) b2g-desktop(timed out)
[test_bug495300.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
[test_bug654550.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(timed out) b2g-desktop(timed out)
[test_bug686942.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(timed out) b2g-desktop(timed out)
# [test_bug726904.html] # disabled - See bug 754860
[test_bug726904.html]
skip-if = true # bug 754860
[test_bug874897.html]
[test_bug883173.html]
[test_bug895305.html]
[test_bug895091.html]
[test_bug895305.html]
[test_bug919265.html]
[test_bug957847.html]
[test_can_play_type.html]
[test_can_play_type_mpeg.html]
skip-if = buildapp == 'b2g' # b2g(7 failures out of 27)
[test_can_play_type_no_ogg.html]
[test_can_play_type_ogg.html]
skip-if = buildapp == 'b2g' || e10s
[test_chaining.html]
skip-if = buildapp == 'b2g' # b2g(timed out) b2g-debug(timed out) b2g-desktop(timed out)
skip-if = buildapp == 'b2g' # timeouts
[test_clone_media_element.html]
[test_closing_connections.html]
[test_constants.html]
[test_contentDuration1.html]
[test_contentDuration2.html]
[test_contentDuration3.html]
@ -327,169 +341,132 @@ skip-if = buildapp == 'b2g' # b2g(timed out) b2g-debug(timed out) b2g-desktop(ti
[test_contentDuration5.html]
[test_contentDuration6.html]
[test_contentDuration7.html]
[test_can_play_type.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(timed out) b2g-desktop(timed out)
[test_can_play_type_mpeg.html]
skip-if = buildapp == 'b2g' # b2g(7 failures out of 27) b2g-debug(7 failures out of 27) b2g-desktop(7 failures out of 27)
[test_can_play_type_ogg.html]
skip-if = buildapp == 'b2g' || e10s
[test_can_play_type_no_ogg.html]
[test_closing_connections.html]
[test_constants.html]
[test_controls.html]
[test_currentTime.html]
[test_decode_error.html]
[test_decoder_disable.html]
[test_defaultMuted.html]
[test_delay_load.html]
skip-if = buildapp == 'b2g' # b2g(6 failures) b2g-debug(6 failures) b2g-desktop(6 failures)
skip-if = buildapp == 'b2g' # b2g(6 failures)
[test_error_in_video_document.html]
skip-if = true # bug 608634
[test_error_on_404.html]
skip-if = buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(timed out) b2g-desktop(timed out)
[test_fastSeek.html]
[test_info_leak.html]
skip-if = buildapp == 'b2g' # b2g(2 failures) b2g-debug(2 failures) b2g-desktop(2 failures)
skip-if = buildapp == 'b2g' # b2g(2 failures)
[test_invalid_reject.html]
[test_load.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(Timed out after gizmo.mp4) b2g-desktop(Timed out after gizmo.mp4)
[test_load_candidates.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(timed out) b2g-desktop(timed out)
[test_load_same_resource.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
[test_load_source.html]
[test_loop.html]
[test_media_selection.html]
skip-if = os == "win" || (toolkit == 'gonk' && !debug) # See bug 897843, b2g(timed out)
[test_media_sniffer.html]
[test_mediarecorder_avoid_recursion.html]
[test_mediarecorder_creation.html]
[test_mediarecorder_creation_fail.html]
[test_mediarecorder_getencodeddata.html]
[test_mediarecorder_record_4ch_audiocontext.html]
skip-if = (toolkit == 'gonk' && !debug)
[test_mediarecorder_record_audiocontext.html]
[test_mediarecorder_record_audiocontext_mlk.html]
[test_mediarecorder_record_gum_video_timeslice.html]
skip-if = buildapp == 'b2g' || (toolkit == 'android') # mimetype check, bug 969289
[test_mediarecorder_record_immediate_stop.html]
[test_mediarecorder_record_no_timeslice.html]
[test_mediarecorder_record_nosrc.html]
[test_mediarecorder_record_session.html]
[test_mediarecorder_record_startstopstart.html]
[test_mediarecorder_record_stopms.html]
[test_mediarecorder_record_timeslice.html]
[test_mediarecorder_reload_crash.html]
[test_mediarecorder_unsupported_src.html]
[test_metadata.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
[test_no_load_event.html]
[test_mixed_principals.html]
skip-if = true # bug 567954 and 574586
[test_mozHasAudio.html]
[test_networkState.html]
[test_new_audio.html]
[test_no_load_event.html]
[test_paused.html]
[test_paused_after_ended.html]
[test_play_events.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough) b2g-desktop(Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough)
[test_play_events_2.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough) b2g-desktop(Last event should be canplaythrough for gizmo.mp4 - got playing, expected canplaythrough)
[test_playback_errors.html]
[test_seekable1.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
[test_preload_actions.html]
[test_preload_attribute.html]
[test_progress.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(bug 901716 - timeouts) b2g-desktop(bug 901716 - timeouts)
[test_reactivate.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) # b2g-debug(timed out in small-shot.mp3) b2g-desktop(timed out in small-shot.mp3)
[test_readyState.html]
[test_referer.html]
[test_reset_events_async.html]
[test_replay_metadata.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
[test_seek2.html]
[test_seek_out_of_range.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
[test_seekable2.html]
[test_seekable3.html]
skip-if = buildapp == 'b2g' # b2g(timed out) b2g-debug(timed out) b2g-desktop(timed out)
[test_source.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
[test_source_write.html]
[test_source_null.html]
[test_standalone.html]
[test_volume.html]
[test_video_to_canvas.html]
[test_mediarecorder_creation.html]
[test_mediarecorder_creation_fail.html]
[test_mediarecorder_avoid_recursion.html]
[test_mediarecorder_record_timeslice.html]
[test_mediarecorder_record_audiocontext.html]
[test_mediarecorder_record_audiocontext_mlk.html]
[test_mediarecorder_record_4ch_audiocontext.html]
skip-if = (toolkit == 'gonk' && !debug)
[test_mediarecorder_record_stopms.html]
[test_mediarecorder_record_nosrc.html]
[test_mozHasAudio.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
[test_source_media.html]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug))
[test_autoplay_contentEditable.html]
skip-if = buildapp == 'b2g' # b2g(bug 899074 - timeouts) b2g-debug(bug 899074 - timeouts) b2g-desktop(bug 899074 - timeouts)
[test_decoder_disable.html]
[test_mediarecorder_record_no_timeslice.html]
[test_mediarecorder_reload_crash.html]
[test_mediarecorder_record_immediate_stop.html]
[test_mediarecorder_record_session.html]
[test_mediarecorder_record_startstopstart.html]
[test_mediarecorder_getencodeddata.html]
[test_mediarecorder_unsupported_src.html]
[test_mediarecorder_record_gum_video_timeslice.html]
skip-if = buildapp == 'b2g' || (toolkit == 'android') # mimetype check, bug 969289
[test_playback.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' # Disabled on Android & B2G due to bug 668973
[test_seekLies.html]
[test_media_sniffer.html]
[test_streams_srcObject.html]
[test_reset_src.html]
[test_streams_autoplay.html]
[test_streams_element_capture.html]
[test_streams_element_capture_reset.html]
skip-if = buildapp == 'b2g' # b2g(bug 901102) b2g-debug(bug 901102) b2g-desktop(bug 901102)
[test_streams_element_capture_createObjectURL.html]
[test_streams_element_capture_playback.html]
[test_streams_gc.html]
skip-if = buildapp == 'b2g' # b2g(Value being assigned to HTMLMediaElement.currentTime is not a finite floating-point value) b2g-debug(Value being assigned to HTMLMediaElement.currentTime is not a finite floating-point value) b2g-desktop(Value being assigned to HTMLMediaElement.currentTime is not a finite floating-point value)
[test_streams_tracks.html]
[test_trackelementevent.html]
[test_texttrack.html]
[test_texttrackcue.html]
[test_trackevent.html]
[test_texttrackregion.html]
[test_texttracklist.html]
[test_timeupdate_small_files.html]
[test_unseekable.html]
skip-if = buildapp == 'b2g'
[test_VideoPlaybackQuality.html]
[test_VideoPlaybackQuality_disabled.html]
[test_webvtt_disabled.html]
# [test_audioDocumentTitle.html] # disabled - See bug 475110
# [test_error_in_video_document.html] # disabled - See bug 608634
# [test_mixed_principals.html] # disabled - See bug 567954 and 574586
# [test_playback_rate_playpause.html] # disabled - See bug 897108
# [test_played.html] # disabled - See bug 751539
# [test_preload_suspend.html] # disabled - See bug 493692
# [test_resume.html] # disabled - No bug :-(
# [test_videoDocumentTitle.html] # disabled - See bug 492821
# [test_playback_rate.html] # disabled - See bug 921622
# Disabled since it causes random memory corruption, bug 921622, so
# the best-case scenario is that it results in random crashes while it
# runs, like bug 918417, bug 920827, bug 923996, bug 928225, bug 929521
# bug 930982, bug 932193. Worst-case but quite likely, it causes random
# crashes and failures in other tests which run after it. Don't even think
# about reenabling it on any platform unless you *know* that you have fixed
# that. Then don't think about reenabling it on Windows until you know that
# you have fixed the timeouts of bug 832768, bug 814533, bug 840742
[test_play_twice.html]
# Seamonkey: Bug 598252, B2G: Bug 982100, Android: Bug 758476, bug 981086
skip-if = appname == "seamonkey" || toolkit == 'gonk' || toolkit == 'android'
[test_buffered.html]
skip-if = toolkit == 'android' || os == "win" || (toolkit == 'gonk' && !debug) # See bug 832768 and 864682, b2g(assertion failures)
[test_bug465498.html]
skip-if = os == "win" || (toolkit == 'gonk' && !debug) # See bug 832768 and 864682
[test_bug493187.html]
skip-if = os == "win" || (buildapp=='b2g'&&debug) || (toolkit == 'gonk' && !debug) # See bug 707777, #b2g-emulator-debug - process crash
[test_media_selection.html]
skip-if = os == "win" || (toolkit == 'gonk' && !debug) # See bug 897843, b2g(timed out)
[test_playback.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' # Disabled on Android & B2G due to bug 668973
[test_playback_errors.html]
[test_playback_rate.html]
# Win: Bug 814533, B2G & Android Debug: Bug 1020538
skip-if = os == 'win' || buildapp == 'b2g' || (toolkit == 'android' && debug)
[test_playback_rate_playpause.html]
skip-if = true # bug 897108
[test_played.html]
skip-if = true # bug 751539
[test_preload_actions.html]
[test_preload_attribute.html]
[test_preload_suspend.html]
skip-if = true # bug 493692
[test_progress.html]
[test_reactivate.html]
[test_readyState.html]
[test_referer.html]
[test_replay_metadata.html]
[test_reset_events_async.html]
[test_reset_src.html]
[test_resume.html]
skip-if = true # disabled - No bug :-(
[test_seek_out_of_range.html]
[test_seek.html]
skip-if = toolkit == 'android' || (toolkit == 'gonk' && !debug) # See bug 832678, 795271, and 857424 # android(bug 845162) androidx86(bug 845162)
[test_seek2.html]
[test_seekable1.html]
[test_seekable2.html]
[test_seekable3.html]
skip-if = buildapp == 'b2g' # timeouts
[test_seekLies.html]
[test_source.html]
[test_source_media.html]
[test_source_null.html]
[test_source_write.html]
[test_standalone.html]
[test_streams_autoplay.html]
[test_streams_element_capture.html]
[test_streams_element_capture_createObjectURL.html]
[test_streams_element_capture_playback.html]
[test_streams_element_capture_reset.html]
skip-if = buildapp == 'b2g' # bug 901102
[test_streams_gc.html]
skip-if = buildapp == 'b2g' # Value being assigned to HTMLMediaElement.currentTime is not a finite floating-point value
[test_streams_srcObject.html]
[test_streams_tracks.html]
[test_texttrack.html]
[test_texttrackcue.html]
[test_texttracklist.html]
[test_texttrackregion.html]
[test_timeupdate_small_files.html]
[test_trackelementevent.html]
[test_trackevent.html]
[test_unseekable.html]
skip-if = buildapp == 'b2g'
[test_video_to_canvas.html]
[test_videoDocumentTitle.html]
skip-if = true # bug 492821
[test_VideoPlaybackQuality.html]
[test_VideoPlaybackQuality_disabled.html]
[test_volume.html]
[test_webvtt_disabled.html]
# The tests below contain backend-specific tests. Write backend independent
# tests rather than adding to this list.
[test_can_play_type_webm.html]
run-if = webm
[test_can_play_type_no_webm.html]
skip-if = webm
[test_can_play_type_wave.html]
run-if = wave
[test_can_play_type_no_wave.html]

View File

@ -10,12 +10,19 @@
<pre id="test">
<script class="testbody" type='application/javascript;version=1.8'>
SimpleTest.expectAssertions(0, 2);
// In varying quantities:
// ASSERTION: Should be on state machine or decode thread.:
// 'OnStateMachineThread() || OnDecodeThread()',
// file MediaDecoderStateMachine.cpp, line 559
// ASSERTION: Clock should go forwards if the playback rate is > 0.:
// 'mCurrentFrameTime <= clock_time || mPlaybackRate <= 0',
// file MediaDecoderStateMachine.cpp, line 2379
// This test is currently disabled on Android debug for wildly-varying numbers of the above.
SimpleTest.expectAssertions(5, 9);
if (navigator.platform.startsWith("Win")) {
SimpleTest.expectAssertions(0, 1);
SimpleTest.expectAssertions(4, 5);
} else if (navigator.platform.startsWith("Mac")) {
SimpleTest.expectAssertions(0, 2);
SimpleTest.expectAssertions(5, 7);
}
let manager = new MediaTestManager;

View File

@ -1,5 +1,5 @@
[DEFAULT]
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) #b2g-debug(bug 916135) b2g-desktop(bug 916135)
skip-if = (buildapp == 'b2g' && (toolkit != 'gonk' || debug)) #b2g-debug,b2g-desktop(bug 916135)
support-files =
audio-expected.wav
audio-mono-expected-2.wav
@ -23,11 +23,8 @@ support-files =
ting-48k-2ch.wav
webaudio.js
[test_AudioBuffer.html]
[test_AudioContext.html]
[test_AudioListener.html]
[test_OfflineAudioContext.html]
[test_analyserNode.html]
[test_AudioBuffer.html]
[test_audioBufferSourceNode.html]
[test_audioBufferSourceNodeEnded.html]
[test_audioBufferSourceNodeLazyLoopParam.html]
@ -39,14 +36,17 @@ support-files =
[test_audioBufferSourceNodeNullBuffer.html]
[test_audioBufferSourceNodeOffset.html]
skip-if = (toolkit == 'gonk' && !debug) #bug 906752
[test_AudioContext.html]
[test_audioDestinationNode.html]
[test_AudioListener.html]
[test_audioParamExponentialRamp.html]
[test_audioParamGain.html]
[test_audioParamLinearRamp.html]
[test_audioParamSetCurveAtTime.html]
[test_audioParamSetCurveAtTimeZeroDuration.html]
[test_audioParamSetTargetAtTime.html]
[test_audioParamSetValueAtTime.html]
[test_audioParamTimelineDestinationOffset.html]
[test_audioParamGain.html]
[test_badConnect.html]
[test_biquadFilterNode.html]
[test_biquadFilterNodeWithGain.html]
@ -72,9 +72,9 @@ skip-if = (toolkit == 'gonk' && !debug) #bug 906752
[test_channelSplitterNode.html]
[test_channelSplitterNodeWithVolume.html]
[test_convolverNode.html]
[test_convolverNode_mono_mono.html]
[test_convolverNodeChannelCount.html]
[test_convolverNodeWithGain.html]
[test_convolverNode_mono_mono.html]
[test_currentTime.html]
[test_decodeMultichannel.html]
[test_delayNode.html]
@ -98,7 +98,10 @@ skip-if = (toolkit == 'gonk' && !debug) #bug 906752
[test_mediaStreamAudioSourceNodeCrossOrigin.html]
[test_mediaStreamAudioSourceNodeResampling.html]
[test_mixingRules.html]
[test_mozaudiochannel.html]
skip-if = (toolkit == 'gonk' && !debug)
[test_nodeToParamConnection.html]
[test_OfflineAudioContext.html]
[test_offlineDestinationChannelCountLess.html]
[test_offlineDestinationChannelCountMore.html]
[test_oscillatorNode.html]
@ -106,22 +109,19 @@ skip-if = (toolkit == 'gonk' && !debug) #bug 906752
[test_oscillatorNodeStart.html]
[test_oscillatorTypeChange.html]
[test_pannerNode.html]
[test_pannerNode_equalPower.html]
[test_pannerNodeAbove.html]
[test_pannerNodeChannelCount.html]
[test_pannerNodeHRTFSymmetry.html]
[test_pannerNodeTail.html]
[test_pannerNode_equalPower.html]
[test_periodicWave.html]
[test_scriptProcessorNode.html]
[test_scriptProcessorNodeChannelCount.html]
[test_scriptProcessorNodeZeroInputOutput.html]
[test_scriptProcessorNodeNotConnected.html]
[test_stereoPanningWithGain.html]
[test_singleSourceDest.html]
[test_stereoPanningWithGain.html]
[test_waveDecoder.html]
[test_waveShaper.html]
[test_waveShaperNoCurve.html]
[test_waveShaperZeroLengthCurve.html]
[test_audioDestinationNode.html]
[test_mozaudiochannel.html]
skip-if = (toolkit == 'gonk' && !debug)
[test_waveDecoder.html]

View File

@ -10,10 +10,10 @@ support-files =
[test_audio_capture_error.html]
[test_call_start_from_end_handler.html]
[test_nested_eventloop.html]
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(showmodaldialog) b2g-debug(showmodaldialog) b2g-desktop(showmodaldialog)
skip-if = buildapp == 'b2g' || toolkit == 'android' || e10s # b2g(showmodaldialog)
[test_preference_enable.html]
[test_recognition_service_error.html]
skip-if = buildapp == 'b2g' # b2g(timed out) b2g-debug(timed out) b2g-desktop(timed out)
skip-if = buildapp == 'b2g' # b2g(timed out)
[test_success_without_recognition_service.html]
[test_timeout.html]
skip-if = os == "win"

View File

@ -8,6 +8,6 @@ support-files =
[test_setup.html]
[test_speech_queue.html]
skip-if = buildapp == 'b2g' # b2g(Test timed out) b2g-debug(Test timed out) b2g-desktop(Test timed out)
skip-if = buildapp == 'b2g' # b2g(Test timed out)
[test_speech_simple.html]
skip-if = buildapp == 'b2g' # b2g(Test timed out) b2g-debug(Test timed out) b2g-desktop(Test timed out)
skip-if = buildapp == 'b2g' # b2g(Test timed out)

View File

@ -65,6 +65,21 @@ SVGDocument::GetRootElement(ErrorResult& aRv)
return static_cast<nsSVGElement*>(root);
}
nsresult
SVGDocument::InsertChildAt(nsIContent* aKid, uint32_t aIndex, bool aNotify)
{
nsresult rv = XMLDocument::InsertChildAt(aKid, aIndex, aNotify);
if (NS_SUCCEEDED(rv) && aKid->IsElement() && !aKid->IsSVG()) {
// We can get here when well formed XML with a non-SVG root element is
// served with the SVG MIME type, for example. In that case we need to load
// the non-SVG UA sheets or else we can get bugs like bug 1016145.
EnsureNonSVGUserAgentStyleSheetsLoaded();
}
return rv;
}
nsresult
SVGDocument::Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const
{

View File

@ -28,6 +28,8 @@ public:
mType = eSVG;
}
virtual nsresult InsertChildAt(nsIContent* aKid, uint32_t aIndex,
bool aNotify) MOZ_OVERRIDE;
virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const MOZ_OVERRIDE;
// WebIDL API

View File

@ -19,7 +19,6 @@
#include "nsIDocShellTreeItem.h"
#include "nsIURI.h"
#include "nsIContentViewer.h"
#include "nsICacheService.h"
#include "nsIObserverService.h"
#include "prclist.h"
#include "mozilla/Services.h"
@ -190,7 +189,7 @@ nsSHistoryObserver::Observe(nsISupports *aSubject, const char *aTopic,
if (!strcmp(aTopic, NS_PREFBRANCH_PREFCHANGE_TOPIC_ID)) {
nsSHistory::UpdatePrefs();
nsSHistory::GloballyEvictContentViewers();
} else if (!strcmp(aTopic, NS_CACHESERVICE_EMPTYCACHE_TOPIC_ID) ||
} else if (!strcmp(aTopic, "cacheservice:empty-cache") ||
!strcmp(aTopic, "memory-pressure")) {
nsSHistory::GloballyEvictAllContentViewers();
}
@ -370,7 +369,7 @@ nsSHistory::Startup()
// Observe empty-cache notifications so tahat clearing the disk/memory
// cache will also evict all content viewers.
obsSvc->AddObserver(gObserver,
NS_CACHESERVICE_EMPTYCACHE_TOPIC_ID, false);
"cacheservice:empty-cache", false);
// Same for memory-pressure notifications
obsSvc->AddObserver(gObserver, "memory-pressure", false);
@ -391,7 +390,7 @@ nsSHistory::Shutdown()
nsCOMPtr<nsIObserverService> obsSvc =
mozilla::services::GetObserverService();
if (obsSvc) {
obsSvc->RemoveObserver(gObserver, NS_CACHESERVICE_EMPTYCACHE_TOPIC_ID);
obsSvc->RemoveObserver(gObserver, "cacheservice:empty-cache");
obsSvc->RemoveObserver(gObserver, "memory-pressure");
}
NS_RELEASE(gObserver);

View File

@ -4,6 +4,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "MessageChannel.h"
#include "mozilla/Preferences.h"
#include "mozilla/dom/MessageChannelBinding.h"
#include "mozilla/dom/MessagePort.h"
@ -28,16 +29,38 @@ namespace {
}
/* static */ bool
MessageChannel::PrefEnabled()
MessageChannel::Enabled(JSContext* aCx, JSObject* aObj)
{
if (!gPrefInitialized) {
Preferences::AddBoolVarCache(&gPrefEnabled, "dom.messageChannel.enabled");
gPrefInitialized = true;
}
return gPrefEnabled;
// Enabled by pref
if (gPrefEnabled) {
return true;
}
// Chrome callers are allowed.
if (nsContentUtils::ThreadsafeIsCallerChrome()) {
return true;
}
nsCOMPtr<nsIPrincipal> principal = nsContentUtils::SubjectPrincipal();
MOZ_ASSERT(principal);
nsCOMPtr<nsIURI> uri;
if (NS_FAILED(principal->GetURI(getter_AddRefs(uri))) || !uri) {
return false;
}
bool isResource = false;
if (NS_FAILED(uri->SchemeIs("resource", &isResource))) {
return false;
}
return isResource;
}
MessageChannel::MessageChannel(nsPIDOMWindow* aWindow)

View File

@ -28,7 +28,7 @@ public:
NS_DECL_CYCLE_COLLECTING_ISUPPORTS
NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(MessageChannel)
static bool PrefEnabled();
static bool Enabled(JSContext* aCx, JSObject* aGlobal);
public:
MessageChannel(nsPIDOMWindow* aWindow);

View File

@ -7905,7 +7905,7 @@ PostMessageReadTransferStructuredClone(JSContext* aCx,
StructuredCloneInfo* scInfo = static_cast<StructuredCloneInfo*>(aClosure);
NS_ASSERTION(scInfo, "Must have scInfo!");
if (MessageChannel::PrefEnabled() && tag == SCTAG_DOM_MAP_MESSAGEPORT) {
if (tag == SCTAG_DOM_MAP_MESSAGEPORT) {
MessagePort* port = static_cast<MessagePort*>(aData);
port->BindToOwner(scInfo->window);
scInfo->ports.Put(port, nullptr);
@ -7934,26 +7934,24 @@ PostMessageTransferStructuredClone(JSContext* aCx,
StructuredCloneInfo* scInfo = static_cast<StructuredCloneInfo*>(aClosure);
NS_ASSERTION(scInfo, "Must have scInfo!");
if (MessageChannel::PrefEnabled()) {
MessagePortBase* port = nullptr;
nsresult rv = UNWRAP_OBJECT(MessagePort, aObj, port);
if (NS_SUCCEEDED(rv)) {
nsRefPtr<MessagePortBase> newPort;
if (scInfo->ports.Get(port, getter_AddRefs(newPort))) {
// No duplicate.
return false;
}
newPort = port->Clone();
scInfo->ports.Put(port, newPort);
*aTag = SCTAG_DOM_MAP_MESSAGEPORT;
*aOwnership = JS::SCTAG_TMO_CUSTOM;
*aContent = newPort;
*aExtraData = 0;
return true;
MessagePortBase* port = nullptr;
nsresult rv = UNWRAP_OBJECT(MessagePort, aObj, port);
if (NS_SUCCEEDED(rv)) {
nsRefPtr<MessagePortBase> newPort;
if (scInfo->ports.Get(port, getter_AddRefs(newPort))) {
// No duplicate.
return false;
}
newPort = port->Clone();
scInfo->ports.Put(port, newPort);
*aTag = SCTAG_DOM_MAP_MESSAGEPORT;
*aOwnership = JS::SCTAG_TMO_CUSTOM;
*aContent = newPort;
*aExtraData = 0;
return true;
}
return false;
@ -7966,7 +7964,7 @@ PostMessageFreeTransferStructuredClone(uint32_t aTag, JS::TransferableOwnership
StructuredCloneInfo* scInfo = static_cast<StructuredCloneInfo*>(aClosure);
NS_ASSERTION(scInfo, "Must have scInfo!");
if (MessageChannel::PrefEnabled() && aTag == SCTAG_DOM_MAP_MESSAGEPORT) {
if (aTag == SCTAG_DOM_MAP_MESSAGEPORT) {
nsRefPtr<MessagePortBase> port(static_cast<MessagePort*>(aContent));
scInfo->ports.Remove(port);
}

View File

@ -967,6 +967,7 @@ public:
void SizeToContent(mozilla::ErrorResult& aError);
nsIDOMCrypto* GetCrypto(mozilla::ErrorResult& aError);
nsIControllers* GetControllers(mozilla::ErrorResult& aError);
mozilla::dom::Element* GetRealFrameElement(mozilla::ErrorResult& aError);
float GetMozInnerScreenX(mozilla::ErrorResult& aError);
float GetMozInnerScreenY(mozilla::ErrorResult& aError);
float GetDevicePixelRatio(mozilla::ErrorResult& aError);
@ -1374,8 +1375,6 @@ protected:
nsGlobalWindow* InnerForSetTimeoutOrInterval(mozilla::ErrorResult& aError);
mozilla::dom::Element* GetRealFrameElement(mozilla::ErrorResult& aError);
void PostMessageMoz(JSContext* aCx, JS::Handle<JS::Value> aMessage,
const nsAString& aTargetOrigin,
JS::Handle<JS::Value> aTransfer,

View File

@ -8,6 +8,7 @@ support-files =
[test_domrequesthelper.xul]
[test_url.xul]
[test_console.xul]
[test_messageChannel.xul]
[test_navigator_resolve_identity_xrays.xul]
[test_sendQueryContentAndSelectionSetEvent.html]
[test_bug1016960.html]

View File

@ -0,0 +1,11 @@
<!DOCTYPE HTML>
<html>
<body>
<script type="application/javascript">
window.addEventListener('message', receiveMessage, false);
function receiveMessage(evt) {
evt.data.postMessage("Hello world");
}
</script>
</body>

View File

@ -2,6 +2,7 @@
support-files =
audio.ogg
iframe_messageChannel_cloning.html
iframe_messageChannel_chrome.html
iframe_messageChannel_pingpong.html
iframe_messageChannel_post.html
file_empty.html

View File

@ -0,0 +1,38 @@
<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="chrome://global/skin"?>
<?xml-stylesheet type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css"?>
<window title="Test for MessageChannel API"
xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"/>
<!-- test results are displayed in the html:body -->
<body xmlns="http://www.w3.org/1999/xhtml" id="body">
</body>
<!-- test code goes here -->
<script type="application/javascript"><![CDATA[
ok("MessageChannel" in window, "Should MessageChannel exist?");
var channel = new MessageChannel();
ok(channel, "MessageChannel is created");
channel.port1.onmessage = function(evt) {
ok(true, "message received!");
SimpleTest.finish();
}
var ifr = document.createElement('browser');
ifr.setAttribute("src", "http://mochi.test:8888/tests/dom/base/test/iframe_messageChannel_chrome.html");
ifr.setAttribute("flex", "1");
ifr.addEventListener('load', function() {
ifr.contentWindow.postMessage(channel.port2, '*', [channel.port2]);
});
var body = document.getElementById("body");
body.appendChild(ifr);
SimpleTest.waitForExplicitFinish();
]]></script>
</window>

View File

@ -317,7 +317,8 @@ public:
mStrength = SECKEY_PublicKeyStrength(mPubKey);
// Verify that the data input is not too big
// (as required by PKCS#1 / RFC 3447)
// (as required by PKCS#1 / RFC 3447, Section 7.2)
// http://tools.ietf.org/html/rfc3447#section-7.2
if (mData.Length() > mStrength - 11) {
mEarlyRv = NS_ERROR_DOM_DATA_ERR;
return;
@ -448,10 +449,12 @@ private:
// Compare the MAC to the provided signature
// No truncation allowed
bool equal = (mResult.Length() == mSignature.Length());
int cmp = NSS_SecureMemcmp(mSignature.Elements(),
mResult.Elements(),
mSignature.Length());
equal = equal && (cmp == 0);
if (equal) {
int cmp = NSS_SecureMemcmp(mSignature.Elements(),
mResult.Elements(),
mSignature.Length());
equal = (cmp == 0);
}
mResultPromise->MaybeResolve(equal);
}
}
@ -535,9 +538,13 @@ private:
rv = MapSECStatus(SGN_End(ctx, signature));
NS_ENSURE_SUCCESS(rv, NS_ERROR_DOM_OPERATION_ERR);
mSignature.Assign(signature);
ATTEMPT_BUFFER_ASSIGN(mSignature, signature);
} else {
ScopedSECItem signature(mSignature.ToSECItem());
if (!signature) {
return NS_ERROR_DOM_UNKNOWN_ERR;
}
ScopedVFYContext ctx(VFY_CreateContext(mPubKey, signature,
mOidTag, nullptr));
if (!ctx) {
@ -585,6 +592,7 @@ public:
nsString algName;
mEarlyRv = GetAlgorithmName(aCx, aAlgorithm, algName);
if (NS_FAILED(mEarlyRv)) {
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
return;
}
@ -937,32 +945,31 @@ private:
if (mResult.Length() == 0) {
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
return NS_OK;
} else if (mFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_PKCS8)) {
if (!mPrivateKey) {
mEarlyRv = NS_ERROR_DOM_NOT_SUPPORTED_ERR;
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
switch (mPrivateKey->keyType) {
case rsaKey:
Key::PrivateKeyToPkcs8(mPrivateKey.get(), mResult, locker);
mEarlyRv = NS_OK;
break;
return NS_OK;
default:
mEarlyRv = NS_ERROR_DOM_NOT_SUPPORTED_ERR;
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
} else if (mFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_SPKI)) {
if (!mPublicKey) {
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
mEarlyRv = Key::PublicKeyToSpki(mPublicKey.get(), mResult, locker);
return Key::PublicKeyToSpki(mPublicKey.get(), mResult, locker);
} else if (mFormat.EqualsLiteral(WEBCRYPTO_KEY_FORMAT_JWK)) {
mEarlyRv = NS_ERROR_DOM_NOT_SUPPORTED_ERR;
} else {
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
return NS_ERROR_DOM_NOT_SUPPORTED_ERR;
}
return NS_OK;
return NS_ERROR_DOM_SYNTAX_ERR;
}
};
@ -988,6 +995,7 @@ public:
nsString algName;
mEarlyRv = GetAlgorithmName(aCx, aAlgorithm, algName);
if (NS_FAILED(mEarlyRv)) {
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
return;
}
@ -1001,6 +1009,7 @@ public:
mEarlyRv = Coerce(aCx, params, aAlgorithm);
if (NS_FAILED(mEarlyRv) || !params.mLength.WasPassed()) {
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
return;
}
mLength = params.mLength.Value();
@ -1026,6 +1035,7 @@ public:
Algorithm hashAlg;
mEarlyRv = Coerce(aCx, hashAlg, params.mHash.Value());
if (NS_FAILED(mEarlyRv) || !hashAlg.mName.WasPassed()) {
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
return;
}
hashName.Assign(hashAlg.mName.Value());
@ -1052,8 +1062,6 @@ public:
mMechanism = algorithm->Mechanism();
mKey->SetAlgorithm(algorithm);
// SetSymKey done in Resolve, after we've done the keygen
return;
}
private:
@ -1115,6 +1123,7 @@ public:
nsString algName;
mEarlyRv = GetAlgorithmName(aCx, aAlgorithm, algName);
if (NS_FAILED(mEarlyRv)) {
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
return;
}
@ -1127,8 +1136,8 @@ public:
if (NS_FAILED(mEarlyRv) || !params.mModulusLength.WasPassed() ||
!params.mPublicExponent.WasPassed() ||
!params.mHash.WasPassed()) {
// TODO fix error and handle default values
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
return;
}
// Pull relevant info
@ -1138,6 +1147,7 @@ public:
nsString hashName;
mEarlyRv = GetAlgorithmName(aCx, params.mHash.Value(), hashName);
if (NS_FAILED(mEarlyRv)) {
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
return;
}
@ -1163,8 +1173,8 @@ public:
mEarlyRv = Coerce(aCx, params, aAlgorithm);
if (NS_FAILED(mEarlyRv) || !params.mModulusLength.WasPassed() ||
!params.mPublicExponent.WasPassed()) {
// TODO fix error and handle default values
mEarlyRv = NS_ERROR_DOM_SYNTAX_ERR;
return;
}
// Pull relevant info
@ -1215,8 +1225,6 @@ public:
return;
}
}
return;
}
private:

View File

@ -7,6 +7,7 @@
#undef CreateEvent
#include "mozilla/BasicEvents.h"
#include "mozilla/CycleCollectedJSRuntime.h"
#include "mozilla/EventDispatcher.h"
#include "mozilla/EventListenerManager.h"
#ifdef MOZ_B2G
@ -1329,6 +1330,27 @@ EventListenerManager::MarkForCC()
}
}
void
EventListenerManager::TraceListeners(JSTracer* aTrc)
{
uint32_t count = mListeners.Length();
for (uint32_t i = 0; i < count; ++i) {
const Listener& listener = mListeners.ElementAt(i);
JSEventHandler* jsEventHandler = listener.GetJSEventHandler();
if (jsEventHandler) {
const TypedEventHandler& typedHandler =
jsEventHandler->GetTypedEventHandler();
if (typedHandler.HasEventHandler()) {
mozilla::TraceScriptHolder(typedHandler.Ptr(), aTrc);
}
} else if (listener.mListenerType == Listener::eWebIDLListener) {
mozilla::TraceScriptHolder(listener.mListener.GetWebIDLCallback(), aTrc);
}
// We might have eWrappedJSListener, but that is the legacy type for
// JS implemented event listeners, and trickier to handle here.
}
}
already_AddRefed<nsIScriptGlobalObject>
EventListenerManager::GetScriptGlobalAndDocument(nsIDocument** aDoc)
{

View File

@ -20,6 +20,7 @@ class nsIDOMEvent;
class nsIEventListenerInfo;
class nsIScriptContext;
class nsPIDOMWindow;
class JSTracer;
struct EventTypeData;
@ -404,6 +405,8 @@ public:
void MarkForCC();
void TraceListeners(JSTracer* aTrc);
dom::EventTarget* GetTarget() { return mTarget; }
protected:

View File

@ -479,7 +479,7 @@ TabChildBase::DispatchSynthesizedMouseEvent(uint32_t aMsg, uint64_t aTime,
nsIWidget* aWidget)
{
MOZ_ASSERT(aMsg == NS_MOUSE_MOVE || aMsg == NS_MOUSE_BUTTON_DOWN ||
aMsg == NS_MOUSE_BUTTON_UP);
aMsg == NS_MOUSE_BUTTON_UP || aMsg == NS_MOUSE_MOZLONGTAP);
WidgetMouseEvent event(true, aMsg, nullptr,
WidgetMouseEvent::eReal, WidgetMouseEvent::eNormal);
@ -691,6 +691,7 @@ TabChild::TabChild(ContentChild* aManager, const TabContext& aContext, uint32_t
, mOrientation(eScreenOrientation_PortraitPrimary)
, mUpdateHitRegion(false)
, mContextMenuHandled(false)
, mLongTapEventHandled(false)
, mWaitingTouchListeners(false)
, mIgnoreKeyPressEvent(false)
, mActiveElementManager(new ActiveElementManager())
@ -1739,7 +1740,17 @@ TabChild::RecvHandleLongTap(const CSSPoint& aPoint, const ScrollableLayerGuid& a
2, 1, 0, false,
nsIDOMMouseEvent::MOZ_SOURCE_TOUCH);
SendContentReceivedTouch(aGuid, mContextMenuHandled);
// If no one handle context menu, fire MOZLONGTAP event
if (!mContextMenuHandled) {
LayoutDevicePoint currentPoint =
APZCCallbackHelper::ApplyCallbackTransform(aPoint, aGuid) * mWidget->GetDefaultScale();
int time = 0;
nsEventStatus status =
DispatchSynthesizedMouseEvent(NS_MOUSE_MOZLONGTAP, time, currentPoint, mWidget);
mLongTapEventHandled = (status == nsEventStatus_eConsumeNoDefault);
}
SendContentReceivedTouch(aGuid, mContextMenuHandled || mLongTapEventHandled);
return true;
}
@ -1752,6 +1763,11 @@ TabChild::RecvHandleLongTapUp(const CSSPoint& aPoint, const ScrollableLayerGuid&
return true;
}
if (mLongTapEventHandled) {
mLongTapEventHandled = false;
return true;
}
RecvHandleSingleTap(aPoint, aGuid);
return true;
}

View File

@ -561,6 +561,7 @@ private:
ScreenOrientation mOrientation;
bool mUpdateHitRegion;
bool mContextMenuHandled;
bool mLongTapEventHandled;
bool mWaitingTouchListeners;
void FireSingleTapEvent(LayoutDevicePoint aPoint);

View File

@ -12,6 +12,11 @@ if CONFIG['MOZ_WEBRTC']:
'/media/webrtc/trunk',
]
if CONFIG['GNU_CXX']:
CXXFLAGS += [
'-Wno-unused-local-typedefs', # Workaround until we fix bug 1020661
]
TEST_DIRS += ['tests/mochitest', 'tests/ipc', 'tests/identity']
XPIDL_SOURCES += [

View File

@ -1,23 +1,19 @@
[DEFAULT]
skip-if = e10s
# All tests are disabled on android&b2g due to lack of https support in
# mochitests (Bug 907770)
# Tests are also disabled on b2g due to lack of e10s support in WebRTC identity
# (Bug 975144)
skip-if = e10s || os == "android" || appname == "b2g"
support-files =
/.well-known/idp-proxy/idp.html
/.well-known/idp-proxy/idp-proxy.js
identityevent.js
# All tests are disabled on android&b2g due to lack of https support in
# mochitests (Bug 907770)
# All tests are disabled on b2g due to lack of e10s support in WebRTC identity
# (Bug 975144)
[test_idpproxy.html]
skip-if = os == "android" || appname == "b2g"
[test_getIdentityAssertion.html]
skip-if = os == "android" || appname == "b2g"
[test_setIdentityProvider.html]
skip-if = os == "android" || appname == "b2g"
[test_setIdentityProviderWithErrors.html]
skip-if = os == "android" || appname == "b2g"
[test_peerConnection_peerIdentity.html]
skip-if = os == "android" || appname == "b2g"
# Bug 950317: Hack for making a cleanup hook after finishing all WebRTC cases
[../mochitest/test_zmedia_cleanup.html]
skip-if = os == "android" || appname == "b2g"

View File

@ -13,15 +13,15 @@ support-files =
skip-if = toolkit == 'gonk' #Bug 962984 for debug, bug 963244 for opt
[test_dataChannel_basicAudioVideo.html]
# Disabled on OS X for bug 930481 timeouts
skip-if = os == 'mac' || toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) b2g-debug(Bug 960442, video support for WebRTC is disabled on b2g)
skip-if = os == 'mac' || toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
[test_dataChannel_basicAudioVideoCombined.html]
# Disabled on OS X for bug 930481 timeouts
skip-if = os == 'mac' || toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) b2g-debug(Bug 960442, video support for WebRTC is disabled on b2g)
skip-if = os == 'mac' || toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
[test_dataChannel_basicDataOnly.html]
[test_dataChannel_basicVideo.html]
skip-if = toolkit=='gonk' # b2g emulator seems to bee too slow (Bug 1016498 and 1008080)
[test_dataChannel_bug1013809.html]
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) b2g-debug(Bug 960442, video support for WebRTC is disabled on b2g)
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
[test_dataChannel_noOffer.html]
[test_getUserMedia_basicAudio.html]
skip-if = (toolkit == 'gonk' && debug) #debug-only failure
@ -51,15 +51,15 @@ skip-if = (toolkit == 'gonk' && debug) #debug-only failure
[test_peerConnection_basicAudio.html]
skip-if = (toolkit == 'gonk' && debug) #Bug 962984, test fail on b2g debug build
[test_peerConnection_basicAudioVideo.html]
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) b2g-debug(Bug 960442, video support for WebRTC is disabled on b2g)
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
[test_peerConnection_basicAudioVideoCombined.html]
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) b2g-debug(Bug 960442, video support for WebRTC is disabled on b2g)
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
[test_peerConnection_basicVideo.html]
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) b2g-debug(Bug 960442, video support for WebRTC is disabled on b2g)
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
[test_peerConnection_bug822674.html]
[test_peerConnection_bug825703.html]
[test_peerConnection_bug827843.html]
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) b2g-debug(Bug 960442, video support for WebRTC is disabled on b2g)
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
[test_peerConnection_bug834153.html]
[test_peerConnection_bug835370.html]
skip-if = toolkit=='gonk' # b2g emulator seems to bee too slow (Bug 1016498 and 1008080)
@ -67,11 +67,11 @@ skip-if = toolkit=='gonk' # b2g emulator seems to bee too slow (Bug 1016498 and
[test_peerConnection_close.html]
[test_peerConnection_errorCallbacks.html]
[test_peerConnection_offerRequiresReceiveAudio.html]
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) b2g-debug(Bug 960442, video support for WebRTC is disabled on b2g)
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
[test_peerConnection_offerRequiresReceiveVideo.html]
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) b2g-debug(Bug 960442, video support for WebRTC is disabled on b2g)
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
[test_peerConnection_offerRequiresReceiveVideoAudio.html]
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) b2g-debug(Bug 960442, video support for WebRTC is disabled on b2g)
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
[test_peerConnection_setLocalAnswerInHaveLocalOffer.html]
[test_peerConnection_setLocalAnswerInStable.html]
[test_peerConnection_setLocalOfferInHaveRemoteOffer.html]
@ -79,7 +79,8 @@ skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled
[test_peerConnection_setRemoteAnswerInStable.html]
[test_peerConnection_setRemoteOfferInHaveLocalOffer.html]
[test_peerConnection_throwInCallbacks.html]
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g) b2g-debug(Bug 960442, video support for WebRTC is disabled on b2g)
skip-if = toolkit=='gonk' # b2g(Bug 960442, video support for WebRTC is disabled on b2g)
[test_peerConnection_toJSON.html]
# Bug950317: Hack for making a cleanup hook after finishing all WebRTC cases
# Bug 950317: Hack for making a cleanup hook after finishing all WebRTC cases
[test_zmedia_cleanup.html]

View File

@ -421,6 +421,62 @@ var commandsDataChannel = [
});
}
],
[
'PC_LOCAL_WAIT_FOR_ICE_CONNECTED',
function (test) {
var myTest = test;
var myPc = myTest.pcLocal;
function onIceConnectedSuccess () {
ok(true, "pc_local: ICE switched to 'connected' state");
myTest.next();
};
function onIceConnectedFailed () {
dumpSdp(myTest);
ok(false, "pc_local: ICE failed to switch to 'connected' state: " + myPc.iceConnectionState);
myTest.next();
};
if (myPc.isIceConnected()) {
ok(true, "pc_local: ICE is in connected state");
myTest.next();
} else if (myPc.isIceConnectionPending()) {
myPc.waitForIceConnected(onIceConnectedSuccess, onIceConnectedFailed);
} else {
dumpSdp(myTest);
ok(false, "pc_local: ICE is already in bad state: " + myPc.iceConnectionState);
myTest.next();
}
}
],
[
'PC_REMOTE_WAIT_FOR_ICE_CONNECTED',
function (test) {
var myTest = test;
var myPc = myTest.pcRemote;
function onIceConnectedSuccess () {
ok(true, "pc_remote: ICE switched to 'connected' state");
myTest.next();
};
function onIceConnectedFailed () {
dumpSdp(myTest);
ok(false, "pc_remote: ICE failed to switch to 'connected' state: " + myPc.iceConnectionState);
myTest.next();
};
if (myPc.isIceConnected()) {
ok(true, "pc_remote: ICE is in connected state");
myTest.next();
} else if (myPc.isIceConnectionPending()) {
myPc.waitForIceConnected(onIceConnectedSuccess, onIceConnectedFailed);
} else {
dumpSdp(myTest);
ok(false, "pc_remote: ICE is already in bad state: " + myPc.iceConnectionState);
myTest.next();
}
}
],
[
'PC_LOCAL_VERIFY_DATA_CHANNEL_STATE',
function (test) {

View File

@ -1208,9 +1208,11 @@ Promise::RunResolveTask(JS::Handle<JS::Value> aValue,
mFeature = new PromiseReportRejectFeature(this);
if (NS_WARN_IF(!worker->AddFeature(worker->GetJSContext(), mFeature))) {
// To avoid a false RemoveFeature().
mFeature = nullptr;
// Worker is shutting down, report rejection immediately since it is
// unlikely that reject callbacks will be added after this point.
MaybeReportRejected();
MaybeReportRejectedOnce();
}
}

View File

@ -13,7 +13,6 @@
#include "nsNetUtil.h"
#include "nsNetCID.h"
#include "nsICacheSession.h"
#include "nsICacheService.h"
#include "nsIOfflineCacheUpdate.h"
#include "nsAutoPtr.h"
#include "nsContentUtils.h"

View File

@ -3,6 +3,7 @@ var Cc = SpecialPowers.Cc;
var Ci = SpecialPowers.Ci;
var Cu = SpecialPowers.Cu;
var LoadContextInfo = Cu.import("resource://gre/modules/LoadContextInfo.jsm", {}).LoadContextInfo;
var CommonUtils = Cu.import("resource://services-common/utils.js", {}).CommonUtils;
const kNetBase = 2152398848; // 0x804B0000
var NS_ERROR_CACHE_KEY_NOT_FOUND = kNetBase + 61;
@ -22,13 +23,14 @@ QueryInterface: function(iid) {
}
return this;
},
onCacheEntryAvailable: function(desc, accessGranted, status) {
onCacheEntryCheck: function() { return Ci.nsICacheEntryOpenCallback.ENTRY_WANTED; },
onCacheEntryAvailable: function(desc, isnew, applicationCache, status) {
if (!desc) {
this.fetch(this.callback);
return;
}
var stream = desc.QueryInterface(Ci.nsICacheEntryDescriptor).openInputStream(0);
var stream = desc.openInputStream(0);
var sstream = Cc["@mozilla.org/scriptableinputstream;1"]
.createInstance(SpecialPowers.Ci.nsIScriptableInputStream);
sstream.init(stream);
@ -49,8 +51,8 @@ fetch: function(callback)
var url = this.urls.shift();
var self = this;
var cacheSession = OfflineTest.getActiveSession();
cacheSession.asyncOpenCacheEntry(url, Ci.nsICache.ACCESS_READ, this);
var cacheStorage = OfflineTest.getActiveStorage();
cacheStorage.asyncOpenURI(CommonUtils.makeURI(url), "", Ci.nsICacheStorage.OPEN_READONLY, this);
}
};
@ -255,7 +257,8 @@ waitForAdd: function(url, onFinished) {
var numChecks = 20;
var waitForAddListener = {
onCacheEntryAvailable: function(entry, access, status) {
onCacheEntryCheck: function() { return Ci.nsICacheEntryOpenCallback.ENTRY_WANTED; },
onCacheEntryAvailable: function(entry, isnew, applicationCache, status) {
if (entry) {
entry.close();
onFinished();
@ -272,10 +275,8 @@ waitForAdd: function(url, onFinished) {
};
var waitFunc = function() {
var cacheSession = OfflineTest.getActiveSession();
cacheSession.asyncOpenCacheEntry(url,
Ci.nsICache.ACCESS_READ,
waitForAddListener);
var cacheStorage = OfflineTest.getActiveStorage();
cacheStorage.asyncOpenURI(CommonUtils.makeURI(url), "", Ci.nsICacheStorage.OPEN_READONLY, waitForAddListener);
}
setTimeout(this.priv(waitFunc), 500);
@ -327,18 +328,16 @@ getActiveCache: function(overload)
return serv.getActiveCache(groupID);
},
getActiveSession: function()
getActiveStorage: function()
{
var cache = this.getActiveCache();
if (!cache) {
return null;
}
var cacheService = Cc["@mozilla.org/network/cache-service;1"]
.getService(Ci.nsICacheService);
return cacheService.createSession(cache.clientID,
Ci.nsICache.STORE_OFFLINE,
true);
var cacheService = Cc["@mozilla.org/netwerk/cache-storage-service;1"]
.getService(Ci.nsICacheStorageService);
return cacheService.appCacheStorage(LoadContextInfo.default, cache);
},
priv: function(func)
@ -365,13 +364,13 @@ checkCacheEntries: function(entries, callback)
checkCache: function(url, expectEntry, callback)
{
var cacheSession = this.getActiveSession();
this._checkCache(cacheSession, url, expectEntry, callback);
var cacheStorage = this.getActiveStorage();
this._checkCache(cacheStorage, url, expectEntry, callback);
},
_checkCache: function(cacheSession, url, expectEntry, callback)
_checkCache: function(cacheStorage, url, expectEntry, callback)
{
if (!cacheSession) {
if (!cacheStorage) {
if (expectEntry) {
this.ok(false, url + " should exist in the offline cache (no session)");
} else {
@ -382,7 +381,8 @@ _checkCache: function(cacheSession, url, expectEntry, callback)
}
var _checkCacheListener = {
onCacheEntryAvailable: function(entry, access, status) {
onCacheEntryCheck: function() { return Ci.nsICacheEntryOpenCallback.ENTRY_WANTED; },
onCacheEntryAvailable: function(entry, isnew, applicationCache, status) {
if (entry) {
if (expectEntry) {
OfflineTest.ok(true, url + " should exist in the offline cache");
@ -412,10 +412,7 @@ _checkCache: function(cacheSession, url, expectEntry, callback)
}
};
cacheSession.asyncOpenCacheEntry(url,
Ci.nsICache.ACCESS_READ,
_checkCacheListener,
false);
cacheStorage.asyncOpenURI(CommonUtils.makeURI(url), "", Ci.nsICacheStorage.OPEN_READONLY, _checkCacheListener);
},
setSJSState: function(sjsPath, stateQuery)

View File

@ -155,7 +155,7 @@
ok(notif.dbId.match(uuidRegEx), "Notification dbId is valid: " + notif.dbId);
is(notif.dir, "ltr", "Notification dir is valid: " + notif.dir);
is(notif.tag, "fakeTag", "Notification tag is valid: " + notif.tag);
ok((notif.timestamp > now), "Notification timestamp is valid: " + notif.timestamp);
ok((notif.timestamp >= now), "Notification timestamp is valid: (" + notif.timestamp + " >= " + now + ")");
notif2.close();
});
}

View File

@ -44,6 +44,7 @@ partial interface HTMLLinkElement {
// http://w3c.github.io/webcomponents/spec/imports/#interface-import
partial interface HTMLLinkElement {
[Pref="dom.webcomponents.enabled"]
readonly attribute Document? import;
};

View File

@ -7,7 +7,7 @@
* http://www.whatwg.org/specs/web-apps/current-work/#channel-messaging
*/
[Constructor, Pref="dom.messageChannel.enabled"]
[Constructor, Func="MessageChannel::Enabled"]
interface MessageChannel {
readonly attribute MessagePort port1;
readonly attribute MessagePort port2;

View File

@ -285,6 +285,8 @@ partial interface Window {
// XXX Shouldn't this be in nsIDOMChromeWindow?
[ChromeOnly, Replaceable, Throws] readonly attribute MozControllers controllers;
[ChromeOnly, Throws] readonly attribute Element? realFrameElement;
[Throws] readonly attribute float mozInnerScreenX;
[Throws] readonly attribute float mozInnerScreenY;
[Throws] readonly attribute float devicePixelRatio;

View File

@ -0,0 +1,20 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1020226
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1020226</title>
</head>
<body>
<script type="application/javascript">
var worker = new Worker("bug1020226_worker.js");
worker.onmessage = function(e) {
window.parent.postMessage("loaded", "*");
}
</script>
</body>
</html>

View File

@ -0,0 +1,11 @@
var p = new Promise(function(resolve, reject) {
// This causes a runnable to be queued.
reject(new Error());
postMessage("loaded");
// This prevents that runnable from running until the window calls terminate(),
// at which point the worker goes into the Canceling state and then an
// AddFeature() is attempted, which fails, which used to result in multiple
// calls to the error reporter, one after the worker's context had been GCed.
while (true);
});

View File

@ -2,6 +2,8 @@
support-files =
WorkerTest_badworker.js
atob_worker.js
bug1020226_worker.js
bug1020226_frame.html
clearTimeouts_worker.js
closeOnGC_server.sjs
closeOnGC_worker.js
@ -78,6 +80,7 @@ support-files =
[test_blobWorkers.html]
[test_bug949946.html]
[test_bug1010784.html]
[test_bug1020226.html]
[test_chromeWorker.html]
[test_clearTimeouts.html]
[test_close.html]

View File

@ -0,0 +1,38 @@
<!DOCTYPE HTML>
<html>
<!--
https://bugzilla.mozilla.org/show_bug.cgi?id=1020226
-->
<head>
<meta charset="utf-8">
<title>Test for Bug 1020226</title>
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
</head>
<body>
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1020226">Mozilla Bug 1020226</a>
<p id="display"></p>
<div id="content" style="display: none">
<iframe id="iframe" src="bug1020226_frame.html" onload="finishTest();">
</iframe>
</div>
<pre id="test">
<script type="application/javascript">
function finishTest() {
document.getElementById("iframe").onload = null;
window.onmessage = function(e) {
info("Got message");
document.getElementById("iframe").src = "about:blank";
// We aren't really interested in the test, it shouldn't crash when the
// worker is GCed later.
ok(true, "Should not crash");
SimpleTest.finish();
};
}
SimpleTest.waitForExplicitFinish();
</script>
</pre>
</body>
</html>

View File

@ -39,6 +39,18 @@ RESOURCE_FILES += [
'res/table-remove-row-active.gif',
'res/table-remove-row-hover.gif',
'res/table-remove-row.gif',
'res/text_caret.png',
'res/text_caret@1.5x.png',
'res/text_caret@2.25x.png',
'res/text_caret@2x.png',
'res/text_caret_tilt_left.png',
'res/text_caret_tilt_left@1.5x.png',
'res/text_caret_tilt_left@2.25x.png',
'res/text_caret_tilt_left@2x.png',
'res/text_caret_tilt_right.png',
'res/text_caret_tilt_right@1.5x.png',
'res/text_caret_tilt_right@2.25x.png',
'res/text_caret_tilt_right@2x.png',
'res/text_selection_handle.png',
'res/text_selection_handle@1.5.png',
'res/text_selection_handle@2.png',

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -176,7 +176,7 @@ CanvasClientSurfaceStream::Update(gfx::IntSize aSize, ClientCanvasLayer* aLayer)
if (mBuffer && CompositorChild::ChildProcessHasCompositor()) {
// remove old buffer from CompositableHost
RefPtr<AsyncTransactionTracker> tracker = new RemoveTextureFromCompositableTracker(this);
RefPtr<AsyncTransactionTracker> tracker = new RemoveTextureFromCompositableTracker();
// Hold TextureClient until transaction complete.
tracker->SetTextureClient(mBuffer);
mBuffer->SetRemoveFromCompositableTracker(tracker);

View File

@ -34,8 +34,7 @@ class PCompositableChild;
*/
class RemoveTextureFromCompositableTracker : public AsyncTransactionTracker {
public:
RemoveTextureFromCompositableTracker(CompositableClient* aCompositableClient)
: mCompositableClient(aCompositableClient)
RemoveTextureFromCompositableTracker()
{
MOZ_COUNT_CTOR(RemoveTextureFromCompositableTracker);
}
@ -50,13 +49,11 @@ public:
// The TextureClient's recycling is postponed until the transaction
// complete.
mTextureClient = nullptr;
mCompositableClient = nullptr;
}
virtual void Cancel() MOZ_OVERRIDE
{
mTextureClient = nullptr;
mCompositableClient = nullptr;
}
virtual void SetTextureClient(TextureClient* aTextureClient) MOZ_OVERRIDE
@ -72,7 +69,6 @@ public:
}
private:
RefPtr<CompositableClient> mCompositableClient;
RefPtr<TextureClient> mTextureClient;
};

View File

@ -368,7 +368,7 @@ ContentClientDoubleBuffered::Updated(const nsIntRegion& aRegionToDraw,
#if defined(MOZ_WIDGET_GONK) && ANDROID_VERSION >= 17
if (mFrontClient && CompositorChild::ChildProcessHasCompositor()) {
// remove old buffer from CompositableHost
RefPtr<AsyncTransactionTracker> tracker = new RemoveTextureFromCompositableTracker(this);
RefPtr<AsyncTransactionTracker> tracker = new RemoveTextureFromCompositableTracker();
// Hold TextureClient until transaction complete.
tracker->SetTextureClient(mFrontClient);
mFrontClient->SetRemoveFromCompositableTracker(tracker);
@ -378,7 +378,7 @@ ContentClientDoubleBuffered::Updated(const nsIntRegion& aRegionToDraw,
if (mFrontClientOnWhite && CompositorChild::ChildProcessHasCompositor()) {
// remove old buffer from CompositableHost
RefPtr<AsyncTransactionTracker> tracker = new RemoveTextureFromCompositableTracker(this);
RefPtr<AsyncTransactionTracker> tracker = new RemoveTextureFromCompositableTracker();
// Hold TextureClient until transaction complete.
tracker->SetTextureClient(mFrontClientOnWhite);
mFrontClientOnWhite->SetRemoveFromCompositableTracker(tracker);

View File

@ -81,17 +81,15 @@ ImageClient::RemoveTextureWithTracker(TextureClient* aTexture,
AsyncTransactionTracker* aAsyncTransactionTracker)
{
#ifdef MOZ_WIDGET_GONK
// AsyncTransactionTracker is supported only on ImageBridge.
// Use AsyncTransactionTracker only when TextureClient is recyeled.
if (aAsyncTransactionTracker ||
(GetForwarder()->IsImageBridgeChild() && aTexture->HasRecycleCallback())) {
GetForwarder()->IsImageBridgeChild()) {
RefPtr<AsyncTransactionTracker> request = aAsyncTransactionTracker;
if (!request) {
// Create AsyncTransactionTracker if it is not provided as argument.
request = new RemoveTextureFromCompositableTracker(this);
request = new RemoveTextureFromCompositableTracker();
}
// Hold TextureClient until the transaction complete to postpone
// the TextureClient recycle.
// the TextureClient recycle/delete.
request->SetTextureClient(aTexture);
GetForwarder()->RemoveTextureFromCompositableAsync(request, this, aTexture);
return;
@ -128,7 +126,7 @@ TextureInfo ImageClientSingle::GetTextureInfo() const
TemporaryRef<AsyncTransactionTracker>
ImageClientSingle::PrepareFlushAllImages()
{
RefPtr<AsyncTransactionTracker> status = new RemoveTextureFromCompositableTracker(this);
RefPtr<AsyncTransactionTracker> status = new RemoveTextureFromCompositableTracker();
return status;
}

View File

@ -114,6 +114,15 @@ CompositorOGL::CreateContext()
}
#endif
// Allow to create offscreen GL context for main Layer Manager
if (!context && PR_GetEnv("MOZ_LAYERS_PREFER_OFFSCREEN")) {
SurfaceCaps caps = SurfaceCaps::ForRGB();
caps.preserve = false;
caps.bpp16 = gfxPlatform::GetPlatform()->GetOffscreenFormat() == gfxImageFormat::RGB16_565;
context = GLContextProvider::CreateOffscreen(gfxIntSize(mSurfaceSize.width,
mSurfaceSize.height), caps);
}
if (!context)
context = gl::GLContextProvider::CreateForWindow(mWidget);
@ -571,9 +580,15 @@ CompositorOGL::PrepareViewport(const gfx::IntSize& aSize,
// Matrix to transform (0, 0, aWidth, aHeight) to viewport space (-1.0, 1.0,
// 2, 2) and flip the contents.
Matrix viewMatrix;
viewMatrix.Translate(-1.0, 1.0);
viewMatrix.Scale(2.0f / float(aSize.width), 2.0f / float(aSize.height));
viewMatrix.Scale(1.0f, -1.0f);
if (mGLContext->IsOffscreen()) {
// In case of rendering via GL Offscreen context, disable Y-Flipping
viewMatrix.Translate(-1.0, -1.0);
viewMatrix.Scale(2.0f / float(aSize.width), 2.0f / float(aSize.height));
} else {
viewMatrix.Translate(-1.0, 1.0);
viewMatrix.Scale(2.0f / float(aSize.width), 2.0f / float(aSize.height));
viewMatrix.Scale(1.0f, -1.0f);
}
viewMatrix = aWorldTransform * viewMatrix;

View File

@ -525,52 +525,6 @@ gfxASurface::BytePerPixelFromFormat(gfxImageFormat format)
return 0;
}
void
gfxASurface::FastMovePixels(const nsIntRect& aSourceRect,
const nsIntPoint& aDestTopLeft)
{
// Used when the backend can internally handle self copies.
nsIntRect dest(aDestTopLeft, aSourceRect.Size());
nsRefPtr<gfxContext> ctx = new gfxContext(this);
ctx->SetOperator(gfxContext::OPERATOR_SOURCE);
nsIntPoint srcOrigin = dest.TopLeft() - aSourceRect.TopLeft();
ctx->SetSource(this, gfxPoint(srcOrigin.x, srcOrigin.y));
ctx->Rectangle(gfxRect(dest.x, dest.y, dest.width, dest.height));
ctx->Fill();
}
void
gfxASurface::MovePixels(const nsIntRect& aSourceRect,
const nsIntPoint& aDestTopLeft)
{
// Assume the backend can't handle self copying well and allocate
// a temporary surface instead.
nsRefPtr<gfxASurface> tmp =
CreateSimilarSurface(GetContentType(),
nsIntSize(aSourceRect.width, aSourceRect.height));
// CreateSimilarSurface can return nullptr if the current surface is
// in an error state. This isn't good, but its better to carry
// on with the error surface instead of crashing.
NS_WARN_IF_FALSE(tmp, "Must have temporary surface to move pixels!");
if (!tmp) {
return;
}
nsRefPtr<gfxContext> ctx = new gfxContext(tmp);
ctx->SetOperator(gfxContext::OPERATOR_SOURCE);
ctx->SetSource(this, gfxPoint(-aSourceRect.x, -aSourceRect.y));
ctx->Paint();
ctx = new gfxContext(this);
ctx->SetOperator(gfxContext::OPERATOR_SOURCE);
ctx->SetSource(tmp, gfxPoint(aDestTopLeft.x, aDestTopLeft.y));
ctx->Rectangle(gfxRect(aDestTopLeft.x,
aDestTopLeft.y,
aSourceRect.width,
aSourceRect.height));
ctx->Fill();
}
/** Memory reporting **/
static const char *sDefaultSurfaceDescription =

View File

@ -209,19 +209,6 @@ public:
return GetEmptyOpaqueRect();
}
/**
* Move the pixels in |aSourceRect| to |aDestTopLeft|. Like with
* memmove(), |aSourceRect| and the rectangle defined by
* |aDestTopLeft| are allowed to overlap, and the effect is
* equivalent to copying |aSourceRect| to a scratch surface and
* then back to |aDestTopLeft|.
*
* |aSourceRect| and the destination rectangle defined by
* |aDestTopLeft| are clipped to this surface's bounds.
*/
virtual void MovePixels(const nsIntRect& aSourceRect,
const nsIntPoint& aDestTopLeft);
/**
* Mark the surface as being allowed/not allowed to be used as a source.
*/
@ -236,14 +223,6 @@ protected:
static gfxASurface* GetSurfaceWrapper(cairo_surface_t *csurf);
static void SetSurfaceWrapper(cairo_surface_t *csurf, gfxASurface *asurf);
/**
* An implementation of MovePixels that assumes the backend can
* internally handle this operation and doesn't allocate any
* temporary surfaces.
*/
void FastMovePixels(const nsIntRect& aSourceRect,
const nsIntPoint& aDestTopLeft);
// NB: Init() *must* be called from within subclass's
// constructors. It's unsafe to call it after the ctor finishes;
// leaks and use-after-frees are possible.

View File

@ -29,12 +29,6 @@ public:
gfxD2DSurface(cairo_surface_t *csurf);
void MovePixels(const nsIntRect& aSourceRect,
const nsIntPoint& aDestTopLeft)
{
FastMovePixels(aSourceRect, aDestTopLeft);
}
virtual ~gfxD2DSurface();
void Present();

View File

@ -6,31 +6,17 @@
#include "mozilla/ArrayUtils.h"
#include "mozilla/MemoryReporting.h"
#if (MOZ_WIDGET_GTK == 2)
#include "gfxPlatformGtk.h"
#define gfxToolkitPlatform gfxPlatformGtk
#elif defined(MOZ_WIDGET_QT)
#include <qfontinfo.h>
#include "gfxQtPlatform.h"
#define gfxToolkitPlatform gfxQtPlatform
#elif defined(XP_WIN)
#include "gfxWindowsPlatform.h"
#define gfxToolkitPlatform gfxWindowsPlatform
#elif defined(ANDROID)
#include "mozilla/dom/ContentChild.h"
#include "gfxAndroidPlatform.h"
#include "mozilla/Omnijar.h"
#include "nsIInputStream.h"
#include "nsNetUtil.h"
#define gfxToolkitPlatform gfxAndroidPlatform
#endif
#ifdef ANDROID
#include "nsXULAppAPI.h"
#include <dirent.h>
#include <android/log.h>
#define ALOG(args...) __android_log_print(ANDROID_LOG_INFO, "Gecko" , ## args)
#endif
#include "ft2build.h"
#include FT_FREETYPE_H
@ -58,11 +44,6 @@
#include "mozilla/scache/StartupCache.h"
#include <sys/stat.h>
#ifdef XP_WIN
#include "nsIWindowsRegKey.h"
#include <windows.h>
#endif
using namespace mozilla;
#ifdef PR_LOGGING
@ -85,10 +66,6 @@ static cairo_user_data_key_t sFTUserFontDataKey;
static __inline void
BuildKeyNameFromFontName(nsAString &aName)
{
#ifdef XP_WIN
if (aName.Length() >= LF_FACESIZE)
aName.Truncate(LF_FACESIZE - 1);
#endif
ToLowerCase(aName);
}
@ -963,11 +940,7 @@ gfxFT2FontList::AppendFacesFromFontFile(const nsCString& aFileName,
return;
}
#ifdef XP_WIN
FT_Library ftLibrary = gfxWindowsPlatform::GetPlatform()->GetFTLibrary();
#elif defined(ANDROID)
FT_Library ftLibrary = gfxAndroidPlatform::GetPlatform()->GetFTLibrary();
#endif
FT_Face dummy;
if (FT_Err_Ok == FT_New_Face(ftLibrary, aFileName.get(), -1, &dummy)) {
LOG(("reading font info via FreeType for %s", aFileName.get()));
@ -1170,50 +1143,6 @@ FinalizeFamilyMemberList(nsStringHashKey::KeyType aKey,
void
gfxFT2FontList::FindFonts()
{
#ifdef XP_WIN
nsTArray<nsString> searchPaths(3);
nsTArray<nsString> fontPatterns(3);
fontPatterns.AppendElement(NS_LITERAL_STRING("\\*.ttf"));
fontPatterns.AppendElement(NS_LITERAL_STRING("\\*.ttc"));
fontPatterns.AppendElement(NS_LITERAL_STRING("\\*.otf"));
wchar_t pathBuf[256];
SHGetSpecialFolderPathW(0, pathBuf, CSIDL_WINDOWS, 0);
searchPaths.AppendElement(pathBuf);
SHGetSpecialFolderPathW(0, pathBuf, CSIDL_FONTS, 0);
searchPaths.AppendElement(pathBuf);
nsCOMPtr<nsIFile> resDir;
NS_GetSpecialDirectory(NS_APP_RES_DIR, getter_AddRefs(resDir));
if (resDir) {
resDir->Append(NS_LITERAL_STRING("fonts"));
nsAutoString resPath;
resDir->GetPath(resPath);
searchPaths.AppendElement(resPath);
}
WIN32_FIND_DATAW results;
for (uint32_t i = 0; i < searchPaths.Length(); i++) {
const nsString& path(searchPaths[i]);
for (uint32_t j = 0; j < fontPatterns.Length(); j++) {
nsAutoString pattern(path);
pattern.Append(fontPatterns[j]);
HANDLE handle = FindFirstFileExW(pattern.get(),
FindExInfoStandard,
&results,
FindExSearchNameMatch,
nullptr,
0);
bool moreFiles = handle != INVALID_HANDLE_VALUE;
while (moreFiles) {
nsAutoString filePath(path);
filePath.Append('\\');
filePath.Append(results.cFileName);
AppendFacesFromFontFile(NS_ConvertUTF16toUTF8(filePath));
moreFiles = FindNextFile(handle, &results);
}
if (handle != INVALID_HANDLE_VALUE)
FindClose(handle);
}
}
#elif defined(ANDROID)
gfxFontCache *fc = gfxFontCache::GetCache();
if (fc)
fc->AgeAllGenerations();
@ -1259,7 +1188,6 @@ gfxFT2FontList::FindFonts()
// if we can't find/read the font directory, we are doomed!
NS_RUNTIMEABORT("Could not read the system fonts directory");
}
#endif // XP_WIN && ANDROID
// Look for fonts stored in omnijar, unless we're on a low-memory
// device where we don't want to spend the RAM to decompress them.
@ -1291,7 +1219,6 @@ gfxFT2FontList::FindFonts()
mFontFamilies.Enumerate(FinalizeFamilyMemberList, this);
}
#ifdef ANDROID
void
gfxFT2FontList::FindFontsInDir(const nsCString& aDir, FontNameCache *aFNC)
{
@ -1348,7 +1275,6 @@ gfxFT2FontList::FindFontsInDir(const nsCString& aDir, FontNameCache *aFNC)
closedir(d);
}
#endif
void
gfxFT2FontList::AppendFaceFromFontListEntry(const FontListEntry& aFLE,
@ -1506,16 +1432,7 @@ gfxFT2FontList::LookupLocalFont(const gfxProxyFontEntry *aProxyEntry,
gfxFontFamily*
gfxFT2FontList::GetDefaultFont(const gfxFontStyle* aStyle)
{
#ifdef XP_WIN
HGDIOBJ hGDI = ::GetStockObject(SYSTEM_FONT);
LOGFONTW logFont;
if (hGDI && ::GetObjectW(hGDI, sizeof(logFont), &logFont)) {
nsAutoString resolvedName;
if (ResolveFontName(nsDependentString(logFont.lfFaceName), resolvedName)) {
return FindFamily(resolvedName);
}
}
#elif defined(MOZ_WIDGET_GONK)
#ifdef MOZ_WIDGET_GONK
nsAutoString resolvedName;
if (ResolveFontName(NS_LITERAL_STRING("Fira Sans OT"), resolvedName)) {
return FindFamily(resolvedName);

View File

@ -7,11 +7,6 @@
#define GFX_FT2FONTLIST_H
#include "mozilla/MemoryReporting.h"
#ifdef XP_WIN
#include "gfxWindowsPlatform.h"
#include <windows.h>
#endif
#include "gfxPlatformFontList.h"
namespace mozilla {
@ -153,9 +148,7 @@ protected:
void FindFontsInOmnijar(FontNameCache *aCache);
#ifdef ANDROID
void FindFontsInDir(const nsCString& aDir, FontNameCache* aFNC);
#endif
nsTHashtable<nsStringHashKey> mSkipSpaceLookupCheckFamilies;
};

View File

@ -371,70 +371,3 @@ gfxImageSurface::GetAsImageSurface()
nsRefPtr<gfxImageSurface> surface = this;
return surface.forget();
}
void
gfxImageSurface::MovePixels(const nsIntRect& aSourceRect,
const nsIntPoint& aDestTopLeft)
{
const nsIntRect bounds(0, 0, mSize.width, mSize.height);
nsIntPoint offset = aDestTopLeft - aSourceRect.TopLeft();
nsIntRect clippedSource = aSourceRect;
clippedSource.IntersectRect(clippedSource, bounds);
nsIntRect clippedDest = clippedSource + offset;
clippedDest.IntersectRect(clippedDest, bounds);
const nsIntRect dest = clippedDest;
const nsIntRect source = dest - offset;
// NB: this relies on IntersectRect() and operator+/- preserving
// x/y for empty rectangles
NS_ABORT_IF_FALSE(bounds.Contains(dest) && bounds.Contains(source) &&
aSourceRect.Contains(source) &&
nsIntRect(aDestTopLeft, aSourceRect.Size()).Contains(dest) &&
source.Size() == dest.Size() &&
offset == (dest.TopLeft() - source.TopLeft()),
"Messed up clipping, crash or corruption will follow");
if (source.IsEmpty() || source.IsEqualInterior(dest)) {
return;
}
long naturalStride = ComputeStride(mSize, mFormat);
if (mStride == naturalStride && dest.width == bounds.width) {
// Fast path: this is a vertical shift of some rows in a
// "normal" image surface. We can directly memmove and
// hopefully stay in SIMD land.
unsigned char* dst = mData + dest.y * mStride;
const unsigned char* src = mData + source.y * mStride;
size_t nBytes = dest.height * mStride;
memmove(dst, src, nBytes);
return;
}
// Slow(er) path: have to move row-by-row.
const int32_t bpp = BytePerPixelFromFormat(mFormat);
const size_t nRowBytes = dest.width * bpp;
// dstRow points at the first pixel within the current destination
// row, and similarly for srcRow. endSrcRow is one row beyond the
// last row we need to copy. stride is either +mStride or
// -mStride, depending on which direction we're copying.
unsigned char* dstRow;
unsigned char* srcRow;
unsigned char* endSrcRow; // NB: this may point outside the image
long stride;
if (dest.y > source.y) {
// We're copying down from source to dest, so walk backwards
// starting from the last rows to avoid stomping pixels we
// need.
stride = -mStride;
dstRow = mData + dest.x * bpp + (dest.YMost() - 1) * mStride;
srcRow = mData + source.x * bpp + (source.YMost() - 1) * mStride;
endSrcRow = mData + source.x * bpp + (source.y - 1) * mStride;
} else {
stride = mStride;
dstRow = mData + dest.x * bpp + dest.y * mStride;
srcRow = mData + source.x * bpp + source.y * mStride;
endSrcRow = mData + source.x * bpp + source.YMost() * mStride;
}
for (; srcRow != endSrcRow; dstRow += stride, srcRow += stride) {
memmove(dstRow, srcRow, nRowBytes);
}
}

View File

@ -124,9 +124,6 @@ public:
virtual already_AddRefed<gfxImageSurface> GetAsImageSurface();
/** See gfxASurface.h. */
virtual void MovePixels(const nsIntRect& aSourceRect,
const nsIntPoint& aDestTopLeft) MOZ_OVERRIDE;
static long ComputeStride(const gfxIntSize&, gfxImageFormat);
virtual size_t SizeOfExcludingThis(mozilla::MallocSizeOf aMallocSizeOf) const

View File

@ -536,16 +536,6 @@ gfxPlatform::PreferMemoryOverShmem() const {
return mLayersPreferMemoryOverShmem;
}
already_AddRefed<gfxASurface>
gfxPlatform::CreateOffscreenImageSurface(const gfxIntSize& aSize,
gfxContentType aContentType)
{
nsRefPtr<gfxASurface> newSurface;
newSurface = new gfxImageSurface(aSize, OptimalFormatForContent(aContentType));
return newSurface.forget();
}
already_AddRefed<gfxASurface>
gfxPlatform::OptimizeImage(gfxImageSurface *aSurface,
gfxImageFormat format)
@ -1251,11 +1241,13 @@ bool gfxPlatform::ForEachPrefFont(eFontPrefLang aLangArray[], uint32_t aLangArra
eFontPrefLang
gfxPlatform::GetFontPrefLangFor(const char* aLang)
{
if (!aLang || !aLang[0])
if (!aLang || !aLang[0]) {
return eFontPrefLang_Others;
for (uint32_t i = 0; i < uint32_t(eFontPrefLang_LangCount); ++i) {
if (!PL_strcasecmp(gPrefLangNames[i], aLang))
}
for (uint32_t i = 0; i < ArrayLength(gPrefLangNames); ++i) {
if (!PL_strcasecmp(gPrefLangNames[i], aLang)) {
return eFontPrefLang(i);
}
}
return eFontPrefLang_Others;
}
@ -1273,8 +1265,9 @@ gfxPlatform::GetFontPrefLangFor(nsIAtom *aLang)
const char*
gfxPlatform::GetPrefLangName(eFontPrefLang aLang)
{
if (uint32_t(aLang) < uint32_t(eFontPrefLang_AllCount))
if (uint32_t(aLang) < ArrayLength(gPrefLangNames)) {
return gPrefLangNames[uint32_t(aLang)];
}
return nullptr;
}

View File

@ -95,12 +95,9 @@ enum eFontPrefLang {
eFontPrefLang_Sinhala = 28,
eFontPrefLang_Tibetan = 29,
eFontPrefLang_LangCount = 30, // except Others.
eFontPrefLang_Others = 30, // x-unicode
eFontPrefLang_CJKSet = 31, // special code for CJK set
eFontPrefLang_AllCount = 32
eFontPrefLang_CJKSet = 31 // special code for CJK set
};
enum eCMSMode {
@ -180,18 +177,6 @@ public:
CreateOffscreenSurface(const IntSize& size,
gfxContentType contentType) = 0;
/**
* Create an offscreen surface of the given dimensions and image format which
* can be converted to a gfxImageSurface without copying. If we can provide
* a platform-hosted surface, then we will return that instead of an actual
* gfxImageSurface.
* Sub-classes should override this method if CreateOffscreenSurface returns a
* surface which implements GetAsImageSurface
*/
virtual already_AddRefed<gfxASurface>
CreateOffscreenImageSurface(const gfxIntSize& aSize,
gfxContentType aContentType);
virtual already_AddRefed<gfxASurface> OptimizeImage(gfxImageSurface *aSurface,
gfxImageFormat format);

View File

@ -105,20 +105,6 @@ gfxPlatformMac::CreateOffscreenSurface(const IntSize& size,
return newSurface.forget();
}
already_AddRefed<gfxASurface>
gfxPlatformMac::CreateOffscreenImageSurface(const gfxIntSize& aSize,
gfxContentType aContentType)
{
nsRefPtr<gfxASurface> surface =
CreateOffscreenSurface(aSize.ToIntSize(), aContentType);
#ifdef DEBUG
nsRefPtr<gfxImageSurface> imageSurface = surface->GetAsImageSurface();
NS_ASSERTION(imageSurface, "Surface cannot be converted to a gfxImageSurface");
#endif
return surface.forget();
}
already_AddRefed<gfxASurface>
gfxPlatformMac::OptimizeImage(gfxImageSurface *aSurface,
gfxImageFormat format)

View File

@ -29,10 +29,6 @@ public:
CreateOffscreenSurface(const IntSize& size,
gfxContentType contentType) MOZ_OVERRIDE;
virtual already_AddRefed<gfxASurface>
CreateOffscreenImageSurface(const gfxIntSize& aSize,
gfxContentType aContentType);
already_AddRefed<gfxASurface> OptimizeImage(gfxImageSurface *aSurface,
gfxImageFormat format);

View File

@ -39,12 +39,6 @@ public:
already_AddRefed<gfxImageSurface> GetAsImageSurface();
void MovePixels(const nsIntRect& aSourceRect,
const nsIntPoint& aDestTopLeft)
{
FastMovePixels(aSourceRect, aDestTopLeft);
}
protected:
void MakeInvalid();

View File

@ -12,7 +12,6 @@
#include "gfxPlatform.h"
#include "nsUnicharUtils.h"
#include "nsNetUtil.h"
#include "nsICacheService.h"
#include "nsIProtocolHandler.h"
#include "nsIPrincipal.h"
#include "gfxFontConstants.h"
@ -863,7 +862,7 @@ gfxUserFontSet::UserFontCache::Flusher::Observe(nsISupports* aSubject,
return NS_OK;
}
if (!strcmp(aTopic, NS_CACHESERVICE_EMPTYCACHE_TOPIC_ID)) {
if (!strcmp(aTopic, "cacheservice:empty-cache")) {
sUserFonts->Clear();
} else if (!strcmp(aTopic, "last-pb-context-exited")) {
sUserFonts->EnumerateEntries(Entry::RemoveIfPrivate, nullptr);
@ -917,7 +916,7 @@ gfxUserFontSet::UserFontCache::CacheFont(gfxFontEntry *aFontEntry)
mozilla::services::GetObserverService();
if (obs) {
Flusher *flusher = new Flusher;
obs->AddObserver(flusher, NS_CACHESERVICE_EMPTYCACHE_TOPIC_ID,
obs->AddObserver(flusher, "cacheservice:empty-cache",
false);
obs->AddObserver(flusher, "last-pb-context-exited", false);
obs->AddObserver(flusher, "xpcom-shutdown", false);

View File

@ -617,27 +617,6 @@ gfxWindowsPlatform::CreateOffscreenSurface(const IntSize& size,
return surf.forget();
}
already_AddRefed<gfxASurface>
gfxWindowsPlatform::CreateOffscreenImageSurface(const gfxIntSize& aSize,
gfxContentType aContentType)
{
#ifdef CAIRO_HAS_D2D_SURFACE
if (mRenderMode == RENDER_DIRECT2D) {
nsRefPtr<gfxASurface> surface =
new gfxImageSurface(aSize, OptimalFormatForContent(aContentType));
return surface.forget();
}
#endif
nsRefPtr<gfxASurface> surface = CreateOffscreenSurface(aSize.ToIntSize(),
aContentType);
#ifdef DEBUG
nsRefPtr<gfxImageSurface> imageSurface = surface->GetAsImageSurface();
NS_ASSERTION(imageSurface, "Surface cannot be converted to a gfxImageSurface");
#endif
return surface.forget();
}
TemporaryRef<ScaledFont>
gfxWindowsPlatform::GetScaledFontForFont(DrawTarget* aTarget, gfxFont *aFont)
{

View File

@ -128,9 +128,6 @@ public:
virtual already_AddRefed<gfxASurface>
CreateOffscreenSurface(const IntSize& size,
gfxContentType contentType) MOZ_OVERRIDE;
virtual already_AddRefed<gfxASurface>
CreateOffscreenImageSurface(const gfxIntSize& aSize,
gfxContentType aContentType);
virtual mozilla::TemporaryRef<mozilla::gfx::ScaledFont>
GetScaledFontForFont(mozilla::gfx::DrawTarget* aTarget, gfxFont *aFont);

View File

@ -67,12 +67,6 @@ public:
const gfxIntSize GetSize() const;
void MovePixels(const nsIntRect& aSourceRect,
const nsIntPoint& aDestTopLeft)
{
FastMovePixels(aSourceRect, aDestTopLeft);
}
// The memory used by this surface lives in this process's address space,
// but not in the heap.
virtual gfxMemoryLocation GetMemoryLocation() const;

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