[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 05:55:44 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 4a7ab0297ea22d563ed3006840668f82e66bb316
Author: rjw <rjw at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sat Feb 16 04:06:45 2002 +0000

    Lots of changes for forms.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@627 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 580a5b2..0e4f9a9 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,42 @@
+2002-02-15  Richard Williamson  <rjw at apple.com>
+    
+    Lots of changes to support forms.
+
+	* src/kdelibs/khtml/rendering/render_form.cpp: (RenderFormElement::slotClicked),
+	(RenderCheckBox::performAction), (RenderRadioButton::slotClicked),
+	(RenderSelect::RenderSelect), (RenderSelect::layout),
+	(RenderSelect::performAction), (RenderTextArea::layout), (RenderTextArea::text),
+	(RenderTextArea::performAction):
+	* src/kdelibs/khtml/rendering/render_form.h:
+	* src/kwq/KWQCheckBox.mm: (QCheckBox::QCheckBox), (QCheckBox::isChecked):
+	* src/kwq/KWQComboBox.mm: (QComboBox::indexOfCurrentItem):
+	* src/kwq/KWQKHTMLPart.mm: (KHTMLPart::requestFrame):
+	* src/kwq/KWQListBox.h:
+	* src/kwq/KWQListBox.mm: (-[KWQBrowserDelegate initWithListBox:]),
+	(-[KWQBrowserDelegate browser:numberOfRowsInColumn:]), (-[KWQBrowserDelegate
+	browser:willDisplayCell:atRow:column:]), (-[KWQBrowserDelegate
+	browserSingleClick:]), (-[KWQBrowserDelegate browserDoubleClick:]),
+	(QListBox::QListBox), (QListBox::~QListBox), (QListBox::count),
+	(QListBox::scrollBarWidth), (QListBox::clear), (QListBox::setSelectionMode),
+	(QListBox::currentItem), (QListBox::insertItem), (QListBox::setSelected),
+	(QListBox::isSelected), (QListBoxItem::QListBoxItem),
+	(QListBoxItem::~QListBoxItem), (QListBoxItem::setSelectable),
+	(QListBoxItem::width), (QListBoxItem::height):
+	* src/kwq/KWQNSTextField.mm: (-[KWQNSTextField action:]), (-[KWQNSTextField
+	controlTextDidEndEditing:]):
+	* src/kwq/KWQScrollView.mm: (QScrollView::addChild):
+	* src/kwq/KWQTextArea.mm: (-[KWQTextArea initWithFrame:]), (-[KWQTextArea
+	_createTextView]), (-[KWQTextArea initWithFrame:widget:]), (-[KWQTextArea
+	textDidEndEditing:]), (-[KWQTextArea setFrame:]):
+	* src/kwq/KWQTextEdit.mm: (QMultiLineEdit::setCursorPosition),
+	(QMultiLineEdit::getCursorPosition):
+	* src/kwq/KWQView.mm: (-[KWQNSButton stateChanged:]), (-[KWQNSComboBox
+	initWithFrame:widget:]), (-[KWQNSComboBox action:]):
+	* src/kwq/KWQWidget.mm: (QWidget::endEditing):
+	* src/kwq/qt/qcheckbox.h:
+	* src/kwq/qt/qcombobox.h:
+	* src/kwq/qt/qobject.h:
+
 2002-02-13  Richard Williamson  <rjw at apple.com>
     
     Use NSSwitchButtons for check boxes.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 580a5b2..0e4f9a9 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,42 @@
+2002-02-15  Richard Williamson  <rjw at apple.com>
+    
+    Lots of changes to support forms.
+
+	* src/kdelibs/khtml/rendering/render_form.cpp: (RenderFormElement::slotClicked),
+	(RenderCheckBox::performAction), (RenderRadioButton::slotClicked),
+	(RenderSelect::RenderSelect), (RenderSelect::layout),
+	(RenderSelect::performAction), (RenderTextArea::layout), (RenderTextArea::text),
+	(RenderTextArea::performAction):
+	* src/kdelibs/khtml/rendering/render_form.h:
+	* src/kwq/KWQCheckBox.mm: (QCheckBox::QCheckBox), (QCheckBox::isChecked):
+	* src/kwq/KWQComboBox.mm: (QComboBox::indexOfCurrentItem):
+	* src/kwq/KWQKHTMLPart.mm: (KHTMLPart::requestFrame):
+	* src/kwq/KWQListBox.h:
+	* src/kwq/KWQListBox.mm: (-[KWQBrowserDelegate initWithListBox:]),
+	(-[KWQBrowserDelegate browser:numberOfRowsInColumn:]), (-[KWQBrowserDelegate
+	browser:willDisplayCell:atRow:column:]), (-[KWQBrowserDelegate
+	browserSingleClick:]), (-[KWQBrowserDelegate browserDoubleClick:]),
+	(QListBox::QListBox), (QListBox::~QListBox), (QListBox::count),
+	(QListBox::scrollBarWidth), (QListBox::clear), (QListBox::setSelectionMode),
+	(QListBox::currentItem), (QListBox::insertItem), (QListBox::setSelected),
+	(QListBox::isSelected), (QListBoxItem::QListBoxItem),
+	(QListBoxItem::~QListBoxItem), (QListBoxItem::setSelectable),
+	(QListBoxItem::width), (QListBoxItem::height):
+	* src/kwq/KWQNSTextField.mm: (-[KWQNSTextField action:]), (-[KWQNSTextField
+	controlTextDidEndEditing:]):
+	* src/kwq/KWQScrollView.mm: (QScrollView::addChild):
+	* src/kwq/KWQTextArea.mm: (-[KWQTextArea initWithFrame:]), (-[KWQTextArea
+	_createTextView]), (-[KWQTextArea initWithFrame:widget:]), (-[KWQTextArea
+	textDidEndEditing:]), (-[KWQTextArea setFrame:]):
+	* src/kwq/KWQTextEdit.mm: (QMultiLineEdit::setCursorPosition),
+	(QMultiLineEdit::getCursorPosition):
+	* src/kwq/KWQView.mm: (-[KWQNSButton stateChanged:]), (-[KWQNSComboBox
+	initWithFrame:widget:]), (-[KWQNSComboBox action:]):
+	* src/kwq/KWQWidget.mm: (QWidget::endEditing):
+	* src/kwq/qt/qcheckbox.h:
+	* src/kwq/qt/qcombobox.h:
+	* src/kwq/qt/qobject.h:
+
 2002-02-13  Richard Williamson  <rjw at apple.com>
     
     Use NSSwitchButtons for check boxes.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 580a5b2..0e4f9a9 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,42 @@
+2002-02-15  Richard Williamson  <rjw at apple.com>
+    
+    Lots of changes to support forms.
+
+	* src/kdelibs/khtml/rendering/render_form.cpp: (RenderFormElement::slotClicked),
+	(RenderCheckBox::performAction), (RenderRadioButton::slotClicked),
+	(RenderSelect::RenderSelect), (RenderSelect::layout),
+	(RenderSelect::performAction), (RenderTextArea::layout), (RenderTextArea::text),
+	(RenderTextArea::performAction):
+	* src/kdelibs/khtml/rendering/render_form.h:
+	* src/kwq/KWQCheckBox.mm: (QCheckBox::QCheckBox), (QCheckBox::isChecked):
+	* src/kwq/KWQComboBox.mm: (QComboBox::indexOfCurrentItem):
+	* src/kwq/KWQKHTMLPart.mm: (KHTMLPart::requestFrame):
+	* src/kwq/KWQListBox.h:
+	* src/kwq/KWQListBox.mm: (-[KWQBrowserDelegate initWithListBox:]),
+	(-[KWQBrowserDelegate browser:numberOfRowsInColumn:]), (-[KWQBrowserDelegate
+	browser:willDisplayCell:atRow:column:]), (-[KWQBrowserDelegate
+	browserSingleClick:]), (-[KWQBrowserDelegate browserDoubleClick:]),
+	(QListBox::QListBox), (QListBox::~QListBox), (QListBox::count),
+	(QListBox::scrollBarWidth), (QListBox::clear), (QListBox::setSelectionMode),
+	(QListBox::currentItem), (QListBox::insertItem), (QListBox::setSelected),
+	(QListBox::isSelected), (QListBoxItem::QListBoxItem),
+	(QListBoxItem::~QListBoxItem), (QListBoxItem::setSelectable),
+	(QListBoxItem::width), (QListBoxItem::height):
+	* src/kwq/KWQNSTextField.mm: (-[KWQNSTextField action:]), (-[KWQNSTextField
+	controlTextDidEndEditing:]):
+	* src/kwq/KWQScrollView.mm: (QScrollView::addChild):
+	* src/kwq/KWQTextArea.mm: (-[KWQTextArea initWithFrame:]), (-[KWQTextArea
+	_createTextView]), (-[KWQTextArea initWithFrame:widget:]), (-[KWQTextArea
+	textDidEndEditing:]), (-[KWQTextArea setFrame:]):
+	* src/kwq/KWQTextEdit.mm: (QMultiLineEdit::setCursorPosition),
+	(QMultiLineEdit::getCursorPosition):
+	* src/kwq/KWQView.mm: (-[KWQNSButton stateChanged:]), (-[KWQNSComboBox
+	initWithFrame:widget:]), (-[KWQNSComboBox action:]):
+	* src/kwq/KWQWidget.mm: (QWidget::endEditing):
+	* src/kwq/qt/qcheckbox.h:
+	* src/kwq/qt/qcombobox.h:
+	* src/kwq/qt/qobject.h:
+
 2002-02-13  Richard Williamson  <rjw at apple.com>
     
     Use NSSwitchButtons for check boxes.
diff --git a/WebCore/khtml/rendering/render_form.cpp b/WebCore/khtml/rendering/render_form.cpp
index f62fe9d..d2d928b 100644
--- a/WebCore/khtml/rendering/render_form.cpp
+++ b/WebCore/khtml/rendering/render_form.cpp
@@ -271,6 +271,7 @@ void RenderFormElement::performAction(QObject::Actions action)
 
 void RenderFormElement::slotClicked()
 {
+    //fprintf (stdout, "RenderFormElement::slotClicked():\n");
     if(isRenderButton()) {
         QMouseEvent e2( QEvent::MouseButtonRelease, m_mousePos, m_button, m_state);
 
@@ -348,6 +349,20 @@ void RenderCheckBox::layout()
     RenderButton::layout();
 }
 
+#ifdef _KWQ_
+void RenderCheckBox::performAction(QObject::Actions action)
+{
+    QCheckBox* cb = static_cast<QCheckBox*>( m_widget );
+
+    //fprintf (stdout, "RenderCheckBox::performAction():  %d\n", action);
+    if (action == QObject::ACTION_CHECKBOX_CLICKED)
+        slotStateChanged(cb->isChecked() ? 2 : 0);
+}
+#endif
+
+
+// From the Qt documentation:
+// state is 2 if the button is on, 1 if it is in the "no change" state or 0 if the button is off. 
 void RenderCheckBox::slotStateChanged(int state)
 {
     m_element->setAttribute(ATTR_CHECKED,state == 2 ? "" : 0);
@@ -374,6 +389,8 @@ void RenderRadioButton::setChecked(bool checked)
 
 void RenderRadioButton::slotClicked()
 {
+    //fprintf (stdout, "RenderRadioButton::slotClicked():\n");
+
     m_element->setAttribute(ATTR_CHECKED,"");
 
     // emit mouseClick event etc
@@ -843,7 +860,7 @@ RenderSelect::RenderSelect(QScrollView *view, HTMLSelectElementImpl *element)
     if(m_useListBox)
         setQWidget(createListBox());
     else
-	setQWidget(createComboBox());
+	    setQWidget(createComboBox());
 }
 
 
@@ -917,8 +934,7 @@ void RenderSelect::layout( )
 
                 if(m_useListBox) {
                     QListBoxText *item = new QListBoxText(QString(text.implementation()->s, text.implementation()->l).visual());
-                    static_cast<KListBox*>(m_widget)
-                        ->insertItem(item, listIndex);
+                    static_cast<KListBox*>(m_widget)->insertItem(item, listIndex);
                     item->setSelectable(false);
                 }
                 else
@@ -972,8 +988,13 @@ void RenderSelect::layout( )
         if(size < 1)
             size = QMIN(static_cast<KListBox*>(m_widget)->count(), 10);
 
+#ifdef _KWQ_
+        width += w->scrollBarWidth();
+        height = size*height;
+#else
         width += 2*w->frameWidth() + w->verticalScrollBar()->sizeHint().width();
         height = size*height + 2*w->frameWidth();
+#endif
 
         setIntrinsicWidth( width );
         setIntrinsicHeight( height );
@@ -1058,6 +1079,18 @@ void RenderSelect::slotSelected(int index)
 }
 
 
+void RenderSelect::performAction(QObject::Actions action)
+{
+    //fprintf (stdout, "RenderSelect::performAction():  %d\n", action);
+    if (action == QObject::ACTION_LISTBOX_CLICKED)
+        slotSelectionChanged();
+    else if (action == QObject::ACTION_COMBOBOX_CLICKED){
+        ComboBoxWidget *combo = static_cast<ComboBoxWidget*>(m_widget);
+
+        slotSelected(combo->indexOfCurrentItem());
+    }
+}
+
 void RenderSelect::slotSelectionChanged()
 {
     if ( m_ignoreSelectEvents ) return;
@@ -1101,6 +1134,7 @@ ComboBoxWidget *RenderSelect::createComboBox()
     return cb;
 }
 
+
 void RenderSelect::updateSelection()
 {
     QArray<HTMLGenericFormElementImpl*> listItems = static_cast<HTMLSelectElementImpl*>(m_element)->listItems();
@@ -1223,13 +1257,13 @@ void RenderTextArea::layout( )
     HTMLTextAreaElementImpl* f = static_cast<HTMLTextAreaElementImpl*>(m_element);
 
     if (!layouted()) {
-	w->setReadOnly(m_element->readOnly());
-	w->blockSignals(true);
-	int line, col;
-	w->getCursorPosition( &line, &col );
-	w->setText(f->value().string().visual());
-	w->setCursorPosition( line, col );
-	w->blockSignals(false);
+        w->setReadOnly(m_element->readOnly());
+        w->blockSignals(true);
+        int line, col;
+        w->getCursorPosition( &line, &col );
+        w->setText(f->value().string().visual());
+        w->setCursorPosition( line, col );
+        w->blockSignals(false);
     }
 
     RenderFormElement::layout();
@@ -1264,6 +1298,15 @@ QString RenderTextArea::text()
     return txt;
 }
 
+void RenderTextArea::performAction(QObject::Actions action)
+{
+    //TextAreaWidget *edit = static_cast<TextAreaWidget*>(m_widget);
+
+    //fprintf (stdout, "RenderTextArea::performAction():  %d text value = %s\n", action, edit->text().latin1());
+    if (action == QObject::ACTION_TEXT_AREA_END_EDITING)
+        slotTextChanged();
+}
+
 void RenderTextArea::slotTextChanged()
 {
     static_cast<HTMLTextAreaElementImpl*>( m_element )->m_dirtyvalue = true;
diff --git a/WebCore/khtml/rendering/render_form.h b/WebCore/khtml/rendering/render_form.h
index 669932f..9c9713b 100644
--- a/WebCore/khtml/rendering/render_form.h
+++ b/WebCore/khtml/rendering/render_form.h
@@ -133,6 +133,10 @@ public:
     virtual const char *renderName() const { return "RenderCheckBox"; }
     virtual void calcMinMaxWidth();
     virtual void layout( );
+
+#ifdef _KWQ_
+    void performAction(QObject::Actions action);
+#endif
     
 public slots:
     virtual void slotStateChanged(int state);
@@ -338,6 +342,11 @@ public:
 
     void updateSelection();
 
+#ifdef _KWQ_
+    void performAction(QObject::Actions action);
+#endif
+
+
 protected:
     KListBox *createListBox();
     ComboBoxWidget *createComboBox();
@@ -386,6 +395,10 @@ public:
 
     QString text(); // ### remove
 
+#ifdef _KWQ_
+    void performAction(QObject::Actions action);
+#endif
+
     void select();
 
 protected slots:
diff --git a/WebCore/kwq/KWQCheckBox.h b/WebCore/kwq/KWQCheckBox.h
index cafd2dc..652ec70 100644
--- a/WebCore/kwq/KWQCheckBox.h
+++ b/WebCore/kwq/KWQCheckBox.h
@@ -53,6 +53,7 @@ public:
     // member functions --------------------------------------------------------
 
     void setChecked(bool);
+    bool isChecked();
 
     // operators ---------------------------------------------------------------
 
diff --git a/WebCore/kwq/KWQCheckBox.mm b/WebCore/kwq/KWQCheckBox.mm
index 8b88ba1..49e8327 100644
--- a/WebCore/kwq/KWQCheckBox.mm
+++ b/WebCore/kwq/KWQCheckBox.mm
@@ -35,6 +35,7 @@ QCheckBox::QCheckBox(QWidget *w) : QButton (w)
     
     button = (KWQNSButton *)getView();
     [button setButtonType: NSSwitchButton];
+    [button setAction: @selector(stateChanged:)];
     setView (button);
 }
 
@@ -49,3 +50,17 @@ void QCheckBox::setChecked(bool isChecked)
     else
         [button setState: NSOffState];
 }
+
+
+bool QCheckBox::isChecked()
+{
+    KWQNSButton *button;
+    int state;
+    
+    button = (KWQNSButton *)getView();
+    state = [button state];
+    if (state == NSOffState)
+        return 0;
+    return 1;
+}
+
diff --git a/WebCore/kwq/KWQComboBox.h b/WebCore/kwq/KWQComboBox.h
index 0a0c56b..12b9d63 100644
--- a/WebCore/kwq/KWQComboBox.h
+++ b/WebCore/kwq/KWQComboBox.h
@@ -57,6 +57,9 @@ public:
     bool eventFilter(QObject *object, QEvent *event);
     void insertItem(const QString &text, int index=-1);
     void clear();
+#ifdef _KWQ_
+    int indexOfCurrentItem();
+#endif
     virtual void setCurrentItem(int);
     QSize sizeHint() const;
 
diff --git a/WebCore/kwq/KWQComboBox.mm b/WebCore/kwq/KWQComboBox.mm
index f2f94ec..2e6f7a9 100644
--- a/WebCore/kwq/KWQComboBox.mm
+++ b/WebCore/kwq/KWQComboBox.mm
@@ -115,6 +115,12 @@ void QComboBox::clear()
     [comboBox removeAllItems];
 }
 
