[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

rjw rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:24:15 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 04ca9b2dd122b41ff7254ec8766cef1387e3f768
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Jul 13 22:01:32 2002 +0000

            Fixed 2981849 - frames don't always draw correctly.
    
            * WebCoreSupport.subproj/IFWebCoreBridge.mm:
            (-[IFWebCoreBridge childFrameNamed:]):
            Check provisional data source first.
    
            * WebView.subproj/IFHTMLViewPrivate.h:
            * WebView.subproj/IFHTMLViewPrivate.mm:
            (-[IFHTMLView _adjustFrames]):
            Added method to adjust frame geometry.
    
            * WebView.subproj/IFWebDataSourcePrivate.h:
            * WebView.subproj/IFWebDataSourcePrivate.mm:
            (-[IFWebDataSource _layoutChildren]):
            Added method to adjust child frame geometries.
    
            * WebView.subproj/IFWebFramePrivate.mm:
            (-[IFWebFrame _isLoadComplete]):
            Removed unnecessary drawing now that frame geometry is
            calculated directly.
    
            * kwq/KWQPainter.mm:
            Added disable drawing mode.
            (QPainter::drawRect):
            (QPainter::drawLine):
            (QPainter::drawEllipse):
            (QPainter::drawArc):
            (QPainter::drawLineSegments):
            (QPainter::drawPolyline):
            (QPainter::drawPolygon):
            (QPainter::drawConvexPolygon):
            (QPainter::drawPixmap):
            (QPainter::drawTiledPixmap):
            (QPainter::drawText):
            (QPainter::drawUnderlineForText):
            (QPainter::fillRect):
            (QPainter::setPaintingDisabled):
    
            * kwq/KWQWidget.mm:
            (QWidget::frameGeometry):
            Use the IFWebView's geometry.
    
            * kwq/WebCoreBridge.h:
            * kwq/WebCoreBridge.mm:
            (-[WebCoreBridge _drawRect:withPainter:]):
            (-[WebCoreBridge drawRect:]):
            (-[WebCoreBridge adjustFrames:]):
            Added adjustFrames:.  Factored some code.
    
            * kwq/qt/qpainter.h:
            Added setPaintingDisabled.
    
            * khtml/html/html_baseimpl.cpp:
            (HTMLFrameElementImpl::attach):
            (HTMLIFrameElementImpl::attach):
            Removed uniqueness check.  Need to revisit vis-a-vis provisional ds.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1550 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 0006257..3e4bef4 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,41 @@
+2002-07-13  Richard Williamson (Home)  <rjw at apple.com>
+
+        * kwq/KWQPainter.mm:
+        Added disable drawing mode.
+        (QPainter::drawRect):
+        (QPainter::drawLine):
+        (QPainter::drawEllipse):
+        (QPainter::drawArc):
+        (QPainter::drawLineSegments):
+        (QPainter::drawPolyline):
+        (QPainter::drawPolygon):
+        (QPainter::drawConvexPolygon):
+        (QPainter::drawPixmap):
+        (QPainter::drawTiledPixmap):
+        (QPainter::drawText):
+        (QPainter::drawUnderlineForText):
+        (QPainter::fillRect):
+        (QPainter::setPaintingDisabled):
+        
+        * kwq/KWQWidget.mm:
+        (QWidget::frameGeometry):
+        Use the IFWebView's geometry.
+        
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge _drawRect:withPainter:]):
+        (-[WebCoreBridge drawRect:]):
+        (-[WebCoreBridge adjustFrames:]):
+        Added adjustFrames:.  Factored some code.
+        
+        * kwq/qt/qpainter.h:
+        Added setPaintingDisabled.
+
+        * khtml/html/html_baseimpl.cpp:
+        (HTMLFrameElementImpl::attach):
+        (HTMLIFrameElementImpl::attach):
+        Removed uniqueness check.  Need to revisit vis-a-vis provisional ds.
+        
 2002-07-12  Darin Adler  <darin at apple.com>
 
         * WebCore.pbproj/project.pbxproj: Add WebCoreFrame.mm, also export all
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 0006257..3e4bef4 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,41 @@
+2002-07-13  Richard Williamson (Home)  <rjw at apple.com>
+
+        * kwq/KWQPainter.mm:
+        Added disable drawing mode.
+        (QPainter::drawRect):
+        (QPainter::drawLine):
+        (QPainter::drawEllipse):
+        (QPainter::drawArc):
+        (QPainter::drawLineSegments):
+        (QPainter::drawPolyline):
+        (QPainter::drawPolygon):
+        (QPainter::drawConvexPolygon):
+        (QPainter::drawPixmap):
+        (QPainter::drawTiledPixmap):
+        (QPainter::drawText):
+        (QPainter::drawUnderlineForText):
+        (QPainter::fillRect):
+        (QPainter::setPaintingDisabled):
+        
+        * kwq/KWQWidget.mm:
+        (QWidget::frameGeometry):
+        Use the IFWebView's geometry.
+        
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge _drawRect:withPainter:]):
+        (-[WebCoreBridge drawRect:]):
+        (-[WebCoreBridge adjustFrames:]):
+        Added adjustFrames:.  Factored some code.
+        
+        * kwq/qt/qpainter.h:
+        Added setPaintingDisabled.
+
+        * khtml/html/html_baseimpl.cpp:
+        (HTMLFrameElementImpl::attach):
+        (HTMLIFrameElementImpl::attach):
+        Removed uniqueness check.  Need to revisit vis-a-vis provisional ds.
+        
 2002-07-12  Darin Adler  <darin at apple.com>
 
         * WebCore.pbproj/project.pbxproj: Add WebCoreFrame.mm, also export all
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 0006257..3e4bef4 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,41 @@
+2002-07-13  Richard Williamson (Home)  <rjw at apple.com>
+
+        * kwq/KWQPainter.mm:
+        Added disable drawing mode.
+        (QPainter::drawRect):
+        (QPainter::drawLine):
+        (QPainter::drawEllipse):
+        (QPainter::drawArc):
+        (QPainter::drawLineSegments):
+        (QPainter::drawPolyline):
+        (QPainter::drawPolygon):
+        (QPainter::drawConvexPolygon):
+        (QPainter::drawPixmap):
+        (QPainter::drawTiledPixmap):
+        (QPainter::drawText):
+        (QPainter::drawUnderlineForText):
+        (QPainter::fillRect):
+        (QPainter::setPaintingDisabled):
+        
+        * kwq/KWQWidget.mm:
+        (QWidget::frameGeometry):
+        Use the IFWebView's geometry.
+        
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm:
+        (-[WebCoreBridge _drawRect:withPainter:]):
+        (-[WebCoreBridge drawRect:]):
+        (-[WebCoreBridge adjustFrames:]):
+        Added adjustFrames:.  Factored some code.
+        
+        * kwq/qt/qpainter.h:
+        Added setPaintingDisabled.
+
+        * khtml/html/html_baseimpl.cpp:
+        (HTMLFrameElementImpl::attach):
+        (HTMLIFrameElementImpl::attach):
+        Removed uniqueness check.  Need to revisit vis-a-vis provisional ds.
+        
 2002-07-12  Darin Adler  <darin at apple.com>
 
         * WebCore.pbproj/project.pbxproj: Add WebCoreFrame.mm, also export all
