<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>111413</bug_id>
          
          <creation_ts>2013-03-05 00:27:51 -0800</creation_ts>
          <short_desc>Support wheel event even when FrameView does not have scrollbars.</short_desc>
          <delta_ts>2013-03-05 20:59:14 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Layout and Rendering</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>110066</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Dongseong Hwang">dongseong.hwang</reporter>
          <assigned_to name="Dongseong Hwang">dongseong.hwang</assigned_to>
          <cc>allan.jensen</cc>
    
    <cc>bdakin</cc>
    
    <cc>buildbot</cc>
    
    <cc>kenneth</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>847373</commentid>
    <comment_count>0</comment_count>
    <who name="Dongseong Hwang">dongseong.hwang</who>
    <bug_when>2013-03-05 00:27:51 -0800</bug_when>
    <thetext>Currently, when FrameView does not have scrollbars, FrameView does not support wheel event. However, our mouse can have wheel button without scrollbars in FrameView. We can emulate wheel event as delegates scrolling does.
So this patch make FrameView support wheel event even when FrameView does not have scrollbars.

In addition, EFL WK2 will turn off delegates scrolling, so this patch will be needed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>847381</commentid>
    <comment_count>1</comment_count>
    <who name="Dongseong Hwang">dongseong.hwang</who>
    <bug_when>2013-03-05 00:32:27 -0800</bug_when>
    <thetext>This policy has been so long time.
