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

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:00:40 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit f9b9c55cbf8bab8291b09aaba8c118ca49994d60
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Oct 10 22:03:14 2003 +0000

    	Fix for table regression 3449444, as well as a patch to support padding on tables and to stop
    	honoring borders on row groups (both of which are correct for the "separate" border model).
    
    	* khtml/rendering/render_table.cpp:
    	        (RenderTable::layout):
    	        (RenderTableSection::calcRowHeight):
    	        (RenderTableSection::layoutRows):
    	        * khtml/rendering/render_table.h:
    	        (khtml::RenderTable::bordersPaddingAndSpacing):
    	        * khtml/rendering/table_layout.cpp:
    	        (FixedTableLayout::calcMinMaxWidth):
    	        (FixedTableLayout::layout):
    	        (AutoTableLayout::calcMinMaxWidth):
    	        (AutoTableLayout::layout):
    
    	Reviewed by darin
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@5167 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 46b8721..c035c0a 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,74 @@
+2003-10-10  David Hyatt  <hyatt at apple.com>
+
+	Fix for table regression 3449444, as well as a patch to support padding on tables and to stop
+	honoring borders on row groups (both of which are correct for the "separate" border model).
+	
+	* khtml/rendering/render_table.cpp:
+	        (RenderTable::layout):
+	        (RenderTableSection::calcRowHeight):
+	        (RenderTableSection::layoutRows):
+	        * khtml/rendering/render_table.h:
+	        (khtml::RenderTable::bordersPaddingAndSpacing):
+	        * khtml/rendering/table_layout.cpp:
+	        (FixedTableLayout::calcMinMaxWidth):
+	        (FixedTableLayout::layout):
+	        (AutoTableLayout::calcMinMaxWidth):
+	        (AutoTableLayout::layout):
+
+	Reviewed by darin
+
+2003-10-10  David Hyatt  <hyatt at apple.com>
+	
+	Patch to move the widgets during layout instead of at paint time.
+	
+        Reviewed by darin
+
+        * khtml/khtmlview.cpp:
+        * khtml/rendering/render_canvas.cpp:
+        (RenderCanvas::repaintViewRectangle):
+        * khtml/rendering/render_form.cpp:
+        (RenderFormElement::baselinePosition):
+        (RenderFormElement::layout):
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::updateWidgetPositions):
+        * khtml/rendering/render_object.h:
+        * khtml/rendering/render_replaced.cpp:
+        (RenderWidget::layout):
+        (RenderWidget::updateWidgetPositions):
+        * khtml/rendering/render_replaced.h:
+        * kwq/KWQCheckBox.h:
+        * kwq/KWQCheckBox.mm:
+        (QCheckBox::baselinePosition):
+        * kwq/KWQComboBox.h:
+        * kwq/KWQComboBox.mm:
+        (QComboBox::baselinePosition):
+        * kwq/KWQFileButton.h:
+        * kwq/KWQFileButton.mm:
+        (KWQFileButton::baselinePosition):
+        * kwq/KWQLineEdit.h:
+        * kwq/KWQLineEdit.mm:
+        (QLineEdit::baselinePosition):
+        * kwq/KWQPushButton.h:
+        * kwq/KWQPushButton.mm:
+        (QPushButton::baselinePosition):
+        * kwq/KWQRadioButton.h:
+        * kwq/KWQRadioButton.mm:
+        (QRadioButton::baselinePosition):
+        * kwq/KWQWidget.h:
+        * kwq/KWQWidget.mm:
+        (QWidget::baselinePosition):
+        (QWidget::setFrameGeometry):
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm:
+
+2003-10-10  David Hyatt  <hyatt at apple.com>
+
+	Make sure the i-beam cursor is only forced if you have a selection.
+
+	Reviewed by John
+
+	* khtml/khtmlview.cpp
+	
 2003-10-10  Ken Kocienda  <kocienda at apple.com>
 
         Reviewed by John
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 46b8721..c035c0a 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,74 @@
+2003-10-10  David Hyatt  <hyatt at apple.com>
+
+	Fix for table regression 3449444, as well as a patch to support padding on tables and to stop
+	honoring borders on row groups (both of which are correct for the "separate" border model).
+	
+	* khtml/rendering/render_table.cpp:
+	        (RenderTable::layout):
+	        (RenderTableSection::calcRowHeight):
+	        (RenderTableSection::layoutRows):
+	        * khtml/rendering/render_table.h:
+	        (khtml::RenderTable::bordersPaddingAndSpacing):
+	        * khtml/rendering/table_layout.cpp:
+	        (FixedTableLayout::calcMinMaxWidth):
+	        (FixedTableLayout::layout):
+	        (AutoTableLayout::calcMinMaxWidth):
+	        (AutoTableLayout::layout):
+
+	Reviewed by darin
+
+2003-10-10  David Hyatt  <hyatt at apple.com>
+	
+	Patch to move the widgets during layout instead of at paint time.
+	
+        Reviewed by darin
+
+        * khtml/khtmlview.cpp:
+        * khtml/rendering/render_canvas.cpp:
+        (RenderCanvas::repaintViewRectangle):
+        * khtml/rendering/render_form.cpp:
+        (RenderFormElement::baselinePosition):
+        (RenderFormElement::layout):
+        * khtml/rendering/render_object.cpp:
+        (RenderObject::updateWidgetPositions):
+        * khtml/rendering/render_object.h:
+        * khtml/rendering/render_replaced.cpp:
+        (RenderWidget::layout):
+        (RenderWidget::updateWidgetPositions):
+        * khtml/rendering/render_replaced.h:
+        * kwq/KWQCheckBox.h:
+        * kwq/KWQCheckBox.mm:
+        (QCheckBox::baselinePosition):
+        * kwq/KWQComboBox.h:
+        * kwq/KWQComboBox.mm:
+        (QComboBox::baselinePosition):
+        * kwq/KWQFileButton.h:
+        * kwq/KWQFileButton.mm:
+        (KWQFileButton::baselinePosition):
+        * kwq/KWQLineEdit.h:
+        * kwq/KWQLineEdit.mm:
+        (QLineEdit::baselinePosition):
+        * kwq/KWQPushButton.h:
+        * kwq/KWQPushButton.mm:
+        (QPushButton::baselinePosition):
+        * kwq/KWQRadioButton.h:
+        * kwq/KWQRadioButton.mm:
+        (QRadioButton::baselinePosition):
+        * kwq/KWQWidget.h:
+        * kwq/KWQWidget.mm:
+        (QWidget::baselinePosition):
+        (QWidget::setFrameGeometry):
+        * kwq/WebCoreBridge.h:
+        * kwq/WebCoreBridge.mm:
+
+2003-10-10  David Hyatt  <hyatt at apple.com>
+
+	Make sure the i-beam cursor is only forced if you have a selection.
+
+	Reviewed by John
+
+	* khtml/khtmlview.cpp
+	
 2003-10-10  Ken Kocienda  <kocienda at apple.com>
 
         Reviewed by John
