<?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>104884</bug_id>
          
          <creation_ts>2012-12-13 00:03:38 -0800</creation_ts>
          <short_desc>Safari spends a lot of time in WebCore::findSimpleWordBoundary while selecting text on large scrabutility.com page</short_desc>
          <delta_ts>2012-12-13 02:10:21 -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>HTML Editing</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="Ryosuke Niwa">rniwa</assigned_to>
          <cc>barraclough</cc>
    
    <cc>darin</cc>
    
    <cc>enrica</cc>
    
    <cc>jiapu.mail</cc>
    
    <cc>kling</cc>
    
    <cc>koivisto</cc>
    
    <cc>mifenton</cc>
    
    <cc>morrita</cc>
    
    <cc>webkit.review.bot</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>790340</commentid>
    <comment_count>0</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-12-13 00:03:38 -0800</bug_when>
    <thetext>Visit http://scrabutility.com/4_TWL06.php and select text by mouse drags. You see a spin.

&lt;rdar://problem/12188622&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>790341</commentid>
    <comment_count>1</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-12-13 00:03:53 -0800</bug_when>
    <thetext>It appears that this could be a regression from http://trac.webkit.org/changeset/120357.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>790343</commentid>
    <comment_count>2</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-12-13 00:04:57 -0800</bug_when>
    <thetext>We’re spending a significant amount of time in AlternativeTextController::respondToChangedSelection