+int QComboBox::indexOfCurrentItem()
+{
+    KWQNSComboBox *comboBox = (KWQNSComboBox *)getView();
+    return [comboBox indexOfSelectedItem];
+}
+
 void QComboBox::setCurrentItem(int index)
 {
     KWQNSComboBox *comboBox = (KWQNSComboBox *)getView();
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index fe40d54..042a113 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -1656,12 +1656,12 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons
     IFWebFrame *aFrame;
     IFWebDataSource *dataSource;
     
-    fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x, name = %s, url = %s\n", (unsigned int)this, (unsigned int)frame, frameName.latin1(), url.latin1());    
+    //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x, name = %s, url = %s\n", (unsigned int)this, (unsigned int)frame, frameName.latin1(), url.latin1());    
     dataSource = getDataSource();
 
     aFrame =[dataSource frameNamed: nsframeName];
     if (aFrame){
-        fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x frame found\n", (unsigned int)this, (unsigned int)frame);    
+        //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x frame found\n", (unsigned int)this, (unsigned int)frame);    
         // ?
         frame->setWidget ([[aFrame view] _widget]);
     }
@@ -1671,7 +1671,7 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons
         IFWebFrame *newFrame;
         id <IFWebController> controller;
 
-        fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x creating frame\n", (unsigned int)this, (unsigned int)frame);    
+        //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x creating frame\n", (unsigned int)this, (unsigned int)frame);    
         childURL = [NSURL URLWithString: QSTRING_TO_NSSTRING (completeURL( url ).url() )];
         
         dataSource = getDataSource();
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index fe40d54..042a113 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -1656,12 +1656,12 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons
     IFWebFrame *aFrame;
     IFWebDataSource *dataSource;
     
-    fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x, name = %s, url = %s\n", (unsigned int)this, (unsigned int)frame, frameName.latin1(), url.latin1());    
+    //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x, name = %s, url = %s\n", (unsigned int)this, (unsigned int)frame, frameName.latin1(), url.latin1());    
     dataSource = getDataSource();
 
     aFrame =[dataSource frameNamed: nsframeName];
     if (aFrame){
-        fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x frame found\n", (unsigned int)this, (unsigned int)frame);    
+        //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x frame found\n", (unsigned int)this, (unsigned int)frame);    
         // ?
         frame->setWidget ([[aFrame view] _widget]);
     }
@@ -1671,7 +1671,7 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons
         IFWebFrame *newFrame;
         id <IFWebController> controller;
 
-        fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x creating frame\n", (unsigned int)this, (unsigned int)frame);    
+        //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x creating frame\n", (unsigned int)this, (unsigned int)frame);    
         childURL = [NSURL URLWithString: QSTRING_TO_NSSTRING (completeURL( url ).url() )];
         
         dataSource = getDataSource();
diff --git a/WebCore/kwq/KWQListBox.h b/WebCore/kwq/KWQListBox.h
index 9e6bdd4..6d8904a 100644
--- a/WebCore/kwq/KWQListBox.h
+++ b/WebCore/kwq/KWQListBox.h
@@ -63,6 +63,10 @@ public:
 
     // member functions --------------------------------------------------------
 
+#ifdef _KWQ_
+    int scrollBarWidth() const;
+#endif
+    
     uint count() const;
     void clear();
     virtual void setSelectionMode(SelectionMode);
@@ -85,12 +89,6 @@ private:
     QListBox &operator=(const QListBox &);
 
     QListBoxItem *head;
-#if (defined(__APPLE__) && defined(__OBJC__) && defined(__cplusplus))
-    NSMatrix *matrix;
-#else
-    void *matrix;
-#endif
-
 }; // class QListBox ===========================================================
 
 