diff --git a/WebCore/khtml/khtmlview.cpp b/WebCore/khtml/khtmlview.cpp
index 003009e..31a9061 100644
--- a/WebCore/khtml/khtmlview.cpp
+++ b/WebCore/khtml/khtmlview.cpp
@@ -613,6 +613,11 @@ void KHTMLView::layout()
     layer->updateLayerPositions();
 #endif
 
+#if APPLE_CHANGES
+    // We update our widget positions right after doing a layout.
+    root->updateWidgetPositions();
+#endif
+    
 #ifdef INCREMENTAL_REPAINTING
     if (root->needsLayout()) {
 #else
@@ -808,9 +813,9 @@ void KHTMLView::viewportMouseMoveEvent( QMouseEvent * _mouse )
 
     switch ( style ? style->cursor() : CURSOR_AUTO) {
     case CURSOR_AUTO:
-        if ( d->mousePressed )
-            // during selection, use an IBeam no matter what we're over
-            c = KCursor::ibeamCursor();
+        if ( d->mousePressed && m_part->hasSelection() )
+	    // during selection, use an IBeam no matter what we're over
+	    c = KCursor::ibeamCursor();
         else if ( (mev.url.length() || isSubmitImage(mev.innerNode.handle()))
                   && m_part->settings()->changeCursor() )
             c = m_part->urlCursor();
diff --git a/WebCore/khtml/rendering/render_canvas.cpp b/WebCore/khtml/rendering/render_canvas.cpp
index ed9eaa8..605bfc6 100644
--- a/WebCore/khtml/rendering/render_canvas.cpp
+++ b/WebCore/khtml/rendering/render_canvas.cpp
@@ -266,25 +266,8 @@ void RenderCanvas::repaintViewRectangle(const QRect& ur, bool immediate)
     if (m_printingMode || ur.width() == 0 || ur.height() == 0) return;
 
     QRect vr = viewRect();
-    if (m_view && ur.intersects(vr)) {
-        // We always just invalidate the root view, since we could be an iframe that is clipped out
-        // or even invisible.
-        QRect r = ur.intersect(vr);
-        DOM::ElementImpl* elt = element()->getDocument()->ownerElement();
-        if (!elt)
-            m_view->repaintRectangle(r, immediate);
-        else {
-            // Subtract out the contentsX and contentsY offsets to get our coords within the viewing
-            // rectangle.
-            r.setX(r.x() - m_view->contentsX());
-            r.setY(r.y() - m_view->contentsY());
-
-            RenderObject* obj = elt->renderer();
-            r.setX(r.x() + obj->borderLeft()+obj->paddingLeft());
-            r.setY(r.y() + obj->borderTop()+obj->paddingTop());
-            obj->repaintRectangle(r, immediate);
-        }
-    }
+    if (m_view && ur.intersects(vr))
+        m_view->repaintRectangle(ur.intersect(vr), immediate);
 }
 
 QRect RenderCanvas::getAbsoluteRepaintRect()
diff --git a/WebCore/khtml/rendering/render_form.cpp b/WebCore/khtml/rendering/render_form.cpp
index 403d609..540fb7f 100644
--- a/WebCore/khtml/rendering/render_form.cpp
+++ b/WebCore/khtml/rendering/render_form.cpp
@@ -70,7 +70,7 @@ RenderFormElement::~RenderFormElement()
 short RenderFormElement::baselinePosition( bool f, bool isRootLineBox ) const
 {
 #if APPLE_CHANGES
-    return marginTop() + widget()->baselinePosition();
+    return marginTop() + widget()->baselinePosition(m_height);
 #else
     return RenderWidget::baselinePosition( f, isRootLineBox ) - 2 - style()->fontMetrics().descent();
 #endif
@@ -157,13 +157,14 @@ void RenderFormElement::layout()
     calcWidth();
     calcHeight();
 
+#if !APPLE_CHANGES
     if ( m_widget )
         resizeWidget(m_widget,
                      m_width-borderLeft()-borderRight()-paddingLeft()-paddingRight(),
                      m_height-borderLeft()-borderRight()-paddingLeft()-paddingRight());
-
-    if ( !style()->width().isPercent() )
-        setNeedsLayout(false);
+#endif
+    
+    setNeedsLayout(false);
 }
 
 void RenderFormElement::slotClicked()
diff --git a/WebCore/khtml/rendering/render_object.cpp b/WebCore/khtml/rendering/render_object.cpp
index 15cdb12..dc97737 100644
--- a/WebCore/khtml/rendering/render_object.cpp
+++ b/WebCore/khtml/rendering/render_object.cpp
@@ -1783,6 +1783,14 @@ void RenderObject::getTextDecorationColors(int decorations, QColor& underline, Q
     }        
 }
 