diff --git a/WebCore/khtml/html/html_baseimpl.cpp b/WebCore/khtml/html/html_baseimpl.cpp
index 1bae529..1dfaf4c 100644
--- a/WebCore/khtml/html/html_baseimpl.cpp
+++ b/WebCore/khtml/html/html_baseimpl.cpp
@@ -318,7 +318,11 @@ void HTMLFrameElementImpl::attach()
         return;
 
     // we need a unique name for every frame in the frameset. Hope that's unique enough.
+#ifdef APPLE_CHANGES
+    if(name.isEmpty())
+#else
     if(name.isEmpty() || w->part()->frameExists( name.string() ) )
+#endif
       name = DOMString(w->part()->requestFrameName());
 
     // load the frame contents
@@ -630,7 +634,11 @@ void HTMLIFrameElementImpl::attach()
     if (m_render) {
         // we need a unique name for every frame in the frameset. Hope that's unique enough.
         KHTMLView* w = getDocument()->view();
+#ifdef APPLE_CHANGES
+        if(name.isEmpty())
+#else
         if(name.isEmpty() || w->part()->frameExists( name.string() ))
+#endif
             name = DOMString(w->part()->requestFrameName());
 
         static_cast<RenderPartObject*>(m_render)->updateWidget();
diff --git a/WebCore/kwq/KWQPainter.h b/WebCore/kwq/KWQPainter.h
index 45e41a6..6911692 100644
--- a/WebCore/kwq/KWQPainter.h
+++ b/WebCore/kwq/KWQPainter.h
@@ -122,6 +122,8 @@ public:
 
     static QColor selectedTextBackgroundColor();
     
+    void setPaintingDisabled(bool f);
+    
 private:
     // no copying or assignment
     // note that these are "standard" (no pendantic stuff needed)
diff --git a/WebCore/kwq/KWQPainter.mm b/WebCore/kwq/KWQPainter.mm
index 411b2a3..66657a2 100644
--- a/WebCore/kwq/KWQPainter.mm
+++ b/WebCore/kwq/KWQPainter.mm
@@ -37,11 +37,12 @@
 #import <WebCoreImageRenderer.h>
 
 struct QPState {				// painter state
-    QPState() : compositingOperation(NSCompositeCopy) { }
+    QPState() : compositingOperation(NSCompositeCopy),paintingDisabled(0) { }
     QFont font;
     QPen pen;
     QBrush brush;
     NSCompositingOperation compositingOperation;
+    bool paintingDisabled;
 };
 
 typedef QPtrStack<QPState> QPStateStack;
@@ -176,6 +177,9 @@ void QPainter::restore()
 // Draws a filled rectangle with a stroked border.
 void QPainter::drawRect(int x, int y, int w, int h)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     _lockFocus();
     if (data->state.brush.style() != NoBrush) {
         _setColorFromBrush();
@@ -204,6 +208,9 @@ void QPainter::_setColorFromPen()
 // This is only used to draw borders around text, and lines over text.
 void QPainter::drawLine(int x1, int y1, int x2, int y2)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     PenStyle penStyle = data->state.pen.style();
     if (penStyle == NoPen)
         return;
@@ -256,6 +263,9 @@ void QPainter::drawLine(int x1, int y1, int x2, int y2)
 // This method is only used to draw the little circles used in lists.
 void QPainter::drawEllipse(int x, int y, int w, int h)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     NSBezierPath *path;
     
     path = [NSBezierPath bezierPathWithOvalInRect: NSMakeRect (x, y, w, h)];
@@ -276,6 +286,9 @@ void QPainter::drawEllipse(int x, int y, int w, int h)
 // Only supports arc on circles.  That's all khtml needs.
 void QPainter::drawArc (int x, int y, int w, int h, int a, int alen)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     if (data->state.pen.style() != NoPen){
 
         NSBezierPath *path;
@@ -305,11 +318,17 @@ void QPainter::drawArc (int x, int y, int w, int h, int a, int alen)
 
 void QPainter::drawLineSegments(const QPointArray &points, int index, int nlines)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     _drawPoints (points, 0, index, nlines, FALSE);
 }
 
 void QPainter::drawPolyline(const QPointArray &points, int index, int npoints)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     _drawPoints (points, 0, index, npoints, FALSE);
 }
 
@@ -317,11 +336,17 @@ void QPainter::drawPolyline(const QPointArray &points, int index, int npoints)
 void QPainter::drawPolygon(const QPointArray &points, bool winding, int index, 
     int npoints)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     _drawPoints (points, winding, index, npoints, TRUE);
 }
 
 void QPainter::drawConvexPolygon(const QPointArray &points)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     _drawPoints (points, FALSE, 0, -1, TRUE);
 }
 
