Bug 935501 - Get pointer events working for <input type=number>'s spin up/down buttons. r=smaug
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user