Bug 1442176 - 1. Remove current pin-on-caret-drag code; r=snorp

Remove the current code that pins the toolbar on caret drag, which only
works for Fennec.

Differential Revision: https://phabricator.services.mozilla.com/D5189
This commit is contained in:
Jim Chen 2018-09-17 17:47:21 -04:00
parent 0aa327aaa4
commit e87c3096e6
4 changed files with 0 additions and 50 deletions

View File

@ -27,9 +27,6 @@
#include "nsFrameSelection.h"
#include "nsGenericHTMLElement.h"
#include "nsIHapticFeedback.h"
#ifdef MOZ_WIDGET_ANDROID
#include "nsWindow.h"
#endif
namespace mozilla {
@ -894,17 +891,6 @@ AccessibleCaretManager::SetSelectionDragState(bool aState) const
if (fs) {
fs->SetDragState(aState);
}
// Pin Fennecs DynamicToolbarAnimator in place before/after dragging,
// to avoid co-incident screen scrolling.
#ifdef MOZ_WIDGET_ANDROID
if (XRE_IsParentProcess()) {
nsIDocument* doc = mPresShell->GetDocument();
MOZ_ASSERT(doc);
nsIWidget* widget = nsContentUtils::WidgetForDocument(doc);
static_cast<nsWindow*>(widget)->SetSelectionDragState(aState);
}
#endif
}
bool

View File

@ -140,13 +140,6 @@ public class LayerSession {
private void updateOverscrollOffset(final float x, final float y) {
LayerSession.this.updateOverscrollOffset(x, y);
}
@WrapForJNI(calledFrom = "ui")
private void onSelectionCaretDrag(final boolean dragging) {
// Active SelectionCaretDrag requires DynamicToolbarAnimator to be pinned to
// avoid unwanted scroll interactions.
LayerSession.this.onSelectionCaretDrag(dragging);
}
}
protected final Compositor mCompositor = new Compositor();
@ -482,16 +475,6 @@ public class LayerSession {
mOverscroll.setDistance(y, OverscrollEdgeEffect.AXIS_Y);
}
/* package */ void onSelectionCaretDrag(final boolean dragging) {
if (DEBUG) {
ThreadUtils.assertOnUiThread();
}
if (mToolbar != null) {
mToolbar.setPinned(dragging, DynamicToolbarAnimator.PinReason.CARET_DRAG);
}
}
/* package */ void onMetricsChanged(final float scrollX, final float scrollY,
final float zoom) {
if (DEBUG) {

View File

@ -1945,24 +1945,6 @@ nsWindow::UpdateOverscrollOffset(const float aX, const float aY)
}
}
void
nsWindow::SetSelectionDragState(bool aState)
{
MOZ_ASSERT(NS_IsMainThread());
if (!mLayerViewSupport) {
return;
}
const auto& compositor = mLayerViewSupport->GetJavaCompositor();
DispatchToUiThread(
"nsWindow::SetSelectionDragState",
[compositor = LayerSession::Compositor::GlobalRef(compositor),
aState] {
compositor->OnSelectionCaretDrag(aState);
});
}
void *
nsWindow::GetNativeData(uint32_t aDataType)
{

View File

@ -268,7 +268,6 @@ public:
const InputContextAction& aAction) override;
virtual InputContext GetInputContext() override;
void SetSelectionDragState(bool aState);
LayerManager* GetLayerManager(PLayerTransactionChild* aShadowManager = nullptr,
LayersBackend aBackendHint = mozilla::layers::LayersBackend::LAYERS_NONE,
LayerManagerPersistence aPersistence = LAYER_MANAGER_CURRENT) override;