Running Time	Self		Symbol Name
1183.0ms   50.6%	1183.0	 	icu::RuleBasedBreakIterator::handleNext(icu::RBBIStateTable const*)
1183.0ms   50.6%	0.0	 	 icu::RuleBasedBreakIterator::next()
1183.0ms   50.6%	0.0	 	  icu::RuleBasedBreakIterator::following(int)
1183.0ms   50.6%	0.0	 	   -[NSAttributedString(NSAttributedStringKitAdditions) doubleClickAtIndex:inRange:]
1183.0ms   50.6%	0.0	 	    WebCore::findWordBoundary(unsigned short const*, int, int, int*, int*)
1183.0ms   50.6%	0.0	 	     WebCore::endWordBoundary(unsigned short const*, unsigned int, unsigned int, WebCore::BoundarySearchContextAvailability, bool&amp;)
1183.0ms   50.6%	0.0	 	      WebCore::nextBoundary(WebCore::VisiblePosition const&amp;, unsigned int (*)(unsigned short const*, unsigned int, unsigned int, WebCore::BoundarySearchContextAvailability, bool&amp;))
1183.0ms   50.6%	0.0	 	       WebCore::endOfWord(WebCore::VisiblePosition const&amp;, WebCore::EWordSide)
1183.0ms   50.6%	0.0	 	        WebCore::AlternativeTextController::respondToChangedSelection(WebCore::VisibleSelection const&amp;, unsigned int)
1183.0ms   50.6%	0.0	 	         WebCore::Editor::respondToChangedSelection(WebCore::VisibleSelection const&amp;, unsigned int)
1183.0ms   50.6%	0.0	 	          WebCore::FrameSelection::setSelection(WebCore::VisibleSelection const&amp;, unsigned int, WebCore::FrameSelection::CursorAlignOnScroll, WebCore::TextGranularity)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>790357</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-12-13 00:21:04 -0800</bug_when>
    <thetext>Okay, I have a fix for this particular bug but selection is still very laggy. Now we spend most of time clipping selection rect :(

Running Time	Self		Symbol Name
2832.0ms   62.5%	0.0	 	                      -[WebTileLayer drawInContext:]
2832.0ms   62.5%	0.0	 	                       WebCore::TileCache::drawLayer(WebTileLayer*, CGContext*)
2832.0ms   62.5%	0.0	 	                        drawLayerContents(CGContext*, CALayer*, WebCore::PlatformCALayer*)
2830.0ms   62.4%	0.0	 	                         WebCore::GraphicsLayer::paintGraphicsLayerContents(WebCore::GraphicsContext&amp;, WebCore::IntRect const&amp;)
2830.0ms   62.4%	0.0	 	                          WebCore::RenderLayerBacking::paintContents(WebCore::GraphicsLayer const*, WebCore::GraphicsContext&amp;, unsigned int, WebCore::IntRect const&amp;)
2830.0ms   62.4%	0.0	 	                           WebCore::RenderLayerBacking::paintIntoLayer(WebCore::RenderLayer*, WebCore::GraphicsContext*, WebCore::IntRect const&amp;, unsigned int, unsigned int)
2829.0ms   62.4%	0.0	 	                            WebCore::RenderLayer::paintLayerContents(WebCore::GraphicsContext*, WebCore::RenderLayer::LayerPaintingInfo const&amp;, unsigned int)
2829.0ms   62.4%	0.0	 	                             WebCore::RenderLayer::paintLayer(WebCore::GraphicsContext*, WebCore::RenderLayer::LayerPaintingInfo const&amp;, unsigned int)
2829.0ms   62.4%	2.0	 	                              WebCore::RenderLayer::paintLayerContents(WebCore::GraphicsContext*, WebCore::RenderLayer::LayerPaintingInfo const&amp;, unsigned int)
2827.0ms   62.4%	0.0	 	                               WebCore::RenderBlock::paint(WebCore::PaintInfo&amp;, WebCore::LayoutPoint const&amp;)
2826.0ms   62.3%	0.0	 	                                WebCore::RenderBlock::paintObject(WebCore::PaintInfo&amp;, WebCore::LayoutPoint const&amp;)
2819.0ms   62.2%	0.0	 	                                 WebCore::RenderBlock::paintFloats(WebCore::PaintInfo&amp;, WebCore::LayoutPoint const&amp;, bool)
2819.0ms   62.2%	0.0	 	                                  WebCore::RenderBlock::paint(WebCore::PaintInfo&amp;, WebCore::LayoutPoint const&amp;)
2819.0ms   62.2%	0.0	 	                                   WebCore::RenderBlock::paintObject(WebCore::PaintInfo&amp;, WebCore::LayoutPoint const&amp;)
1904.0ms   42.0%	0.0	 	                                    WebCore::RenderBlock::paintSelection(WebCore::PaintInfo&amp;, WebCore::LayoutPoint const&amp;)
1363.0ms   30.0%	52.0	 	                                     WebCore::RenderBlock::selectionGaps(WebCore::RenderBlock*, WebCore::LayoutPoint const&amp;, WebCore::LayoutSize const&amp;, WebCore::LayoutUnit&amp;, WebCore::LayoutUnit&amp;, WebCore::LayoutUnit&amp;, WebCore::PaintInfo const*)
1300.0ms   28.7%	12.0	 	                                      WebCore::GraphicsContext::clipOut(WebCore::IntRect const&amp;)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>790360</commentid>
    <comment_count>4</comment_count>
      <attachid>179219</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-12-13 00:24:39 -0800</bug_when>
    <thetext>Created attachment 179219
Don&apos;t find word boundaries outside of editable region</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>790367</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-12-13 00:29:46 -0800</bug_when>
    <thetext>+antti, +kling in the case they know how to improve GraphicsContext::clipOut.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>790372</commentid>
    <comment_count>6</comment_count>
      <attachid>179219</attachid>
    <who name="Hajime Morrita">morrita</who>
    <bug_when>2012-12-13 00:37:09 -0800</bug_when>
    <thetext>Comment on attachment 179219
Don&apos;t find word boundaries outside of editable region

Looks an easy win. You&apos;d file a bug for tracking slowness of selection in general.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>790376</commentid>
    <comment_count>7</comment_count>
      <attachid>179219</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-12-13 00:45:19 -0800</bug_when>
    <thetext>Comment on attachment 179219
Don&apos;t find word boundaries outside of editable region

Thanks for the review.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>790380</commentid>
    <comment_count>8</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2012-12-13 00:53:12 -0800</bug_when>
    <thetext>(In reply to comment #6)
&gt; (From update of attachment 179219 [details])
&gt; Looks an easy win. You&apos;d file a bug for tracking slowness of selection in general.

Yeah, I&apos;ll go talk with someone familiar with GraphicsContext and see there&apos;s anyway to improve clipping.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>790426</commentid>
    <comment_count>9</comment_count>
      <attachid>179219</attachid>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-12-13 02:10:17 -0800</bug_when>
    <thetext>Comment on attachment 179219
Don&apos;t find word boundaries outside of editable region

Clearing flags on attachment: 179219

Committed r137577: &lt;http://trac.webkit.org/changeset/137577&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>790427</commentid>
    <comment_count>10</comment_count>
    <who name="WebKit Review Bot">webkit.review.bot</who>
    <bug_when>2012-12-13 02:10:21 -0800</bug_when>
    <thetext>All reviewed patches have been landed.  Closing bug.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>179219</attachid>
            <date>2012-12-13 00:24:39 -0800</date>
            <delta_ts>2012-12-13 02:10:16 -0800</delta_ts>
            <desc>Don&apos;t find word boundaries outside of editable region</desc>
            <filename>bug-104884-20121213002159.patch</filename>
            <type>text/plain</type>
            <size>1855</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb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G9sZFNlbGVjdGlvbiB8fCAhY3VycmVudFNlbGVjdGlvbi5pc0NvbnRlbnRFZGl0YWJsZSgp
KQogICAgICAgICByZXR1cm47CiAKICAgICBWaXNpYmxlUG9zaXRpb24gc2VsZWN0aW9uUG9zaXRp
b24gPSBjdXJyZW50U2VsZWN0aW9uLnN0YXJ0KCk7Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>