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..12ed753ace642b6ac2fce50c9dd8a9e1ba62a195 100644 |
--- a/Source/core/html/shadow/ClearButtonElement.cpp |
+++ b/Source/core/html/shadow/ClearButtonElement.cpp |
@@ -39,7 +39,6 @@ using namespace HTMLNames; |
inline ClearButtonElement::ClearButtonElement(Document& document, ClearButtonOwner& clearButtonOwner) |
: HTMLDivElement(document) |
, m_clearButtonOwner(&clearButtonOwner) |
- , m_capturing(false) |
{ |
} |
@@ -53,24 +52,9 @@ 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); |
} |
-void ClearButtonElement::releaseCapture() |
-{ |
- if (!m_capturing) |
- return; |
- |
- if (LocalFrame* frame = document().frame()) { |
- frame->eventHandler().setCapturingMouseEventsNode(nullptr); |
- m_capturing = false; |
- } |
-} |
- |
void ClearButtonElement::defaultEventHandler(Event* event) |
{ |
if (!m_clearButtonOwner) { |
@@ -85,26 +69,11 @@ void ClearButtonElement::defaultEventHandler(Event* event) |
return; |
} |
- if (event->type() == EventTypeNames::mousedown && event->isMouseEvent() && toMouseEvent(event)->button() == LeftButton) { |
+ if (event->type() == EventTypeNames::click) { |
if (renderer() && renderer()->visibleToHitTesting()) { |
- if (LocalFrame* frame = document().frame()) { |
- frame->eventHandler().setCapturingMouseEventsNode(this); |
- m_capturing = true; |
- } |
- } |
- 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(); |
- } |
+ m_clearButtonOwner->focusAndSelectClearButtonOwner(); |
+ m_clearButtonOwner->clearValue(); |
+ event->setDefaultHandled(); |
} |
} |