summaryrefslogtreecommitdiffstats
path: root/layout
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-05-12 14:32:03 +0200
committerwolfbeast <mcwerewolf@gmail.com>2018-05-12 14:32:03 +0200
commitb7d9dad58e5a3f87a6c767412941700bc8010044 (patch)
treef5e99b3029cf54409ae5951e9e91cca3a54addc7 /layout
parent73cdd6117df7c17b76aad93952cf574c494351aa (diff)
downloadUXP-b7d9dad58e5a3f87a6c767412941700bc8010044.tar
UXP-b7d9dad58e5a3f87a6c767412941700bc8010044.tar.gz
UXP-b7d9dad58e5a3f87a6c767412941700bc8010044.tar.lz
UXP-b7d9dad58e5a3f87a6c767412941700bc8010044.tar.xz
UXP-b7d9dad58e5a3f87a6c767412941700bc8010044.zip
Remove MOZ_B2G leftovers and some dead B2G-only components.
Diffstat (limited to 'layout')
-rw-r--r--layout/base/FrameLayerBuilder.cpp10
-rw-r--r--layout/base/nsIPresShell.h9
-rw-r--r--layout/base/nsPresShell.cpp68
-rw-r--r--layout/base/nsPresShell.h9
-rw-r--r--layout/build/nsLayoutModule.cpp20
-rw-r--r--layout/generic/nsGfxScrollFrame.cpp4
6 files changed, 3 insertions, 117 deletions
diff --git a/layout/base/FrameLayerBuilder.cpp b/layout/base/FrameLayerBuilder.cpp
index 9269c2ab6..183285439 100644
--- a/layout/base/FrameLayerBuilder.cpp
+++ b/layout/base/FrameLayerBuilder.cpp
@@ -2346,15 +2346,7 @@ ContainerState::GetLayerCreationHint(AnimatedGeometryRoot* aAnimatedGeometryRoot
break;
}
nsIScrollableFrame* scrollable = do_QueryFrame(fParent);
- if (scrollable
- #ifdef MOZ_B2G
- && scrollable->WantAsyncScroll()
- #endif
- ) {
- // WantAsyncScroll() returns false when the frame has overflow:hidden,
- // so we won't create tiled layers for overflow:hidden frames even if
- // they have a display port. The main purpose of the WantAsyncScroll check
- // is to allow the B2G camera app to use hardware composer for compositing.
+ if (scrollable) {
return LayerManager::SCROLLABLE;
}
}
diff --git a/layout/base/nsIPresShell.h b/layout/base/nsIPresShell.h
index 5990402ed..4016cc0a9 100644
--- a/layout/base/nsIPresShell.h
+++ b/layout/base/nsIPresShell.h
@@ -51,10 +51,6 @@
#include "nsFrameState.h"
#include "Units.h"
-#ifdef MOZ_B2G
-#include "nsIHardwareKeyHandler.h"
-#endif
-
class nsDocShell;
class nsIDocument;
class nsIFrame;
@@ -1766,11 +1762,6 @@ protected:
// moving/sizing loop is running, see bug 491700 for details.
nsCOMPtr<nsITimer> mReflowContinueTimer;
-#ifdef MOZ_B2G
- // Forward hardware key events to the input-method-app
- nsCOMPtr<nsIHardwareKeyHandler> mHardwareKeyHandler;
-#endif // MOZ_B2G
-
#ifdef DEBUG
nsIFrame* mDrawEventTargetFrame;
diff --git a/layout/base/nsPresShell.cpp b/layout/base/nsPresShell.cpp
index 42b39c860..0b88948c3 100644
--- a/layout/base/nsPresShell.cpp
+++ b/layout/base/nsPresShell.cpp
@@ -201,10 +201,6 @@
#include "nsIDocShellTreeOwner.h"
#endif
-#ifdef MOZ_B2G
-#include "nsIHardwareKeyHandler.h"
-#endif
-
#ifdef MOZ_TASK_TRACER
#include "GeckoTaskTracer.h"
using namespace mozilla::tasktracer;
@@ -7236,38 +7232,6 @@ PresShell::HandleKeyboardEvent(nsINode* aTarget,
DispatchAfterKeyboardEventInternal(chain, aEvent, aEvent.DefaultPrevented());
}
-#ifdef MOZ_B2G
-bool
-PresShell::ForwardKeyToInputMethodApp(nsINode* aTarget,
- WidgetKeyboardEvent& aEvent,
- nsEventStatus* aStatus)
-{
- if (!XRE_IsParentProcess() || aEvent.mIsSynthesizedByTIP ||
- aEvent.IsKeyEventOnPlugin()) {
- return false;
- }
-
- if (!mHardwareKeyHandler) {
- nsresult rv;
- mHardwareKeyHandler =
- do_GetService("@mozilla.org/HardwareKeyHandler;1", &rv);
- if (!NS_SUCCEEDED(rv) || !mHardwareKeyHandler) {
- return false;
- }
- }
-
- if (mHardwareKeyHandler->ForwardKeyToInputMethodApp(aTarget,
- aEvent.AsKeyboardEvent(),
- aStatus)) {
- // No need to dispatch the forwarded keyboard event to it's child process
- aEvent.mFlags.mNoCrossProcessBoundaryForwarding = true;
- return true;
- }
-
- return false;
-}
-#endif // MOZ_B2G
-
bool
PresShell::ForwardKeyToInputMethodAppOrDispatch(bool aIsTargetRemote,
nsINode* aTarget,
@@ -7275,41 +7239,9 @@ PresShell::ForwardKeyToInputMethodAppOrDispatch(bool aIsTargetRemote,
nsEventStatus* aStatus,
EventDispatchingCallback* aEventCB)
{
-#ifndef MOZ_B2G
- // No need to forward to input-method-app if the platform isn't run on B2G.
EventDispatcher::Dispatch(aTarget, mPresContext,
&aEvent, nullptr, aStatus, aEventCB);
return false;
-#else
- // In-process case: the event target is in the current process
- if (!aIsTargetRemote) {
- if(ForwardKeyToInputMethodApp(aTarget, aEvent, aStatus)) {
- return true;
- }
-
- // If the keyboard event isn't forwarded to the input-method-app,
- // then it should be dispatched to its event target directly.
- EventDispatcher::Dispatch(aTarget, mPresContext,
- &aEvent, nullptr, aStatus, aEventCB);
-
- return false;
- }
-
- // OOP case: the event target is in its child process.
- // Dispatch the keyboard event to the iframe that embeds the remote
- // event target first.
- EventDispatcher::Dispatch(aTarget, mPresContext,
- &aEvent, nullptr, aStatus, aEventCB);
-
- // If the event is defaultPrevented, then there is no need to forward it
- // to the input-method-app.
- if (aEvent.mFlags.mDefaultPrevented) {
- return false;
- }
-
- // Try forwarding to the input-method-app.
- return ForwardKeyToInputMethodApp(aTarget, aEvent, aStatus);
-#endif // MOZ_B2G
}
nsresult
diff --git a/layout/base/nsPresShell.h b/layout/base/nsPresShell.h
index ad4ede08b..7a9056a38 100644
--- a/layout/base/nsPresShell.h
+++ b/layout/base/nsPresShell.h
@@ -815,15 +815,6 @@ protected:
bool aEmbeddedCancelled,
size_t aChainIndex = 0);
-#ifdef MOZ_B2G
- // This method is used to forward the keyboard event to the input-method-app
- // before the event is dispatched to its event target.
- // Return true if it's successfully forwarded. Otherwise, return false.
- bool ForwardKeyToInputMethodApp(nsINode* aTarget,
- mozilla::WidgetKeyboardEvent& aEvent,
- nsEventStatus* aStatus);
-#endif // MOZ_B2G
-
// This method tries forwarding key events to the input-method-editor(IME).
// If the event isn't be forwarded, then it will be dispathed to its target.
// Return true when event is successfully forwarded to the input-method-editor.
diff --git a/layout/build/nsLayoutModule.cpp b/layout/build/nsLayoutModule.cpp
index ab301a627..ae0db06ab 100644
--- a/layout/build/nsLayoutModule.cpp
+++ b/layout/build/nsLayoutModule.cpp
@@ -213,11 +213,6 @@ static void Shutdown();
#include "mozilla/TextInputProcessor.h"
-#ifdef MOZ_B2G
-#include "nsIHardwareKeyHandler.h"
-#include "mozilla/HardwareKeyHandler.h"
-#endif
-
using namespace mozilla;
using namespace mozilla::dom;
using mozilla::dom::power::PowerManagerService;
@@ -608,11 +603,6 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(UDPSocketChild)
NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(GeckoMediaPluginService, GeckoMediaPluginService::GetGeckoMediaPluginService)
-#ifdef MOZ_B2G
-NS_GENERIC_FACTORY_SINGLETON_CONSTRUCTOR(nsIHardwareKeyHandler,
- HardwareKeyHandler::GetInstance)
-#endif
-
#ifdef ACCESSIBILITY
#include "xpcAccessibilityService.h"
@@ -788,10 +778,6 @@ NS_DEFINE_NAMED_CID(PRESENTATION_TCP_SESSION_TRANSPORT_CID);
NS_DEFINE_NAMED_CID(TEXT_INPUT_PROCESSOR_CID);
-#ifdef MOZ_B2G
-NS_DEFINE_NAMED_CID(NS_HARDWARE_KEY_HANDLER_CID);
-#endif
-
static nsresult
CreateWindowCommandTableConstructor(nsISupports *aOuter,
REFNSIID aIID, void **aResult)
@@ -1063,9 +1049,6 @@ static const mozilla::Module::CIDEntry kLayoutCIDs[] = {
{ &kPRESENTATION_DEVICE_MANAGER_CID, false, nullptr, PresentationDeviceManagerConstructor },
{ &kPRESENTATION_TCP_SESSION_TRANSPORT_CID, false, nullptr, PresentationTCPSessionTransportConstructor },
{ &kTEXT_INPUT_PROCESSOR_CID, false, nullptr, TextInputProcessorConstructor },
-#ifdef MOZ_B2G
- { &kNS_HARDWARE_KEY_HANDLER_CID, false, nullptr, nsIHardwareKeyHandlerConstructor },
-#endif
{ nullptr }
};
@@ -1210,9 +1193,6 @@ static const mozilla::Module::ContractIDEntry kLayoutContracts[] = {
{ PRESENTATION_DEVICE_MANAGER_CONTRACTID, &kPRESENTATION_DEVICE_MANAGER_CID },
{ PRESENTATION_TCP_SESSION_TRANSPORT_CONTRACTID, &kPRESENTATION_TCP_SESSION_TRANSPORT_CID },
{ "@mozilla.org/text-input-processor;1", &kTEXT_INPUT_PROCESSOR_CID },
-#ifdef MOZ_B2G
- { NS_HARDWARE_KEY_HANDLER_CONTRACTID, &kNS_HARDWARE_KEY_HANDLER_CID },
-#endif
{ nullptr }
};
diff --git a/layout/generic/nsGfxScrollFrame.cpp b/layout/generic/nsGfxScrollFrame.cpp
index f664845b6..ccdc3a0ce 100644
--- a/layout/generic/nsGfxScrollFrame.cpp
+++ b/layout/generic/nsGfxScrollFrame.cpp
@@ -1266,7 +1266,7 @@ ScrollFrameHelper::HandleScrollbarStyleSwitching()
}
}
-#if defined(MOZ_B2G) || defined(MOZ_WIDGET_ANDROID)
+#if defined(MOZ_WIDGET_ANDROID)
static bool IsFocused(nsIContent* aContent)
{
// Some content elements, like the GetContent() of a scroll frame
@@ -1315,7 +1315,7 @@ ScrollFrameHelper::WantAsyncScroll() const
bool isHScrollable = (scrollRange.width >= oneDevPixel) &&
(styles.mHorizontal != NS_STYLE_OVERFLOW_HIDDEN);
-#if defined(MOZ_B2G) || defined(MOZ_WIDGET_ANDROID)
+#if defined(MOZ_WIDGET_ANDROID)
// Mobile platforms need focus to scroll.
bool canScrollWithoutScrollbars = IsFocused(mOuter->GetContent());
#else