<?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>75506</bug_id>
          
          <creation_ts>2012-01-03 17:10:16 -0800</creation_ts>
          <short_desc>Improve touch handling performance by reusing the hitTest result</short_desc>
          <delta_ts>2012-03-22 13:30:22 -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>UI Events</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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="Min Qin">qinmin</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>abarth</cc>
    
    <cc>allan.jensen</cc>
    
    <cc>ap</cc>
    
    <cc>webkit.review.bot</cc>
    
    <cc>yong.li.webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>529180</commentid>
    <comment_count>0</comment_count>
    <who name="Min Qin">qinmin</who>
    <bug_when>2012-01-03 17:10:16 -0800</bug_when>
    <thetext>Currently we are doing a hit test for every touch events, this is unnecessary.
For TouchRelease and TouchMove events, the touchTarget is always the same as the TouchPressed event.
Even worse, performing a hitTest on a TouchMove could give us a new containing frame as finger moves. This could totally mess up the touch handling.
One good example for this is scrolling http://www.nme.com/reviews/young-knives/11931 on android browser with galaxy nexus. Touch the first paragraph and start scrolling upwards. When finger reaches the video area, flickering will appear.

This change reuses the hit test results from TouchPressed for further touch events.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>529192</commentid>
    <comment_count>1</comment_count>
      <attachid>121025</attachid>
    <who name="Min Qin">qinmin</who>
    <bug_when>2012-01-03 17:18:05 -0800</bug_when>
    <thetext>Created attachment 121025
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>529702</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-01-04 13:27:45 -0800</bug_when>
    <thetext>&gt; For TouchRelease and TouchMove events, the touchTarget is always the same as the TouchPressed event.

Is it really the case? Page content may move, so another element will be at the touch position. The original element may even be removed already.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>529726</commentid>
    <comment_count>3</comment_count>
    <who name="Min Qin">qinmin</who>
    <bug_when>2012-01-04 13:52:03 -0800</bug_when>
    <thetext>Yes, this is the case. TouchTarget should not change before finger is released. In the current EventHandler.cc, for example, the touchTarget  for TouchRelease and TouchMove is always the node given by TouchPressed.
Yes, the touchTarget could be removed during touch moves. But since it is ref counted, so as long as eventHandler maintains a pointer to it, it will not be GCed. And subsequent events send to it should do nothing. 

