Changeset 163329 in webkit


Ignore:
Timestamp:
Feb 3, 2014 3:10:31 PM (10 years ago)
Author:
Brent Fulgham
Message:

REGRESSION (r163018): Can’t scroll in <select> lists
https://bugs.webkit.org/show_bug.cgi?id=128090

Source/WebCore:

The regression was caused by the fact that a new method scrollWithWheelEventLocation() was added
to RenderBox to replace the generic scroll() method for the particular case of scrolling using
the mouse wheel. This turned out to be a mistake because in the case of some elements, like select lists,
the scroll method was overriden and now the incorrect method was being called.
The solution was to remove the new method and just add two default parameters to the generic
scroll method.

Patch by Radu Stavila <stavila@adobe.com> on 2014-02-03
Reviewed by Simon Fraser.

Test: fast/scrolling/scroll-select-list.html

  • page/EventHandler.cpp:

(WebCore::scrollNode):

  • rendering/RenderBox.cpp:

(WebCore::RenderBox::scroll):

  • rendering/RenderBox.h:
  • rendering/RenderEmbeddedObject.cpp:

(WebCore::RenderEmbeddedObject::scroll):

  • rendering/RenderEmbeddedObject.h:
  • rendering/RenderListBox.cpp:

(WebCore::RenderListBox::scroll):

  • rendering/RenderListBox.h:
  • rendering/RenderTextControlSingleLine.cpp:

(WebCore::RenderTextControlSingleLine::scroll):

  • rendering/RenderTextControlSingleLine.h:

LayoutTests:

New test validates scrolling using the mouse wheel inside a select list.
This test is for the moment added as a ImageOnlyFailure expectation
because the current implementation of eventSender cannot simulate mouse wheel events.

Patch by Radu Stavila <stavila@adobe.com> on 2014-02-03
Reviewed by Simon Fraser.

  • TestExpectations:
  • fast/scrolling/scroll-select-list-expected.html: Added.
  • fast/scrolling/scroll-select-list.html: Added.