@@ -365,18 +390,27 @@ void QPainter::_drawPoints (const QPointArray &_points, bool winding, int index,
 
 void QPainter::drawPixmap(const QPoint &p, const QPixmap &pix)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     drawPixmap (p.x(), p.y(), pix);
 }
 
 
 void QPainter::drawPixmap(const QPoint &p, const QPixmap &pix, const QRect &r)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     drawPixmap (p.x(), p.y(), pix, r.x(), r.y(), r.width(), r.height());
 }
 
 void QPainter::drawPixmap( int x, int y, const QPixmap &pixmap,
                            int sx, int sy, int sw, int sh )
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     _lockFocus();
 
     if (sw == -1)
@@ -393,12 +427,18 @@ void QPainter::drawPixmap( int x, int y, const QPixmap &pixmap,
 void QPainter::drawTiledPixmap( int x, int y, int w, int h,
 				const QPixmap &pixmap, int sx, int sy )
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     [pixmap.imageRenderer tileInRect:NSMakeRect(x, y, w, h) fromPoint:NSMakePoint(sx, sy)];
 }
 
 // y is the baseline
 void QPainter::drawText(int x, int y, const QString &qstring, int len)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     _lockFocus();
     
     if (len == -1)
@@ -412,11 +452,17 @@ void QPainter::drawText(int x, int y, const QString &qstring, int len)
 
 void QPainter::drawText(int x, int y, const QString &qstring, int len, TextDirection dir)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     drawText(x, y, qstring, 0, len, dir);
 }
 
 void QPainter::drawText(int x, int y, const QString &qstring, int from, int to, const QColor &backgroundColor)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     _lockFocus();
 
     [[[WebCoreTextRendererFactory sharedFactory]
@@ -431,6 +477,9 @@ void QPainter::drawText(int x, int y, const QString &qstring, int from, int to,
 
 void QPainter::drawText(int x, int y, const QString &qstring, int pos, int len, TextDirection dir)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     if (dir == RTL) {
         _logPartiallyImplemented();
     }
@@ -444,6 +493,9 @@ void QPainter::drawText(int x, int y, const QString &qstring, int pos, int len,
 
 void QPainter::drawUnderlineForText(int x, int y, const QString &qstring, int len)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     NSString *string;
     
     _lockFocus();
@@ -464,6 +516,9 @@ void QPainter::drawUnderlineForText(int x, int y, const QString &qstring, int le
 void QPainter::drawText(int x, int y, int w, int h, int flags, const QString &qstring, int len, 
     QRect *br, char **internal)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     NSString *string;
     NSMutableParagraphStyle *style = [[[NSMutableParagraphStyle alloc] init] autorelease];
     
@@ -508,6 +563,9 @@ QColor QPainter::selectedTextBackgroundColor()
 
 void QPainter::fillRect(int x, int y, int w, int h, const QBrush &brush)
 {
+    if (data->state.paintingDisabled)
+        return;
+        
     _lockFocus();
     if (brush.style() == SolidPattern) {
         [brush.color().getNSColor() set];
@@ -625,4 +683,10 @@ void QPainter::_unlockFocus()
 #endif
 }
 
+void QPainter::setPaintingDisabled(bool f)
+{
+    data->state.paintingDisabled = f;
+}
+
+
 
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index 4c03dff..1829a42 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -95,7 +95,7 @@ long QWidget::winId() const
     return (long)this;
 }
 
-int QWidget::x() const 
+int QWidget::x() const
 {
     return frameGeometry().topLeft().x();
 }
@@ -132,7 +132,7 @@ QPoint QWidget::pos() const
 
 void QWidget::move(int x, int y) 
 {
-    KWQDEBUG ("%p %s to x %d y %d\n", getView(), [[[getView() class] className] cString], x, y);
+    //KWQDEBUG ("%p %s to x %d y %d\n", getView(), [[[getView() class] className] cString], x, y);
     internalSetGeometry(x, y, width(), height());
 }
 
@@ -143,7 +143,12 @@ void QWidget::move(const QPoint &p)
 
 QRect QWidget::frameGeometry() const
 {
-    NSRect vFrame = [getView() frame];
+    NSView *view = getView();
+    
+    if ([view conformsToProtocol:@protocol(WebCoreFrameView)]) {
+        view = [view superview];
+    }
+    NSRect vFrame = [view frame];
     return QRect((int)vFrame.origin.x, (int)vFrame.origin.y, (int)vFrame.size.width, (int)vFrame.size.height);
 }
 
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index f0dbd39..334ce47 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -87,6 +87,7 @@ typedef khtml::RenderPart KHTMLRenderPart;
 
 - (void)reapplyStyles;
 - (void)forceLayout;
+- (void)adjustFrames: (NSRect)rect;
 - (void)drawRect:(NSRect)rect;
 
 @end
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 3fdf941..fac9496 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -150,16 +150,35 @@
     }
 }
 
-- (void)drawRect:(NSRect)rect
+- (void)_drawRect:(NSRect)rect withPainter: (QPainter *)p
 {
     DOM::DocumentImpl *doc = part->xmlDocImpl();
     if (doc) {
         khtml::RenderObject *renderer = doc->renderer();
         if (renderer) {
-            QPainter p;
-            renderer->print(&p, (int)rect.origin.x, (int)rect.origin.y, (int)rect.size.width, (int)rect.size.height, 0, 0);
+            renderer->print(p, (int)rect.origin.x, (int)rect.origin.y, (int)rect.size.width, (int)rect.size.height, 0, 0);
         }
     }
 }
 
+- (void)drawRect:(NSRect)rect
+{
+    QPainter p;
+    [self _drawRect:rect withPainter: &p];
+}
+
+- (void)adjustFrames: (NSRect)rect
+{
+    // Ick!  khtml sets the frame size during layout and
+    // the frame origins during drawing!  So we have to 
+    // layout and do a draw with rendering disabled to
+    // correclty adjust the frames.
+    [self forceLayout];
+    QPainter p;
+    p.setPaintingDisabled(YES);
+    [self _drawRect:rect withPainter: &p];
+}
+
+
+
 @end
diff --git a/WebCore/kwq/qt/qpainter.h b/WebCore/kwq/qt/qpainter.h
index 45e41a6..6911692 100644
--- a/WebCore/kwq/qt/qpainter.h
+++ b/WebCore/kwq/qt/qpainter.h
@@ -122,6 +122,8 @@ public:
 
     static QColor selectedTextBackgroundColor();
     
+    void setPaintingDisabled(bool f);
+    
 private:
     // no copying or assignment
     // note that these are "standard" (no pendantic stuff needed)
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 00cbda3..82888ca 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,26 @@
+2002-07-13  Richard Williamson (Home)  <rjw at apple.com>
+
+        Fixed 2981849 - frames don't always draw correctly.
+        
+        * WebCoreSupport.subproj/IFWebCoreBridge.mm:
+        (-[IFWebCoreBridge childFrameNamed:]):
+        Check provisional data source first.
+        
+        * WebView.subproj/IFHTMLViewPrivate.h:
+        * WebView.subproj/IFHTMLViewPrivate.mm:
+        (-[IFHTMLView _adjustFrames]):
+        Added method to adjust frame geometry.
+        
+        * WebView.subproj/IFWebDataSourcePrivate.h:
+        * WebView.subproj/IFWebDataSourcePrivate.mm:
+        (-[IFWebDataSource _layoutChildren]):
+        Added method to adjust child frame geometries.
+        
+        * WebView.subproj/IFWebFramePrivate.mm:
+        (-[IFWebFrame _isLoadComplete]):
+        Removed unnecessary drawing now that frame geometry is
+        calculated directly.
+        
 2002-07-12  Darin Adler  <darin at apple.com>
 
 	About 1/3 of the remaining work to wean WebKit from its special relationship with WebCore
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 00cbda3..82888ca 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,26 @@
+2002-07-13  Richard Williamson (Home)  <rjw at apple.com>
+
+        Fixed 2981849 - frames don't always draw correctly.
+        
+        * WebCoreSupport.subproj/IFWebCoreBridge.mm:
+        (-[IFWebCoreBridge childFrameNamed:]):
+        Check provisional data source first.
+        
+        * WebView.subproj/IFHTMLViewPrivate.h:
+        * WebView.subproj/IFHTMLViewPrivate.mm:
+        (-[IFHTMLView _adjustFrames]):
+        Added method to adjust frame geometry.
+        
+        * WebView.subproj/IFWebDataSourcePrivate.h:
+        * WebView.subproj/IFWebDataSourcePrivate.mm:
+        (-[IFWebDataSource _layoutChildren]):
+        Added method to adjust child frame geometries.
+        
+        * WebView.subproj/IFWebFramePrivate.mm:
+        (-[IFWebFrame _isLoadComplete]):
+        Removed unnecessary drawing now that frame geometry is
+        calculated directly.
+        
 2002-07-12  Darin Adler  <darin at apple.com>
 
 	About 1/3 of the remaining work to wean WebKit from its special relationship with WebCore
diff --git a/WebKit/WebCoreSupport.subproj/IFWebCoreBridge.mm b/WebKit/WebCoreSupport.subproj/IFWebCoreBridge.mm
index 1acc192..acf5a89 100644
--- a/WebKit/WebCoreSupport.subproj/IFWebCoreBridge.mm
+++ b/WebKit/WebCoreSupport.subproj/IFWebCoreBridge.mm
@@ -62,6 +62,12 @@
 
 - (WebCoreFrame *)childFrameNamed:(NSString *)name
 {
+    IFWebDataSource *pd;
+    
+    pd = [[dataSource webFrame] provisionalDataSource];
+    if (pd)
+        return [[pd frameNamed: name] _bridgeFrame];
+
     return [[dataSource frameNamed:name] _bridgeFrame];
 }
 
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 1acc192..acf5a89 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -62,6 +62,12 @@
 
 - (WebCoreFrame *)childFrameNamed:(NSString *)name
 {
+    IFWebDataSource *pd;
+    
+    pd = [[dataSource webFrame] provisionalDataSource];
+    if (pd)
+        return [[pd frameNamed: name] _bridgeFrame];
+
     return [[dataSource frameNamed:name] _bridgeFrame];
 }
 
diff --git a/WebKit/WebView.subproj/IFHTMLViewPrivate.h b/WebKit/WebView.subproj/IFHTMLViewPrivate.h
index 53a9857..d477faf 100644
--- a/WebKit/WebView.subproj/IFHTMLViewPrivate.h
+++ b/WebKit/WebView.subproj/IFHTMLViewPrivate.h
@@ -41,4 +41,5 @@ class KHTMLView;
 - (KHTMLView *)_widget;
 - (KHTMLView *)_provisionalWidget;
 - (IFWebCoreBridge *)_bridge;
+- (void)_adjustFrames;
 @end
diff --git a/WebKit/WebView.subproj/IFHTMLViewPrivate.mm b/WebKit/WebView.subproj/IFHTMLViewPrivate.mm
index 45d1aee..7628827 100644
--- a/WebKit/WebView.subproj/IFHTMLViewPrivate.mm
+++ b/WebKit/WebView.subproj/IFHTMLViewPrivate.mm
@@ -46,6 +46,16 @@
 
 @implementation IFHTMLView (IFPrivate)
 
+- (void)_adjustFrames
+{
+    // Ick!  khtml set the frame size during layout and
+    // the frame origins during drawing!  So we have to 
+    // layout and do a draw with rendering disabled to
+    // correclty adjust the frames.
+    [[self _bridge] adjustFrames: [self frame]];
+}
+
+
 - (void)_reset
 {
     NSArray *subviews = [[self subviews] copy];
diff --git a/WebKit/WebView.subproj/IFWebDataSourcePrivate.h b/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
index 3947ea3..8d82843 100644
--- a/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/IFWebDataSourcePrivate.h
@@ -91,7 +91,7 @@
 - (void)_setContentPolicy:(IFContentPolicy)policy;
 - (void)_setContentType:(NSString *)type;
 - (void)_setEncoding:(NSString *)encoding;
-
+- (void)_layoutChildren;
 - (void)_clearErrors;
 - (void)_setMainDocumentError: (IFError *)error;
 - (void)_addError: (IFError *)error forResource: (NSString *)resourceDescription;
diff --git a/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm b/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
index d937f2b..3766850 100644
--- a/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebDataSourcePrivate.mm
@@ -11,6 +11,7 @@
 #import <WebKit/IFDocument.h>
 #import <WebKit/IFException.h>
 #import <WebKit/IFHTMLRepresentation.h>
+#import <WebKit/IFHTMLViewPrivate.h>
 #import <WebKit/IFImageRepresentation.h>
 #import <WebKit/IFLocationChangeHandler.h>
 #import <WebKit/IFMainURLHandleClient.h>
@@ -18,6 +19,7 @@
 #import <WebKit/IFWebController.h>
 #import <WebKit/IFWebCoreBridge.h>
 #import <WebKit/IFWebFramePrivate.h>
+#import <WebKit/IFWebView.h>
 #import <WebKit/WebKitDebug.h>
 
 #import <WebFoundation/IFError.h>
@@ -346,6 +348,25 @@
     [_private->errors setObject: error forKey: resourceDescription];
 }
 
+
+- (void)_layoutChildren
+{
+    if ([[self children] count] > 0){
+        NSArray *subFrames = [self children];
+        IFWebFrame *subFrame;
+        unsigned int i;
+        id dview;
+        for (i = 0; i < [subFrames count]; i++){
+            subFrame = [subFrames objectAtIndex: i];
+            dview = [[subFrame webView] documentView];
+            if ([[subFrame webView] isDocumentHTML])
+                [dview _adjustFrames];
+            [dview setNeedsDisplay: YES];
+            [[subFrame dataSource] _layoutChildren];
+        }
+    }
+}
+
 + (NSMutableDictionary *)_repTypes
 {
     static NSMutableDictionary *repTypes = nil;
diff --git a/WebKit/WebView.subproj/IFWebFramePrivate.mm b/WebKit/WebView.subproj/IFWebFramePrivate.mm
index 746fafd..fe5d415 100644
--- a/WebKit/WebView.subproj/IFWebFramePrivate.mm
+++ b/WebKit/WebView.subproj/IFWebFramePrivate.mm
@@ -333,57 +333,38 @@ static const char * const stateNames[6] = {
             
             //WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s:  checking complete, current state IFWEBFRAMESTATE_COMMITTED\n", [[self name] cString]);
             if (![ds isLoading]) {
-                id mainView = [[[self controller] mainFrame] webView];
-                NSView <IFDocumentView> *mainDocumentView = [mainView documentView];
-#if 0
                 id thisView = [self webView];
                 NSView <IFDocumentView> *thisDocumentView = [thisView documentView];
-#endif
+
                 [self _setState: IFWEBFRAMESTATE_COMPLETE];
                 
                 [[ds _bridge] end];
 
-                // We have to layout the main document as
-                // it may change the size of frames.
-                // FIXME:  Why is this necessary? and recurse.
-                {
-                    if ([mainView isDocumentHTML]) {
-                        [(IFHTMLView *)mainDocumentView setNeedsLayout: YES];
-                    }
-                    [mainDocumentView layout];
-                    
-                    NSArray *subFrames = [[[[self controller] mainFrame] dataSource] children];
-                    unsigned int i;
-                    id dview;
-                    for (i = 0; i < [subFrames count]; i++){
-                        dview = [[[subFrames objectAtIndex: i] webView] documentView];
-                        if ([[[subFrames objectAtIndex: i] webView] isDocumentHTML])
-                            [dview setNeedsLayout: YES];
-                        [dview layout];
-                    }
-                }
+                // Unfortunately we have to get our parent to adjust the frames in this
+                // frameset so this frame's geometry is set correctly.  This should
+                // be a reasonably inexpensive operation.
+                id parentWebView = [[[ds parent] webFrame] webView];
+                if ([parentWebView isDocumentHTML])
+                    [[parentWebView documentView] _adjustFrames];
 
-#if 0
                 // Tell the just loaded document to layout.  This may be necessary
                 // for non-html content that needs a layout message.
                 if ([thisView isDocumentHTML]){
-                    [thisDocumentView setNeedsLayout: YES];
+                    IFHTMLView *hview = thisDocumentView;
+                    [hview setNeedsLayout: YES];
                 }
                 [thisDocumentView layout];
 
+                // Unfortunately if this frame has children we have to lay them
+                // out too.
+                [ds _layoutChildren];
+
                 [thisDocumentView setNeedsDisplay: YES];
-                [thisDocumentView display];
-#endif
+                //[thisDocumentView display];
 
                 // Jump to anchor point, if necessary.
                 [[ds _bridge] scrollToBaseAnchor];
 
-                // FIXME:  We have to draw the whole document hierarchy.  We should be 
-                // able to just draw the document associated with this
-                // frame, but that doesn't work.  Not sure why.
-                [mainDocumentView setNeedsDisplay: YES];
-                [mainDocumentView display];
-
                 [[ds _locationChangeHandler] locationChangeDone: [ds mainDocumentError] forDataSource:ds];
  
                 //if ([ds isDocumentHTML])
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.h b/WebKit/WebView.subproj/WebDataSourcePrivate.h
index 3947ea3..8d82843 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.h
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.h
@@ -91,7 +91,7 @@
 - (void)_setContentPolicy:(IFContentPolicy)policy;
 - (void)_setContentType:(NSString *)type;
 - (void)_setEncoding:(NSString *)encoding;
-
+- (void)_layoutChildren;
 - (void)_clearErrors;
 - (void)_setMainDocumentError: (IFError *)error;
 - (void)_addError: (IFError *)error forResource: (NSString *)resourceDescription;
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index d937f2b..3766850 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -11,6 +11,7 @@
 #import <WebKit/IFDocument.h>
 #import <WebKit/IFException.h>
 #import <WebKit/IFHTMLRepresentation.h>
+#import <WebKit/IFHTMLViewPrivate.h>
 #import <WebKit/IFImageRepresentation.h>
 #import <WebKit/IFLocationChangeHandler.h>
 #import <WebKit/IFMainURLHandleClient.h>
@@ -18,6 +19,7 @@
 #import <WebKit/IFWebController.h>
 #import <WebKit/IFWebCoreBridge.h>
 #import <WebKit/IFWebFramePrivate.h>
+#import <WebKit/IFWebView.h>
 #import <WebKit/WebKitDebug.h>
 
 #import <WebFoundation/IFError.h>
@@ -346,6 +348,25 @@
     [_private->errors setObject: error forKey: resourceDescription];
 }
 
+
+- (void)_layoutChildren
+{
+    if ([[self children] count] > 0){
+        NSArray *subFrames = [self children];
+        IFWebFrame *subFrame;
+        unsigned int i;
+        id dview;
+        for (i = 0; i < [subFrames count]; i++){
+            subFrame = [subFrames objectAtIndex: i];
+            dview = [[subFrame webView] documentView];
+            if ([[subFrame webView] isDocumentHTML])
+                [dview _adjustFrames];
+            [dview setNeedsDisplay: YES];
+            [[subFrame dataSource] _layoutChildren];
+        }
+    }
+}
+
 + (NSMutableDictionary *)_repTypes
 {
     static NSMutableDictionary *repTypes = nil;
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 746fafd..fe5d415 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -333,57 +333,38 @@ static const char * const stateNames[6] = {
             
             //WEBKITDEBUGLEVEL (WEBKIT_LOG_LOADING, "%s:  checking complete, current state IFWEBFRAMESTATE_COMMITTED\n", [[self name] cString]);
             if (![ds isLoading]) {
-                id mainView = [[[self controller] mainFrame] webView];
-                NSView <IFDocumentView> *mainDocumentView = [mainView documentView];
-#if 0
                 id thisView = [self webView];
                 NSView <IFDocumentView> *thisDocumentView = [thisView documentView];
-#endif
+
                 [self _setState: IFWEBFRAMESTATE_COMPLETE];
                 
                 [[ds _bridge] end];
 
-                // We have to layout the main document as
-                // it may change the size of frames.
-                // FIXME:  Why is this necessary? and recurse.
-                {
-                    if ([mainView isDocumentHTML]) {
-                        [(IFHTMLView *)mainDocumentView setNeedsLayout: YES];
-                    }
-                    [mainDocumentView layout];
-                    
-                    NSArray *subFrames = [[[[self controller] mainFrame] dataSource] children];
-                    unsigned int i;
-                    id dview;
-                    for (i = 0; i < [subFrames count]; i++){
-                        dview = [[[subFrames objectAtIndex: i] webView] documentView];
-                        if ([[[subFrames objectAtIndex: i] webView] isDocumentHTML])
-                            [dview setNeedsLayout: YES];
-                        [dview layout];
-                    }
-                }
+                // Unfortunately we have to get our parent to adjust the frames in this
+                // frameset so this frame's geometry is set correctly.  This should
+                // be a reasonably inexpensive operation.
+                id parentWebView = [[[ds parent] webFrame] webView];
+                if ([parentWebView isDocumentHTML])
+                    [[parentWebView documentView] _adjustFrames];
 
-#if 0
                 // Tell the just loaded document to layout.  This may be necessary
                 // for non-html content that needs a layout message.
                 if ([thisView isDocumentHTML]){
-                    [thisDocumentView setNeedsLayout: YES];
+                    IFHTMLView *hview = thisDocumentView;
+                    [hview setNeedsLayout: YES];
                 }
                 [thisDocumentView layout];
 
+                // Unfortunately if this frame has children we have to lay them
+                // out too.
+                [ds _layoutChildren];
+
                 [thisDocumentView setNeedsDisplay: YES];
-                [thisDocumentView display];
-#endif
+                //[thisDocumentView display];
 
                 // Jump to anchor point, if necessary.
                 [[ds _bridge] scrollToBaseAnchor];
 
-                // FIXME:  We have to draw the whole document hierarchy.  We should be 
-                // able to just draw the document associated with this
-                // frame, but that doesn't work.  Not sure why.
-                [mainDocumentView setNeedsDisplay: YES];
-                [mainDocumentView display];
-
                 [[ds _locationChangeHandler] locationChangeDone: [ds mainDocumentError] forDataSource:ds];
  
                 //if ([ds isDocumentHTML])
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.h b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
index 53a9857..d477faf 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.h
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.h
@@ -41,4 +41,5 @@ class KHTMLView;
 - (KHTMLView *)_widget;
 - (KHTMLView *)_provisionalWidget;
 - (IFWebCoreBridge *)_bridge;
+- (void)_adjustFrames;
 @end
diff --git a/WebKit/WebView.subproj/WebHTMLViewPrivate.m b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
index 45d1aee..7628827 100644
--- a/WebKit/WebView.subproj/WebHTMLViewPrivate.m
+++ b/WebKit/WebView.subproj/WebHTMLViewPrivate.m
@@ -46,6 +46,16 @@
 
 @implementation IFHTMLView (IFPrivate)
 
+- (void)_adjustFrames
+{
+    // Ick!  khtml set the frame size during layout and
+    // the frame origins during drawing!  So we have to 
+    // layout and do a draw with rendering disabled to
+    // correclty adjust the frames.
+    [[self _bridge] adjustFrames: [self frame]];
+}
+
+
 - (void)_reset
 {
     NSArray *subviews = [[self subviews] copy];

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list