<?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>52742</bug_id>
          
          <creation_ts>2011-01-19 14:12:19 -0800</creation_ts>
          <short_desc>Stop instantiating legacy editing positions in FocusController::advanceFocusInDocumentOrder</short_desc>
          <delta_ts>2011-03-03 16:49:37 -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>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>Enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>52099</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Ryosuke Niwa">rniwa</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>darin</cc>
    
    <cc>justin.garcia</cc>
    
    <cc>kling</cc>
    
    <cc>mario</cc>
    
    <cc>mrobinson</cc>
    
    <cc>pnormand</cc>
    
    <cc>tonikitoo</cc>
    
    <cc>xan.lopez</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>336783</commentid>
    <comment_count>0</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-01-19 14:12:19 -0800</bug_when>
    <thetext>We&apos;re currently in the process of removing all instantiations of legacy editing positions.  FocusController::advanceFocusInDocumentOrder currently instantiates two legacy editing positions in the line:
    if (caretBrowsing) {
        VisibleSelection newSelection(Position(node, 0), Position(node, 0), DOWNSTREAM);
        if (frame-&gt;selection()-&gt;shouldChangeSelection(newSelection))
            frame-&gt;selection()-&gt;setSelection(newSelection);
    }

They should be calling one of helper functions in Position.h or htmlediting.h.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>336788</commentid>
    <comment_count>1</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-01-19 14:14:42 -0800</bug_when>
    <thetext>I think the right thing to do here is to call firstPositionInOrBeforeNode.

This function produces a position [node, 0] when node can have children for editing (div, blockquote, span, etc...) and before node when node can&apos;t have children for editing (br, img, etc...).

