summaryrefslogtreecommitdiffstats
path: root/WebCore/rendering/TextControlInnerElements.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/rendering/TextControlInnerElements.cpp')
-rw-r--r--WebCore/rendering/TextControlInnerElements.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/WebCore/rendering/TextControlInnerElements.cpp b/WebCore/rendering/TextControlInnerElements.cpp
index cd067de..fc7f7f0 100644
--- a/WebCore/rendering/TextControlInnerElements.cpp
+++ b/WebCore/rendering/TextControlInnerElements.cpp
@@ -56,7 +56,7 @@ bool RenderTextControlInnerBlock::nodeAtPoint(const HitTestRequest& request, Hit
bool placeholderIsVisible = false;
if (renderer->isTextField())
- placeholderIsVisible = static_cast<RenderTextControlSingleLine*>(renderer)->placeholderIsVisible();
+ placeholderIsVisible = toRenderTextControlSingleLine(renderer)->placeholderIsVisible();
return RenderBlock::nodeAtPoint(request, result, x, y, tx, ty, placeholderIsVisible ? HitTestBlockBackground : hitTestAction);
}
@@ -69,7 +69,7 @@ VisiblePosition RenderTextControlInnerBlock::positionForPoint(const IntPoint& po
// Multiline text controls have the scroll on shadowAncestorNode, so we need to take that
// into account here.
if (m_multiLine) {
- RenderTextControl* renderer = static_cast<RenderTextControl*>(node()->shadowAncestorNode()->renderer());
+ RenderTextControl* renderer = toRenderTextControl(node()->shadowAncestorNode()->renderer());
if (renderer->hasOverflowClip())
renderer->layer()->addScrolledContentOffset(contentsX, contentsY);
}
@@ -155,7 +155,7 @@ void SearchFieldResultsButtonElement::defaultEventHandler(Event* evt)
if (evt->type() == eventNames().mousedownEvent && evt->isMouseEvent() && static_cast<MouseEvent*>(evt)->button() == LeftButton) {
input->focus();
input->select();
- RenderTextControlSingleLine* renderer = static_cast<RenderTextControlSingleLine*>(input->renderer());
+ RenderTextControlSingleLine* renderer = toRenderTextControlSingleLine(input->renderer());
if (renderer->popupIsVisible())
renderer->hidePopup();
else if (input->maxResults() > 0)
@@ -172,6 +172,16 @@ SearchFieldCancelButtonElement::SearchFieldCancelButtonElement(Document* doc)
{
}
+void SearchFieldCancelButtonElement::detach()
+{
+ if (m_capturing) {
+ if (Frame* frame = document()->frame())
+ frame->eventHandler()->setCapturingMouseEventsNode(0);
+ }
+ TextControlInnerElement::detach();
+}
+
+
void SearchFieldCancelButtonElement::defaultEventHandler(Event* evt)
{
// If the element is visible, on mouseup, clear the value, and set selection