@@ -123,10 +121,7 @@ public:
 
     // operators ---------------------------------------------------------------
 
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
 
-private:
     // no copying or assignment
     // note that these are "standard" (no pendantic stuff needed)
     QListBoxItem(const QListBoxItem &);
@@ -135,11 +130,9 @@ private:
     QString text;
     QListBoxItem *previousItem, *nextItem;
     QListBox *box;
-#if (defined(__APPLE__) && defined(__OBJC__) && defined(__cplusplus))
-    NSButtonCell *cell;
-#else
-    void *cell;
-#endif
+
+// protected -------------------------------------------------------------------
+// private ---------------------------------------------------------------------
 
 }; // class QListBoxItem =======================================================
 
diff --git a/WebCore/kwq/KWQListBox.mm b/WebCore/kwq/KWQListBox.mm
index 92e6b3f..58b99be 100644
--- a/WebCore/kwq/KWQListBox.mm
+++ b/WebCore/kwq/KWQListBox.mm
@@ -28,56 +28,125 @@
 #include <KWQListBox.h>
 
 
-// Emulated with a NSScrollView that contains a NSMatrix.  Use a prototype cell.
-QListBox::QListBox()
+ at interface KWQBrowserDelegate : NSObject
 {
-    KWQNSScrollView *scrollview = [[NSScrollView alloc] initWithFrame: NSMakeRect (0,0,0,0) widget: this];
-    NSButtonCell *cell = [[[NSButtonCell alloc] init] autorelease];
-    
-    [cell setBordered: NO];
-    [cell setAlignment: NSLeftTextAlignment];
-       
-    matrix  = [[NSMatrix alloc] initWithFrame: NSMakeRect (0,0,0,0) mode:NSHighlightModeMatrix prototype:cell numberOfRows:0 numberOfColumns:0];
+    QListBox *box;
+}
+
+ at end
+
+ at implementation KWQBrowserDelegate
+
+- initWithListBox: (QListBox *)b
+{
+    [super init];
+    box = b;
+    return self;
+}
+
+// ==========================================================
+// Browser Delegate Methods.
+// ==========================================================
+
+// Use lazy initialization, since we don't want to touch the file system too much.
+- (int)browser:(NSBrowser *)sender numberOfRowsInColumn:(int)column {
+    return box->count();
+}
+
+- (void)browser:(NSBrowser *)sender willDisplayCell:(id)cell atRow:(int)row column:(int)column
+{
+    QListBoxItem *item = box->firstItem();
+    int count = 0;
     
-    [scrollview setHasVerticalScroller: NO];
-    [scrollview setHasHorizontalScroller: YES];
-    [scrollview setDocumentView: matrix];
+    while (item != 0){
+        if (count == row){
+            if (item->text.isEmpty())
+                [cell setEnabled: NO];
+            else
+                [cell setEnabled: YES];
+            [cell setLeaf: YES];
+            [cell setStringValue: QSTRING_TO_NSSTRING(item->text)];
+            return;
+        }
+        item = item->nextItem;
+        count++;
+    }
+}
+
+// ==========================================================
+// Browser Target / Action Methods.
+// ==========================================================
+
+- (IBAction)browserSingleClick:(id)browser {
+    box->emitAction(QObject::ACTION_LISTBOX_CLICKED);
+}
+
+- (IBAction)browserDoubleClick:(id)browser {
+}
+ at end
+
+
+QListBox::QListBox()
+{
+    NSBrowser *browser =  [[[NSBrowser alloc] initWithFrame: NSMakeRect (0,0,1,1)] autorelease];
+    KWQBrowserDelegate *delegate = [[KWQBrowserDelegate alloc] initWithListBox: this];
 
     head = 0L;
+
+    [browser setTitled: NO];
+    [browser setDelegate: delegate];
+    [browser setTarget: delegate];
+    [browser setAction: @selector(browserSingleClick:)];
+    [browser addColumn];
     
-    setView (scrollview);
+    setView (browser);
 }
 
 
 QListBox::~QListBox()
 {
-    KWQNSScrollView *scrollview = (KWQNSScrollView *)getView();
-
-    [scrollview setDocumentView: nil];
-    [matrix release];
+    KWQBrowserDelegate *delegate = [(NSBrowser *)getView() delegate];
+    
+    [(NSBrowser *)getView() setDelegate: nil];
+    [delegate release];
 }
 
 
 uint QListBox::count() const
 {
-    return (uint)[matrix numberOfRows];
+    QListBoxItem *item = (QListBoxItem *)head;
+    int count = 0;
+    
+    while (item != 0){
+        item = item->nextItem;
+        count++;
+    }
+    return count;
+}
+
+
+int QListBox::scrollBarWidth() const
+{
+    return (int)[NSScroller scrollerWidth];
 }
 
 
 void QListBox::clear()
 {
-    [matrix renewRows: 0 columns: 0];
-    [matrix sizeToCells];
+    // Do we need to delete previous head?
+    head = 0;
+    
+    [(NSBrowser *)getView() loadColumnZero];
 }
 
 
 void QListBox::setSelectionMode(SelectionMode mode)
 {
     if (mode == QListBox::Extended){
-        [matrix setMode: NSListModeMatrix];
+        [(NSBrowser *)getView() setAllowsMultipleSelection: YES];
     }
     else {
-        [matrix setMode: NSHighlightModeMatrix];
+        [(NSBrowser *)getView() setAllowsMultipleSelection: NO];
     }
 }
 
@@ -90,7 +159,7 @@ QListBoxItem *QListBox::firstItem() const
 
 int QListBox::currentItem() const
 {
-    return [matrix selectedRow];
+    return [(NSBrowser *)getView() selectedRowInColumn:0];
 }
 
 
@@ -100,60 +169,56 @@ void QListBox::insertItem(const QString &t, int index)
 }
 
 
