Index: Source/core/html/shadow/ClearButtonElement.cpp |
diff --git a/Source/core/html/shadow/ClearButtonElement.cpp b/Source/core/html/shadow/ClearButtonElement.cpp |
index 71e922a54bc9145cd8b301d2c2ee86119b16c023..0a6ed2eecf88ea50ec327fd8b6044e0a0ca181be 100644 |
--- a/Source/core/html/shadow/ClearButtonElement.cpp |
+++ b/Source/core/html/shadow/ClearButtonElement.cpp |
@@ -53,10 +53,6 @@ PassRefPtrWillBeRawPtr<ClearButtonElement> ClearButtonElement::create(Document& |
void ClearButtonElement::detach(const AttachContext& context) |
{ |
- if (m_capturing) { |
- if (LocalFrame* frame = document().frame()) |
- frame->eventHandler().setCapturingMouseEventsNode(nullptr); |
- } |
HTMLDivElement::detach(context); |
} |
@@ -64,11 +60,7 @@ void ClearButtonElement::releaseCapture() |
{ |
if (!m_capturing) |
return; |
- |
- if (LocalFrame* frame = document().frame()) { |
- frame->eventHandler().setCapturingMouseEventsNode(nullptr); |
- m_capturing = false; |
- } |
+ m_capturing = false; |
} |
void ClearButtonElement::defaultEventHandler(Event* event) |
@@ -85,26 +77,13 @@ void ClearButtonElement::defaultEventHandler(Event* event) |
return; |
} |
- if (event->type() == EventTypeNames::mousedown && event->isMouseEvent() && toMouseEvent(event)->button() == LeftButton) { |
- if (renderer() && renderer()->visibleToHitTesting()) { |
Habib Virji
2014/10/16 08:39:53
Should you not still take visibileToHitTesting int
Paritosh Kumar
2014/10/18 05:46:03
Thanks. Done.
|
- if (LocalFrame* frame = document().frame()) { |
- frame->eventHandler().setCapturingMouseEventsNode(this); |
- m_capturing = true; |
- } |
- } |
+ if (event->type() == EventTypeNames::click) { |
m_clearButtonOwner->focusAndSelectClearButtonOwner(); |
event->setDefaultHandled(); |
- } |
- if (event->type() == EventTypeNames::mouseup && event->isMouseEvent() && toMouseEvent(event)->button() == LeftButton) { |
- if (m_capturing) { |
- if (LocalFrame* frame = document().frame()) { |
- frame->eventHandler().setCapturingMouseEventsNode(nullptr); |
- m_capturing = false; |
- } |
- if (hovered()) { |
- m_clearButtonOwner->clearValue(); |
- event->setDefaultHandled(); |
- } |
+ if (hovered()) { |
+ m_capturing = true; |
Habib Virji
2014/10/16 08:39:53
This looks bit unclear. You are changing m_capturi
|
+ m_clearButtonOwner->clearValue(); |
+ event->setDefaultHandled(); |
} |
} |