Merging mozilla-central to mozilla-inbound.

This commit is contained in:
Mounir Lamouri 2011-08-31 17:59:12 +02:00
commit 4debd61099
47 changed files with 636 additions and 85 deletions

View File

@ -179,6 +179,7 @@
@BINPATH@/components/jar.xpt
@BINPATH@/components/jetpack.xpt
@BINPATH@/components/jsdservice.xpt
@BINPATH@/components/jsdebugger.xpt
@BINPATH@/components/layout_base.xpt
@BINPATH@/components/layout_forms.xpt
#ifdef NS_PRINTING

View File

@ -1044,6 +1044,14 @@ nsGeolocation::WindowOwnerStillExists()
bool
nsGeolocation::RegisterRequestWithPrompt(nsGeolocationRequest* request)
{
if (Preferences::GetBool("geo.prompt.testing", PR_FALSE)) {
nsCOMPtr<nsIRunnable> ev =
new RequestAllowEvent(Preferences::GetBool("geo.prompt.testing.allow",
PR_FALSE), request);
NS_DispatchToMainThread(ev);
return true;
}
if (XRE_GetProcessType() == GeckoProcessType_Content) {
nsCOMPtr<nsPIDOMWindow> window = do_QueryReferent(mOwner);
if (!window)
@ -1066,14 +1074,6 @@ nsGeolocation::RegisterRequestWithPrompt(nsGeolocationRequest* request)
return true;
}
if (Preferences::GetBool("geo.prompt.testing", PR_FALSE)) {
nsCOMPtr<nsIRunnable> ev =
new RequestAllowEvent(Preferences::GetBool("geo.prompt.testing.allow",
PR_FALSE), request);
NS_DispatchToMainThread(ev);
return true;
}
nsCOMPtr<nsIRunnable> ev = new RequestPromptEvent(request);
NS_DispatchToMainThread(ev);
return true;

View File

@ -10,7 +10,7 @@
#endif
>
<uses-sdk android:minSdkVersion="5"
android:targetSdkVersion="5"/>
android:targetSdkVersion="11"/>
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>

View File

@ -110,7 +110,7 @@ SourceSurfaceCG::InitFromData(unsigned char *aData,
};
void *data = malloc(aStride * aSize.height);
memcpy(aData, data, aStride * aSize.height);
memcpy(data, aData, aStride * aSize.height);
mFormat = aFormat;

View File

@ -135,6 +135,7 @@ public:
#endif
#include "gfxUtils.h"
#include "gfxFailure.h"
#include "gfxASurface.h"
#include "gfxImageSurface.h"
#include "gfxPlatform.h"
@ -708,7 +709,13 @@ public:
return PR_FALSE;
}
MakeCurrent();
PRBool current = MakeCurrent();
if (!current) {
gfx::LogFailure(NS_LITERAL_CSTRING(
"Couldn't get device attachments for device."));
return PR_FALSE;
}
PRBool ok = InitWithPrefix("gl", PR_TRUE);
#if 0
if (ok) {

49
js/ductwork/Makefile.in Normal file
View File

@ -0,0 +1,49 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Mozilla Browser code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 2011
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Jason Orendorff <jorendorff@mozilla.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
include $(topsrcdir)/config/config.mk
PARALLEL_DIRS += \
debugger \
$(NULL)
include $(topsrcdir)/config/rules.mk

View File

@ -1,7 +1,4 @@
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
* vim: set ts=8 sw=4 et tw=78:
*
* ***** BEGIN LICENSE BLOCK *****
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
@ -14,18 +11,19 @@
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is Mozilla SpiderMonkey JavaScript 1.8 code, released
* March 4, 2008.
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* Igor Bukanov <igor@mir2.org>
* Mozilla Foundation
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Brendan Eich <brendan@mozilla.org
* Dave Camp <dcamp@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either of the GNU General Public License Version 2 or later (the "GPL"),
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
@ -37,6 +35,18 @@
*
* ***** END LICENSE BLOCK ***** */
#define jsinvoke_cpp___
#include "nsISupports.idl"
#include "jsinterp.cpp"
/**
* Do not use this interface. Instead, write:
* Components.utils.import("resource://gre/modules/jsdebugger.jsm");
*/
[scriptable, uuid(2fc14cc6-4ed0-4bbf-a7dd-e535bf088eb5)]
interface IJSDebugger : nsISupports
{
/**
* Define the global Debugger constructor.
*/
[implicit_jscontext]
void addClass();
};

View File

@ -0,0 +1,111 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* The Mozilla Foundation <http://www.mozilla.org/>.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Dave Camp <dcamp@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#include "JSDebugger.h"
#include "nsIXPConnect.h"
#include "nsThreadUtils.h"
#include "jsapi.h"
#include "jsobj.h"
#include "jsgc.h"
#include "jsfriendapi.h"
#include "jsdbgapi.h"
#include "mozilla/ModuleUtils.h"
#include "nsServiceManagerUtils.h"
#include "nsMemory.h"
#define JSDEBUGGER_CONTRACTID \
"@mozilla.org/jsdebugger;1"
#define JSDEBUGGER_CID \
{ 0x0365cbd5, 0xd46e, 0x4e94, { 0xa3, 0x9f, 0x83, 0xb6, 0x3c, 0xd1, 0xa9, 0x63 } }
namespace mozilla {
namespace jsdebugger {
NS_GENERIC_FACTORY_CONSTRUCTOR(JSDebugger)
NS_IMPL_ISUPPORTS1(JSDebugger, IJSDebugger)
JSDebugger::JSDebugger()
{
}
JSDebugger::~JSDebugger()
{
}
NS_IMETHODIMP
JSDebugger::AddClass(JSContext *cx)
{
nsresult rv;
nsCOMPtr<nsIXPConnect> xpc = do_GetService(nsIXPConnect::GetCID(), &rv);
JSObject* global = JS_GetGlobalForScopeChain(cx);
if (!global) {
return NS_ERROR_NOT_AVAILABLE;
}
if (!JS_DefineDebuggerObject(cx, global)) {
return NS_ERROR_FAILURE;
}
return NS_OK;
}
}
}
NS_DEFINE_NAMED_CID(JSDEBUGGER_CID);
static const mozilla::Module::CIDEntry kJSDebuggerCIDs[] = {
{ &kJSDEBUGGER_CID, false, NULL, mozilla::jsdebugger::JSDebuggerConstructor },
{ NULL }
};
static const mozilla::Module::ContractIDEntry kJSDebuggerContracts[] = {
{ JSDEBUGGER_CONTRACTID, &kJSDEBUGGER_CID },
{ NULL }
};
static const mozilla::Module kJSDebuggerModule = {
mozilla::Module::kVersion,
kJSDebuggerCIDs,
kJSDebuggerContracts
};
NSMODULE_DEFN(jsdebugger) = &kJSDebuggerModule;

View File

@ -0,0 +1,62 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is mozilla.org code.
*
* The Initial Developer of the Original Code is
* The Mozilla Foundation <http://www.mozilla.org/>.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Dave Camp <dcamp@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
#ifndef COMPONENTS_JSDEBUGGER_H
#define COMPONENTS_JSDEBUGGER_H
#include "IJSDebugger.h"
namespace mozilla {
namespace jsdebugger {
class JSDebugger : public IJSDebugger
{
public:
NS_DECL_ISUPPORTS
NS_DECL_IJSDEBUGGER
JSDebugger();
private:
~JSDebugger();
};
}
}
#endif

View File

@ -0,0 +1,75 @@
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (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.mozilla.org/MPL/
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is mozilla.org code.
#
# The Initial Developer of the Original Code is
# The Mozilla Foundation <http://www.mozilla.org/>.
# Portions created by the Initial Developer are Copyright (C) 2011
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
# Dave Camp <dcamp@mozilla.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
DEPTH = ../../..
topsrcdir = @top_srcdir@
srcdir = @srcdir@
VPATH = @srcdir@
relativesrcdir = js/ductwork/debugger
include $(DEPTH)/config/autoconf.mk
MODULE = jsdebugger
MODULE_NAME = jsdebugger
GRE_MODULE = 1
LIBRARY_NAME = jsdebugger
XPIDL_MODULE = jsdebugger
LIBXUL_LIBRARY = 1
EXPORT_LIBRARY = 1
IS_COMPONENT = 1
CPPSRCS = \
JSDebugger.cpp \
$(NULL)
EXTRA_DSO_LDOPTS += \
$(MOZ_COMPONENT_LIBS) \
$(MOZ_JS_LIBS) \
$(NULL)
EXTRA_JS_MODULES = \
jsdebugger.jsm \
$(NULL)
XPIDLSRCS = \
IJSDebugger.idl \
$(NULL)
XPCSHELL_TESTS = tests
include $(topsrcdir)/config/rules.mk

View File

@ -0,0 +1,55 @@
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
/* ***** BEGIN LICENSE BLOCK *****
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
*
* The contents of this file are subject to the Mozilla Public License Version
* 1.1 (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.mozilla.org/MPL/
*
* Software distributed under the License is distributed on an "AS IS" basis,
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
* for the specific language governing rights and limitations under the
* License.
*
* The Original Code is js-ctypes.
*
* The Initial Developer of the Original Code is
* The Mozilla Foundation <http://www.mozilla.org/>.
* Portions created by the Initial Developer are Copyright (C) 2011
* the Initial Developer. All Rights Reserved.
*
* Contributor(s):
* Jason Orendorff <jorendorff@mozilla.com>
*
* Alternatively, the contents of this file may be used under the terms of
* either the GNU General Public License Version 2 or later (the "GPL"), or
* the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
* in which case the provisions of the GPL or the LGPL are applicable instead
* of those above. If you wish to allow use of your version of this file only
* under the terms of either the GPL or the LGPL, and not to allow others to
* use your version of this file under the terms of the MPL, indicate your
* decision by deleting the provisions above and replace them with the notice
* and other provisions required by the GPL or the LGPL. If you do not delete
* the provisions above, a recipient may use your version of this file under
* the terms of any one of the MPL, the GPL or the LGPL.
*
* ***** END LICENSE BLOCK ***** */
let EXPORTED_SYMBOLS = [ "Debugger" ];
/*
* This is the js module for Debugger. Import it like so:
* Components.utils.import("resource://gre/modules/jsdebugger.jsm");
*
* This will create a 'Debugger' object, which provides an interface to debug
* JavaScript code running in other compartments in the same process, on the
* same thread.
*
* For documentation on the API, see:
* https://wiki.mozilla.org/Debugger
*/
// Initialize the Debugger object. You do not need to do this yourself.
const init = Components.classes["@mozilla.org/jsdebugger;1"].createInstance(Components.interfaces.IJSDebugger);
init.addClass();

View File

@ -0,0 +1,17 @@
/* Any copyright is dedicated to the Public Domain.
http://creativecommons.org/publicdomain/zero/1.0/ */
"use strict";
const Cc = Components.classes;
const Ci = Components.interfaces;
const Cu = Components.utils;
const Cr = Components.results;
function testGlobal(aName) {
let systemPrincipal = Cc["@mozilla.org/systemprincipal;1"]
.createInstance(Ci.nsIPrincipal);
let sandbox = Cu.Sandbox(systemPrincipal);
Cu.evalInSandbox("this.__name = '" + aName + "'", sandbox);
return sandbox;
}

View File

@ -0,0 +1,29 @@
function run_test()
{
Components.utils.import("resource://gre/modules/jsdebugger.jsm");
var g = testGlobal("test1");
var dbg = new Debugger();
dbg.addDebuggee(g);
dbg.onDebuggerStatement = function(aFrame) {
let args = aFrame["arguments"];
try {
args[0];
do_check_true(true);
} catch(ex) {
do_check_true(false);
}
};
g.eval("function stopMe(arg) {debugger;}");
g2 = testGlobal("test2");
g2.g = g;
g2.eval("(" + function createBadEvent() {
let parser = Components.classes["@mozilla.org/xmlextras/domparser;1"].createInstance(Components.interfaces.nsIDOMParser);
let doc = parser.parseFromString("<foo></foo>", "text/xml");
g.stopMe(doc.createEvent("MouseEvent"));
} + ")()");
dbg.enabled = false;
}

View File

@ -0,0 +1,5 @@
[DEFAULT]
head = head_dbg.js
tail =
[test_nativewrappers.js]

View File

@ -124,7 +124,6 @@ CPPSRCS = \
jshash.cpp \
jsinfer.cpp \
jsinterp.cpp \
jsinvoke.cpp \
jsiter.cpp \
jslock.cpp \
jslog2.cpp \

View File

@ -1173,20 +1173,6 @@ static void
call_trace(JSTracer *trc, JSObject *obj)
{
JS_ASSERT(obj->isCall());
if (StackFrame *fp = obj->maybeCallObjStackFrame()) {
/*
* FIXME: Hide copies of stack values rooted by fp from the Cycle
* Collector, which currently lacks a non-stub Unlink implementation
* for JS objects (including Call objects), so is unable to collect
* cycles involving Call objects whose frames are active without this
* hiding hack.
*/
uintN first = JSObject::CALL_RESERVED_SLOTS;
uintN count = fp->script()->bindings.countArgsAndVars();
JS_ASSERT(obj->numSlots() >= first + count);
obj->clearSlotRange(first, count);
}
MaybeMarkGenerator(trc, obj);
}

View File

@ -110,9 +110,6 @@ using namespace js;
using namespace js::gc;
using namespace js::types;
/* jsinvoke_cpp___ indicates inclusion from jsinvoke.cpp. */
#if !JS_LONE_INTERPRET ^ defined jsinvoke_cpp___
JSObject *
js::GetScopeChain(JSContext *cx)
{
@ -1322,7 +1319,7 @@ ValueToId(JSContext *cx, const Value &v, jsid *idp)
* Enter the new with scope using an object at sp[-1] and associate the depth
* of the with block with sp + stackIndex.
*/
JS_STATIC_INTERPRET JS_REQUIRES_STACK JSBool
JS_REQUIRES_STACK JSBool
js_EnterWith(JSContext *cx, jsint stackIndex, JSOp op, size_t oplen)
{
StackFrame *fp = cx->fp();
@ -1357,7 +1354,7 @@ js_EnterWith(JSContext *cx, jsint stackIndex, JSOp op, size_t oplen)
return JS_TRUE;
}
JS_STATIC_INTERPRET JS_REQUIRES_STACK void
JS_REQUIRES_STACK void
js_LeaveWith(JSContext *cx)
{
JSObject *withobj;
@ -1413,7 +1410,7 @@ js_UnwindScope(JSContext *cx, jsint stackDepth, JSBool normalUnwind)
return normalUnwind;
}
JS_STATIC_INTERPRET JSBool
JSBool
js_DoIncDec(JSContext *cx, const JSCodeSpec *cs, Value *vp, Value *vp2)
{
if (cs->format & JOF_POST) {
@ -1475,10 +1472,6 @@ js::FindUpvarFrame(JSContext *cx, uintN targetLevel)
return fp;
}
#endif /* !JS_LONE_INTERPRET ^ defined jsinvoke_cpp___ */
#ifndef jsinvoke_cpp___
#define PUSH_COPY(v) do { *regs.sp++ = v; assertSameCompartment(cx, regs.sp[-1]); } while (0)
#define PUSH_COPY_SKIP_CHECK(v) *regs.sp++ = v
#define PUSH_NULL() regs.sp++->setNull()
@ -6371,5 +6364,3 @@ END_CASE(JSOP_ARRAYPUSH)
}
} /* namespace js */
#endif /* !defined jsinvoke_cpp___ */

View File

@ -362,30 +362,6 @@ class InterpreterFrames {
} /* namespace js */
/*
* JS_LONE_INTERPRET indicates that the compiler should see just the code for
* the js_Interpret function when compiling jsinterp.cpp. The rest of the code
* from the file should be visible only when compiling jsinvoke.cpp. It allows
* platform builds to optimize selectively js_Interpret when the granularity
* of the optimizations with the given compiler is a compilation unit.
*
* JS_STATIC_INTERPRET is the modifier for functions defined in jsinterp.cpp
* that only js_Interpret calls. When JS_LONE_INTERPRET is true all such
* functions are declared below.
*/
#ifndef JS_LONE_INTERPRET
# ifdef _MSC_VER
# define JS_LONE_INTERPRET 0
# else
# define JS_LONE_INTERPRET 1
# endif
#endif
#if !JS_LONE_INTERPRET
# define JS_STATIC_INTERPRET static
#else
# define JS_STATIC_INTERPRET
extern JS_REQUIRES_STACK JSBool
js_EnterWith(JSContext *cx, jsint stackIndex, JSOp op, size_t oplen);
@ -401,7 +377,6 @@ js_LeaveWith(JSContext *cx);
extern JSBool
js_DoIncDec(JSContext *cx, const JSCodeSpec *cs, js::Value *vp, js::Value *vp2);
#endif /* JS_LONE_INTERPRET */
/*
* Unwind block and scope chains to match the given depth. The function sets
* fp->sp on return to stackDepth.

View File

@ -2476,7 +2476,7 @@ Parser::setFunctionKinds(JSFunctionBox *funbox, uint32 *tcflags)
} else if (funbox->inAnyDynamicScope()) {
JS_ASSERT(!fun->isNullClosure());
} else {
uintN hasUpvars = false;
bool hasUpvars = false;
bool canFlatten = true;
if (pn->pn_type == TOK_UPVARS) {

View File

@ -382,7 +382,7 @@ nsMathMLmactionFrame::MouseListener::HandleEvent(nsIDOMEvent* aEvent)
if (eventType.EqualsLiteral("mouseover")) {
mOwner->MouseOver();
}
else if (eventType.EqualsLiteral("mouseclick")) {
else if (eventType.EqualsLiteral("click")) {
mOwner->MouseClick();
}
else if (eventType.EqualsLiteral("mouseout")) {

View File

@ -400,7 +400,7 @@ pref("dom.max_script_run_time", 20);
// JS error console
pref("devtools.errorconsole.enabled", false);
pref("browser.ui.layout.tablet", 0); // on: 1, off: 0, auto: -1
pref("browser.ui.layout.tablet", -1); // on: 1, off: 0, auto: -1
// kinetic tweakables
pref("browser.ui.kinetic.updateInterval", 16);

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

View File

@ -17,4 +17,5 @@
== bmp-size-32x32-1bpp.bmp bmp-size-32x32-1bpp.png
== bmp-size-33x33-1bpp.bmp bmp-size-33x33-1bpp.png
== bmp-not-square-1bpp.bmp bmp-not-square-1bpp.png
== os2bmp-size-32x32-1bpp.bmp bmp-size-32x32-1bpp.png
== top-to-bottom-16x16-1bpp.bmp bmp-size-16x16-1bpp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 126 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

View File

@ -17,4 +17,5 @@
== bmp-size-32x32-24bpp.bmp bmp-size-32x32-24bpp.png
== bmp-size-33x33-24bpp.bmp bmp-size-33x33-24bpp.png
== bmp-not-square-24bpp.bmp bmp-not-square-24bpp.png
== os2bmp-size-32x32-24bpp.bmp bmp-size-32x32-24bpp.png
== top-to-bottom-16x16-24bpp.bmp bmp-size-16x16-24bpp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 822 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 586 B

View File

@ -17,4 +17,5 @@
== bmp-size-32x32-4bpp.bmp bmp-size-32x32-4bpp.png
== bmp-size-33x33-4bpp.bmp bmp-size-33x33-4bpp.png
== bmp-not-square-4bpp.bmp bmp-not-square-4bpp.png
== os2bmp-size-32x32-4bpp.bmp bmp-size-32x32-4bpp.png
== top-to-bottom-16x16-4bpp.bmp bmp-size-16x16-4bpp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 246 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -17,4 +17,5 @@
== bmp-size-32x32-8bpp.bmp bmp-size-32x32-8bpp.png
== bmp-size-33x33-8bpp.bmp bmp-size-33x33-8bpp.png
== bmp-not-square-8bpp.bmp bmp-not-square-8bpp.png
== os2bmp-size-32x32-8bpp.bmp bmp-size-32x32-8bpp.png
== top-to-bottom-16x16-8bpp.bmp bmp-size-16x16-8bpp.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 30 B

View File

@ -2,6 +2,7 @@
== wrapper.html?invalid-signature.bmp about:blank
== wrapper.html?invalid-bpp.bmp about:blank
== wrapper.html?os2-invalid-bpp.bmp about:blank
# Tests for an unsupported compression value
== wrapper.html?invalid-compression.bmp about:blank
# Tests for RLE4 with an invalid BPP

View File

@ -291,6 +291,7 @@ extractFile(const char * path, const struct cdir_entry *entry, void * data)
MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
if (buf == (void *)-1) {
__android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "Couldn't mmap decompression buffer");
close(fd);
return;
}
@ -510,10 +511,12 @@ static void * mozload(const char * path, void *zip,
// we'd like to use fallocate here, but it doesn't exist currently?
if (lseek(fd, lib_size - 1, SEEK_SET) == (off_t) - 1) {
__android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "seeking file failed");
close(fd);
return NULL;
}
if (write(fd, "", 1) != 1) {
__android_log_print(ANDROID_LOG_ERROR, "GeckoLibLoad", "writting one byte to the file failed");
close(fd);
return NULL;
}
skipLibCache = true;

View File

@ -46,6 +46,7 @@ skip-if = os == "android"
[include:intl/uconv/tests/unit/xpcshell.ini]
[include:netwerk/test/unit/xpcshell.ini]
[include:netwerk/test/httpserver/test/xpcshell.ini]
[include:js/ductwork/debugger/tests/xpcshell.ini]
[include:js/jetpack/tests/unit/xpcshell.ini]
[include:js/src/xpconnect/tests/unit/xpcshell.ini]
[include:modules/libjar/test/unit/xpcshell.ini]

View File

@ -859,7 +859,7 @@ AsyncAssociateIconToPage::Run()
// static
nsresult
AsyncGetFaviconURLForPage::start(nsIURI *aPageURI,
AsyncGetFaviconURLForPage::start(nsIURI* aPageURI,
nsCOMPtr<mozIStorageConnection>& aDBConn,
nsIFaviconDataCallback* aCallback)
{
@ -927,6 +927,83 @@ AsyncGetFaviconURLForPage::Run()
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
//// AsyncGetFaviconDataForPage
// static
nsresult
AsyncGetFaviconDataForPage::start(nsIURI* aPageURI,
nsCOMPtr<mozIStorageConnection>& aDBConn,
nsIFaviconDataCallback* aCallback)
{
NS_ENSURE_ARG(aCallback);
NS_ENSURE_ARG(aPageURI);
NS_PRECONDITION(NS_IsMainThread(),
"This should be called on the main thread.");
nsRefPtr<nsFaviconService> fs = nsFaviconService::GetFaviconService();
NS_ENSURE_TRUE(fs, NS_ERROR_OUT_OF_MEMORY);
nsCAutoString pageSpec;
nsresult rv = aPageURI->GetSpec(pageSpec);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIFaviconDataCallback> callback = aCallback;
nsRefPtr<AsyncGetFaviconDataForPage> event =
new AsyncGetFaviconDataForPage(pageSpec, aDBConn, fs, callback);
nsCOMPtr<nsIEventTarget> target = do_GetInterface(aDBConn);
NS_ENSURE_TRUE(target, NS_ERROR_OUT_OF_MEMORY);
rv = target->Dispatch(event, NS_DISPATCH_NORMAL);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}
AsyncGetFaviconDataForPage::AsyncGetFaviconDataForPage(const nsACString& aPageSpec,
nsCOMPtr<mozIStorageConnection>& aDBConn,
nsRefPtr<nsFaviconService>& aFaviconSvc,
nsCOMPtr<nsIFaviconDataCallback>& aCallback)
: AsyncFaviconHelperBase(aDBConn, aFaviconSvc, aCallback)
{
mPageSpec.Assign(aPageSpec);
}
AsyncGetFaviconDataForPage::~AsyncGetFaviconDataForPage()
{
}
NS_IMETHODIMP
AsyncGetFaviconDataForPage::Run()
{
NS_PRECONDITION(!NS_IsMainThread(),
"This should not be called on the main thread.");
nsCAutoString iconSpec;
nsresult rv = FetchIconURL(mFaviconSvc->mSyncStatements,
mPageSpec, iconSpec);
NS_ENSURE_SUCCESS(rv, rv);
if (!iconSpec.Length()) {
return NS_ERROR_NOT_AVAILABLE;
}
IconData iconData;
iconData.spec.Assign(iconSpec);
PageData pageData;
pageData.spec.Assign(mPageSpec);
rv = FetchIconInfo(mFaviconSvc->mSyncStatements, iconData);
NS_ENSURE_SUCCESS(rv, rv);
nsCOMPtr<nsIRunnable> event =
new NotifyIconObservers(iconData, pageData, mDBConn,
mFaviconSvc, mCallback);
rv = NS_DispatchToMainThread(event);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
//// NotifyIconObservers

View File

@ -314,6 +314,53 @@ private:
nsCString mPageSpec;
};
/**
* Asynchronously tries to get the URL and data of a page's favicon.
* If this succeeds, notifies the given observer.
*/
class AsyncGetFaviconDataForPage : public AsyncFaviconHelperBase
{
public:
NS_DECL_NSIRUNNABLE
/**
* Creates the event and dispatches it to the I/O thread.
*
* @param aPageURI
* URL of the page whose favicon URL and data we're fetching
* @param aDBConn
* database connection to use
* @param aCallback
* function to be called once the URL and data is retrieved from the database
*/
static nsresult start(nsIURI* aPageURI,
nsCOMPtr<mozIStorageConnection>& aDBConn,
nsIFaviconDataCallback* aCallback);
/**
* Constructor.
*
* @param aPageSpec
* URL of the page whose favicon URL and data we're fetching
* @param aDBConn
* database connection to use
* @param aFaviconSvc
* the favicon service to query
* @param aCallback
* function to be called once the URL is retrieved from the database
*/
AsyncGetFaviconDataForPage(const nsACString& aPageSpec,
nsCOMPtr<mozIStorageConnection>& aDBConn,
nsRefPtr<nsFaviconService>& aFaviconSvc,
nsCOMPtr<nsIFaviconDataCallback>& aCallback);
virtual ~AsyncGetFaviconDataForPage();
private:
nsCString mPageSpec;
};
/**
* Notifies the icon change to favicon observers.
*/

View File

@ -47,7 +47,7 @@ interface nsIFaviconDataCallback;
* @status EXPERIMENTAL
*/
[scriptable, uuid(6D2B0507-245F-452D-9718-5595DCD3CD14)]
[scriptable, uuid(0cb4e536-e120-41e6-998f-66123d81ec53)]
interface mozIAsyncFavicons : nsISupports
{
/**
@ -106,4 +106,18 @@ interface mozIAsyncFavicons : nsISupports
*/
void getFaviconURLForPage(in nsIURI aPageURI,
in nsIFaviconDataCallback aCallback);
/**
* Retrieve the URL and data of the favicon for the given page.
*
* @param aPageURI
* URI of the page whose favicon's URL and data we're looking up
* @param aCallback
* Once we've found the favicon's URL, we invoke this callback with
* the favicon data.
*
* @see nsIFaviconDataCallback in nsIFaviconService.idl.
*/
void getFaviconDataForPage(in nsIURI aPageURI,
in nsIFaviconDataCallback aCallback);
};

View File

@ -718,6 +718,17 @@ nsFaviconService::GetFaviconURLForPage(nsIURI *aPageURI,
return NS_OK;
}
NS_IMETHODIMP
nsFaviconService::GetFaviconDataForPage(nsIURI* aPageURI,
nsIFaviconDataCallback* aCallback)
{
NS_ENSURE_ARG(aPageURI);
NS_ENSURE_ARG(aCallback);
nsresult rv = AsyncGetFaviconDataForPage::start(aPageURI, mDBConn, aCallback);
NS_ENSURE_SUCCESS(rv, rv);
return NS_OK;
}
NS_IMETHODIMP
nsFaviconService::GetFaviconImageForPage(nsIURI* aPageURI, nsIURI** _retval)

View File

@ -341,6 +341,16 @@ iconsvc.getFaviconURLForPage(page1URI, {
do_check_eq(aDataLen, 0);
do_check_eq(aData.length, 0);
do_check_eq(aMimeType, "");
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFaviconDataCallback])
});
iconsvc.getFaviconDataForPage(page1URI, {
onFaviconDataAvailable: function(aURI, aDataLen, aData, aMimeType) {
do_check_true(aURI.equals(savedIcon1URI));
do_check_eq(icon1MimeType, out1MimeType.value);
checkArrays(icon1Data, aData);
do_check_eq(aDataLen, aData.length);
do_test_finished();
},
QueryInterface: XPCOMUtils.generateQI([Ci.nsIFaviconDataCallback])

View File

@ -142,6 +142,7 @@ COMPONENT_LIBS += \
composer \
jetpack_s \
telemetry \
jsdebugger \
storagecomps \
$(NULL)

View File

@ -273,6 +273,7 @@
SERVICES_CRYPTO_MODULE \
MOZ_APP_COMPONENT_MODULES \
MODULE(nsTelemetryModule) \
MODULE(jsdebugger) \
/* end of list */
#define MODULE(_name) \

View File

@ -683,6 +683,12 @@ MAKEFILES_jsreflect="
toolkit/components/reflect/Makefile
"
MAKEFILES_jsductwork="
js/ductwork/Makefile
js/ductwork/debugger/Makefile
js/ductwork/debugger/tests/Makefile
"
MAKEFILES_libpr0n="
modules/libpr0n/Makefile
modules/libpr0n/build/Makefile
@ -750,6 +756,7 @@ add_makefiles "
$MAKEFILES_jsdebugger
$MAKEFILES_jsctypes
$MAKEFILES_jsreflect
$MAKEFILES_jsductwork
$MAKEFILES_content
$MAKEFILES_layout
$MAKEFILES_libimg

View File

@ -224,6 +224,8 @@ tier_platform_dirs += services/crypto/component
tier_platform_dirs += startupcache
tier_platform_dirs += js/ductwork
ifdef APP_LIBXUL_STATICDIRS
# Applications can cheat and ask for code to be
# built before libxul so libxul can be linked against it.

View File

@ -175,7 +175,7 @@ public:
return refcount;
}
void stabilizeForDeletion(nsISupports *owner)
void stabilizeForDeletion(nsISupports*)
{
mTagged = NS_CCAR_TAGGED_STABILIZED_REFCNT;
}