+#if APPLE_CHANGES
+void RenderObject::updateWidgetPositions()
+{
+    for (RenderObject* curr = firstChild(); curr; curr = curr->nextSibling())
+        curr->updateWidgetPositions();
+}
+#endif
+
 QChar RenderObject::backslashAsCurrencySymbol() const
 {
 #if !APPLE_CHANGES
diff --git a/WebCore/khtml/rendering/render_object.h b/WebCore/khtml/rendering/render_object.h
index fc8d6d2..bc8b8da 100644
--- a/WebCore/khtml/rendering/render_object.h
+++ b/WebCore/khtml/rendering/render_object.h
@@ -389,7 +389,12 @@ public:
     // Whether or not the element shrinks to its max width (rather than filling the width
     // of a containing block).  HTML4 buttons, legends, and floating/compact elements do this.
     bool sizesToMaxWidth() const;
-    
+
+#if APPLE_CHANGES
+    // Called recursively to update the absolute positions of all widgets.
+    virtual void updateWidgetPositions();
+#endif
+
     // does a query on the rendertree and finds the innernode
     // and overURL for the given position
     // if readonly == false, it will recalc hover styles accordingly
diff --git a/WebCore/khtml/rendering/render_replaced.cpp b/WebCore/khtml/rendering/render_replaced.cpp
index 8a101d4..b4b9f82 100644
--- a/WebCore/khtml/rendering/render_replaced.cpp
+++ b/WebCore/khtml/rendering/render_replaced.cpp
@@ -209,11 +209,13 @@ void RenderWidget::layout( )
 {
     KHTMLAssert( needsLayout() );
     KHTMLAssert( minMaxKnown() );
+#if !APPLE_CHANGES
     if ( m_widget ) {
 	resizeWidget( m_widget,
 		      m_width-borderLeft()-borderRight()-paddingLeft()-paddingRight(),
 		      m_height-borderLeft()-borderRight()-paddingLeft()-paddingRight() );
     }
+#endif
 
     setNeedsLayout(false);
 }
@@ -422,4 +424,27 @@ void RenderWidget::deref(RenderArena *arena)
         arenaDelete(arena);
 }
 
