Changeset 102896 in webkit


Ignore:
Timestamp:
Dec 14, 2011 11:00:50 PM (12 years ago)
Author:
tkent@chromium.org
Message:

A spin button changes the value incorrectly if it is clicked after touch events.
https://bugs.webkit.org/show_bug.cgi?id=71181

Reviewed by Ryosuke Niwa.

Source/WebCore:

SpinButtonElement assumed setHovered(true) was always called before a
mousemove event in the element. It is not true for touch events.

We should not reset m_upDownState to Indetermiante in setHovered(true),
and should reset it when the mouse pointer moves out.

This change fixes the flakiness of fast/forms/input-step-as-double.html.

Test: fast/events/touch/touch-before-pressing-spin-button.html

  • html/shadow/TextControlInnerElements.cpp:

(WebCore::SpinButtonElement::defaultEventHandler):
Add an assertion that m_upDownState should not be Indetermiante.
Reset m_upDownState to Indeterminate when the mouse pointer moves out
from the element.
(WebCore::SpinButtonElement::setHovered):
Reset m_upDownState to Indeterminate when the element becomes unhovered.

LayoutTests:

  • fast/events/touch/touch-before-pressing-spin-button-expected.txt: Added.
  • fast/events/touch/touch-before-pressing-spin-button.html: Added.
  • platform/chromium/test_expectations.txt: Remove the flakiness of fast/forms/input-step-as-double.html.
  • platform/qt/Skipped: ditto.
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r102894 r102896  
     12011-11-03  Kent Tamura  <tkent@chromium.org>
     2
     3        A spin button changes the value incorrectly if it is clicked after touch events.
     4        https://bugs.webkit.org/show_bug.cgi?id=71181
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        * fast/events/touch/touch-before-pressing-spin-button-expected.txt: Added.
     9        * fast/events/touch/touch-before-pressing-spin-button.html: Added.
     10        * platform/chromium/test_expectations.txt:
     11          Remove the flakiness of fast/forms/input-step-as-double.html.
     12        * platform/qt/Skipped: ditto.
     13
    1142011-12-14  David Levin  <levin@chromium.org>
    215
  • trunk/LayoutTests/platform/chromium/test_expectations.txt

    r102886 r102896  
    37873787BUGWK71004 : inspector/storage-panel-dom-storage.html = PASS TIMEOUT
    37883788
    3789 BUGWK71181 : fast/forms/input-step-as-double.html = PASS TEXT
    37903789BUGWK71209 LINUX MAC : compositing/visibility/visibility-image-layers.html = IMAGE
    37913790
  • trunk/LayoutTests/platform/qt/Skipped

    r102742 r102896  
    25272527tables/mozilla/bugs/bug2947.html
    25282528
    2529 # Layout Test fast/forms/input-step-as-double.html fails after running touch event tests
    2530 # https://bugs.webkit.org/show_bug.cgi?id=71181
    2531 fast/forms/input-step-as-double.html
    2532 
    25332529# [Qt] plugins/netscape-plugin-page-cache-works.html fails
    25342530# https://bugs.webkit.org/show_bug.cgi?id=74482
  • trunk/Source/WebCore/ChangeLog

    r102895 r102896  
     12011-11-03  Kent Tamura  <tkent@chromium.org>
     2
     3        A spin button changes the value incorrectly if it is clicked after touch events.
     4        https://bugs.webkit.org/show_bug.cgi?id=71181
     5
     6        Reviewed by Ryosuke Niwa.
     7
     8        SpinButtonElement assumed setHovered(true) was always called before a
     9        mousemove event in the element. It is not true for touch events.
     10
     11        We should not reset m_upDownState to Indetermiante in setHovered(true),
     12        and should reset it when the mouse pointer moves out.
     13
     14        This change fixes the flakiness of fast/forms/input-step-as-double.html.
     15
     16        Test: fast/events/touch/touch-before-pressing-spin-button.html
     17
     18        * html/shadow/TextControlInnerElements.cpp:
     19        (WebCore::SpinButtonElement::defaultEventHandler):
     20        Add an assertion that m_upDownState should not be Indetermiante.
     21        Reset m_upDownState to Indeterminate when the mouse pointer moves out
     22        from the element.
     23        (WebCore::SpinButtonElement::setHovered):
     24        Reset m_upDownState to Indeterminate when the element becomes unhovered.
     25
    1262011-12-14  Lucas Forschler  <lforschler@apple.com>
    227   
  • trunk/Source/WebCore/html/shadow/TextControlInnerElements.cpp

    r97753 r102896  
    294294            input->select();
    295295            if (renderer()) {
     296                ASSERT(m_upDownState != Indeterminate);
    296297                input->stepUpFromRenderer(m_upDownState == Up ? 1 : -1);
    297298                if (renderer())
     
    314315            if (m_upDownState != oldUpDownState)
    315316                renderer()->repaint();
    316         } else
     317        } else {
    317318            releaseCapture();
     319            m_upDownState = Indeterminate;
     320        }
    318321    }
    319322
     
    367370void SpinButtonElement::setHovered(bool flag)
    368371{
    369     if (!hovered() && flag)
     372    if (!flag)
    370373        m_upDownState = Indeterminate;
    371374    HTMLDivElement::setHovered(flag);
Note: See TracChangeset for help on using the changeset viewer.