-void QListBox::insertItem(const QListBoxItem *newItem, int index)
+void QListBox::insertItem(const QListBoxItem *newItem, int _index)
 {
     if ( !newItem )
-	return;
+	    return;
 
-    if ( index < 0 || index >= (int)count())
-	index = count();
+    if ( _index < 0 || _index >= (int)count())
+	    _index = count();
 
+    int index = _index;
     QListBoxItem *item = (QListBoxItem *)newItem;
 
     item->box = this;
     if ( !head || index == 0 ) {
-	item->nextItem = head;
-	item->previousItem = 0;
-	head = item;
-	if ( item->nextItem )
-	    item->nextItem->previousItem = item;
+        item->nextItem = head;
+        item->previousItem = 0;
+        head = item;
+        if ( item->nextItem )
+            item->nextItem->previousItem = item;
     } else {
-	QListBoxItem * i = head;
-	while ( i->nextItem && index > 1 ) {
-	    i = i->nextItem;
-	    index--;
-	}
-	if ( i->nextItem ) {
-	    item->nextItem = i->nextItem;
-	    item->previousItem = i;
-	    item->nextItem->previousItem = item;
-	    item->previousItem->nextItem = item;
-	} else {
-	    i->nextItem = item;
-	    item->previousItem = i;
-	    item->nextItem = 0;
-	}
+        QListBoxItem * i = head;
+        while ( i->nextItem && index > 1 ) {
+            i = i->nextItem;
+            index--;
+        }
+        if ( i->nextItem ) {
+            item->nextItem = i->nextItem;
+            item->previousItem = i;
+            item->nextItem->previousItem = item;
+            item->previousItem->nextItem = item;
+        } else {
+            i->nextItem = item;
+            item->previousItem = i;
+            item->nextItem = 0;
+        }
     }
-    [matrix insertRow: index];
-    
-    NSButtonCell *cell = [matrix cellAtRow: index column: 0];
-    [cell setTitle:  QSTRING_TO_NSSTRING(item->text)];
-    
-    item->cell = [cell retain];
+
+    [(NSBrowser *)getView() loadColumnZero];
+    [(NSBrowser *)getView() tile];
 }
 
 void QListBox::setSelected(int index, bool selectIt)
 {
     if (selectIt)
-        [matrix selectCellAtRow: index column: 0];
-    else
-        [matrix deselectSelectedCell];
+        [(NSBrowser *)getView() selectRow: index inColumn: 0];
 }
 
 
 bool QListBox::isSelected(int index)
 {
-    return [matrix selectedRow] == index;
+    return [[(NSBrowser *)getView() loadedCellAtRow: index column:0] state] == NSOnState; 
 }
 
 
@@ -161,18 +226,17 @@ bool QListBox::isSelected(int index)
 
 QListBoxItem::QListBoxItem()
 {
-    cell = 0L;
 }
 
 QListBoxItem::~QListBoxItem()
 {
-    [cell release];
 }
 
 
 void QListBoxItem::setSelectable(bool flag)
 {
-    [cell setSelectable: flag];
+    // Not implemented, RenderSelect calls this when an item element is ""
+    // We handle that case directly in our browser delegate.
 }
 
 
@@ -185,15 +249,16 @@ QListBox *QListBoxItem::listBox() const
 int QListBoxItem::width(const QListBox *) const
 {
     // Is this right?
-    NSSize size = [cell cellSizeForBounds: NSMakeRect (0,0,10000,10000)];
-    return (int)size.width;
+    NSSize cellSize = [[(NSBrowser *)box->getView() loadedCellAtRow: 0 column: 0] cellSizeForBounds: NSMakeRect (0,0,10000,10000)];
+    NSSize frameSize = [NSScrollView frameSizeForContentSize:cellSize hasHorizontalScroller:NO hasVerticalScroller:YES borderType:NSLineBorder];
+    return (int)frameSize.width;
 }
 
 
 int QListBoxItem::height(const QListBox *) const
 {
     // Is this right?
-    NSSize size = [cell cellSizeForBounds: NSMakeRect (0,0,10000,10000)];
+    NSSize size = [[(NSBrowser *)box->getView() loadedCellAtRow: 0 column: 0] cellSizeForBounds: NSMakeRect (0,0,10000,10000)];
     return (int)size.height;
 }
 
@@ -209,7 +274,7 @@ QListBoxItem *QListBoxItem::prev() const
     return previousItem;
 }
 
-
+    
 
 // class QListBoxText ==========================================================
 
diff --git a/WebCore/kwq/KWQNSTextField.mm b/WebCore/kwq/KWQNSTextField.mm
index 63b56aa..03af598 100644
--- a/WebCore/kwq/KWQNSTextField.mm
+++ b/WebCore/kwq/KWQNSTextField.mm
@@ -46,12 +46,14 @@
 
 - (void)action: sender
 {
-    widget->emitAction(QObject::ACTION_TEXT_FIELD);
+    if (widget)
+        widget->emitAction(QObject::ACTION_TEXT_FIELD);
 }
 
 - (void)controlTextDidEndEditing:(NSNotification *)aNotification
 {
-    widget->emitAction(QObject::ACTION_TEXT_FIELD_END_EDITING);
+    if (widget)
+        widget->emitAction(QObject::ACTION_TEXT_FIELD_END_EDITING);
 }
 
 - (void)dealloc
diff --git a/WebCore/kwq/KWQObject.h b/WebCore/kwq/KWQObject.h
index 3f9e051..bb98860 100644
--- a/WebCore/kwq/KWQObject.h
+++ b/WebCore/kwq/KWQObject.h
@@ -74,9 +74,22 @@ public:
 
 #ifdef _KWQ_
     enum Actions {
+        // Standard button action, maps to RenderFormElement::slotClicked
         ACTION_BUTTON_CLICKED = 1,
-        ACTION_TEXT_FIELD = 2,  // corresponds to [NSTextField action]
-        ACTION_TEXT_FIELD_END_EDITING = 3 // corresponds to NSTextField's delegate textDidEndEditing:
+        
+        // Checkbox button action, maps to RenderCheckBox::slotStateChanged
+        ACTION_CHECKBOX_CLICKED = 2,
+        
+        // Text field actions, map to RenderLineEdit::slotReturnPressed and
+        // RenderLineEdit::slotTextChanged
+        ACTION_TEXT_FIELD = 3,  // corresponds to [NSTextField action]
+        ACTION_TEXT_FIELD_END_EDITING = 4, // corresponds to NSTextField's delegate textDidEndEditing:
+
+        ACTION_TEXT_AREA_END_EDITING = 5,
+        
+        ACTION_LISTBOX_CLICKED = 6,
+        
+        ACTION_COMBOBOX_CLICKED = 7
     };
 #endif
 