+#if APPLE_CHANGES
+void RenderWidget::updateWidgetPositions()
+{
+    if (!m_widget)
+        return;
+    
+    int x, y, width, height;
+    absolutePosition(x,y);
+    width = m_width-borderLeft()-borderRight()-paddingLeft()-paddingRight();
+    height = m_height-borderLeft()-borderRight()-paddingLeft()-paddingRight();
+    QRect newBounds(x,y,width,height);
+    const QRect& oldBounds = m_widget->frameGeometry();
+    if (newBounds != oldBounds) {
+        // The widget changed positions.  Update the frame geometry.
+        RenderArena *arena = ref();
+        element()->ref();
+        m_widget->setFrameGeometry(newBounds);
+        element()->deref();
+        deref(arena);
+    }
+}
+#endif
+
 #include "render_replaced.moc"
diff --git a/WebCore/khtml/rendering/render_replaced.h b/WebCore/khtml/rendering/render_replaced.h
index db18fcf..1562c98 100644
--- a/WebCore/khtml/rendering/render_replaced.h
+++ b/WebCore/khtml/rendering/render_replaced.h
@@ -85,6 +85,7 @@ public:
 
 #if APPLE_CHANGES 
     void sendConsumedMouseUp(const QPoint &mousePos, int button, int state);
+    virtual void updateWidgetPositions();
 #endif
 
 public slots:
diff --git a/WebCore/khtml/rendering/render_table.cpp b/WebCore/khtml/rendering/render_table.cpp
index aa2813c..24a2c32 100644
--- a/WebCore/khtml/rendering/render_table.cpp
+++ b/WebCore/khtml/rendering/render_table.cpp
@@ -271,12 +271,19 @@ void RenderTable::layout()
         m_height += tCaption->height() + tCaption->marginTop() + tCaption->marginBottom();
     }
 