I quote as follows from r37159.
 void ScrollView::wheelEvent(PlatformWheelEvent&amp; e)
 {
-    if (!allowsScrolling() || platformWidget())
+    // We don&apos;t allow mouse wheeling to happen in a ScrollView that has had its scrollbars explicitly disabled.
+    if (!canHaveScrollbars() || platformWidget())
         return;

I assume there is no ports that do not have scrollbars without having delegates scrolling, because I think that wheel event is too essential to be disabled.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>847388</commentid>
    <comment_count>2</comment_count>
      <attachid>191423</attachid>
    <who name="Dongseong Hwang">dongseong.hwang</who>
    <bug_when>2013-03-05 00:38:00 -0800</bug_when>
    <thetext>Created attachment 191423
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>847422</commentid>
    <comment_count>3</comment_count>
      <attachid>191423</attachid>
    <who name="Allan Sandfeld Jensen">allan.jensen</who>
    <bug_when>2013-03-05 01:28:02 -0800</bug_when>
    <thetext>Comment on attachment 191423
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=191423&amp;action=review

&gt; Source/WebCore/page/FrameView.cpp:3894
&gt; -    if (delegatesScrolling()) {
&gt; -        IntSize offset = scrollOffset();
&gt; -        IntSize newOffset = IntSize(offset.width() - wheelEvent.deltaX(), offset.height() - wheelEvent.deltaY());
&gt; -        if (offset != newOffset) {
&gt; -            ScrollView::scrollTo(newOffset);
&gt; -            scrollPositionChanged();
&gt; -            frame()-&gt;loader()-&gt;client()-&gt;didChangeScrollOffset();
&gt; -        }
&gt; +    if (delegatesScrolling() || !canHaveScrollbars()) {
&gt; +        IntPoint position = scrollPosition();
&gt; +        IntPoint newPosition = position - IntSize(wheelEvent.deltaX(), wheelEvent.deltaY());
&gt; +        newPosition = adjustScrollPositionWithinRange(newPosition);
&gt; +        if (position != newPosition)
&gt; +            scrollTo(IntSize(newPosition.x(), newPosition.y()));

Is scrollPositionChanged() and frame()-&gt;loader()-&gt;client()-&gt;didChangeScrollOffset() no longer needed?

Two, are you sure every port that disables scrollbars wants the wheel-event redirected to scrollTo? The deleted comment below must have been there for a reason.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>847451</commentid>
    <comment_count>4</comment_count>
    <who name="Dongseong Hwang">dongseong.hwang</who>
    <bug_when>2013-03-05 01:51:46 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (From update of attachment 191423 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=191423&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/page/FrameView.cpp:3894
&gt; &gt; -    if (delegatesScrolling()) {
&gt; &gt; -        IntSize offset = scrollOffset();
&gt; &gt; -        IntSize newOffset = IntSize(offset.width() - wheelEvent.deltaX(), offset.height() - wheelEvent.deltaY());
&gt; &gt; -        if (offset != newOffset) {
&gt; &gt; -            ScrollView::scrollTo(newOffset);
&gt; &gt; -            scrollPositionChanged();
&gt; &gt; -            frame()-&gt;loader()-&gt;client()-&gt;didChangeScrollOffset();
&gt; &gt; -        }
&gt; &gt; +    if (delegatesScrolling() || !canHaveScrollbars()) {
&gt; &gt; +        IntPoint position = scrollPosition();
&gt; &gt; +        IntPoint newPosition = position - IntSize(wheelEvent.deltaX(), wheelEvent.deltaY());
&gt; &gt; +        newPosition = adjustScrollPositionWithinRange(newPosition);
&gt; &gt; +        if (position != newPosition)
&gt; &gt; +            scrollTo(IntSize(newPosition.x(), newPosition.y()));
&gt; 

Thanks for review :)

&gt; Is scrollPositionChanged() and frame()-&gt;loader()-&gt;client()-&gt;didChangeScrollOffset() no longer needed?
Good point! FrameView::scrollTo does the same thing.

void FrameView::scrollTo(const IntSize&amp; newOffset)
{
    LayoutSize offset = scrollOffset();
    ScrollView::scrollTo(newOffset);
    if (offset != scrollOffset())
        scrollPositionChanged();
    frame()-&gt;loader()-&gt;client()-&gt;didChangeScrollOffset();
}

&gt; Two, are you sure every port that disables scrollbars wants the wheel-event redirected to scrollTo? The deleted comment below must have been there for a reason.

I&apos;m not sure, so I need feedback. As I mentioned #c1, I guess it seems not to affect badly... The deleted comment had been even in 2008.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>847460</commentid>
    <comment_count>5</comment_count>
    <who name="Allan Sandfeld Jensen">allan.jensen</who>
    <bug_when>2013-03-05 02:03:11 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; I&apos;m not sure, so I need feedback. As I mentioned #c1, I guess it seems not to affect badly... The deleted comment had been even in 2008.

No, it is only a year old see bug 78731 and http://trac.webkit.org/changeset/107838</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>847462</commentid>
    <comment_count>6</comment_count>
    <who name="Allan Sandfeld Jensen">allan.jensen</who>
    <bug_when>2013-03-05 02:05:01 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; (In reply to comment #4)
&gt; &gt; I&apos;m not sure, so I need feedback. As I mentioned #c1, I guess it seems not to affect badly... The deleted comment had been even in 2008.
&gt; 
&gt; No, it is only a year old see bug 78731 and http://trac.webkit.org/changeset/107838

Nah, sorry. That was only moving code around.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>847627</commentid>
    <comment_count>7</comment_count>
      <attachid>191423</attachid>
    <who name="Build Bot">buildbot</who>
    <bug_when>2013-03-05 06:42:43 -0800</bug_when>
    <thetext>Comment on attachment 191423
Patch

Attachment 191423 did not pass mac-ews (mac):
Output: http://webkit-commit-queue.appspot.com/results/17009118

New failing tests:
editing/selection/selection-invalid-offset.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>847819</commentid>
    <comment_count>8</comment_count>
      <attachid>191423</attachid>
    <who name="Simon Fraser (smfr)">simon.fraser</who>
    <bug_when>2013-03-05 10:47:56 -0800</bug_when>
    <thetext>Comment on attachment 191423
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=191423&amp;action=review

&gt; Source/WebCore/page/FrameView.cpp:3889
&gt; +    if (delegatesScrolling() || !canHaveScrollbars()) {

This seems like a behavior change, which some platforms don&apos;t want.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>848425</commentid>
    <comment_count>9</comment_count>
    <who name="Dongseong Hwang">dongseong.hwang</who>
    <bug_when>2013-03-05 20:45:53 -0800</bug_when>
    <thetext>(In reply to comment #7)
&gt; (From update of attachment 191423 [details])
&gt; Attachment 191423 [details] did not pass mac-ews (mac):
&gt; Output: http://webkit-commit-queue.appspot.com/results/17009118
&gt; 
&gt; New failing tests:
&gt; editing/selection/selection-invalid-offset.html

I think it is flaky, because IMO this test is not related to wheel event.

(In reply to comment #8)
&gt; (From update of attachment 191423 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=191423&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/page/FrameView.cpp:3889
&gt; &gt; +    if (delegatesScrolling() || !canHaveScrollbars()) {
&gt; 
&gt; This seems like a behavior change, which some platforms don&apos;t want.

Thank you feedback. could you let me know which specific platforms would have problem?

And I&apos;m curious if it does not make sense to support wheel event when FrameView can not have scrollbars. otherwise, what is relevant way to support wheel event?

If turning off, EFL WK2 can not deal with wheel event because EFL WK2 does not have scrollbars.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>848429</commentid>
    <comment_count>10</comment_count>
    <who name="Dongseong Hwang">dongseong.hwang</who>
    <bug_when>2013-03-05 20:59:14 -0800</bug_when>
    <thetext>(In reply to comment #9)
&gt; If turning off, EFL WK2 can not deal with wheel event because EFL WK2 does not have scrollbars.

s/If turning off/If turning off delegates scrolling/
I&apos;m trying to turn off delegates scrolling in EFL and Qt WK2 now, because I think works of Mac and Chromium can cover the requirement of delegated scrolling now.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>191423</attachid>
            <date>2013-03-05 00:38:00 -0800</date>
            <delta_ts>2013-03-05 10:47:56 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-111413-20130305173333.patch</filename>
            <type>text/plain</type>
            <size>2691</size>
            <attacher name="Dongseong Hwang">dongseong.hwang</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTQ0NzEwCmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggZjRmNGQ5ODZhODk5ODdh
MzRiYzFkMmFlYzMwNzBkZmFmMzk5ZWQ2Ni4uYTkxODUyYjQ5OGYwOWYxYTRkNmYxZDhmYmQxMjRm
NzE4NWNjNzEwNCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDI1IEBACisyMDEzLTAzLTA1ICBIdWFu
ZyBEb25nc3VuZyAgPGx1eHRlbGxhQGNvbXBhbnkxMDAubmV0PgorCisgICAgICAgIFN1cHBvcnQg
d2hlZWwgZXZlbnQgZXZlbiB3aGVuIEZyYW1lVmlldyBkb2VzIG5vdCBoYXZlIHNjcm9sbGJhcnMu
CisgICAgICAgIGh0dHBzOi8vYnVncy53ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD0xMTE0MTMK
KworICAgICAgICBSZXZpZXdlZCBieSBOT0JPRFkgKE9PUFMhKS4KKworICAgICAgICBDdXJyZW50
bHksIHdoZW4gRnJhbWVWaWV3IGRvZXMgbm90IGhhdmUgc2Nyb2xsYmFycywgRnJhbWVWaWV3IGRv
ZXMgbm90IHN1cHBvcnQKKyAgICAgICAgd2hlZWwgZXZlbnQuIEhvd2V2ZXIsIG91ciBtb3VzZSBj
YW4gaGF2ZSB3aGVlbCBidXR0b24gd2l0aG91dCBzY3JvbGxiYXJzIGluCisgICAgICAgIEZyYW1l
Vmlldy4gV2UgY2FuIGVtdWxhdGUgd2hlZWwgZXZlb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luUmFuZ2UobmV3UG9zaXRpb24pOworICAgICAgICBpZiAocG9zaXRp
b24gIT0gbmV3UG9zaXRpb24pCisgICAgICAgICAgICBzY3JvbGxUbyhJbnRTaXplKG5ld1Bvc2l0
aW9uLngoKSwgbmV3UG9zaXRpb24ueSgpKSk7CiAgICAgICAgIHJldHVybiB0cnVlOwogICAgIH0K
IAotICAgIC8vIFdlIGRvbid0IGFsbG93IG1vdXNlIHdoZWVsaW5nIHRvIGhhcHBlbiBpbiBhIFNj
cm9sbFZpZXcgdGhhdCBoYXMgaGFkIGl0cyBzY3JvbGxiYXJzIGV4cGxpY2l0bHkgZGlzYWJsZWQu
Ci0gICAgaWYgKCFjYW5IYXZlU2Nyb2xsYmFycygpKQotICAgICAgICByZXR1cm4gZmFsc2U7Ci0K
ICNpZiAhUExBVEZPUk0oV1gpCiAgICAgaWYgKHBsYXRmb3JtV2lkZ2V0KCkpCiAgICAgICAgIHJl
dHVybiBmYWxzZTsK
</data>
<flag name="review"
          id="212382"
          type_id="1"
          status="-"
          setter="simon.fraser"
    />
    <flag name="commit-queue"
          id="212383"
          type_id="3"
          status="-"
          setter="buildbot"
    />
          </attachment>
      

    </bug>

</bugzilla>