[webkit-changes] cvs commit: WebCore/khtml/xml dom_nodeimpl.cpp

Adele adele at opensource.apple.com
Thu Dec 1 15:45:23 PST 2005


adele       05/12/01 15:45:22

  Modified:    .        ChangeLog
               .        ChangeLog
               khtml/xml dom_nodeimpl.cpp
  Added:       editing/selection focus_editable_html-expected.checksum
                        focus_editable_html-expected.png
                        focus_editable_html-expected.txt
                        focus_editable_html.html
  Log:
  LayoutTests:
  
          Added test for <rdar://problem/4356771> Regression: Mail always scrolls to the bottom of a message when replying/forwarding
  
          * editing/selection/focus_editable_html-expected.checksum: Added.
          * editing/selection/focus_editable_html-expected.png: Added.
          * editing/selection/focus_editable_html-expected.txt: Added.
          * editing/selection/focus_editable_html.html: Added.
  
  WebCore:
  
          Reviewed by Vicki and Dave Harrsion.
  
          - fixed <rdar://problem/4356771> Regression: Mail always scrolls to the bottom of a message when replying/forwarding
  
          Fixed a bug in getRect where the code would return a zero sized rect at the
          lower right corner if the origin was 0,0.  This was causing the scrolling code to
          attempt to scroll to the lower left corner of the editable html element in Mail.
  
          Added test:
          * editing/selection/focus_editable_html.html
  
          * khtml/xml/dom_nodeimpl.cpp:
          (DOM::ContainerNodeImpl::getRect):
  
  Revision  Changes    Path
  1.119     +9 -0      LayoutTests/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/LayoutTests/ChangeLog,v
  retrieving revision 1.118
  retrieving revision 1.119
  diff -u -r1.118 -r1.119
  --- ChangeLog	1 Dec 2005 17:58:53 -0000	1.118
  +++ ChangeLog	1 Dec 2005 23:45:12 -0000	1.119
  @@ -1,3 +1,12 @@
  +2005-12-01  Adele Peterson  <adele at apple.com>
  +
  +        Added test for <rdar://problem/4356771> Regression: Mail always scrolls to the bottom of a message when replying/forwarding
  +
  +        * editing/selection/focus_editable_html-expected.checksum: Added.
  +        * editing/selection/focus_editable_html-expected.png: Added.
  +        * editing/selection/focus_editable_html-expected.txt: Added.
  +        * editing/selection/focus_editable_html.html: Added.
  +
   2005-12-01  Anders Carlsson  <andersca at mac.com>
   
           Reviewed by Geoffrey.
  
  
  
  1.1                  LayoutTests/editing/selection/focus_editable_html-expected.checksum
  
  Index: focus_editable_html-expected.checksum
  ===================================================================
  4f147eea252b5d96986624026e8cae2c
  
  
  1.1                  LayoutTests/editing/selection/focus_editable_html-expected.png
  
  	<<Binary file>>
  
  
  1.1                  LayoutTests/editing/selection/focus_editable_html-expected.txt
  
  Index: focus_editable_html-expected.txt
  ===================================================================
  EDITING DELEGATE: shouldBeginEditingInDOMRange:range from 0 of HTML > #document to 1 of HTML > #document
  layer at (0,0) size 2008x2070
    RenderCanvas at (0,0) size 785x585
  layer at (0,0) size 2008x2070
    RenderBlock {HTML} at (0,0) size 785x2070
      RenderBody {BODY} at (8,8) size 769x2054
        RenderBlock (anonymous) at (0,0) size 769x36
          RenderText {TEXT} at (0,0) size 583x18
            text run at (0,0) width 583: "This test makes sure that we don't scroll unnecessarily to reveal an editable HTML Element. "
          RenderBR {BR} at (0,0) size 0x0
          RenderText {TEXT} at (0,18) size 262x18
            text run at (0,18) width 262: "If the document doesn't scroll, test passes."
        RenderBlock {DIV} at (0,36) size 2000x2000
        RenderBlock (anonymous) at (0,2036) size 769x18
          RenderText {TEXT} at (0,0) size 237x18
            text run at (0,0) width 237: "If the document scrolls here, test fails."
          RenderText {TEXT} at (0,0) size 0x0
  
  
  
  1.1                  LayoutTests/editing/selection/focus_editable_html.html
  
  Index: focus_editable_html.html
  ===================================================================
  <html id="hElem" contenteditable=true>
  <body onload="document.getElementById('hElem').focus()">
  This test makes sure that we don't scroll unnecessarily to reveal an editable HTML Element.
  <br> If the document doesn't scroll, test passes.
  <div style="width:2000px;height:2000px;"></div>
  If the document scrolls here, test fails.
  </body>
  </html>
  
  
  1.445     +16 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.444
  retrieving revision 1.445
  diff -u -r1.444 -r1.445
  --- ChangeLog	1 Dec 2005 10:32:01 -0000	1.444
  +++ ChangeLog	1 Dec 2005 23:45:14 -0000	1.445
  @@ -1,3 +1,19 @@
  +2005-12-01  Adele Peterson  <adele at apple.com>
  +
  +        Reviewed by Vicki and Dave Harrsion.
  +
  +        - fixed <rdar://problem/4356771> Regression: Mail always scrolls to the bottom of a message when replying/forwarding
  +
  +        Fixed a bug in getRect where the code would return a zero sized rect at the 
  +        lower right corner if the origin was 0,0.  This was causing the scrolling code to
  +        attempt to scroll to the lower left corner of the editable html element in Mail.
  +
  +        Added test: 
  +        * editing/selection/focus_editable_html.html
  +
  +        * khtml/xml/dom_nodeimpl.cpp:
  +        (DOM::ContainerNodeImpl::getRect):
  +
   2005-12-01  Maciej Stachowiak  <mjs at apple.com>
   
           Rubber stamped by Eric.
  
  
  
  1.219     +12 -16    WebCore/khtml/xml/dom_nodeimpl.cpp
  
  Index: dom_nodeimpl.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/xml/dom_nodeimpl.cpp,v
  retrieving revision 1.218
  retrieving revision 1.219
  diff -u -r1.218 -r1.219
  --- dom_nodeimpl.cpp	1 Dec 2005 10:32:27 -0000	1.218
  +++ dom_nodeimpl.cpp	1 Dec 2005 23:45:21 -0000	1.219
  @@ -2685,27 +2685,23 @@
   
   QRect ContainerNodeImpl::getRect() const
   {
  -    int xPos, yPos;
  -    if (!getUpperLeftCorner(xPos,yPos))
  -    {
  -        xPos=0;
  -        yPos=0;
  -    }
  -    int xEnd, yEnd;
  -    if (!getLowerRightCorner(xEnd,yEnd))
  +    int xPos = 0, yPos = 0, xEnd = 0, yEnd = 0;
  +    bool foundUpperLeft = getUpperLeftCorner(xPos,yPos);
  +    bool foundLowerRight = getLowerRightCorner(xEnd,yEnd);
  +    
  +    // If we've found one corner, but not the other,
  +    // then we should just return a point at the corner that we did find.
  +    if (foundUpperLeft != foundLowerRight)
       {
  -        if (xPos)
  +        if (foundUpperLeft) {
               xEnd = xPos;
  -        if (yPos)
               yEnd = yPos;
  -    }
  -    else
  -    {
  -        if (xPos==0)
  +        } else {
               xPos = xEnd;
  -        if (yPos==0)
               yPos = yEnd;
  -    }
  +        }
  +    } 
  +
       if (xEnd < xPos)
           xEnd = xPos;
       if (yEnd < yPos)
  
  
  



More information about the webkit-changes mailing list