зеркало из https://github.com/mozilla/gecko-dev.git
Backed out changeset 0f7fe4800ace for landing with the wrong bug number.
--HG-- extra : rebase_source : fe37a4e6b566cb2121079ad95bfdce99ab997d33
This commit is contained in:
Родитель
9e0116a4f7
Коммит
b3ab357b12
|
@ -333,7 +333,6 @@ var shell = {
|
|||
this.contentBrowser.addEventListener('mozbrowserloadstart', this, true);
|
||||
this.contentBrowser.addEventListener('mozbrowserselectionchange', this, true);
|
||||
this.contentBrowser.addEventListener('mozbrowserscrollviewchange', this, true);
|
||||
this.contentBrowser.addEventListener('mozbrowsertouchcarettap', this, true);
|
||||
|
||||
CustomEventManager.init();
|
||||
WebappsHelper.init();
|
||||
|
@ -362,7 +361,6 @@ var shell = {
|
|||
this.contentBrowser.removeEventListener('mozbrowserloadstart', this, true);
|
||||
this.contentBrowser.removeEventListener('mozbrowserselectionchange', this, true);
|
||||
this.contentBrowser.removeEventListener('mozbrowserscrollviewchange', this, true);
|
||||
this.contentBrowser.removeEventListener('mozbrowsertouchcarettap', this, true);
|
||||
ppmm.removeMessageListener("content-handler", this);
|
||||
|
||||
UserAgentOverrides.uninit();
|
||||
|
@ -510,12 +508,6 @@ var shell = {
|
|||
detail: evt.detail,
|
||||
});
|
||||
break;
|
||||
case 'mozbrowsertouchcarettap':
|
||||
this.sendChromeEvent({
|
||||
type: 'touchcarettap',
|
||||
detail: evt.detail,
|
||||
});
|
||||
break;
|
||||
case 'mozbrowserselectionchange':
|
||||
// The mozbrowserselectionchange event, may have crossed the chrome-content boundary.
|
||||
// This event always dispatch to shell.js. But the offset we got from this event is
|
||||
|
|
|
@ -226,12 +226,6 @@ BrowserElementChild.prototype = {
|
|||
/* useCapture = */ false,
|
||||
/* wantsUntrusted = */ false);
|
||||
|
||||
addEventListener('touchcarettap',
|
||||
this._touchCaretTapHandler.bind(this),
|
||||
/* useCapture = */ false,
|
||||
/* wantsUntrusted = */ false);
|
||||
|
||||
|
||||
// This listens to unload events from our message manager, but /not/ from
|
||||
// the |content| window. That's because the window's unload event doesn't
|
||||
// bubble, and we're not using a capturing listener. If we'd used
|
||||
|
@ -637,11 +631,6 @@ BrowserElementChild.prototype = {
|
|||
sendAsyncMsg('metachange', meta);
|
||||
},
|
||||
|
||||
_touchCaretTapHandler: function(e) {
|
||||
e.stopPropagation();
|
||||
sendAsyncMsg('touchcarettap');
|
||||
},
|
||||
|
||||
_ScrollViewChangeHandler: function(e) {
|
||||
e.stopPropagation();
|
||||
let detail = {
|
||||
|
|
|
@ -258,8 +258,7 @@ BrowserElementParent.prototype = {
|
|||
"visibilitychange": this._childVisibilityChange,
|
||||
"got-set-input-method-active": this._gotDOMRequestResult,
|
||||
"selectionchange": this._handleSelectionChange,
|
||||
"scrollviewchange": this._handleScrollViewChange,
|
||||
"touchcarettap": this._handleTouchCaretTap
|
||||
"scrollviewchange": this._handleScrollViewChange
|
||||
};
|
||||
|
||||
let mmSecuritySensitiveCalls = {
|
||||
|
@ -506,12 +505,6 @@ BrowserElementParent.prototype = {
|
|||
this._frameElement.dispatchEvent(evt);
|
||||
},
|
||||
|
||||
_handleTouchCaretTap: function(data) {
|
||||
let evt = this._createEvent("touchcarettap", data.json,
|
||||
/* cancelable = */ false);
|
||||
this._frameElement.dispatchEvent(evt);
|
||||
},
|
||||
|
||||
_createEvent: function(evtName, detail, cancelable) {
|
||||
// This will have to change if we ever want to send a CustomEvent with null
|
||||
// detail. For now, it's OK.
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include "nsView.h"
|
||||
#include "nsDOMTokenList.h"
|
||||
#include "nsCaret.h"
|
||||
#include "mozilla/dom/CustomEvent.h"
|
||||
|
||||
using namespace mozilla;
|
||||
|
||||
|
@ -59,8 +58,7 @@ TouchCaret::TouchCaret(nsIPresShell* aPresShell)
|
|||
: mState(TOUCHCARET_NONE),
|
||||
mActiveTouchId(-1),
|
||||
mCaretCenterToDownPointOffsetY(0),
|
||||
mVisible(false),
|
||||
mIsValidTap(false)
|
||||
mVisible(false)
|
||||
{
|
||||
TOUCHCARET_LOG("Constructor, PresShell=%p", aPresShell);
|
||||
MOZ_ASSERT(NS_IsMainThread());
|
||||
|
@ -603,7 +601,6 @@ TouchCaret::HandleMouseMoveEvent(WidgetMouseEvent* aEvent)
|
|||
movePoint = contentBoundary.ClampPoint(movePoint);
|
||||
|
||||
MoveCaret(movePoint);
|
||||
mIsValidTap = false;
|
||||
status = nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
break;
|
||||
|
@ -641,7 +638,6 @@ TouchCaret::HandleTouchMoveEvent(WidgetTouchEvent* aEvent)
|
|||
movePoint = contentBoundary.ClampPoint(movePoint);
|
||||
|
||||
MoveCaret(movePoint);
|
||||
mIsValidTap = false;
|
||||
status = nsEventStatus_eConsumeNoDefault;
|
||||
}
|
||||
break;
|
||||
|
@ -852,35 +848,6 @@ TouchCaret::HandleTouchDownEvent(WidgetTouchEvent* aEvent)
|
|||
return status;
|
||||
}
|
||||
|
||||
void
|
||||
TouchCaret::DispatchTapEvent()
|
||||
{
|
||||
nsCOMPtr<nsIPresShell> presShell = do_QueryReferent(mPresShell);
|
||||
if (!presShell) {
|
||||
return;
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIDocument> doc = presShell->GetDocument();
|
||||
if (!doc) {
|
||||
return;
|
||||
}
|
||||
|
||||
ErrorResult res;
|
||||
nsRefPtr<Event> domEvent =
|
||||
doc->CreateEvent(NS_LITERAL_STRING("CustomEvent"), res);
|
||||
if (res.Failed()) {
|
||||
return;
|
||||
}
|
||||
|
||||
CustomEvent* customEvent = static_cast<CustomEvent*>(domEvent.get());
|
||||
customEvent->InitCustomEvent(NS_LITERAL_STRING("touchcarettap"),
|
||||
true, false, nullptr);
|
||||
customEvent->SetTrusted(true);
|
||||
customEvent->GetInternalNSEvent()->mFlags.mOnlyChromeDispatch = true;
|
||||
bool ret;
|
||||
doc->DispatchEvent(domEvent, &ret);
|
||||
}
|
||||
|
||||
void
|
||||
TouchCaret::SetState(TouchCaretState aState)
|
||||
{
|
||||
|
@ -912,12 +879,5 @@ TouchCaret::SetState(TouchCaretState aState)
|
|||
if (mState == TOUCHCARET_NONE) {
|
||||
mActiveTouchId = -1;
|
||||
mCaretCenterToDownPointOffsetY = 0;
|
||||
if (mIsValidTap) {
|
||||
DispatchTapEvent();
|
||||
mIsValidTap = false;
|
||||
}
|
||||
} else if (mState == TOUCHCARET_TOUCHDRAG_ACTIVE ||
|
||||
mState == TOUCHCARET_MOUSEDRAG_ACTIVE) {
|
||||
mIsValidTap = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -209,11 +209,6 @@ private:
|
|||
*/
|
||||
void SetState(TouchCaretState aState);
|
||||
|
||||
/**
|
||||
* Dispatch touch caret tap event to chrome.
|
||||
*/
|
||||
void DispatchTapEvent();
|
||||
|
||||
/**
|
||||
* Current state we're dealing with.
|
||||
*/
|
||||
|
@ -254,8 +249,6 @@ private:
|
|||
|
||||
// Touch caret visibility
|
||||
bool mVisible;
|
||||
// Use for detecting single tap on touch caret.
|
||||
bool mIsValidTap;
|
||||
// Touch caret timer
|
||||
nsCOMPtr<nsITimer> mTouchCaretExpirationTimer;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче