mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
Merge Places and mozilla-central.
This commit is contained in:
commit
81f58cea7d
@ -157,7 +157,7 @@ Sanitizer.prototype = {
|
||||
|
||||
// Clear plugin data.
|
||||
let ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
|
||||
const phInterface = Ci.nsIPluginHost_MOZILLA_2_0_BRANCH;
|
||||
const phInterface = Ci.nsIPluginHost;
|
||||
const FLAG_CLEAR_ALL = phInterface.FLAG_CLEAR_ALL;
|
||||
ph.QueryInterface(phInterface);
|
||||
|
||||
|
@ -10,7 +10,7 @@ const testURL2 = "http://mochi.test:8888/browser/browser/base/content/test/brows
|
||||
Cc["@mozilla.org/moz/jssubscript-loader;1"].getService(Ci.mozIJSSubScriptLoader)
|
||||
.loadSubScript("chrome://browser/content/sanitize.js");
|
||||
|
||||
const pluginHostIface = Ci.nsIPluginHost_MOZILLA_2_0_BRANCH;
|
||||
const pluginHostIface = Ci.nsIPluginHost;
|
||||
var pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
|
||||
pluginHost.QueryInterface(pluginHostIface);
|
||||
|
||||
|
@ -618,7 +618,7 @@ PrivateBrowsingService.prototype = {
|
||||
|
||||
// Plugin data
|
||||
let (ph = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost)) {
|
||||
const phInterface = Ci.nsIPluginHost_MOZILLA_2_0_BRANCH;
|
||||
const phInterface = Ci.nsIPluginHost;
|
||||
const FLAG_CLEAR_ALL = phInterface.FLAG_CLEAR_ALL;
|
||||
ph.QueryInterface(phInterface);
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
// Test clearing plugin data by domain using nsPrivateBrowsingService.
|
||||
const testURL = "http://mochi.test:8888/browser/browser/components/privatebrowsing/test/browser/browser_privatebrowsing_clearplugindata.html";
|
||||
|
||||
const pluginHostIface = Ci.nsIPluginHost_MOZILLA_2_0_BRANCH;
|
||||
const pluginHostIface = Ci.nsIPluginHost;
|
||||
var pluginHost = Cc["@mozilla.org/plugin/host;1"].getService(Ci.nsIPluginHost);
|
||||
pluginHost.QueryInterface(pluginHostIface);
|
||||
|
||||
|
@ -91,30 +91,4 @@ public:
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentUtils2, NS_ICONTENTUTILS2_IID)
|
||||
|
||||
#ifndef MOZ_ENABLE_LIBXUL
|
||||
// nsIContentUtils_MOZILLA_2_0_BRANCH is a non-libxul only interface to enable
|
||||
// us keep those builds working.
|
||||
|
||||
#define NS_ICONTENTUTILS_MOZILLA_2_0_BRANCH_IID \
|
||||
{ 0x0fe8099c, 0x622a, 0x4c79, \
|
||||
{ 0xb0, 0x02, 0x55, 0xf0, 0x44, 0x34, 0x00, 0x30 } }
|
||||
|
||||
class nsIContentUtils_MOZILLA_2_0_BRANCH : public nsISupports
|
||||
{
|
||||
public:
|
||||
NS_DECLARE_STATIC_IID_ACCESSOR(NS_ICONTENTURILS_MOZILLA_2_0_BRANCH_IID)
|
||||
NS_DECL_ISUPPORTS
|
||||
|
||||
virtual nsresult DispatchTrustedEvent(nsIDocument* aDoc,
|
||||
nsISupports* aTarget,
|
||||
const nsAString& aEventName,
|
||||
PRBool aCanBubble,
|
||||
PRBool aCancelable,
|
||||
PRBool *aDefaultAction = nsnull);
|
||||
};
|
||||
|
||||
NS_DEFINE_STATIC_IID_ACCESSOR(nsIContentUtils_MOZILLA_2_0_BRANCH, NS_ICONTENTUTILS_MOZILLA_2_0_BRANCH_IID)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* nsIContentUtils_h__ */
|
||||
|
@ -6514,21 +6514,3 @@ nsIContentUtils2::CheckSameOrigin(nsIChannel *aOldChannel, nsIChannel *aNewChann
|
||||
{
|
||||
return nsContentUtils::CheckSameOrigin(aOldChannel, aNewChannel);
|
||||
}
|
||||
|
||||
#ifndef MOZ_ENABLE_LIBXUL
|
||||
|
||||
NS_IMPL_ISUPPORTS1(nsIContentUtils_MOZILLA_2_0_BRANCH, nsIContentUtils_MOZILLA_2_0_BRANCH)
|
||||
|
||||
nsresult
|
||||
nsIContentUtils_MOZILLA_2_0_BRANCH::DispatchTrustedEvent(nsIDocument* aDoc,
|
||||
nsISupports* aTarget,
|
||||
const nsAString& aEventName,
|
||||
PRBool aCanBubble,
|
||||
PRBool aCancelable,
|
||||
PRBool *aDefaultAction)
|
||||
{
|
||||
return nsContentUtils::DispatchTrustedEvent(aDoc, aTarget, aEventName,
|
||||
aCanBubble, aCancelable, aDefaultAction);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -897,10 +897,8 @@ nsTextInputListener::EditAction()
|
||||
}
|
||||
|
||||
// Fire input event
|
||||
nsCOMPtr<nsIEditor_MOZILLA_2_0_BRANCH> editor20 = do_QueryInterface(editor);
|
||||
NS_ASSERTION(editor20, "Something is very wrong!");
|
||||
PRBool trusted = PR_FALSE;
|
||||
editor20->GetLastKeypressEventTrusted(&trusted);
|
||||
editor->GetLastKeypressEventTrusted(&trusted);
|
||||
frame->FireOnInput(trusted);
|
||||
|
||||
// mFrame may be dead after this, but we don't need to check for it, because
|
||||
|
@ -516,6 +516,12 @@ nsDummyJavaPluginOwner::GetWindow(NPWindow *&aWindow)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDummyJavaPluginOwner::SetWindow()
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsDummyJavaPluginOwner::GetMode(PRInt32 *aMode)
|
||||
{
|
||||
|
@ -596,16 +596,6 @@ PluginInstanceParent::AsyncSetWindow(NPWindow* aWindow)
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsresult
|
||||
PluginInstanceParent::GetSurface(gfxASurface** aSurface)
|
||||
{
|
||||
if (mFrontSurface) {
|
||||
NS_ADDREF(*aSurface = mFrontSurface);
|
||||
return NS_OK;
|
||||
}
|
||||
return NS_ERROR_NOT_AVAILABLE;
|
||||
}
|
||||
|
||||
nsresult
|
||||
PluginInstanceParent::GetImage(ImageContainer* aContainer, Image** aImage)
|
||||
{
|
||||
|
@ -280,7 +280,6 @@ public:
|
||||
#endif // definied(OS_MACOSX)
|
||||
|
||||
nsresult AsyncSetWindow(NPWindow* window);
|
||||
nsresult GetSurface(gfxASurface** aSurface);
|
||||
nsresult GetImage(mozilla::layers::ImageContainer* aContainer, mozilla::layers::Image** aImage);
|
||||
nsresult GetImageSize(nsIntSize* aSize);
|
||||
#ifdef XP_MACOSX
|
||||
|
@ -99,7 +99,6 @@ public:
|
||||
virtual nsresult NPP_GetSitesWithData(InfallibleTArray<nsCString>& aResult) = 0;
|
||||
|
||||
virtual nsresult AsyncSetWindow(NPP instance, NPWindow* window) = 0;
|
||||
virtual nsresult GetSurface(NPP instance, gfxASurface** aSurface) = 0;
|
||||
virtual nsresult GetImage(NPP instance, ImageContainer* aContainer, Image** aImage) = 0;
|
||||
virtual nsresult GetImageSize(NPP instance, nsIntSize* aSize) = 0;
|
||||
virtual bool UseAsyncPainting() = 0;
|
||||
|
@ -672,16 +672,6 @@ PluginModuleParent::AsyncSetWindow(NPP instance, NPWindow* window)
|
||||
return i->AsyncSetWindow(window);
|
||||
}
|
||||
|
||||
nsresult
|
||||
PluginModuleParent::GetSurface(NPP instance, gfxASurface** aSurface)
|
||||
{
|
||||
PluginInstanceParent* i = InstCast(instance);
|
||||
if (!i)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
return i->GetSurface(aSurface);
|
||||
}
|
||||
|
||||
nsresult
|
||||
PluginModuleParent::GetImage(NPP instance,
|
||||
mozilla::layers::ImageContainer* aContainer,
|
||||
|
@ -231,7 +231,6 @@ private:
|
||||
|
||||
virtual bool HasRequiredFunctions();
|
||||
virtual nsresult AsyncSetWindow(NPP instance, NPWindow* window);
|
||||
virtual nsresult GetSurface(NPP instance, gfxASurface** aSurface);
|
||||
virtual nsresult GetImage(NPP instance, mozilla::layers::ImageContainer* aContainer, mozilla::layers::Image** aImage);
|
||||
virtual nsresult GetImageSize(NPP instance, nsIntSize* aSize);
|
||||
NS_OVERRIDE virtual bool UseAsyncPainting() { return true; }
|
||||
|
@ -55,7 +55,7 @@ interface nsIEditActionListener;
|
||||
interface nsIInlineSpellChecker;
|
||||
interface nsITransferable;
|
||||
|
||||
[scriptable, uuid(78b0bde0-ab69-428b-ab30-fcc09eead499)]
|
||||
[scriptable, uuid(bd5d93f0-6451-11e0-ae3e-0800200c9a66)]
|
||||
|
||||
interface nsIEditor : nsISupports
|
||||
{
|
||||
@ -572,11 +572,7 @@ interface nsIEditor : nsISupports
|
||||
|
||||
/* checks if a node is read-only or not */
|
||||
[notxpcom] boolean isModifiableNode(in nsIDOMNode aNode);
|
||||
};
|
||||
|
||||
[uuid(54c0bc08-6c0e-4967-bb0d-ec991d78a8b3)]
|
||||
interface nsIEditor_MOZILLA_2_0_BRANCH : nsISupports
|
||||
{
|
||||
/**
|
||||
* Will be set to true if the last keypress event that the editor has handled
|
||||
* has been trusted. The value will only be valid when the edit action listeners
|
||||
|
@ -205,7 +205,6 @@ NS_IMPL_CYCLE_COLLECTION_TRAVERSE_BEGIN(nsEditor)
|
||||
NS_IMPL_CYCLE_COLLECTION_TRAVERSE_END
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsEditor)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIEditor_MOZILLA_2_0_BRANCH)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIPhonetic)
|
||||
NS_INTERFACE_MAP_ENTRY(nsISupportsWeakReference)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIEditorIMESupport)
|
||||
|
@ -100,8 +100,7 @@ class nsIDOMNSEvent;
|
||||
class nsEditor : public nsIEditor,
|
||||
public nsIEditorIMESupport,
|
||||
public nsSupportsWeakReference,
|
||||
public nsIPhonetic,
|
||||
public nsIEditor_MOZILLA_2_0_BRANCH
|
||||
public nsIPhonetic
|
||||
{
|
||||
public:
|
||||
|
||||
@ -157,9 +156,6 @@ public:
|
||||
// nsIPhonetic
|
||||
NS_DECL_NSIPHONETIC
|
||||
|
||||
// nsIEditor_MOZILLA_2_0_BRANCH
|
||||
NS_DECL_NSIEDITOR_MOZILLA_2_0_BRANCH
|
||||
|
||||
public:
|
||||
|
||||
|
||||
|
@ -522,7 +522,8 @@ public class GeckoAppShell
|
||||
}
|
||||
|
||||
public static void notifyIMEEnabled(int state, String typeHint,
|
||||
String actionHint) {
|
||||
String actionHint, boolean landscapeFS)
|
||||
{
|
||||
if (GeckoApp.surfaceView == null)
|
||||
return;
|
||||
|
||||
@ -531,6 +532,7 @@ public class GeckoAppShell
|
||||
GeckoApp.surfaceView.mIMEState = state;
|
||||
GeckoApp.surfaceView.mIMETypeHint = typeHint;
|
||||
GeckoApp.surfaceView.mIMEActionHint = actionHint;
|
||||
GeckoApp.surfaceView.mIMELandscapeFS = landscapeFS;
|
||||
IMEStateUpdater.enableIME();
|
||||
}
|
||||
|
||||
|
@ -383,7 +383,10 @@ class GeckoSurfaceView
|
||||
outAttrs.imeOptions = EditorInfo.IME_ACTION_SEND;
|
||||
else if (mIMEActionHint != null && mIMEActionHint.length() != 0)
|
||||
outAttrs.actionLabel = mIMEActionHint;
|
||||
|
||||
|
||||
if (mIMELandscapeFS == false)
|
||||
outAttrs.imeOptions |= EditorInfo.IME_FLAG_NO_EXTRACT_UI;
|
||||
|
||||
inputConnection.reset();
|
||||
return inputConnection;
|
||||
}
|
||||
@ -624,6 +627,7 @@ class GeckoSurfaceView
|
||||
int mIMEState;
|
||||
String mIMETypeHint;
|
||||
String mIMEActionHint;
|
||||
boolean mIMELandscapeFS;
|
||||
|
||||
// Software rendering
|
||||
ByteBuffer mSoftwareBuffer;
|
||||
|
@ -762,6 +762,12 @@ public:
|
||||
*/
|
||||
virtual ThebesLayer* AsThebesLayer() { return nsnull; }
|
||||
|
||||
/**
|
||||
* Dynamic cast to a ContainerLayer. Returns null if this is not
|
||||
* a ContainerLayer.
|
||||
*/
|
||||
virtual ContainerLayer* AsContainerLayer() { return nsnull; }
|
||||
|
||||
/**
|
||||
* Dynamic cast to a ShadowLayer. Return null if this is not a
|
||||
* ShadowLayer. Can be used anytime.
|
||||
@ -1029,6 +1035,8 @@ public:
|
||||
|
||||
// These getters can be used anytime.
|
||||
|
||||
virtual ContainerLayer* AsContainerLayer() { return this; }
|
||||
|
||||
virtual Layer* GetFirstChild() { return mFirstChild; }
|
||||
virtual Layer* GetLastChild() { return mLastChild; }
|
||||
const FrameMetrics& GetFrameMetrics() { return mFrameMetrics; }
|
||||
|
@ -59,7 +59,9 @@ enum LayerState {
|
||||
LAYER_ACTIVE,
|
||||
// Force an active layer even if it causes incorrect rendering, e.g.
|
||||
// when the layer has rounded rect clips.
|
||||
LAYER_ACTIVE_FORCE
|
||||
LAYER_ACTIVE_FORCE,
|
||||
// Special layer that is metadata only.
|
||||
LAYER_ACTIVE_EMPTY
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -84,6 +84,7 @@ enum Type {
|
||||
TYPE_REMOTE,
|
||||
TYPE_REMOTE_SHADOW,
|
||||
TYPE_SCROLL_LAYER,
|
||||
TYPE_SCROLL_INFO_LAYER,
|
||||
TYPE_SELECTION_OVERLAY,
|
||||
TYPE_SOLID_COLOR,
|
||||
TYPE_TABLE_CELL_BACKGROUND,
|
||||
|
@ -1836,6 +1836,25 @@ nsDisplayScrollLayer::~nsDisplayScrollLayer()
|
||||
}
|
||||
#endif
|
||||
|
||||
nsDisplayScrollInfoLayer::nsDisplayScrollInfoLayer(
|
||||
nsDisplayListBuilder* aBuilder,
|
||||
nsDisplayList* aList,
|
||||
nsIFrame* aForFrame,
|
||||
nsIFrame* aViewportFrame)
|
||||
: nsDisplayScrollLayer(aBuilder, aList, aForFrame, aViewportFrame)
|
||||
{
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
MOZ_COUNT_CTOR(nsDisplayScrollInfoLayer);
|
||||
#endif
|
||||
}
|
||||
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
nsDisplayScrollInfoLayer::~nsDisplayScrollInfoLayer()
|
||||
{
|
||||
MOZ_COUNT_DTOR(nsDisplayScrollInfoLayer);
|
||||
}
|
||||
#endif
|
||||
|
||||
nsDisplayClip::nsDisplayClip(nsDisplayListBuilder* aBuilder,
|
||||
nsIFrame* aFrame, nsDisplayItem* aItem,
|
||||
const nsRect& aRect)
|
||||
|
@ -1836,6 +1836,30 @@ private:
|
||||
nsIFrame* mViewportFrame;
|
||||
};
|
||||
|
||||
/**
|
||||
* Like nsDisplayScrollLayer, but only has metadata on the scroll frame. This
|
||||
* creates a layer that has no Thebes child layer, but still allows the
|
||||
* compositor process to know of the scroll frame's existence.
|
||||
*/
|
||||
class nsDisplayScrollInfoLayer : public nsDisplayScrollLayer
|
||||
{
|
||||
public:
|
||||
nsDisplayScrollInfoLayer(nsDisplayListBuilder* aBuilder, nsDisplayList* aList,
|
||||
nsIFrame* aForFrame, nsIFrame* aViewportFrame);
|
||||
NS_DISPLAY_DECL_NAME("ScrollInfoLayer", TYPE_SCROLL_INFO_LAYER)
|
||||
|
||||
#ifdef NS_BUILD_REFCNT_LOGGING
|
||||
virtual ~nsDisplayScrollInfoLayer();
|
||||
#endif
|
||||
|
||||
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
|
||||
LayerManager* aManager)
|
||||
{
|
||||
return mozilla::LAYER_ACTIVE_EMPTY;
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* nsDisplayClip can clip a list of items, but we take a single item
|
||||
* initially and then later merge other items into it when we merge
|
||||
|
@ -246,12 +246,6 @@
|
||||
#define NS_ICONTENTUTILS2_CID \
|
||||
{ 0x1802442d, 0xa59b, 0x43b8, { 0xb8, 0xfd, 0x07, 0x0d, 0xa5, 0x54, 0x95, 0x93 } }
|
||||
|
||||
#ifndef MOZ_ENABLE_LIBXUL
|
||||
// {4c14b440-307f-11e0-91fa-0800200c9a66}
|
||||
#define NS_ICONTENTUTILS_MOZILLA_2_0_BRANCH_CID \
|
||||
{ 0x4c14b440, 0x307f, 0x11e9, { 0x91, 0xfa, 0x08, 0x00, 0x20, 0x0c, 0x9a, 0x66 } }
|
||||
#endif
|
||||
|
||||
// {1A26A7B7-D06E-4F45-8B45-D7AD60F7A9AB}
|
||||
#define INDEXEDDB_MANAGER_CID \
|
||||
{ 0x1a26a7b7, 0xd06e, 0x4f45, { 0x8b, 0x45, 0xd7, 0xad, 0x60, 0xf7, 0xa9, 0xab } }
|
||||
|
@ -582,9 +582,6 @@ MAKE_CTOR(CreateFocusManager, nsIFocusManager, NS_NewFocusManag
|
||||
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsIContentUtils)
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsIContentUtils2)
|
||||
#ifndef MOZ_ENABLE_LIBXUL
|
||||
NS_GENERIC_FACTORY_CONSTRUCTOR(nsIContentUtils_MOZILLA_2_0_BRANCH)
|
||||
#endif
|
||||
|
||||
MAKE_CTOR(CreateCanvasRenderingContext2D, nsIDOMCanvasRenderingContext2D, NS_NewCanvasRenderingContext2D)
|
||||
MAKE_CTOR(CreateCanvasRenderingContextWebGL, nsIDOMWebGLRenderingContext, NS_NewCanvasRenderingContextWebGL)
|
||||
@ -873,9 +870,6 @@ NS_DEFINE_NAMED_CID(NS_GEOLOCATION_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_FOCUSMANAGER_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_ICONTENTUTILS_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_ICONTENTUTILS2_CID);
|
||||
#ifndef MOZ_ENABLE_LIBXUL
|
||||
NS_DEFINE_NAMED_CID(NS_ICONTENTUTILS_MOZILLA_2_0_BRANCH_CID);
|
||||
#endif
|
||||
NS_DEFINE_NAMED_CID(CSPSERVICE_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_EVENTLISTENERSERVICE_CID);
|
||||
NS_DEFINE_NAMED_CID(NS_GLOBALMESSAGEMANAGER_CID);
|
||||
@ -1027,9 +1021,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
|
||||
{ &kNS_FOCUSMANAGER_CID, false, NULL, CreateFocusManager },
|
||||
{ &kNS_ICONTENTUTILS_CID, false, NULL, nsIContentUtilsConstructor },
|
||||
{ &kNS_ICONTENTUTILS2_CID, false, NULL, nsIContentUtils2Constructor },
|
||||
#ifndef MOZ_ENABLE_LIBXUL
|
||||
{ &kNS_ICONTENTUTILS_MOZILLA_2_0_BRANCH_CID, false, NULL, nsIContentUtils_MOZILLA_2_0_BRANCHConstructor },
|
||||
#endif
|
||||
{ &kCSPSERVICE_CID, false, NULL, CSPServiceConstructor },
|
||||
{ &kNS_EVENTLISTENERSERVICE_CID, false, NULL, CreateEventListenerService },
|
||||
{ &kNS_GLOBALMESSAGEMANAGER_CID, false, NULL, CreateGlobalMessageManager },
|
||||
@ -1175,9 +1166,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
|
||||
{ "@mozilla.org/focus-manager;1", &kNS_FOCUSMANAGER_CID },
|
||||
{ "@mozilla.org/content/contentutils;1", &kNS_ICONTENTUTILS_CID },
|
||||
{ "@mozilla.org/content/contentutils2;1", &kNS_ICONTENTUTILS2_CID },
|
||||
#ifndef MOZ_ENABLE_LIBXUL
|
||||
{ "@mozilla.org/content/contentutils-moz2.0;1", &kNS_ICONTENTUTILS_MOZILLA_2_0_BRANCH_CID },
|
||||
#endif
|
||||
{ CSPSERVICE_CONTRACTID, &kCSPSERVICE_CID },
|
||||
{ NS_EVENTLISTENERSERVICE_CONTRACTID, &kNS_EVENTLISTENERSERVICE_CID },
|
||||
{ NS_GLOBALMESSAGEMANAGER_CONTRACTID, &kNS_GLOBALMESSAGEMANAGER_CID },
|
||||
|
@ -1961,7 +1961,8 @@ nsGfxScrollFrameInner::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
dirtyRect.IntersectRect(aDirtyRect, mScrollPort);
|
||||
|
||||
// Override the dirty rectangle if the displayport has been set.
|
||||
nsLayoutUtils::GetDisplayPort(mOuter->GetContent(), &dirtyRect);
|
||||
PRBool usingDisplayport =
|
||||
nsLayoutUtils::GetDisplayPort(mOuter->GetContent(), &dirtyRect);
|
||||
|
||||
nsDisplayListCollection set;
|
||||
|
||||
@ -1976,30 +1977,42 @@ nsGfxScrollFrameInner::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
// range of 20 pixels to eliminate many gfx scroll frames from becoming a
|
||||
// layer.
|
||||
//
|
||||
PRInt32 appUnitsPerDevPixel = presContext->AppUnitsPerDevPixel();
|
||||
nsRect scrollRange = GetScrollRange();
|
||||
ScrollbarStyles styles = GetScrollbarStylesFromFrame();
|
||||
mShouldBuildLayer =
|
||||
(XRE_GetProcessType() == GeckoProcessType_Content &&
|
||||
(styles.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN ||
|
||||
styles.mVertical != NS_STYLE_OVERFLOW_HIDDEN) &&
|
||||
(scrollRange.width >= NSIntPixelsToAppUnits(20, appUnitsPerDevPixel) ||
|
||||
scrollRange.height >= NSIntPixelsToAppUnits(20, appUnitsPerDevPixel))) &&
|
||||
(!mIsRoot || !mOuter->PresContext()->IsRootContentDocument());
|
||||
(!mIsRoot || !mOuter->PresContext()->IsRootContentDocument()));
|
||||
|
||||
if (ShouldBuildLayer()) {
|
||||
// Note that using StackingContext breaks z order, so the resulting
|
||||
// rendering can be incorrect for weird edge cases!
|
||||
|
||||
nsDisplayList list;
|
||||
rv = mScrolledFrame->BuildDisplayListForStackingContext(
|
||||
aBuilder, dirtyRect + mOuter->GetOffsetTo(mScrolledFrame), &list);
|
||||
if (usingDisplayport) {
|
||||
// Once a displayport is set, assume that scrolling needs to be fast
|
||||
// so create a layer with all the content inside. The compositor
|
||||
// process will be able to scroll the content asynchronously.
|
||||
//
|
||||
// Note that using StackingContext breaks z order, so the resulting
|
||||
// rendering can be incorrect for weird edge cases!
|
||||
|
||||
nsDisplayScrollLayer* layerItem = new (aBuilder) nsDisplayScrollLayer(
|
||||
aBuilder, &list, mScrolledFrame, mOuter);
|
||||
set.Content()->AppendNewToTop(layerItem);
|
||||
} else
|
||||
{
|
||||
rv = mScrolledFrame->BuildDisplayListForStackingContext(
|
||||
aBuilder, dirtyRect + mOuter->GetOffsetTo(mScrolledFrame), &list);
|
||||
|
||||
nsDisplayScrollLayer* layerItem = new (aBuilder) nsDisplayScrollLayer(
|
||||
aBuilder, &list, mScrolledFrame, mOuter);
|
||||
set.Content()->AppendNewToTop(layerItem);
|
||||
} else {
|
||||
// If there is no displayport set, there is no reason here to force a
|
||||
// layer that needs a memory-expensive allocation, but the compositor
|
||||
// process would still like to know that it exists.
|
||||
|
||||
nsDisplayScrollLayer* layerItem = new (aBuilder) nsDisplayScrollInfoLayer(
|
||||
aBuilder, &list, mScrolledFrame, mOuter);
|
||||
set.Content()->AppendNewToTop(layerItem);
|
||||
|
||||
rv = mOuter->BuildDisplayListForChild(aBuilder, mScrolledFrame, dirtyRect, set);
|
||||
}
|
||||
} else {
|
||||
rv = mOuter->BuildDisplayListForChild(aBuilder, mScrolledFrame, dirtyRect, set);
|
||||
}
|
||||
|
||||
|
@ -270,7 +270,6 @@ public:
|
||||
|
||||
|
||||
class nsPluginInstanceOwner : public nsIPluginInstanceOwner,
|
||||
public nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH,
|
||||
public nsIPluginTagInfo,
|
||||
public nsIDOMMouseListener,
|
||||
public nsIDOMMouseMotionListener,
|
||||
@ -286,7 +285,6 @@ public:
|
||||
|
||||
//nsIPluginInstanceOwner interface
|
||||
NS_DECL_NSIPLUGININSTANCEOWNER
|
||||
NS_DECL_NSIPLUGININSTANCEOWNER_MOZILLA_2_0_BRANCH
|
||||
|
||||
NS_IMETHOD GetURL(const char *aURL, const char *aTarget,
|
||||
nsIInputStream *aPostStream,
|
||||
@ -500,22 +498,11 @@ private:
|
||||
// return FALSE if LayerSurface dirty (newly created and don't have valid plugin content yet)
|
||||
PRBool IsUpToDate()
|
||||
{
|
||||
nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = do_QueryInterface(mInstance);
|
||||
if (!inst)
|
||||
return PR_FALSE;
|
||||
|
||||
nsIntSize size;
|
||||
return NS_SUCCEEDED(inst->GetImageSize(&size)) &&
|
||||
return NS_SUCCEEDED(mInstance->GetImageSize(&size)) &&
|
||||
size == nsIntSize(mPluginWindow->width, mPluginWindow->height);
|
||||
}
|
||||
|
||||
already_AddRefed<nsIPluginInstance_MOZILLA_2_0_BRANCH>
|
||||
GetInstance()
|
||||
{
|
||||
nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = do_QueryInterface(mInstance);
|
||||
return inst.forget();
|
||||
}
|
||||
|
||||
void FixUpURLS(const nsString &name, nsAString &value);
|
||||
|
||||
nsPluginNativeWindow *mPluginWindow;
|
||||
@ -2004,12 +1991,11 @@ nsObjectFrame::UpdateImageLayer(ImageContainer* aContainer, const gfxRect& aRect
|
||||
PRBool
|
||||
nsPluginInstanceOwner::SetCurrentImage(ImageContainer* aContainer)
|
||||
{
|
||||
nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = do_QueryInterface(mInstance);
|
||||
if (inst) {
|
||||
if (mInstance) {
|
||||
nsRefPtr<Image> image;
|
||||
// Every call to nsIPluginInstance_MOZILLA_2_0_BRANCH::GetImage() creates
|
||||
// Every call to nsIPluginInstance::GetImage() creates
|
||||
// a new image. See nsIPluginInstance.idl.
|
||||
inst->GetImage(aContainer, getter_AddRefs(image));
|
||||
mInstance->GetImage(aContainer, getter_AddRefs(image));
|
||||
if (image) {
|
||||
#ifdef XP_MACOSX
|
||||
if (image->GetFormat() == Image::MAC_IO_SURFACE && mObjectFrame) {
|
||||
@ -2030,9 +2016,8 @@ nsPluginInstanceOwner::SetCurrentImage(ImageContainer* aContainer)
|
||||
void
|
||||
nsPluginInstanceOwner::SetBackgroundUnknown()
|
||||
{
|
||||
nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = GetInstance();
|
||||
if (inst) {
|
||||
inst->SetBackgroundUnknown();
|
||||
if (mInstance) {
|
||||
mInstance->SetBackgroundUnknown();
|
||||
}
|
||||
}
|
||||
|
||||
@ -2040,10 +2025,9 @@ already_AddRefed<gfxContext>
|
||||
nsPluginInstanceOwner::BeginUpdateBackground(const nsIntRect& aRect)
|
||||
{
|
||||
nsIntRect rect = aRect;
|
||||
nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = GetInstance();
|
||||
nsRefPtr<gfxContext> ctx;
|
||||
if (inst &&
|
||||
NS_SUCCEEDED(inst->BeginUpdateBackground(&rect, getter_AddRefs(ctx)))) {
|
||||
if (mInstance &&
|
||||
NS_SUCCEEDED(mInstance->BeginUpdateBackground(&rect, getter_AddRefs(ctx)))) {
|
||||
return ctx.forget();
|
||||
}
|
||||
return nsnull;
|
||||
@ -2054,19 +2038,17 @@ nsPluginInstanceOwner::EndUpdateBackground(gfxContext* aContext,
|
||||
const nsIntRect& aRect)
|
||||
{
|
||||
nsIntRect rect = aRect;
|
||||
nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = GetInstance();
|
||||
if (inst) {
|
||||
inst->EndUpdateBackground(aContext, &rect);
|
||||
if (mInstance) {
|
||||
mInstance->EndUpdateBackground(aContext, &rect);
|
||||
}
|
||||
}
|
||||
|
||||
nsIntSize
|
||||
nsPluginInstanceOwner::GetCurrentImageSize()
|
||||
{
|
||||
nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = GetInstance();
|
||||
nsIntSize size(0,0);
|
||||
if (inst) {
|
||||
inst->GetImageSize(&size);
|
||||
if (mInstance) {
|
||||
mInstance->GetImageSize(&size);
|
||||
}
|
||||
return size;
|
||||
}
|
||||
@ -3308,7 +3290,6 @@ NS_IMPL_RELEASE(nsPluginInstanceOwner)
|
||||
|
||||
NS_INTERFACE_MAP_BEGIN(nsPluginInstanceOwner)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIPluginInstanceOwner)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIPluginTagInfo)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMMouseListener)
|
||||
NS_INTERFACE_MAP_ENTRY(nsIDOMMouseMotionListener)
|
||||
@ -4299,12 +4280,11 @@ NPDrawingModel nsPluginInstanceOwner::GetDrawingModel()
|
||||
|
||||
PRBool nsPluginInstanceOwner::IsRemoteDrawingCoreAnimation()
|
||||
{
|
||||
nsCOMPtr<nsIPluginInstance_MOZILLA_2_0_BRANCH> inst = do_QueryInterface(mInstance);
|
||||
if (!inst)
|
||||
if (mInstance)
|
||||
return PR_FALSE;
|
||||
|
||||
PRBool coreAnimation;
|
||||
if (!NS_SUCCEEDED(inst->IsRemoteDrawingCoreAnimation(&coreAnimation)))
|
||||
if (!NS_SUCCEEDED(mInstance->IsRemoteDrawingCoreAnimation(&coreAnimation)))
|
||||
return PR_FALSE;
|
||||
|
||||
return coreAnimation;
|
||||
|
@ -139,13 +139,8 @@ FindViewForId(const ViewMap& aMap, ViewID aId)
|
||||
static const FrameMetrics*
|
||||
GetFrameMetrics(Layer* aLayer)
|
||||
{
|
||||
// Children are not container layers, so they don't have frame metrics. Give
|
||||
// them a blank metric.
|
||||
if (!aLayer->GetFirstChild())
|
||||
return NULL;
|
||||
|
||||
ContainerLayer* container = static_cast<ContainerLayer*>(aLayer);
|
||||
return &container->GetFrameMetrics();
|
||||
ContainerLayer* container = aLayer->AsContainerLayer();
|
||||
return container ? &container->GetFrameMetrics() : NULL;
|
||||
}
|
||||
|
||||
static nsIntPoint
|
||||
@ -346,10 +341,9 @@ BuildViewMap(ViewMap& oldContentViews, ViewMap& newContentViews,
|
||||
nsFrameLoader* aFrameLoader, Layer* aLayer,
|
||||
float aXScale = 1, float aYScale = 1)
|
||||
{
|
||||
if (!aLayer->GetFirstChild())
|
||||
ContainerLayer* container = aLayer->AsContainerLayer();
|
||||
if (!container)
|
||||
return;
|
||||
|
||||
ContainerLayer* container = static_cast<ContainerLayer*>(aLayer);
|
||||
const FrameMetrics metrics = container->GetFrameMetrics();
|
||||
const ViewID scrollId = metrics.mScrollId;
|
||||
|
||||
|
@ -395,9 +395,9 @@ pref("dom.max_script_run_time", 20);
|
||||
pref("devtools.errorconsole.enabled", false);
|
||||
|
||||
// kinetic tweakables
|
||||
pref("browser.ui.kinetic.updateInterval", 30);
|
||||
pref("browser.ui.kinetic.decelerationRate", 20);
|
||||
pref("browser.ui.kinetic.speedSensitivity", 80);
|
||||
pref("browser.ui.kinetic.updateInterval", 16);
|
||||
pref("browser.ui.kinetic.exponentialC", 1400);
|
||||
pref("browser.ui.kinetic.polynomialC", 100);
|
||||
pref("browser.ui.kinetic.swipeLength", 160);
|
||||
|
||||
// zooming
|
||||
@ -585,6 +585,12 @@ pref("indexedDB.feature.enabled", false);
|
||||
pref("media.preload.default", 1); // default to preload none
|
||||
pref("media.preload.auto", 2); // preload metadata if preload=auto
|
||||
|
||||
// 0: don't show fullscreen keyboard
|
||||
// 1: always show fullscreen keyboard
|
||||
// -1: show fullscreen keyboard based on threshold pref
|
||||
pref("widget.ime.android.landscape_fullscreen", 0);
|
||||
pref("widget.ime.android.fullscreen_threshold", 300); // in hundreths of inches
|
||||
|
||||
// optimize images memory usage
|
||||
pref("image.mem.decodeondraw", true);
|
||||
pref("content.image.allow_locking", false);
|
||||
|
@ -461,6 +461,7 @@
|
||||
<settings id="prefs-privacy" label="&privacy.title;">
|
||||
<setting pref="network.cookie.cookieBehavior" title="&allowCookies.title;" type="boolint" on="0" off="2"/>
|
||||
<setting pref="signon.rememberSignons" title="&rememberPasswords.title;" type="bool"/>
|
||||
<setting pref="privacy.donottrackheader.enabled" title="&doNotTrack.title;" type="bool"/>
|
||||
<setting title="&clearPrivateData2.title;" type="control">
|
||||
<button id="prefs-clear-data" label="&clearPrivateData.button;" command="cmd_sanitize"/>
|
||||
</setting>
|
||||
|
@ -60,6 +60,13 @@ const kAxisLockRevertThreshold = 0.8;
|
||||
// Same as NS_EVENT_STATE_ACTIVE from nsIEventStateManager.h
|
||||
const kStateActive = 0x00000001;
|
||||
|
||||
// After a drag begins, kinetic panning is stopped if the drag doesn't become
|
||||
// a pan in 300 milliseconds.
|
||||
const kStopKineticPanOnDragTimeout = 300;
|
||||
|
||||
// Max velocity of a pan. This is in pixels/millisecond.
|
||||
const kMaxVelocity = 6;
|
||||
|
||||
/**
|
||||
* MouseModule
|
||||
*
|
||||
@ -205,19 +212,21 @@ MouseModule.prototype = {
|
||||
this._targetScrollInterface = targetScrollInterface;
|
||||
|
||||
// Do tap
|
||||
let event = document.createEvent("Events");
|
||||
event.initEvent("TapDown", true, true);
|
||||
event.clientX = aEvent.clientX;
|
||||
event.clientY = aEvent.clientY;
|
||||
let success = aEvent.target.dispatchEvent(event);
|
||||
if (success) {
|
||||
this._recordEvent(aEvent);
|
||||
this._target = aEvent.target;
|
||||
this._mouseOverTimeout.once(kOverTapWait);
|
||||
this._longClickTimeout.once(kLongTapWait);
|
||||
} else {
|
||||
// cancel all pending content clicks
|
||||
this._cleanClickBuffer();
|
||||
if (!this._kinetic.isActive()) {
|
||||
let event = document.createEvent("Events");
|
||||
event.initEvent("TapDown", true, true);
|
||||
event.clientX = aEvent.clientX;
|
||||
event.clientY = aEvent.clientY;
|
||||
let success = aEvent.target.dispatchEvent(event);
|
||||
if (success) {
|
||||
this._recordEvent(aEvent);
|
||||
this._target = aEvent.target;
|
||||
this._mouseOverTimeout.once(kOverTapWait);
|
||||
this._longClickTimeout.once(kLongTapWait);
|
||||
} else {
|
||||
// cancel all pending content clicks
|
||||
this._cleanClickBuffer();
|
||||
}
|
||||
}
|
||||
|
||||
// Do pan
|
||||
@ -328,11 +337,8 @@ MouseModule.prototype = {
|
||||
if (dragData.isPan()) {
|
||||
// Only pan when mouse event isn't part of a click. Prevent jittering on tap.
|
||||
this._kinetic.addData(sX - dragData.prevPanX, sY - dragData.prevPanY);
|
||||
if (!this._waitingForPaint) {
|
||||
this._dragBy(this.dX, this.dY);
|
||||
this.dX = 0;
|
||||
this.dY = 0;
|
||||
}
|
||||
this._dragBy(this.dX, this.dY);
|
||||
// dragBy will reset dX and dY values to 0.
|
||||
|
||||
// Let everyone know when mousemove begins a pan
|
||||
if (!oldIsPan && dragData.isPan()) {
|
||||
@ -361,6 +367,7 @@ MouseModule.prototype = {
|
||||
let dragData = this._dragData;
|
||||
dragData.setDragStart(aEvent.screenX, aEvent.screenY, aDraggable);
|
||||
this._kinetic.addData(0, 0);
|
||||
this._dragStartTime = Date.now();
|
||||
if (!this._kinetic.isActive())
|
||||
this._dragger.dragStart(aEvent.clientX, aEvent.clientY, aEvent.target, this._targetScrollInterface);
|
||||
},
|
||||
@ -377,13 +384,15 @@ MouseModule.prototype = {
|
||||
// mousedown/mouseup event previous to this one. In this case, we
|
||||
// want the kinetic panner to tell our drag interface to stop.
|
||||
|
||||
if (!dragData.isPan() && !this._kinetic.isActive()) {
|
||||
// There was no pan and no kinetic scrolling, so just stop dragger.
|
||||
this._dragger.dragStop(0, 0, this._targetScrollInterface);
|
||||
this._dragger = null;
|
||||
} else if (dragData.isPan()) {
|
||||
if (dragData.isPan()) {
|
||||
if (Date.now() - this._dragStartTime > kStopKineticPanOnDragTimeout)
|
||||
this._kinetic._velocity.set(0, 0);
|
||||
// Start kinetic pan.
|
||||
this._kinetic.start();
|
||||
} else {
|
||||
this._kinetic.end();
|
||||
this._dragger.dragStop(0, 0, this._targetScrollInterface);
|
||||
this._dragger = null;
|
||||
}
|
||||
},
|
||||
|
||||
@ -394,12 +403,21 @@ MouseModule.prototype = {
|
||||
* the dragger of dragMove()s.
|
||||
*/
|
||||
_dragBy: function _dragBy(dX, dY, aIsKinetic) {
|
||||
let dragged = true;
|
||||
let dragData = this._dragData;
|
||||
let dragged = this._dragger.dragMove(dX, dY, this._targetScrollInterface, aIsKinetic);
|
||||
if (dragged && !this._waitingForPaint) {
|
||||
this._waitingForPaint = true;
|
||||
mozRequestAnimationFrame(this);
|
||||
if (!this._waitingForPaint || aIsKinetic) {
|
||||
let dragData = this._dragData;
|
||||
dragged = this._dragger.dragMove(dX, dY, this._targetScrollInterface, aIsKinetic);
|
||||
if (dragged && !this._waitingForPaint) {
|
||||
this._waitingForPaint = true;
|
||||
mozRequestAnimationFrame(this);
|
||||
}
|
||||
this.dX = 0;
|
||||
this.dY = 0;
|
||||
}
|
||||
if (!dragData.isPan())
|
||||
this._kinetic.pause();
|
||||
|
||||
return dragged;
|
||||
},
|
||||
|
||||
@ -816,10 +834,9 @@ function KineticController(aPanBy, aEndCallback) {
|
||||
// How often do we change the position of the scroll pane? Too often and panning may jerk near
|
||||
// the end. Too little and panning will be choppy. In milliseconds.
|
||||
this._updateInterval = Services.prefs.getIntPref("browser.ui.kinetic.updateInterval");
|
||||
// "Friction" of the scroll pane. The lower, the less friction and the further distance traveled.
|
||||
this._decelerationRate = Services.prefs.getIntPref("browser.ui.kinetic.decelerationRate") / 10000;
|
||||
// A multiplier for the initial velocity of the movement.
|
||||
this._speedSensitivity = Services.prefs.getIntPref("browser.ui.kinetic.speedSensitivity") / 100;
|
||||
// Constants that affect the "friction" of the scroll pane.
|
||||
this._exponentialC = Services.prefs.getIntPref("browser.ui.kinetic.exponentialC");
|
||||
this._polynomialC = Services.prefs.getIntPref("browser.ui.kinetic.polynomialC") / 1000000;
|
||||
// Number of milliseconds that can contain a swipe. Movements earlier than this are disregarded.
|
||||
this._swipeLength = Services.prefs.getIntPref("browser.ui.kinetic.swipeLength");
|
||||
|
||||
@ -829,6 +846,7 @@ function KineticController(aPanBy, aEndCallback) {
|
||||
KineticController.prototype = {
|
||||
_reset: function _reset() {
|
||||
this._active = false;
|
||||
this._paused = false;
|
||||
this.momentumBuffer = [];
|
||||
this._velocity.set(0, 0);
|
||||
},
|
||||
@ -838,82 +856,84 @@ KineticController.prototype = {
|
||||
},
|
||||
|
||||
_startTimer: function _startTimer() {
|
||||
// Use closed form of a parabola to calculate each position for panning.
|
||||
// x(t) = v0*t + .5*t^2*a
|
||||
// where: v0 is initial velocity
|
||||
// a is acceleration
|
||||
// t is time elapsed
|
||||
//
|
||||
// x(t)
|
||||
// ^
|
||||
// | |
|
||||
// |
|
||||
// | |
|
||||
// | ....^^^^....
|
||||
// | ...^^ | ^^...
|
||||
// | ...^ ^...
|
||||
// |.. | ..
|
||||
// -----------------------------------> t
|
||||
// t0 tf=-v0/a
|
||||
//
|
||||
// Using this formula, distance moved is independent of the time between each frame, unlike time
|
||||
// step approaches. Once the time is up, set the position to x(tf) and stop the timer.
|
||||
let self = this;
|
||||
|
||||
let lastx = this._position; // track last position vector because pan takes differences
|
||||
let lastp = this._position; // track last position vector because pan takes deltas
|
||||
let v0 = this._velocity; // initial velocity
|
||||
let a = this._acceleration; // acceleration
|
||||
let c = this._exponentialC;
|
||||
let p = new Point(0, 0);
|
||||
let dx, dy, t, realt;
|
||||
|
||||
// Temporary "bins" so that we don't create new objects during pan.
|
||||
let aBin = new Point(0, 0);
|
||||
let v0Bin = new Point(0, 0);
|
||||
let self = this;
|
||||
function calcP(v0, a, t) {
|
||||
// Important traits for this function:
|
||||
// p(t=0) is 0
|
||||
// p'(t=0) is v0
|
||||
//
|
||||
// We use exponential to get a smoother stop, but by itself exponential
|
||||
// is too smooth at the end. Adding a polynomial with the appropriate
|
||||
// weight helps to balance
|
||||
return v0 * Math.exp(-t / c) * -c + a * t * t + v0 * c;
|
||||
}
|
||||
|
||||
this._calcV = function(v0, a, t) {
|
||||
return v0 * Math.exp(-t / c) + 2 * a * t;
|
||||
}
|
||||
|
||||
let callback = {
|
||||
onBeforePaint: function kineticHandleEvent(timeStamp) {
|
||||
if (!self.isActive()) // someone called end() on us between timer intervals
|
||||
// Someone called end() on us between timer intervals
|
||||
// or we are paused.
|
||||
if (!self.isActive() || self._paused)
|
||||
return;
|
||||
|
||||
// To make animation end fast enough but to keep smoothness, average the ideal
|
||||
// time frame (smooth animation) with the actual time lapse (end fast enough).
|
||||
// Animation will never take longer than 2 times the ideal length of time.
|
||||
let realt = timeStamp - self._initialTime;
|
||||
realt = timeStamp - self._initialTime;
|
||||
self._time += self._updateInterval;
|
||||
let t = (self._time + realt) / 2;
|
||||
t = (self._time + realt) / 2;
|
||||
|
||||
// Calculate new position using x(t) formula.
|
||||
let x = v0Bin.set(v0).scale(t).add(aBin.set(a).scale(0.5 * t * t));
|
||||
let dx = x.x - lastx.x;
|
||||
let dy = x.y - lastx.y;
|
||||
lastx.set(x);
|
||||
// Calculate new position.
|
||||
p.x = calcP(v0.x, a.x, t);
|
||||
p.y = calcP(v0.y, a.y, t);
|
||||
dx = Math.round(p.x - lastp.x);
|
||||
dy = Math.round(p.y - lastp.y);
|
||||
|
||||
// Test to see if movement is finished for each component. As seen in graph, we want the
|
||||
// final position to be at tf.
|
||||
if (t >= -v0.x / a.x) {
|
||||
// Plug in t=-v0/a into x(t) to get final position.
|
||||
dx = -v0.x * v0.x / 2 / a.x - lastx.x;
|
||||
// Reset components. Next frame: a's component will be 0 and t >= NaN will be false.
|
||||
lastx.x = 0;
|
||||
// Test to see if movement is finished for each component.
|
||||
if (dx * a.x > 0) {
|
||||
dx = 0;
|
||||
lastp.x = 0;
|
||||
v0.x = 0;
|
||||
a.x = 0;
|
||||
}
|
||||
// Symmetric to above case.
|
||||
if (t >= -v0.y / a.y) {
|
||||
dy = -v0.y * v0.y / 2 / a.y - lastx.y;
|
||||
lastx.y = 0;
|
||||
if (dy * a.y > 0) {
|
||||
dy = 0;
|
||||
lastp.y = 0;
|
||||
v0.y = 0;
|
||||
a.y = 0;
|
||||
}
|
||||
|
||||
let panned = false;
|
||||
try { panned = self._panBy(Math.round(-dx), Math.round(-dy), true); } catch (e) {}
|
||||
if (!panned)
|
||||
if (v0.x == 0 && v0.y == 0) {
|
||||
self.end();
|
||||
else
|
||||
mozRequestAnimationFrame(this);
|
||||
} else {
|
||||
let panStop = false;
|
||||
if (dx != 0 || dy != 0) {
|
||||
try { panStop = !self._panBy(-dx, -dy, true); } catch (e) {}
|
||||
lastp.add(dx, dy);
|
||||
}
|
||||
|
||||
if (panStop)
|
||||
self.end();
|
||||
else
|
||||
mozRequestAnimationFrame(this);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
this._active = true;
|
||||
this._paused = false;
|
||||
mozRequestAnimationFrame(callback);
|
||||
},
|
||||
|
||||
@ -922,6 +942,12 @@ KineticController.prototype = {
|
||||
return x ? ((x > 0) ? 1 : -1) : 0;
|
||||
}
|
||||
|
||||
function clampFromZero(x, closerToZero, furtherFromZero) {
|
||||
if (x >= 0)
|
||||
return Math.max(closerToZero, Math.min(furtherFromZero, x));
|
||||
return Math.min(-closerToZero, Math.max(-furtherFromZero, x));
|
||||
}
|
||||
|
||||
let mb = this.momentumBuffer;
|
||||
let mblen = this.momentumBuffer.length;
|
||||
|
||||
@ -940,24 +966,43 @@ KineticController.prototype = {
|
||||
}
|
||||
}
|
||||
|
||||
// Only allow kinetic scrolling to speed up if kinetic scrolling is active.
|
||||
this._velocity.x = (distanceX < 0 ? Math.min : Math.max)((distanceX / swipeLength) * this._speedSensitivity, this._velocity.x);
|
||||
this._velocity.y = (distanceY < 0 ? Math.min : Math.max)((distanceY / swipeLength) * this._speedSensitivity, this._velocity.y);
|
||||
let currentVelocityX = 0;
|
||||
let currentVelocityY = 0;
|
||||
|
||||
if (this.isActive()) {
|
||||
// If active, then we expect this._calcV to be defined.
|
||||
let currentTime = Date.now() - this._initialTime;
|
||||
currentVelocityX = Util.clamp(this._calcV(this._velocity.x, this._acceleration.x, currentTime), -kMaxVelocity, kMaxVelocity);
|
||||
currentVelocityY = Util.clamp(this._calcV(this._velocity.y, this._acceleration.y, currentTime), -kMaxVelocity, kMaxVelocity);
|
||||
}
|
||||
|
||||
if (currentVelocityX * this._velocity.x <= 0)
|
||||
currentVelocityX = 0;
|
||||
if (currentVelocityY * this._velocity.y <= 0)
|
||||
currentVelocityY = 0;
|
||||
|
||||
let swipeTime = Math.min(swipeLength, lastTime - mb[0].t);
|
||||
this._velocity.x = clampFromZero((distanceX / swipeTime) + currentVelocityX, Math.abs(currentVelocityX), 6);
|
||||
this._velocity.y = clampFromZero((distanceY / swipeTime) + currentVelocityY, Math.abs(currentVelocityY), 6);
|
||||
|
||||
// Set acceleration vector to opposite signs of velocity
|
||||
this._acceleration.set(this._velocity.clone().map(sign).scale(-this._decelerationRate));
|
||||
this._acceleration.set(this._velocity.clone().map(sign).scale(-this._polynomialC));
|
||||
|
||||
this._position.set(0, 0);
|
||||
this._initialTime = mozAnimationStartTime;
|
||||
this._time = 0;
|
||||
this.momentumBuffer = [];
|
||||
|
||||
if (!this.isActive())
|
||||
if (!this.isActive() || this._paused)
|
||||
this._startTimer();
|
||||
|
||||
return true;
|
||||
},
|
||||
|
||||
pause: function pause() {
|
||||
this._paused = true;
|
||||
},
|
||||
|
||||
end: function end() {
|
||||
if (this.isActive()) {
|
||||
if (this._beforeEnd)
|
||||
|
@ -8,6 +8,7 @@
|
||||
<!ENTITY enablePlugins.title "Enable Plugins">
|
||||
<!ENTITY privacy.title "Privacy & Security">
|
||||
<!ENTITY allowCookies.title "Allow cookies">
|
||||
<!ENTITY doNotTrack.title "Tell sites not to track me">
|
||||
<!ENTITY clearPrivateData2.title "Clear private data">
|
||||
<!ENTITY clearPrivateData.button "Clear">
|
||||
<!ENTITY rememberPasswords.title "Remember passwords">
|
||||
|
@ -141,16 +141,13 @@ interface nsIPluginHost : nsISupports
|
||||
* specify PR_FALSE)
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
%{C++
|
||||
NS_IMETHOD
|
||||
GetURL(nsISupports* pluginInst,
|
||||
const char* url,
|
||||
const char* target = NULL,
|
||||
nsIPluginStreamListener* streamListener = NULL,
|
||||
const char* altHost = NULL,
|
||||
const char* referrer = NULL,
|
||||
PRBool forceJSEnabled = PR_FALSE) = 0;
|
||||
%}
|
||||
[noscript] void getURL(in nsISupports pluginInt,
|
||||
in string url,
|
||||
in string target,
|
||||
in nsIPluginStreamListener streamListener,
|
||||
in string altHost,
|
||||
in string referrer,
|
||||
in boolean forceJSEnabled);
|
||||
|
||||
/**
|
||||
* Posts to a URL with post data and/or post headers.
|
||||
@ -183,21 +180,18 @@ interface nsIPluginHost : nsISupports
|
||||
* post headers
|
||||
* @result - NS_OK if this operation was successful
|
||||
*/
|
||||
%{C++
|
||||
NS_IMETHOD
|
||||
PostURL(nsISupports* pluginInst,
|
||||
const char* url,
|
||||
PRUint32 postDataLen,
|
||||
const char* postData,
|
||||
PRBool isFile = PR_FALSE,
|
||||
const char* target = NULL,
|
||||
nsIPluginStreamListener* streamListener = NULL,
|
||||
const char* altHost = NULL,
|
||||
const char* referrer = NULL,
|
||||
PRBool forceJSEnabled = PR_FALSE,
|
||||
PRUint32 postHeadersLength = 0,
|
||||
const char* postHeaders = NULL) = 0;
|
||||
%}
|
||||
[noscript] void postURL(in nsISupports pluginInst,
|
||||
in string url,
|
||||
in PRUint32 postDataLen,
|
||||
in string postData,
|
||||
in boolean isFile,
|
||||
in string target,
|
||||
in nsIPluginStreamListener streamListener,
|
||||
in string altHost,
|
||||
in string referrer,
|
||||
in boolean forceJSEnabled,
|
||||
in PRUint32 postHeadersLength,
|
||||
in string postHeaders);
|
||||
|
||||
/**
|
||||
* Returns the proxy info for a given URL. The caller is required to
|
||||
@ -284,19 +278,9 @@ interface nsIPluginHost : nsISupports
|
||||
*/
|
||||
[noscript] nsIPluginTag getPluginTagForInstance(in nsIPluginInstance aInstance);
|
||||
|
||||
%{C++
|
||||
virtual void AddIdleTimeTarget(nsIPluginInstanceOwner* objectFrame, PRBool isVisible) = 0;
|
||||
virtual void RemoveIdleTimeTarget(nsIPluginInstanceOwner* objectFrame) = 0;
|
||||
%}
|
||||
};
|
||||
[noscript, notxpcom] void addIdleTimeTarget(in nsIPluginInstanceOwner objectFrame, in boolean isVisible);
|
||||
[noscript, notxpcom] void removeIdleTimeTarget(in nsIPluginInstanceOwner objectFrame);
|
||||
|
||||
/*
|
||||
* Methods for clearing plugin private data. These should be moved onto
|
||||
* nsIPluginHost proper post-Gecko 2.0.
|
||||
*/
|
||||
[scriptable, uuid(0b0a2fb8-dc2b-4df2-b721-4b7a4008df6c)]
|
||||
interface nsIPluginHost_MOZILLA_2_0_BRANCH : nsISupports
|
||||
{
|
||||
/*
|
||||
* Flags for use with clearSiteData.
|
||||
*
|
||||
|
@ -253,24 +253,13 @@ interface nsIPluginInstance : nsISupports
|
||||
*/
|
||||
void notifyPainted();
|
||||
|
||||
/**
|
||||
* This should return a valid gfxASurface pointer, or null if there is nothing to render yet.
|
||||
* NO LONGER USED. Do not call.
|
||||
*/
|
||||
void getSurface(out gfxASurfacePtr aSurface);
|
||||
|
||||
/**
|
||||
* @return true if plugin module supports async rendering
|
||||
*/
|
||||
PRBool useAsyncPainting();
|
||||
};
|
||||
|
||||
|
||||
// XXX kill me after branching
|
||||
[noscript, uuid(24235105-ac5f-483b-86ec-7c9446ddcb8a)]
|
||||
interface nsIPluginInstance_MOZILLA_2_0_BRANCH : nsIPluginInstance
|
||||
{
|
||||
PRBool isRemoteDrawingCoreAnimation();
|
||||
|
||||
/**
|
||||
* Returns a new Image object which draws an asynchronously-rendered
|
||||
* plugin. The Image is created using aContainer.
|
||||
@ -278,6 +267,7 @@ interface nsIPluginInstance_MOZILLA_2_0_BRANCH : nsIPluginInstance
|
||||
* been received, or if the plugin is not using async rendering.
|
||||
*/
|
||||
void getImage(in ImageContainerPtr aContainer, out ImagePtr aImage);
|
||||
|
||||
/**
|
||||
* Returns the size of the Image object that would be created if we called
|
||||
* getImage.
|
||||
@ -285,6 +275,7 @@ interface nsIPluginInstance_MOZILLA_2_0_BRANCH : nsIPluginInstance
|
||||
* been received, or if the plugin is not using async rendering.
|
||||
*/
|
||||
void getImageSize(in nsIntSizePtr aSize);
|
||||
|
||||
/**
|
||||
* This is the second leg in the trip to PluginInstanceParent. It
|
||||
* approximately follows the ReadbackSink API.
|
||||
|
@ -148,14 +148,7 @@ interface nsIPluginInstanceOwner : nsISupports
|
||||
%{C++
|
||||
virtual void SendIdleEvent() = 0;
|
||||
%}
|
||||
};
|
||||
|
||||
/**
|
||||
* This interface extends nsIPluginInstanceOwner for the 2.0 branch
|
||||
*/
|
||||
[uuid(20504739-4519-45f3-a8f7-fc8afba7ea87)]
|
||||
interface nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH : nsISupports
|
||||
{
|
||||
/**
|
||||
* Call NPP_SetWindow on the plugin.
|
||||
*/
|
||||
|
@ -246,12 +246,6 @@ PluginPRLibrary::AsyncSetWindow(NPP instance, NPWindow* window)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
nsresult
|
||||
PluginPRLibrary::GetSurface(NPP instance, gfxASurface** aSurface)
|
||||
{
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
nsresult
|
||||
PluginPRLibrary::GetImage(NPP instance, ImageContainer* aContainer, Image** aImage)
|
||||
{
|
||||
|
@ -140,7 +140,6 @@ public:
|
||||
virtual nsresult NPP_GetSitesWithData(InfallibleTArray<nsCString>& result);
|
||||
|
||||
virtual nsresult AsyncSetWindow(NPP instance, NPWindow* window);
|
||||
virtual nsresult GetSurface(NPP instance, gfxASurface** aSurface);
|
||||
virtual nsresult GetImage(NPP instance, ImageContainer* aContainer, Image** aImage);
|
||||
virtual nsresult GetImageSize(NPP instance, nsIntSize* aSize);
|
||||
NS_OVERRIDE virtual bool UseAsyncPainting() { return false; }
|
||||
|
@ -619,13 +619,14 @@ MakeNewNPAPIStreamInternal(NPP npp, const char *relativeURL, const char *target,
|
||||
switch (type) {
|
||||
case eNPPStreamTypeInternal_Get:
|
||||
{
|
||||
if (NS_FAILED(pluginHost->GetURL(inst, relativeURL, target, listener)))
|
||||
if (NS_FAILED(pluginHost->GetURL(inst, relativeURL, target, listener,
|
||||
NULL, NULL, false)))
|
||||
return NPERR_GENERIC_ERROR;
|
||||
break;
|
||||
}
|
||||
case eNPPStreamTypeInternal_Post:
|
||||
{
|
||||
if (NS_FAILED(pluginHost->PostURL(inst, relativeURL, len, buf, file, target, listener)))
|
||||
if (NS_FAILED(pluginHost->PostURL(inst, relativeURL, len, buf, file, target, listener, NULL, NULL, false, 0, NULL)))
|
||||
return NPERR_GENERIC_ERROR;
|
||||
break;
|
||||
}
|
||||
|
@ -50,7 +50,6 @@
|
||||
#include "nsPluginLogging.h"
|
||||
#include "nsIPrivateBrowsingService.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsIContentUtils.h"
|
||||
|
||||
#include "nsIDocument.h"
|
||||
#include "nsIScriptGlobalObject.h"
|
||||
@ -65,7 +64,7 @@ using namespace mozilla::plugins::parent;
|
||||
static NS_DEFINE_IID(kIOutputStreamIID, NS_IOUTPUTSTREAM_IID);
|
||||
static NS_DEFINE_IID(kIPluginStreamListenerIID, NS_IPLUGINSTREAMLISTENER_IID);
|
||||
|
||||
NS_IMPL_ISUPPORTS2(nsNPAPIPluginInstance, nsIPluginInstance, nsIPluginInstance_MOZILLA_2_0_BRANCH)
|
||||
NS_IMPL_ISUPPORTS1(nsNPAPIPluginInstance, nsIPluginInstance)
|
||||
|
||||
nsNPAPIPluginInstance::nsNPAPIPluginInstance(nsNPAPIPlugin* plugin)
|
||||
:
|
||||
@ -878,19 +877,6 @@ nsNPAPIPluginInstance::AsyncSetWindow(NPWindow* window)
|
||||
return library->AsyncSetWindow(&mNPP, window);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNPAPIPluginInstance::GetSurface(gfxASurface** aSurface)
|
||||
{
|
||||
if (RUNNING != mRunning)
|
||||
return NS_OK;
|
||||
|
||||
AutoPluginLibraryCall library(this);
|
||||
if (!library)
|
||||
return NS_ERROR_FAILURE;
|
||||
|
||||
return library->GetSurface(&mNPP, aSurface);
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsNPAPIPluginInstance::GetImage(ImageContainer* aContainer, Image** aImage)
|
||||
{
|
||||
@ -1375,17 +1361,8 @@ NS_IMETHODIMP
|
||||
CarbonEventModelFailureEvent::Run()
|
||||
{
|
||||
nsString type = NS_LITERAL_STRING("npapi-carbon-event-model-failure");
|
||||
#ifdef MOZ_ENABLE_LIBXUL
|
||||
nsContentUtils::DispatchTrustedEvent(mContent->GetDocument(), mContent,
|
||||
type, PR_TRUE, PR_TRUE);
|
||||
#else
|
||||
nsCOMPtr<nsIContentUtils_MOZILLA_2_0_BRANCH> cu =
|
||||
do_GetService("@mozilla.org/content/contentutils-moz2.0;1");
|
||||
if (cu) {
|
||||
cu->DispatchTrustedEvent(mContent->GetDocument(), mContent,
|
||||
type, PR_TRUE, PR_TRUE);
|
||||
}
|
||||
#endif
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ public:
|
||||
void (*callback)(NPP npp, uint32_t timerID);
|
||||
};
|
||||
|
||||
class nsNPAPIPluginInstance : public nsIPluginInstance_MOZILLA_2_0_BRANCH
|
||||
class nsNPAPIPluginInstance : public nsIPluginInstance
|
||||
{
|
||||
private:
|
||||
typedef mozilla::PluginLibrary PluginLibrary;
|
||||
@ -75,7 +75,6 @@ private:
|
||||
public:
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIPLUGININSTANCE
|
||||
NS_DECL_NSIPLUGININSTANCE_MOZILLA_2_0_BRANCH
|
||||
|
||||
nsNPAPIPlugin* GetPlugin();
|
||||
|
||||
|
@ -431,9 +431,8 @@ nsPluginHost::~nsPluginHost()
|
||||
sInst = nsnull;
|
||||
}
|
||||
|
||||
NS_IMPL_ISUPPORTS5(nsPluginHost,
|
||||
NS_IMPL_ISUPPORTS4(nsPluginHost,
|
||||
nsIPluginHost,
|
||||
nsIPluginHost_MOZILLA_2_0_BRANCH,
|
||||
nsIObserver,
|
||||
nsITimerCallback,
|
||||
nsISupportsWeakReference)
|
||||
@ -1108,9 +1107,7 @@ nsPluginHost::DoInstantiateEmbeddedPlugin(const char *aMimeType, nsIURI* aURL,
|
||||
aOwner->CreateWidget();
|
||||
|
||||
// If we've got a native window, the let the plugin know about it.
|
||||
nsCOMPtr<nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH> owner = do_QueryInterface(aOwner);
|
||||
if (owner)
|
||||
owner->SetWindow();
|
||||
aOwner->SetWindow();
|
||||
|
||||
// create an initial stream with data
|
||||
// don't make the stream if it's a java applet or we don't have SRC or DATA attribute
|
||||
@ -1185,15 +1182,12 @@ NS_IMETHODIMP nsPluginHost::InstantiateFullPagePlugin(const char *aMimeType,
|
||||
aOwner->CreateWidget();
|
||||
|
||||
// If we've got a native window, the let the plugin know about it.
|
||||
nsCOMPtr<nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH> owner = do_QueryInterface(aOwner);
|
||||
if (owner)
|
||||
owner->SetWindow();
|
||||
aOwner->SetWindow();
|
||||
|
||||
rv = NewFullPagePluginStream(aURI, instance, aStreamListener);
|
||||
|
||||
// If we've got a native window, the let the plugin know about it.
|
||||
if (owner)
|
||||
owner->SetWindow();
|
||||
aOwner->SetWindow();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1248,9 +1242,7 @@ nsresult nsPluginHost::FindStoppedPluginForURL(nsIURI* aURL,
|
||||
aOwner->CreateWidget();
|
||||
|
||||
// If we've got a native window, the let the plugin know about it.
|
||||
nsCOMPtr<nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH> owner = do_QueryInterface(aOwner);
|
||||
if (owner)
|
||||
owner->SetWindow();
|
||||
aOwner->SetWindow();
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -90,7 +90,6 @@ public:
|
||||
};
|
||||
|
||||
class nsPluginHost : public nsIPluginHost,
|
||||
public nsIPluginHost_MOZILLA_2_0_BRANCH,
|
||||
public nsIObserver,
|
||||
public nsITimerCallback,
|
||||
public nsSupportsWeakReference
|
||||
@ -105,33 +104,9 @@ public:
|
||||
|
||||
NS_DECL_ISUPPORTS
|
||||
NS_DECL_NSIPLUGINHOST
|
||||
NS_DECL_NSIPLUGINHOST_MOZILLA_2_0_BRANCH
|
||||
NS_DECL_NSIOBSERVER
|
||||
NS_DECL_NSITIMERCALLBACK
|
||||
|
||||
NS_IMETHOD
|
||||
GetURL(nsISupports* pluginInst,
|
||||
const char* url,
|
||||
const char* target = NULL,
|
||||
nsIPluginStreamListener* streamListener = NULL,
|
||||
const char* altHost = NULL,
|
||||
const char* referrer = NULL,
|
||||
PRBool forceJSEnabled = PR_FALSE);
|
||||
|
||||
NS_IMETHOD
|
||||
PostURL(nsISupports* pluginInst,
|
||||
const char* url,
|
||||
PRUint32 postDataLen,
|
||||
const char* postData,
|
||||
PRBool isFile = PR_FALSE,
|
||||
const char* target = NULL,
|
||||
nsIPluginStreamListener* streamListener = NULL,
|
||||
const char* altHost = NULL,
|
||||
const char* referrer = NULL,
|
||||
PRBool forceJSEnabled = PR_FALSE,
|
||||
PRUint32 postHeadersLength = 0,
|
||||
const char* postHeaders = NULL);
|
||||
|
||||
nsresult
|
||||
NewPluginURLStream(const nsString& aURL,
|
||||
nsNPAPIPluginInstance *aInstance,
|
||||
@ -173,9 +148,6 @@ public:
|
||||
|
||||
static nsresult PostPluginUnloadEvent(PRLibrary* aLibrary);
|
||||
|
||||
void AddIdleTimeTarget(nsIPluginInstanceOwner* objectFrame, PRBool isVisible);
|
||||
void RemoveIdleTimeTarget(nsIPluginInstanceOwner* objectFrame);
|
||||
|
||||
void PluginCrashed(nsNPAPIPlugin* plugin,
|
||||
const nsAString& pluginDumpID,
|
||||
const nsAString& browserDumpID);
|
||||
|
@ -672,9 +672,7 @@ nsPluginStreamListenerPeer::OnStartRequest(nsIRequest *request,
|
||||
mPluginInstance->Start();
|
||||
mOwner->CreateWidget();
|
||||
// If we've got a native window, the let the plugin know about it.
|
||||
nsCOMPtr<nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH> owner = do_QueryInterface(mOwner);
|
||||
if (owner)
|
||||
owner->SetWindow();
|
||||
mOwner->SetWindow();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -876,9 +874,7 @@ nsresult nsPluginStreamListenerPeer::ServeStreamAsFile(nsIRequest *request,
|
||||
window->window = widget->GetNativeData(NS_NATIVE_PLUGIN_PORT);
|
||||
}
|
||||
#endif
|
||||
nsCOMPtr<nsIPluginInstanceOwner_MOZILLA_2_0_BRANCH> owner = do_QueryInterface(mOwner);
|
||||
if (owner)
|
||||
owner->SetWindow();
|
||||
mOwner->SetWindow();
|
||||
}
|
||||
|
||||
mSeekable = PR_FALSE;
|
||||
|
@ -12,7 +12,7 @@
|
||||
netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');
|
||||
SimpleTest.waitForExplicitFinish();
|
||||
|
||||
const pluginHostIface = Components.interfaces.nsIPluginHost_MOZILLA_2_0_BRANCH;
|
||||
const pluginHostIface = Components.interfaces.nsIPluginHost;
|
||||
var pluginHost = Components.classes["@mozilla.org/plugin/host;1"].
|
||||
getService(pluginHostIface);
|
||||
const FLAG_CLEAR_ALL = pluginHostIface.FLAG_CLEAR_ALL;
|
||||
|
@ -45,6 +45,8 @@
|
||||
#include "AndroidBridge.h"
|
||||
#include "nsAppShell.h"
|
||||
#include "nsOSHelperAppService.h"
|
||||
#include "nsIPrefService.h"
|
||||
#include "nsWindow.h"
|
||||
|
||||
#ifdef DEBUG
|
||||
#define ALOG_BRIDGE(args...) ALOG(args)
|
||||
@ -52,6 +54,9 @@
|
||||
#define ALOG_BRIDGE(args...)
|
||||
#endif
|
||||
|
||||
#define IME_FULLSCREEN_PREF "widget.ime.android.landscape_fullscreen"
|
||||
#define IME_FULLSCREEN_THRESHOLD_PREF "widget.ime.android.fullscreen_threshold"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
static PRUintn sJavaEnvThreadIndex = 0;
|
||||
@ -103,7 +108,7 @@ AndroidBridge::Init(JNIEnv *jEnv,
|
||||
mGeckoAppShellClass = (jclass) jEnv->NewGlobalRef(jGeckoAppShellClass);
|
||||
|
||||
jNotifyIME = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIME", "(II)V");
|
||||
jNotifyIMEEnabled = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIMEEnabled", "(ILjava/lang/String;Ljava/lang/String;)V");
|
||||
jNotifyIMEEnabled = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIMEEnabled", "(ILjava/lang/String;Ljava/lang/String;Z)V");
|
||||
jNotifyIMEChange = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "notifyIMEChange", "(Ljava/lang/String;III)V");
|
||||
jAcknowledgeEventSync = (jmethodID) jEnv->GetStaticMethodID(jGeckoAppShellClass, "acknowledgeEventSync", "()V");
|
||||
|
||||
@ -237,11 +242,35 @@ AndroidBridge::NotifyIMEEnabled(int aState, const nsAString& aTypeHint,
|
||||
nsPromiseFlatString typeHint(aTypeHint);
|
||||
nsPromiseFlatString actionHint(aActionHint);
|
||||
|
||||
jvalue args[3];
|
||||
jvalue args[4];
|
||||
AutoLocalJNIFrame jniFrame(1);
|
||||
args[0].i = aState;
|
||||
args[1].l = JNI()->NewString(typeHint.get(), typeHint.Length());
|
||||
args[2].l = JNI()->NewString(actionHint.get(), actionHint.Length());
|
||||
args[3].z = false;
|
||||
nsCOMPtr<nsIPrefBranch> prefs =
|
||||
do_GetService(NS_PREFSERVICE_CONTRACTID);
|
||||
if (prefs) {
|
||||
PRInt32 landscapeFS;
|
||||
nsresult rv = prefs->GetIntPref(IME_FULLSCREEN_PREF, &landscapeFS);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
if (landscapeFS == 1) {
|
||||
args[3].z = true;
|
||||
} else if (landscapeFS == -1){
|
||||
rv = prefs->GetIntPref(IME_FULLSCREEN_THRESHOLD_PREF,
|
||||
&landscapeFS);
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
// the threshold is hundreths of inches, so convert the
|
||||
// threshold to pixels and multiply the height by 100
|
||||
if (nsWindow::GetAndroidScreenBounds().height * 100 <
|
||||
landscapeFS * Bridge()->GetDPI())
|
||||
args[3].z = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
JNI()->CallStaticVoidMethodA(sBridge->mGeckoAppShellClass,
|
||||
sBridge->jNotifyIMEEnabled, args);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user