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

Adele adele at opensource.apple.com
Tue Oct 25 15:33:56 PDT 2005


adele       05/10/25 15:33:56

  Modified:    .        ChangeLog
               khtml/rendering render_layer.cpp
  Log:
          Reviewed by Hyatt.
  
          - fixed <rdar://problem/3612121> setting focus, by tabbing, searching, or with JavaScript does not scroll overflow:auto/scroll/overlay to reveal focused element (3480)
  
          * khtml/rendering/render_layer.cpp:
          (khtml::RenderLayer::scrollRectToVisible): Added case for when the renderer has an overflow clip, so we can scroll overflow and views recursively.
  
  Revision  Changes    Path
  1.288     +9 -0      WebCore/ChangeLog
  
  Index: ChangeLog
  ===================================================================
  RCS file: /cvs/root/WebCore/ChangeLog,v
  retrieving revision 1.287
  retrieving revision 1.288
  diff -u -r1.287 -r1.288
  --- ChangeLog	25 Oct 2005 22:32:51 -0000	1.287
  +++ ChangeLog	25 Oct 2005 22:33:52 -0000	1.288
  @@ -1,5 +1,14 @@
   2005-10-25  Adele Peterson  <adele at apple.com>
   
  +        Reviewed by Hyatt.
  +
  +        - fixed <rdar://problem/3612121> setting focus, by tabbing, searching, or with JavaScript does not scroll overflow:auto/scroll/overlay to reveal focused element (3480)
  +
  +        * khtml/rendering/render_layer.cpp: 
  +        (khtml::RenderLayer::scrollRectToVisible): Added case for when the renderer has an overflow clip, so we can scroll overflow and views recursively.
  +
  +2005-10-25  Adele Peterson  <adele at apple.com>
  +
           Reviewed by Vicki.
   
           Fixed <rdar://problem/4098450> RoboHelp-generated html help system crashes in latest Safari -KWQValueListImpl::copyOnWrite
  
  
  
  1.117     +26 -10    WebCore/khtml/rendering/render_layer.cpp
  
  Index: render_layer.cpp
  ===================================================================
  RCS file: /cvs/root/WebCore/khtml/rendering/render_layer.cpp,v
  retrieving revision 1.116
  retrieving revision 1.117
  diff -u -r1.116 -r1.117
  --- render_layer.cpp	25 Oct 2005 21:14:39 -0000	1.116
  +++ render_layer.cpp	25 Oct 2005 22:33:55 -0000	1.117
  @@ -555,17 +555,33 @@
   {
       RenderLayer* parentLayer = 0;
       QRect newRect;
  -    QScrollView* view = m_object->document()->view();
  -    QRect viewRect = QRect(view->contentsX(), view->contentsY(), view->visibleWidth(), view->visibleHeight());
  -    if (view) {
  -        QRect r = getRectToExpose(viewRect, rect, verticalAlignment, verticalAlignment);
  -        view->ensureRectVisible(r);
  -    }
  -    if (m_object->document() && m_object->document()->ownerElement() && m_object->document()->ownerElement()->renderer()) {
  -        parentLayer = m_object->document()->ownerElement()->renderer()->enclosingLayer();
  -        newRect = QRect(view->viewport()->x(), view->viewport()->y(), view->viewport()->width(), view->viewport()->height());
  +    
  +    if (m_object->hasOverflowClip()) {
  +        QRect layerBounds = QRect(m_x + m_scrollX, m_y + m_scrollY, m_width, m_height);
  +        QRect exposeRect = QRect(rect.x() + m_scrollX, rect.y() + m_scrollY, rect.width(), rect.height());
  +        QRect r = getRectToExpose(layerBounds, exposeRect, verticalAlignment, horizontalAlignment);
  +        
  +        int xOffset = r.x() - m_x;
  +        int yOffset = r.y() - m_y;
  +        if (xOffset != m_scrollX || yOffset != m_scrollY)
  +            scrollToOffset(xOffset, yOffset);
  +    
  +        newRect = layerBounds;
  +        if (m_object->parent())
  +            parentLayer = m_object->parent()->enclosingLayer();
  +    } else {
  +        QScrollView* view = m_object->document()->view();
  +        QRect viewRect = QRect(view->contentsX(), view->contentsY(), view->visibleWidth(), view->visibleHeight());
  +        if (view) {
  +            QRect r = getRectToExpose(viewRect, rect, verticalAlignment, verticalAlignment);
  +            view->ensureRectVisible(r);
  +        }
  +        if (m_object->document() && m_object->document()->ownerElement() && m_object->document()->ownerElement()->renderer()) {
  +            parentLayer = m_object->document()->ownerElement()->renderer()->enclosingLayer();
  +            newRect = QRect(view->viewport()->x(), view->viewport()->y(), view->viewport()->width(), view->viewport()->height());
  +        }
       }
  -
  +    
       if (parentLayer)
           parentLayer->scrollRectToVisible(newRect, verticalAlignment, horizontalAlignment);
   }
  
  
  



More information about the webkit-changes mailing list