Bug 1221947 - part 1: add BYTOUCH flag to nsIFocusManager, r=jaws,smaug

IGNORE IDL
This commit is contained in:
Gijs Kruitbosch
2015-11-12 16:35:20 +00:00
parent e3a45d8b00
commit 715fa89606
7 changed files with 39 additions and 13 deletions

View File

@@ -317,9 +317,15 @@ HTMLButtonElement::PostHandleEvent(EventChainPostVisitor& aVisitor)
static_cast<EventStateManager*>(esm), this);
}
nsIFocusManager* fm = nsFocusManager::GetFocusManager();
if (fm)
fm->SetFocus(this, nsIFocusManager::FLAG_BYMOUSE |
nsIFocusManager::FLAG_NOSCROLL);
if (fm) {
uint32_t flags = nsIFocusManager::FLAG_BYMOUSE |
nsIFocusManager::FLAG_NOSCROLL;
// If this was a touch-generated event, pass that information:
if (mouseEvent->inputSource == nsIDOMMouseEvent::MOZ_SOURCE_TOUCH) {
flags |= nsIFocusManager::FLAG_BYTOUCH;
}
fm->SetFocus(this, flags);
}
mouseEvent->mFlags.mMultipleActionsPrevented = true;
} else if (mouseEvent->button == WidgetMouseEvent::eMiddleButton ||
mouseEvent->button == WidgetMouseEvent::eRightButton) {