[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677
darin
darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 06:55:55 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit d6ad6b4c8bef4e6ee17066e96f4ad1d593a06e75
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Wed Oct 30 16:19:10 2002 +0000
WebCore:
- fixed 3086564 -- REGRESSION: meta-refresh to the same page doesn't refresh
The key is to get args.reload passed through to the bridge.
* kwq/WebCoreBridge.h: Add reload parameter to loadURL:.
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::openURL): Pass NO for reload.
(KWQKHTMLPart::openURLRequest): Pass args.reload for reload.
(KWQKHTMLPart::urlSelected): Pass args.reload for reload.
(KWQKHTMLPart::submitForm): Pass args.reload for reload.
- fixed a memory problem with the use of NSBrowser in KWQListBox
- fixed 2863040 -- multiple default items in select list not selected
Switched to use NSTableView instead of NSBrowser. This should also create
a measurable speedup due to other changes to this class.
* kwq/KWQListBox.h: Remove firstItem(), the insertItem() that takes a QListBoxItem
parameter, and deleteItems(). Add _items, _width, and _widthGood. Removed _head.
Removed the QListBoxItem and QListBoxText classes.
* kwq/KWQListBox.mm:
(QListBox::QListBox): Create a KWQListBoxScrollView and put an NSTableView
inside it. Also create an NSMutableArray to hold the items.
(QListBox::~QListBox): Disconnect the table view from the delegate before
releasing it. Also release the items array.
(QListBox::count): Return the array count.
(QListBox::clear): Do a reloadData here instead of loadColumnZero.
(QListBox::setSelectionMode): Update for table view.
(QListBox::insertItem): Update for table view.
(QListBox::insertGroupLabel): Just calls insertItem for now.
(QListBox::endBatchInsert): Update for table view.
(QListBox::setSelected): Update for table view, including support for multiple
selection.
(QListBox::isSelected): Update for table view.
(QListBox::sizeForNumberOfLines): Use the table view cell for width, and
cache it so we don't have to measure all the strings over and over again.
(-[KWQListBoxScrollView setFrameSize:]): Resize the table view column whenever
the entire scroll view is resized.
(-[KWQListBoxTableViewDelegate initWithListBox:]): Store box pointer and
pointer to items array.
(-[KWQListBoxTableViewDelegate numberOfRowsInTableView:]): Return count.
(-[KWQListBoxTableViewDelegate tableView:objectValueForTableColumn:row:]):
Get the data from the items array.
(-[KWQListBoxTableViewDelegate tableViewSelectionDidChange:]): Call both the
selection-changed signal and the clicked signal.
* khtml/rendering/render_form.cpp: (RenderSelect::updateFromElement):
Get rid of the one place here that gets at a list box item by calling a KWQ
function insertGroupLabel instead of making a QListBoxText. Also call
beginBatchInsert() before clear() for a slight additional speed boost.
- fixed 3067572 -- javascript: URLs typed into page address field or
bookmarks don't work in empty window
We needed a document for DOM, so we make a dummy one. This works for an empty
window, and also for a window with non-HTML content.
* kwq/KWQKHTMLPart.h: Added createDummyDocument().
* kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::createDummyDocument): Create an empty
DOM document if there isn't one already.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]): Call the new
createDummyDocument() instead of checking and doing nothing if there is no
document present when this is called.
- other stuff
* kwq/WebCoreBridge.mm: (-[WebCoreBridge DOMDocument]): Removed a stray printf.
* kwq/KWQTextArea.mm: Tweaked code a little.
WebKit:
- fixed 3086564 -- REGRESSION: meta-refresh to the same page doesn't refresh
The key is to respect the new reload: parameter from the bridge.
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge loadURL:reload:]): Don't ever treat a reload as a redirect.
Set the cache policy to WebRequestCachePolicyLoadFromOrigin if it's a reload.
- fixed 3087214 -- REGRESSION: <WebKit/WebKit.h> contains #import of non-existent header
* Misc.subproj/WebKit.h: Removed import of WebControllerSets.h, which is private.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2507 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index f4a9b57..cb3861a 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,78 @@
+2002-10-30 Darin Adler <darin at apple.com>
+
+ - fixed 3086564 -- REGRESSION: meta-refresh to the same page doesn't refresh
+
+ The key is to get args.reload passed through to the bridge.
+
+ * kwq/WebCoreBridge.h: Add reload parameter to loadURL:.
+
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::openURL): Pass NO for reload.
+ (KWQKHTMLPart::openURLRequest): Pass args.reload for reload.
+ (KWQKHTMLPart::urlSelected): Pass args.reload for reload.
+ (KWQKHTMLPart::submitForm): Pass args.reload for reload.
+
+ - fixed a memory problem with the use of NSBrowser in KWQListBox
+ - fixed 2863040 -- multiple default items in select list not selected
+
+ Switched to use NSTableView instead of NSBrowser. This should also create
+ a measurable speedup due to other changes to this class.
+
+ * kwq/KWQListBox.h: Remove firstItem(), the insertItem() that takes a QListBoxItem
+ parameter, and deleteItems(). Add _items, _width, and _widthGood. Removed _head.
+ Removed the QListBoxItem and QListBoxText classes.
+ * kwq/KWQListBox.mm:
+ (QListBox::QListBox): Create a KWQListBoxScrollView and put an NSTableView
+ inside it. Also create an NSMutableArray to hold the items.
+ (QListBox::~QListBox): Disconnect the table view from the delegate before
+ releasing it. Also release the items array.
+ (QListBox::count): Return the array count.
+ (QListBox::clear): Do a reloadData here instead of loadColumnZero.
+ (QListBox::setSelectionMode): Update for table view.
+ (QListBox::insertItem): Update for table view.
+ (QListBox::insertGroupLabel): Just calls insertItem for now.
+ (QListBox::endBatchInsert): Update for table view.
+ (QListBox::setSelected): Update for table view, including support for multiple
+ selection.
+ (QListBox::isSelected): Update for table view.
+ (QListBox::sizeForNumberOfLines): Use the table view cell for width, and
+ cache it so we don't have to measure all the strings over and over again.
+ (-[KWQListBoxScrollView setFrameSize:]): Resize the table view column whenever
+ the entire scroll view is resized.
+ (-[KWQListBoxTableViewDelegate initWithListBox:]): Store box pointer and
+ pointer to items array.
+ (-[KWQListBoxTableViewDelegate numberOfRowsInTableView:]): Return count.
+ (-[KWQListBoxTableViewDelegate tableView:objectValueForTableColumn:row:]):
+ Get the data from the items array.
+ (-[KWQListBoxTableViewDelegate tableViewSelectionDidChange:]): Call both the
+ selection-changed signal and the clicked signal.
+
+ * khtml/rendering/render_form.cpp: (RenderSelect::updateFromElement):
+ Get rid of the one place here that gets at a list box item by calling a KWQ
+ function insertGroupLabel instead of making a QListBoxText. Also call
+ beginBatchInsert() before clear() for a slight additional speed boost.
+
+ - fixed 3067572 -- javascript: URLs typed into page address field or
+ bookmarks don't work in empty window
+
+ We needed a document for DOM, so we make a dummy one. This works for an empty
+ window, and also for a window with non-HTML content.
+
+ * kwq/KWQKHTMLPart.h: Added createDummyDocument().
+ * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::createDummyDocument): Create an empty
+ DOM document if there isn't one already.
+
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]): Call the new
+ createDummyDocument() instead of checking and doing nothing if there is no
+ document present when this is called.
+
+ - other stuff
+
+ * kwq/WebCoreBridge.mm: (-[WebCoreBridge DOMDocument]): Removed a stray printf.
+
+ * kwq/KWQTextArea.mm: Tweaked code a little.
+
2002-10-28 Darin Adler <darin at apple.com>
* khtml/khtml_part.cpp: (KHTMLPart::checkCompleted):
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index f4a9b57..cb3861a 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,78 @@
+2002-10-30 Darin Adler <darin at apple.com>
+
+ - fixed 3086564 -- REGRESSION: meta-refresh to the same page doesn't refresh
+
+ The key is to get args.reload passed through to the bridge.
+
+ * kwq/WebCoreBridge.h: Add reload parameter to loadURL:.
+
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::openURL): Pass NO for reload.
+ (KWQKHTMLPart::openURLRequest): Pass args.reload for reload.
+ (KWQKHTMLPart::urlSelected): Pass args.reload for reload.
+ (KWQKHTMLPart::submitForm): Pass args.reload for reload.
+
+ - fixed a memory problem with the use of NSBrowser in KWQListBox
+ - fixed 2863040 -- multiple default items in select list not selected
+
+ Switched to use NSTableView instead of NSBrowser. This should also create
+ a measurable speedup due to other changes to this class.
+
+ * kwq/KWQListBox.h: Remove firstItem(), the insertItem() that takes a QListBoxItem
+ parameter, and deleteItems(). Add _items, _width, and _widthGood. Removed _head.
+ Removed the QListBoxItem and QListBoxText classes.
+ * kwq/KWQListBox.mm:
+ (QListBox::QListBox): Create a KWQListBoxScrollView and put an NSTableView
+ inside it. Also create an NSMutableArray to hold the items.
+ (QListBox::~QListBox): Disconnect the table view from the delegate before
+ releasing it. Also release the items array.
+ (QListBox::count): Return the array count.
+ (QListBox::clear): Do a reloadData here instead of loadColumnZero.
+ (QListBox::setSelectionMode): Update for table view.
+ (QListBox::insertItem): Update for table view.
+ (QListBox::insertGroupLabel): Just calls insertItem for now.
+ (QListBox::endBatchInsert): Update for table view.
+ (QListBox::setSelected): Update for table view, including support for multiple
+ selection.
+ (QListBox::isSelected): Update for table view.
+ (QListBox::sizeForNumberOfLines): Use the table view cell for width, and
+ cache it so we don't have to measure all the strings over and over again.
+ (-[KWQListBoxScrollView setFrameSize:]): Resize the table view column whenever
+ the entire scroll view is resized.
+ (-[KWQListBoxTableViewDelegate initWithListBox:]): Store box pointer and
+ pointer to items array.
+ (-[KWQListBoxTableViewDelegate numberOfRowsInTableView:]): Return count.
+ (-[KWQListBoxTableViewDelegate tableView:objectValueForTableColumn:row:]):
+ Get the data from the items array.
+ (-[KWQListBoxTableViewDelegate tableViewSelectionDidChange:]): Call both the
+ selection-changed signal and the clicked signal.
+
+ * khtml/rendering/render_form.cpp: (RenderSelect::updateFromElement):
+ Get rid of the one place here that gets at a list box item by calling a KWQ
+ function insertGroupLabel instead of making a QListBoxText. Also call
+ beginBatchInsert() before clear() for a slight additional speed boost.
+
+ - fixed 3067572 -- javascript: URLs typed into page address field or
+ bookmarks don't work in empty window
+
+ We needed a document for DOM, so we make a dummy one. This works for an empty
+ window, and also for a window with non-HTML content.
+
+ * kwq/KWQKHTMLPart.h: Added createDummyDocument().
+ * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::createDummyDocument): Create an empty
+ DOM document if there isn't one already.
+
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]): Call the new
+ createDummyDocument() instead of checking and doing nothing if there is no
+ document present when this is called.
+
+ - other stuff
+
+ * kwq/WebCoreBridge.mm: (-[WebCoreBridge DOMDocument]): Removed a stray printf.
+
+ * kwq/KWQTextArea.mm: Tweaked code a little.
+
2002-10-28 Darin Adler <darin at apple.com>
* khtml/khtml_part.cpp: (KHTMLPart::checkCompleted):
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index f4a9b57..cb3861a 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,78 @@
+2002-10-30 Darin Adler <darin at apple.com>
+
+ - fixed 3086564 -- REGRESSION: meta-refresh to the same page doesn't refresh
+
+ The key is to get args.reload passed through to the bridge.
+
+ * kwq/WebCoreBridge.h: Add reload parameter to loadURL:.
+
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::openURL): Pass NO for reload.
+ (KWQKHTMLPart::openURLRequest): Pass args.reload for reload.
+ (KWQKHTMLPart::urlSelected): Pass args.reload for reload.
+ (KWQKHTMLPart::submitForm): Pass args.reload for reload.
+
+ - fixed a memory problem with the use of NSBrowser in KWQListBox
+ - fixed 2863040 -- multiple default items in select list not selected
+
+ Switched to use NSTableView instead of NSBrowser. This should also create
+ a measurable speedup due to other changes to this class.
+
+ * kwq/KWQListBox.h: Remove firstItem(), the insertItem() that takes a QListBoxItem
+ parameter, and deleteItems(). Add _items, _width, and _widthGood. Removed _head.
+ Removed the QListBoxItem and QListBoxText classes.
+ * kwq/KWQListBox.mm:
+ (QListBox::QListBox): Create a KWQListBoxScrollView and put an NSTableView
+ inside it. Also create an NSMutableArray to hold the items.
+ (QListBox::~QListBox): Disconnect the table view from the delegate before
+ releasing it. Also release the items array.
+ (QListBox::count): Return the array count.
+ (QListBox::clear): Do a reloadData here instead of loadColumnZero.
+ (QListBox::setSelectionMode): Update for table view.
+ (QListBox::insertItem): Update for table view.
+ (QListBox::insertGroupLabel): Just calls insertItem for now.
+ (QListBox::endBatchInsert): Update for table view.
+ (QListBox::setSelected): Update for table view, including support for multiple
+ selection.
+ (QListBox::isSelected): Update for table view.
+ (QListBox::sizeForNumberOfLines): Use the table view cell for width, and
+ cache it so we don't have to measure all the strings over and over again.
+ (-[KWQListBoxScrollView setFrameSize:]): Resize the table view column whenever
+ the entire scroll view is resized.
+ (-[KWQListBoxTableViewDelegate initWithListBox:]): Store box pointer and
+ pointer to items array.
+ (-[KWQListBoxTableViewDelegate numberOfRowsInTableView:]): Return count.
+ (-[KWQListBoxTableViewDelegate tableView:objectValueForTableColumn:row:]):
+ Get the data from the items array.
+ (-[KWQListBoxTableViewDelegate tableViewSelectionDidChange:]): Call both the
+ selection-changed signal and the clicked signal.
+
+ * khtml/rendering/render_form.cpp: (RenderSelect::updateFromElement):
+ Get rid of the one place here that gets at a list box item by calling a KWQ
+ function insertGroupLabel instead of making a QListBoxText. Also call
+ beginBatchInsert() before clear() for a slight additional speed boost.
+
+ - fixed 3067572 -- javascript: URLs typed into page address field or
+ bookmarks don't work in empty window
+
+ We needed a document for DOM, so we make a dummy one. This works for an empty
+ window, and also for a window with non-HTML content.
+
+ * kwq/KWQKHTMLPart.h: Added createDummyDocument().
+ * kwq/KWQKHTMLPart.mm: (KWQKHTMLPart::createDummyDocument): Create an empty
+ DOM document if there isn't one already.
+
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge stringByEvaluatingJavaScriptFromString:]): Call the new
+ createDummyDocument() instead of checking and doing nothing if there is no
+ document present when this is called.
+
+ - other stuff
+
+ * kwq/WebCoreBridge.mm: (-[WebCoreBridge DOMDocument]): Removed a stray printf.
+
+ * kwq/KWQTextArea.mm: Tweaked code a little.
+
2002-10-28 Darin Adler <darin at apple.com>
* khtml/khtml_part.cpp: (KHTMLPart::checkCompleted):
diff --git a/WebCore/khtml/rendering/render_form.cpp b/WebCore/khtml/rendering/render_form.cpp
index 5b35875..49528ed 100644
--- a/WebCore/khtml/rendering/render_form.cpp
+++ b/WebCore/khtml/rendering/render_form.cpp
@@ -805,16 +805,15 @@ void RenderSelect::updateFromElement()
int listIndex;
if(m_useListBox) {
+#if APPLE_CHANGES
+ static_cast<KListBox*>(m_widget)->beginBatchInsert();
+#endif
static_cast<KListBox*>(m_widget)->clear();
}
else
static_cast<KComboBox*>(m_widget)->clear();
-#if APPLE_CHANGES
- if (m_useListBox)
- static_cast<KListBox*>(m_widget)->beginBatchInsert();
-#endif
for (listIndex = 0; listIndex < int(listItems.size()); listIndex++) {
if (listItems[listIndex]->id() == ID_OPTGROUP) {
DOMString text = listItems[listIndex]->getAttribute(ATTR_LABEL);
@@ -822,10 +821,15 @@ void RenderSelect::updateFromElement()
text = "";
if(m_useListBox) {
+#if APPLE_CHANGES
+ static_cast<KListBox*>(m_widget)
+ ->insertGroupLabel(QString(text.implementation()->s, text.implementation()->l), listIndex);
+#else
QListBoxText *item = new QListBoxText(QString(text.implementation()->s, text.implementation()->l));
static_cast<KListBox*>(m_widget)
->insertItem(item, listIndex);
item->setSelectable(false);
+#endif
}
else
static_cast<KComboBox*>(m_widget)
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 55c72af..4381394 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -126,6 +126,8 @@ public:
void forceLayout();
void paint(QPainter *, const QRect &);
+ void createDummyDocument();
+
// Used internally, but need to be public because they are used by non-member functions.
void redirectionTimerStartedOrStopped();
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 91622ae..7bb6cea 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -127,7 +127,10 @@ void KWQKHTMLPart::openURL(const KURL &url)
if (cocoaURL == nil) {
// FIXME: We need to report this error to someone.
} else {
- [_bridge loadURL:cocoaURL];
+ // FIXME: The lack of args here to get the reload flag from
+ // indicates a problem in KHTMLPart::processObjectRequest,
+ // where we are opening the URL before the args are set up.
+ [_bridge loadURL:cocoaURL reload:NO];
}
}
@@ -137,7 +140,7 @@ void KWQKHTMLPart::openURLRequest(const KURL &url, const URLArgs &args)
if (cocoaURL == nil) {
// FIXME: We need to report this error to someone.
} else {
- [bridgeForFrameName(args.frameName) loadURL:cocoaURL];
+ [bridgeForFrameName(args.frameName) loadURL:cocoaURL reload:args.reload];
}
}
@@ -167,7 +170,7 @@ void KWQKHTMLPart::urlSelected(const KURL &url, int button, int state, const URL
return;
}
- [bridgeForFrameName(args.frameName) loadURL:cocoaURL];
+ [bridgeForFrameName(args.frameName) loadURL:cocoaURL reload:args.reload];
}
class KWQPluginPart : public ReadOnlyPart
@@ -209,7 +212,7 @@ ReadOnlyPart *KWQKHTMLPart::createPart(const ChildFrame &child, const KURL &url,
void KWQKHTMLPart::submitForm(const KURL &u, const URLArgs &args)
{
if (!args.doPost()) {
- [bridgeForFrameName(args.frameName) loadURL:u.getNSURL()];
+ [bridgeForFrameName(args.frameName) loadURL:u.getNSURL() reload:args.reload];
} else {
QString contentType = args.contentType();
ASSERT(contentType.startsWith("Content-Type: "));
@@ -511,3 +514,12 @@ bool KWQKHTMLPart::runJavaScriptPrompt(const QString &prompt, const QString &def
result = QString::fromNSString(returnedText);
return ok;
}
+
+void KWQKHTMLPart::createDummyDocument()
+{
+ if (d->m_doc) {
+ return;
+ }
+ d->m_doc = DOMImplementationImpl::instance()->createHTMLDocument(d->m_view);
+ d->m_doc->ref();
+}
diff --git a/WebCore/kwq/KWQListBox.h b/WebCore/kwq/KWQListBox.h
index 8e4dc89..fa431ff 100644
--- a/WebCore/kwq/KWQListBox.h
+++ b/WebCore/kwq/KWQListBox.h
@@ -32,6 +32,12 @@
class QListBoxItem;
+#ifdef __OBJC__
+ at class NSMutableArray;
+#else
+class NSMutableArray;
+#endif
+
class QListBox : public QScrollView {
friend class QListBoxItem;
public:
@@ -44,13 +50,11 @@ public:
uint count() const;
void clear();
- virtual void setSelectionMode(SelectionMode);
-
- QListBoxItem *firstItem() const { return _head; }
+ void setSelectionMode(SelectionMode);
void beginBatchInsert();
void insertItem(const QString &, unsigned index);
- void insertItem(QListBoxItem *, unsigned index);
+ void insertGroupLabel(const QString &, unsigned index);
void endBatchInsert();
void setSelected(int, bool);
bool isSelected(int) const;
@@ -59,35 +63,13 @@ public:
void selectionChanged() { _selectionChanged.call(); }
private:
- void deleteItems();
-
- QListBoxItem *_head;
+ NSMutableArray *_items;
bool _insertingItems;
+ mutable float _width;
+ mutable bool _widthGood;
KWQSignal _clicked;
KWQSignal _selectionChanged;
};
-class QListBoxItem {
-friend class QListBox;
-public:
- QListBoxItem(const QString &text);
-
- void setSelectable(bool) { }
- QListBoxItem *next() const { return _next; }
- QString text() const { return _text; }
-
-private:
- QString _text;
- QListBoxItem *_next;
-
- QListBoxItem(const QListBoxItem &);
- QListBoxItem &operator=(const QListBoxItem &);
-};
-
-class QListBoxText : public QListBoxItem {
-public:
- QListBoxText(const QString &text = QString::null) : QListBoxItem(text) { }
-};
-
#endif
diff --git a/WebCore/kwq/KWQListBox.mm b/WebCore/kwq/KWQListBox.mm
index 480794b..bd3c8f4 100644
--- a/WebCore/kwq/KWQListBox.mm
+++ b/WebCore/kwq/KWQListBox.mm
@@ -27,154 +27,116 @@
#import "KWQAssertions.h"
-// FIXME: We have to switch to NSTableView instead of NSBrowser.
-
-#define BORDER_TOTAL_WIDTH 3
-#define BORDER_TOTAL_HEIGHT 2
-
- at interface NSBrowser (KWQNSBrowserSecrets)
-- (void)_setScrollerSize:(NSControlSize)scrollerSize;
- at end
-
- at interface KWQBrowserDelegate : NSObject
+ at interface KWQListBoxScrollView : NSScrollView
{
- QListBox *box;
}
-- initWithListBox:(QListBox *)b;
@end
- at implementation KWQBrowserDelegate
-
-- initWithListBox:(QListBox *)b
-{
- [super init];
- box = b;
- return self;
-}
-
-- (int)browser:(NSBrowser *)sender numberOfRowsInColumn:(int)column
-{
- return box->count();
-}
-
-- (void)browser:(NSBrowser *)sender willDisplayCell:(id)cell atRow:(int)row column:(int)column
-{
- int count = 0;
- for (QListBoxItem *item = box->firstItem(); item; item = item->next()) {
- if (count == row) {
- [cell setEnabled:!item->text().isEmpty()];
- [cell setLeaf:YES];
- [cell setStringValue:item->text().getNSString()];
- break;
- }
- count++;
- }
-}
-
-- (IBAction)browserSingleClick:(id)browser
+ at interface KWQListBoxTableViewDelegate : NSObject
{
- box->selectionChanged();
- box->clicked();
+ QListBox *_box;
+ NSArray *_items;
}
-
+- initWithListBox:(QListBox *)b items:(NSArray *)items;
@end
QListBox::QListBox(QWidget *parent)
- : QScrollView(parent), _head(0), _insertingItems(false)
+ : QScrollView(parent)
+ , _items([[NSMutableArray alloc] init])
+ , _insertingItems(false)
+ , _widthGood(false)
, _clicked(this, SIGNAL(clicked(QListBoxItem *)))
, _selectionChanged(this, SIGNAL(selectionChanged()))
{
- NSBrowser *browser = [[NSBrowser alloc] init];
- KWQBrowserDelegate *delegate = [[KWQBrowserDelegate alloc] initWithListBox:this];
-
- // FIXME: Need to configure browser's scroll view to use a scroller that
- // has no up/down buttons. Typically the browser is very small and won't
- // have enough space to draw the up/down buttons and the scroll knob.
- [browser setTitled:NO];
- [browser setDelegate:delegate];
- [browser setTarget:delegate];
- [browser setAction:@selector(browserSingleClick:)];
- [browser addColumn];
- [browser setMaxVisibleColumns:1];
- [browser _setScrollerSize:NSSmallControlSize];
+ NSScrollView *scrollView = [[KWQListBoxScrollView alloc] init];
+
+ [scrollView setBorderType:NSBezelBorder];
+ [scrollView setHasVerticalScroller:YES];
+ [[scrollView verticalScroller] setControlSize:NSSmallControlSize];
+
+ NSTableView *tableView = [[NSTableView alloc] init];
+ KWQListBoxTableViewDelegate *delegate = [[KWQListBoxTableViewDelegate alloc] initWithListBox:this items:_items];
+
+ NSTableColumn *column = [[NSTableColumn alloc] initWithIdentifier:nil];
+
+ [column setEditable:NO];
+ [[column dataCell] setFont:[NSFont systemFontOfSize:[NSFont smallSystemFontSize]]];
+
+ [tableView addTableColumn:column];
+
+ [column release];
+
+ [tableView setAllowsMultipleSelection:NO];
+ [tableView setHeaderView:nil];
+ [tableView setIntercellSpacing:NSMakeSize(0, 0)];
+ [tableView setRowHeight:ceil([[column dataCell] cellSize].height)];
+
+ [tableView setDataSource:delegate];
+ [tableView setDelegate:delegate];
+
+ [scrollView setDocumentView:tableView];
+ [scrollView setVerticalLineScroll:[tableView rowHeight]];
+
+ [tableView release];
- setView(browser);
+ setView(scrollView);
- [browser release];
+ [scrollView release];
}
QListBox::~QListBox()
{
- NSBrowser *browser = (NSBrowser *)getView();
- KWQBrowserDelegate *delegate = [browser delegate];
- [browser setDelegate:nil];
+ NSTableView *tableView = [(NSScrollView *)getView() documentView];
+ KWQListBoxTableViewDelegate *delegate = [tableView delegate];
+ [tableView setDelegate:nil];
+ [tableView setDataSource:nil];
[delegate release];
- deleteItems();
+ [_items release];
}
uint QListBox::count() const
{
- int count = 0;
- for (QListBoxItem *item = _head; item; item = item->next()) {
- count++;
- }
- return count;
-}
-
-void QListBox::deleteItems()
-{
- QListBoxItem *next;
- for (QListBoxItem *item = _head; item; item = next) {
- next = item->next();
- delete item;
- }
- _head = 0;
+ return [_items count];
}
void QListBox::clear()
{
- deleteItems();
- NSBrowser *browser = (NSBrowser *)getView();
- [browser loadColumnZero];
+ [_items removeAllObjects];
+ if (!_insertingItems) {
+ NSTableView *tableView = [(NSScrollView *)getView() documentView];
+ [tableView reloadData];
+ }
+ _widthGood = NO;
}
void QListBox::setSelectionMode(SelectionMode mode)
{
- NSBrowser *browser = (NSBrowser *)getView();
- [browser setAllowsMultipleSelection:mode != Single];
+ NSTableView *tableView = [(NSScrollView *)getView() documentView];
+ [tableView setAllowsMultipleSelection:mode != Single];
}
void QListBox::insertItem(const QString &text, unsigned index)
{
- insertItem(new QListBoxItem(text), index);
-}
-
-void QListBox::insertItem(QListBoxItem *item, unsigned index)
-{
- if (!item)
- return;
-
- if (index > count())
- index = count();
-
- if (!_head || index == 0) {
- item->_next = _head;
- _head = item;
+ unsigned c = count();
+ NSString *s = text.getNSString();
+ if (index >= c) {
+ [_items addObject:s];
} else {
- QListBoxItem *i = _head;
- while (i->_next && index > 1) {
- i = i->_next;
- index--;
- }
- item->_next = i->_next;
- i->_next = item;
+ [_items replaceObjectAtIndex:index withObject:s];
}
if (!_insertingItems) {
- NSBrowser *browser = (NSBrowser *)getView();
- [browser loadColumnZero];
- [browser tile];
+ NSTableView *tableView = [(NSScrollView *)getView() documentView];
+ [tableView reloadData];
}
+ _widthGood = NO;
+}
+
+void QListBox::insertGroupLabel(const QString &text, unsigned index)
+{
+ // FIXME: This should be a non-selectable item, I think.
+ // Not sure how to do this in HTML.
+ insertItem(text, index);
}
void QListBox::beginBatchInsert()
@@ -187,47 +149,97 @@ void QListBox::endBatchInsert()
{
ASSERT(_insertingItems);
_insertingItems = false;
- NSBrowser *browser = (NSBrowser *)getView();
- [browser loadColumnZero];
- [browser tile];
+ NSTableView *tableView = [(NSScrollView *)getView() documentView];
+ [tableView reloadData];
}
void QListBox::setSelected(int index, bool selectIt)
{
ASSERT(!_insertingItems);
+ NSTableView *tableView = [(NSScrollView *)getView() documentView];
if (selectIt) {
- NSBrowser *browser = (NSBrowser *)getView();
- [browser selectRow:index inColumn:0];
+ [tableView selectRow:index byExtendingSelection:[tableView allowsMultipleSelection]];
} else {
- // FIXME: What can we do here?
+ [tableView deselectRow:index];
}
}
bool QListBox::isSelected(int index) const
{
ASSERT(!_insertingItems);
- NSBrowser *browser = (NSBrowser *)getView();
- return [[browser loadedCellAtRow:index column:0] state] != NSOffState;
+ NSTableView *tableView = [(NSScrollView *)getView() documentView];
+ return [tableView isRowSelected:index];
}
QSize QListBox::sizeForNumberOfLines(int lines) const
{
- NSBrowser *browser = (NSBrowser *)getView();
- int rows = [[browser delegate] browser:browser numberOfRowsInColumn:0];
- float rowHeight = 0;
- float width = 0;
- for (int row = 0; row < rows; row++) {
- NSSize size = [[browser loadedCellAtRow:row column:0] cellSize];
- width = MAX(width, size.width);
- rowHeight = MAX(rowHeight, size.height);
+ ASSERT(!_insertingItems);
+
+ NSTableView *tableView = [(NSScrollView *)getView() documentView];
+
+ float width;
+ if (_widthGood) {
+ width = _width;
+ } else {
+ width = 0;
+ NSCell *cell = [[[tableView tableColumns] objectAtIndex:0] dataCell];
+ NSEnumerator *e = [_items objectEnumerator];
+ NSString *text;
+ while ((text = [e nextObject])) {
+ [cell setStringValue:text];
+ NSSize size = [cell cellSize];
+ width = MAX(width, size.width);
+ }
+ _width = width;
+ _widthGood = YES;
}
- // FIXME: Add scroll bar width.
- return QSize((int)ceil(width + BORDER_TOTAL_WIDTH
- + [NSScroller scrollerWidthForControlSize:NSSmallControlSize]),
- (int)ceil(rowHeight * lines + BORDER_TOTAL_HEIGHT));
+
+ NSSize contentSize;
+ contentSize.width = ceil(width);
+ contentSize.height = ceil(([tableView rowHeight] + [tableView intercellSpacing].height) * lines);
+ NSSize size = [NSScrollView frameSizeForContentSize:contentSize
+ hasHorizontalScroller:NO hasVerticalScroller:YES borderType:NSBezelBorder];
+
+ return QSize(size);
+}
+
+ at implementation KWQListBoxScrollView
+
+- (void)setFrameSize:(NSSize)size
+{
+ [super setFrameSize:size];
+ NSTableColumn *column = [[[self documentView] tableColumns] objectAtIndex:0];
+ [column setWidth:[self contentSize].width];
+ [column setMinWidth:[self contentSize].width];
+ [column setMaxWidth:[self contentSize].width];
+}
+
+ at end
+
+ at implementation KWQListBoxTableViewDelegate
+
+- initWithListBox:(QListBox *)b items:(NSArray *)i
+{
+ [super init];
+ _box = b;
+ _items = i;
+ return self;
}
-QListBoxItem::QListBoxItem(const QString &text)
- : _text(text), _next(0)
+- (int)numberOfRowsInTableView:(NSTableView *)tableView
{
+ return [_items count];
}
+
+- (id)tableView:(NSTableView *)tableView objectValueForTableColumn:(NSTableColumn *)column row:(int)row
+{
+ return [_items objectAtIndex:row];
+}
+
+- (void)tableViewSelectionDidChange:(NSNotification *)notification
+{
+ _box->selectionChanged();
+ _box->clicked();
+}
+
+ at end
diff --git a/WebCore/kwq/KWQTextArea.mm b/WebCore/kwq/KWQTextArea.mm
index 446e3d7..ce9e050 100644
--- a/WebCore/kwq/KWQTextArea.mm
+++ b/WebCore/kwq/KWQTextArea.mm
@@ -82,7 +82,7 @@ const float LargeNumberForText = 1.0e7;
// If WRAP=OFF we reset many of these attributes.
[style setLineBreakMode:NSLineBreakByWordWrapping];
[style setAlignment:NSLeftTextAlignment];
- attr = [NSDictionary dictionaryWithObjectsAndKeys:style, NSParagraphStyleAttributeName, nil];
+ attr = [NSDictionary dictionaryWithObject:style forKey:NSParagraphStyleAttributeName];
[textView setTypingAttributes:attr];
[textView setAutoresizingMask:NSViewWidthSizable | NSViewHeightSizable];
@@ -155,7 +155,7 @@ const float LargeNumberForText = 1.0e7;
}
[style setAlignment:NSLeftTextAlignment];
- attr = [NSDictionary dictionaryWithObjectsAndKeys:style, NSParagraphStyleAttributeName, nil];
+ attr = [NSDictionary dictionaryWithObject:style forKey:NSParagraphStyleAttributeName];
[textView setMaxSize:NSMakeSize(LargeNumberForText, LargeNumberForText)];
[textView setTypingAttributes:attr];
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 95e41eb..c5fda4b 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -177,7 +177,7 @@ enum FrameBorderStyle {
- (WebCoreBridge *)findFramedNamed:(NSString *)name;
- (WebCoreBridge *)findOrCreateFramedNamed:(NSString *)name;
-- (void)loadURL:(NSURL *)URL;
+- (void)loadURL:(NSURL *)URL reload:(BOOL)reload;
- (void)postWithURL:(NSURL *)URL data:(NSData *)data contentType:(NSString *)contentType;
- (WebCoreBridge *)createWindowWithURL:(NSURL *)URL frameName:(NSString *)name;
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 4c5637b..35c4877 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -546,28 +546,20 @@ using khtml::RenderPart;
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)string
{
- // FIXME: We want to execute it even without a document, no?
- if (!part->kwq->document()) {
- return nil;
- }
+ part->kwq->createDummyDocument();
return part->executeScript(QString::fromNSString(string)).asString().getNSString();
}
- (id<WebDOMDocument>)DOMDocument
{
- DocumentImpl *doc = part->kwq->document();
- printf ("(id<WebDOMDocument>)DOMDocument doc = %p, lastChild = %p\n", doc, doc->lastChild());
- return [WebCoreDOMDocument documentWithImpl:doc];
+ return [WebCoreDOMDocument documentWithImpl:part->kwq->document()];
}
- (void)setSelectionFrom:(id<WebDOMNode>)start startOffset:(int)startOffset to:(id<WebDOMNode>)end endOffset:(int) endOffset
{
- DocumentImpl *doc = part->kwq->document();
-
- doc->setSelection ([(WebCoreDOMNode *)start impl], startOffset, [(WebCoreDOMNode *)end impl], endOffset);
+ part->kwq->document()->setSelection([(WebCoreDOMNode *)start impl], startOffset, [(WebCoreDOMNode *)end impl], endOffset);
}
-
static NSAttributedString *attributedString(DOM::NodeImpl *_startNode, int startOffset, DOM::NodeImpl *endNode, int endOffset)
{
bool hasNewLine = true;
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 778b190..38f70b6 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,17 @@
+2002-10-30 Darin Adler <darin at apple.com>
+
+ - fixed 3086564 -- REGRESSION: meta-refresh to the same page doesn't refresh
+
+ The key is to respect the new reload: parameter from the bridge.
+
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge loadURL:reload:]): Don't ever treat a reload as a redirect.
+ Set the cache policy to WebRequestCachePolicyLoadFromOrigin if it's a reload.
+
+ - fixed 3087214 -- REGRESSION: <WebKit/WebKit.h> contains #import of non-existent header
+
+ * Misc.subproj/WebKit.h: Removed import of WebControllerSets.h, which is private.
+
2002-10-30 Maciej Stachowiak <mjs at apple.com>
Another step towards the policy API change - add request argument
@@ -54,6 +68,7 @@
* Misc.subproj/WebDownloadHandler.m: Removed.
* WebKit.pbproj/project.pbxproj:
+>>>>>>> 1.1051
2002-10-28 Darin Adler <darin at apple.com>
- fixed crash I just introduced
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 778b190..38f70b6 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,17 @@
+2002-10-30 Darin Adler <darin at apple.com>
+
+ - fixed 3086564 -- REGRESSION: meta-refresh to the same page doesn't refresh
+
+ The key is to respect the new reload: parameter from the bridge.
+
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge loadURL:reload:]): Don't ever treat a reload as a redirect.
+ Set the cache policy to WebRequestCachePolicyLoadFromOrigin if it's a reload.
+
+ - fixed 3087214 -- REGRESSION: <WebKit/WebKit.h> contains #import of non-existent header
+
+ * Misc.subproj/WebKit.h: Removed import of WebControllerSets.h, which is private.
+
2002-10-30 Maciej Stachowiak <mjs at apple.com>
Another step towards the policy API change - add request argument
@@ -54,6 +68,7 @@
* Misc.subproj/WebDownloadHandler.m: Removed.
* WebKit.pbproj/project.pbxproj:
+>>>>>>> 1.1051
2002-10-28 Darin Adler <darin at apple.com>
- fixed crash I just introduced
diff --git a/WebKit/Misc.subproj/WebKit.h b/WebKit/Misc.subproj/WebKit.h
index dcd21a6..6162fb6 100644
--- a/WebKit/Misc.subproj/WebKit.h
+++ b/WebKit/Misc.subproj/WebKit.h
@@ -6,7 +6,6 @@
#import <WebKit/WebContextMenuDelegate.h>
#import <WebKit/WebController.h>
#import <WebKit/WebControllerPolicyDelegate.h>
-#import <WebKit/WebControllerSets.h>
#import <WebKit/WebDataSource.h>
#import <WebKit/WebDefaultPolicyDelegate.h>
#import <WebKit/WebDocument.h>
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index f073d9f..e0c7348 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -208,7 +208,7 @@
- (BOOL)isReloading
{
- return ([[[self dataSource] request] requestCachePolicy] == WebRequestCachePolicyLoadFromOrigin);
+ return [[[self dataSource] request] requestCachePolicy] == WebRequestCachePolicyLoadFromOrigin;
}
- (void)reportClientRedirectTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date
@@ -286,11 +286,11 @@
[newDataSource release];
}
-- (void)loadURL:(NSURL *)URL
+- (void)loadURL:(NSURL *)URL reload:(BOOL)reload
{
// FIXME: This logic doesn't exactly match what KHTML does in openURL, so it's possible
// this will screw up in some cases involving framesets.
- if ([[URL _web_URLByRemovingFragment] isEqual:[[self URL] _web_URLByRemovingFragment]]) {
+ if (!reload && [[URL _web_URLByRemovingFragment] isEqual:[[self URL] _web_URLByRemovingFragment]]) {
[self openURL:URL];
WebDataSource *dataSource = [frame dataSource];
@@ -306,14 +306,17 @@
} else {
WebResourceRequest *request = [[WebResourceRequest alloc] initWithURL:URL];
[request setReferrer:[self referrer]];
- [self loadRequest:request];
+ if (reload) {
+ [request setRequestCachePolicy:WebRequestCachePolicyLoadFromOrigin];
+ }
if (_doingInternalLoad) {
// client side redirects shouldn't be treated like user navigations
[frame _setLoadType:WebFrameLoadTypeInternal];
- _doingInternalLoad = NO;
}
+ [self loadRequest:request];
[request release];
}
+ _doingInternalLoad = NO;
}
- (void)postWithURL:(NSURL *)URL data:(NSData *)data contentType:(NSString *)contentType
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list