-    m_height += borderTop();
+    m_height += borderTop() + paddingTop();
+
+    int oldHeight = m_height;
+    calcHeight();
+    int newHeight = m_height;
+    m_height = oldHeight;
 
     // html tables with percent height are relative to view
     Length h = style()->height();
     int th=0;
-    if (h.isFixed())
+    if (isPositioned())
+        th = newHeight;
+    else if (h.isFixed())
         th = h.value;
     else if (h.isPercent())
     {
@@ -322,7 +329,7 @@ void RenderTable::layout()
             firstBody->layoutRows( th - calculatedHeight );
         }
     }
-    int bl = borderLeft();
+    int bl = borderLeft()+paddingLeft();
 
     // position the table sections
     if ( head ) {
@@ -343,7 +350,7 @@ void RenderTable::layout()
     }
 
 
-    m_height += borderBottom();
+    m_height += paddingBottom() + borderBottom();
 
     if(tCaption && tCaption->style()->captionSide()==CAPBOTTOM) {
         tCaption->setPos(tCaption->marginLeft(), m_height);
@@ -352,19 +359,6 @@ void RenderTable::layout()
 
     //kdDebug(0) << "table height: " << m_height << endl;
 
-    // FIXME: calcHeight should not affect height for tables.  In the positioned case,
-    // e.g., <table style="position:absolute">, it potentially does.  We're going to have to come up with a better
-    // solution eventually, but for now a good stopgap solution is to simply prevent this function
-    // from altering the height.
-    // 
-    // When the height is implicitly determined via, e.g., explicit top and bottom values in CSS, we're still
-    // going to be completely wrong.
-    int oldHeight = m_height;
-    calcHeight();
-    m_height = oldHeight;
-        
-    //kdDebug(0) << "table height: " << m_height << endl;
-
     // table can be containing block of positioned elements.
     // ### only pass true if width or height changed.
     layoutPositionedObjects( true );
@@ -961,7 +955,7 @@ void RenderTableSection::calcRowHeight()
     int spacing = table()->cellSpacing();
 
     rowPos.resize( totalRows + 1 );
-    rowPos[0] =  spacing + borderTop();
+    rowPos[0] = spacing;
 
     for ( int r = 0; r < totalRows; r++ ) {
 	rowPos[r+1] = 0;
@@ -1101,7 +1095,7 @@ int RenderTableSection::layoutRows( int toAdd )
         }
     }
 
-    int leftOffset = borderLeft() + spacing;
+    int leftOffset = spacing;
 
     int nEffCols = table()->numEffCols();
     for ( int r = 0; r < totalRows; r++ )
diff --git a/WebCore/khtml/rendering/render_table.h b/WebCore/khtml/rendering/render_table.h
index d840f55..19e0f23 100644
--- a/WebCore/khtml/rendering/render_table.h
+++ b/WebCore/khtml/rendering/render_table.h
@@ -148,8 +148,8 @@ public:
 	return c;
     }
 
