Index: Source/core/html/shadow/SpinButtonElement.cpp |
diff --git a/Source/core/html/shadow/SpinButtonElement.cpp b/Source/core/html/shadow/SpinButtonElement.cpp |
index 22f4255e658a0f763186abbf5bdb8323c2437bd8..b14209b53b6cddb51c26b8ff7c0777e814e0382a 100644 |
--- a/Source/core/html/shadow/SpinButtonElement.cpp |
+++ b/Source/core/html/shadow/SpinButtonElement.cpp |
@@ -60,10 +60,11 @@ PassRefPtr<SpinButtonElement> SpinButtonElement::create(Document& document, Spin |
return element.release(); |
} |
-void SpinButtonElement::detach(const AttachContext& context) |
+void SpinButtonElement::setFocus(bool status) |
{ |
- releaseCapture(); |
- HTMLDivElement::detach(context); |
+ if (!status) |
+ releaseCapture(); |
tkent
2014/04/04 01:31:46
I think this code won't work.
SpinButtonElement ne
Habib Virji
2014/04/04 09:24:05
Done.
|
+ ContainerNode::setFocus(status); |
} |
void SpinButtonElement::defaultEventHandler(Event* event) |
@@ -106,12 +107,14 @@ void SpinButtonElement::defaultEventHandler(Event* event) |
// chance to cancel the timer. |
startRepeatingTimer(); |
doStepAction(m_upDownState == Up ? 1 : -1); |
+ if (m_spinButtonOwner) |
+ m_spinButtonOwner->spinButtonDidReleaseMouseCapture(); |
} |
} |
event->setDefaultHandled(); |
} |
} else if (mouseEvent->type() == EventTypeNames::mouseup && mouseEvent->button() == LeftButton) { |
- stopRepeatingTimer(); |
+ releaseCapture(); |
} else if (event->type() == EventTypeNames::mousemove) { |
if (box->pixelSnappedBorderBoxRect().contains(local)) { |
if (!m_capturing) { |
@@ -130,6 +133,11 @@ void SpinButtonElement::defaultEventHandler(Event* event) |
releaseCapture(); |
m_upDownState = Indeterminate; |
} |
+ } else if (event->type() == EventTypeNames::mouseout) { |
tkent
2014/04/04 01:31:46
Why is this block necessary? Doesn't the above rel
Habib Virji
2014/04/04 09:24:05
Done.
|
+ if (m_capturing) { // In order to check that spin button is under focus |
+ if (m_spinButtonOwner) |
+ m_spinButtonOwner->spinButtonDidReleaseMouseCapture(); |
+ } |
} |
if (!event->defaultHandled()) |
@@ -198,6 +206,9 @@ void SpinButtonElement::releaseCapture() |
page->chrome().unregisterPopupOpeningObserver(this); |
} |
} |
+ if (m_spinButtonOwner) |
+ m_spinButtonOwner->spinButtonDidReleaseMouseCapture(); |
+ |
} |
bool SpinButtonElement::matchesReadOnlyPseudoClass() const |