diff --git a/WebCore/kwq/KWQScrollView.mm b/WebCore/kwq/KWQScrollView.mm
index b7d0ed7..f17bb3e 100644
--- a/WebCore/kwq/KWQScrollView.mm
+++ b/WebCore/kwq/KWQScrollView.mm
@@ -147,9 +147,10 @@ void QScrollView::setHScrollBarMode(ScrollBarMode)
 void QScrollView::addChild(QWidget* child, int x, int y)
 {
     NSView *thisView, *subView;
-    
-    child->move (x, y);
-    
+
+    if (child->x() != x || child->y() != y)
+        child->move (x, y);
+        
     if ([getView() isKindOfClass: NSClassFromString(@"NSScrollView")]){
         thisView = [(NSScrollView *)getView() documentView];
     }
diff --git a/WebCore/kwq/KWQTextArea.mm b/WebCore/kwq/KWQTextArea.mm
index be144e7..537feda 100644
--- a/WebCore/kwq/KWQTextArea.mm
+++ b/WebCore/kwq/KWQTextArea.mm
@@ -52,22 +52,29 @@
 
 const float LargeNumberForText = 1.0e7;
 
-- initWithFrame: (NSRect) r widget: (QWidget *)w 
+- initWithFrame: (NSRect)r
+{
+    return [self initWithFrame: r widget: 0];
+}
+
+- (void)_createTextView
 {
     NSDictionary *attr;
     NSMutableParagraphStyle *style = [[[NSMutableParagraphStyle alloc] init] autorelease];
-    NSRect textFrame;
-
-    [super initWithFrame: r];
-
-    [self setHasVerticalScroller: YES];
-    [self setHasHorizontalScroller: NO];
+    NSRect frame, textFrame;
 
+    frame = [self frame];
+    
     textFrame.origin.x = textFrame.origin.y = 0;
-    textFrame.size = [NSScrollView contentSizeForFrameSize:r.size hasHorizontalScroller:NO hasVerticalScroller:YES borderType: [self borderType]];
-
+    if (frame.size.width > 0 && frame.size.height > 0)
+        textFrame.size = [NSScrollView contentSizeForFrameSize:frame.size hasHorizontalScroller:NO hasVerticalScroller:YES borderType: [self borderType]];
+    else {
+        textFrame.size.width = 0;
+        textFrame.size.height = 0;
+    }
+        
     textView = [[NSTextView alloc] initWithFrame: textFrame];
-    [[textView textContainer] setWidthTracksTextView: NO];
+    [[textView textContainer] setWidthTracksTextView: YES];
     
     // Setup attributes for default cases WRAP=SOFT|VIRTUAL and WRAP=HARD|PHYSICAL.
     // If WRAP=OFF we reset many of these attributes.
@@ -75,14 +82,35 @@ const float LargeNumberForText = 1.0e7;
     [style setAlignment: NSLeftTextAlignment];
     attr = [NSDictionary dictionaryWithObjectsAndKeys: style, NSParagraphStyleAttributeName, nil];
     [textView setTypingAttributes: attr];
+    [textView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
 
+    [textView setDelegate: self];
+    
     [self setDocumentView: textView];
+}
+
+- initWithFrame: (NSRect) r widget: (QWidget *)w 
+{
+    [super initWithFrame: r];
+
+    [self setHasVerticalScroller: YES];
+    [self setHasHorizontalScroller: NO];
+    [self setBorderType: NSLineBorder];
+
+    if (r.size.width > 0 && r.size.height > 0)
+        [self _createTextView];
     
     widget = w;
     
     return self;
 }
 
+- (void)textDidEndEditing:(NSNotification *)aNotification
+{
+    if (widget)
+        widget->emitAction(QObject::ACTION_TEXT_AREA_END_EDITING);
+}
+
 
 - (void) setWordWrap: (BOOL)f
 {
@@ -209,6 +237,13 @@ const float LargeNumberForText = 1.0e7;
     return [textView isEditable];
 }
 
+- (void)setFrame:(NSRect)frameRect
+{    
+    [super setFrame:frameRect];
+
+    if (frameRect.size.width > 0 && frameRect.size.height > 0 && textView == nil)
+        [self _createTextView];
+}
 
 
 @end
diff --git a/WebCore/kwq/KWQTextEdit.mm b/WebCore/kwq/KWQTextEdit.mm
index e9dfae5..f96e39b 100644
--- a/WebCore/kwq/KWQTextEdit.mm
+++ b/WebCore/kwq/KWQTextEdit.mm
@@ -137,14 +137,14 @@ void QMultiLineEdit::setReadOnly(bool flag)
 void QMultiLineEdit::setCursorPosition(int line, int col, bool mark = FALSE)
 {
     // We can safely ignore this method.
-    _logNeverImplemented();
 }
 
 
 void QMultiLineEdit::getCursorPosition(int *line, int *col) const
 {
     // We can safely ignore this method.
-    _logNeverImplemented();
+    *line = 0;
+    *col = 0;
 }
 
 
diff --git a/WebCore/kwq/KWQTextField.mm b/WebCore/kwq/KWQTextField.mm
index 63b56aa..03af598 100644
--- a/WebCore/kwq/KWQTextField.mm
+++ b/WebCore/kwq/KWQTextField.mm
@@ -46,12 +46,14 @@
 
 - (void)action: sender
 {
-    widget->emitAction(QObject::ACTION_TEXT_FIELD);
+    if (widget)
+        widget->emitAction(QObject::ACTION_TEXT_FIELD);
 }
 
 - (void)controlTextDidEndEditing:(NSNotification *)aNotification
 {
-    widget->emitAction(QObject::ACTION_TEXT_FIELD_END_EDITING);
+    if (widget)
+        widget->emitAction(QObject::ACTION_TEXT_FIELD_END_EDITING);
 }
 
 - (void)dealloc
diff --git a/WebCore/kwq/KWQView.mm b/WebCore/kwq/KWQView.mm
index 2672225..317d9ba 100644
--- a/WebCore/kwq/KWQView.mm
+++ b/WebCore/kwq/KWQView.mm
@@ -83,6 +83,11 @@
     widget->emitAction(QObject::ACTION_BUTTON_CLICKED);
 }
 
+- (void)stateChanged: sender
+{
+    widget->emitAction(QObject::ACTION_CHECKBOX_CLICKED);
+}
+
 @end
 
 
@@ -92,6 +97,25 @@
 {
     [super initWithFrame: r];
     widget = w;
+    [self setTarget: self];
+    [self setAction: @selector(action:)];
+    return self;
+}
+
+- (void)action: sender
+{
+    widget->emitAction(QObject::ACTION_COMBOBOX_CLICKED);
+}
+
+ at end
+
+
+ at implementation KWQNSScrollView
+
+- initWithFrame: (NSRect) r widget: (QWidget *)w 
+{
+    [super initWithFrame: r];
+    widget = w;
     return self;
 }
 
diff --git a/WebCore/kwq/KWQWidget.mm b/WebCore/kwq/KWQWidget.mm
index 34fd0d0..b3fc622 100644
--- a/WebCore/kwq/KWQWidget.mm
+++ b/WebCore/kwq/KWQWidget.mm
@@ -502,7 +502,17 @@ void QWidget::setView(NSView *view)
 
 void QWidget::endEditing()
 {
-    [[getView() window] endEditingFor: nil];
+    id window, firstResponder;
+    
+    // Catch the field editor case.
+    window = [getView() window];
+    [window endEditingFor: nil];
+    
+    // The previous case is probably not necessary, given that we whack
+    // any NSText first repsonders.
+    firstResponder = [window firstResponder];
+    if ([firstResponder isKindOfClass: NSClassFromString(@"NSText")])
+        [window makeFirstResponder: nil];
 }
 
 #endif _KWQ_
diff --git a/WebCore/kwq/qt/qcheckbox.h b/WebCore/kwq/qt/qcheckbox.h
index cafd2dc..652ec70 100644
--- a/WebCore/kwq/qt/qcheckbox.h
+++ b/WebCore/kwq/qt/qcheckbox.h
@@ -53,6 +53,7 @@ public:
     // member functions --------------------------------------------------------
 
     void setChecked(bool);
+    bool isChecked();
 
     // operators ---------------------------------------------------------------
 
diff --git a/WebCore/kwq/qt/qcombobox.h b/WebCore/kwq/qt/qcombobox.h
index 0a0c56b..12b9d63 100644
--- a/WebCore/kwq/qt/qcombobox.h
+++ b/WebCore/kwq/qt/qcombobox.h
@@ -57,6 +57,9 @@ public:
     bool eventFilter(QObject *object, QEvent *event);
     void insertItem(const QString &text, int index=-1);
     void clear();
+#ifdef _KWQ_
+    int indexOfCurrentItem();
+#endif
     virtual void setCurrentItem(int);
     QSize sizeHint() const;
 
diff --git a/WebCore/kwq/qt/qobject.h b/WebCore/kwq/qt/qobject.h
index 3f9e051..bb98860 100644
--- a/WebCore/kwq/qt/qobject.h
+++ b/WebCore/kwq/qt/qobject.h
@@ -74,9 +74,22 @@ public:
 
 #ifdef _KWQ_
     enum Actions {
+        // Standard button action, maps to RenderFormElement::slotClicked
         ACTION_BUTTON_CLICKED = 1,
-        ACTION_TEXT_FIELD = 2,  // corresponds to [NSTextField action]
-        ACTION_TEXT_FIELD_END_EDITING = 3 // corresponds to NSTextField's delegate textDidEndEditing:
+        
+        // Checkbox button action, maps to RenderCheckBox::slotStateChanged
+        ACTION_CHECKBOX_CLICKED = 2,
+        
+        // Text field actions, map to RenderLineEdit::slotReturnPressed and
+        // RenderLineEdit::slotTextChanged
+        ACTION_TEXT_FIELD = 3,  // corresponds to [NSTextField action]
+        ACTION_TEXT_FIELD_END_EDITING = 4, // corresponds to NSTextField's delegate textDidEndEditing:
+
+        ACTION_TEXT_AREA_END_EDITING = 5,
+        
+        ACTION_LISTBOX_CLICKED = 6,
+        
+        ACTION_COMBOBOX_CLICKED = 7
     };
 #endif
 
diff --git a/WebCore/src/kdelibs/khtml/rendering/render_form.cpp b/WebCore/src/kdelibs/khtml/rendering/render_form.cpp
index f62fe9d..d2d928b 100644
--- a/WebCore/src/kdelibs/khtml/rendering/render_form.cpp
+++ b/WebCore/src/kdelibs/khtml/rendering/render_form.cpp
@@ -271,6 +271,7 @@ void RenderFormElement::performAction(QObject::Actions action)
 
 void RenderFormElement::slotClicked()
 {
+    //fprintf (stdout, "RenderFormElement::slotClicked():\n");
     if(isRenderButton()) {
         QMouseEvent e2( QEvent::MouseButtonRelease, m_mousePos, m_button, m_state);
 
@@ -348,6 +349,20 @@ void RenderCheckBox::layout()
     RenderButton::layout();
 }
 
+#ifdef _KWQ_
+void RenderCheckBox::performAction(QObject::Actions action)
+{
+    QCheckBox* cb = static_cast<QCheckBox*>( m_widget );
+
+    //fprintf (stdout, "RenderCheckBox::performAction():  %d\n", action);
+    if (action == QObject::ACTION_CHECKBOX_CLICKED)
+        slotStateChanged(cb->isChecked() ? 2 : 0);
+}
+#endif
+
+
+// From the Qt documentation:
+// state is 2 if the button is on, 1 if it is in the "no change" state or 0 if the button is off. 
 void RenderCheckBox::slotStateChanged(int state)
 {
     m_element->setAttribute(ATTR_CHECKED,state == 2 ? "" : 0);
@@ -374,6 +389,8 @@ void RenderRadioButton::setChecked(bool checked)
 
 void RenderRadioButton::slotClicked()
 {
+    //fprintf (stdout, "RenderRadioButton::slotClicked():\n");
+
     m_element->setAttribute(ATTR_CHECKED,"");
 
     // emit mouseClick event etc
@@ -843,7 +860,7 @@ RenderSelect::RenderSelect(QScrollView *view, HTMLSelectElementImpl *element)
     if(m_useListBox)
         setQWidget(createListBox());
     else
-	setQWidget(createComboBox());
+	    setQWidget(createComboBox());
 }
 
 
@@ -917,8 +934,7 @@ void RenderSelect::layout( )
 
                 if(m_useListBox) {
                     QListBoxText *item = new QListBoxText(QString(text.implementation()->s, text.implementation()->l).visual());
-                    static_cast<KListBox*>(m_widget)
-                        ->insertItem(item, listIndex);
+                    static_cast<KListBox*>(m_widget)->insertItem(item, listIndex);
                     item->setSelectable(false);
                 }
                 else
@@ -972,8 +988,13 @@ void RenderSelect::layout( )
         if(size < 1)
             size = QMIN(static_cast<KListBox*>(m_widget)->count(), 10);
 
+#ifdef _KWQ_
+        width += w->scrollBarWidth();
+        height = size*height;
+#else
         width += 2*w->frameWidth() + w->verticalScrollBar()->sizeHint().width();
         height = size*height + 2*w->frameWidth();
+#endif
 
         setIntrinsicWidth( width );
         setIntrinsicHeight( height );
@@ -1058,6 +1079,18 @@ void RenderSelect::slotSelected(int index)
 }
 
 
+void RenderSelect::performAction(QObject::Actions action)
+{
+    //fprintf (stdout, "RenderSelect::performAction():  %d\n", action);
+    if (action == QObject::ACTION_LISTBOX_CLICKED)
+        slotSelectionChanged();
+    else if (action == QObject::ACTION_COMBOBOX_CLICKED){
+        ComboBoxWidget *combo = static_cast<ComboBoxWidget*>(m_widget);
+
+        slotSelected(combo->indexOfCurrentItem());
+    }
+}
+
 void RenderSelect::slotSelectionChanged()
 {
     if ( m_ignoreSelectEvents ) return;
@@ -1101,6 +1134,7 @@ ComboBoxWidget *RenderSelect::createComboBox()
     return cb;
 }
 
+
 void RenderSelect::updateSelection()
 {
     QArray<HTMLGenericFormElementImpl*> listItems = static_cast<HTMLSelectElementImpl*>(m_element)->listItems();
@@ -1223,13 +1257,13 @@ void RenderTextArea::layout( )
     HTMLTextAreaElementImpl* f = static_cast<HTMLTextAreaElementImpl*>(m_element);
 
     if (!layouted()) {
-	w->setReadOnly(m_element->readOnly());
-	w->blockSignals(true);
-	int line, col;
-	w->getCursorPosition( &line, &col );
-	w->setText(f->value().string().visual());
-	w->setCursorPosition( line, col );
-	w->blockSignals(false);
+        w->setReadOnly(m_element->readOnly());
+        w->blockSignals(true);
+        int line, col;
+        w->getCursorPosition( &line, &col );
+        w->setText(f->value().string().visual());
+        w->setCursorPosition( line, col );
+        w->blockSignals(false);
     }
 
     RenderFormElement::layout();
@@ -1264,6 +1298,15 @@ QString RenderTextArea::text()
     return txt;
 }
 
+void RenderTextArea::performAction(QObject::Actions action)
+{
+    //TextAreaWidget *edit = static_cast<TextAreaWidget*>(m_widget);
+
+    //fprintf (stdout, "RenderTextArea::performAction():  %d text value = %s\n", action, edit->text().latin1());
+    if (action == QObject::ACTION_TEXT_AREA_END_EDITING)
+        slotTextChanged();
+}
+
 void RenderTextArea::slotTextChanged()
 {
     static_cast<HTMLTextAreaElementImpl*>( m_element )->m_dirtyvalue = true;
diff --git a/WebCore/src/kdelibs/khtml/rendering/render_form.h b/WebCore/src/kdelibs/khtml/rendering/render_form.h
index 669932f..9c9713b 100644
--- a/WebCore/src/kdelibs/khtml/rendering/render_form.h
+++ b/WebCore/src/kdelibs/khtml/rendering/render_form.h
@@ -133,6 +133,10 @@ public:
     virtual const char *renderName() const { return "RenderCheckBox"; }
     virtual void calcMinMaxWidth();
     virtual void layout( );
+
+#ifdef _KWQ_
+    void performAction(QObject::Actions action);
+#endif
     
 public slots:
     virtual void slotStateChanged(int state);
@@ -338,6 +342,11 @@ public:
 
     void updateSelection();
 
+#ifdef _KWQ_
+    void performAction(QObject::Actions action);
+#endif
+
+
 protected:
     KListBox *createListBox();
     ComboBoxWidget *createComboBox();
@@ -386,6 +395,10 @@ public:
 
     QString text(); // ### remove
 
+#ifdef _KWQ_
+    void performAction(QObject::Actions action);
+#endif
+
     void select();
 
 protected slots:
diff --git a/WebCore/src/kwq/KWQCheckBox.mm b/WebCore/src/kwq/KWQCheckBox.mm
index 8b88ba1..49e8327 100644
--- a/WebCore/src/kwq/KWQCheckBox.mm
+++ b/WebCore/src/kwq/KWQCheckBox.mm
@@ -35,6 +35,7 @@ QCheckBox::QCheckBox(QWidget *w) : QButton (w)
     
     button = (KWQNSButton *)getView();
     [button setButtonType: NSSwitchButton];
+    [button setAction: @selector(stateChanged:)];
     setView (button);
 }
 
@@ -49,3 +50,17 @@ void QCheckBox::setChecked(bool isChecked)
     else
         [button setState: NSOffState];
 }
+
+
+bool QCheckBox::isChecked()
+{
+    KWQNSButton *button;
+    int state;
+    
+    button = (KWQNSButton *)getView();
+    state = [button state];
+    if (state == NSOffState)
+        return 0;
+    return 1;
+}
+
diff --git a/WebCore/src/kwq/KWQComboBox.mm b/WebCore/src/kwq/KWQComboBox.mm
index f2f94ec..2e6f7a9 100644
--- a/WebCore/src/kwq/KWQComboBox.mm
+++ b/WebCore/src/kwq/KWQComboBox.mm
@@ -115,6 +115,12 @@ void QComboBox::clear()
     [comboBox removeAllItems];
 }
 