Location:
trunk
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r163328 r163329  
     12014-02-03  Radu Stavila  <stavila@adobe.com>
     2
     3        REGRESSION (r163018): Can’t scroll in <select> lists
     4        https://bugs.webkit.org/show_bug.cgi?id=128090
     5
     6        New test validates scrolling using the mouse wheel inside a select list.
     7        This test is for the moment added as a ImageOnlyFailure expectation
     8        because the current implementation of eventSender cannot simulate mouse wheel events.
     9
     10        Reviewed by Simon Fraser.
     11
     12        * TestExpectations:
     13        * fast/scrolling/scroll-select-list-expected.html: Added.
     14        * fast/scrolling/scroll-select-list.html: Added.
     15
    1162014-02-03  Oliver Hunt  <oliver@apple.com>
    217
  • trunk/LayoutTests/TestExpectations

    r163058 r163329  
    22#
    33# See http://trac.webkit.org/wiki/TestExpectations for more information on this file.
     4
     5# Incomplete implementation of eventSender causes this test to fail
     6webkit.org/b/42194 fast/scrolling/scroll-select-list.html [ ImageOnlyFailure ]
    47
    58# pending functional patch and per-port verification
  • trunk/Source/WebCore/ChangeLog

    r163320 r163329  
     12014-02-03  Radu Stavila  <stavila@adobe.com>
     2
     3        REGRESSION (r163018): Can’t scroll in <select> lists
     4        https://bugs.webkit.org/show_bug.cgi?id=128090
     5
     6        The regression was caused by the fact that a new method scrollWithWheelEventLocation() was added
     7        to RenderBox to replace the generic scroll() method for the particular case of scrolling using
     8        the mouse wheel. This turned out to be a mistake because in the case of some elements, like select lists,
     9        the scroll method was overriden and now the incorrect method was being called.
     10        The solution was to remove the new method and just add two default parameters to the generic
     11        scroll method.
     12
     13        Reviewed by Simon Fraser.
     14
     15        Test: fast/scrolling/scroll-select-list.html
     16
     17        * page/EventHandler.cpp:
     18        (WebCore::scrollNode):
     19        * rendering/RenderBox.cpp:
     20        (WebCore::RenderBox::scroll):
     21        * rendering/RenderBox.h:
     22        * rendering/RenderEmbeddedObject.cpp:
     23        (WebCore::RenderEmbeddedObject::scroll):
     24        * rendering/RenderEmbeddedObject.h:
     25        * rendering/RenderListBox.cpp:
     26        (WebCore::RenderListBox::scroll):
     27        * rendering/RenderListBox.h:
     28        * rendering/RenderTextControlSingleLine.cpp:
     29        (WebCore::RenderTextControlSingleLine::scroll):
     30        * rendering/RenderTextControlSingleLine.h:
     31
    1322014-02-03  Chris Fleizach  <cfleizach@apple.com>
    233
  • trunk/Source/WebCore/page/EventHandler.cpp

    r163232 r163329  
    282282}
    283283
    284 static inline bool scrollNode(float delta, ScrollGranularity granularity, ScrollDirection positiveDirection, ScrollDirection negativeDirection, Node* node, Element** stopElement, const IntPoint& absolutePoint)
     284static inline bool scrollNode(float delta, ScrollGranularity granularity, ScrollDirection positiveDirection, ScrollDirection negativeDirection, Node* node, Element** stopElement, const IntPoint& wheelEventAbsolutePoint)
    285285{
    286286    if (!delta)
     
    291291    float absDelta = delta > 0 ? delta : -delta;
    292292
    293     return enclosingBox->scrollWithWheelEventLocation(delta < 0 ? negativeDirection : positiveDirection, granularity, absDelta, enclosingBox, stopElement, absolutePoint);
     293    return enclosingBox->scroll(delta < 0 ? negativeDirection : positiveDirection, granularity, absDelta, stopElement, enclosingBox, wheelEventAbsolutePoint);
    294294}
    295295
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r163190 r163329  
    769769}
    770770
    771 bool RenderBox::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier, Element** stopElement)
    772 {
    773     if (scrollLayer(direction, granularity, multiplier, stopElement))
    774         return true;
    775 
    776     if (stopElement && *stopElement && *stopElement == element())
    777         return true;
    778 
    779     RenderBlock* b = containingBlock();
    780     if (b && !b->isRenderView())
    781         return b->scroll(direction, granularity, multiplier, stopElement);
    782 
    783     return false;
    784 }
    785 
    786 bool RenderBox::scrollWithWheelEventLocation(ScrollDirection direction, ScrollGranularity granularity, float multiplier, RenderBox* startBox, Element** stopElement, IntPoint absolutePoint)
     771bool RenderBox::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier, Element** stopElement, RenderBox* startBox, const IntPoint& wheelEventAbsolutePoint)
    787772{
    788773    if (scrollLayer(direction, granularity, multiplier, stopElement))
     
    795780    if (nextScrollBlock && nextScrollBlock->isRenderNamedFlowThread()) {
    796781        ASSERT(startBox);
    797         nextScrollBlock = toRenderFlowThread(nextScrollBlock)->regionFromAbsolutePointAndBox(absolutePoint, *startBox);
     782        nextScrollBlock = toRenderFlowThread(nextScrollBlock)->regionFromAbsolutePointAndBox(wheelEventAbsolutePoint, *startBox);
    798783    }
    799784
    800785    if (nextScrollBlock && !nextScrollBlock->isRenderView())
    801         return nextScrollBlock->scrollWithWheelEventLocation(direction, granularity, multiplier, startBox, stopElement, absolutePoint);
     786        return nextScrollBlock->scroll(direction, granularity, multiplier, stopElement, startBox, wheelEventAbsolutePoint);
    802787
    803788    return false;
  • trunk/Source/WebCore/rendering/RenderBox.h

    r163018 r163329  
    453453    int instrinsicScrollbarLogicalWidth() const;
    454454    int scrollbarLogicalHeight() const { return style().isHorizontalWritingMode() ? horizontalScrollbarHeight() : verticalScrollbarWidth(); }
    455     virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = 0);
    456     virtual bool scrollWithWheelEventLocation(ScrollDirection, ScrollGranularity, float multiplier, RenderBox* startBox, Element** stopElement, IntPoint absolutePoint);
     455    virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = nullptr, RenderBox* startBox = nullptr, const IntPoint& wheelEventAbsolutePoint = IntPoint());
    457456    virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = 0);
    458457    bool canBeScrolledAndHasScrollableArea() const;
  • trunk/Source/WebCore/rendering/RenderEmbeddedObject.cpp

    r163079 r163329  
    568568}
    569569
    570 bool RenderEmbeddedObject::scroll(ScrollDirection direction, ScrollGranularity granularity, float, Element**)
     570bool RenderEmbeddedObject::scroll(ScrollDirection direction, ScrollGranularity granularity, float, Element**, RenderBox*, const IntPoint&)
    571571{
    572572    if (!widget() || !widget()->isPluginViewBase())
  • trunk/Source/WebCore/rendering/RenderEmbeddedObject.h

    r163079 r163329  
    8181    virtual bool nodeAtPoint(const HitTestRequest&, HitTestResult&, const HitTestLocation& locationInContainer, const LayoutPoint& accumulatedOffset, HitTestAction) override final;
    8282
    83     virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier, Element** stopElement) override final;
     83    virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = nullptr, RenderBox* startBox = nullptr, const IntPoint& wheelEventAbsolutePoint = IntPoint()) override final;
    8484    virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier, Element** stopElement) override final;
    8585
  • trunk/Source/WebCore/rendering/RenderListBox.cpp

    r162795 r163329  
    593593}
    594594
    595 bool RenderListBox::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier, Element**)
     595bool RenderListBox::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier, Element**, RenderBox*, const IntPoint&)
    596596{
    597597    return ScrollableArea::scroll(direction, granularity, multiplier);
  • trunk/Source/WebCore/rendering/RenderListBox.h

    r162663 r163329  
    7575    virtual bool isPointInOverflowControl(HitTestResult&, const LayoutPoint& locationInContainer, const LayoutPoint& accumulatedOffset) override;
    7676
    77     virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = 0) override;
     77    virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = nullptr, RenderBox* startBox = nullptr, const IntPoint& wheelEventAbsolutePoint = IntPoint()) override;
    7878    virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = 0) override;
    7979
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.cpp

    r162791 r163329  
    461461}
    462462
    463 bool RenderTextControlSingleLine::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier, Element** stopElement)
     463bool RenderTextControlSingleLine::scroll(ScrollDirection direction, ScrollGranularity granularity, float multiplier, Element** stopElement, RenderBox* startBox, const IntPoint& wheelEventAbsolutePoint)
    464464{
    465465    RenderTextControlInnerBlock* renderer = innerTextElement()->renderer();
     
    469469    if (layer && layer->scroll(direction, granularity, multiplier))
    470470        return true;
    471     return RenderBlockFlow::scroll(direction, granularity, multiplier, stopElement);
     471    return RenderBlockFlow::scroll(direction, granularity, multiplier, stopElement, startBox, wheelEventAbsolutePoint);
    472472}
    473473
  • trunk/Source/WebCore/rendering/RenderTextControlSingleLine.h

    r162791 r163329  
    7070    virtual void setScrollLeft(int) override;
    7171    virtual void setScrollTop(int) override;
    72     virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = 0) override final;
     72    virtual bool scroll(ScrollDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = nullptr, RenderBox* startBox = nullptr, const IntPoint& wheelEventAbsolutePoint = IntPoint()) override final;
    7373    virtual bool logicalScroll(ScrollLogicalDirection, ScrollGranularity, float multiplier = 1, Element** stopElement = 0) override final;
    7474
Note: See TracChangeset for help on using the changeset viewer.