(In reply to comment #2)
&gt; &gt; For TouchRelease and TouchMove events, the touchTarget is always the same as the TouchPressed event.
&gt; 
&gt; Is it really the case? Page content may move, so another element will be at the touch position. The original element may even be removed already.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>529746</commentid>
    <comment_count>4</comment_count>
    <who name="Min Qin">qinmin</who>
    <bug_when>2012-01-04 14:14:48 -0800</bug_when>
    <thetext>From the spec: https://dvcs.w3.org/hg/webevents/raw-file/tip/touchevents.html
5.6 The touchmove event
The target of this event must be the same Element on which the touch point started when it was first placed on the surface, even if the touch point has since moved outside the interactive area of the target element.

(In reply to comment #3)
&gt; Yes, this is the case. TouchTarget should not change before finger is released. In the current EventHandler.cc, for example, the touchTarget  for TouchRelease and TouchMove is always the node given by TouchPressed.
&gt; Yes, the touchTarget could be removed during touch moves. But since it is ref counted, so as long as eventHandler maintains a pointer to it, it will not be GCed. And subsequent events send to it should do nothing. 
&gt; 
&gt; (In reply to comment #2)
&gt; &gt; &gt; For TouchRelease and TouchMove events, the touchTarget is always the same as the TouchPressed event.
&gt; &gt; 
&gt; &gt; Is it really the case? Page content may move, so another element will be at the touch position. The original element may even be removed already.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>538088</commentid>
    <comment_count>5</comment_count>
      <attachid>121025</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-01-18 12:54:45 -0800</bug_when>
    <thetext>Comment on attachment 121025
Patch

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

&gt; Source/WebCore/ChangeLog:8
&gt; +        No new tests. (OOPS!)

We won&apos;t be able to land this patch with this line in the ChangeLog.  In cases like this, we usually replace this line with a sentence saying that that patch is a performance optimization only and shouldn&apos;t have any behavior changes.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>538108</commentid>
    <comment_count>6</comment_count>
      <attachid>122981</attachid>
    <who name="Min Qin">qinmin</who>
    <bug_when>2012-01-18 13:32:17 -0800</bug_when>
    <thetext>Created attachment 122981
Patch</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>538801</commentid>
    <comment_count>7</comment_count>
    <who name="Min Qin">qinmin</who>
    <bug_when>2012-01-19 10:45:18 -0800</bug_when>
    <thetext>ChangeLog fixed</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>538999</commentid>
    <comment_count>8</comment_count>
      <attachid>122981</attachid>
    <who name="Adam Barth">abarth</who>
    <bug_when>2012-01-19 13:48:22 -0800</bug_when>
    <thetext>Comment on attachment 122981
Patch

Thanks.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539064</commentid>
    <comment_count>9</comment_count>
      <attachid>122981</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-01-19 15:07:26 -0800</bug_when>
    <thetext>Comment on attachment 122981
Patch

Clearing flags on attachment: 122981

Committed r105453: &lt;http://trac.webkit.org/changeset/105453&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>539065</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-01-19 15:07:31 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>540515</commentid>
    <comment_count>11</comment_count>
    <who name="Allan Sandfeld Jensen">allan.jensen</who>
    <bug_when>2012-01-23 06:41:45 -0800</bug_when>
    <thetext>We already have code that avoids moving the frame on hittests that are read-only. Was this really necessary in trunk to fix this bug?

While this patch is still an optimization. It makes it impossible to improve the :active handling to for instance stop showing :active if the finger moves off the target.

:active is used to show the user what is activated, but once the finger ends off the target this link will no longer be activated, and thus the :active feedback to user will be wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>540536</commentid>
    <comment_count>12</comment_count>
    <who name="Min Qin">qinmin</who>
    <bug_when>2012-01-23 07:43:44 -0800</bug_when>
    <thetext>Why is it hard to show :active? Since the touchTarget won&apos;t change, the last hittest results could be reused as finger moves off the target. So your :active link won&apos;t change during a touch down-&gt;touch move-&gt;touch release

On some pages, doing a hittest on each touchMove can be really expensive. the espn blog page is a good example. It invokes a layout each time when a move happens. each layout could take more than 500 msec to do.

And this change also avoids the problem that finger could move to another element after touchDown. One good example for this is scrolling http://www.nme.com/reviews/young-knives/11931 on android browser. Touch the first paragraph and start scrolling upwards. When finger reaches the video area, flickering will appear as a new hittest will return a different pagePoint as the condition of if statement becomes true.

if (m_frame != doc-&gt;frame()) {		
            // pagePoint should always be relative to the target elements contai
ning frame.		
            pagePoint = documentPointForWindowPoint(doc-&gt;frame(), point.pos());		
}



(In reply to comment #11)
&gt; We already have code that avoids moving the frame on hittests that are read-only. Was this really necessary in trunk to fix this bug?
&gt; 
&gt; While this patch is still an optimization. It makes it impossible to improve the :active handling to for instance stop showing :active if the finger moves off the target.
&gt; 
&gt; :active is used to show the user what is activated, but once the finger ends off the target this link will no longer be activated, and thus the :active feedback to user will be wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>540546</commentid>
    <comment_count>13</comment_count>
    <who name="Min Qin">qinmin</who>
    <bug_when>2012-01-23 07:58:51 -0800</bug_when>
    <thetext>And one more thing on finger moves off the target:

From the spec: https://dvcs.w3.org/hg/webevents/raw-file/tip/touchevents.html:
5.6 The touchmove event
The target of this event must be the same Element on which the touch point started when it was first placed on the surface, even if the touch point has since moved outside the interactive area of the target element.

Even if the finger is off the target, the :active should still remain on the touch down target. Until touch is released. So user should still see the original touch target is activated.

(In reply to comment #11)
&gt; We already have code that avoids moving the frame on hittests that are read-only. Was this really necessary in trunk to fix this bug?
&gt; 
&gt; While this patch is still an optimization. It makes it impossible to improve the :active handling to for instance stop showing :active if the finger moves off the target.
&gt; 
&gt; :active is used to show the user what is activated, but once the finger ends off the target this link will no longer be activated, and thus the :active feedback to user will be wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>540547</commentid>
    <comment_count>14</comment_count>
    <who name="Allan Sandfeld Jensen">allan.jensen</who>
    <bug_when>2012-01-23 08:03:11 -0800</bug_when>
    <thetext>(In reply to comment #12)
&gt; Why is it hard to show :active? Since the touchTarget won&apos;t change, the last hittest results could be reused as finger moves off the target. So your :active link won&apos;t change during a touch down-&gt;touch move-&gt;touch release
&gt; 
The point was to cancel :active and :hover if the activated object no longer is going to be activated by the current gesture. You make a good case for optimizing touch move, but are activated and hovered elements updated on TouchReleased or TouchCancelled?

I believe maintaining the active- and hovered elements is usually done by the hitTest. If hitTest is not performed on touch-release the active or hovered elements will stick to the last hitTested result. Actually hover already stick, but I was going to fix that, but will need a hit-test on touch-release/cancel to do so.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>585455</commentid>
    <comment_count>15</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2012-03-22 10:37:48 -0700</bug_when>
    <thetext> 	        Document* doc = node-&gt;document(); 
3264	 	        if (!doc) 
3265	 	            continue; 

This check is moved to if (pointState == PlatformTouchPoint::TouchPressed) block. And we no longer check it for the other two cases.

I know the node is locked by a RefPtr, however that doesn&apos;t prevent it from being evicted from the document. Will this cause potential crash?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>585640</commentid>
    <comment_count>16</comment_count>
    <who name="Yong Li">yong.li.webkit</who>
    <bug_when>2012-03-22 13:30:22 -0700</bug_when>
    <thetext>Bug 81958 is created for the regression.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="1"
              ispatch="1"
              isprivate="0"
          >
            <attachid>121025</attachid>
            <date>2012-01-03 17:18:05 -0800</date>
            <delta_ts>2012-01-18 13:32:14 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-75506-20120103171804.patch</filename>
            <type>text/plain</type>
            <size>4297</size>
            <attacher name="Min Qin">qinmin</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTAzOTg3CmRpZmYgLS1naXQgYS9Tb3VyY2UvV2ViQ29yZS9D
aGFuZ2VMb2cgYi9Tb3VyY2UvV2ViQ29yZS9DaGFuZ2VMb2cKaW5kZXggODdjNDlmOTI3Y2NhODQz
YWUzNDg4MGJmMWE2M2E3NDkyYTBiYTJjZi4uNTA1NzYyN2ZkNjZiYjVmYzQ1NTllMzQ4ZjQzNmJl
N2ViYjA3MDc4ZCAxMDA2NDQKLS0tIGEvU291cmNlL1dlYkNvcmUvQ2hhbmdlTG9nCisrKyBiL1Nv
dXJjZS9XZWJDb3JlL0NoYW5nZUxvZwpAQCAtMSwzICsxLDE1IEBACisyMDEyLTAxLTAzICBNaW4g
UWluICA8cWlubWluQGdvb2dsZS5jb20+CisKKyAgICAgICAgSW1wcm92ZSB0b3VjaCBoYW5kbGlu
ZyBwZXJmb3JtYW5jZSBieSByZXVzaW5nIHRoZSBoaXRUZXN0IHJlc3VsdAorICAgICAgICBodHRw
czovL2J1Z3Mud2Via2l0Lm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1lLCBwb2ludC5wb3MoKSk7CisgICAgICAgIH0KKworICAgICAgICBmbG9h
dCBzY2FsZUZhY3RvciA9IHRhcmdldEZyYW1lLT5wYWdlWm9vbUZhY3RvcigpICogdGFyZ2V0RnJh
bWUtPmZyYW1lU2NhbGVGYWN0b3IoKTsKKworICAgICAgICBpbnQgYWRqdXN0ZWRQYWdlWCA9IGxy
b3VuZGYocGFnZVBvaW50LngoKSAvIHNjYWxlRmFjdG9yKTsKKyAgICAgICAgaW50IGFkanVzdGVk
UGFnZVkgPSBscm91bmRmKHBhZ2VQb2ludC55KCkgLyBzY2FsZUZhY3Rvcik7CisKKyAgICAgICAg
UmVmUHRyPFRvdWNoPiB0b3VjaCA9IFRvdWNoOjpjcmVhdGUodGFyZ2V0RnJhbWUsIHRvdWNoVGFy
Z2V0LmdldCgpLCBwb2ludC5pZCgpLAogICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICBwb2ludC5zY3JlZW5Qb3MoKS54KCksIHBvaW50LnNjcmVlblBvcygpLnkoKSwK
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWRqdXN0ZWRQYWdl
WCwgYWRqdXN0ZWRQYWdlWSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgcG9pbnQucmFkaXVzWCgpLCBwb2ludC5yYWRpdXNZKCksIHBvaW50LnJvdGF0aW9uQW5n
bGUoKSwgcG9pbnQuZm9yY2UoKSk7Cg==
</data>

          </attachment>
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>122981</attachid>
            <date>2012-01-18 13:32:17 -0800</date>
            <delta_ts>2012-01-19 15:07:26 -0800</delta_ts>
            <desc>Patch</desc>
            <filename>bug-75506-20120118133216.patch</filename>
            <type>text/plain</type>
            <size>4381</size>
            <attacher name="Min Qin">qinmin</attacher>
            
              <data encoding="base64">U3VidmVyc2lvbiBSZXZpc2lvbjogMTAzO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hbWUsIHRvdWNoVGFyZ2V0LmdldCgpLCBwb2ludC5pZCgpLAogICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBwb2ludC5zY3JlZW5Qb3MoKS54
KCksIHBvaW50LnNjcmVlblBvcygpLnkoKSwKICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg
ICAgICAgICAgICAgICAgYWRqdXN0ZWRQYWdlWCwgYWRqdXN0ZWRQYWdlWSwKICAgICAgICAgICAg
ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcG9pbnQucmFkaXVzWCgpLCBwb2ludC5y
YWRpdXNZKCksIHBvaW50LnJvdGF0aW9uQW5nbGUoKSwgcG9pbnQuZm9yY2UoKSk7Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>