+int QComboBox::indexOfCurrentItem()
+{
+    KWQNSComboBox *comboBox = (KWQNSComboBox *)getView();
+    return [comboBox indexOfSelectedItem];
+}
+
 void QComboBox::setCurrentItem(int index)
 {
     KWQNSComboBox *comboBox = (KWQNSComboBox *)getView();
diff --git a/WebCore/src/kwq/KWQKHTMLPart.mm b/WebCore/src/kwq/KWQKHTMLPart.mm
index fe40d54..042a113 100644
--- a/WebCore/src/kwq/KWQKHTMLPart.mm
+++ b/WebCore/src/kwq/KWQKHTMLPart.mm
@@ -1656,12 +1656,12 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons
     IFWebFrame *aFrame;
     IFWebDataSource *dataSource;
     
-    fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x, name = %s, url = %s\n", (unsigned int)this, (unsigned int)frame, frameName.latin1(), url.latin1());    
+    //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x, name = %s, url = %s\n", (unsigned int)this, (unsigned int)frame, frameName.latin1(), url.latin1());    
     dataSource = getDataSource();
 
     aFrame =[dataSource frameNamed: nsframeName];
     if (aFrame){
-        fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x frame found\n", (unsigned int)this, (unsigned int)frame);    
+        //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x frame found\n", (unsigned int)this, (unsigned int)frame);    
         // ?
         frame->setWidget ([[aFrame view] _widget]);
     }
@@ -1671,7 +1671,7 @@ bool KHTMLPart::requestFrame( khtml::RenderPart *frame, const QString &url, cons
         IFWebFrame *newFrame;
         id <IFWebController> controller;
 
-        fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x creating frame\n", (unsigned int)this, (unsigned int)frame);    
+        //fprintf (stdout, "0x%08x requestFrame():  part = 0x%08x creating frame\n", (unsigned int)this, (unsigned int)frame);    
         childURL = [NSURL URLWithString: QSTRING_TO_NSSTRING (completeURL( url ).url() )];
         
         dataSource = getDataSource();
diff --git a/WebCore/src/kwq/KWQListBox.h b/WebCore/src/kwq/KWQListBox.h
index 9e6bdd4..6d8904a 100644
--- a/WebCore/src/kwq/KWQListBox.h
+++ b/WebCore/src/kwq/KWQListBox.h
@@ -63,6 +63,10 @@ public:
 
     // member functions --------------------------------------------------------
 
+#ifdef _KWQ_
+    int scrollBarWidth() const;
+#endif
+    
     uint count() const;
     void clear();
     virtual void setSelectionMode(SelectionMode);
@@ -85,12 +89,6 @@ private:
     QListBox &operator=(const QListBox &);
 
     QListBoxItem *head;
-#if (defined(__APPLE__) && defined(__OBJC__) && defined(__cplusplus))
-    NSMatrix *matrix;
-#else
-    void *matrix;
-#endif
-
 }; // class QListBox ===========================================================
 
 
@@ -123,10 +121,7 @@ public:
 
     // operators ---------------------------------------------------------------
 
-// protected -------------------------------------------------------------------
-// private ---------------------------------------------------------------------
 
-private:
     // no copying or assignment
     // note that these are "standard" (no pendantic stuff needed)
     QListBoxItem(const QListBoxItem &);
@@ -135,11 +130,9 @@ private:
     QString text;
     QListBoxItem *previousItem, *nextItem;
     QListBox *box;
-#if (defined(__APPLE__) && defined(__OBJC__) && defined(__cplusplus))
-    NSButtonCell *cell;
-#else
-    void *cell;
-#endif
+
+// protected -------------------------------------------------------------------
+// private ---------------------------------------------------------------------
 
 }; // class QListBoxItem =======================================================
 
diff --git a/WebCore/src/kwq/KWQListBox.mm b/WebCore/src/kwq/KWQListBox.mm
index 92e6b3f..58b99be 100644
--- a/WebCore/src/kwq/KWQListBox.mm
+++ b/WebCore/src/kwq/KWQListBox.mm
@@ -28,56 +28,125 @@
 #include <KWQListBox.h>
 
 
