Merge mozilla-central to b2g-inbound

This commit is contained in:
Carsten "Tomcat" Book 2014-02-20 13:01:38 +01:00
Родитель e6f5ee30d3 f3825c1c94
Коммит 8fa6ac3545
261 изменённых файлов: 8395 добавлений и 2342 удалений

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

@ -22,4 +22,6 @@
# changes to stick? As of bug 928195, this shouldn't be necessary! Please
# don't change CLOBBER for WebIDL changes any more.
Skia update from Bug 910754 needs a CLOBBER build
CLOBBER to test mozfile changes which previously broke mozbuild's ability to clobber (bug 949600).
Safe to ignore - last clobber was 'Skia update from Bug 910754 needs a CLOBBER build' at Feb 18 15:19:59 2014 PST

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

@ -13,6 +13,10 @@ var AlertsHelper = {
}
this._listener = aListener;
if (Services.metro.foreground) {
// Firefox is in the foreground, no need for a notification.
return;
}
Services.metro.showNativeToast(aTitle, aText, aImageURL, aCookie);
},

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

@ -783,7 +783,6 @@ toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-icon {
.urlbar-input-box {
-moz-margin-start: 0;
min-width: 4em;
}
.urlbar-history-dropmarker {

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

@ -1730,7 +1730,6 @@ toolbarbutton[sdk-button="true"][cui-areatype="toolbar"] > .toolbarbutton-icon {
.urlbar-input-box {
-moz-margin-start: 0;
padding: 3px 0 2px;
min-width: 4em;
}
.urlbar-history-dropmarker {

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

@ -973,7 +973,6 @@ html|*.urlbar-input:-moz-lwtheme::-moz-placeholder,
.urlbar-input-box {
-moz-margin-start: 0;
min-width: 4em;
}
#urlbar-icons {

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

@ -55,6 +55,7 @@ SEARCH_PATHS = [
'testing/mozbase/mozsystemmonitor',
'testing/mozbase/mozinfo',
'testing/mozbase/moztest',
'testing/mozbase/mozversion',
'testing/mozbase/manifestdestiny',
'xpcom/idl-parser',
]

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

@ -234,7 +234,7 @@ nsDOMMultipartFile::ParseBlobArrayArgument(JSContext* aCx, JS::Value& aValue,
BlobSet blobSet;
uint32_t length;
JS_ALWAYS_TRUE(JS_GetArrayLength(aCx, obj, &length));
MOZ_ALWAYS_TRUE(JS_GetArrayLength(aCx, obj, &length));
for (uint32_t i = 0; i < length; ++i) {
JS::Rooted<JS::Value> element(aCx);
if (!JS_GetElement(aCx, obj, i, &element))

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

@ -17,6 +17,8 @@ addLoadEvent(function() {
var sp = context.createScriptProcessor();
osc.connect(sp);
// Work around bug 916387.
sp.connect(context.destination);
sp.onaudioprocess = function (e) {
var input = e.inputBuffer.getChannelData(0);
@ -27,27 +29,11 @@ addLoadEvent(function() {
}
}
sp.onaudioprocess = null;
dump("audioprocess received\n");
ok(isSilent, "OscillatorNode should be silent before calling start.");
SimpleTest.finish();
}
// Debug Logging for bug 966322
dump("Load event ran\n");
var bs = context.createBufferSource();
bs.buffer = context.createBuffer(1, 1, context.sampleRate);
bs.start();
bs.onended = function() {
dump("Graph is running\n");
}
});
// Debug Logging for bug 966322
dump("script ran\n");
</script>
</pre>
</body>

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

@ -60,6 +60,15 @@ nsSVGPolyElement::IsAttributeMapped(const nsIAtom* name) const
nsSVGPolyElementBase::IsAttributeMapped(name);
}
//----------------------------------------------------------------------
// nsSVGElement methods
/* virtual */ bool
nsSVGPolyElement::HasValidDimensions() const
{
return !mPoints.GetAnimValue().IsEmpty();
}
//----------------------------------------------------------------------
// nsSVGPathGeometryElement methods

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

@ -38,6 +38,9 @@ public:
return nsGkAtoms::points;
}
// nsSVGElement methods:
virtual bool HasValidDimensions() const MOZ_OVERRIDE;
// nsSVGPathGeometryElement methods:
virtual bool AttributeDefinesGeometry(const nsIAtom *aName) MOZ_OVERRIDE;
virtual bool IsMarkable() MOZ_OVERRIDE { return true; }

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

@ -21,7 +21,11 @@
<g id="e">
<!-- empty container should not affect parent's bbox -->
<g/>
<!-- nor should an empty text element -->
<!-- neither should a path, -->
<path/>
<!-- a polygon -->
<polygon/>
<!-- or an empty text element -->
<text x="185" y="25"/>
<circle cx="100" cy="100" r="5"/>
<g/>

До

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

После

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

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

@ -0,0 +1,20 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<script>
function boom()
{
var frame = document.createElement("iframe");
document.body.appendChild(frame);
var frameLoc = frame.contentWindow.location;
document.body.removeChild(frame)
frameLoc.origin;
document.documentElement.removeAttribute('class');
}
</script>
</head>
<body onload="boom();"></body>
</html>

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

@ -42,3 +42,4 @@ load 745495.html
load 886213.html
load 898906.html
load 852381.html
load 973401.html

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

@ -546,6 +546,7 @@ nsLocation::GetOrigin(nsAString& aOrigin)
nsCOMPtr<nsIURI> uri;
nsresult rv = GetURI(getter_AddRefs(uri), true);
NS_ENSURE_SUCCESS(rv, rv);
NS_ENSURE_TRUE(uri, NS_OK);
nsAutoString origin;
rv = nsContentUtils::GetUTFOrigin(uri, origin);

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

@ -214,7 +214,7 @@ MmsMessage::Create(int32_t aId,
}
uint32_t length;
JS_ALWAYS_TRUE(JS_GetArrayLength(aCx, deliveryInfoObj, &length));
MOZ_ALWAYS_TRUE(JS_GetArrayLength(aCx, deliveryInfoObj, &length));
nsTArray<MmsDeliveryInfo> deliveryInfo;
JS::Rooted<JS::Value> infoJsVal(aCx);
@ -240,7 +240,7 @@ MmsMessage::Create(int32_t aId,
return NS_ERROR_INVALID_ARG;
}
JS_ALWAYS_TRUE(JS_GetArrayLength(aCx, receiversObj, &length));
MOZ_ALWAYS_TRUE(JS_GetArrayLength(aCx, receiversObj, &length));
nsTArray<nsString> receivers;
JS::Rooted<JS::Value> receiverJsVal(aCx);
@ -275,7 +275,7 @@ MmsMessage::Create(int32_t aId,
}
nsTArray<MmsAttachment> attachments;
JS_ALWAYS_TRUE(JS_GetArrayLength(aCx, attachmentsObj, &length));
MOZ_ALWAYS_TRUE(JS_GetArrayLength(aCx, attachmentsObj, &length));
JS::Rooted<JS::Value> attachmentJsVal(aCx);
for (uint32_t i = 0; i < length; ++i) {

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

@ -350,7 +350,7 @@ MobileMessageManager::Delete(JS::Handle<JS::Value> aParam, JSContext* aCx,
// Int32[], SmsMessage[], or MmsMessage[]
JS::Rooted<JSObject*> ids(aCx, &aParam.toObject());
JS_ALWAYS_TRUE(JS_GetArrayLength(aCx, ids, &size));
MOZ_ALWAYS_TRUE(JS_GetArrayLength(aCx, ids, &size));
nsAutoArrayPtr<int32_t> idAutoArray(new int32_t[size]);
JS::Rooted<JS::Value> idJsValue(aCx);

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

@ -11,7 +11,6 @@
#include "nsTArrayHelpers.h" // For nsTArrayToJSArray
#include "mozilla/dom/mobilemessage/Constants.h" // For MessageType
using namespace mozilla::dom::mobilemessage;
DOMCI_DATA(MozMobileMessageThread, mozilla::dom::MobileMessageThread)
@ -61,7 +60,7 @@ MobileMessageThread::Create(const uint64_t aId,
}
uint32_t length;
JS_ALWAYS_TRUE(JS_GetArrayLength(aCx, obj, &length));
MOZ_ALWAYS_TRUE(JS_GetArrayLength(aCx, obj, &length));
NS_ENSURE_TRUE(length, NS_ERROR_INVALID_ARG);
for (uint32_t i = 0; i < length; ++i) {

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

@ -172,7 +172,7 @@ SmsFilter::SetNumbers(JSContext* aCx, JS::Handle<JS::Value> aNumbers)
}
uint32_t size;
JS_ALWAYS_TRUE(JS_GetArrayLength(aCx, obj, &size));
MOZ_ALWAYS_TRUE(JS_GetArrayLength(aCx, obj, &size));
nsTArray<nsString> numbers;

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

@ -1589,7 +1589,7 @@ NPObjWrapper_NewResolve(JSContext *cx, JS::Handle<JSObject*> obj, JS::Handle<jsi
static bool
NPObjWrapper_Convert(JSContext *cx, JS::Handle<JSObject*> obj, JSType hint, JS::MutableHandle<JS::Value> vp)
{
JS_ASSERT(hint == JSTYPE_NUMBER || hint == JSTYPE_STRING || hint == JSTYPE_VOID);
MOZ_ASSERT(hint == JSTYPE_NUMBER || hint == JSTYPE_STRING || hint == JSTYPE_VOID);
// Plugins do not simply use JS_ConvertStub, and the default [[DefaultValue]]
// behavior, because that behavior involves calling toString or valueOf on

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

@ -70,7 +70,8 @@ namespace mozilla {
namespace plugins {
namespace parent {
JS_STATIC_ASSERT(sizeof(NPIdentifier) == sizeof(jsid));
static_assert(sizeof(NPIdentifier) == sizeof(jsid),
"NPIdentifier must be binary compatible with jsid.");
inline jsid
NPIdentifierToJSId(NPIdentifier id)

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

@ -482,8 +482,7 @@ Promise::Constructor(const GlobalObject& aGlobal,
return nullptr;
}
aInit.Call(promise, resolveFunc, rejectFunc, aRv,
CallbackObject::eRethrowExceptions);
aInit.Call(resolveFunc, rejectFunc, aRv, CallbackObject::eRethrowExceptions);
aRv.WouldReportJSException();
if (aRv.IsJSException()) {

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

@ -573,6 +573,14 @@ function promiseStrictHandlers() {
});
}
function promiseStrictExecutorThisArg() {
var promise = new Promise(function(resolve, reject) {
"use strict";
ok(this === undefined, "thisArg should be undefined.");
runTest();
});
}
function promiseResolveArray() {
var p = Promise.resolve([1,2,3]);
ok(p instanceof Promise, "Should return a Promise.");
@ -636,6 +644,7 @@ var tests = [ promiseResolve, promiseReject,
promiseThenableRejectThenResolve,
promiseWithThenReplaced,
promiseStrictHandlers,
promiseStrictExecutorThisArg,
promiseResolveArray,
promiseResolveThenable,
promiseResolvePromise,

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

@ -46,7 +46,7 @@ public:
static JSObject*
Create(JSContext* aCx, nsIDOMBlob* aBlob)
{
JS_ASSERT(SameCOMIdentity(static_cast<nsISupports*>(aBlob), aBlob));
MOZ_ASSERT(SameCOMIdentity(static_cast<nsISupports*>(aBlob), aBlob));
JSObject* obj = JS_NewObject(aCx, &sClass, JS::NullPtr(), JS::NullPtr());
if (obj) {
@ -101,7 +101,7 @@ private:
static void
Finalize(JSFreeOp* aFop, JSObject* aObj)
{
JS_ASSERT(JS_GetClass(aObj) == &sClass);
MOZ_ASSERT(JS_GetClass(aObj) == &sClass);
nsIDOMBlob* blob = GetPrivate(aObj);
NS_IF_RELEASE(blob);
@ -248,7 +248,7 @@ public:
static JSObject*
Create(JSContext* aCx, nsIDOMFile* aFile)
{
JS_ASSERT(SameCOMIdentity(static_cast<nsISupports*>(aFile), aFile));
MOZ_ASSERT(SameCOMIdentity(static_cast<nsISupports*>(aFile), aFile));
JSObject* obj = JS_NewObject(aCx, &sClass, JS::NullPtr(), JS::NullPtr());
if (obj) {
@ -266,7 +266,7 @@ public:
if (classPtr == &sClass) {
nsISupports* priv = static_cast<nsISupports*>(JS_GetPrivate(aObj));
nsCOMPtr<nsIDOMFile> file = do_QueryInterface(priv);
JS_ASSERT_IF(priv, file);
MOZ_ASSERT_IF(priv, file);
return file;
}
}
@ -306,7 +306,7 @@ private:
static void
Finalize(JSFreeOp* aFop, JSObject* aObj)
{
JS_ASSERT(JS_GetClass(aObj) == &sClass);
MOZ_ASSERT(JS_GetClass(aObj) == &sClass);
nsIDOMFile* file = GetPrivate(aObj);
NS_IF_RELEASE(file);
@ -450,7 +450,7 @@ Blob::GetPrivate(JSObject* aObj)
if (classPtr == &sClass || classPtr == File::Class()) {
nsISupports* priv = static_cast<nsISupports*>(JS_GetPrivate(aObj));
nsCOMPtr<nsIDOMBlob> blob = do_QueryInterface(priv);
JS_ASSERT_IF(priv, blob);
MOZ_ASSERT_IF(priv, blob);
return blob;
}
}

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

@ -302,11 +302,11 @@ struct WorkerStructuredCloneCallbacks
{
// See if object is a nsIDOMFile pointer.
if (aTag == DOMWORKER_SCTAG_FILE) {
JS_ASSERT(!aData);
MOZ_ASSERT(!aData);
nsIDOMFile* file;
if (JS_ReadBytes(aReader, &file, sizeof(file))) {
JS_ASSERT(file);
MOZ_ASSERT(file);
#ifdef DEBUG
{
@ -327,11 +327,11 @@ struct WorkerStructuredCloneCallbacks
}
// See if object is a nsIDOMBlob pointer.
else if (aTag == DOMWORKER_SCTAG_BLOB) {
JS_ASSERT(!aData);
MOZ_ASSERT(!aData);
nsIDOMBlob* blob;
if (JS_ReadBytes(aReader, &blob, sizeof(blob))) {
JS_ASSERT(blob);
MOZ_ASSERT(blob);
#ifdef DEBUG
{
@ -352,7 +352,7 @@ struct WorkerStructuredCloneCallbacks
}
// See if the object is an ImageData.
else if (aTag == SCTAG_DOM_IMAGEDATA) {
JS_ASSERT(!aData);
MOZ_ASSERT(!aData);
// Read the information out of the stream.
uint32_t width, height;
@ -459,11 +459,11 @@ struct MainThreadWorkerStructuredCloneCallbacks
// See if object is a nsIDOMFile pointer.
if (aTag == DOMWORKER_SCTAG_FILE) {
JS_ASSERT(!aData);
MOZ_ASSERT(!aData);
nsIDOMFile* file;
if (JS_ReadBytes(aReader, &file, sizeof(file))) {
JS_ASSERT(file);
MOZ_ASSERT(file);
#ifdef DEBUG
{
@ -493,11 +493,11 @@ struct MainThreadWorkerStructuredCloneCallbacks
}
// See if object is a nsIDOMBlob pointer.
else if (aTag == DOMWORKER_SCTAG_BLOB) {
JS_ASSERT(!aData);
MOZ_ASSERT(!aData);
nsIDOMBlob* blob;
if (JS_ReadBytes(aReader, &blob, sizeof(blob))) {
JS_ASSERT(blob);
MOZ_ASSERT(blob);
#ifdef DEBUG
{

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

@ -5,6 +5,11 @@ import os
import locale
locale.setlocale(locale.LC_ALL, 'en_US.UTF-8')
header = """
# Please note this file is autogenerated from generate_mozbuild.py, so do not modify it directly
"""
footer = """
# left out of UNIFIED_SOURCES for now; that's not C++ anyway, nothing else to unify it with
@ -57,6 +62,7 @@ if CONFIG['INTEL_ARCHITECTURE'] and CONFIG['HAVE_TOOLCHAIN_SUPPORT_MSSSE3']:
if (CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android') or \
(CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa') or \
(CONFIG['MOZ_WIDGET_TOOLKIT'] == 'gonk') or \
CONFIG['MOZ_WIDGET_GTK']:
DEFINES['SK_FONTHOST_DOES_NOT_USE_FONTMGR'] = 1
@ -251,6 +257,7 @@ def write_mozbuild(includes, sources):
filename = 'moz.build'
f = open(filename, 'w')
f.write(header)
write_list(f, 'EXPORTS.skia', includes, 0)

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

@ -1,3 +1,5 @@
# Please note this file is autogenerated from generate_mozbuild.py, so do not modify it directly
EXPORTS.skia += [
'trunk/include/animator/SkAnimator.h',
'trunk/include/animator/SkAnimatorView.h',

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

@ -202,3 +202,5 @@
# define SK_MUTEX_PLATFORM_H "skia/SkMutex_pthread.h"
# endif
#endif
#define SK_ALLOW_STATIC_GLOBAL_INITIALIZERS 0

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

@ -180,7 +180,7 @@ JavaScriptShared::toVariant(JSContext *cx, JS::HandleValue from, JSVariant *to)
{
RootedObject obj(cx, from.toObjectOrNull());
if (!obj) {
JS_ASSERT(from == JSVAL_NULL);
MOZ_ASSERT(from == JSVAL_NULL);
*to = uint64_t(0);
return true;
}

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

@ -734,13 +734,13 @@ extern JSDStaticLock* _jsd_global_lock;
JS_BEGIN_MACRO \
if(!_jsd_global_lock) \
_jsd_global_lock = jsd_CreateLock(); \
JS_ASSERT(_jsd_global_lock); \
MOZ_ASSERT(_jsd_global_lock); \
jsd_Lock(_jsd_global_lock); \
JS_END_MACRO
#define JSD_UNLOCK() \
JS_BEGIN_MACRO \
JS_ASSERT(_jsd_global_lock); \
MOZ_ASSERT(_jsd_global_lock); \
jsd_Unlock(_jsd_global_lock); \
JS_END_MACRO

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

@ -39,9 +39,9 @@ _testAtoms(JSDContext*jsdc)
static int
_atom_smasher(JSHashEntry *he, int i, void *arg)
{
JS_ASSERT(he);
JS_ASSERT(he->value);
JS_ASSERT(((JSDAtom*)(he->value))->str);
MOZ_ASSERT(he);
MOZ_ASSERT(he->value);
MOZ_ASSERT(((JSDAtom*)(he->value))->str);
free(((JSDAtom*)(he->value))->str);
free(he->value);
@ -93,7 +93,7 @@ jsd_AddAtom(JSDContext* jsdc, const char* str)
if(!str)
{
JS_ASSERT(0);
MOZ_ASSERT(0);
return nullptr;
}

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

@ -34,9 +34,9 @@ JSDStaticLock* _jsd_global_lock = nullptr;
#ifdef DEBUG
void JSD_ASSERT_VALID_CONTEXT(JSDContext* jsdc)
{
JS_ASSERT(jsdc->inited);
JS_ASSERT(jsdc->jsrt);
JS_ASSERT(jsdc->glob);
MOZ_ASSERT(jsdc->inited);
MOZ_ASSERT(jsdc->jsrt);
MOZ_ASSERT(jsdc->glob);
}
#endif
@ -209,8 +209,8 @@ jsd_DebuggerOnForUser(JSRuntime* jsrt,
JSDContext*
jsd_DebuggerOn(void)
{
JS_ASSERT(_jsrt);
JS_ASSERT(_validateUserCallbacks(&_callbacks));
MOZ_ASSERT(_jsrt);
MOZ_ASSERT(_validateUserCallbacks(&_callbacks));
return jsd_DebuggerOnForUser(_jsrt, &_callbacks, _user, nullptr);
}
@ -337,7 +337,7 @@ jsd_DebugErrorHook(JSContext *cx, const char *message,
if( ! jsdc )
{
JS_ASSERT(0);
MOZ_ASSERT(0);
return true;
}
if( JSD_IS_DANGEROUS_THREAD(jsdc) )
@ -380,7 +380,7 @@ jsd_DebugErrorHook(JSContext *cx, const char *message,
JS_ClearPendingException(cx);
return false;
default:
JS_ASSERT(0);
MOZ_ASSERT(0);
break;
}
return true;

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

@ -159,10 +159,10 @@ jsd_CallExecutionHook(JSDContext* jsdc,
break;
case JSD_HOOK_RETURN_CONTINUE_THROW:
/* only makes sense for jsd_ThrowHandler (which init'd rval) */
JS_ASSERT(JSD_HOOK_THROW == type);
MOZ_ASSERT(JSD_HOOK_THROW == type);
return JSTRAP_THROW;
default:
JS_ASSERT(0);
MOZ_ASSERT(0);
break;
}
return JSTRAP_CONTINUE;

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

@ -58,13 +58,13 @@ JS_BEGIN_MACRO \
if(!out) \
out = (void*) JS_AttachThread(PR_USER_THREAD, PR_PRIORITY_NORMAL, \
nullptr); \
JS_ASSERT(out); \
MOZ_ASSERT(out); \
JS_END_MACRO
#else
#define _CURRENT_THREAD(out) \
JS_BEGIN_MACRO \
out = (void*) PR_GetCurrentThread(); \
JS_ASSERT(out); \
MOZ_ASSERT(out); \
JS_END_MACRO
#endif
@ -72,10 +72,10 @@ JS_END_MACRO
#define JSD_LOCK_SIG 0x10CC10CC
void ASSERT_VALID_LOCK(JSDStaticLock* lock)
{
JS_ASSERT(lock);
JS_ASSERT(lock->lock);
JS_ASSERT(lock->count >= 0);
JS_ASSERT(lock->sig == (uint16_t) JSD_LOCK_SIG);
MOZ_ASSERT(lock);
MOZ_ASSERT(lock->lock);
MOZ_ASSERT(lock->count >= 0);
MOZ_ASSERT(lock->sig == (uint16_t) JSD_LOCK_SIG);
}
#else
#define ASSERT_VALID_LOCK(x) ((void)0)
@ -111,13 +111,13 @@ jsd_Lock(JSDStaticLock* lock)
if(lock->owner == me)
{
lock->count++;
JS_ASSERT(lock->count > 1);
MOZ_ASSERT(lock->count > 1);
}
else
{
PR_Lock(lock->lock); /* this can block... */
JS_ASSERT(lock->owner == 0);
JS_ASSERT(lock->count == 0);
MOZ_ASSERT(lock->owner == 0);
MOZ_ASSERT(lock->count == 0);
lock->count = 1;
lock->owner = me;
}
@ -131,7 +131,7 @@ jsd_Unlock(JSDStaticLock* lock)
_CURRENT_THREAD(me);
/* it's an error to unlock a lock you don't own */
JS_ASSERT(lock->owner == me);
MOZ_ASSERT(lock->owner == me);
if(lock->owner != me)
return;
@ -151,7 +151,7 @@ jsd_IsLocked(JSDStaticLock* lock)
_CURRENT_THREAD(me);
if (lock->owner != me)
return false;
JS_ASSERT(lock->count > 0);
MOZ_ASSERT(lock->count > 0);
return true;
}
#endif /* DEBUG */

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

@ -55,9 +55,9 @@ _traceObj(JSDContext* jsdc, JSDObject* jsdobj, int which)
#ifdef DEBUG
void JSD_ASSERT_VALID_OBJECT(JSDObject* jsdobj)
{
JS_ASSERT(jsdobj);
JS_ASSERT(!JS_CLIST_IS_EMPTY(&jsdobj->links));
JS_ASSERT(jsdobj->obj);
MOZ_ASSERT(jsdobj);
MOZ_ASSERT(!JS_CLIST_IS_EMPTY(&jsdobj->links));
MOZ_ASSERT(jsdobj->obj);
}
#endif
@ -65,7 +65,7 @@ void JSD_ASSERT_VALID_OBJECT(JSDObject* jsdobj)
static void
_destroyJSDObject(JSDContext* jsdc, JSDObject* jsdobj)
{
JS_ASSERT(JSD_OBJECTS_LOCKED(jsdc));
MOZ_ASSERT(JSD_OBJECTS_LOCKED(jsdc));
JS_REMOVE_LINK(&jsdobj->links);
JS_HashTableRemove(jsdc->objectsTable, jsdobj->obj);
@ -156,7 +156,7 @@ jsd_IterateObjects(JSDContext* jsdc, JSDObject** iterp)
{
JSDObject *jsdobj = *iterp;
JS_ASSERT(JSD_OBJECTS_LOCKED(jsdc));
MOZ_ASSERT(JSD_OBJECTS_LOCKED(jsdc));
if( !jsdobj )
jsdobj = (JSDObject *)jsdc->objectsList.next;

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

@ -28,13 +28,13 @@ using mozilla::AutoSafeJSContext;
#ifdef DEBUG
void JSD_ASSERT_VALID_SCRIPT(JSDScript* jsdscript)
{
JS_ASSERT(jsdscript);
JS_ASSERT(jsdscript->script);
MOZ_ASSERT(jsdscript);
MOZ_ASSERT(jsdscript->script);
}
void JSD_ASSERT_VALID_EXEC_HOOK(JSDExecHook* jsdhook)
{
JS_ASSERT(jsdhook);
JS_ASSERT(jsdhook->hook);
MOZ_ASSERT(jsdhook);
MOZ_ASSERT(jsdhook->hook);
}
#endif
@ -51,7 +51,7 @@ _newJSDScript(JSDContext* jsdc,
unsigned lineno;
const char* raw_filename;
JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
/* these are inlined javascript: urls and we can't handle them now */
lineno = (unsigned) JS_GetScriptBaseLineNumber(cx, script);
@ -82,7 +82,7 @@ static void
_destroyJSDScript(JSDContext* jsdc,
JSDScript* jsdscript)
{
JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
/* destroy all hooks */
jsd_ClearAllExecutionHooksForScript(jsdc, jsdscript);
@ -130,7 +130,7 @@ _dumpJSDScript(JSDContext* jsdc, JSDScript* jsdscript, const char* leadingtext)
n += size_t(snprintf(Buf + n, sizeof(Buf) - n, "%s", "no fun"));
} else {
n += JS_PutEscapedFlatString(Buf + n, sizeof(Buf) - n,
JS_ASSERT_STRING_IS_FLAT(fun), 0);
MOZ_ASSERT_STRING_IS_FLAT(fun), 0);
Buf[sizeof(Buf) - 1] = '\0';
}
if (n + 1 < sizeof(Buf))
@ -218,7 +218,7 @@ JSDScript*
jsd_FindJSDScript( JSDContext* jsdc,
JSScript *script )
{
JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
return (JSDScript*) JS_HashTableLookup(jsdc->scriptsTable, (void *)script);
}
@ -230,7 +230,7 @@ jsd_FindOrCreateJSDScript(JSDContext *jsdc,
{
JS::RootedScript script(cx, script_);
JSDScript *jsdscript;
JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
jsdscript = jsd_FindJSDScript(jsdc, script);
if (jsdscript)
@ -369,7 +369,7 @@ jsd_IterateScripts(JSDContext* jsdc, JSDScript **iterp)
{
JSDScript *jsdscript = *iterp;
JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
if( !jsdscript )
jsdscript = (JSDScript *)jsdc->scripts.next;
@ -398,7 +398,7 @@ jsd_IsActiveScript(JSDContext* jsdc, JSDScript *jsdscript)
{
JSDScript *current;
JS_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
MOZ_ASSERT(JSD_SCRIPTS_LOCKED(jsdc));
for( current = (JSDScript *)jsdc->scripts.next;
current != (JSDScript *)&jsdc->scripts;
@ -720,9 +720,9 @@ jsd_TrapHandler(JSContext *cx, JSScript *script_, jsbytecode *pc, jsval *rval,
}
JSD_ASSERT_VALID_EXEC_HOOK(jsdhook);
JS_ASSERT(!jsdhook->pc || jsdhook->pc == (uintptr_t)pc);
JS_ASSERT(jsdhook->jsdscript->script == script);
JS_ASSERT(jsdhook->jsdscript->jsdc == jsdc);
MOZ_ASSERT(!jsdhook->pc || jsdhook->pc == (uintptr_t)pc);
MOZ_ASSERT(jsdhook->jsdscript->script == script);
MOZ_ASSERT(jsdhook->jsdscript->jsdc == jsdc);
hook = jsdhook->hook;
hookData = jsdhook->callerdata;

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

@ -17,14 +17,14 @@ using mozilla::AutoPushJSContext;
#ifdef DEBUG
void JSD_ASSERT_VALID_THREAD_STATE(JSDThreadState* jsdthreadstate)
{
JS_ASSERT(jsdthreadstate);
JS_ASSERT(jsdthreadstate->stackDepth > 0);
MOZ_ASSERT(jsdthreadstate);
MOZ_ASSERT(jsdthreadstate->stackDepth > 0);
}
void JSD_ASSERT_VALID_STACK_FRAME(JSDStackFrameInfo* jsdframe)
{
JS_ASSERT(jsdframe);
JS_ASSERT(jsdframe->jsdthreadstate);
MOZ_ASSERT(jsdframe);
MOZ_ASSERT(jsdframe->jsdthreadstate);
}
#endif
@ -148,8 +148,8 @@ jsd_DestroyThreadState(JSDContext* jsdc, JSDThreadState* jsdthreadstate)
JSDStackFrameInfo* jsdframe;
JSCList* list;
JS_ASSERT(jsdthreadstate);
JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
MOZ_ASSERT(jsdthreadstate);
MOZ_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
JSD_LOCK_THREADSTATES(jsdc);
JS_REMOVE_LINK(&jsdthreadstate->links);
@ -402,7 +402,7 @@ jsd_EvaluateUCScriptInStackFrame(JSDContext* jsdc,
bool valid;
JSExceptionState* exceptionState = nullptr;
JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
MOZ_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
JSD_LOCK_THREADSTATES(jsdc);
valid = jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe);
@ -412,7 +412,7 @@ jsd_EvaluateUCScriptInStackFrame(JSDContext* jsdc,
return false;
AutoPushJSContext cx(jsdthreadstate->context);
JS_ASSERT(cx);
MOZ_ASSERT(cx);
if (eatExceptions)
exceptionState = JS_SaveExceptionState(cx);
@ -439,7 +439,7 @@ jsd_EvaluateScriptInStackFrame(JSDContext* jsdc,
bool valid;
JSExceptionState* exceptionState = nullptr;
JS_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
MOZ_ASSERT(JSD_CURRENT_THREAD() == jsdthreadstate->thread);
JSD_LOCK_THREADSTATES(jsdc);
valid = jsd_IsValidFrameInThreadState(jsdc, jsdthreadstate, jsdframe);
@ -449,7 +449,7 @@ jsd_EvaluateScriptInStackFrame(JSDContext* jsdc,
return false;
AutoPushJSContext cx(jsdthreadstate->context);
JS_ASSERT(cx);
MOZ_ASSERT(cx);
if (eatExceptions)
exceptionState = JS_SaveExceptionState(cx);
@ -483,7 +483,7 @@ jsd_ValToStringInStackFrame(JSDContext* jsdc,
return nullptr;
cx = jsdthreadstate->context;
JS_ASSERT(cx);
MOZ_ASSERT(cx);
JS::RootedValue v(cx, val);
exceptionState = JS_SaveExceptionState(cx);
@ -499,7 +499,7 @@ jsd_IsValidThreadState(JSDContext* jsdc,
{
JSDThreadState *cur;
JS_ASSERT( JSD_THREADSTATES_LOCKED(jsdc) );
MOZ_ASSERT( JSD_THREADSTATES_LOCKED(jsdc) );
for( cur = (JSDThreadState*)jsdc->threadsStates.next;
cur != (JSDThreadState*)&jsdc->threadsStates;
@ -516,7 +516,7 @@ jsd_IsValidFrameInThreadState(JSDContext* jsdc,
JSDThreadState* jsdthreadstate,
JSDStackFrameInfo* jsdframe)
{
JS_ASSERT(JSD_THREADSTATES_LOCKED(jsdc));
MOZ_ASSERT(JSD_THREADSTATES_LOCKED(jsdc));
if( ! jsd_IsValidThreadState(jsdc, jsdthreadstate) )
return false;

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

@ -72,7 +72,7 @@ _interpreterTrace(JSDContext* jsdc, JSContext *cx, JSAbstractFramePtr frame,
puts("<unavailable>");
}
printf("\n");
JS_ASSERT(indent >= 0);
MOZ_ASSERT(indent >= 0);
}
#endif

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

@ -15,8 +15,8 @@
#ifdef DEBUG
void JSD_ASSERT_VALID_SOURCE_TEXT(JSDSourceText* jsdsrc)
{
JS_ASSERT(jsdsrc);
JS_ASSERT(jsdsrc->url);
MOZ_ASSERT(jsdsrc);
MOZ_ASSERT(jsdsrc->url);
}
#endif
@ -98,7 +98,7 @@ _newSource(JSDContext* jsdc, char* url)
static void
_destroySource(JSDContext* jsdc, JSDSourceText* jsdsrc)
{
JS_ASSERT(nullptr == jsdsrc->text); /* must _clearText() first */
MOZ_ASSERT(nullptr == jsdsrc->text); /* must _clearText() first */
free(jsdsrc->url);
free(jsdsrc);
}
@ -491,7 +491,7 @@ jsd_StartingEvalUsingFilename(JSDContext* jsdc, const char* url)
{
#if 0
#ifndef JSD_LOWLEVEL_SOURCE
JS_ASSERT(! jsdsrc->doingEval);
MOZ_ASSERT(! jsdsrc->doingEval);
#endif
#endif
jsdsrc->doingEval = true;
@ -515,7 +515,7 @@ jsd_FinishedEvalUsingFilename(JSDContext* jsdc, const char* url)
* not have existed before the eval, but does exist now (without
* this flag set!)
*/
JS_ASSERT(jsdsrc->doingEval);
MOZ_ASSERT(jsdsrc->doingEval);
#endif
#endif
jsdsrc->doingEval = false;

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

@ -19,40 +19,40 @@ using mozilla::AutoSafeJSContext;
#ifdef DEBUG
void JSD_ASSERT_VALID_VALUE(JSDValue* jsdval)
{
JS_ASSERT(jsdval);
JS_ASSERT(jsdval->nref > 0);
MOZ_ASSERT(jsdval);
MOZ_ASSERT(jsdval->nref > 0);
if(!JS_CLIST_IS_EMPTY(&jsdval->props))
{
JS_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS));
JS_ASSERT(!JSVAL_IS_PRIMITIVE(jsdval->val));
MOZ_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS));
MOZ_ASSERT(!JSVAL_IS_PRIMITIVE(jsdval->val));
}
if(jsdval->proto)
{
JS_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PROTO));
JS_ASSERT(jsdval->proto->nref > 0);
MOZ_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PROTO));
MOZ_ASSERT(jsdval->proto->nref > 0);
}
if(jsdval->parent)
{
JS_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PARENT));
JS_ASSERT(jsdval->parent->nref > 0);
MOZ_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_PARENT));
MOZ_ASSERT(jsdval->parent->nref > 0);
}
if(jsdval->ctor)
{
JS_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_CTOR));
JS_ASSERT(jsdval->ctor->nref > 0);
MOZ_ASSERT(CHECK_BIT_FLAG(jsdval->flags, GOT_CTOR));
MOZ_ASSERT(jsdval->ctor->nref > 0);
}
}
void JSD_ASSERT_VALID_PROPERTY(JSDProperty* jsdprop)
{
JS_ASSERT(jsdprop);
JS_ASSERT(jsdprop->name);
JS_ASSERT(jsdprop->name->nref > 0);
JS_ASSERT(jsdprop->val);
JS_ASSERT(jsdprop->val->nref > 0);
MOZ_ASSERT(jsdprop);
MOZ_ASSERT(jsdprop->name);
MOZ_ASSERT(jsdprop->name->nref > 0);
MOZ_ASSERT(jsdprop->val);
MOZ_ASSERT(jsdprop->val->nref > 0);
if(jsdprop->alias)
JS_ASSERT(jsdprop->alias->nref > 0);
MOZ_ASSERT(jsdprop->alias->nref > 0);
}
#endif
@ -133,7 +133,7 @@ jsd_IsValueNative(JSDContext* jsdc, JSDValue* jsdval)
fun = JSD_GetValueFunction(jsdc, jsdval);
if(fun)
ok = JS_GetFunctionScript(cx, fun) ? false : true;
JS_ASSERT(fun);
MOZ_ASSERT(fun);
return ok;
}
return !JSVAL_IS_PRIMITIVE(jsdval->val);
@ -275,7 +275,7 @@ jsd_NewValue(JSDContext* jsdc, jsval value)
void
jsd_DropValue(JSDContext* jsdc, JSDValue* jsdval)
{
JS_ASSERT(jsdval->nref > 0);
MOZ_ASSERT(jsdval->nref > 0);
if(0 == --jsdval->nref)
{
jsd_RefreshValue(jsdc, jsdval);
@ -349,7 +349,7 @@ static void _freeProps(JSDContext* jsdc, JSDValue* jsdval)
JS_REMOVE_AND_INIT_LINK(&jsdprop->links);
jsd_DropProperty(jsdc, jsdprop);
}
JS_ASSERT(JS_CLIST_IS_EMPTY(&jsdval->props));
MOZ_ASSERT(JS_CLIST_IS_EMPTY(&jsdval->props));
CLEAR_BIT_FLAG(jsdval->flags, GOT_PROPS);
}
@ -360,9 +360,9 @@ static bool _buildProps(JSDContext* jsdc, JSDValue* jsdval)
JSPropertyDescArray pda;
unsigned i;
JS_ASSERT(JS_CLIST_IS_EMPTY(&jsdval->props));
JS_ASSERT(!(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS)));
JS_ASSERT(!JSVAL_IS_PRIMITIVE(jsdval->val));
MOZ_ASSERT(JS_CLIST_IS_EMPTY(&jsdval->props));
MOZ_ASSERT(!(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS)));
MOZ_ASSERT(!JSVAL_IS_PRIMITIVE(jsdval->val));
if(JSVAL_IS_PRIMITIVE(jsdval->val))
return false;
@ -453,7 +453,7 @@ jsd_IterateProperties(JSDContext* jsdc, JSDValue* jsdval, JSDProperty **iterp)
JSDProperty* jsdprop = *iterp;
if(!(CHECK_BIT_FLAG(jsdval->flags, GOT_PROPS)))
{
JS_ASSERT(!jsdprop);
MOZ_ASSERT(!jsdprop);
if(!_buildProps(jsdc, jsdval))
return nullptr;
}
@ -464,7 +464,7 @@ jsd_IterateProperties(JSDContext* jsdc, JSDValue* jsdval, JSDProperty **iterp)
return nullptr;
*iterp = (JSDProperty*)jsdprop->links.next;
JS_ASSERT(jsdprop);
MOZ_ASSERT(jsdprop);
jsdprop->nref++;
return jsdprop;
}
@ -586,7 +586,7 @@ jsd_GetValuePrototype(JSDContext* jsdc, JSDValue* jsdval)
{
JS::RootedObject obj(cx);
JS::RootedObject proto(cx);
JS_ASSERT(!jsdval->proto);
MOZ_ASSERT(!jsdval->proto);
SET_BIT_FLAG(jsdval->flags, GOT_PROTO);
if(JSVAL_IS_PRIMITIVE(jsdval->val))
return nullptr;
@ -610,7 +610,7 @@ jsd_GetValueParent(JSDContext* jsdc, JSDValue* jsdval)
AutoSafeJSContext cx;
JS::RootedObject obj(cx);
JS::RootedObject parent(cx);
JS_ASSERT(!jsdval->parent);
MOZ_ASSERT(!jsdval->parent);
SET_BIT_FLAG(jsdval->flags, GOT_PARENT);
if(JSVAL_IS_PRIMITIVE(jsdval->val))
return nullptr;
@ -637,7 +637,7 @@ jsd_GetValueConstructor(JSDContext* jsdc, JSDValue* jsdval)
JS::RootedObject obj(cx);
JS::RootedObject proto(cx);
JS::RootedObject ctor(cx);
JS_ASSERT(!jsdval->ctor);
MOZ_ASSERT(!jsdval->ctor);
SET_BIT_FLAG(jsdval->flags, GOT_CTOR);
if(JSVAL_IS_PRIMITIVE(jsdval->val))
return nullptr;
@ -737,10 +737,10 @@ jsd_GetPropertyFlags(JSDContext* jsdc, JSDProperty* jsdprop)
void
jsd_DropProperty(JSDContext* jsdc, JSDProperty* jsdprop)
{
JS_ASSERT(jsdprop->nref > 0);
MOZ_ASSERT(jsdprop->nref > 0);
if(0 == --jsdprop->nref)
{
JS_ASSERT(JS_CLIST_IS_EMPTY(&jsdprop->links));
MOZ_ASSERT(JS_CLIST_IS_EMPTY(&jsdprop->links));
DROP_CLEAR_VALUE(jsdc, jsdprop->val);
DROP_CLEAR_VALUE(jsdc, jsdprop->name);
DROP_CLEAR_VALUE(jsdc, jsdprop->alias);

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

@ -390,7 +390,7 @@ JSD_PUBLIC_API(JSDSourceText*)
JSD_FindSourceForURL(JSDContext* jsdc, const char* url)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JS_ASSERT(url);
MOZ_ASSERT(url);
return jsd_FindSourceForURL(jsdc, url);
}
@ -408,8 +408,8 @@ JSD_GetSourceText(JSDContext* jsdc, JSDSourceText* jsdsrc,
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_SOURCE_TEXT(jsdsrc);
JS_ASSERT(ppBuf);
JS_ASSERT(pLen);
MOZ_ASSERT(ppBuf);
MOZ_ASSERT(pLen);
return jsd_GetSourceText(jsdc, jsdsrc, ppBuf, pLen);
}
@ -473,7 +473,7 @@ JSD_PUBLIC_API(JSDSourceText*)
JSD_NewSourceText(JSDContext* jsdc, const char* url)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JS_ASSERT(url);
MOZ_ASSERT(url);
return jsd_NewSourceText(jsdc, url);
}
@ -508,7 +508,7 @@ JSD_AddFullSourceText(JSDContext* jsdc,
const char* url)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JS_ASSERT(url);
MOZ_ASSERT(url);
return jsd_AddFullSourceText(jsdc, text, length, url);
}
@ -769,9 +769,9 @@ JSD_EvaluateUCScriptInStackFrame(JSDContext* jsdc,
const char *filename, unsigned lineno, JS::MutableHandleValue rval)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JS_ASSERT(bytes);
JS_ASSERT(length);
JS_ASSERT(filename);
MOZ_ASSERT(bytes);
MOZ_ASSERT(length);
MOZ_ASSERT(filename);
return jsd_EvaluateUCScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
bytes, length, filename, lineno,
@ -787,9 +787,9 @@ JSD_AttemptUCScriptInStackFrame(JSDContext* jsdc,
JS::MutableHandleValue rval)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JS_ASSERT(bytes);
JS_ASSERT(length);
JS_ASSERT(filename);
MOZ_ASSERT(bytes);
MOZ_ASSERT(length);
MOZ_ASSERT(filename);
return jsd_EvaluateUCScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
bytes, length, filename, lineno,
@ -804,9 +804,9 @@ JSD_EvaluateScriptInStackFrame(JSDContext* jsdc,
const char *filename, unsigned lineno, JS::MutableHandleValue rval)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JS_ASSERT(bytes);
JS_ASSERT(length);
JS_ASSERT(filename);
MOZ_ASSERT(bytes);
MOZ_ASSERT(length);
MOZ_ASSERT(filename);
return jsd_EvaluateScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
bytes, length,
@ -821,9 +821,9 @@ JSD_AttemptScriptInStackFrame(JSDContext* jsdc,
const char *filename, unsigned lineno, JS::MutableHandleValue rval)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JS_ASSERT(bytes);
JS_ASSERT(length);
JS_ASSERT(filename);
MOZ_ASSERT(bytes);
MOZ_ASSERT(length);
MOZ_ASSERT(filename);
return jsd_EvaluateScriptInStackFrame(jsdc, jsdthreadstate,jsdframe,
bytes, length,
@ -1128,7 +1128,7 @@ JSD_IterateProperties(JSDContext* jsdc, JSDValue* jsdval, JSDProperty **iterp)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_VALUE(jsdval);
JS_ASSERT(iterp);
MOZ_ASSERT(iterp);
return jsd_IterateProperties(jsdc, jsdval, iterp);
}
@ -1137,7 +1137,7 @@ JSD_GetValueProperty(JSDContext* jsdc, JSDValue* jsdval, JSString* name)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JSD_ASSERT_VALID_VALUE(jsdval);
JS_ASSERT(name);
MOZ_ASSERT(name);
return jsd_GetValueProperty(jsdc, jsdval, name);
}
@ -1299,7 +1299,7 @@ JSD_PUBLIC_API(JSDObject*)
JSD_GetJSDObjectForJSObject(JSDContext* jsdc, JSObject* jsobj)
{
JSD_ASSERT_VALID_CONTEXT(jsdc);
JS_ASSERT(jsobj);
MOZ_ASSERT(jsobj);
return jsd_GetJSDObjectForJSObject(jsdc, jsobj);
}

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

@ -176,7 +176,7 @@ Resize(JSHashTable *ht, uint32_t newshift)
JSHashEntry **oldbuckets, *he, *next, **hep;
size_t nold = NBUCKETS(ht);
JS_ASSERT(newshift < JS_HASH_BITS);
MOZ_ASSERT(newshift < JS_HASH_BITS);
nb = (size_t)1 << (JS_HASH_BITS - newshift);
@ -198,7 +198,7 @@ Resize(JSHashTable *ht, uint32_t newshift)
for (i = 0; nentries != 0; i++) {
for (he = oldbuckets[i]; he; he = next) {
JS_ASSERT(nentries != 0);
MOZ_ASSERT(nentries != 0);
--nentries;
next = he->next;
hep = BUCKET_HEAD(ht, he->keyHash);
@ -339,7 +339,7 @@ JS_HashTableEnumerateEntries(JSHashTable *ht, JSHashEnumerator f, void *arg)
for (bucket = ht->buckets; n != nlimit; ++bucket) {
hep = bucket;
while ((he = *hep) != nullptr) {
JS_ASSERT(n < nlimit);
MOZ_ASSERT(n < nlimit);
rv = f(he, n, arg);
n++;
if (rv & HT_ENUMERATE_REMOVE) {
@ -358,7 +358,7 @@ JS_HashTableEnumerateEntries(JSHashTable *ht, JSHashEnumerator f, void *arg)
out:
/* Shrink table if removal of entries made it underloaded */
if (ht->nentries != nlimit) {
JS_ASSERT(ht->nentries < nlimit);
MOZ_ASSERT(ht->nentries < nlimit);
nbuckets = NBUCKETS(ht);
if (MINBUCKETS < nbuckets && ht->nentries < UNDERLOADED(nbuckets)) {
newlog2 = CeilingLog2Size(ht->nentries);
@ -366,7 +366,7 @@ out:
newlog2 = MINBUCKETSLOG2;
/* Check that we really shrink the table. */
JS_ASSERT(JS_HASH_BITS - ht->shift > newlog2);
MOZ_ASSERT(JS_HASH_BITS - ht->shift > newlog2);
Resize(ht, JS_HASH_BITS - newlog2);
}
}

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

@ -50,13 +50,13 @@ class Latin1CharsZ : public mozilla::RangedPtr<unsigned char>
Latin1CharsZ(char *aBytes, size_t aLength)
: Base(reinterpret_cast<unsigned char *>(aBytes), aLength)
{
JS_ASSERT(aBytes[aLength] == '\0');
MOZ_ASSERT(aBytes[aLength] == '\0');
}
Latin1CharsZ(unsigned char *aBytes, size_t aLength)
: Base(aBytes, aLength)
{
JS_ASSERT(aBytes[aLength] == '\0');
MOZ_ASSERT(aBytes[aLength] == '\0');
}
using Base::operator=;
@ -91,13 +91,13 @@ class UTF8CharsZ : public mozilla::RangedPtr<unsigned char>
UTF8CharsZ(char *aBytes, size_t aLength)
: Base(reinterpret_cast<unsigned char *>(aBytes), aLength)
{
JS_ASSERT(aBytes[aLength] == '\0');
MOZ_ASSERT(aBytes[aLength] == '\0');
}
UTF8CharsZ(unsigned char *aBytes, size_t aLength)
: Base(aBytes, aLength)
{
JS_ASSERT(aBytes[aLength] == '\0');
MOZ_ASSERT(aBytes[aLength] == '\0');
}
using Base::operator=;
@ -136,7 +136,7 @@ class TwoByteCharsZ : public mozilla::RangedPtr<jschar>
TwoByteCharsZ(jschar *chars, size_t length)
: Base(chars, length)
{
JS_ASSERT(chars[length] == '\0');
MOZ_ASSERT(chars[length] == '\0');
}
using Base::operator=;

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

@ -76,8 +76,8 @@ class SpecialId
SpecialId(JSObject &obj)
: bits_(uintptr_t(&obj) | TYPE_OBJECT)
{
JS_ASSERT(&obj != nullptr);
JS_ASSERT((uintptr_t(&obj) & TYPE_MASK) == 0);
MOZ_ASSERT(&obj != nullptr);
MOZ_ASSERT((uintptr_t(&obj) & TYPE_MASK) == 0);
}
bool isObject() const {
@ -85,7 +85,7 @@ class SpecialId
}
JSObject *toObject() const {
JS_ASSERT(isObject());
MOZ_ASSERT(isObject());
return reinterpret_cast<JSObject *>(bits_ & ~TYPE_MASK);
}
@ -93,7 +93,7 @@ class SpecialId
static SpecialId empty() {
SpecialId sid(TYPE_OBJECT);
JS_ASSERT(sid.isEmpty());
MOZ_ASSERT(sid.isEmpty());
return sid;
}
@ -105,7 +105,7 @@ class SpecialId
static SpecialId voidId() {
SpecialId sid(TYPE_VOID);
JS_ASSERT(sid.isVoid());
MOZ_ASSERT(sid.isVoid());
return sid;
}
@ -119,9 +119,9 @@ SPECIALID_TO_JSID(const SpecialId &sid)
{
jsid id;
JSID_BITS(id) = sid.bits_;
JS_ASSERT_IF(sid.isObject(), JSID_IS_OBJECT(id) && JSID_TO_OBJECT(id) == sid.toObject());
JS_ASSERT_IF(sid.isVoid(), JSID_IS_VOID(id));
JS_ASSERT_IF(sid.isEmpty(), JSID_IS_EMPTY(id));
MOZ_ASSERT_IF(sid.isObject(), JSID_IS_OBJECT(id) && JSID_TO_OBJECT(id) == sid.toObject());
MOZ_ASSERT_IF(sid.isVoid(), JSID_IS_VOID(id));
MOZ_ASSERT_IF(sid.isEmpty(), JSID_IS_EMPTY(id));
return id;
}
@ -134,12 +134,12 @@ JSID_IS_SPECIAL(jsid id)
static MOZ_ALWAYS_INLINE SpecialId
JSID_TO_SPECIALID(jsid id)
{
JS_ASSERT(JSID_IS_SPECIAL(id));
MOZ_ASSERT(JSID_IS_SPECIAL(id));
if (JSID_IS_OBJECT(id))
return SpecialId(*JSID_TO_OBJECT(id));
if (JSID_IS_EMPTY(id))
return SpecialId::empty();
JS_ASSERT(JSID_IS_VOID(id));
MOZ_ASSERT(JSID_IS_VOID(id));
return SpecialId::voidId();
}

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

@ -388,7 +388,7 @@ class JS_PUBLIC_API(ObjectPtr)
ObjectPtr(JSObject *obj) : value(obj) {}
/* Always call finalize before the destructor. */
~ObjectPtr() { JS_ASSERT(!value); }
~ObjectPtr() { MOZ_ASSERT(!value); }
void finalize(JSRuntime *rt) {
if (IsIncrementalBarrierNeeded(rt))
@ -435,7 +435,7 @@ UnmarkGrayGCThingRecursively(void *thing, JSGCTraceKind kind);
static MOZ_ALWAYS_INLINE void
ExposeGCThingToActiveJS(void *thing, JSGCTraceKind kind)
{
JS_ASSERT(kind != JSTRACE_SHAPE);
MOZ_ASSERT(kind != JSTRACE_SHAPE);
shadow::Runtime *rt = js::gc::GetGCThingRuntime(thing);
#ifdef JSGC_GENERATIONAL

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

@ -531,7 +531,7 @@ struct PointerHasher
{
typedef Key Lookup;
static HashNumber hash(const Lookup &l) {
JS_ASSERT(!JS::IsPoisonedPtr(l));
MOZ_ASSERT(!JS::IsPoisonedPtr(l));
size_t word = reinterpret_cast<size_t>(l) >> zeroBits;
JS_STATIC_ASSERT(sizeof(HashNumber) == 4);
#if JS_BITS_PER_WORD == 32
@ -542,8 +542,8 @@ struct PointerHasher
#endif
}
static bool match(const Key &k, const Lookup &l) {
JS_ASSERT(!JS::IsPoisonedPtr(k));
JS_ASSERT(!JS::IsPoisonedPtr(l));
MOZ_ASSERT(!JS::IsPoisonedPtr(k));
MOZ_ASSERT(!JS::IsPoisonedPtr(l));
return k == l;
}
static void rekey(Key &k, const Key& newKey) {
@ -701,7 +701,7 @@ class HashTableEntry
}
void destroy() {
JS_ASSERT(isLive());
MOZ_ASSERT(isLive());
mem.addr()->~T();
}
@ -710,16 +710,16 @@ class HashTableEntry
mozilla::Swap(mem, other->mem);
}
T &get() { JS_ASSERT(isLive()); return *mem.addr(); }
T &get() { MOZ_ASSERT(isLive()); return *mem.addr(); }
bool isFree() const { return keyHash == sFreeKey; }
void clearLive() { JS_ASSERT(isLive()); keyHash = sFreeKey; mem.addr()->~T(); }
void clearLive() { MOZ_ASSERT(isLive()); keyHash = sFreeKey; mem.addr()->~T(); }
void clear() { if (isLive()) mem.addr()->~T(); keyHash = sFreeKey; }
bool isRemoved() const { return keyHash == sRemovedKey; }
void removeLive() { JS_ASSERT(isLive()); keyHash = sRemovedKey; mem.addr()->~T(); }
void removeLive() { MOZ_ASSERT(isLive()); keyHash = sRemovedKey; mem.addr()->~T(); }
bool isLive() const { return isLiveHash(keyHash); }
void setCollision() { JS_ASSERT(isLive()); keyHash |= sCollisionBit; }
void setCollision(HashNumber bit) { JS_ASSERT(isLive()); keyHash |= bit; }
void setCollision() { MOZ_ASSERT(isLive()); keyHash |= sCollisionBit; }
void setCollision(HashNumber bit) { MOZ_ASSERT(isLive()); keyHash |= bit; }
void unsetCollision() { keyHash &= ~sCollisionBit; }
bool hasCollision() const { return keyHash & sCollisionBit; }
bool matchHash(HashNumber hn) { return (keyHash & ~sCollisionBit) == hn; }
@ -728,10 +728,10 @@ class HashTableEntry
template <class U>
void setLive(HashNumber hn, U &&u)
{
JS_ASSERT(!isLive());
MOZ_ASSERT(!isLive());
keyHash = hn;
new(mem.addr()) T(mozilla::Forward<U>(u));
JS_ASSERT(isLive());
MOZ_ASSERT(isLive());
}
};
@ -779,7 +779,7 @@ class HashTable : private AllocPolicy
}
bool found() const {
JS_ASSERT(generation == table_->generation());
MOZ_ASSERT(generation == table_->generation());
return entry_->isLive();
}
@ -788,22 +788,22 @@ class HashTable : private AllocPolicy
}
bool operator==(const Ptr &rhs) const {
JS_ASSERT(found() && rhs.found());
MOZ_ASSERT(found() && rhs.found());
return entry_ == rhs.entry_;
}
bool operator!=(const Ptr &rhs) const {
JS_ASSERT(generation == table_->generation());
MOZ_ASSERT(generation == table_->generation());
return !(*this == rhs);
}
T &operator*() const {
JS_ASSERT(generation == table_->generation());
MOZ_ASSERT(generation == table_->generation());
return entry_->get();
}
T *operator->() const {
JS_ASSERT(generation == table_->generation());
MOZ_ASSERT(generation == table_->generation());
return &entry_->get();
}
};
@ -868,23 +868,23 @@ class HashTable : private AllocPolicy
{}
bool empty() const {
JS_ASSERT(generation == table_->generation());
JS_ASSERT(mutationCount == table_->mutationCount);
MOZ_ASSERT(generation == table_->generation());
MOZ_ASSERT(mutationCount == table_->mutationCount);
return cur == end;
}
T &front() const {
JS_ASSERT(validEntry);
JS_ASSERT(!empty());
JS_ASSERT(generation == table_->generation());
JS_ASSERT(mutationCount == table_->mutationCount);
MOZ_ASSERT(validEntry);
MOZ_ASSERT(!empty());
MOZ_ASSERT(generation == table_->generation());
MOZ_ASSERT(mutationCount == table_->mutationCount);
return cur->get();
}
void popFront() {
JS_ASSERT(!empty());
JS_ASSERT(generation == table_->generation());
JS_ASSERT(mutationCount == table_->mutationCount);
MOZ_ASSERT(!empty());
MOZ_ASSERT(generation == table_->generation());
MOZ_ASSERT(mutationCount == table_->mutationCount);
while (++cur < end && !cur->isLive())
continue;
#ifdef DEBUG
@ -1078,7 +1078,7 @@ class HashTable : private AllocPolicy
MOZ_WARN_UNUSED_RESULT bool init(uint32_t length)
{
JS_ASSERT(!initialized());
MOZ_ASSERT(!initialized());
// Reject all lengths whose initial computed capacity would exceed
// sMaxCapacity. Round that maximum length down to the nearest power
@ -1188,10 +1188,10 @@ class HashTable : private AllocPolicy
Entry &lookup(const Lookup &l, HashNumber keyHash, unsigned collisionBit) const
{
JS_ASSERT(isLiveHash(keyHash));
JS_ASSERT(!(keyHash & sCollisionBit));
JS_ASSERT(collisionBit == 0 || collisionBit == sCollisionBit);
JS_ASSERT(table);
MOZ_ASSERT(isLiveHash(keyHash));
MOZ_ASSERT(!(keyHash & sCollisionBit));
MOZ_ASSERT(collisionBit == 0 || collisionBit == sCollisionBit);
MOZ_ASSERT(table);
METER(stats.searches++);
// Compute the primary hash address.
@ -1248,8 +1248,8 @@ class HashTable : private AllocPolicy
// from entries, which allows more flexible Lookup/Key types.
Entry &findFreeEntry(HashNumber keyHash)
{
JS_ASSERT(!(keyHash & sCollisionBit));
JS_ASSERT(table);
MOZ_ASSERT(!(keyHash & sCollisionBit));
MOZ_ASSERT(table);
METER(stats.searches++);
// We assume 'keyHash' has already been distributed.
@ -1268,7 +1268,7 @@ class HashTable : private AllocPolicy
DoubleHash dh = hash2(keyHash);
while(true) {
JS_ASSERT(!entry->isRemoved());
MOZ_ASSERT(!entry->isRemoved());
entry->setCollision();
METER(stats.steps++);
@ -1349,7 +1349,7 @@ class HashTable : private AllocPolicy
void remove(Entry &e)
{
JS_ASSERT(table);
MOZ_ASSERT(table);
METER(stats.removes++);
if (e.hasCollision()) {
@ -1448,7 +1448,7 @@ class HashTable : private AllocPolicy
void finish()
{
JS_ASSERT(!entered);
MOZ_ASSERT(!entered);
if (!table)
return;
@ -1463,31 +1463,31 @@ class HashTable : private AllocPolicy
Range all() const
{
JS_ASSERT(table);
MOZ_ASSERT(table);
return Range(*this, table, table + capacity());
}
bool empty() const
{
JS_ASSERT(table);
MOZ_ASSERT(table);
return !entryCount;
}
uint32_t count() const
{
JS_ASSERT(table);
MOZ_ASSERT(table);
return entryCount;
}
uint32_t capacity() const
{
JS_ASSERT(table);
MOZ_ASSERT(table);
return JS_BIT(sHashBits - hashShift);
}
uint32_t generation() const
{
JS_ASSERT(table);
MOZ_ASSERT(table);
return gen;
}
@ -1527,9 +1527,9 @@ class HashTable : private AllocPolicy
bool add(AddPtr &p, U &&u)
{
mozilla::ReentrancyGuard g(*this);
JS_ASSERT(table);
JS_ASSERT(!p.found());
JS_ASSERT(!(p.keyHash & sCollisionBit));
MOZ_ASSERT(table);
MOZ_ASSERT(!p.found());
MOZ_ASSERT(!(p.keyHash & sCollisionBit));
// Changing an entry from removed to live does not affect whether we
// are overloaded and can be handled separately.
@ -1561,7 +1561,7 @@ class HashTable : private AllocPolicy
template <class U>
void putNewInfallible(const Lookup &l, U &&u)
{
JS_ASSERT(table);
MOZ_ASSERT(table);
HashNumber keyHash = prepareHash(l);
Entry *entry = &findFreeEntry(keyHash);
@ -1600,7 +1600,7 @@ class HashTable : private AllocPolicy
#endif
{
mozilla::ReentrancyGuard g(*this);
JS_ASSERT(prepareHash(l) == p.keyHash); // l has not been destroyed
MOZ_ASSERT(prepareHash(l) == p.keyHash); // l has not been destroyed
p.entry_ = &lookup(l, p.keyHash, sCollisionBit);
}
return p.found() || add(p, mozilla::Forward<U>(u));
@ -1608,18 +1608,18 @@ class HashTable : private AllocPolicy
void remove(Ptr p)
{
JS_ASSERT(table);
MOZ_ASSERT(table);
mozilla::ReentrancyGuard g(*this);
JS_ASSERT(p.found());
MOZ_ASSERT(p.found());
remove(*p.entry_);
checkUnderloaded();
}
void rekeyWithoutRehash(Ptr p, const Lookup &l, const Key &k)
{
JS_ASSERT(table);
MOZ_ASSERT(table);
mozilla::ReentrancyGuard g(*this);
JS_ASSERT(p.found());
MOZ_ASSERT(p.found());
typename HashTableEntry<T>::NonConstT t(mozilla::Move(*p));
HashPolicy::setKey(t, const_cast<Key &>(k));
remove(*p.entry_);

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

@ -86,13 +86,13 @@ struct Zone
}
JSTracer *barrierTracer() {
JS_ASSERT(needsBarrier_);
JS_ASSERT(js::CurrentThreadCanAccessRuntime(runtime_));
MOZ_ASSERT(needsBarrier_);
MOZ_ASSERT(js::CurrentThreadCanAccessRuntime(runtime_));
return barrierTracer_;
}
JSRuntime *runtimeFromMainThread() const {
JS_ASSERT(js::CurrentThreadCanAccessRuntime(runtime_));
MOZ_ASSERT(js::CurrentThreadCanAccessRuntime(runtime_));
return runtime_;
}
@ -116,7 +116,7 @@ namespace gc {
static MOZ_ALWAYS_INLINE uintptr_t *
GetGCThingMarkBitmap(const void *thing)
{
JS_ASSERT(thing);
MOZ_ASSERT(thing);
uintptr_t addr = uintptr_t(thing);
addr &= ~js::gc::ChunkMask;
addr |= js::gc::ChunkMarkBitmapOffset;
@ -126,7 +126,7 @@ GetGCThingMarkBitmap(const void *thing)
static MOZ_ALWAYS_INLINE JS::shadow::Runtime *
GetGCThingRuntime(const void *thing)
{
JS_ASSERT(thing);
MOZ_ASSERT(thing);
uintptr_t addr = uintptr_t(thing);
addr &= ~js::gc::ChunkMask;
addr |= js::gc::ChunkRuntimeOffset;
@ -139,7 +139,7 @@ GetGCThingMarkWordAndMask(const void *thing, uint32_t color,
{
uintptr_t addr = uintptr_t(thing);
size_t bit = (addr & js::gc::ChunkMask) / js::gc::CellSize + color;
JS_ASSERT(bit < js::gc::ChunkMarkBitmapBits);
MOZ_ASSERT(bit < js::gc::ChunkMarkBitmapBits);
uintptr_t *bitmap = GetGCThingMarkBitmap(thing);
const uintptr_t nbits = sizeof(*bitmap) * CHAR_BIT;
*maskp = uintptr_t(1) << (bit % nbits);
@ -173,7 +173,7 @@ namespace JS {
static MOZ_ALWAYS_INLINE Zone *
GetGCThingZone(void *thing)
{
JS_ASSERT(thing);
MOZ_ASSERT(thing);
return js::gc::GetGCThingArena(thing)->zone;
}

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

@ -55,7 +55,7 @@ JSID_IS_STRING(jsid id)
static MOZ_ALWAYS_INLINE JSString *
JSID_TO_STRING(jsid id)
{
JS_ASSERT(JSID_IS_STRING(id));
MOZ_ASSERT(JSID_IS_STRING(id));
return (JSString *)JSID_BITS(id);
}
@ -74,7 +74,7 @@ JSID_IS_INT(jsid id)
static MOZ_ALWAYS_INLINE int32_t
JSID_TO_INT(jsid id)
{
JS_ASSERT(JSID_IS_INT(id));
MOZ_ASSERT(JSID_IS_INT(id));
return ((uint32_t)JSID_BITS(id)) >> 1;
}
@ -91,7 +91,7 @@ static MOZ_ALWAYS_INLINE jsid
INT_TO_JSID(int32_t i)
{
jsid id;
JS_ASSERT(INT_FITS_IN_JSID(i));
MOZ_ASSERT(INT_FITS_IN_JSID(i));
JSID_BITS(id) = ((i << 1) | JSID_TYPE_INT);
return id;
}
@ -106,7 +106,7 @@ JSID_IS_OBJECT(jsid id)
static MOZ_ALWAYS_INLINE JSObject *
JSID_TO_OBJECT(jsid id)
{
JS_ASSERT(JSID_IS_OBJECT(id));
MOZ_ASSERT(JSID_IS_OBJECT(id));
return (JSObject *)(JSID_BITS(id) & ~(size_t)JSID_TYPE_MASK);
}
@ -114,8 +114,8 @@ static MOZ_ALWAYS_INLINE jsid
OBJECT_TO_JSID(JSObject *obj)
{
jsid id;
JS_ASSERT(obj != nullptr);
JS_ASSERT(((size_t)obj & JSID_TYPE_MASK) == 0);
MOZ_ASSERT(obj != nullptr);
MOZ_ASSERT(((size_t)obj & JSID_TYPE_MASK) == 0);
JSID_BITS(id) = ((size_t)obj | JSID_TYPE_OBJECT);
return id;
}
@ -135,7 +135,7 @@ JSID_TO_GCTHING(jsid id)
static MOZ_ALWAYS_INLINE bool
JSID_IS_VOID(const jsid id)
{
JS_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,
MOZ_ASSERT_IF(((size_t)JSID_BITS(id) & JSID_TYPE_MASK) == JSID_TYPE_VOID,
JSID_BITS(id) == JSID_TYPE_VOID);
return ((size_t)JSID_BITS(id) == JSID_TYPE_VOID);
}

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

@ -51,16 +51,16 @@ class ProfileEntry
// were marked as volatile as well.
bool js() const volatile {
JS_ASSERT_IF(sp == nullptr, script_ != nullptr);
MOZ_ASSERT_IF(sp == nullptr, script_ != nullptr);
return sp == nullptr;
}
uint32_t line() const volatile { JS_ASSERT(!js()); return idx; }
JSScript *script() const volatile { JS_ASSERT(js()); return script_; }
uint32_t line() const volatile { MOZ_ASSERT(!js()); return idx; }
JSScript *script() const volatile { MOZ_ASSERT(js()); return script_; }
void *stackAddress() const volatile { return sp; }
const char *label() const volatile { return string; }
void setLine(uint32_t aLine) volatile { JS_ASSERT(!js()); idx = aLine; }
void setLine(uint32_t aLine) volatile { MOZ_ASSERT(!js()); idx = aLine; }
void setLabel(const char *aString) volatile { string = aString; }
void setStackAddress(void *aSp) volatile { sp = aSp; }
void setScript(JSScript *aScript) volatile { script_ = aScript; }

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

@ -238,7 +238,7 @@ class Heap : public js::HeapBase<T>
}
void set(T newPtr) {
JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
MOZ_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
if (js::GCMethods<T>::needsPostBarrier(newPtr)) {
ptr = newPtr;
post();
@ -252,7 +252,7 @@ class Heap : public js::HeapBase<T>
private:
void init(T newPtr) {
JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
MOZ_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
ptr = newPtr;
if (js::GCMethods<T>::needsPostBarrier(ptr))
post();
@ -260,7 +260,7 @@ class Heap : public js::HeapBase<T>
void post() {
#ifdef JSGC_GENERATIONAL
JS_ASSERT(js::GCMethods<T>::needsPostBarrier(ptr));
MOZ_ASSERT(js::GCMethods<T>::needsPostBarrier(ptr));
js::GCMethods<T>::postBarrier(&ptr);
#endif
}
@ -330,25 +330,25 @@ class TenuredHeap : public js::HeapBase<T>
bool operator!=(const TenuredHeap<T> &other) { return bits != other.bits; }
void setPtr(T newPtr) {
JS_ASSERT((reinterpret_cast<uintptr_t>(newPtr) & flagsMask) == 0);
JS_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
MOZ_ASSERT((reinterpret_cast<uintptr_t>(newPtr) & flagsMask) == 0);
MOZ_ASSERT(!js::GCMethods<T>::poisoned(newPtr));
if (newPtr)
AssertGCThingMustBeTenured(newPtr);
bits = (bits & flagsMask) | reinterpret_cast<uintptr_t>(newPtr);
}
void setFlags(uintptr_t flagsToSet) {
JS_ASSERT((flagsToSet & ~flagsMask) == 0);
MOZ_ASSERT((flagsToSet & ~flagsMask) == 0);
bits |= flagsToSet;
}
void unsetFlags(uintptr_t flagsToUnset) {
JS_ASSERT((flagsToUnset & ~flagsMask) == 0);
MOZ_ASSERT((flagsToUnset & ~flagsMask) == 0);
bits &= ~flagsToUnset;
}
bool hasFlag(uintptr_t flag) const {
JS_ASSERT((flag & ~flagsMask) == 0);
MOZ_ASSERT((flag & ~flagsMask) == 0);
return (bits & flag) != 0;
}
@ -529,7 +529,7 @@ class MOZ_STACK_CLASS MutableHandle : public js::MutableHandleBase<T>
public:
void set(T v) {
JS_ASSERT(!js::GCMethods<T>::poisoned(v));
MOZ_ASSERT(!js::GCMethods<T>::poisoned(v));
*ptr = v;
}
@ -695,7 +695,7 @@ class MOZ_STACK_CLASS Rooted : public js::RootedBase<T>
this->prev = *stack;
*stack = reinterpret_cast<Rooted<void*>*>(this);
JS_ASSERT(!js::GCMethods<T>::poisoned(ptr));
MOZ_ASSERT(!js::GCMethods<T>::poisoned(ptr));
#endif
}
@ -775,7 +775,7 @@ class MOZ_STACK_CLASS Rooted : public js::RootedBase<T>
// using MSVC, see bug 915735 for more details.
#ifdef JSGC_TRACK_EXACT_ROOTS
~Rooted() {
JS_ASSERT(*stack == reinterpret_cast<Rooted<void*>*>(this));
MOZ_ASSERT(*stack == reinterpret_cast<Rooted<void*>*>(this));
*stack = prev;
}
#endif
@ -796,7 +796,7 @@ class MOZ_STACK_CLASS Rooted : public js::RootedBase<T>
const T &get() const { return ptr; }
T &operator=(T value) {
JS_ASSERT(!js::GCMethods<T>::poisoned(value));
MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
ptr = value;
return ptr;
}
@ -807,7 +807,7 @@ class MOZ_STACK_CLASS Rooted : public js::RootedBase<T>
}
void set(T value) {
JS_ASSERT(!js::GCMethods<T>::poisoned(value));
MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
ptr = value;
}
@ -887,7 +887,7 @@ class SkipRoot
public:
~SkipRoot() {
JS_ASSERT(*stack == this);
MOZ_ASSERT(*stack == this);
*stack = prev;
}
@ -1021,13 +1021,13 @@ class FakeRooted : public RootedBase<T>
const T &get() const { return ptr; }
FakeRooted<T> &operator=(T value) {
JS_ASSERT(!GCMethods<T>::poisoned(value));
MOZ_ASSERT(!GCMethods<T>::poisoned(value));
ptr = value;
return *this;
}
FakeRooted<T> &operator=(const FakeRooted<T> &other) {
JS_ASSERT(!GCMethods<T>::poisoned(other.ptr));
MOZ_ASSERT(!GCMethods<T>::poisoned(other.ptr));
ptr = other.ptr;
return *this;
}
@ -1057,7 +1057,7 @@ class FakeMutableHandle : public js::MutableHandleBase<T>
}
void set(T v) {
JS_ASSERT(!js::GCMethods<T>::poisoned(v));
MOZ_ASSERT(!js::GCMethods<T>::poisoned(v));
*ptr = v;
}
@ -1261,7 +1261,7 @@ class PersistentRooted : private mozilla::LinkedListElement<PersistentRooted<T>
const T &get() const { return ptr; }
T &operator=(T value) {
JS_ASSERT(!js::GCMethods<T>::poisoned(value));
MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
ptr = value;
return ptr;
}
@ -1272,7 +1272,7 @@ class PersistentRooted : private mozilla::LinkedListElement<PersistentRooted<T>
}
void set(T value) {
JS_ASSERT(!js::GCMethods<T>::poisoned(value));
MOZ_ASSERT(!js::GCMethods<T>::poisoned(value));
ptr = value;
}

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

@ -42,16 +42,6 @@ namespace js {}
#define JS_ASSERT(expr) MOZ_ASSERT(expr)
#define JS_ASSERT_IF(cond, expr) MOZ_ASSERT_IF(cond, expr)
#define JS_ALWAYS_TRUE(expr) MOZ_ALWAYS_TRUE(expr)
#define JS_ALWAYS_FALSE(expr) MOZ_ALWAYS_FALSE(expr)
#if defined(JS_DEBUG)
# define JS_DIAGNOSTICS_ASSERT(expr) MOZ_ASSERT(expr)
#elif defined(JS_CRASH_DIAGNOSTICS)
# define JS_DIAGNOSTICS_ASSERT(expr) do { if (!(expr)) MOZ_CRASH(); } while(0)
#else
# define JS_DIAGNOSTICS_ASSERT(expr) ((void) 0)
#endif
#define JS_STATIC_ASSERT(cond) static_assert(cond, "JS_STATIC_ASSERT")
#define JS_STATIC_ASSERT_IF(cond, expr) MOZ_STATIC_ASSERT_IF(cond, expr, "JS_STATIC_ASSERT_IF")

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

@ -225,9 +225,10 @@ function isRootedPointerTypeName(name)
function isSuppressConstructor(name)
{
return /::AutoSuppressGC/.test(name)
|| /::AutoEnterAnalysis/.test(name)
|| /::AutoAssertNoGC/.test(name);
return name.indexOf("::AutoSuppressGC") != -1
|| name.indexOf("::AutoEnterAnalysis") != -1
|| name.indexOf("::AutoAssertNoGC") != -1
|| name.indexOf("::AutoIgnoreRootingHazards") != -1;
}
// nsISupports subclasses' methods may be scriptable (or overridden

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

@ -1,5 +1,8 @@
// |jit-test| slow
if (typeof evalInWorker == "undefined")
quit();
gcslice(10);
evalInWorker("print('helo world');");
for (i = 0; i < 100000; i++) {}

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

@ -0,0 +1,4 @@
function h(x) { return +x == x };
h(false)
assertEq(h(null), false);
assertEq(h(null), false);

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

@ -1584,7 +1584,7 @@ MacroAssembler::convertValueToInt(ValueOperand value, MDefinition *maybeInput,
Label done, isInt32, isBool, isDouble, isNull, isString;
branchEqualTypeIfNeeded(MIRType_Int32, maybeInput, tag, &isInt32);
if (conversion == IntConversion_Any)
if (conversion == IntConversion_Any || conversion == IntConversion_NumbersOrBoolsOnly)
branchEqualTypeIfNeeded(MIRType_Boolean, maybeInput, tag, &isBool);
branchEqualTypeIfNeeded(MIRType_Double, maybeInput, tag, &isDouble);

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

@ -1192,6 +1192,7 @@ class MacroAssembler : public MacroAssemblerSpecific
enum IntConversionInputKind {
IntConversion_NumbersOnly,
IntConversion_NumbersOrBoolsOnly,
IntConversion_Any
};

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

@ -235,15 +235,16 @@ ComparePolicy::adjustInputs(TempAllocator &alloc, MInstruction *def)
(compare->compareType() == MCompare::Compare_Int32MaybeCoerceLHS && i == 0) ||
(compare->compareType() == MCompare::Compare_Int32MaybeCoerceRHS && i == 1))
{
convert = MacroAssembler::IntConversion_Any;
convert = MacroAssembler::IntConversion_NumbersOrBoolsOnly;
}
if (convert == MacroAssembler::IntConversion_NumbersOnly) {
if (in->type() != MIRType_Int32 && in->type() != MIRType_Value)
in = boxAt(alloc, def, in);
} else {
if (in->type() == MIRType_Undefined ||
in->type() == MIRType_String ||
in->type() == MIRType_Object)
MOZ_ASSERT(convert == MacroAssembler::IntConversion_NumbersOrBoolsOnly);
if (in->type() != MIRType_Int32 &&
in->type() != MIRType_Boolean &&
in->type() != MIRType_Value)
{
in = boxAt(alloc, def, in);
}

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

@ -13,6 +13,14 @@
using namespace JS;
using namespace js;
struct AutoIgnoreRootingHazards {
// Force a nontrivial destructor so the compiler sees the whole RAII scope
static volatile int depth;
AutoIgnoreRootingHazards() { depth++; }
~AutoIgnoreRootingHazards() { depth--; }
};
volatile int AutoIgnoreRootingHazards::depth = 0;
BEGIN_TEST(testGCStoreBufferRemoval)
{
// Sanity check - objects start in the nursery and then become tenured.
@ -24,12 +32,12 @@ BEGIN_TEST(testGCStoreBufferRemoval)
JS::RootedObject tenuredObject(cx, obj);
// Hide the horrors herein from the static rooting analysis.
typedef JSObject *ObjectPtr;
AutoIgnoreRootingHazards ignore;
// Test removal of store buffer entries added by RelocatablePtr<T>.
{
ObjectPtr badObject = reinterpret_cast<JSObject*>(1);
ObjectPtr punnedPtr = nullptr;
JSObject *badObject = reinterpret_cast<JSObject*>(1);
JSObject *punnedPtr = nullptr;
RelocatablePtrObject* relocPtr =
reinterpret_cast<RelocatablePtrObject*>(&punnedPtr);
new (relocPtr) RelocatablePtrObject;
@ -80,8 +88,8 @@ BEGIN_TEST(testGCStoreBufferRemoval)
// Test removal of store buffer entries added by Heap<T>.
{
ObjectPtr badObject = reinterpret_cast<JSObject*>(1);
ObjectPtr punnedPtr = nullptr;
JSObject *badObject = reinterpret_cast<JSObject*>(1);
JSObject *punnedPtr = nullptr;
Heap<JSObject*>* heapPtr =
reinterpret_cast<Heap<JSObject*>*>(&punnedPtr);
new (heapPtr) Heap<JSObject*>;

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

@ -11,6 +11,7 @@
#ifndef jsutil_h
#define jsutil_h
#include "mozilla/Assertions.h"
#include "mozilla/Compiler.h"
#include "mozilla/GuardObjects.h"
@ -18,6 +19,17 @@
#include "js/Utility.h"
#define JS_ALWAYS_TRUE(expr) MOZ_ALWAYS_TRUE(expr)
#define JS_ALWAYS_FALSE(expr) MOZ_ALWAYS_FALSE(expr)
#if defined(JS_DEBUG)
# define JS_DIAGNOSTICS_ASSERT(expr) MOZ_ASSERT(expr)
#elif defined(JS_CRASH_DIAGNOSTICS)
# define JS_DIAGNOSTICS_ASSERT(expr) do { if (MOZ_UNLIKELY(!(expr))) MOZ_CRASH(); } while(0)
#else
# define JS_DIAGNOSTICS_ASSERT(expr) ((void) 0)
#endif
static MOZ_ALWAYS_INLINE void *
js_memcpy(void *dst_, const void *src_, size_t len)
{

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

@ -2608,6 +2608,7 @@ EvalInFrame(JSContext *cx, unsigned argc, jsval *vp)
return ok;
}
#ifdef JS_THREADSAFE
struct WorkerInput
{
JSRuntime *runtime;
@ -2704,6 +2705,7 @@ EvalInWorker(JSContext *cx, unsigned argc, jsval *vp)
return true;
}
#endif
static bool
ShapeOf(JSContext *cx, unsigned argc, JS::Value *vp)
@ -4269,9 +4271,11 @@ static const JSFunctionSpecWithHelp shell_functions[] = {
" Evaluate 'str' in the nth up frame.\n"
" If 'save' (default false), save the frame chain."),
#ifdef JS_THREADSAFE
JS_FN_HELP("evalInWorker", EvalInWorker, 1, 0,
"evalInWorker(str)",
" Evaluate 'str' in a separate thread with its own runtime.\n"),
#endif
JS_FN_HELP("shapeOf", ShapeOf, 1, 0,
"shapeOf(obj)",
@ -4286,14 +4290,14 @@ static const JSFunctionSpecWithHelp shell_functions[] = {
JS_FN_HELP("arrayInfo", js_ArrayInfo, 1, 0,
"arrayInfo(a1, a2, ...)",
" Report statistics about arrays."),
#endif
#ifdef JS_THREADSAFE
JS_FN_HELP("sleep", Sleep_fn, 1, 0,
"sleep(dt)",
" Sleep for dt seconds."),
#endif
JS_FN_HELP("snarf", Snarf, 1, 0,
"snarf(filename, [\"binary\"])",
" Read filename into returned string. Filename is relative to the current\n"
@ -6053,8 +6057,10 @@ main(int argc, char **argv, char **envp)
KillWatchdog();
#ifdef JS_THREADSAFE
for (size_t i = 0; i < workerThreads.length(); i++)
PR_JoinThread(workerThreads[i]);
#endif
JS_DestroyRuntime(rt);
JS_ShutDown();

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

@ -392,8 +392,8 @@ CloneNonReflectorsRead(JSContext *cx, JSStructuredCloneReader *reader, uint32_t
if (!JS_WrapObject(cx, &reflector))
return nullptr;
JS_ASSERT(WrapperFactory::IsXrayWrapper(reflector) ||
IsReflector(reflector));
MOZ_ASSERT(WrapperFactory::IsXrayWrapper(reflector) ||
IsReflector(reflector));
return reflector;
}

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

@ -378,10 +378,16 @@ XPCWrappedNative::GetNewOrUsed(xpcObjectHelper& helper,
if (parent != plannedParent) {
XPCWrappedNativeScope* betterScope = GetObjectScope(parent);
if (MOZ_UNLIKELY(!betterScope)) {
printf("Uh oh, hit an object without a scope! Crashing shortly.\n");
printf("Object class: %s\n", js::GetObjectClass(parent)->name);
printf("Global class: %s\n", js::GetObjectClass(js::GetGlobalForObjectCrossCompartment(parent))->name);
printf("IsMainThread: %u\n", (uint32_t) NS_IsMainThread());
printf_stderr("Uh oh, hit an object without a scope! Crashing shortly.\n");
printf_stderr("IsMainThread: %u\n", (uint32_t) NS_IsMainThread());
char* className = nullptr;
sciWrapper.GetCallback()->GetClassName(&className);
printf_stderr("SH Class Name: %s\n", className);
nsMemory::Free(className);
printf_stderr("plannedParent object class: %s\n", js::GetObjectClass(plannedParent)->name);
printf_stderr("plannedParent Global class: %s\n", js::GetObjectClass(js::GetGlobalForObjectCrossCompartment(plannedParent))->name);
printf_stderr("parent Object class: %s\n", js::GetObjectClass(parent)->name);
printf_stderr("parent Global class: %s\n", js::GetObjectClass(js::GetGlobalForObjectCrossCompartment(parent))->name);
MOZ_CRASH();
}
if (betterScope != Scope)

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

@ -2180,6 +2180,7 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
bool isStackingContext =
(isPositioned && (disp->mPosition == NS_STYLE_POSITION_STICKY ||
pos->mZIndex.GetUnit() == eStyleUnit_Integer)) ||
(disp->mWillChangeBitField & NS_STYLE_WILL_CHANGE_STACKING_CONTEXT) ||
isVisuallyAtomic || (aFlags & DISPLAY_CHILD_FORCE_STACKING_CONTEXT);
if (isVisuallyAtomic || isPositioned || (!isSVG && disp->IsFloating(child)) ||
@ -5248,12 +5249,12 @@ int32_t nsFrame::ContentIndexInContainer(const nsIFrame* aFrame)
}
/**
* List a frame tree to stdout. Meant to be called from gdb.
* List a frame tree to stderr. Meant to be called from gdb.
*/
void
DebugListFrameTree(nsIFrame* aFrame)
{
((nsFrame*)aFrame)->List(stdout);
((nsFrame*)aFrame)->List(stderr);
}
void
@ -5383,13 +5384,13 @@ nsFrame::MakeFrameName(const nsAString& aType, nsAString& aResult) const
void
nsIFrame::DumpFrameTree()
{
RootFrameList(PresContext(), stdout);
RootFrameList(PresContext(), stderr);
}
void
nsIFrame::DumpFrameTreeLimited()
{
List(stdout);
List(stderr);
}
void

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

@ -2389,7 +2389,8 @@ CSS_PROP_DISPLAY(
mix-blend-mode,
mix_blend_mode,
MixBlendMode,
CSS_PROPERTY_PARSE_VALUE,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
"layout.css.mix-blend-mode.enabled",
VARIANT_HK,
kBlendModeKTable,
@ -2759,7 +2760,9 @@ CSS_PROP_DISPLAY(
position,
position,
Position,
CSS_PROPERTY_PARSE_VALUE,
CSS_PROPERTY_PARSE_VALUE |
// For position: sticky
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
"",
VARIANT_HK,
kPositionKTable,
@ -2974,7 +2977,8 @@ CSS_PROP_DISPLAY(
transform,
Transform,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH,
CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH |
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
"",
0,
nullptr,
@ -3008,7 +3012,8 @@ CSS_PROP_DISPLAY(
perspective,
perspective,
Perspective,
CSS_PROPERTY_PARSE_VALUE,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
"",
VARIANT_NONE | VARIANT_INHERIT | VARIANT_LENGTH | VARIANT_POSITIVE_DIMENSION,
nullptr,
@ -3018,7 +3023,8 @@ CSS_PROP_DISPLAY(
transform-style,
transform_style,
TransformStyle,
CSS_PROPERTY_PARSE_VALUE,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
"",
VARIANT_HK,
kTransformStyleKTable,
@ -3289,7 +3295,8 @@ CSS_PROP_POSITION(
z-index,
z_index,
ZIndex,
CSS_PROPERTY_PARSE_VALUE,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
"",
VARIANT_AHI,
nullptr,
@ -3437,7 +3444,8 @@ CSS_PROP_SVGRESET(
clip-path,
clip_path,
ClipPath,
CSS_PROPERTY_PARSE_VALUE,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
"",
VARIANT_HUO,
nullptr,
@ -3517,7 +3525,8 @@ CSS_PROP_SVGRESET(
filter,
filter,
Filter,
CSS_PROPERTY_PARSE_FUNCTION,
CSS_PROPERTY_PARSE_FUNCTION |
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
"",
0,
nullptr,
@ -3603,7 +3612,8 @@ CSS_PROP_SVGRESET(
mask,
mask,
Mask,
CSS_PROPERTY_PARSE_VALUE,
CSS_PROPERTY_PARSE_VALUE |
CSS_PROPERTY_CREATES_STACKING_CONTEXT,
"",
VARIANT_HUO,
nullptr,

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

@ -191,6 +191,9 @@ static_assert((CSS_PROPERTY_PARSE_PROPERTY_MASK &
// flushed.
#define CSS_PROPERTY_GETCS_NEEDS_LAYOUT_FLUSH (1<<20)
// This property requires a stacking context.
#define CSS_PROPERTY_CREATES_STACKING_CONTEXT (1<<21)
/**
* Types of animatable values.
*/

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

@ -5477,6 +5477,8 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
if (item->mValue.UnitHasStringValue()) {
nsAutoString buffer;
item->mValue.GetStringValue(buffer);
display->mWillChange.AppendElement(buffer);
if (buffer.EqualsLiteral("transform")) {
display->mWillChangeBitField |= NS_STYLE_WILL_CHANGE_TRANSFORM;
}
@ -5486,7 +5488,13 @@ nsRuleNode::ComputeDisplayData(void* aStartStruct,
if (buffer.EqualsLiteral("scroll-position")) {
display->mWillChangeBitField |= NS_STYLE_WILL_CHANGE_SCROLL;
}
display->mWillChange.AppendElement(buffer);
nsCSSProperty prop =
nsCSSProps::LookupProperty(buffer, nsCSSProps::eEnabled);
if (nsCSSProps::PropHasFlags(prop,
CSS_PROPERTY_CREATES_STACKING_CONTEXT)) {
display->mWillChangeBitField |= NS_STYLE_WILL_CHANGE_STACKING_CONTEXT;
}
}
}
break;

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

@ -212,9 +212,10 @@ static inline mozilla::css::Side operator++(mozilla::css::Side& side, int) {
#define NS_COLOR_CONTEXT_STROKE -8
// See nsStyleDisplay
#define NS_STYLE_WILL_CHANGE_TRANSFORM (1<<0)
#define NS_STYLE_WILL_CHANGE_SCROLL (1<<1)
#define NS_STYLE_WILL_CHANGE_OPACITY (1<<2)
#define NS_STYLE_WILL_CHANGE_STACKING_CONTEXT (1<<0)
#define NS_STYLE_WILL_CHANGE_TRANSFORM (1<<1)
#define NS_STYLE_WILL_CHANGE_SCROLL (1<<2)
#define NS_STYLE_WILL_CHANGE_OPACITY (1<<3)
// See nsStyleDisplay
#define NS_STYLE_ANIMATION_DIRECTION_NORMAL 0

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

@ -2467,7 +2467,13 @@ nsChangeHint nsStyleDisplay::CalcDifference(const nsStyleDisplay& aOther) const
NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
}
if (mWillChangeBitField != aOther.mWillChangeBitField) {
uint8_t willChangeBitsChanged =
mWillChangeBitField ^ aOther.mWillChangeBitField;
if (willChangeBitsChanged & NS_STYLE_WILL_CHANGE_STACKING_CONTEXT) {
NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
}
if (willChangeBitsChanged & ~uint8_t(NS_STYLE_WILL_CHANGE_STACKING_CONTEXT)) {
// FIXME (Bug 974125): Don't reconstruct the frame
NS_UpdateHint(hint, nsChangeHint_ReconstructFrame);
}

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

@ -1801,10 +1801,12 @@ struct nsStyleDisplay {
uint8_t mClipFlags; // [reset] see nsStyleConsts.h
uint8_t mOrient; // [reset] see nsStyleConsts.h
uint8_t mMixBlendMode; // [reset] see nsStyleConsts.h
uint8_t mWillChangeBitField; // [reset] see nsStyleConsts.h. Stores a bitfield
// representation of the property that
// are frequently queried. This should match
// mWillChange
uint8_t mWillChangeBitField; // [reset] see nsStyleConsts.h. Stores a
// bitfield representation of the properties
// that are frequently queried. This should
// match mWillChange. Also tracks if any of the
// properties in the will-change list require
// a stacking context.
nsAutoTArray<nsString, 1> mWillChange;
uint8_t mTouchAction; // [reset] see nsStyleConsts.h

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

@ -3539,7 +3539,7 @@ ShouldPaintCaret(const TextRenderedRun& aThisRun, nsCaret* aCaret)
return false;
}
NS_IMETHODIMP
nsresult
SVGTextFrame::PaintSVG(nsRenderingContext* aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot)
@ -3674,7 +3674,7 @@ SVGTextFrame::PaintSVG(nsRenderingContext* aContext,
return NS_OK;
}
NS_IMETHODIMP_(nsIFrame*)
nsIFrame*
SVGTextFrame::GetFrameForPoint(const nsPoint& aPoint)
{
NS_ASSERTION(GetFirstPrincipalChild(), "must have a child frame");
@ -3718,7 +3718,7 @@ SVGTextFrame::GetFrameForPoint(const nsPoint& aPoint)
return hit;
}
NS_IMETHODIMP_(nsRect)
nsRect
SVGTextFrame::GetCoveredRegion()
{
return nsSVGUtils::TransformFrameRectToOuterSVG(

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

@ -314,12 +314,12 @@ public:
// nsISVGChildFrame interface:
virtual void NotifySVGChanged(uint32_t aFlags) MOZ_OVERRIDE;
NS_IMETHOD PaintSVG(nsRenderingContext* aContext,
const nsIntRect* aDirtyRect,
nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
NS_IMETHOD_(nsIFrame*) GetFrameForPoint(const nsPoint& aPoint) MOZ_OVERRIDE;
virtual nsresult PaintSVG(nsRenderingContext* aContext,
const nsIntRect* aDirtyRect,
nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
virtual nsIFrame* GetFrameForPoint(const nsPoint& aPoint) MOZ_OVERRIDE;
virtual void ReflowSVG() MOZ_OVERRIDE;
NS_IMETHOD_(nsRect) GetCoveredRegion() MOZ_OVERRIDE;
virtual nsRect GetCoveredRegion() MOZ_OVERRIDE;
virtual SVGBBox GetBBoxContribution(const Matrix& aToBBoxUserspace,
uint32_t aFlags) MOZ_OVERRIDE;

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

@ -58,18 +58,18 @@ public:
// so the element's full transform needs to be applied; but we don't want to
// apply transforms from outside the actual glyph element, so we need to know
// how far up the ancestor chain to go.
NS_IMETHOD PaintSVG(nsRenderingContext* aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot = nullptr) = 0;
virtual nsresult PaintSVG(nsRenderingContext* aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot = nullptr) = 0;
// Check if this frame or children contain the given point,
// specified in app units relative to the origin of the outer
// svg frame (origin ill-defined in the case of borders - bug
// 290770). See bug 290852 for foreignObject complications.
NS_IMETHOD_(nsIFrame*) GetFrameForPoint(const nsPoint &aPoint)=0;
virtual nsIFrame* GetFrameForPoint(const nsPoint &aPoint)=0;
// Get bounds in our nsSVGOuterSVGFrame's coordinates space (in app units)
NS_IMETHOD_(nsRect) GetCoveredRegion()=0;
virtual nsRect GetCoveredRegion()=0;
// Called on SVG child frames (except NS_FRAME_IS_NONDISPLAY frames)
// to update and then invalidate their cached bounds. This method is not
@ -141,7 +141,7 @@ public:
uint32_t aFlags) = 0;
// Are we a container frame?
NS_IMETHOD_(bool) IsDisplayContainer()=0;
virtual bool IsDisplayContainer()=0;
};
#endif // __NS_ISVGCHILDFRAME_H__

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

@ -146,6 +146,7 @@ nsSVGDisplayContainerFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsRect& aDirtyRect,
const nsDisplayListSet& aLists)
{
// mContent could be a XUL element so check for an SVG element before casting
if (mContent->IsSVG() &&
!static_cast<const nsSVGElement*>(mContent)->HasValidDimensions()) {
return;
@ -233,6 +234,7 @@ nsSVGDisplayContainerFrame::IsSVGTransformed(gfx::Matrix *aOwnTransform,
HasChildrenOnlyTransform(aFromParentTransform);
}
// mContent could be a XUL element so check for an SVG element before casting
if (mContent->IsSVG()) {
nsSVGElement *content = static_cast<nsSVGElement*>(mContent);
nsSVGAnimatedTransformList* transformList =
@ -252,7 +254,7 @@ nsSVGDisplayContainerFrame::IsSVGTransformed(gfx::Matrix *aOwnTransform,
//----------------------------------------------------------------------
// nsISVGChildFrame methods
NS_IMETHODIMP
nsresult
nsSVGDisplayContainerFrame::PaintSVG(nsRenderingContext* aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot)
@ -275,7 +277,7 @@ nsSVGDisplayContainerFrame::PaintSVG(nsRenderingContext* aContext,
return NS_OK;
}
NS_IMETHODIMP_(nsIFrame*)
nsIFrame*
nsSVGDisplayContainerFrame::GetFrameForPoint(const nsPoint &aPoint)
{
NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
@ -285,7 +287,7 @@ nsSVGDisplayContainerFrame::GetFrameForPoint(const nsPoint &aPoint)
return nsSVGUtils::HitTestChildren(this, aPoint);
}
NS_IMETHODIMP_(nsRect)
nsRect
nsSVGDisplayContainerFrame::GetCoveredRegion()
{
return nsSVGUtils::GetCoveredRegion(mFrames);
@ -399,10 +401,13 @@ nsSVGDisplayContainerFrame::GetBBoxContribution(
nsIFrame* kid = mFrames.FirstChild();
while (kid) {
nsIContent *content = kid->GetContent();
nsISVGChildFrame* svgKid = do_QueryFrame(kid);
if (svgKid) {
// content could be a XUL element so check for an SVG element before casting
if (svgKid && (!content->IsSVG() ||
static_cast<const nsSVGElement*>(content)->HasValidDimensions())) {
gfxMatrix transform = gfx::ThebesMatrix(aToBBoxUserspace);
nsIContent *content = kid->GetContent();
if (content->IsSVG()) {
transform = static_cast<nsSVGElement*>(content)->
PrependLocalTransformsTo(transform);

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

@ -145,16 +145,16 @@ public:
Matrix *aFromParentTransform = nullptr) const MOZ_OVERRIDE;
// nsISVGChildFrame interface:
NS_IMETHOD PaintSVG(nsRenderingContext* aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
NS_IMETHOD_(nsIFrame*) GetFrameForPoint(const nsPoint &aPoint) MOZ_OVERRIDE;
NS_IMETHOD_(nsRect) GetCoveredRegion() MOZ_OVERRIDE;
virtual nsresult PaintSVG(nsRenderingContext* aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
virtual nsIFrame* GetFrameForPoint(const nsPoint &aPoint) MOZ_OVERRIDE;
virtual nsRect GetCoveredRegion() MOZ_OVERRIDE;
virtual void ReflowSVG() MOZ_OVERRIDE;
virtual void NotifySVGChanged(uint32_t aFlags) MOZ_OVERRIDE;
virtual SVGBBox GetBBoxContribution(const Matrix &aToBBoxUserspace,
uint32_t aFlags) MOZ_OVERRIDE;
NS_IMETHOD_(bool) IsDisplayContainer() MOZ_OVERRIDE { return true; }
virtual bool IsDisplayContainer() MOZ_OVERRIDE { return true; }
};
#endif

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

@ -191,7 +191,7 @@ nsSVGForeignObjectFrame::IsSVGTransformed(Matrix *aOwnTransform,
return foundTransform;
}
NS_IMETHODIMP
nsresult
nsSVGForeignObjectFrame::PaintSVG(nsRenderingContext *aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot)
@ -280,7 +280,7 @@ nsSVGForeignObjectFrame::PaintSVG(nsRenderingContext *aContext,
return rv;
}
NS_IMETHODIMP_(nsIFrame*)
nsIFrame*
nsSVGForeignObjectFrame::GetFrameForPoint(const nsPoint &aPoint)
{
NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
@ -323,7 +323,7 @@ nsSVGForeignObjectFrame::GetFrameForPoint(const nsPoint &aPoint)
return nullptr;
}
NS_IMETHODIMP_(nsRect)
nsRect
nsSVGForeignObjectFrame::GetCoveredRegion()
{
float x, y, w, h;

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

@ -76,16 +76,16 @@ public:
#endif
// nsISVGChildFrame interface:
NS_IMETHOD PaintSVG(nsRenderingContext *aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
NS_IMETHOD_(nsIFrame*) GetFrameForPoint(const nsPoint &aPoint) MOZ_OVERRIDE;
NS_IMETHOD_(nsRect) GetCoveredRegion() MOZ_OVERRIDE;
virtual nsresult PaintSVG(nsRenderingContext *aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
virtual nsIFrame* GetFrameForPoint(const nsPoint &aPoint) MOZ_OVERRIDE;
virtual nsRect GetCoveredRegion() MOZ_OVERRIDE;
virtual void ReflowSVG() MOZ_OVERRIDE;
virtual void NotifySVGChanged(uint32_t aFlags) MOZ_OVERRIDE;
virtual SVGBBox GetBBoxContribution(const Matrix &aToBBoxUserspace,
uint32_t aFlags) MOZ_OVERRIDE;
NS_IMETHOD_(bool) IsDisplayContainer() MOZ_OVERRIDE { return true; }
virtual bool IsDisplayContainer() MOZ_OVERRIDE { return true; }
gfxMatrix GetCanvasTM(uint32_t aFor, nsIFrame* aTransformRoot = nullptr);

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

@ -57,9 +57,10 @@ public:
NS_DECL_FRAMEARENA_HELPERS
// nsISVGChildFrame interface:
NS_IMETHOD PaintSVG(nsRenderingContext *aContext, const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot) MOZ_OVERRIDE;
NS_IMETHOD_(nsIFrame*) GetFrameForPoint(const nsPoint &aPoint);
virtual nsresult PaintSVG(nsRenderingContext *aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot) MOZ_OVERRIDE;
virtual nsIFrame* GetFrameForPoint(const nsPoint &aPoint);
virtual void ReflowSVG();
// nsSVGPathGeometryFrame methods:
@ -294,7 +295,7 @@ nsSVGImageFrame::TransformContextForPainting(gfxContext* aGfxContext,
//----------------------------------------------------------------------
// nsISVGChildFrame methods:
NS_IMETHODIMP
nsresult
nsSVGImageFrame::PaintSVG(nsRenderingContext *aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot)
@ -409,7 +410,7 @@ nsSVGImageFrame::PaintSVG(nsRenderingContext *aContext,
return rv;
}
NS_IMETHODIMP_(nsIFrame*)
nsIFrame*
nsSVGImageFrame::GetFrameForPoint(const nsPoint &aPoint)
{
// Special case for raster images -- we only want to accept points that fall

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

@ -57,7 +57,7 @@ nsSVGInnerSVGFrame::GetType() const
//----------------------------------------------------------------------
// nsISVGChildFrame methods
NS_IMETHODIMP
nsresult
nsSVGInnerSVGFrame::PaintSVG(nsRenderingContext *aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot)
@ -225,7 +225,7 @@ nsSVGInnerSVGFrame::AttributeChanged(int32_t aNameSpaceID,
return NS_OK;
}
NS_IMETHODIMP_(nsIFrame*)
nsIFrame*
nsSVGInnerSVGFrame::GetFrameForPoint(const nsPoint &aPoint)
{
NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||

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

@ -53,12 +53,12 @@ public:
int32_t aModType) MOZ_OVERRIDE;
// nsISVGChildFrame interface:
NS_IMETHOD PaintSVG(nsRenderingContext *aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
virtual nsresult PaintSVG(nsRenderingContext *aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
virtual void ReflowSVG() MOZ_OVERRIDE;
virtual void NotifySVGChanged(uint32_t aFlags) MOZ_OVERRIDE;
NS_IMETHOD_(nsIFrame*) GetFrameForPoint(const nsPoint &aPoint) MOZ_OVERRIDE;
virtual nsIFrame* GetFrameForPoint(const nsPoint &aPoint) MOZ_OVERRIDE;
// nsSVGContainerFrame methods:
virtual gfxMatrix GetCanvasTM(uint32_t aFor,

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

@ -789,7 +789,7 @@ nsSVGOuterSVGFrame::NotifyViewportOrTransformChanged(uint32_t aFlags)
//----------------------------------------------------------------------
// nsISVGChildFrame methods:
NS_IMETHODIMP
nsresult
nsSVGOuterSVGFrame::PaintSVG(nsRenderingContext* aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot)

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

@ -109,9 +109,9 @@ public:
virtual void NotifyViewportOrTransformChanged(uint32_t aFlags) MOZ_OVERRIDE;
// nsISVGChildFrame methods:
NS_IMETHOD PaintSVG(nsRenderingContext* aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
virtual nsresult PaintSVG(nsRenderingContext* aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
virtual SVGBBox GetBBoxContribution(const Matrix &aToBBoxUserspace,
uint32_t aFlags) MOZ_OVERRIDE;

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

@ -197,7 +197,7 @@ nsSVGPathGeometryFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
//----------------------------------------------------------------------
// nsISVGChildFrame methods
NS_IMETHODIMP
nsresult
nsSVGPathGeometryFrame::PaintSVG(nsRenderingContext *aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot)
@ -231,7 +231,7 @@ nsSVGPathGeometryFrame::PaintSVG(nsRenderingContext *aContext,
return NS_OK;
}
NS_IMETHODIMP_(nsIFrame*)
nsIFrame*
nsSVGPathGeometryFrame::GetFrameForPoint(const nsPoint &aPoint)
{
gfxMatrix canvasTM = GetCanvasTM(FOR_HIT_TESTING);
@ -287,7 +287,7 @@ nsSVGPathGeometryFrame::GetFrameForPoint(const nsPoint &aPoint)
return nullptr;
}
NS_IMETHODIMP_(nsRect)
nsRect
nsSVGPathGeometryFrame::GetCoveredRegion()
{
return nsSVGUtils::TransformFrameRectToOuterSVG(

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

@ -93,16 +93,16 @@ public:
nsIFrame* aTransformRoot = nullptr);
protected:
// nsISVGChildFrame interface:
NS_IMETHOD PaintSVG(nsRenderingContext *aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
NS_IMETHOD_(nsIFrame*) GetFrameForPoint(const nsPoint &aPoint) MOZ_OVERRIDE;
NS_IMETHOD_(nsRect) GetCoveredRegion() MOZ_OVERRIDE;
virtual nsresult PaintSVG(nsRenderingContext *aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot = nullptr) MOZ_OVERRIDE;
virtual nsIFrame* GetFrameForPoint(const nsPoint &aPoint) MOZ_OVERRIDE;
virtual nsRect GetCoveredRegion() MOZ_OVERRIDE;
virtual void ReflowSVG() MOZ_OVERRIDE;
virtual void NotifySVGChanged(uint32_t aFlags) MOZ_OVERRIDE;
virtual SVGBBox GetBBoxContribution(const Matrix &aToBBoxUserspace,
uint32_t aFlags) MOZ_OVERRIDE;
NS_IMETHOD_(bool) IsDisplayContainer() MOZ_OVERRIDE { return false; }
virtual bool IsDisplayContainer() MOZ_OVERRIDE { return false; }
void GeneratePath(gfxContext *aContext, const Matrix &aTransform);
/**

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

@ -52,11 +52,11 @@ public:
const nsDisplayListSet& aLists) MOZ_OVERRIDE;
// nsISVGChildFrame interface:
NS_IMETHOD PaintSVG(nsRenderingContext* aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot) MOZ_OVERRIDE;
NS_IMETHODIMP_(nsIFrame*) GetFrameForPoint(const nsPoint &aPoint);
NS_IMETHODIMP_(nsRect) GetCoveredRegion();
virtual nsresult PaintSVG(nsRenderingContext* aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot) MOZ_OVERRIDE;
nsIFrame* GetFrameForPoint(const nsPoint &aPoint);
nsRect GetCoveredRegion();
virtual void ReflowSVG();
virtual SVGBBox GetBBoxContribution(const Matrix &aToBBoxUserspace,
uint32_t aFlags);
@ -106,7 +106,7 @@ nsSVGSwitchFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
}
}
NS_IMETHODIMP
nsresult
nsSVGSwitchFrame::PaintSVG(nsRenderingContext* aContext,
const nsIntRect *aDirtyRect,
nsIFrame* aTransformRoot)
@ -127,7 +127,7 @@ nsSVGSwitchFrame::PaintSVG(nsRenderingContext* aContext,
}
NS_IMETHODIMP_(nsIFrame*)
nsIFrame*
nsSVGSwitchFrame::GetFrameForPoint(const nsPoint &aPoint)
{
NS_ASSERTION(!NS_SVGDisplayListHitTestingEnabled() ||
@ -146,7 +146,7 @@ nsSVGSwitchFrame::GetFrameForPoint(const nsPoint &aPoint)
return nullptr;
}
NS_IMETHODIMP_(nsRect)
nsRect
nsSVGSwitchFrame::GetCoveredRegion()
{
nsRect rect;

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

@ -253,13 +253,14 @@ class B2GRemoteReftest(RefTest):
sys.exit(5)
# Delete any bundled extensions
extensionDir = os.path.join(profileDir, 'extensions', 'staged')
for filename in os.listdir(extensionDir):
try:
self._devicemanager._checkCmdAs(['shell', 'rm', '-rf',
os.path.join(self.bundlesDir, filename)])
except DMError:
pass
if profileDir:
extensionDir = os.path.join(profileDir, 'extensions', 'staged')
for filename in os.listdir(extensionDir):
try:
self._devicemanager._checkCmd(['shell', 'rm', '-rf',
os.path.join(self.bundlesDir, filename)])
except DMError:
pass
# Restore the original profiles.ini.
if self.originalProfilesIni:
@ -276,8 +277,8 @@ class B2GRemoteReftest(RefTest):
self._devicemanager.removeDir(self.remoteTestRoot)
# Restore the original user.js.
self._devicemanager._checkCmdAs(['shell', 'rm', '-f', self.userJS])
self._devicemanager._checkCmdAs(['shell', 'dd', 'if=%s.orig' % self.userJS, 'of=%s' % self.userJS])
self._devicemanager._checkCmd(['shell', 'rm', '-f', self.userJS])
self._devicemanager._checkCmd(['shell', 'dd', 'if=%s.orig' % self.userJS, 'of=%s' % self.userJS])
# We've restored the original profile, so reboot the device so that
# it gets picked up.
@ -441,9 +442,9 @@ class B2GRemoteReftest(RefTest):
# Copy the extensions to the B2G bundles dir.
extensionDir = os.path.join(profileDir, 'extensions', 'staged')
# need to write to read-only dir
self._devicemanager._checkCmdAs(['remount'])
self._devicemanager._checkCmd(['remount'])
for filename in os.listdir(extensionDir):
self._devicemanager._checkCmdAs(['shell', 'rm', '-rf',
self._devicemanager._checkCmd(['shell', 'rm', '-rf',
os.path.join(self.bundlesDir, filename)])
try:
self._devicemanager.pushDir(extensionDir, self.bundlesDir)
@ -453,8 +454,8 @@ class B2GRemoteReftest(RefTest):
# In B2G, user.js is always read from /data/local, not the profile
# directory. Backup the original user.js first so we can restore it.
self._devicemanager._checkCmdAs(['shell', 'rm', '-f', '%s.orig' % self.userJS])
self._devicemanager._checkCmdAs(['shell', 'dd', 'if=%s' % self.userJS, 'of=%s.orig' % self.userJS])
self._devicemanager._checkCmd(['shell', 'rm', '-f', '%s.orig' % self.userJS])
self._devicemanager._checkCmd(['shell', 'dd', 'if=%s' % self.userJS, 'of=%s.orig' % self.userJS])
self._devicemanager.pushFile(os.path.join(profileDir, "user.js"), self.userJS)
self.updateProfilesIni(self.remoteProfile)

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

@ -2180,6 +2180,7 @@ abstract public class BrowserApp extends GeckoApp
}
bookmark.setEnabled(!AboutPages.isAboutReader(tab.getURL()));
bookmark.setVisible(!GeckoProfile.get(this).inGuestMode());
bookmark.setCheckable(true);
bookmark.setChecked(tab.isBookmark());
bookmark.setIcon(tab.isBookmark() ? R.drawable.ic_menu_bookmark_remove : R.drawable.ic_menu_bookmark_add);

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

@ -702,6 +702,8 @@ public class BrowserProvider extends TransactionalProvider<BrowserDatabaseHelper
// extend it to look like
//
// SELECT COALESCE((SELECT ...), 0) | COALESCE(...) | ...
final boolean includeDeleted = shouldShowDeleted(uri);
final String query = "SELECT COALESCE(SUM(flag), 0) AS flags " +
"FROM ( SELECT DISTINCT CASE" +
" WHEN " + Bookmarks.PARENT + " = " + Bookmarks.FIXED_READING_LIST_ID +
@ -712,7 +714,9 @@ public class BrowserProvider extends TransactionalProvider<BrowserDatabaseHelper
" ELSE " + Bookmarks.FLAG_BOOKMARK +
" END flag " +
"FROM " + TABLE_BOOKMARKS + " WHERE " + Bookmarks.URL + " = ? " +
"FROM " + TABLE_BOOKMARKS + " WHERE " +
Bookmarks.URL + " = ? " +
(includeDeleted ? "" : ("AND " + Bookmarks.IS_DELETED + " = 0")) +
")";
return db.rawQuery(query, selectionArgs);

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

@ -103,7 +103,7 @@ public class Prompt implements OnClickListener, OnCancelListener, OnItemClickLis
// Don't add padding to color picker views
if (input.canApplyInputStyle()) {
view.setPadding(mInputPaddingSize, 0, mInputPaddingSize, 0);
}
}
return view;
}
@ -314,6 +314,20 @@ public class Prompt implements OnClickListener, OnCancelListener, OnItemClickLis
mSelected = null;
}
/* Wraps an input in a linearlayout. We do this so that we can set padding that appears outside the background
* drawable for the view.
*/
private View wrapInput(final PromptInput input) {
final LinearLayout linearLayout = new LinearLayout(mContext);
linearLayout.setOrientation(LinearLayout.VERTICAL);
applyInputStyle(linearLayout, input);
linearLayout.addView(input.getView(mContext));
return linearLayout;
}
/* Add the requested input elements to the dialog.
*
* @param builder
@ -333,18 +347,18 @@ public class Prompt implements OnClickListener, OnCancelListener, OnItemClickLis
boolean scrollable = false; // If any of the innuts are scrollable, we won't wrap this in a ScrollView
if (length == 1) {
root = mInputs[0].getView(mContext);
applyInputStyle(root, mInputs[0]);
root = wrapInput(mInputs[0]);
scrollable |= mInputs[0].getScrollable();
} else if (length > 1) {
LinearLayout linearLayout = new LinearLayout(mContext);
linearLayout.setOrientation(LinearLayout.VERTICAL);
for (int i = 0; i < length; i++) {
View content = mInputs[i].getView(mContext);
applyInputStyle(content, mInputs[i]);
View content = wrapInput(mInputs[i]);
linearLayout.addView(content);
scrollable |= mInputs[i].getScrollable();
}
root = linearLayout;
}

Двоичные данные
mobile/android/base/resources/drawable-hdpi-v19/toast.9.png Normal file

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

После

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

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

После

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

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

@ -0,0 +1,20 @@
<!--
Copyright 2012 Roman Nurik
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:drawable="@drawable/toast_button_pressed" android:state_pressed="true"/>
<item android:drawable="@drawable/toast_button_pressed" android:state_focused="true"/>
<item android:drawable="@android:color/transparent"/>
</selector>

Двоичные данные
mobile/android/base/resources/drawable-xhdpi-v19/toast.9.png Normal file

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

После

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

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

После

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

Двоичные данные
mobile/android/base/resources/drawable-xxhdpi-v19/toast.9.png Normal file

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

После

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

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

После

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

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

@ -28,7 +28,7 @@
<item name="topDivider">true</item>
</style>
<style name="Widget.HomeGridView" parent="Widget.GridView">
<style name="Widget.TopSitesGridView" parent="Widget.GridView">
<item name="android:paddingLeft">55dp</item>
<item name="android:paddingRight">55dp</item>
<item name="android:paddingBottom">30dp</item>
@ -36,8 +36,6 @@
<item name="android:verticalSpacing">20dp</item>
</style>
<style name="Widget.TopSitesGridView" parent="Widget.HomeGridView" />
<style name="Widget.Home.HistoryListView">
<item name="android:paddingLeft">50dp</item>
<item name="android:paddingRight">100dp</item>

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

@ -77,7 +77,7 @@
<item name="topDivider">true</item>
</style>
<style name="Widget.HomeGridView" parent="Widget.GridView">
<style name="Widget.TopSitesGridView" parent="Widget.GridView">
<item name="android:paddingLeft">5dp</item>
<item name="android:paddingRight">5dp</item>
<item name="android:paddingBottom">30dp</item>
@ -85,8 +85,6 @@
<item name="android:verticalSpacing">10dp</item>
</style>
<style name="Widget.TopSitesGridView" parent="Widget.HomeGridView" />
<style name="Widget.TopSitesListView" parent="Widget.BookmarksListView">
<item name="topDivider">false</item>
</style>

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

@ -0,0 +1,36 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<resources xmlns:android="http://schemas.android.com/apk/res/android">
<style name="ToastMessage">
<item name="android:textSize">16sp</item>
<item name="android:fontFamily">sans-serif-condensed</item>
<item name="android:textColor">#ffffff</item>
<item name="android:shadowColor">#BB000000</item>
<item name="android:shadowRadius">2.75</item>
<item name="android:layout_width">0dp</item>
<item name="android:layout_weight">1</item>
<item name="android:layout_height">wrap_content</item>
<item name="android:layout_gravity">center_vertical</item>
<item name="android:paddingLeft">@dimen/toast_button_padding</item>
<item name="android:layout_marginLeft">8dp</item>
</style>
<style name="ToastButton">
<item name="android:background">@drawable/toast_button</item>
<item name="android:textSize">16sp</item>
<item name="android:fontFamily">sans-serif-condensed</item>
<item name="android:textColor">#ffffff</item>
<item name="android:shadowColor">#BB000000</item>
<item name="android:shadowRadius">2.75</item>
<item name="android:layout_width">wrap_content</item>
<item name="android:layout_height">match_parent</item>
<item name="android:paddingLeft">16dp</item>
<item name="android:maxWidth">160dp</item>
<item name="android:layout_gravity">center_vertical</item>
</style>
</resources>

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

@ -5,7 +5,7 @@
<resources>
<style name="Widget.HomeGridView" parent="Widget.GridView">
<style name="Widget.TopSitesGridView" parent="Widget.GridView">
<item name="android:paddingLeft">55dp</item>
<item name="android:paddingRight">55dp</item>
<item name="android:paddingBottom">30dp</item>
@ -13,8 +13,6 @@
<item name="android:verticalSpacing">20dp</item>
</style>
<style name="Widget.TopSitesGridView" parent="Widget.HomeGridView" />
<style name="Widget.Home.HistoryListView">
<item name="android:paddingLeft">50dp</item>
<item name="android:paddingRight">100dp</item>

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

@ -35,9 +35,6 @@
<!-- Default style for the TopSitesGridItemView -->
<attr name="topSitesGridItemViewStyle" format="reference" />
<!-- Default style for the HomeGridView -->
<attr name="homeGridViewStyle" format="reference" />
<!-- Style for the PanelGridView -->
<attr name="panelGridViewStyle" format="reference" />

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

@ -145,14 +145,12 @@
<item name="android:ellipsize">end</item>
</style>
<style name="Widget.HomeGridView" parent="Widget.GridView">
<style name="Widget.TopSitesGridView" parent="Widget.GridView">
<item name="android:padding">7dp</item>
<item name="android:horizontalSpacing">0dp</item>
<item name="android:verticalSpacing">7dp</item>
</style>
<style name="Widget.TopSitesGridView" parent="Widget.HomeGridView" />
<style name="Widget.TopSitesGridItemView">
<item name="android:layout_width">fill_parent</item>
<item name="android:layout_height">fill_parent</item>
@ -169,6 +167,7 @@
<item name="android:columnWidth">@dimen/panel_grid_view_column_width</item>
<item name="android:horizontalSpacing">2dp</item>
<item name="android:verticalSpacing">2dp</item>
<item name="android:drawSelectorOnTop">true</item>
</style>
<style name="Widget.BookmarkItemView" parent="Widget.TwoLineRow"/>

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