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

Adele adele at opensource.apple.com
Mon Dec 12 11:04:35 PST 2005


adele       05/12/12 11:04:34

  Modified:    .        ChangeLog
               khtml    khtml_part.cpp
  Log:
          Reviewed by Dave Harrison.
  
          - fixed <rdar://problem/4374673> Regression: Safari fails to scroll to top of page if (name="top") attribute is not present
  
          When there's no node corresponding to the anchor (the name is empty or "top"), we still want to scroll to the top of the document.  This got left out in the conversion to the new scrolling code.
  
          * khtml/khtml_part.cpp: (KHTMLPart::gotoAnchor):
  
  Revision  Changes    Path
  1.514     +10 -0     WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.513
  retrieving revision 1.514
  diff -u -r1.513 -r1.514
  --- ChangeLog	12 Dec 2005 17:37:19 -0000	1.513
  +++ ChangeLog	12 Dec 2005 19:04:25 -0000	1.514
  @@ -1,3 +1,13 @@
  +2005-12-12  Adele Peterson  <adele at apple.com>
  +
  +        Reviewed by Dave Harrison.
  +
  +        - fixed <rdar://problem/4374673> Regression: Safari fails to scroll to top of page if (name="top") attribute is not present
  +
  +        When there's no node corresponding to the anchor (the name is empty or "top"), we still want to scroll to the top of the document.  This got left out in the conversion to the new scrolling code.
  +
  +        * khtml/khtml_part.cpp: (KHTMLPart::gotoAnchor):
  +
   2005-12-12  Rob Buis  <rwlbuis at xs4all.nl>
   
           Reviewed by eseidel.  Committed by eseidel.
  
  
  
  1.365     +16 -5     WebCore/khtml/khtml_part.cpp
  
  Index: khtml_part.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/khtml_part.cpp,v
  retrieving revision 1.364
  retrieving revision 1.365
  diff -u -r1.364 -r1.365
  --- khtml_part.cpp	6 Dec 2005 04:29:23 -0000	1.364
  +++ khtml_part.cpp	12 Dec 2005 19:04:31 -0000	1.365
  @@ -1537,12 +1537,23 @@
       }
     }
     
  -    // Scroll nested layers and frames to reveal the anchor.
  -    if (n && n->renderer()) {
  -        // Align to the top and to the closest side (this matches other browsers).
  -        n->renderer()->enclosingLayer()->scrollRectToVisible(n->getRect(), RenderLayer::gAlignToEdgeIfNeeded, RenderLayer::gAlignTopAlways);
  -    }
  +  // Scroll nested layers and frames to reveal the anchor.
  +  RenderObject *renderer;
  +  QRect rect;
  +  if (n) {
  +      renderer = n->renderer();
  +      rect = n->getRect();
  +  } else {
  +    // If there's no node, we should scroll to the top of the document.
  +      renderer = d->m_doc->renderer();
  +      rect = QRect();
  +  }
   
  +  if (renderer) {
  +    // Align to the top and to the closest side (this matches other browsers).
  +    renderer->enclosingLayer()->scrollRectToVisible(rect, RenderLayer::gAlignToEdgeIfNeeded, RenderLayer::gAlignTopAlways);
  +  }
  +  
     return true;
   }
   
  
  
  



More information about the webkit-changes mailing list