-// Emulated with a NSScrollView that contains a NSMatrix.  Use a prototype cell.
-QListBox::QListBox()
+ at interface KWQBrowserDelegate : NSObject
 {
-    KWQNSScrollView *scrollview = [[NSScrollView alloc] initWithFrame: NSMakeRect (0,0,0,0) widget: this];
-    NSButtonCell *cell = [[[NSButtonCell alloc] init] autorelease];
-    
-    [cell setBordered: NO];
-    [cell setAlignment: NSLeftTextAlignment];
-       
-    matrix  = [[NSMatrix alloc] initWithFrame: NSMakeRect (0,0,0,0) mode:NSHighlightModeMatrix prototype:cell numberOfRows:0 numberOfColumns:0];
+    QListBox *box;
+}
+
+ at end
+
+ at implementation KWQBrowserDelegate
+
+- initWithListBox: (QListBox *)b
+{
+    [super init];
+    box = b;
+    return self;
+}
+
+// ==========================================================
+// Browser Delegate Methods.
+// ==========================================================
+
+// Use lazy initialization, since we don't want to touch the file system too much.
+- (int)browser:(NSBrowser *)sender numberOfRowsInColumn:(int)column {
+    return box->count();
+}
+
+- (void)browser:(NSBrowser *)sender willDisplayCell:(id)cell atRow:(int)row column:(int)column
+{
+    QListBoxItem *item = box->firstItem();
+    int count = 0;
     
-    [scrollview setHasVerticalScroller: NO];
-    [scrollview setHasHorizontalScroller: YES];
-    [scrollview setDocumentView: matrix];
+    while (item != 0){
+        if (count == row){
+            if (item->text.isEmpty())
+                [cell setEnabled: NO];
+            else
+                [cell setEnabled: YES];
+            [cell setLeaf: YES];
+            [cell setStringValue: QSTRING_TO_NSSTRING(item->text)];
+            return;
+        }
+        item = item->nextItem;
+        count++;
+    }
+}
+
+// ==========================================================
+// Browser Target / Action Methods.
+// ==========================================================
+
+- (IBAction)browserSingleClick:(id)browser {
+    box->emitAction(QObject::ACTION_LISTBOX_CLICKED);
+}
+
+- (IBAction)browserDoubleClick:(id)browser {
+}
+ at end
+
+
+QListBox::QListBox()
+{
+    NSBrowser *browser =  [[[NSBrowser alloc] initWithFrame: NSMakeRect (0,0,1,1)] autorelease];
+    KWQBrowserDelegate *delegate = [[KWQBrowserDelegate alloc] initWithListBox: this];
 
     head = 0L;
+
+    [browser setTitled: NO];
+    [browser setDelegate: delegate];
+    [browser setTarget: delegate];
+    [browser setAction: @selector(browserSingleClick:)];
+    [browser addColumn];
     
-    setView (scrollview);
+    setView (browser);
 }
 
 
 QListBox::~QListBox()
 {
-    KWQNSScrollView *scrollview = (KWQNSScrollView *)getView();
-
-    [scrollview setDocumentView: nil];
-    [matrix release];
+    KWQBrowserDelegate *delegate = [(NSBrowser *)getView() delegate];
+    
+    [(NSBrowser *)getView() setDelegate: nil];
+    [delegate release];
 }
 
 
 uint QListBox::count() const
 {
-    return (uint)[matrix numberOfRows];
+    QListBoxItem *item = (QListBoxItem *)head;
+    int count = 0;
+    
+    while (item != 0){
+        item = item->nextItem;
+        count++;
+    }
+    return count;
+}
+
+
+int QListBox::scrollBarWidth() const
+{
+    return (int)[NSScroller scrollerWidth];
 }
 
 
 void QListBox::clear()
 {
-    [matrix renewRows: 0 columns: 0];
-    [matrix sizeToCells];
+    // Do we need to delete previous head?
+    head = 0;
+    
+    [(NSBrowser *)getView() loadColumnZero];
 }
 
 
 void QListBox::setSelectionMode(SelectionMode mode)
 {
     if (mode == QListBox::Extended){
-        [matrix setMode: NSListModeMatrix];
+        [(NSBrowser *)getView() setAllowsMultipleSelection: YES];
     }
     else {
-        [matrix setMode: NSHighlightModeMatrix];
+        [(NSBrowser *)getView() setAllowsMultipleSelection: NO];
     }
 }
 
@@ -90,7 +159,7 @@ QListBoxItem *QListBox::firstItem() const
 
 int QListBox::currentItem() const
 {
-    return [matrix selectedRow];
+    return [(NSBrowser *)getView() selectedRowInColumn:0];
 }
 
 
@@ -100,60 +169,56 @@ void QListBox::insertItem(const QString &t, int index)
 }
 
 
-void QListBox::insertItem(const QListBoxItem *newItem, int index)
+void QListBox::insertItem(const QListBoxItem *newItem, int _index)
 {
     if ( !newItem )
-	return;
+	    return;
 
-    if ( index < 0 || index >= (int)count())
-	index = count();
+    if ( _index < 0 || _index >= (int)count())
+	    _index = count();
 
+    int index = _index;
     QListBoxItem *item = (QListBoxItem *)newItem;
 
     item->box = this;
     if ( !head || index == 0 ) {
-	item->nextItem = head;
-	item->previousItem = 0;
-	head = item;
-	if ( item->nextItem )
-	    item->nextItem->previousItem = item;
+        item->nextItem = head;
+        item->previousItem = 0;
+        head = item;
+        if ( item->nextItem )
+            item->nextItem->previousItem = item;
     } else {
-	QListBoxItem * i = head;
-	while ( i->nextItem && index > 1 ) {
-	    i = i->nextItem;
-	    index--;
-	}
-	if ( i->nextItem ) {
-	    item->nextItem = i->nextItem;
-	    item->previousItem = i;
-	    item->nextItem->previousItem = item;
-	    item->previousItem->nextItem = item;
-	} else {
-	    i->nextItem = item;
-	    item->previousItem = i;
-	    item->nextItem = 0;
-	}
+        QListBoxItem * i = head;
+        while ( i->nextItem && index > 1 ) {
+            i = i->nextItem;
+            index--;
+        }
+        if ( i->nextItem ) {
+            item->nextItem = i->nextItem;
+            item->previousItem = i;
+            item->nextItem->previousItem = item;
+            item->previousItem->nextItem = item;
+        } else {
+            i->nextItem = item;
+            item->previousItem = i;
+            item->nextItem = 0;
+        }
     }
-    [matrix insertRow: index];
-    
-    NSButtonCell *cell = [matrix cellAtRow: index column: 0];
-    [cell setTitle:  QSTRING_TO_NSSTRING(item->text)];
-    
-    item->cell = [cell retain];
+
+    [(NSBrowser *)getView() loadColumnZero];
+    [(NSBrowser *)getView() tile];
 }
 
 void QListBox::setSelected(int index, bool selectIt)
 {
     if (selectIt)
-        [matrix selectCellAtRow: index column: 0];
-    else
-        [matrix deselectSelectedCell];
+        [(NSBrowser *)getView() selectRow: index inColumn: 0];
 }
 
 
 bool QListBox::isSelected(int index)
 {
-    return [matrix selectedRow] == index;
+    return [[(NSBrowser *)getView() loadedCellAtRow: index column:0] state] == NSOnState; 
 }
 
 
@@ -161,18 +226,17 @@ bool QListBox::isSelected(int index)
 
 QListBoxItem::QListBoxItem()
 {
-    cell = 0L;
 }
 
 QListBoxItem::~QListBoxItem()
 {
-    [cell release];
 }
 
 
 void QListBoxItem::setSelectable(bool flag)
 {
-    [cell setSelectable: flag];
+    // Not implemented, RenderSelect calls this when an item element is ""
+    // We handle that case directly in our browser delegate.
 }
 
 
@@ -185,15 +249,16 @@ QListBox *QListBoxItem::listBox() const
 int QListBoxItem::width(const QListBox *) const
 {
     // Is this right?
-    NSSize size = [cell cellSizeForBounds: NSMakeRect (0,0,10000,10000)];
-    return (int)size.width;
+    NSSize cellSize = [[(NSBrowser *)box->getView() loadedCellAtRow: 0 column: 0] cellSizeForBounds: NSMakeRect (0,0,10000,10000)];
+    NSSize frameSize = [NSScrollView frameSizeForContentSize:cellSize hasHorizontalScroller:NO hasVerticalScroller:YES borderType:NSLineBorder];
+    return (int)frameSize.width;
 }
 
 
 int QListBoxItem::height(const QListBox *) const
 {
     // Is this right?
-    NSSize size = [cell cellSizeForBounds: NSMakeRect (0,0,10000,10000)];
+    NSSize size = [[(NSBrowser *)box->getView() loadedCellAtRow: 0 column: 0] cellSizeForBounds: NSMakeRect (0,0,10000,10000)];
     return (int)size.height;
 }
 
@@ -209,7 +274,7 @@ QListBoxItem *QListBoxItem::prev() const
     return previousItem;
 }
 
-
+    
 
 // class QListBoxText ==========================================================
 
diff --git a/WebCore/src/kwq/KWQNSTextField.mm b/WebCore/src/kwq/KWQNSTextField.mm
index 63b56aa..03af598 100644
--- a/WebCore/src/kwq/KWQNSTextField.mm
+++ b/WebCore/src/kwq/KWQNSTextField.mm
@@ -46,12 +46,14 @@
 
 - (void)action: sender
 {
-    widget->emitAction(QObject::ACTION_TEXT_FIELD);
+    if (widget)
+        widget->emitAction(QObject::ACTION_TEXT_FIELD);
 }
 
 - (void)controlTextDidEndEditing:(NSNotification *)aNotification
 {
-    widget->emitAction(QObject::ACTION_TEXT_FIELD_END_EDITING);
+    if (widget)
+        widget->emitAction(QObject::ACTION_TEXT_FIELD_END_EDITING);
 }
 
 - (void)dealloc