-    int bordersAndSpacing() const {
-	return borderLeft() + borderRight() + (numEffCols()+1) * cellSpacing();
+    int bordersPaddingAndSpacing() const {
+	return borderLeft() + borderRight() + paddingLeft() + paddingRight() + (numEffCols()+1) * cellSpacing();
     }
 
     RenderTableCol *colElement( int col );
diff --git a/WebCore/khtml/rendering/table_layout.cpp b/WebCore/khtml/rendering/table_layout.cpp
index 427c4e3..91cc48d 100644
--- a/WebCore/khtml/rendering/table_layout.cpp
+++ b/WebCore/khtml/rendering/table_layout.cpp
@@ -237,7 +237,7 @@ void FixedTableLayout::calcMinMaxWidth()
     // width is fixed. If table width is percent, we set maxWidth to
     // unlimited.
 
-    int bs = table->bordersAndSpacing();
+    int bs = table->bordersPaddingAndSpacing();
     
     int tableWidth = table->style()->width().type == Fixed ? table->style()->width().value - bs : 0;
     int mw = calcWidthArray( tableWidth ) + bs;
@@ -263,7 +263,7 @@ void FixedTableLayout::calcMinMaxWidth()
 
 void FixedTableLayout::layout()
 {
-    int tableWidth = table->width() - table->bordersAndSpacing();
+    int tableWidth = table->width() - table->bordersPaddingAndSpacing();
     int available = tableWidth;
     int nEffCols = table->numEffCols();
     int totalPercent = 0;
@@ -605,7 +605,7 @@ void AutoTableLayout::calcMinMaxWidth()
 
     maxWidth = kMax( maxWidth, spanMaxWidth );
     
-    int bs = table->bordersAndSpacing();
+    int bs = table->bordersPaddingAndSpacing();
     minWidth += bs;
     maxWidth += bs;
 
@@ -856,7 +856,7 @@ void AutoTableLayout::insertSpanCell( RenderTableCell *cell )
 void AutoTableLayout::layout()
 {
     // table layout based on the values collected in the layout structure.
-    int tableWidth = table->width() - table->bordersAndSpacing();
+    int tableWidth = table->width() - table->bordersPaddingAndSpacing();
     int available = tableWidth;
     int nEffCols = table->numEffCols();
 
diff --git a/WebCore/kwq/KWQCheckBox.h b/WebCore/kwq/KWQCheckBox.h
index 8735229..fa317d0 100644
--- a/WebCore/kwq/KWQCheckBox.h
+++ b/WebCore/kwq/KWQCheckBox.h
@@ -36,7 +36,7 @@ public:
     bool isChecked();
 
     QSize sizeHint() const;
-    int baselinePosition() const;
+    int baselinePosition(int height) const;
     QRect frameGeometry() const;
     void setFrameGeometry(const QRect &);
 
diff --git a/WebCore/kwq/KWQCheckBox.mm b/WebCore/kwq/KWQCheckBox.mm
index da6c270..c299555 100644
--- a/WebCore/kwq/KWQCheckBox.mm
+++ b/WebCore/kwq/KWQCheckBox.mm
@@ -102,9 +102,9 @@ void QCheckBox::clicked()
     QButton::clicked();
 }
 
-int QCheckBox::baselinePosition() const
+int QCheckBox::baselinePosition(int height) const
 {
-    return height() - dimensions()[baselineFudgeFactor];
+    return height - dimensions()[baselineFudgeFactor];
 }
 
 const int *QCheckBox::dimensions() const
diff --git a/WebCore/kwq/KWQComboBox.h b/WebCore/kwq/KWQComboBox.h
index 5da8159..7f51ccf 100644
--- a/WebCore/kwq/KWQComboBox.h
+++ b/WebCore/kwq/KWQComboBox.h
@@ -53,7 +53,7 @@ public:
     QSize sizeHint() const;
     QRect frameGeometry() const;
     void setFrameGeometry(const QRect &);
-    int baselinePosition() const;
+    int baselinePosition(int height) const;
     void setFont(const QFont &);
 
     void itemSelected();
diff --git a/WebCore/kwq/KWQComboBox.mm b/WebCore/kwq/KWQComboBox.mm
index c82f363..6482474 100644
--- a/WebCore/kwq/KWQComboBox.mm
+++ b/WebCore/kwq/KWQComboBox.mm
@@ -182,7 +182,7 @@ void QComboBox::setFrameGeometry(const QRect &r)
         dimensions()[topMargin] + r.height() + dimensions()[bottomMargin]));
 }
 
