Changeset 19411 in webkit


Ignore:
Timestamp:
Feb 5, 2007 2:55:25 PM (17 years ago)
Author:
weinig
Message:

LayoutTests:

Reviewed by Adele.

  • fast/forms/search-cancel-button-mouseup-expected.txt: Added.
  • fast/forms/search-cancel-button-mouseup.html: Added.

WebCore:

Reviewed by Adele.

Test: fast/forms/search-cancel-button-mouseup.html

Made the cancel button capturing.

  • html/HTMLTextFieldInnerElement.cpp: (WebCore::HTMLSearchFieldCancelButtonElement::HTMLSearchFieldCancelButtonElement): (WebCore::HTMLSearchFieldCancelButtonElement::defaultEventHandler):
  • html/HTMLTextFieldInnerElement.h:
Location:
trunk
Files:
2 added
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r19408 r19411  
     12007-02-05  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by Adele.
     4
     5        - test for http://bugs.webkit.org/show_bug.cgi?id=12618
     6          REGRESSION (SearchField): Dragging across the text and releasing over the clear button clears the field
     7
     8        * fast/forms/search-cancel-button-mouseup-expected.txt: Added.
     9        * fast/forms/search-cancel-button-mouseup.html: Added.
     10
    1112007-02-05  Geoffrey Garen  <ggaren@apple.com>
    212
  • trunk/WebCore/ChangeLog

    r19407 r19411  
     12007-02-05  Mitz Pettel  <mitz@webkit.org>
     2
     3        Reviewed by Adele.
     4
     5        - fix http://bugs.webkit.org/show_bug.cgi?id=12618
     6          REGRESSION (SearchField): Dragging across the text and releasing over the clear button clears the field
     7
     8        Test: fast/forms/search-cancel-button-mouseup.html
     9
     10        Made the cancel button capturing.
     11
     12        * html/HTMLTextFieldInnerElement.cpp:
     13        (WebCore::HTMLSearchFieldCancelButtonElement::HTMLSearchFieldCancelButtonElement):
     14        (WebCore::HTMLSearchFieldCancelButtonElement::defaultEventHandler):
     15        * html/HTMLTextFieldInnerElement.h:
     16
    1172007-02-05  Mitz Pettel  <mitz@webkit.org>
    218
  • trunk/WebCore/html/HTMLTextFieldInnerElement.cpp

    r18877 r19411  
    2828
    2929#include "BeforeTextInsertedEvent.h"
     30#include "Document.h"
     31#include "EventHandler.h"
    3032#include "EventNames.h"
     33#include "Frame.h"
    3134#include "HTMLInputElement.h"
    3235#include "HTMLTextAreaElement.h"
     
    8992HTMLSearchFieldCancelButtonElement::HTMLSearchFieldCancelButtonElement(Document* doc)
    9093    : HTMLTextFieldInnerElement(doc)
     94    , m_capturing(false)
    9195{
    9296}
     
    100104        input->select();
    101105        evt->setDefaultHandled();
     106        if (Frame* frame = document()->frame())
     107            frame->eventHandler()->setCapturingMouseEventsNode(this);
     108        m_capturing = true;
    102109    } else if (evt->type() == mouseupEvent) {
    103         if (renderer() && renderer()->style()->visibility() == VISIBLE) {
    104             input->setValue("");
    105             input->onSearch();
    106             evt->setDefaultHandled();
     110        if (m_capturing && renderer() && renderer()->style()->visibility() == VISIBLE) {
     111            if (hovered()) {
     112                input->setValue("");
     113                input->onSearch();
     114                evt->setDefaultHandled();
     115            }
     116            if (Frame* frame = document()->frame())
     117                frame->eventHandler()->setCapturingMouseEventsNode(0);
     118            m_capturing = false;
    107119        }
    108120    }
  • trunk/WebCore/html/HTMLTextFieldInnerElement.h

    r18874 r19411  
    6363    HTMLSearchFieldCancelButtonElement(Document*);
    6464    virtual void defaultEventHandler(Event*);
     65private:
     66    bool m_capturing;
    6567};
    6668
Note: See TracChangeset for help on using the changeset viewer.