Could someone from GTK comment on whether this is right behavior or not?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>337225</commentid>
    <comment_count>2</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2011-01-20 03:01:42 -0800</bug_when>
    <thetext>(In reply to comment #1)
&gt; I think the right thing to do here is to call firstPositionInOrBeforeNode.
&gt; 
&gt; This function produces a position [node, 0] when node can have children for editing (div, blockquote, span, etc...) and before node when node can&apos;t have children for editing (br, img, etc...).
&gt; 
&gt; Could someone from GTK comment on whether this is right behavior or not?

I&apos;ve some doubts whether the right thing to do would be just to call firstPositionInNode(node) instead of your suggestion, but then I&apos;ve tried it out and run the unit and layout tests and it seems everything is fine with firstPositionInOrBeforeNode(node).

So guess you&apos;re right and thus that your patch is the right way to go.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>337333</commentid>
    <comment_count>3</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-01-20 07:35:04 -0800</bug_when>
    <thetext>(In reply to comment #2)
&gt; I&apos;ve some doubts whether the right thing to do would be just to call firstPositionInNode(node) instead of your suggestion, but then I&apos;ve tried it out and run the unit and layout tests and it seems everything is fine with firstPositionInOrBeforeNode(node).

Calling firstPositionInNode won&apos;t make any sense if editing can ignore contents for the node.  e.g. if node was br, img, textarea, etc... it doesn&apos;t make any sense to have a position inside that node.  Is there any guarantee that node is always a container and the contents are not ignored by editing?  That&apos;s a requirement for us to be calling firstPositionInNode.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>337364</commentid>
    <comment_count>4</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2011-01-20 08:45:05 -0800</bug_when>
    <thetext>(In reply to comment #3)
&gt; (In reply to comment #2)
&gt; &gt; I&apos;ve some doubts whether the right thing to do would be just to call firstPositionInNode(node) instead of your suggestion, but then I&apos;ve tried it out and run the unit and layout tests and it seems everything is fine with firstPositionInOrBeforeNode(node).
&gt; 
&gt; Calling firstPositionInNode won&apos;t make any sense if editing can ignore contents for the node.  e.g. if node was br, img, textarea, etc... it doesn&apos;t make any sense to have a position inside that node.  Is there any guarantee that node is always a container and the contents are not ignored by editing?  That&apos;s a requirement for us to be calling firstPositionInNode.

If I could have any doubt wrt this stuff, now you&apos;ve completely dissipated them once and for all. Thanks for the explanation, I appreciate that.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>361432</commentid>
    <comment_count>5</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-03-03 01:07:08 -0800</bug_when>
    <thetext>Mario, are you working on this bug?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>361453</commentid>
    <comment_count>6</comment_count>
    <who name="Mario Sanchez Prada">mario</who>
    <bug_when>2011-03-03 02:09:01 -0800</bug_when>
    <thetext>(In reply to comment #5)
&gt; Mario, are you working on this bug?

Not at the moment, sorry. I&apos;ve started to take a look into it but then I got distracted by other bugs and, I&apos;ve to recognize, I forgot about this one.

Anyway, feel free to make the change yourself if you want. As you can read in comment #2 I tried that out some weeks ago and seemed to work fine, while not breaking any test.

If not, I guess I could take care of this when I finish my current tasks, but things this month are piling up so quickly I can&apos;t tell for sure...

Again, sorry for overlooking this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>361456</commentid>
    <comment_count>7</comment_count>
      <attachid>84539</attachid>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-03-03 02:19:29 -0800</bug_when>
    <thetext>Created attachment 84539
fixes the bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>361457</commentid>
    <comment_count>8</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-03-03 02:20:31 -0800</bug_when>
    <thetext>Could someone from Qt / GTK ports verify that this patch doesn&apos;t cause a regression by running layout tests?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>361591</commentid>
    <comment_count>9</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2011-03-03 07:00:52 -0800</bug_when>
    <thetext>I&apos;ll check this on GTK+, sorry for  the delay!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>361600</commentid>
    <comment_count>10</comment_count>
    <who name="Philippe Normand">pnormand</who>
    <bug_when>2011-03-03 07:20:29 -0800</bug_when>
    <thetext>I checked the editing, accessibility and unit tests on GTK without spotting a failure</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>362087</commentid>
    <comment_count>11</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2011-03-03 16:49:37 -0800</bug_when>
    <thetext>Committed r80298: &lt;http://trac.webkit.org/changeset/80298&gt;</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>84539</attachid>
            <date>2011-03-03 02:19:29 -0800</date>
            <delta_ts>2011-03-03 08:16:57 -0800</delta_ts>
            <desc>fixes the bug</desc>
            <filename>bug-52742-20110303191928.patch</filename>
            <type>text/plain</type>
            <size>1649</size>
            <attacher name="Ryosuke Niwa">rniwa</attacher>
            
              <data encoding="base64">SW5kZXg6IFNvdXJjZS9XZWJDb3JlL0NoYW5nZUxvZwo9PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09Ci0tLSBTb3VyY2UvV2Vi
Q29yZS9DaGFuZ2VMb2cJKHJldmlzaW9uIDgwMjE2K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ya2luZyBjb3B5KQpA
QCAtNTUsNiArNTUsNyBAQAogI2luY2x1ZGUgIlNldHRpbmdzLmgiCiAjaW5jbHVkZSAiU3BhdGlh
bE5hdmlnYXRpb24uaCIKICNpbmNsdWRlICJXaWRnZXQuaCIKKyNpbmNsdWRlICJodG1sZWRpdGlu
Zy5oIiAvLyBGb3IgZmlyc3RQb3NpdGlvbkluT3JCZWZvcmVOb2RlCiAKIG5hbWVzcGFjZSBXZWJD
b3JlIHsKIApAQCAtMjg3LDcgKzI4OCw4IEBAIGJvb2wgRm9jdXNDb250cm9sbGVyOjphZHZhbmNl
Rm9jdXNJbkRvY3UKICAgICAgICAgc2V0Rm9jdXNlZEZyYW1lKG5ld0RvY3VtZW50LT5mcmFtZSgp
KTsKIAogICAgIGlmIChjYXJldEJyb3dzaW5nKSB7Ci0gICAgICAgIFZpc2libGVTZWxlY3Rpb24g
bmV3U2VsZWN0aW9uKFBvc2l0aW9uKG5vZGUsIDApLCBQb3NpdGlvbihub2RlLCAwKSwgRE9XTlNU
UkVBTSk7CisgICAgICAgIFBvc2l0aW9uIHBvc2l0aW9uID0gZmlyc3RQb3NpdGlvbkluT3JCZWZv
cmVOb2RlKG5vZGUpOworICAgICAgICBWaXNpYmxlU2VsZWN0aW9uIG5ld1NlbGVjdGlvbihwb3Np
dGlvbiwgcG9zaXRpb24sIERPV05TVFJFQU0pOwogICAgICAgICBpZiAoZnJhbWUtPnNlbGVjdGlv
bigpLT5zaG91bGRDaGFuZ2VTZWxlY3Rpb24obmV3U2VsZWN0aW9uKSkKICAgICAgICAgICAgIGZy
YW1lLT5zZWxlY3Rpb24oKS0+c2V0U2VsZWN0aW9uKG5ld1NlbGVjdGlvbik7CiAgICAgfQo=
</data>
<flag name="review"
          id="76529"
          type_id="1"
          status="+"
          setter="mrobinson"
    />
          </attachment>
      

    </bug>

</bugzilla>