diff --git a/WebCore/src/kwq/KWQScrollView.mm b/WebCore/src/kwq/KWQScrollView.mm
index b7d0ed7..f17bb3e 100644
--- a/WebCore/src/kwq/KWQScrollView.mm
+++ b/WebCore/src/kwq/KWQScrollView.mm
@@ -147,9 +147,10 @@ void QScrollView::setHScrollBarMode(ScrollBarMode)
 void QScrollView::addChild(QWidget* child, int x, int y)
 {
     NSView *thisView, *subView;
-    
-    child->move (x, y);
-    
+
+    if (child->x() != x || child->y() != y)
+        child->move (x, y);
+        
     if ([getView() isKindOfClass: NSClassFromString(@"NSScrollView")]){
         thisView = [(NSScrollView *)getView() documentView];
     }
diff --git a/WebCore/src/kwq/KWQTextArea.mm b/WebCore/src/kwq/KWQTextArea.mm
index be144e7..537feda 100644
--- a/WebCore/src/kwq/KWQTextArea.mm
+++ b/WebCore/src/kwq/KWQTextArea.mm
@@ -52,22 +52,29 @@
 
 const float LargeNumberForText = 1.0e7;
 
-- initWithFrame: (NSRect) r widget: (QWidget *)w 
+- initWithFrame: (NSRect)r
+{
+    return [self initWithFrame: r widget: 0];
+}
+
+- (void)_createTextView
 {
     NSDictionary *attr;
     NSMutableParagraphStyle *style = [[[NSMutableParagraphStyle alloc] init] autorelease];
-    NSRect textFrame;
-
-    [super initWithFrame: r];
-
-    [self setHasVerticalScroller: YES];
-    [self setHasHorizontalScroller: NO];
+    NSRect frame, textFrame;
 
+    frame = [self frame];
+    
     textFrame.origin.x = textFrame.origin.y = 0;
-    textFrame.size = [NSScrollView contentSizeForFrameSize:r.size hasHorizontalScroller:NO hasVerticalScroller:YES borderType: [self borderType]];
-
+    if (frame.size.width > 0 && frame.size.height > 0)
+        textFrame.size = [NSScrollView contentSizeForFrameSize:frame.size hasHorizontalScroller:NO hasVerticalScroller:YES borderType: [self borderType]];
+    else {
+        textFrame.size.width = 0;
+        textFrame.size.height = 0;
+    }
+        
     textView = [[NSTextView alloc] initWithFrame: textFrame];
-    [[textView textContainer] setWidthTracksTextView: NO];
+    [[textView textContainer] setWidthTracksTextView: YES];
     
     // Setup attributes for default cases WRAP=SOFT|VIRTUAL and WRAP=HARD|PHYSICAL.
     // If WRAP=OFF we reset many of these attributes.
@@ -75,14 +82,35 @@ const float LargeNumberForText = 1.0e7;
     [style setAlignment: NSLeftTextAlignment];
     attr = [NSDictionary dictionaryWithObjectsAndKeys: style, NSParagraphStyleAttributeName, nil];
     [textView setTypingAttributes: attr];
+    [textView setAutoresizingMask: NSViewWidthSizable | NSViewHeightSizable];
 
+    [textView setDelegate: self];
+    
     [self setDocumentView: textView];
+}
+
+- initWithFrame: (NSRect) r widget: (QWidget *)w 
+{
+    [super initWithFrame: r];
+
+    [self setHasVerticalScroller: YES];
+    [self setHasHorizontalScroller: NO];
+    [self setBorderType: NSLineBorder];
+
+    if (r.size.width > 0 && r.size.height > 0)
+        [self _createTextView];
     
     widget = w;
     
     return self;
 }
 
+- (void)textDidEndEditing:(NSNotification *)aNotification
+{
+    if (widget)
+        widget->emitAction(QObject::ACTION_TEXT_AREA_END_EDITING);
+}
+
 
 - (void) setWordWrap: (BOOL)f
 {
@@ -209,6 +237,13 @@ const float LargeNumberForText = 1.0e7;
     return [textView isEditable];
 }
 
+- (void)setFrame:(NSRect)frameRect
+{    
+    [super setFrame:frameRect];
+
+    if (frameRect.size.width > 0 && frameRect.size.height > 0 && textView == nil)
+        [self _createTextView];
+}
 
 
 @end
diff --git a/WebCore/src/kwq/KWQTextEdit.mm b/WebCore/src/kwq/KWQTextEdit.mm
index e9dfae5..f96e39b 100644
--- a/WebCore/src/kwq/KWQTextEdit.mm
+++ b/WebCore/src/kwq/KWQTextEdit.mm
@@ -137,14 +137,14 @@ void QMultiLineEdit::setReadOnly(bool flag)
 void QMultiLineEdit::setCursorPosition(int line, int col, bool mark = FALSE)
 {
     // We can safely ignore this method.
-    _logNeverImplemented();
 }
 
 
 void QMultiLineEdit::getCursorPosition(int *line, int *col) const
 {
     // We can safely ignore this method.
-    _logNeverImplemented();
+    *line = 0;
+    *col = 0;
 }
 
 
diff --git a/WebCore/src/kwq/KWQView.mm b/WebCore/src/kwq/KWQView.mm
index 2672225..317d9ba 100644
--- a/WebCore/src/kwq/KWQView.mm
+++ b/WebCore/src/kwq/KWQView.mm
@@ -83,6 +83,11 @@
     widget->emitAction(QObject::ACTION_BUTTON_CLICKED);
 }
 
+- (void)stateChanged: sender
+{
+    widget->emitAction(QObject::ACTION_CHECKBOX_CLICKED);
+}
+
 @end
 
 
@@ -92,6 +97,25 @@
 {
     [super initWithFrame: r];
     widget = w;
+    [self setTarget: self];
+    [self setAction: @selector(action:)];
+    return self;
+}
+
+- (void)action: sender
+{
+    widget->emitAction(QObject::ACTION_COMBOBOX_CLICKED);
+}
+
+ at end
+
+
+ at implementation KWQNSScrollView
+
+- initWithFrame: (NSRect) r widget: (QWidget *)w 
+{
+    [super initWithFrame: r];
+    widget = w;
     return self;
 }
 
diff --git a/WebCore/src/kwq/KWQWidget.mm b/WebCore/src/kwq/KWQWidget.mm
index 34fd0d0..b3fc622 100644
--- a/WebCore/src/kwq/KWQWidget.mm
+++ b/WebCore/src/kwq/KWQWidget.mm
@@ -502,7 +502,17 @@ void QWidget::setView(NSView *view)
 
 void QWidget::endEditing()
 {
-    [[getView() window] endEditingFor: nil];
+    id window, firstResponder;
+    
+    // Catch the field editor case.
+    window = [getView() window];
+    [window endEditingFor: nil];
+    
+    // The previous case is probably not necessary, given that we whack
+    // any NSText first repsonders.
+    firstResponder = [window firstResponder];
+    if ([firstResponder isKindOfClass: NSClassFromString(@"NSText")])
+        [window makeFirstResponder: nil];
 }
 
 #endif _KWQ_
diff --git a/WebCore/src/kwq/qt/qcheckbox.h b/WebCore/src/kwq/qt/qcheckbox.h
index cafd2dc..652ec70 100644
--- a/WebCore/src/kwq/qt/qcheckbox.h
+++ b/WebCore/src/kwq/qt/qcheckbox.h
@@ -53,6 +53,7 @@ public:
     // member functions --------------------------------------------------------
 
     void setChecked(bool);
+    bool isChecked();
 
     // operators ---------------------------------------------------------------
 
diff --git a/WebCore/src/kwq/qt/qcombobox.h b/WebCore/src/kwq/qt/qcombobox.h
index 0a0c56b..12b9d63 100644
--- a/WebCore/src/kwq/qt/qcombobox.h
+++ b/WebCore/src/kwq/qt/qcombobox.h
@@ -57,6 +57,9 @@ public:
     bool eventFilter(QObject *object, QEvent *event);
     void insertItem(const QString &text, int index=-1);
     void clear();
+#ifdef _KWQ_
+    int indexOfCurrentItem();
+#endif
     virtual void setCurrentItem(int);
     QSize sizeHint() const;
 
diff --git a/WebCore/src/kwq/qt/qobject.h b/WebCore/src/kwq/qt/qobject.h
index 3f9e051..bb98860 100644
--- a/WebCore/src/kwq/qt/qobject.h
+++ b/WebCore/src/kwq/qt/qobject.h
@@ -74,9 +74,22 @@ public:
 
 #ifdef _KWQ_
     enum Actions {
+        // Standard button action, maps to RenderFormElement::slotClicked
         ACTION_BUTTON_CLICKED = 1,
-        ACTION_TEXT_FIELD = 2,  // corresponds to [NSTextField action]
-        ACTION_TEXT_FIELD_END_EDITING = 3 // corresponds to NSTextField's delegate textDidEndEditing:
+        
+        // Checkbox button action, maps to RenderCheckBox::slotStateChanged
+        ACTION_CHECKBOX_CLICKED = 2,
+        
+        // Text field actions, map to RenderLineEdit::slotReturnPressed and
+        // RenderLineEdit::slotTextChanged
+        ACTION_TEXT_FIELD = 3,  // corresponds to [NSTextField action]
+        ACTION_TEXT_FIELD_END_EDITING = 4, // corresponds to NSTextField's delegate textDidEndEditing:
+
+        ACTION_TEXT_AREA_END_EDITING = 5,
+        
+        ACTION_LISTBOX_CLICKED = 6,
+        
+        ACTION_COMBOBOX_CLICKED = 7
     };
 #endif
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list