-int QComboBox::baselinePosition() const
+int QComboBox::baselinePosition(int height) const
 {
     // Menu text is at the top.
     KWQPopUpButton *button = (KWQPopUpButton *)getView();
diff --git a/WebCore/kwq/KWQFileButton.h b/WebCore/kwq/KWQFileButton.h
index bbe0552..a8743e7 100644
--- a/WebCore/kwq/KWQFileButton.h
+++ b/WebCore/kwq/KWQFileButton.h
@@ -45,7 +45,7 @@ public:
     QSize sizeForCharacterWidth(int characters) const;
     QRect frameGeometry() const;
     void setFrameGeometry(const QRect &);
-    int baselinePosition() const;
+    int baselinePosition(int height) const;
     
     void filenameChanged();
     void clicked();
diff --git a/WebCore/kwq/KWQFileButton.mm b/WebCore/kwq/KWQFileButton.mm
index 0dd4352..a219904 100644
--- a/WebCore/kwq/KWQFileButton.mm
+++ b/WebCore/kwq/KWQFileButton.mm
@@ -107,7 +107,7 @@ void KWQFileButton::setFrameGeometry(const QRect &rect)
     KWQ_UNBLOCK_NS_EXCEPTIONS;
 }
 
-int KWQFileButton::baselinePosition() const
+int KWQFileButton::baselinePosition(int height) const
 {
     NSView <WebCoreFileButton> *button = getView();
 
diff --git a/WebCore/kwq/KWQLineEdit.h b/WebCore/kwq/KWQLineEdit.h
index 977fd16..58310c5 100644
--- a/WebCore/kwq/KWQLineEdit.h
+++ b/WebCore/kwq/KWQLineEdit.h
@@ -59,7 +59,7 @@ public:
     void selectAll();
     
     QSize sizeForCharacterWidth(int numCharacters) const;
-    int baselinePosition() const;
+    int baselinePosition(int height) const;
     
     void returnPressed() { m_returnPressed.call(); }
     void textChanged() { m_textChanged.call(text()); }
diff --git a/WebCore/kwq/KWQLineEdit.mm b/WebCore/kwq/KWQLineEdit.mm
index e59fc9c..d87752d 100644
--- a/WebCore/kwq/KWQLineEdit.mm
+++ b/WebCore/kwq/KWQLineEdit.mm
@@ -203,7 +203,7 @@ QSize QLineEdit::sizeForCharacterWidth(int numCharacters) const
     return QSize(size);
 }
 
-int QLineEdit::baselinePosition() const
+int QLineEdit::baselinePosition(int height) const
 {
     KWQTextField *textField = (KWQTextField *)getView();
 
diff --git a/WebCore/kwq/KWQPushButton.h b/WebCore/kwq/KWQPushButton.h
index 2b5de64..79d87e7 100644
--- a/WebCore/kwq/KWQPushButton.h
+++ b/WebCore/kwq/KWQPushButton.h
@@ -36,7 +36,7 @@ public:
     QSize sizeHint() const;
     QRect frameGeometry() const;
     void setFrameGeometry(const QRect &);
-    int baselinePosition() const;
+    int baselinePosition(int height) const;
 
 private:
     const int *dimensions() const;
diff --git a/WebCore/kwq/KWQPushButton.mm b/WebCore/kwq/KWQPushButton.mm
index 80a11bf..95f2751 100644
--- a/WebCore/kwq/KWQPushButton.mm
+++ b/WebCore/kwq/KWQPushButton.mm
@@ -83,7 +83,7 @@ void QPushButton::setFrameGeometry(const QRect &r)
         r.height() + dimensions()[topMargin] + dimensions()[bottomMargin]));
 }
 
-int QPushButton::baselinePosition() const
+int QPushButton::baselinePosition(int height) const
 {
     // Button text is centered vertically, with a fudge factor to account for the shadow.
     NSButton *button = (NSButton *)getView();
@@ -98,7 +98,7 @@ int QPushButton::baselinePosition() const
     KWQ_UNBLOCK_NS_EXCEPTIONS;
 
     return (int)ceil(-dimensions()[topMargin]
-        + ((height() + dimensions()[topMargin] + dimensions()[bottomMargin]) - (ascender - descender)) / 2.0
+        + ((height + dimensions()[topMargin] + dimensions()[bottomMargin]) - (ascender - descender)) / 2.0
         + ascender - dimensions()[baselineFudgeFactor]);
 }
 
