Changeset 65997 in webkit


Ignore:
Timestamp:
Aug 25, 2010 1:38:49 AM (14 years ago)
Author:
tkent@chromium.org
Message:

Fix a bug that a spin-button doesn't release mouse capturing
https://bugs.webkit.org/show_bug.cgi?id=44411

Reviewed by Shinichiro Hamaji

WebCore:

  • LeftButton should be checked only for clickEvent. Note that this change doesn't change the behavior because button() value is initialized with LeftButton even for mousemoveEvent.
  • Should pass a SpinButtonElement node to setCapturingMouseEventsNode().

Test: fast/forms/input-spinbutton-capturing.html

  • rendering/TextControlInnerElements.cpp:

(WebCore::SpinButtonElement::defaultEventHandler):

LayoutTests:

  • fast/forms/input-spinbutton-capturing-expected.txt: Added.
  • fast/forms/input-spinbutton-capturing.html: Added.
  • fast/forms/script-tests/input-spinbutton-capturing.js: Added.
Location:
trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r65996 r65997  
     12010-08-25  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Shinichiro Hamaji
     4
     5        Fix a bug that a spin-button doesn't release mouse capturing
     6        https://bugs.webkit.org/show_bug.cgi?id=44411
     7
     8        * fast/forms/input-spinbutton-capturing-expected.txt: Added.
     9        * fast/forms/input-spinbutton-capturing.html: Added.
     10        * fast/forms/script-tests/input-spinbutton-capturing.js: Added.
     11
    1122010-08-25  Gavin Peters  <gavinp@chromium.org>
    213
  • trunk/WebCore/ChangeLog

    r65995 r65997  
     12010-08-25  Kent Tamura  <tkent@chromium.org>
     2
     3        Reviewed by Shinichiro Hamaji
     4
     5        Fix a bug that a spin-button doesn't release mouse capturing
     6        https://bugs.webkit.org/show_bug.cgi?id=44411
     7
     8        - LeftButton should be checked only for clickEvent.
     9          Note that this change doesn't change the behavior because
     10          button() value is initialized with LeftButton even for
     11          mousemoveEvent.
     12        - Should pass a SpinButtonElement node to setCapturingMouseEventsNode().
     13
     14        Test: fast/forms/input-spinbutton-capturing.html
     15
     16        * rendering/TextControlInnerElements.cpp:
     17        (WebCore::SpinButtonElement::defaultEventHandler):
     18
    1192010-08-16  Gabor Loki  <loki@webkit.org>
    220
  • trunk/WebCore/rendering/TextControlInnerElements.cpp

    r65986 r65997  
    275275    }
    276276
    277     MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
    278     if (mouseEvent->button() != LeftButton) {
    279         if (!event->defaultHandled())
    280             HTMLDivElement::defaultEventHandler(event);
    281         return;
    282     }
    283 
    284277    RenderBox* box = renderBox();
    285278    if (!box) {
     
    289282    }
    290283   
     284    MouseEvent* mouseEvent = static_cast<MouseEvent*>(event);
    291285    HTMLInputElement* input = static_cast<HTMLInputElement*>(shadowAncestorNode());
    292286    if (input->disabled() || input->isReadOnlyFormControl()) {
     
    297291
    298292    IntPoint local = roundedIntPoint(box->absoluteToLocal(mouseEvent->absoluteLocation(), false, true));
    299     if (event->type() == eventNames().clickEvent) {
     293    if (event->type() == eventNames().clickEvent && mouseEvent->button() == LeftButton) {
    300294        if (box->borderBoxRect().contains(local)) {
    301295            RefPtr<Node> protector(input);
     
    312306            if (!m_capturing) {
    313307                if (Frame* frame = document()->frame()) {
    314                     frame->eventHandler()->setCapturingMouseEventsNode(input);
     308                    frame->eventHandler()->setCapturingMouseEventsNode(this);
    315309                    m_capturing = true;
    316310                }
Note: See TracChangeset for help on using the changeset viewer.