<?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>64954</bug_id>
          
          <creation_ts>2011-07-21 08:59:04 -0700</creation_ts>
          <short_desc>Unpaired calls to Document::didAddWheelEventHandler / Document::didRemoveWheelEventHandler</short_desc>
          <delta_ts>2012-05-01 14:51:39 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>WebCore Misc.</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>UNCONFIRMED</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>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Rob Bradford">rob</reporter>
          <assigned_to name="Jon Lee">jonlee</assigned_to>
          <cc>andersca</cc>
    
    <cc>eric</cc>
    
    <cc>hyatt</cc>
    
    <cc>jochen</cc>
    
    <cc>jonlee</cc>
    
    <cc>levin</cc>
    
    <cc>rakuco</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>440439</commentid>
    <comment_count>0</comment_count>
    <who name="Rob Bradford">rob</who>
    <bug_when>2011-07-21 08:59:04 -0700</bug_when>
    <thetext>With the EFL backend and some Chromium use cases (according to https://bugs.webkit.org/show_bug.cgi?id=60779#c27) we trigger the assertion below:

void Document::didRemoveWheelEventHandler()
{
    ASSERT(m_wheelEventHandlerCount &gt; 0);
    --m_wheelEventHandlerCount;
    Frame* mainFrame = page() ? page()-&gt;mainFrame() : 0;
    if (mainFrame)
        mainFrame-&gt;notifyChromeClientWheelEventHandlerCountChanged();
}

When navigating from the page.

I observe the following from the backtraces

#0  WebCore::Document::didAddWheelEventHandler (this=0x74b240)
    at /home/rob/src/efl-webkit/source/WebKit/Source/WebCore/dom/Document.cpp:5050

and then

#0  WebCore::Document::didRemoveWheelEventHandler (this=0x856fa0)
    at /home/rob/src/efl-webkit/source/WebKit/Source/WebCore/dom/Document.cpp:5059

and then

#0  WebCore::Document::didAddWheelEventHandler (this=0x856fa0)
    at /home/rob/src/efl-webkit/source/WebKit/Source/WebCore/dom/Document.cpp:5050

So from my observations the Document inside the Frame has changed before the code that&apos;s doing the tidy up to remove the handlers gets called.

i.e. we would expect the call to didRemoveWheelEventHandler to act on 0x74b240.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>440456</commentid>
    <comment_count>1</comment_count>
    <who name="Jon Lee">jonlee</who>
    <bug_when>2011-07-21 09:46:17 -0700</bug_when>
    <thetext>This is a dupe of 60931.

*** This bug has been marked as a duplicate of bug 60931 ***</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>450192</commentid>
    <comment_count>2</comment_count>
    <who name="Jon Lee">jonlee</who>
    <bug_when>2011-08-11 17:37:42 -0700</bug_when>
    <thetext>Sorry, this should not have been marked as a dupe.  Back to unconfirmed, and assigning to me.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>450340</commentid>
    <comment_count>3</comment_count>
      <attachid>103748</attachid>
    <who name="Rob Bradford">rob</who>
    <bug_when>2011-08-12 00:51:04 -0700</bug_when>
    <thetext>Created attachment 103748
Proposed patch

Here is the patch I proposed on the other bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>523989</commentid>
    <comment_count>4</comment_count>
      <attachid>103748</attachid>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2011-12-19 10:38:36 -0800</bug_when>
    <thetext>Comment on attachment 103748
Proposed patch

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

&gt; Source/WebCore/page/FrameView.h:143
&gt; +    void detachScrollbars();

Señor Levin wrote http://trac.webkit.org/changeset/44940, so it seems he should be involved in this review as well.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>542946</commentid>
    <comment_count>5</comment_count>
      <attachid>103748</attachid>
    <who name="">jochen</who>
    <bug_when>2012-01-26 01:15:01 -0800</bug_when>
    <thetext>Comment on attachment 103748
Proposed patch

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

&gt; Source/WebCore/dom/Document.cpp:1793
&gt; +            view-&gt;detachScrollbars();

you&apos;re dropping the call to detachCustomScrollbars here. Should detachScrollbars() invoke detachCustomScrollbars() then?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>543076</commentid>
    <comment_count>6</comment_count>
    <who name="David Levin">levin</who>
    <bug_when>2012-01-26 05:24:12 -0800</bug_when>
    <thetext>(In reply to comment #4)
&gt; (From update of attachment 103748 [details])
&gt; View in context: https://bugs.webkit.org/attachment.cgi?id=103748&amp;action=review
&gt; 
&gt; &gt; Source/WebCore/page/FrameView.h:143
&gt; &gt; +    void detachScrollbars();
&gt; 
&gt; Señor Levin wrote http://trac.webkit.org/changeset/44940, so it seems he should be involved in this review as well.

2 1/2 years ago :( 
To my memory I was fixing a crash and consulted with several other folks about the right fix. Given all this my expertise is about none for this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>613691</commentid>
    <comment_count>7</comment_count>
      <attachid>103748</attachid>
    <who name="Ojan Vafai">ojan</who>
    <bug_when>2012-05-01 14:51:39 -0700</bug_when>
    <thetext>Comment on attachment 103748
Proposed patch

Is this visible to the web? If so, can you add layout tests for this? All WebKit patches need a test unless there&apos;s a good reason why it can&apos;t be tested.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>103748</attachid>
            <date>2011-08-12 00:51:04 -0700</date>
            <delta_ts>2012-05-01 14:51:38 -0700</delta_ts>
            <desc>Proposed patch</desc>
            <filename>updated-patch.diff</filename>
            <type>text/plain</type>
            <size>2310</size>
            <attacher name="Rob Bradford">rob</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZyBiL1NvdXJjZS9XZWJDb3JlL0No
YW5nZUxvZwppbmRleCA3ZTU1MDk0Li43OWUxZmQxIDEwMDY0NAotLS0gYS9Tb3VyY2UvV2ViQ29y
ZS9DaGFuZ2VMb2cKKysrIGIvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCkBAIC0xLDMgKzEsMTYg
QEAKKzIwMTEtMDctMjIgIFJvYiBCcmFkZm9yZCAgIDxyb2JAbGludXguaW50ZWwuY29tPgorCisg
ICAgICAgIEVuc3VyZSB0aGUgc2Nyb2xsYmFycyBhcmUgYWx3YXlzIHJlbW92ZWQgd2hlbiB0aGUg
cGFnZSBpcyBkZXRhY2hlZAorICAgICAgICBvdGhlcndpc2UgdW5wYWlyZWQgY2FsbHMgdG8gRG9j
dW1lbnQ6OmRpZEFkZFdoZWVsRXZlbnRIYW5kbGVyIGFuZAorICAgICAgICBEb2N1bWVudDo6ZGlk
UmVtb3ZlV2hlZWxFdmVudEhhbmRsZXIgYXJlIG1hZGUuCisgICAgICAgIGh0dHBzOi8vYnVncy53
ZWJraXQub3JnL3Nob3dfYnVnLmNnaT9pZD02MDkzMQorCisgICAgICAgICogcGFnZS9GcmFtZVZp
ZXcuY3BwOgorICAgICAgICAqIHBhZ2UvRnJhbWVWaWV3Lmg6CisgICAgICAgIEFkZCBkZXRhY2hT
Y3JvbGxiYXJzIG1ldGhvZC4KKyAgICAgICAgKiBkb20vRG9jdW1lbnQuaDoKKyAgICAgICAgRGV0
YWNoIHNjcm9sbGJhcnMgd2hlbiB0aGUgZG9jdW1lbnQgaXMgZGV0YWNoZWQuCisKIDIwMTEtMDct
MjEgIFBhdmVsIEZlbGRtYW4gIDxwZmVsZG1hbkBnb29nbGUu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gIHZvaWQgY2xlYXIoKTsK
</data>
<flag name="review"
          id="99443"
          type_id="1"
          status="-"
          setter="ojan"
    />
          </attachment>
      

    </bug>

</bugzilla>