diff --git a/WebCore/kwq/KWQRadioButton.h b/WebCore/kwq/KWQRadioButton.h
index 1c888eb..51a5a55 100644
--- a/WebCore/kwq/KWQRadioButton.h
+++ b/WebCore/kwq/KWQRadioButton.h
@@ -36,7 +36,7 @@ public:
     bool isChecked() const;
 
     QSize sizeHint() const;
-    int baselinePosition() const;
+    int baselinePosition(int height) const;
     QRect frameGeometry() const;
     void setFrameGeometry(const QRect &);
 
diff --git a/WebCore/kwq/KWQRadioButton.mm b/WebCore/kwq/KWQRadioButton.mm
index 037785b..29b025a 100644
--- a/WebCore/kwq/KWQRadioButton.mm
+++ b/WebCore/kwq/KWQRadioButton.mm
@@ -85,9 +85,9 @@ bool QRadioButton::isChecked() const
     return result;
 }
 
-int QRadioButton::baselinePosition() const
+int QRadioButton::baselinePosition(int height) const
 {
-    return height() - dimensions()[baselineFudgeFactor];
+    return height - dimensions()[baselineFudgeFactor];
 }
 
 const int *QRadioButton::dimensions() const
diff --git a/WebCore/kwq/KWQWidget.h b/WebCore/kwq/KWQWidget.h
index 0ef41aa..08d9fe1 100644
--- a/WebCore/kwq/KWQWidget.h
+++ b/WebCore/kwq/KWQWidget.h
@@ -93,7 +93,7 @@ public:
     virtual QRect frameGeometry() const;
     virtual void setFrameGeometry(const QRect &);
 
-    virtual int baselinePosition() const; // relative to the top of the widget
+    virtual int baselinePosition(int height) const; // relative to the top of the widget
 
     virtual QPoint mapFromGlobal(const QPoint &) const;
 
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index b22d935..9ab9625 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -189,9 +189,9 @@ QRect QWidget::frameGeometry() const
     return rect;
 }
 
-int QWidget::baselinePosition() const
+int QWidget::baselinePosition(int height) const
 {
-    return height();
+    return height;
 }
 
 bool QWidget::hasFocus() const
@@ -404,7 +404,9 @@ bool QWidget::hasMouseTracking() const
 void QWidget::setFrameGeometry(const QRect &rect)
 {
     KWQ_BLOCK_NS_EXCEPTIONS;
+    [getOuterView() setNeedsDisplay: YES];
     [getOuterView() setFrame:rect];
+    [getOuterView() setNeedsDisplay: YES];
     KWQ_UNBLOCK_NS_EXCEPTIONS;
 }
 
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index ce9365a..6ad2e28 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -146,7 +146,6 @@ typedef enum {
 - (void)forceLayoutForPageWidth:(float)pageWidth adjustingViewSize:(BOOL)adjustSizeFlag;
 - (void)sendResizeEvent;
 - (BOOL)needsLayout;
-- (void)adjustFrames:(NSRect)rect;
 - (void)drawRect:(NSRect)rect;
 - (void)adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit;
 
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index a0a17d6..29a2a17 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -428,18 +428,6 @@ static BOOL nowPrinting(WebCoreBridge *self)
     [self drawRect:rect withPainter:&painter];
 }
 
-- (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
-    // correctly adjust the frames.
-    [self forceLayoutAdjustingViewSize:NO];
-    QPainter painter(nowPrinting(self));
-    painter.setPaintingDisabled(YES);
-    [self drawRect:rect withPainter:&painter];
-}
-
 // Vertical pagination hook from AppKit
 - (void)adjustPageHeightNew:(float *)newBottom top:(float)oldTop bottom:(float)oldBottom limit:(float)bottomLimit
 {

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list