Bug 935501 - Get pointer events working for <input type=number>'s spin up/down buttons. r=smaug

This commit is contained in:
Jonathan Watt
2013-12-01 13:49:10 +00:00
parent c43b8083ae
commit 4511337a91
6 changed files with 288 additions and 4 deletions

View File

@@ -14,6 +14,7 @@
#include "nsGkAtoms.h"
#include "nsINodeInfo.h"
#include "nsINameSpaceManager.h"
#include "mozilla/BasicEvents.h"
#include "nsContentUtils.h"
#include "nsContentCreatorFunctions.h"
#include "nsContentList.h"
@@ -315,6 +316,21 @@ nsNumberControlFrame::GetAnonTextControl()
return mTextField ? HTMLInputElement::FromContent(mTextField) : nullptr;
}
int32_t
nsNumberControlFrame::GetSpinButtonForPointerEvent(WidgetGUIEvent* aEvent) const
{
MOZ_ASSERT(aEvent->eventStructType == NS_MOUSE_EVENT,
"Unexpected event type");
if (aEvent->originalTarget == mSpinUp) {
return eSpinButtonUp;
}
if (aEvent->originalTarget == mSpinDown) {
return eSpinButtonDown;
}
return eSpinButtonNone;
}
void
nsNumberControlFrame::AppendAnonymousContentTo(nsBaseContentList& aElements,
uint32_t aFilter)