[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 06:25:49 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 952bd993d538ad9d297e7761d9a89eafb182bbe4
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Sun Jul 21 07:46:20 2002 +0000

    Apologies for the lack of the changelog info.  I need help setting that up on my laptop.  I did edit the changelog, and you can see it there.  This is a fix to speed up list boxes.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1614 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 067b580..61e5117 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,29 @@
+2002-07-21  David Hyatt  <hyatt at apple.com>
+
+	Fixing bug 3003837, list boxes are extremely slow.  The
+	buildup of a list box was order n squared, since on every
+	insert of an item the list box was rebuilding its entire
+	contents.  This patch adds smarts to the list buildup, so that
+	the underlying NSBrowser only rebuilds itself one time, after
+	all the items have been inserted.
+
+	This speeds up the Bugzilla forms page on cvs-base by 60%.
+	
+        * khtml/rendering/render_form.cpp:
+        (RenderSelect::updateFromElement):
+	Patched to make calls to beginBatchInsert and endBatchInsert
+	on KListBox.
+	
+        * kwq/KWQListBox.h:
+        * kwq/KWQListBox.mm:
+        (QListBox::QListBox):
+        (QListBox::insertItem):
+        (QListBox::beginBatchInsert):
+        (QListBox::endBatchInsert):
+	If in the middle of a batch insert, the insertitem function will
+	not rebuild the NSBrowser's list.  endBatchInsert will actually
+	do this now.
+	
 2002-07-20  David Hyatt  <hyatt at apple.com>
 
 	This patch fixes the FOUC (flash of unstyled content) problem.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 067b580..61e5117 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,29 @@
+2002-07-21  David Hyatt  <hyatt at apple.com>
+
+	Fixing bug 3003837, list boxes are extremely slow.  The
+	buildup of a list box was order n squared, since on every
+	insert of an item the list box was rebuilding its entire
+	contents.  This patch adds smarts to the list buildup, so that
+	the underlying NSBrowser only rebuilds itself one time, after
+	all the items have been inserted.
+
+	This speeds up the Bugzilla forms page on cvs-base by 60%.
+	
+        * khtml/rendering/render_form.cpp:
+        (RenderSelect::updateFromElement):
+	Patched to make calls to beginBatchInsert and endBatchInsert
+	on KListBox.
+	
+        * kwq/KWQListBox.h:
+        * kwq/KWQListBox.mm:
+        (QListBox::QListBox):
+        (QListBox::insertItem):
+        (QListBox::beginBatchInsert):
+        (QListBox::endBatchInsert):
+	If in the middle of a batch insert, the insertitem function will
+	not rebuild the NSBrowser's list.  endBatchInsert will actually
+	do this now.
+	
 2002-07-20  David Hyatt  <hyatt at apple.com>
 
 	This patch fixes the FOUC (flash of unstyled content) problem.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 067b580..61e5117 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,29 @@
+2002-07-21  David Hyatt  <hyatt at apple.com>
+
+	Fixing bug 3003837, list boxes are extremely slow.  The
+	buildup of a list box was order n squared, since on every
+	insert of an item the list box was rebuilding its entire
+	contents.  This patch adds smarts to the list buildup, so that
+	the underlying NSBrowser only rebuilds itself one time, after
+	all the items have been inserted.
+
+	This speeds up the Bugzilla forms page on cvs-base by 60%.
+	
+        * khtml/rendering/render_form.cpp:
+        (RenderSelect::updateFromElement):
+	Patched to make calls to beginBatchInsert and endBatchInsert
+	on KListBox.
+	
+        * kwq/KWQListBox.h:
+        * kwq/KWQListBox.mm:
+        (QListBox::QListBox):
+        (QListBox::insertItem):
+        (QListBox::beginBatchInsert):
+        (QListBox::endBatchInsert):
+	If in the middle of a batch insert, the insertitem function will
+	not rebuild the NSBrowser's list.  endBatchInsert will actually
+	do this now.
+	
 2002-07-20  David Hyatt  <hyatt at apple.com>
 
 	This patch fixes the FOUC (flash of unstyled content) problem.
diff --git a/WebCore/khtml/rendering/render_form.cpp b/WebCore/khtml/rendering/render_form.cpp
index 0364310..7d854f5 100644
--- a/WebCore/khtml/rendering/render_form.cpp
+++ b/WebCore/khtml/rendering/render_form.cpp
@@ -837,6 +837,8 @@ void RenderSelect::updateFromElement()
 #ifdef APPLE_CHANGES
         if(!m_useListBox)
             static_cast<KComboBox*>(m_widget)->setSize(listItems.size());
+	else
+            static_cast<KListBox*>(m_widget)->beginBatchInsert();
 #endif
         for (listIndex = 0; listIndex < int(listItems.size()); listIndex++) {
             if (listItems[listIndex]->id() == ID_OPTGROUP) {
@@ -875,6 +877,8 @@ void RenderSelect::updateFromElement()
 #ifdef APPLE_CHANGES
         if(!m_useListBox)
             static_cast<KComboBox*>(m_widget)->doneLoading();
+	else
+	    static_cast<KListBox*>(m_widget)->endBatchInsert();
 #endif
         setMinMaxKnown(false);
         setLayouted(false);
diff --git a/WebCore/kwq/KWQListBox.h b/WebCore/kwq/KWQListBox.h
index 6ff1ac8..39c3b14 100644
--- a/WebCore/kwq/KWQListBox.h
+++ b/WebCore/kwq/KWQListBox.h
@@ -49,11 +49,14 @@ public:
     int currentItem() const;
     void insertItem(const QString &, int index=-1);
     void insertItem(const QListBoxItem *, int index=-1);
+    void beginBatchInsert();
+    void endBatchInsert();
     void setSelected(int, bool);
     bool isSelected(int);
 
 private:
     QListBoxItem *head;
+    bool m_insertingItems;
 };
 
 class QListBoxItem {
diff --git a/WebCore/kwq/KWQListBox.mm b/WebCore/kwq/KWQListBox.mm
index a8b7a59..b48fbec 100644
--- a/WebCore/kwq/KWQListBox.mm
+++ b/WebCore/kwq/KWQListBox.mm
@@ -91,7 +91,7 @@
 
 
 QListBox::QListBox(QWidget *parent)
-    : QScrollView(parent)
+    : QScrollView(parent), m_insertingItems(false)
 {
     NSBrowser *browser =  [[[NSBrowser alloc] initWithFrame: NSMakeRect (0,0,1,1)] autorelease];
     KWQBrowserDelegate *delegate = [[KWQBrowserDelegate alloc] initWithListBox: this];
@@ -218,6 +218,21 @@ void QListBox::insertItem(const QListBoxItem *newItem, int _index)
         }
     }
 
+    if (!m_insertingItems) {
+        NSBrowser *browser = (NSBrowser *)getView();
+        [browser loadColumnZero];
+        [browser tile];
+    }
+}
+
+void QListBox::beginBatchInsert()
+{
+    m_insertingItems = true;
+}
+
+void QListBox::endBatchInsert()
+{
+    m_insertingItems = false;
     NSBrowser *browser = (NSBrowser *)getView();
     [browser loadColumnZero];
     [browser tile];

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list