[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:28:59 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 1405011d3a78f429019e32257c55b0bdac641c5e
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Sat Aug 3 05:53:05 2002 +0000
WebCore:
- fixed 3015522 -- crash decoding http://www.haaretz.co.il/
* khtml/misc/decoder.cpp: (Decoder::setEncoding): Put some hacks for
handling Hebrew text encoding inside ifndef APPLE_CHANGES. It's not clear
that these or the equivalent are needed for WebCore (they are related to
the as-yet unimplemented bidirectional text support) and they were making
us crash.
- fixed 2949235 -- checkboxes in wrong place until you scroll away and back
I fixed this once before, then removed that fix in favor of a simpler one.
But the simpler one didn't work, and I didn't test it properly. Now I have
a fix that works without the drawbacks of the original.
* khtml/rendering/render_replaced.cpp: (RenderWidget::layout): Remove the
call to move the widget aside. This does no good because it's only called
if the widget is told it needs to layout, which only happens if it's resized.
* khtml/rendering/render_root.cpp: (RenderRoot::layout): Call a KWQ function
so we can do some work at layout time.
* kwq/KWQKHTMLPartImpl.mm:
(moveWidgetsAside): Added. Function used recursively to move all widgets aside.
(KWQKHTMLPartImpl::layout): Added. Called at layout time; moves all the widgets
aside. They are moved back when print functions are called.
WebCore support for feature where client redirects are treated as if the
page was continuing to load. A big part of this was changing redirection
so that it uses QTimer, allowing us to use more of the original KHTMLPart
code. I added a feature to QTimer that KWQKHTMLPartImpl uses to monitor
what KHTMLPart does with the timer.
* kwq/qt/qobject.h: Changed "slots" definition so that all slots are public (to help
KWQSlot get at them). Added a prefix for the slot and signal strings, so that we can detect
the case where it's trying to connect a slot to another slot. Implement the convenience
version of connect here in the header. Implement blockSignals. Remove setTarget.
Make target mutable. Add new m_signalListHead and m_signalsBlocked.
* kwq/KWQObject.mm:
(QObject::findSignal): Added. Helper function that locates a signal by name.
(QObject::connect): Connects a signal to a slot using the new KWQSignal and KWQSlot.
(QObject::disconnect): Disconnects, similar to the above.
(QObject::QObject): Initialize target, m_signalListHead, and m_signalsBlocked.
(QObject::~QObject): Assert that m_signalListHead is 0.
* khtml/khtml_part.cpp:
(KHTMLPart::init): Move the code that connects the redirection timer out
of APPLE_CHANGES.
(KHTMLPart::~KHTMLPart): Remove the APPLE_CHANGES around the code that
stops the redirection timer.
(KHTMLPart::restoreURL): Remove the APPLE_CHANGES around the code that
stops the redirection timer.
(KHTMLPart::openURL): Move the APPLE_CHANGES so the code that stops the
redirection timer will run.
(KHTMLPart::closeURL): Remove the APPLE_CHANGES around the code that
stops the redirection timer.
(KHTMLPart::scheduleRedirection): Remove most of this function from the
APPLE_CHANGES. We still probably need to revisit the handling of m_bComplete.
* kwq/KWQSignal.h: Added.
* kwq/KWQSignal.mm: Added.
* kwq/KWQSlot.h: Added.
* kwq/KWQSlot.mm: Added.
* WebCore.pbproj/project.pbxproj: Added KWQSignal.h/mm, KWQSlot.h/mm.
* khtml/misc/loader.h: Simplify APPLE_CHANGES ifdefs since all slots are now public.
* force-clean-timestamp: Touch this since header files were changed.
* khtml/ecma/kjs_window.cpp:
(Window::get): Disable the "name" part of this. We can re-enable it if we
need it, but every QObject had a name because of this one piece of code,
and I don't think it was effectively setting the frame name.
(Window::put): Disable the "name" part of this for the same reason.
(History::getValueProperty): Disable the "length" part of this. It was
calling some unimplemented stuff. We can re-enable this and implement
what we need in KWQ then.
* khtml/rendering/render_form.h: Remove RenderTextArea::performAction, because I
changed this one case to use the new connect machinery. We can convert all the other
form items to use the new machinery, and then eliminate performAction altogether.
* khtml/rendering/render_form.cpp:
(RenderSubmitButton::RenderSubmitButton): Remove unneeded setTarget. For the moment,
connect takes care of this, and in the long run we won't need to set the target at all.
(RenderLineEdit::RenderLineEdit): Ditto.
* khtml/rendering/render_frames.h:
* khtml/rendering/render_frames.cpp: Put partLoadingErrorNotify inside ifndef APPLE_CHANGES
because it uses a bunch of Qt stuff that's not used anywhere else, and we never call it.
* kwq/KWQKHTMLPartImpl.h: Remove scheduleRedirection, timerEvent, and m_redirectionTimer,
add redirectionTimerStartedOrStopped and layout.
* kwq/KWQKHTMLPartImpl.mm:
(redirectionTimerMonitor): Added. Small stub that calls redirectionTimerStartedOrStopped.
(KWQKHTMLPartImpl::KWQKHTMLPartImpl): Set up a monitor on the redirection timer.
(KWQKHTMLPartImpl::~KWQKHTMLPartImpl): Remove now-unneeded killTimer call.
(KWQKHTMLPartImpl::jumpToSelection): Simplify by using dynamic_cast instead of render_name().
(KWQKHTMLPartImpl::redirectionTimerStartedOrStopped): Added. Calls bridge to report client
redirect events whenever the redirection timer is started or stopped.
* kwq/qt/qtextedit.h: Define a KWQSignal for textChanged, and a function that calls it.
* kwq/KWQTextEdit.mm: (QTextEdit::QTextEdit): Set up a KWQSignal for textChanged.
* kwq/KWQTextArea.mm: (-[KWQTextArea textDidEndEditing:]): Instead of calling emitAction,
call textChanged, which will emit the signal using the new signal machinery.
* kwq/qt/qtimer.h:
* kwq/KWQTimer.mm:
(+[KWQTimerTarget targetWithQTimer:]): Added. Used to implement QTimer in terms of NSTimer.
(-[KWQTimerTarget timerFired:]): Added. Used to implement QTimer in terms of NSTimer.
(QTimer::QTimer): Added.
(QTimer::isActive): Implemented.
(QTimer::start): Implemented.
(QTimer::stop): Implemented.
(QTimer::setMonitor): Implemented.
(QTimer::fire): Implemented.
* kwq/WebCoreBridge.h: Changed name of gotoAnchor to scrollToAnchor. Added client redirect
methods.
* kwq/WebCoreBridge.mm: (-[WebCoreBridge scrollToAnchor:]): Changed name.
WebKit:
WebKit support for feature where client redirects are treated as if the
page was continuing to load.
* WebCoreSupport.subproj/WebBridge.m:
(-[WebBridge reportClientRedirectTo:delay:fireDate:]): Added. Passes the client
redirect along to the location change handler.
(-[WebBridge reportClientRedirectCancelled]): Passes client redirect cancel along
to the location change handler.
(-[WebBridge dataSourceChanged]): Remove hack related to dummy data source.
(-[WebBridge dataSource]): Remove hack related to dummy data source.
* WebView.subproj/WebLocationChangeHandler.h: Added client redirect methods.
Added class for base implementation of protocol. Updated stale comment.
* WebView.subproj/WebLocationChangeHandler.m: Added. Provides base implementation
of the WebLocationChangeHandler protocol so that clients don't need to implement
all the methods if they are only interested in some of them.
* WebKit.pbproj/project.pbxproj: Added WebLocationChangeHandler.m.
* WebView.subproj/WebFramePrivate.m:
(-[WebFrame _goToItem:withFrameLoadType:]): Call scrollToAnchor under its new name.
* Misc.subproj/WebIconLoader.h:
* Misc.subproj/WebIconLoader.m:
* WebView.subproj/WebControllerPolicyHandler.m:
* WebView.subproj/WebControllerPolicyHandlerPrivate.h:
Replaced __MyCompanyName__ with the actual name of our company.
WebBrowser:
- fixed 2948387 -- stop button flashes to "go" twice while loading citibank.com
* LocationChangeHandler.m:
(-[LocationChangeHandler locationChangeStartedForDataSource:]): Call
_setInstantRedirectPending:NO when it's a load of the main frame.
(-[LocationChangeHandler receivedPageTitle:forDataSource:]): Make this call
through to the load monitor even for frames other than the main one.
(-[LocationChangeHandler serverRedirectTo:forDataSource:]): Make this call
through to the load monitor even for frames other than the main one.
(-[LocationChangeHandler clientRedirectTo:delay:fireDate:forDataSource:]):
Added. Call _setInstantRedirectPending:YES when it's a no-delay redirect of
the main frame.
(-[LocationChangeHandler clientRedirectCancelledForDataSource:]): Added.
Call _setInstantRedirectPending:NO when it's the main frame, and also post
a notification.
* BrowserDocument.h: Added BrowserDocumentClientRedirectCancelledNotification
and _instantRedirectPending instance variable.
* BrowserDocument.m:
(-[BrowserDocument isLoading]): Return YES if _instantRedirectPending.
(-[BrowserDocument _setInstantRedirectPending:]): Set _instantRedirectPending.
* BrowserDocumentPrivate.h: Declare _setInstantRedirectPending.
* BrowserWindowController.h: Renamed frameLoadRedirected to mainFrameRedirected.
* BrowserWindowController.m:
(-[BrowserWindowController windowDidLoad]): Connect the new
BrowserDocumentClientRedirectCancelledNotification to frameLoadPossiblyFinished.
(-[BrowserWindowController mainFrameRedirected]): Renamed from frameLoadRedirected
and removed the parameter since it is called only for the main frame.
(-[BrowserWindowController frameLoadPossiblyFinished:]): Renamed from frameLoadFinished
since a frame load is not necessarily finished when this is called. Also move the work
back in here from respondToFrameLoadFinished to undo my previous attempt at this feature.
* Test/PageLoadTestRunner.m:
(-[PageLoadTestRunner init]): Connect the new
BrowserDocumentClientRedirectCancelledNotification to pageLoadPossiblyDone.
(-[PageLoadTestRunner pageLoadPossiblyDone:]): Renamed from pageLoadDone
since the page load is not necessarily finished when this is called. Also move the work
back in here from respondToPageLoadDone to undo my previous attempt at this feature.
* BrowserNSControlExtras.h:
* BrowserNSControlExtras.m:
* ContextMenuHandler.h:
* ContextMenuHandler.m:
* TitleBarButton.h:
* TitleBarButton.m:
Replaced __MyCompanyName__ with the actual name of our company.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1727 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 55735a0..1fc73f7 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,124 @@
+2002-08-02 Darin Adler <darin at apple.com>
+
+ - fixed 3015522 -- crash decoding http://www.haaretz.co.il/
+
+ * khtml/misc/decoder.cpp: (Decoder::setEncoding): Put some hacks for
+ handling Hebrew text encoding inside ifndef APPLE_CHANGES. It's not clear
+ that these or the equivalent are needed for WebCore (they are related to
+ the as-yet unimplemented bidirectional text support) and they were making
+ us crash.
+
+ - fixed 2949235 -- checkboxes in wrong place until you scroll away and back
+
+ I fixed this once before, then removed that fix in favor of a simpler one.
+ But the simpler one didn't work, and I didn't test it properly. Now I have
+ a fix that works without the drawbacks of the original.
+
+ * khtml/rendering/render_replaced.cpp: (RenderWidget::layout): Remove the
+ call to move the widget aside. This does no good because it's only called
+ if the widget is told it needs to layout, which only happens if it's resized.
+
+ * khtml/rendering/render_root.cpp: (RenderRoot::layout): Call a KWQ function
+ so we can do some work at layout time.
+
+ * kwq/KWQKHTMLPartImpl.mm:
+ (moveWidgetsAside): Added. Function used recursively to move all widgets aside.
+ (KWQKHTMLPartImpl::layout): Added. Called at layout time; moves all the widgets
+ aside. They are moved back when print functions are called.
+
+ WebCore support for feature where client redirects are treated as if the
+ page was continuing to load. A big part of this was changing redirection
+ so that it uses QTimer, allowing us to use more of the original KHTMLPart
+ code. I added a feature to QTimer that KWQKHTMLPartImpl uses to monitor
+ what KHTMLPart does with the timer.
+
+ * kwq/qt/qobject.h: Changed "slots" definition so that all slots are public (to help
+ KWQSlot get at them). Added a prefix for the slot and signal strings, so that we can detect
+ the case where it's trying to connect a slot to another slot. Implement the convenience
+ version of connect here in the header. Implement blockSignals. Remove setTarget.
+ Make target mutable. Add new m_signalListHead and m_signalsBlocked.
+ * kwq/KWQObject.mm:
+ (QObject::findSignal): Added. Helper function that locates a signal by name.
+ (QObject::connect): Connects a signal to a slot using the new KWQSignal and KWQSlot.
+ (QObject::disconnect): Disconnects, similar to the above.
+ (QObject::QObject): Initialize target, m_signalListHead, and m_signalsBlocked.
+ (QObject::~QObject): Assert that m_signalListHead is 0.
+
+ * khtml/khtml_part.cpp:
+ (KHTMLPart::init): Move the code that connects the redirection timer out
+ of APPLE_CHANGES.
+ (KHTMLPart::~KHTMLPart): Remove the APPLE_CHANGES around the code that
+ stops the redirection timer.
+ (KHTMLPart::restoreURL): Remove the APPLE_CHANGES around the code that
+ stops the redirection timer.
+ (KHTMLPart::openURL): Move the APPLE_CHANGES so the code that stops the
+ redirection timer will run.
+ (KHTMLPart::closeURL): Remove the APPLE_CHANGES around the code that
+ stops the redirection timer.
+ (KHTMLPart::scheduleRedirection): Remove most of this function from the
+ APPLE_CHANGES. We still probably need to revisit the handling of m_bComplete.
+
+ * kwq/KWQSignal.h: Added.
+ * kwq/KWQSignal.mm: Added.
+ * kwq/KWQSlot.h: Added.
+ * kwq/KWQSlot.mm: Added.
+ * WebCore.pbproj/project.pbxproj: Added KWQSignal.h/mm, KWQSlot.h/mm.
+
+ * khtml/misc/loader.h: Simplify APPLE_CHANGES ifdefs since all slots are now public.
+
+ * force-clean-timestamp: Touch this since header files were changed.
+
+ * khtml/ecma/kjs_window.cpp:
+ (Window::get): Disable the "name" part of this. We can re-enable it if we
+ need it, but every QObject had a name because of this one piece of code,
+ and I don't think it was effectively setting the frame name.
+ (Window::put): Disable the "name" part of this for the same reason.
+ (History::getValueProperty): Disable the "length" part of this. It was
+ calling some unimplemented stuff. We can re-enable this and implement
+ what we need in KWQ then.
+
+ * khtml/rendering/render_form.h: Remove RenderTextArea::performAction, because I
+ changed this one case to use the new connect machinery. We can convert all the other
+ form items to use the new machinery, and then eliminate performAction altogether.
+ * khtml/rendering/render_form.cpp:
+ (RenderSubmitButton::RenderSubmitButton): Remove unneeded setTarget. For the moment,
+ connect takes care of this, and in the long run we won't need to set the target at all.
+ (RenderLineEdit::RenderLineEdit): Ditto.
+
+ * khtml/rendering/render_frames.h:
+ * khtml/rendering/render_frames.cpp: Put partLoadingErrorNotify inside ifndef APPLE_CHANGES
+ because it uses a bunch of Qt stuff that's not used anywhere else, and we never call it.
+
+ * kwq/KWQKHTMLPartImpl.h: Remove scheduleRedirection, timerEvent, and m_redirectionTimer,
+ add redirectionTimerStartedOrStopped and layout.
+ * kwq/KWQKHTMLPartImpl.mm:
+ (redirectionTimerMonitor): Added. Small stub that calls redirectionTimerStartedOrStopped.
+ (KWQKHTMLPartImpl::KWQKHTMLPartImpl): Set up a monitor on the redirection timer.
+ (KWQKHTMLPartImpl::~KWQKHTMLPartImpl): Remove now-unneeded killTimer call.
+ (KWQKHTMLPartImpl::jumpToSelection): Simplify by using dynamic_cast instead of render_name().
+ (KWQKHTMLPartImpl::redirectionTimerStartedOrStopped): Added. Calls bridge to report client
+ redirect events whenever the redirection timer is started or stopped.
+
+ * kwq/qt/qtextedit.h: Define a KWQSignal for textChanged, and a function that calls it.
+ * kwq/KWQTextEdit.mm: (QTextEdit::QTextEdit): Set up a KWQSignal for textChanged.
+ * kwq/KWQTextArea.mm: (-[KWQTextArea textDidEndEditing:]): Instead of calling emitAction,
+ call textChanged, which will emit the signal using the new signal machinery.
+
+ * kwq/qt/qtimer.h:
+ * kwq/KWQTimer.mm:
+ (+[KWQTimerTarget targetWithQTimer:]): Added. Used to implement QTimer in terms of NSTimer.
+ (-[KWQTimerTarget timerFired:]): Added. Used to implement QTimer in terms of NSTimer.
+ (QTimer::QTimer): Added.
+ (QTimer::isActive): Implemented.
+ (QTimer::start): Implemented.
+ (QTimer::stop): Implemented.
+ (QTimer::setMonitor): Implemented.
+ (QTimer::fire): Implemented.
+
+ * kwq/WebCoreBridge.h: Changed name of gotoAnchor to scrollToAnchor. Added client redirect
+ methods.
+ * kwq/WebCoreBridge.mm: (-[WebCoreBridge scrollToAnchor:]): Changed name.
+
2002-08-02 David Hyatt <hyatt at apple.com>
Lots of form control changes.
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 55735a0..1fc73f7 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,124 @@
+2002-08-02 Darin Adler <darin at apple.com>
+
+ - fixed 3015522 -- crash decoding http://www.haaretz.co.il/
+
+ * khtml/misc/decoder.cpp: (Decoder::setEncoding): Put some hacks for
+ handling Hebrew text encoding inside ifndef APPLE_CHANGES. It's not clear
+ that these or the equivalent are needed for WebCore (they are related to
+ the as-yet unimplemented bidirectional text support) and they were making
+ us crash.
+
+ - fixed 2949235 -- checkboxes in wrong place until you scroll away and back
+
+ I fixed this once before, then removed that fix in favor of a simpler one.
+ But the simpler one didn't work, and I didn't test it properly. Now I have
+ a fix that works without the drawbacks of the original.
+
+ * khtml/rendering/render_replaced.cpp: (RenderWidget::layout): Remove the
+ call to move the widget aside. This does no good because it's only called
+ if the widget is told it needs to layout, which only happens if it's resized.
+
+ * khtml/rendering/render_root.cpp: (RenderRoot::layout): Call a KWQ function
+ so we can do some work at layout time.
+
+ * kwq/KWQKHTMLPartImpl.mm:
+ (moveWidgetsAside): Added. Function used recursively to move all widgets aside.
+ (KWQKHTMLPartImpl::layout): Added. Called at layout time; moves all the widgets
+ aside. They are moved back when print functions are called.
+
+ WebCore support for feature where client redirects are treated as if the
+ page was continuing to load. A big part of this was changing redirection
+ so that it uses QTimer, allowing us to use more of the original KHTMLPart
+ code. I added a feature to QTimer that KWQKHTMLPartImpl uses to monitor
+ what KHTMLPart does with the timer.
+
+ * kwq/qt/qobject.h: Changed "slots" definition so that all slots are public (to help
+ KWQSlot get at them). Added a prefix for the slot and signal strings, so that we can detect
+ the case where it's trying to connect a slot to another slot. Implement the convenience
+ version of connect here in the header. Implement blockSignals. Remove setTarget.
+ Make target mutable. Add new m_signalListHead and m_signalsBlocked.
+ * kwq/KWQObject.mm:
+ (QObject::findSignal): Added. Helper function that locates a signal by name.
+ (QObject::connect): Connects a signal to a slot using the new KWQSignal and KWQSlot.
+ (QObject::disconnect): Disconnects, similar to the above.
+ (QObject::QObject): Initialize target, m_signalListHead, and m_signalsBlocked.
+ (QObject::~QObject): Assert that m_signalListHead is 0.
+
+ * khtml/khtml_part.cpp:
+ (KHTMLPart::init): Move the code that connects the redirection timer out
+ of APPLE_CHANGES.
+ (KHTMLPart::~KHTMLPart): Remove the APPLE_CHANGES around the code that
+ stops the redirection timer.
+ (KHTMLPart::restoreURL): Remove the APPLE_CHANGES around the code that
+ stops the redirection timer.
+ (KHTMLPart::openURL): Move the APPLE_CHANGES so the code that stops the
+ redirection timer will run.
+ (KHTMLPart::closeURL): Remove the APPLE_CHANGES around the code that
+ stops the redirection timer.
+ (KHTMLPart::scheduleRedirection): Remove most of this function from the
+ APPLE_CHANGES. We still probably need to revisit the handling of m_bComplete.
+
+ * kwq/KWQSignal.h: Added.
+ * kwq/KWQSignal.mm: Added.
+ * kwq/KWQSlot.h: Added.
+ * kwq/KWQSlot.mm: Added.
+ * WebCore.pbproj/project.pbxproj: Added KWQSignal.h/mm, KWQSlot.h/mm.
+
+ * khtml/misc/loader.h: Simplify APPLE_CHANGES ifdefs since all slots are now public.
+
+ * force-clean-timestamp: Touch this since header files were changed.
+
+ * khtml/ecma/kjs_window.cpp:
+ (Window::get): Disable the "name" part of this. We can re-enable it if we
+ need it, but every QObject had a name because of this one piece of code,
+ and I don't think it was effectively setting the frame name.
+ (Window::put): Disable the "name" part of this for the same reason.
+ (History::getValueProperty): Disable the "length" part of this. It was
+ calling some unimplemented stuff. We can re-enable this and implement
+ what we need in KWQ then.
+
+ * khtml/rendering/render_form.h: Remove RenderTextArea::performAction, because I
+ changed this one case to use the new connect machinery. We can convert all the other
+ form items to use the new machinery, and then eliminate performAction altogether.
+ * khtml/rendering/render_form.cpp:
+ (RenderSubmitButton::RenderSubmitButton): Remove unneeded setTarget. For the moment,
+ connect takes care of this, and in the long run we won't need to set the target at all.
+ (RenderLineEdit::RenderLineEdit): Ditto.
+
+ * khtml/rendering/render_frames.h:
+ * khtml/rendering/render_frames.cpp: Put partLoadingErrorNotify inside ifndef APPLE_CHANGES
+ because it uses a bunch of Qt stuff that's not used anywhere else, and we never call it.
+
+ * kwq/KWQKHTMLPartImpl.h: Remove scheduleRedirection, timerEvent, and m_redirectionTimer,
+ add redirectionTimerStartedOrStopped and layout.
+ * kwq/KWQKHTMLPartImpl.mm:
+ (redirectionTimerMonitor): Added. Small stub that calls redirectionTimerStartedOrStopped.
+ (KWQKHTMLPartImpl::KWQKHTMLPartImpl): Set up a monitor on the redirection timer.
+ (KWQKHTMLPartImpl::~KWQKHTMLPartImpl): Remove now-unneeded killTimer call.
+ (KWQKHTMLPartImpl::jumpToSelection): Simplify by using dynamic_cast instead of render_name().
+ (KWQKHTMLPartImpl::redirectionTimerStartedOrStopped): Added. Calls bridge to report client
+ redirect events whenever the redirection timer is started or stopped.
+
+ * kwq/qt/qtextedit.h: Define a KWQSignal for textChanged, and a function that calls it.
+ * kwq/KWQTextEdit.mm: (QTextEdit::QTextEdit): Set up a KWQSignal for textChanged.
+ * kwq/KWQTextArea.mm: (-[KWQTextArea textDidEndEditing:]): Instead of calling emitAction,
+ call textChanged, which will emit the signal using the new signal machinery.
+
+ * kwq/qt/qtimer.h:
+ * kwq/KWQTimer.mm:
+ (+[KWQTimerTarget targetWithQTimer:]): Added. Used to implement QTimer in terms of NSTimer.
+ (-[KWQTimerTarget timerFired:]): Added. Used to implement QTimer in terms of NSTimer.
+ (QTimer::QTimer): Added.
+ (QTimer::isActive): Implemented.
+ (QTimer::start): Implemented.
+ (QTimer::stop): Implemented.
+ (QTimer::setMonitor): Implemented.
+ (QTimer::fire): Implemented.
+
+ * kwq/WebCoreBridge.h: Changed name of gotoAnchor to scrollToAnchor. Added client redirect
+ methods.
+ * kwq/WebCoreBridge.mm: (-[WebCoreBridge scrollToAnchor:]): Changed name.
+
2002-08-02 David Hyatt <hyatt at apple.com>
Lots of form control changes.
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 55735a0..1fc73f7 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,124 @@
+2002-08-02 Darin Adler <darin at apple.com>
+
+ - fixed 3015522 -- crash decoding http://www.haaretz.co.il/
+
+ * khtml/misc/decoder.cpp: (Decoder::setEncoding): Put some hacks for
+ handling Hebrew text encoding inside ifndef APPLE_CHANGES. It's not clear
+ that these or the equivalent are needed for WebCore (they are related to
+ the as-yet unimplemented bidirectional text support) and they were making
+ us crash.
+
+ - fixed 2949235 -- checkboxes in wrong place until you scroll away and back
+
+ I fixed this once before, then removed that fix in favor of a simpler one.
+ But the simpler one didn't work, and I didn't test it properly. Now I have
+ a fix that works without the drawbacks of the original.
+
+ * khtml/rendering/render_replaced.cpp: (RenderWidget::layout): Remove the
+ call to move the widget aside. This does no good because it's only called
+ if the widget is told it needs to layout, which only happens if it's resized.
+
+ * khtml/rendering/render_root.cpp: (RenderRoot::layout): Call a KWQ function
+ so we can do some work at layout time.
+
+ * kwq/KWQKHTMLPartImpl.mm:
+ (moveWidgetsAside): Added. Function used recursively to move all widgets aside.
+ (KWQKHTMLPartImpl::layout): Added. Called at layout time; moves all the widgets
+ aside. They are moved back when print functions are called.
+
+ WebCore support for feature where client redirects are treated as if the
+ page was continuing to load. A big part of this was changing redirection
+ so that it uses QTimer, allowing us to use more of the original KHTMLPart
+ code. I added a feature to QTimer that KWQKHTMLPartImpl uses to monitor
+ what KHTMLPart does with the timer.
+
+ * kwq/qt/qobject.h: Changed "slots" definition so that all slots are public (to help
+ KWQSlot get at them). Added a prefix for the slot and signal strings, so that we can detect
+ the case where it's trying to connect a slot to another slot. Implement the convenience
+ version of connect here in the header. Implement blockSignals. Remove setTarget.
+ Make target mutable. Add new m_signalListHead and m_signalsBlocked.
+ * kwq/KWQObject.mm:
+ (QObject::findSignal): Added. Helper function that locates a signal by name.
+ (QObject::connect): Connects a signal to a slot using the new KWQSignal and KWQSlot.
+ (QObject::disconnect): Disconnects, similar to the above.
+ (QObject::QObject): Initialize target, m_signalListHead, and m_signalsBlocked.
+ (QObject::~QObject): Assert that m_signalListHead is 0.
+
+ * khtml/khtml_part.cpp:
+ (KHTMLPart::init): Move the code that connects the redirection timer out
+ of APPLE_CHANGES.
+ (KHTMLPart::~KHTMLPart): Remove the APPLE_CHANGES around the code that
+ stops the redirection timer.
+ (KHTMLPart::restoreURL): Remove the APPLE_CHANGES around the code that
+ stops the redirection timer.
+ (KHTMLPart::openURL): Move the APPLE_CHANGES so the code that stops the
+ redirection timer will run.
+ (KHTMLPart::closeURL): Remove the APPLE_CHANGES around the code that
+ stops the redirection timer.
+ (KHTMLPart::scheduleRedirection): Remove most of this function from the
+ APPLE_CHANGES. We still probably need to revisit the handling of m_bComplete.
+
+ * kwq/KWQSignal.h: Added.
+ * kwq/KWQSignal.mm: Added.
+ * kwq/KWQSlot.h: Added.
+ * kwq/KWQSlot.mm: Added.
+ * WebCore.pbproj/project.pbxproj: Added KWQSignal.h/mm, KWQSlot.h/mm.
+
+ * khtml/misc/loader.h: Simplify APPLE_CHANGES ifdefs since all slots are now public.
+
+ * force-clean-timestamp: Touch this since header files were changed.
+
+ * khtml/ecma/kjs_window.cpp:
+ (Window::get): Disable the "name" part of this. We can re-enable it if we
+ need it, but every QObject had a name because of this one piece of code,
+ and I don't think it was effectively setting the frame name.
+ (Window::put): Disable the "name" part of this for the same reason.
+ (History::getValueProperty): Disable the "length" part of this. It was
+ calling some unimplemented stuff. We can re-enable this and implement
+ what we need in KWQ then.
+
+ * khtml/rendering/render_form.h: Remove RenderTextArea::performAction, because I
+ changed this one case to use the new connect machinery. We can convert all the other
+ form items to use the new machinery, and then eliminate performAction altogether.
+ * khtml/rendering/render_form.cpp:
+ (RenderSubmitButton::RenderSubmitButton): Remove unneeded setTarget. For the moment,
+ connect takes care of this, and in the long run we won't need to set the target at all.
+ (RenderLineEdit::RenderLineEdit): Ditto.
+
+ * khtml/rendering/render_frames.h:
+ * khtml/rendering/render_frames.cpp: Put partLoadingErrorNotify inside ifndef APPLE_CHANGES
+ because it uses a bunch of Qt stuff that's not used anywhere else, and we never call it.
+
+ * kwq/KWQKHTMLPartImpl.h: Remove scheduleRedirection, timerEvent, and m_redirectionTimer,
+ add redirectionTimerStartedOrStopped and layout.
+ * kwq/KWQKHTMLPartImpl.mm:
+ (redirectionTimerMonitor): Added. Small stub that calls redirectionTimerStartedOrStopped.
+ (KWQKHTMLPartImpl::KWQKHTMLPartImpl): Set up a monitor on the redirection timer.
+ (KWQKHTMLPartImpl::~KWQKHTMLPartImpl): Remove now-unneeded killTimer call.
+ (KWQKHTMLPartImpl::jumpToSelection): Simplify by using dynamic_cast instead of render_name().
+ (KWQKHTMLPartImpl::redirectionTimerStartedOrStopped): Added. Calls bridge to report client
+ redirect events whenever the redirection timer is started or stopped.
+
+ * kwq/qt/qtextedit.h: Define a KWQSignal for textChanged, and a function that calls it.
+ * kwq/KWQTextEdit.mm: (QTextEdit::QTextEdit): Set up a KWQSignal for textChanged.
+ * kwq/KWQTextArea.mm: (-[KWQTextArea textDidEndEditing:]): Instead of calling emitAction,
+ call textChanged, which will emit the signal using the new signal machinery.
+
+ * kwq/qt/qtimer.h:
+ * kwq/KWQTimer.mm:
+ (+[KWQTimerTarget targetWithQTimer:]): Added. Used to implement QTimer in terms of NSTimer.
+ (-[KWQTimerTarget timerFired:]): Added. Used to implement QTimer in terms of NSTimer.
+ (QTimer::QTimer): Added.
+ (QTimer::isActive): Implemented.
+ (QTimer::start): Implemented.
+ (QTimer::stop): Implemented.
+ (QTimer::setMonitor): Implemented.
+ (QTimer::fire): Implemented.
+
+ * kwq/WebCoreBridge.h: Changed name of gotoAnchor to scrollToAnchor. Added client redirect
+ methods.
+ * kwq/WebCoreBridge.mm: (-[WebCoreBridge scrollToAnchor:]): Changed name.
+
2002-08-02 David Hyatt <hyatt at apple.com>
Lots of form control changes.
diff --git a/WebCore/WebCore.pbproj/project.pbxproj b/WebCore/WebCore.pbproj/project.pbxproj
index 096fd67..5ce6dea 100644
--- a/WebCore/WebCore.pbproj/project.pbxproj
+++ b/WebCore/WebCore.pbproj/project.pbxproj
@@ -487,6 +487,8 @@
F5B2A52D02E22573018635CB,
F565AE8702ECA583018635CA,
354F248B02EE28590ACA2ACA,
+ F5117BCD02F9FFEF018635CE,
+ F5117BCF02F9FFEF018635CE,
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -713,6 +715,8 @@
F57B0EE102EBC78B018635CA,
F565AE8802ECA583018635CA,
354F248C02EE28590ACA2ACA,
+ F5117BCE02F9FFEF018635CE,
+ F5117BD002F9FFEF018635CE,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -847,6 +851,54 @@
path = ..;
refType = 4;
};
+ F5117BC902F9FFEF018635CE = {
+ isa = PBXFileReference;
+ name = KWQSignal.h;
+ path = kwq/KWQSignal.h;
+ refType = 2;
+ };
+ F5117BCA02F9FFEF018635CE = {
+ isa = PBXFileReference;
+ name = KWQSignal.mm;
+ path = kwq/KWQSignal.mm;
+ refType = 2;
+ };
+ F5117BCB02F9FFEF018635CE = {
+ isa = PBXFileReference;
+ name = KWQSlot.h;
+ path = kwq/KWQSlot.h;
+ refType = 2;
+ };
+ F5117BCC02F9FFEF018635CE = {
+ isa = PBXFileReference;
+ name = KWQSlot.mm;
+ path = kwq/KWQSlot.mm;
+ refType = 2;
+ };
+ F5117BCD02F9FFEF018635CE = {
+ fileRef = F5117BC902F9FFEF018635CE;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5117BCE02F9FFEF018635CE = {
+ fileRef = F5117BCA02F9FFEF018635CE;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5117BCF02F9FFEF018635CE = {
+ fileRef = F5117BCB02F9FFEF018635CE;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ F5117BD002F9FFEF018635CE = {
+ fileRef = F5117BCC02F9FFEF018635CE;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
F523D15002DE4271018635CA = {
children = (
F58784D802DE375901EA4122,
@@ -7242,7 +7294,11 @@
F587851A02DE375901EA4122,
F587869E02DE3B8601EA4122,
F587869F02DE3B8601EA4122,
+ F5117BC902F9FFEF018635CE,
+ F5117BCB02F9FFEF018635CE,
F587851D02DE375901EA4122,
+ F5117BCA02F9FFEF018635CE,
+ F5117BCC02F9FFEF018635CE,
F58786A002DE3B8601EA4122,
F58786A102DE3B8601EA4122,
F58786A202DE3B8601EA4122,
@@ -7283,7 +7339,6 @@
F587852E02DE375901EA4122,
F58786B602DE3B8601EA4122,
F587853002DE375901EA4122,
- F587853A02DE375901EA4122,
F58786B702DE3B8601EA4122,
F58786B802DE3B8601EA4122,
F58786B902DE3B8601EA4122,
@@ -7302,6 +7357,7 @@
F58786BF02DE3B8601EA4122,
F587853902DE375901EA4122,
F58786C002DE3B8601EA4122,
+ F587853A02DE375901EA4122,
F58786C102DE3B8601EA4122,
F58786C202DE3B8601EA4122,
F587853B02DE375901EA4122,
diff --git a/WebCore/force-clean-timestamp b/WebCore/force-clean-timestamp
index fb97c17..cd74cda 100644
--- a/WebCore/force-clean-timestamp
+++ b/WebCore/force-clean-timestamp
@@ -1 +1 @@
-QVector change 7/31 (and Project Builder bug 3005427)
+QObject change 8/1 (and Project Builder bug 3005427)
diff --git a/WebCore/khtml/ecma/kjs_window.cpp b/WebCore/khtml/ecma/kjs_window.cpp
index f2f2c76..00ee4df 100644
--- a/WebCore/khtml/ecma/kjs_window.cpp
+++ b/WebCore/khtml/ecma/kjs_window.cpp
@@ -435,8 +435,10 @@ Value Window::get(ExecState *exec, const UString &p) const
return Value(location());
else
return Undefined();
+#ifndef APPLE_CHANGES
case Name:
return String(m_part->name());
+#endif
case _Navigator:
case ClientInformation:
return Value(new Navigator(exec, m_part));
@@ -807,10 +809,12 @@ void Window::put(ExecState* exec, const UString &propertyName, const Value &valu
if (isSafeScript(exec))
setListener(exec,DOM::EventImpl::UNLOAD_EVENT,value);
return;
+#ifndef APPLE_CHANGES
case Name:
if (isSafeScript(exec))
m_part->setName( value.toString(exec).qstring().local8Bit().data() );
return;
+#endif
default:
break;
}
@@ -1722,6 +1726,7 @@ Value History::get(ExecState *exec, const UString &p) const
Value History::getValueProperty(ExecState *, int token) const
{
switch (token) {
+#ifndef APPLE_CHANGES
case Length:
{
KParts::BrowserExtension *ext = part->browserExtension();
@@ -1739,6 +1744,7 @@ Value History::getValueProperty(ExecState *, int token) const
return Number( length.toUInt() );
}
+#endif
default:
kdWarning() << "Unhandled token in History::getValueProperty : " << token << endl;
return Value();
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index 625f576..101eca6 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -247,10 +247,10 @@ void KHTMLPart::init( KHTMLView *view, GUIProfile prof )
findTextBegin(); //reset find variables
-#ifndef APPLE_CHANGES
connect( &d->m_redirectionTimer, SIGNAL( timeout() ),
this, SLOT( slotRedirect() ) );
+#ifndef APPLE_CHANGES
d->m_dcopobject = new KHTMLPartIface(this);
#endif
@@ -277,9 +277,7 @@ KHTMLPart::~KHTMLPart()
#endif
stopAutoScroll();
-#ifndef APPLE_CHANGES
d->m_redirectionTimer.stop();
-#endif
if (!d->m_bComplete)
closeURL();
@@ -314,9 +312,7 @@ bool KHTMLPart::restoreURL( const KURL &url )
{
kdDebug( 6050 ) << "KHTMLPart::restoreURL " << url.url() << endl;
-#ifndef APPLE_CHANGES
d->m_redirectionTimer.stop();
-#endif
/*
* That's not a good idea as it will call closeURL() on all
@@ -352,14 +348,14 @@ bool KHTMLPart::restoreURL( const KURL &url )
bool KHTMLPart::openURL( const KURL &url )
{
-#ifdef APPLE_CHANGES
- impl->openURL(url);
- return true;
-#else
kdDebug( 6050 ) << "KHTMLPart(" << this << ")::openURL " << url.url() << endl;
d->m_redirectionTimer.stop();
+#ifdef APPLE_CHANGES
+ impl->openURL(url);
+ return true;
+#else
// check to see if this is an "error://" URL. This is caused when an error
// occurs before this part was loaded (e.g. KonqRun), and is passed to
// khtmlpart so that it can display the error.
@@ -555,11 +551,9 @@ bool KHTMLPart::closeURL()
d->m_bPendingChildRedirection = false;
-#ifndef APPLE_CHANGES
// Stop any started redirections as well!! (DA)
if ( d && d->m_redirectionTimer.isActive() )
d->m_redirectionTimer.stop();
-#endif
// null node activated.
emit nodeActivated(Node());
@@ -1503,6 +1497,8 @@ void KHTMLPart::slotFinishedParsing()
checkCompleted();
}
+#ifndef APPLE_CHANGES
+
void KHTMLPart::slotLoaderRequestStarted( khtml::DocLoader* dl, khtml::CachedObject *obj )
{
if ( obj && obj->type() == khtml::CachedObject::Image && d->m_doc && d->m_doc->docLoader() == dl ) {
@@ -1533,8 +1529,6 @@ void KHTMLPart::slotLoaderRequestDone( khtml::DocLoader* dl, khtml::CachedObject
checkCompleted();
}
-#ifndef APPLE_CHANGES
-
void KHTMLPart::slotProgressUpdate()
{
int percent;
@@ -1728,21 +1722,21 @@ KURL KHTMLPart::completeURL( const QString &url )
void KHTMLPart::scheduleRedirection( int delay, const QString &url, bool doLockHistory )
{
-#ifdef APPLE_CHANGES
- impl->scheduleRedirection(delay, url);
-#else
kdDebug(6050) << "KHTMLPart::scheduleRedirection delay=" << delay << " url=" << url << endl;
if( d->m_redirectURL.isEmpty() || delay < d->m_delayRedirect )
{
d->m_delayRedirect = delay;
d->m_redirectURL = url;
d->m_redirectLockHistory = doLockHistory;
+#ifndef APPLE_CHANGES
if ( d->m_bComplete ) {
+#endif
d->m_redirectionTimer.stop();
d->m_redirectionTimer.start( 1000 * d->m_delayRedirect, true );
+#ifndef APPLE_CHANGES
}
+#endif
}
-#endif // APPLE_CHANGES
}
void KHTMLPart::slotRedirect()
diff --git a/WebCore/khtml/misc/decoder.cpp b/WebCore/khtml/misc/decoder.cpp
index b84308c..8c20e75 100644
--- a/WebCore/khtml/misc/decoder.cpp
+++ b/WebCore/khtml/misc/decoder.cpp
@@ -296,15 +296,19 @@ void Decoder::setEncoding(const char *_encoding, bool force)
#endif
if(enc.isNull() || enc.isEmpty())
return;
+#ifndef APPLE_CHANGES
if(enc == "visual") // hebrew visually ordered
enc = "iso8859-8";
+#endif
bool b;
m_codec = KGlobal::charsets()->codecForName(enc, b);
+#ifndef APPLE_CHANGES
if(m_codec->mibEnum() == 11) {
// iso8859-8 (visually ordered)
m_codec = QTextCodec::codecForName("iso8859-8-i");
visualRTL = true;
}
+#endif
if( !b ) // in case the codec didn't exist, we keep the old one (fixes some sites specifying invalid codecs)
m_codec = old;
else
diff --git a/WebCore/khtml/misc/loader.h b/WebCore/khtml/misc/loader.h
index 7b28e69..6dc8e59 100644
--- a/WebCore/khtml/misc/loader.h
+++ b/WebCore/khtml/misc/loader.h
@@ -397,13 +397,11 @@ namespace khtml
void requestDone( khtml::DocLoader* dl, khtml::CachedObject *obj );
void requestFailed( khtml::DocLoader* dl, khtml::CachedObject *obj );
-#ifdef APPLE_CHANGES
- public:
+ protected slots:
void slotFinished( KIO::Job * );
+#ifdef APPLE_CHANGES
void slotData( KIO::Job *, const char *data, int size );
#else
- protected slots:
- void slotFinished( KIO::Job * );
void slotData( KIO::Job *, const QByteArray & );
#endif
diff --git a/WebCore/khtml/rendering/render_form.cpp b/WebCore/khtml/rendering/render_form.cpp
index e30a0b6..d5fdff9 100644
--- a/WebCore/khtml/rendering/render_form.cpp
+++ b/WebCore/khtml/rendering/render_form.cpp
@@ -320,7 +320,7 @@ RenderSubmitButton::RenderSubmitButton(HTMLInputElementImpl *element)
// Need to store a reference to this object and then invoke slotClicked on it.
//p->setAction(&RenderFormElement::slotClicked);
//p->setRenderObject(this);
- p->setTarget(this);
+ //p->setTarget(this);
#endif
}
@@ -496,9 +496,6 @@ RenderLineEdit::RenderLineEdit(HTMLInputElementImpl *element)
}
setQWidget(edit);
-#ifdef APPLE_CHANGES
- edit->setTarget (this);
-#endif
}
#ifdef APPLE_CHANGES
@@ -1275,14 +1272,6 @@ QString RenderTextArea::text()
return txt;
}
-#ifdef APPLE_CHANGES
-void RenderTextArea::performAction(Actions action)
-{
- if (action == ACTION_TEXT_AREA_END_EDITING)
- slotTextChanged();
-}
-#endif /* APPLE_CHANGES */
-
void RenderTextArea::slotTextChanged()
{
element()->m_dirtyvalue = true;
diff --git a/WebCore/khtml/rendering/render_form.h b/WebCore/khtml/rendering/render_form.h
index 8040ce4..6468f27 100644
--- a/WebCore/khtml/rendering/render_form.h
+++ b/WebCore/khtml/rendering/render_form.h
@@ -429,9 +429,6 @@ public:
QString text();
-#ifdef APPLE_CHANGES
- void performAction(QObject::Actions action);
-#endif /* APPLE_CHANGES */
void select();
protected slots:
diff --git a/WebCore/khtml/rendering/render_frames.cpp b/WebCore/khtml/rendering/render_frames.cpp
index 160d80b..4bba89d 100644
--- a/WebCore/khtml/rendering/render_frames.cpp
+++ b/WebCore/khtml/rendering/render_frames.cpp
@@ -535,11 +535,15 @@ void RenderPart::setWidget( QWidget *widget )
slotViewCleared();
}
+#ifndef APPLE_CHANGES
+
bool RenderPart::partLoadingErrorNotify(khtml::ChildFrame *, const KURL& , const QString& )
{
return false;
}
+#endif // APPLE_CHANGES
+
short RenderPart::intrinsicWidth() const
{
return 300;
@@ -757,6 +761,7 @@ void RenderPartObject::close()
RenderPart::close();
}
+#ifndef APPLE_CHANGES
bool RenderPartObject::partLoadingErrorNotify( khtml::ChildFrame *childFrame, const KURL& url, const QString& serviceType )
{
@@ -842,6 +847,8 @@ void RenderPartObject::slotPartLoadingErrorNotify()
}
}
+#endif // APPLE_CHANGES
+
// duplication of RenderFormElement... FIX THIS!
short RenderPartObject::calcReplacedWidth(bool* ieHack) const
{
diff --git a/WebCore/khtml/rendering/render_frames.h b/WebCore/khtml/rendering/render_frames.h
index 77df68b..7d48909 100644
--- a/WebCore/khtml/rendering/render_frames.h
+++ b/WebCore/khtml/rendering/render_frames.h
@@ -97,6 +97,7 @@ public:
virtual void setWidget( QWidget *widget );
+#ifndef APPLE_CHANGES
/**
* Called by KHTMLPart to notify the frame object that loading the
* part was not successfuly. (called either asyncroniously after a
@@ -109,6 +110,7 @@ public:
* and the url was successfully opened.
*/
virtual bool partLoadingErrorNotify( khtml::ChildFrame *childFrame, const KURL& url, const QString& serviceType );
+#endif
virtual short intrinsicWidth() const;
virtual int intrinsicHeight() const;
@@ -151,7 +153,9 @@ public:
virtual short calcReplacedWidth(bool* ieHack=0) const;
virtual int calcReplacedHeight() const;
+#ifndef APPLE_CHANGES
virtual bool partLoadingErrorNotify( khtml::ChildFrame *childFrame, const KURL& url, const QString& serviceType );
+#endif
public slots:
void slotViewCleared();
diff --git a/WebCore/khtml/rendering/render_replaced.cpp b/WebCore/khtml/rendering/render_replaced.cpp
index 65e646e..f3566cb 100644
--- a/WebCore/khtml/rendering/render_replaced.cpp
+++ b/WebCore/khtml/rendering/render_replaced.cpp
@@ -156,7 +156,7 @@ RenderWidget::~RenderWidget()
void RenderWidget::resizeWidget( QWidget *widget, int w, int h )
{
#ifndef APPLE_CHANGES
- // ugly hack to limit the maximum size of the widget (as X11 has problems i
+ // ugly hack to limit the maximum size of the widget (as X11 has problems if it's bigger)
h = QMIN( h, 3072 );
w = QMIN( w, 2000 );
#endif
@@ -187,7 +187,6 @@ void RenderWidget::setQWidget(QWidget *widget)
// if we're already layouted, apply the calculated space to the
// widget immediately
if (layouted()) {
- // ugly hack to limit the maximum size of the widget (as X11 has problems if it's bigger)
resizeWidget( m_widget,
m_width-borderLeft()-borderRight()-paddingLeft()-paddingRight(),
m_height-borderLeft()-borderRight()-paddingLeft()-paddingRight() );
@@ -204,11 +203,6 @@ void RenderWidget::layout( )
KHTMLAssert( !layouted() );
KHTMLAssert( minMaxKnown() );
if ( m_widget ) {
-#ifdef APPLE_CHANGES
- // Since not all widgets will get a print call, it's important to move them away
- // so that they won't linger in an old position left over from a previous print.
- m_widget->move(999999, 0);
-#endif
resizeWidget( m_widget,
m_width-borderLeft()-borderRight()-paddingLeft()-paddingRight(),
m_height-borderLeft()-borderRight()-paddingLeft()-paddingRight() );
diff --git a/WebCore/khtml/rendering/render_root.cpp b/WebCore/khtml/rendering/render_root.cpp
index f80c3d8..fdf437f 100644
--- a/WebCore/khtml/rendering/render_root.cpp
+++ b/WebCore/khtml/rendering/render_root.cpp
@@ -24,6 +24,10 @@
#include "khtmlview.h"
#include <kdebug.h>
+#ifdef APPLE_CHANGES
+#include "khtml_part.h"
+#endif
+
using namespace khtml;
//#define BOX_DEBUG
@@ -101,6 +105,12 @@ void RenderRoot::calcMinMaxWidth()
void RenderRoot::layout()
{
+#ifdef APPLE_CHANGES
+ // Let the KWQKHTMLPartImpl know we are doing a layout.
+ if (m_view && m_view->part())
+ m_view->part()->impl->layout();
+#endif
+
//kdDebug(6040) << "RenderRoot::layout()" << endl;
if (m_printingMode)
m_minWidth = m_width;
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index 1da6344..bd6395d 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -74,9 +74,6 @@ public:
void slotData(NSString *, const char *bytes, int length, bool complete = false);
- void scheduleRedirection(int delay, const QString &url);
- virtual void timerEvent(QTimerEvent *);
-
bool gotoBaseAnchor();
void setTitle(const DOM::DOMString &);
@@ -106,6 +103,10 @@ public:
void jumpToSelection();
void overURL(const QString &url, const QString &target, int modifierState);
+
+ void redirectionTimerStartedOrStopped();
+
+ void layout();
private:
KHTMLPart *part;
@@ -113,8 +114,6 @@ private:
WebCoreBridge *bridge;
- int m_redirectionTimer;
-
friend class KHTMLPart;
};
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index e7c048b..07ed1ed 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -36,6 +36,8 @@
#import <WebCoreBridge.h>
#import <WebCoreViewFactory.h>
+#import <WebFoundation/WebNSURLExtras.h>
+
#import <kwqdebug.h>
#undef _KWQ_TIMING
@@ -43,6 +45,7 @@
using khtml::Decoder;
using khtml::RenderObject;
using khtml::RenderPart;
+using khtml::RenderText;
using khtml::RenderWidget;
void KHTMLPart::onURL(const QString &)
@@ -58,16 +61,20 @@ void KHTMLPart::setStatusBarText(const QString &status)
impl->setStatusBarText(status);
}
+static void redirectionTimerMonitor(void *context)
+{
+ KWQKHTMLPartImpl *impl = static_cast<KWQKHTMLPartImpl *>(context);
+ impl->redirectionTimerStartedOrStopped();
+}
+
KWQKHTMLPartImpl::KWQKHTMLPartImpl(KHTMLPart *p)
- : part(p)
- , d(part->d)
- , m_redirectionTimer(0)
+ : part(p), d(part->d)
{
+ d->m_redirectionTimer.setMonitor(redirectionTimerMonitor, this);
}
KWQKHTMLPartImpl::~KWQKHTMLPartImpl()
{
- killTimer(m_redirectionTimer);
}
bool KWQKHTMLPartImpl::openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs )
@@ -213,26 +220,6 @@ bool KWQKHTMLPartImpl::gotoBaseAnchor()
return false;
}
-// FIXME: Need to remerge this with code in khtml_part.cpp?
-// Specifically, it seems that if we implement QTimer, including
-// some sort of special case to make connect work, we could use
-// KHTMLPart::scheduleRedirection as-is.
-void KWQKHTMLPartImpl::scheduleRedirection(int delay, const QString &url)
-{
- if( d->m_redirectURL.isEmpty() || delay < d->m_delayRedirect )
- {
- d->m_delayRedirect = delay;
- d->m_redirectURL = url;
- killTimer(m_redirectionTimer);
- m_redirectionTimer = startTimer(1000 * d->m_delayRedirect);
- }
-}
-
-void KWQKHTMLPartImpl::timerEvent(QTimerEvent *e)
-{
- part->slotRedirect();
-}
-
void KWQKHTMLPartImpl::urlSelected( const QString &url, int button, int state, const QString &_target, KParts::URLArgs )
{
KURL clickedURL(part->completeURL( url));
@@ -568,22 +555,54 @@ void KWQKHTMLPartImpl::overURL( const QString &url, const QString &target, int m
setStatusBarText(QString::fromNSString([NSString stringWithFormat:format, url.getNSString()]));
}
-
void KWQKHTMLPartImpl::jumpToSelection()
{
- // Assumes that selection will only ever be text nodes. This is currently
+ // Assumes that selection will only ever be text nodes. This is currently
// true, but will it always be so?
- if (d->m_selectionStart != 0){
- khtml::RenderObject *ro = static_cast<khtml::RenderObject *>(d->m_selectionStart.handle()->renderer());
-
- if (strcmp(ro->renderName(), "RenderText") == 0){
+ if (!d->m_selectionStart.isNull()) {
+ RenderText *rt = dynamic_cast<RenderText *>(d->m_selectionStart.handle()->renderer());
+ if (rt) {
int x = 0, y = 0;
- khtml::RenderText *rt = static_cast<khtml::RenderText *>(d->m_selectionStart.handle()->renderer());
rt->posOfChar(d->m_startOffset, x, y);
// The -50 offset is copied from KHTMLPart::findTextNext, which sets the contents position
// after finding a matched text string.
- d->m_view->setContentsPos(x-50, y-50);
+ d->m_view->setContentsPos(x - 50, y - 50);
}
}
}
+void KWQKHTMLPartImpl::redirectionTimerStartedOrStopped()
+{
+ if (d->m_redirectionTimer.isActive()) {
+ [bridge reportClientRedirectTo:[NSURL _web_URLWithString:d->m_redirectURL.getNSString()]
+ delay:d->m_delayRedirect
+ fireDate:[d->m_redirectionTimer.getNSTimer() fireDate]];
+ } else {
+ [bridge reportClientRedirectCancelled];
+ }
+}
+
+static void moveWidgetsAside(RenderObject *object)
+{
+ RenderWidget *renderWidget = dynamic_cast<RenderWidget *>(object);
+ if (renderWidget) {
+ QWidget *widget = renderWidget->widget();
+ if (widget) {
+ widget->move(999999, 0);
+ }
+ }
+
+ for (RenderObject *child = object->firstChild(); child; child = child->nextSibling()) {
+ moveWidgetsAside(child);
+ }
+}
+
+void KWQKHTMLPartImpl::layout()
+{
+ // Since not all widgets will get a print call, it's important to move them away
+ // so that they won't linger in an old position left over from a previous print.
+ DOM::DocumentImpl *doc = part->xmlDocImpl();
+ if (doc && doc->renderer()) {
+ moveWidgetsAside(doc->renderer());
+ }
+}
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.h b/WebCore/kwq/KWQKHTMLPartImpl.h
index 1da6344..bd6395d 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.h
+++ b/WebCore/kwq/KWQKHTMLPartImpl.h
@@ -74,9 +74,6 @@ public:
void slotData(NSString *, const char *bytes, int length, bool complete = false);
- void scheduleRedirection(int delay, const QString &url);
- virtual void timerEvent(QTimerEvent *);
-
bool gotoBaseAnchor();
void setTitle(const DOM::DOMString &);
@@ -106,6 +103,10 @@ public:
void jumpToSelection();
void overURL(const QString &url, const QString &target, int modifierState);
+
+ void redirectionTimerStartedOrStopped();
+
+ void layout();
private:
KHTMLPart *part;
@@ -113,8 +114,6 @@ private:
WebCoreBridge *bridge;
- int m_redirectionTimer;
-
friend class KHTMLPart;
};
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index e7c048b..07ed1ed 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -36,6 +36,8 @@
#import <WebCoreBridge.h>
#import <WebCoreViewFactory.h>
+#import <WebFoundation/WebNSURLExtras.h>
+
#import <kwqdebug.h>
#undef _KWQ_TIMING
@@ -43,6 +45,7 @@
using khtml::Decoder;
using khtml::RenderObject;
using khtml::RenderPart;
+using khtml::RenderText;
using khtml::RenderWidget;
void KHTMLPart::onURL(const QString &)
@@ -58,16 +61,20 @@ void KHTMLPart::setStatusBarText(const QString &status)
impl->setStatusBarText(status);
}
+static void redirectionTimerMonitor(void *context)
+{
+ KWQKHTMLPartImpl *impl = static_cast<KWQKHTMLPartImpl *>(context);
+ impl->redirectionTimerStartedOrStopped();
+}
+
KWQKHTMLPartImpl::KWQKHTMLPartImpl(KHTMLPart *p)
- : part(p)
- , d(part->d)
- , m_redirectionTimer(0)
+ : part(p), d(part->d)
{
+ d->m_redirectionTimer.setMonitor(redirectionTimerMonitor, this);
}
KWQKHTMLPartImpl::~KWQKHTMLPartImpl()
{
- killTimer(m_redirectionTimer);
}
bool KWQKHTMLPartImpl::openURLInFrame( const KURL &url, const KParts::URLArgs &urlArgs )
@@ -213,26 +220,6 @@ bool KWQKHTMLPartImpl::gotoBaseAnchor()
return false;
}
-// FIXME: Need to remerge this with code in khtml_part.cpp?
-// Specifically, it seems that if we implement QTimer, including
-// some sort of special case to make connect work, we could use
-// KHTMLPart::scheduleRedirection as-is.
-void KWQKHTMLPartImpl::scheduleRedirection(int delay, const QString &url)
-{
- if( d->m_redirectURL.isEmpty() || delay < d->m_delayRedirect )
- {
- d->m_delayRedirect = delay;
- d->m_redirectURL = url;
- killTimer(m_redirectionTimer);
- m_redirectionTimer = startTimer(1000 * d->m_delayRedirect);
- }
-}
-
-void KWQKHTMLPartImpl::timerEvent(QTimerEvent *e)
-{
- part->slotRedirect();
-}
-
void KWQKHTMLPartImpl::urlSelected( const QString &url, int button, int state, const QString &_target, KParts::URLArgs )
{
KURL clickedURL(part->completeURL( url));
@@ -568,22 +555,54 @@ void KWQKHTMLPartImpl::overURL( const QString &url, const QString &target, int m
setStatusBarText(QString::fromNSString([NSString stringWithFormat:format, url.getNSString()]));
}
-
void KWQKHTMLPartImpl::jumpToSelection()
{
- // Assumes that selection will only ever be text nodes. This is currently
+ // Assumes that selection will only ever be text nodes. This is currently
// true, but will it always be so?
- if (d->m_selectionStart != 0){
- khtml::RenderObject *ro = static_cast<khtml::RenderObject *>(d->m_selectionStart.handle()->renderer());
-
- if (strcmp(ro->renderName(), "RenderText") == 0){
+ if (!d->m_selectionStart.isNull()) {
+ RenderText *rt = dynamic_cast<RenderText *>(d->m_selectionStart.handle()->renderer());
+ if (rt) {
int x = 0, y = 0;
- khtml::RenderText *rt = static_cast<khtml::RenderText *>(d->m_selectionStart.handle()->renderer());
rt->posOfChar(d->m_startOffset, x, y);
// The -50 offset is copied from KHTMLPart::findTextNext, which sets the contents position
// after finding a matched text string.
- d->m_view->setContentsPos(x-50, y-50);
+ d->m_view->setContentsPos(x - 50, y - 50);
}
}
}
+void KWQKHTMLPartImpl::redirectionTimerStartedOrStopped()
+{
+ if (d->m_redirectionTimer.isActive()) {
+ [bridge reportClientRedirectTo:[NSURL _web_URLWithString:d->m_redirectURL.getNSString()]
+ delay:d->m_delayRedirect
+ fireDate:[d->m_redirectionTimer.getNSTimer() fireDate]];
+ } else {
+ [bridge reportClientRedirectCancelled];
+ }
+}
+
+static void moveWidgetsAside(RenderObject *object)
+{
+ RenderWidget *renderWidget = dynamic_cast<RenderWidget *>(object);
+ if (renderWidget) {
+ QWidget *widget = renderWidget->widget();
+ if (widget) {
+ widget->move(999999, 0);
+ }
+ }
+
+ for (RenderObject *child = object->firstChild(); child; child = child->nextSibling()) {
+ moveWidgetsAside(child);
+ }
+}
+
+void KWQKHTMLPartImpl::layout()
+{
+ // Since not all widgets will get a print call, it's important to move them away
+ // so that they won't linger in an old position left over from a previous print.
+ DOM::DocumentImpl *doc = part->xmlDocImpl();
+ if (doc && doc->renderer()) {
+ moveWidgetsAside(doc->renderer());
+ }
+}
diff --git a/WebCore/kwq/KWQObject.h b/WebCore/kwq/KWQObject.h
index ec1270b..da9a0ea 100644
--- a/WebCore/kwq/KWQObject.h
+++ b/WebCore/kwq/KWQObject.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -34,11 +34,10 @@
#include "qstringlist.h"
#include "qptrlist.h"
-// FIXME: should these macros be in "kwq.h" or other header file?
-#define slots
-#define SLOT(x) #x
+#define slots : public
+#define SLOT(x) "SLOT:" #x
#define signals protected
-#define SIGNAL(x) #x
+#define SIGNAL(x) "SIGNAL:" #x
#define emit
#define Q_OBJECT
#define Q_PROPERTY(text)
@@ -65,8 +64,7 @@ class QImage;
class QVariant;
class KWQGuardedPtrBase;
-
-// class QObject ===============================================================
+class KWQSignal;
class QObject : public Qt {
public:
@@ -90,45 +88,46 @@ public:
ACTION_COMBOBOX_CLICKED = 7
};
- static bool connect(const QObject *, const char *, const QObject *, const char *);
- static bool disconnect( const QObject *, const char *, const QObject *, const char *);
-
- QObject(QObject *parent=0, const char *name=0);
+ QObject(QObject *parent = 0, const char *name = 0);
virtual ~QObject();
- const char *name() const;
- virtual void setName(const char *);
+ static void connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member);
+ static void disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member);
+ void connect(const QObject *sender, const char *signal, const char *member) const
+ { connect(sender, signal, this, member); }
- QVariant property(const char *name) const;
- bool inherits(const char *) const;
- bool connect(const QObject *src, const char *signal, const char *slot) const;
+ bool inherits(const char *className) const;
int startTimer(int);
void killTimer(int);
void killTimers();
- virtual void timerEvent( QTimerEvent * );
-
+ virtual void timerEvent(QTimerEvent *);
+
void installEventFilter(const QObject *);
void removeEventFilter(const QObject *);
bool eventFilter(QObject *o, QEvent *e);
- void blockSignals(bool);
+ void blockSignals(bool b) { m_signalsBlocked = b; }
- virtual void performAction(QObject::Actions action);
- void emitAction(QObject::Actions action);
- void setTarget(QObject *obj);
-
virtual bool event(QEvent *);
-
+
+ void emitAction(Actions action);
+ virtual void performAction(Actions action);
+
private:
// no copying or assignment
QObject(const QObject &);
QObject &operator=(const QObject &);
-
- QObject *target;
- QPtrList<QObject> guardedPtrDummyList;
+ KWQSignal *findSignal(const char *signalName) const;
+
+ mutable QObject *target;
+ QPtrList<QObject> guardedPtrDummyList;
+ mutable KWQSignal *m_signalListHead;
+ bool m_signalsBlocked;
+
friend class KWQGuardedPtrBase;
+ friend class KWQSignal;
};
#endif
diff --git a/WebCore/kwq/KWQObject.mm b/WebCore/kwq/KWQObject.mm
index a6df8cf..2561c12 100644
--- a/WebCore/kwq/KWQObject.mm
+++ b/WebCore/kwq/KWQObject.mm
@@ -24,72 +24,72 @@
*/
#import <qobject.h>
+
#import <qvariant.h>
#import <qguardedptr.h>
-
#import <kwqdebug.h>
+#import <KWQSignal.h>
-bool QObject::connect(const QObject *sender, const char *signal, const QObject *dest, const char *slot)
+KWQSignal *QObject::findSignal(const char *signalName) const
{
- if (sender)
- ((QObject *)sender)->setTarget((QObject *)dest);
- KWQDEBUG ("src = %p, signal = %s, dest = %p, slot = %s\n", sender, signal, dest, slot);
- return FALSE;
+ for (KWQSignal *signal = m_signalListHead; signal; signal = signal->m_next) {
+ if (KWQNamesMatch(signalName, signal->m_name)) {
+ return signal;
+ }
+ }
+ return 0;
}
-bool QObject::connect(const QObject *sender, const char *signal, const char *slot) const
+void QObject::connect(const QObject *sender, const char *signalName, const QObject *receiver, const char *member)
{
- if (sender)
- ((QObject *)sender)->setTarget((QObject *)sender);
- KWQDEBUG ("src = %p, signal = %s, slot = %s\n", sender, signal, slot);
- return false;
-}
-
+ // FIXME: Assert that sender is not NULL rather than doing the if statement.
+ if (!sender)
+ return;
+
+ // FIXME: Do away with this after we change clients to use the KWQSignal scheme.
+ sender->target = const_cast<QObject *>(receiver);
-void QObject::emitAction(QObject::Actions action)
-{
- if (target != nil)
- target->performAction (action);
+ KWQSignal *signal = sender->findSignal(signalName);
+ if (!signal) {
+ // FIXME: ERROR
+ return;
+ }
+ signal->connect(KWQSlot(const_cast<QObject *>(receiver), member));
}
-
-void QObject::performAction(QObject::Actions action)
+void QObject::disconnect(const QObject *sender, const char *signalName, const QObject *receiver, const char *member)
{
- KWQDEBUG ("action = %d\n", action);
+ // FIXME: Assert that sender is not NULL rather than doing the if statement.
+ if (!sender)
+ return;
+
+ KWQSignal *signal = sender->findSignal(signalName);
+ if (!signal) {
+ // FIXME: ERROR
+ return;
+ }
+ signal->disconnect(KWQSlot(const_cast<QObject *>(receiver), member));
}
-bool QObject::disconnect( const QObject *, const char *, const QObject *, const char *)
+void QObject::emitAction(QObject::Actions action)
{
- return false;
+ if (target)
+ target->performAction (action);
}
-void QObject::setTarget (QObject *t)
+void QObject::performAction(QObject::Actions action)
{
- target = t;
}
QObject::QObject(QObject *parent, const char *name)
+ : target(0), m_signalListHead(0), m_signalsBlocked(false)
{
guardedPtrDummyList.append(this);
}
QObject::~QObject()
{
-}
-
-const char *QObject::name() const
-{
- return "";
-}
-
-
-void QObject::setName(const char *)
-{
-}
-
-QVariant QObject::property(const char *name) const
-{
- return QVariant();
+ KWQ_ASSERT(m_signalListHead == 0);
}
@interface KWQTimerCallback : NSObject
@@ -187,11 +187,6 @@ bool QObject::eventFilter(QObject *o, QEvent *e)
return false;
}
-void QObject::blockSignals(bool)
-{
- _logNeverImplemented();
-}
-
bool QObject::event(QEvent *)
{
return false;
@@ -222,5 +217,6 @@ bool QObject::inherits(const char *className) const
if (strcmp(className, "QScrollView") == 0) {
return dynamic_cast<const QScrollView *>(this);
}
+ // FIXME: ERROR here because we don't know the class name.
return false;
}
diff --git a/WebCore/kwq/KWQKHTMLPageCache.h b/WebCore/kwq/KWQSignal.h
similarity index 72%
copy from WebCore/kwq/KWQKHTMLPageCache.h
copy to WebCore/kwq/KWQSignal.h
index 0c47b64..c1a3c7a 100644
--- a/WebCore/kwq/KWQKHTMLPageCache.h
+++ b/WebCore/kwq/KWQSignal.h
@@ -23,27 +23,32 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef KHTML_PAGECACHE_H_
-#define KHTML_PAGECACHE_H_
+#ifndef KWQSIGNAL_H
+#define KWQSIGNAL_H
-#include <qcstring.h>
+#include "KWQSlot.h"
-class QObject;
-
-class KHTMLPageCache
-{
+class KWQSignal {
public:
- static KHTMLPageCache *self() { return 0; }
+ KWQSignal(QObject *, const char *name);
+ ~KWQSignal();
+
+ void connect(const KWQSlot &);
+ void disconnect(const KWQSlot &);
- long createCacheEntry() { return 0; }
- void addData(long, const QByteArray &) { }
- void cancelEntry(long) { }
- void endData(long) { }
+ void call() const; // should be "emit"; can't be due to define in qobject.h
+
+private:
+ // forbid copying and assignment
+ KWQSignal(const KWQSignal &);
+ KWQSignal &operator=(const KWQSignal &);
- bool isValid(long) { return false; }
+ QObject *m_object;
+ KWQSignal *m_next;
+ const char *m_name;
+ KWQSlot m_slot;
- void fetchData(long, QObject *, const char *) { }
- void cancelFetch(QObject *) { }
+ friend class QObject;
};
#endif
diff --git a/WebCore/kwq/WebCoreJavaScript.mm b/WebCore/kwq/KWQSignal.mm
similarity index 62%
copy from WebCore/kwq/WebCoreJavaScript.mm
copy to WebCore/kwq/KWQSignal.mm
index 9d509a4..36c9370 100644
--- a/WebCore/kwq/WebCoreJavaScript.mm
+++ b/WebCore/kwq/KWQSignal.mm
@@ -23,37 +23,50 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import "WebCoreJavaScript.h"
+#import "KWQSignal.h"
-#import <JavaScriptCore/collector.h>
+#import "qobject.h"
-using KJS::Collector;
-
- at implementation WebCoreJavaScript
-
-+ (int)objectCount
+KWQSignal::KWQSignal(QObject *object, const char *name)
+ : m_object(object), m_next(object->m_signalListHead), m_name(name)
{
- return Collector::size();
+ object->m_signalListHead = this;
}
-+ (int)interpreterCount
+KWQSignal::~KWQSignal()
{
- return Collector::numInterpreters();
+ KWQSignal **prev = &m_object->m_signalListHead;
+ KWQSignal *signal;
+ while ((signal = *prev)) {
+ if (signal == this) {
+ *prev = m_next;
+ break;
+ }
+ prev = &signal->m_next;
+ }
}
-+ (int)noGCAllowedObjectCount
+void KWQSignal::connect(const KWQSlot &slot)
{
- return Collector::numGCNotAllowedObjects();
+ if (!m_slot.isEmpty()) {
+ // ERROR
+ return;
+ }
+ m_slot = slot;
}
-+ (int)referencedObjectCount
+void KWQSignal::disconnect(const KWQSlot &slot)
{
- return Collector::numReferencedObjects();
+ if (m_slot != slot) {
+ // ERROR
+ return;
+ }
+ m_slot.clear();
}
-+ (void)garbageCollect
+void KWQSignal::call() const
{
- while (Collector::collect()) { }
+ if (!m_object->m_signalsBlocked) {
+ m_slot.call();
+ }
}
-
- at end
diff --git a/WebCore/kwq/KWQKHTMLPageCache.h b/WebCore/kwq/KWQSlot.h
similarity index 71%
copy from WebCore/kwq/KWQKHTMLPageCache.h
copy to WebCore/kwq/KWQSlot.h
index 0c47b64..64ffa15 100644
--- a/WebCore/kwq/KWQKHTMLPageCache.h
+++ b/WebCore/kwq/KWQSlot.h
@@ -23,27 +23,31 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef KHTML_PAGECACHE_H_
-#define KHTML_PAGECACHE_H_
+#ifndef KWQSLOT_H
+#define KWQSLOT_H
-#include <qcstring.h>
+#import <qguardedptr.h>
-class QObject;
+// Like strcmp, but ignores spaces.
+bool KWQNamesMatch(const char *a, const char *b);
-class KHTMLPageCache
-{
+class KWQSlot {
public:
- static KHTMLPageCache *self() { return 0; }
+ KWQSlot() : m_object(0) { }
+ KWQSlot(QObject *, const char *member);
- long createCacheEntry() { return 0; }
- void addData(long, const QByteArray &) { }
- void cancelEntry(long) { }
- void endData(long) { }
+ bool isEmpty() const { return !m_object; }
+ void clear() { m_object = 0; }
- bool isValid(long) { return false; }
+ void call() const;
- void fetchData(long, QObject *, const char *) { }
- void cancelFetch(QObject *) { }
+ friend bool operator==(const KWQSlot &, const KWQSlot &);
+
+private:
+ QGuardedPtr<QObject> m_object;
+ int m_function;
};
+inline bool operator!=(const KWQSlot &a, const KWQSlot &b) { return !(a == b); }
+
#endif
diff --git a/WebCore/kwq/KWQSlot.mm b/WebCore/kwq/KWQSlot.mm
new file mode 100644
index 0000000..883d77b
--- /dev/null
+++ b/WebCore/kwq/KWQSlot.mm
@@ -0,0 +1,107 @@
+/*
+ * Copyright (C) 2002 Apple Computer, Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE COMPUTER, INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE COMPUTER, INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#import "KWQSlot.h"
+
+#import <kwqdebug.h>
+#import <khtml_part.h>
+#import <render_form.h>
+
+using khtml::RenderTextArea;
+
+enum FunctionNumber {
+ slotRedirect,
+ slotTextChanged
+};
+
+KWQSlot::KWQSlot(QObject *object, const char *member) : m_object(0)
+{
+ if (KWQNamesMatch(member, SLOT(slotRedirect()))) {
+ KWQ_ASSERT(dynamic_cast<KHTMLPart *>(object));
+ m_function = slotRedirect;
+ } else if (KWQNamesMatch(member, SLOT(slotTextChanged()))) {
+ KWQ_ASSERT(dynamic_cast<RenderTextArea *>(object));
+ m_function = slotTextChanged;
+ } else {
+ // ERROR
+ return;
+ }
+ m_object = object;
+}
+
+void KWQSlot::call() const
+{
+ if (!m_object) {
+ return;
+ }
+
+ switch (m_function) {
+ case slotRedirect: {
+ KHTMLPart *part = dynamic_cast<KHTMLPart *>(m_object.pointer());
+ if (part) {
+ part->slotRedirect();
+ }
+ return;
+ }
+ case slotTextChanged: {
+ RenderTextArea *area = dynamic_cast<RenderTextArea *>(m_object.pointer());
+ if (area) {
+ area->slotTextChanged();
+ }
+ return;
+ }
+ }
+ // ERROR
+}
+
+bool operator==(const KWQSlot &a, const KWQSlot &b)
+{
+ return a.m_object == b.m_object && (a.m_object == 0 || a.m_function == b.m_function);
+}
+
+bool KWQNamesMatch(const char *a, const char *b)
+{
+ char ca = *a;
+ char cb = *b;
+
+ for (;;) {
+ while (ca == ' ') {
+ ca = *++a;
+ }
+ while (cb == ' ') {
+ cb = *++b;
+ }
+
+ if (ca != cb) {
+ return false;
+ }
+ if (ca == 0) {
+ return true;
+ }
+
+ ca = *++a;
+ cb = *++b;
+ }
+}
diff --git a/WebCore/kwq/KWQTextArea.mm b/WebCore/kwq/KWQTextArea.mm
index a98ad14..0c77a55 100644
--- a/WebCore/kwq/KWQTextArea.mm
+++ b/WebCore/kwq/KWQTextArea.mm
@@ -25,7 +25,7 @@
#import <KWQTextArea.h>
-#import <qwidget.h>
+#import <qtextedit.h>
/*
This widget is used to implement the <TEXTAREA> element.
@@ -107,8 +107,13 @@ const float LargeNumberForText = 1.0e7;
- (void)textDidEndEditing:(NSNotification *)aNotification
{
- if (widget)
+ if (widget) {
widget->emitAction(QObject::ACTION_TEXT_AREA_END_EDITING);
+ QTextEdit *textEdit = dynamic_cast<QTextEdit *>(widget);
+ if (textEdit) {
+ textEdit->textChanged();
+ }
+ }
}
diff --git a/WebCore/kwq/KWQTextEdit.h b/WebCore/kwq/KWQTextEdit.h
index b8d3732..54d7066 100644
--- a/WebCore/kwq/KWQTextEdit.h
+++ b/WebCore/kwq/KWQTextEdit.h
@@ -28,6 +28,8 @@
#include <qscrollview.h>
+#include <KWQSignal.h>
+
class QTextEdit : public QScrollView
{
public:
@@ -63,6 +65,11 @@ class QTextEdit : public QScrollView
int verticalScrollBarWidth() const;
int horizontalScrollBarHeight() const;
+
+ void textChanged() { m_textChanged.call(); }
+
+ private:
+ KWQSignal m_textChanged;
};
#endif /* QTEXTEDIT_H_ */
diff --git a/WebCore/kwq/KWQTextEdit.mm b/WebCore/kwq/KWQTextEdit.mm
index d7f2706..b38f57e 100644
--- a/WebCore/kwq/KWQTextEdit.mm
+++ b/WebCore/kwq/KWQTextEdit.mm
@@ -28,6 +28,7 @@
#import <KWQTextArea.h>
QTextEdit::QTextEdit(QWidget *parent)
+ : m_textChanged(this, SIGNAL(textChanged()))
{
KWQTextArea *textView = [[KWQTextArea alloc] initWithFrame:NSMakeRect(0,0,0,0) widget:this];
setView(textView);
diff --git a/WebCore/kwq/KWQTimer.h b/WebCore/kwq/KWQTimer.h
index 34be38c..b106291 100644
--- a/WebCore/kwq/KWQTimer.h
+++ b/WebCore/kwq/KWQTimer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,14 +27,35 @@
#define QTIMER_H_
#include <qobject.h>
+#include <KWQSignal.h>
+
+#ifdef __OBJC__
+ at class NSTimer;
+#else
+class NSTimer;
+#endif
class QTimer : public QObject {
public:
- static void singleShot(int, QObject *, const char *);
+ QTimer();
+ ~QTimer() { stop(); }
bool isActive() const;
void start(int msec, bool singleShot = false);
void stop();
+ void fire();
+
+ // This is just a hack used by KWQKHTMLPartImpl. The monitor function
+ // gets called when the timer starts and when it is stopped before firing,
+ // but not when the timer fires.
+ void setMonitor(void (*monitorFunction)(void *context), void *context);
+ NSTimer *getNSTimer() { return m_timer; }
+
+private:
+ NSTimer *m_timer;
+ void (*m_monitorFunction)(void *context);
+ void *m_monitorFunctionContext;
+ KWQSignal m_timeoutSignal;
};
#endif
diff --git a/WebCore/kwq/KWQTimer.mm b/WebCore/kwq/KWQTimer.mm
index 3a520a6..c455312 100644
--- a/WebCore/kwq/KWQTimer.mm
+++ b/WebCore/kwq/KWQTimer.mm
@@ -27,23 +27,82 @@
#import <kwqdebug.h>
-void QTimer::singleShot(int, QObject *, const char *)
+ at interface KWQTimerTarget : NSObject
+{
+ QTimer *timer;
+}
++ (KWQTimerTarget *)targetWithQTimer:(QTimer *)timer;
+- (void)timerFired:(id)userInfo;
+ at end
+
+ at implementation KWQTimerTarget
+
++ (KWQTimerTarget *)targetWithQTimer:(QTimer *)t
+{
+ KWQTimerTarget *target = [[[self alloc] init] autorelease];
+ target->timer = t;
+ return target;
+}
+
+- (void)timerFired:(id)userInfo
+{
+ timer->fire();
+}
+
+ at end
+
+QTimer::QTimer()
+ : m_timer(0), m_monitorFunction(0), m_timeoutSignal(this, SIGNAL(timeout()))
{
- _logNotYetImplemented();
}
bool QTimer::isActive() const
{
- _logNotYetImplemented();
- return false;
+ return m_timer;
}
void QTimer::start(int msec, bool singleShot)
{
- _logNotYetImplemented();
+ stop();
+ m_timer = [[NSTimer scheduledTimerWithTimeInterval:(msec / 1000.0)
+ target:[KWQTimerTarget targetWithQTimer:this]
+ selector:@selector(timerFired:)
+ userInfo:nil
+ repeats:!singleShot] retain];
+
+ if (m_monitorFunction) {
+ m_monitorFunction(m_monitorFunctionContext);
+ }
}
void QTimer::stop()
{
- _logNotYetImplemented();
+ if (m_timer == nil) {
+ return;
+ }
+
+ [m_timer invalidate];
+ [m_timer release];
+ m_timer = 0;
+
+ if (m_monitorFunction) {
+ m_monitorFunction(m_monitorFunctionContext);
+ }
+}
+
+void QTimer::setMonitor(void (*monitorFunction)(void *context), void *context)
+{
+ KWQ_ASSERT(!m_monitorFunction);
+ m_monitorFunction = monitorFunction;
+ m_monitorFunctionContext = context;
+}
+
+void QTimer::fire()
+{
+ m_timeoutSignal.call();
+
+ if (![m_timer isValid]) {
+ [m_timer release];
+ m_timer = 0;
+ }
}
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index 797e76e..f46ecc9 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -88,7 +88,7 @@ typedef khtml::RenderPart KHTMLRenderPart;
- (void)removeFromFrame;
- (void)scrollToBaseAnchor;
-- (void)gotoAnchor: (NSString *)anchor;
+- (void)scrollToAnchor:(NSString *)anchor;
- (void)createKHTMLViewWithNSView:(NSView *)view
width:(int)width height:(int)height
@@ -114,7 +114,7 @@ typedef khtml::RenderPart KHTMLRenderPart;
- (NSDictionary *)elementAtPoint:(NSPoint)point;
-- (BOOL)searchFor: (NSString *)string direction: (BOOL)forward caseSensitive: (BOOL)caseFlag;
+- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag;
- (void)jumpToSelection;
@end
@@ -133,18 +133,18 @@ typedef khtml::RenderPart KHTMLRenderPart;
- (void)loadURL:(NSURL *)URL;
- (void)postWithURL:(NSURL *)URL data:(NSData *)data;
+- (WebCoreBridge *)openNewWindowWithURL:(NSURL *)URL;
- (void)setTitle:(NSString *)title;
- (void)setStatusText:(NSString *)status;
-- (void)setIconURL:(NSURL *)url;
-- (void)setIconURL:(NSURL *)url withType:(NSString *)string;
+- (void)setIconURL:(NSURL *)URL;
+- (void)setIconURL:(NSURL *)URL withType:(NSString *)string;
- (BOOL)createChildFrameNamed:(NSString *)frameName
withURL:(NSURL *)URL renderPart:(KHTMLRenderPart *)renderPart
allowsScrolling:(BOOL)allowsScrolling marginWidth:(int)width marginHeight:(int)height;
-- (WebCoreBridge *)openNewWindowWithURL:(NSURL *)URL;
- (BOOL)areToolbarsVisible;
- (void)setToolbarsVisible:(BOOL)visible;
- (BOOL)isStatusBarVisible;
@@ -158,6 +158,9 @@ typedef khtml::RenderPart KHTMLRenderPart;
- (void)reportError:(WebError *)error;
- (void)objectLoadedFromCache:(NSURL *)URL size:(unsigned)bytes;
+- (void)reportClientRedirectTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date;
+- (void)reportClientRedirectCancelled;
+
- (BOOL)openedByScript;
- (void)setOpenedByScript:(BOOL)openedByScript;
@@ -165,7 +168,7 @@ typedef khtml::RenderPart KHTMLRenderPart;
- (BOOL)modifierTrackingEnabled;
-- (void)addBackForwardItemWithURL: (NSURL *)url anchor: (NSString *)anchor;
+- (void)addBackForwardItemWithURL:(NSURL *)URL anchor:(NSString *)anchor;
@end
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 58e28cc..5f50f2f 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -132,9 +132,9 @@ using namespace khtml;
part->impl->gotoBaseAnchor();
}
-- (void)gotoAnchor: (NSString *)a
+- (void)scrollToAnchor:(NSString *)a
{
- part->gotoAnchor(QString::fromCFString((CFStringRef)a));
+ part->gotoAnchor(QString::fromNSString(a));
}
- (NSString *)selectedText
diff --git a/WebCore/kwq/qt/qobject.h b/WebCore/kwq/qt/qobject.h
index ec1270b..da9a0ea 100644
--- a/WebCore/kwq/qt/qobject.h
+++ b/WebCore/kwq/qt/qobject.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -34,11 +34,10 @@
#include "qstringlist.h"
#include "qptrlist.h"
-// FIXME: should these macros be in "kwq.h" or other header file?
-#define slots
-#define SLOT(x) #x
+#define slots : public
+#define SLOT(x) "SLOT:" #x
#define signals protected
-#define SIGNAL(x) #x
+#define SIGNAL(x) "SIGNAL:" #x
#define emit
#define Q_OBJECT
#define Q_PROPERTY(text)
@@ -65,8 +64,7 @@ class QImage;
class QVariant;
class KWQGuardedPtrBase;
-
-// class QObject ===============================================================
+class KWQSignal;
class QObject : public Qt {
public:
@@ -90,45 +88,46 @@ public:
ACTION_COMBOBOX_CLICKED = 7
};
- static bool connect(const QObject *, const char *, const QObject *, const char *);
- static bool disconnect( const QObject *, const char *, const QObject *, const char *);
-
- QObject(QObject *parent=0, const char *name=0);
+ QObject(QObject *parent = 0, const char *name = 0);
virtual ~QObject();
- const char *name() const;
- virtual void setName(const char *);
+ static void connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member);
+ static void disconnect(const QObject *sender, const char *signal, const QObject *receiver, const char *member);
+ void connect(const QObject *sender, const char *signal, const char *member) const
+ { connect(sender, signal, this, member); }
- QVariant property(const char *name) const;
- bool inherits(const char *) const;
- bool connect(const QObject *src, const char *signal, const char *slot) const;
+ bool inherits(const char *className) const;
int startTimer(int);
void killTimer(int);
void killTimers();
- virtual void timerEvent( QTimerEvent * );
-
+ virtual void timerEvent(QTimerEvent *);
+
void installEventFilter(const QObject *);
void removeEventFilter(const QObject *);
bool eventFilter(QObject *o, QEvent *e);
- void blockSignals(bool);
+ void blockSignals(bool b) { m_signalsBlocked = b; }
- virtual void performAction(QObject::Actions action);
- void emitAction(QObject::Actions action);
- void setTarget(QObject *obj);
-
virtual bool event(QEvent *);
-
+
+ void emitAction(Actions action);
+ virtual void performAction(Actions action);
+
private:
// no copying or assignment
QObject(const QObject &);
QObject &operator=(const QObject &);
-
- QObject *target;
- QPtrList<QObject> guardedPtrDummyList;
+ KWQSignal *findSignal(const char *signalName) const;
+
+ mutable QObject *target;
+ QPtrList<QObject> guardedPtrDummyList;
+ mutable KWQSignal *m_signalListHead;
+ bool m_signalsBlocked;
+
friend class KWQGuardedPtrBase;
+ friend class KWQSignal;
};
#endif
diff --git a/WebCore/kwq/qt/qtextedit.h b/WebCore/kwq/qt/qtextedit.h
index b8d3732..54d7066 100644
--- a/WebCore/kwq/qt/qtextedit.h
+++ b/WebCore/kwq/qt/qtextedit.h
@@ -28,6 +28,8 @@
#include <qscrollview.h>
+#include <KWQSignal.h>
+
class QTextEdit : public QScrollView
{
public:
@@ -63,6 +65,11 @@ class QTextEdit : public QScrollView
int verticalScrollBarWidth() const;
int horizontalScrollBarHeight() const;
+
+ void textChanged() { m_textChanged.call(); }
+
+ private:
+ KWQSignal m_textChanged;
};
#endif /* QTEXTEDIT_H_ */
diff --git a/WebCore/kwq/qt/qtimer.h b/WebCore/kwq/qt/qtimer.h
index 34be38c..b106291 100644
--- a/WebCore/kwq/qt/qtimer.h
+++ b/WebCore/kwq/qt/qtimer.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2001 Apple Computer, Inc. All rights reserved.
+ * Copyright (C) 2001, 2002 Apple Computer, Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -27,14 +27,35 @@
#define QTIMER_H_
#include <qobject.h>
+#include <KWQSignal.h>
+
+#ifdef __OBJC__
+ at class NSTimer;
+#else
+class NSTimer;
+#endif
class QTimer : public QObject {
public:
- static void singleShot(int, QObject *, const char *);
+ QTimer();
+ ~QTimer() { stop(); }
bool isActive() const;
void start(int msec, bool singleShot = false);
void stop();
+ void fire();
+
+ // This is just a hack used by KWQKHTMLPartImpl. The monitor function
+ // gets called when the timer starts and when it is stopped before firing,
+ // but not when the timer fires.
+ void setMonitor(void (*monitorFunction)(void *context), void *context);
+ NSTimer *getNSTimer() { return m_timer; }
+
+private:
+ NSTimer *m_timer;
+ void (*m_monitorFunction)(void *context);
+ void *m_monitorFunctionContext;
+ KWQSignal m_timeoutSignal;
};
#endif
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index d10430d..2fe038d 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,32 @@
+2002-08-02 Darin Adler <darin at apple.com>
+
+ WebKit support for feature where client redirects are treated as if the
+ page was continuing to load.
+
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge reportClientRedirectTo:delay:fireDate:]): Added. Passes the client
+ redirect along to the location change handler.
+ (-[WebBridge reportClientRedirectCancelled]): Passes client redirect cancel along
+ to the location change handler.
+ (-[WebBridge dataSourceChanged]): Remove hack related to dummy data source.
+ (-[WebBridge dataSource]): Remove hack related to dummy data source.
+
+ * WebView.subproj/WebLocationChangeHandler.h: Added client redirect methods.
+ Added class for base implementation of protocol. Updated stale comment.
+ * WebView.subproj/WebLocationChangeHandler.m: Added. Provides base implementation
+ of the WebLocationChangeHandler protocol so that clients don't need to implement
+ all the methods if they are only interested in some of them.
+ * WebKit.pbproj/project.pbxproj: Added WebLocationChangeHandler.m.
+
+ * WebView.subproj/WebFramePrivate.m:
+ (-[WebFrame _goToItem:withFrameLoadType:]): Call scrollToAnchor under its new name.
+
+ * Misc.subproj/WebIconLoader.h:
+ * Misc.subproj/WebIconLoader.m:
+ * WebView.subproj/WebControllerPolicyHandler.m:
+ * WebView.subproj/WebControllerPolicyHandlerPrivate.h:
+ Replaced __MyCompanyName__ with the actual name of our company.
+
2002-08-02 John Sullivan <sullivan at apple.com>
- fixed 3015705 -- Command-up-arrow and -down-arrow should go to
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index d10430d..2fe038d 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,32 @@
+2002-08-02 Darin Adler <darin at apple.com>
+
+ WebKit support for feature where client redirects are treated as if the
+ page was continuing to load.
+
+ * WebCoreSupport.subproj/WebBridge.m:
+ (-[WebBridge reportClientRedirectTo:delay:fireDate:]): Added. Passes the client
+ redirect along to the location change handler.
+ (-[WebBridge reportClientRedirectCancelled]): Passes client redirect cancel along
+ to the location change handler.
+ (-[WebBridge dataSourceChanged]): Remove hack related to dummy data source.
+ (-[WebBridge dataSource]): Remove hack related to dummy data source.
+
+ * WebView.subproj/WebLocationChangeHandler.h: Added client redirect methods.
+ Added class for base implementation of protocol. Updated stale comment.
+ * WebView.subproj/WebLocationChangeHandler.m: Added. Provides base implementation
+ of the WebLocationChangeHandler protocol so that clients don't need to implement
+ all the methods if they are only interested in some of them.
+ * WebKit.pbproj/project.pbxproj: Added WebLocationChangeHandler.m.
+
+ * WebView.subproj/WebFramePrivate.m:
+ (-[WebFrame _goToItem:withFrameLoadType:]): Call scrollToAnchor under its new name.
+
+ * Misc.subproj/WebIconLoader.h:
+ * Misc.subproj/WebIconLoader.m:
+ * WebView.subproj/WebControllerPolicyHandler.m:
+ * WebView.subproj/WebControllerPolicyHandlerPrivate.h:
+ Replaced __MyCompanyName__ with the actual name of our company.
+
2002-08-02 John Sullivan <sullivan at apple.com>
- fixed 3015705 -- Command-up-arrow and -down-arrow should go to
diff --git a/WebKit/Misc.subproj/WebIconLoader.h b/WebKit/Misc.subproj/WebIconLoader.h
index 1151fd4..1b323b4 100644
--- a/WebKit/Misc.subproj/WebIconLoader.h
+++ b/WebKit/Misc.subproj/WebIconLoader.h
@@ -3,7 +3,7 @@
// WebKit
//
// Created by Chris Blumenberg on Thu Jul 18 2002.
-// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
//
#import <Cocoa/Cocoa.h>
diff --git a/WebKit/Misc.subproj/WebIconLoader.m b/WebKit/Misc.subproj/WebIconLoader.m
index 29ffe49..e29db7f 100644
--- a/WebKit/Misc.subproj/WebIconLoader.m
+++ b/WebKit/Misc.subproj/WebIconLoader.m
@@ -3,7 +3,7 @@
// WebKit
//
// Created by Chris Blumenberg on Thu Jul 18 2002.
-// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
//
#import <WebKit/WebIconLoader.h>
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 55bd867..2d8594a 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -189,19 +189,25 @@
WebResourceHandle *handle = [[WebResourceHandle alloc] initWithURL:URL];
WebLoadProgress *loadProgress = [[WebLoadProgress alloc] initWithBytesSoFar:bytes totalToLoad:bytes];
- [[frame controller] _receivedProgress:loadProgress forResourceHandle:handle fromDataSource: [self dataSource] complete:YES];
+ [[frame controller] _receivedProgress:loadProgress forResourceHandle:handle fromDataSource:[self dataSource] complete:YES];
[loadProgress release];
[handle release];
}
-- (void)setFrame: (WebFrame *)webFrame
+- (void)reportClientRedirectTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date
{
- // FIXME: needed temporarily while we still use the dummy data
- // source hack
- if (webFrame == nil) {
- return;
- }
+ [[[frame controller] locationChangeHandler]
+ clientRedirectTo:URL delay:seconds fireDate:date forDataSource:[self dataSource]];
+}
+
+- (void)reportClientRedirectCancelled
+{
+ [[[frame controller] locationChangeHandler]
+ clientRedirectCancelledForDataSource:[self dataSource]];
+}
+- (void)setFrame: (WebFrame *)webFrame
+{
WEBKIT_ASSERT(webFrame != nil);
if (frame == nil) {
@@ -214,15 +220,9 @@
- (void)dataSourceChanged
{
- // FIXME: needed temporarily while we still use the dummy data
- // source hack
- if ([frame dataSource] == nil) {
- [self openURL:nil];
- } else {
- [self openURL:[[self dataSource] redirectedURL] == nil ?
- [[self dataSource] inputURL] :
- [[self dataSource] redirectedURL]];
- }
+ [self openURL:[[self dataSource] redirectedURL] == nil ?
+ [[self dataSource] inputURL] :
+ [[self dataSource] redirectedURL]];
}
- (WebDataSource *)dataSource
@@ -236,7 +236,6 @@
return dataSource;
}
-
- (BOOL)openedByScript
{
WEBKIT_ASSERT(frame != nil);
diff --git a/WebKit/WebKit.pbproj/project.pbxproj b/WebKit/WebKit.pbproj/project.pbxproj
index 84bd78e..fc58d93 100644
--- a/WebKit/WebKit.pbproj/project.pbxproj
+++ b/WebKit/WebKit.pbproj/project.pbxproj
@@ -346,6 +346,7 @@
F649E40702EE0D1901CA2ACD,
354F260102EF441D0ACA2ACA,
35E371B502F0BAC60ACA2ACA,
+ F505C20C02FB4F18018635CE,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -1087,6 +1088,7 @@
F58BAB3A025036CA01C1A526,
F58BAB380250363E01C1A526,
F567433E026B5B7B01A80181,
+ F505C20B02FB4F18018635CE,
F5D538E802441F2601A80181,
F5D538EC02441FDD01A80181,
3944606E020F50ED0ECA1767,
@@ -1211,6 +1213,17 @@
//F52
//F53
//F54
+ F505C20B02FB4F18018635CE = {
+ isa = PBXFileReference;
+ path = WebLocationChangeHandler.m;
+ refType = 4;
+ };
+ F505C20C02FB4F18018635CE = {
+ fileRef = F505C20B02FB4F18018635CE;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
F5065217027F555001C1A526 = {
children = (
F5065218027F557E01C1A526,
diff --git a/WebKit/WebView.subproj/WebControllerPolicyDelegatePrivate.h b/WebKit/WebView.subproj/WebControllerPolicyDelegatePrivate.h
index fe04d55..e3ddc65 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyDelegatePrivate.h
+++ b/WebKit/WebView.subproj/WebControllerPolicyDelegatePrivate.h
@@ -2,8 +2,8 @@
* WebControllerPolicyHandlerPrivate.h
* WebKit
*
- * Created by Christopher Blumenberg on Thu Jul 25 2002.
- * Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+ * Created by Chris Blumenberg on Thu Jul 25 2002.
+ * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
*
*/
diff --git a/WebKit/WebView.subproj/WebControllerPolicyHandler.m b/WebKit/WebView.subproj/WebControllerPolicyHandler.m
index 1d235fe..c3794ac 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyHandler.m
+++ b/WebKit/WebView.subproj/WebControllerPolicyHandler.m
@@ -3,7 +3,7 @@
// WebKit
//
// Created by Christopher Blumenberg on Thu Jul 25 2002.
-// Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+// Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
//
#import <WebKit/WebControllerPolicyHandler.h>
diff --git a/WebKit/WebView.subproj/WebControllerPolicyHandlerDelegate.h b/WebKit/WebView.subproj/WebControllerPolicyHandlerDelegate.h
index fe04d55..e3ddc65 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyHandlerDelegate.h
+++ b/WebKit/WebView.subproj/WebControllerPolicyHandlerDelegate.h
@@ -2,8 +2,8 @@
* WebControllerPolicyHandlerPrivate.h
* WebKit
*
- * Created by Christopher Blumenberg on Thu Jul 25 2002.
- * Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+ * Created by Chris Blumenberg on Thu Jul 25 2002.
+ * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
*
*/
diff --git a/WebKit/WebView.subproj/WebControllerPolicyHandlerPrivate.h b/WebKit/WebView.subproj/WebControllerPolicyHandlerPrivate.h
index fe04d55..e3ddc65 100644
--- a/WebKit/WebView.subproj/WebControllerPolicyHandlerPrivate.h
+++ b/WebKit/WebView.subproj/WebControllerPolicyHandlerPrivate.h
@@ -2,8 +2,8 @@
* WebControllerPolicyHandlerPrivate.h
* WebKit
*
- * Created by Christopher Blumenberg on Thu Jul 25 2002.
- * Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+ * Created by Chris Blumenberg on Thu Jul 25 2002.
+ * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
*
*/
diff --git a/WebKit/WebView.subproj/WebFrameLoadDelegate.h b/WebKit/WebView.subproj/WebFrameLoadDelegate.h
index e82bd71..2313b50 100644
--- a/WebKit/WebView.subproj/WebFrameLoadDelegate.h
+++ b/WebKit/WebView.subproj/WebFrameLoadDelegate.h
@@ -1,6 +1,6 @@
/*
WebLocationChangeHandler.h
- Copyright 2001, Apple, Inc. All rights reserved.
+ Copyright 2001, 2002, Apple, Inc. All rights reserved.
Public header file.
*/
@@ -23,9 +23,10 @@
A location change that results in changing a frame's document will trigger the
following messages, sent in order:
- - (void)locationChangeStarted;
- - (void)locationChangeCommitted; // Only sent for the WebContentPolicyShow policy.
- - (void)locationChangeDone: (WebError *)error;
+ - (void)locationChangeStartedForDataSource:(WebDataSource *)dataSource;
+ - (void)locationChangeCommittedForDataSource:(WebDataSource *)dataSource;
+ // Only sent for the WebContentPolicyShow policy.
+ - (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource;
None of the WebLocationChangeHandler methods should block for any extended period
of time.
@@ -35,16 +36,25 @@
@protocol WebLocationChangeHandler <NSObject>
-- (void)locationChangeStartedForDataSource: (WebDataSource *)dataSource;
+- (void)locationChangeStartedForDataSource:(WebDataSource *)dataSource;
+- (void)locationChangeCommittedForDataSource:(WebDataSource *)dataSource;
+- (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource;
-- (void)locationChangeCommittedForDataSource: (WebDataSource *)dataSource;
+- (void)receivedPageTitle:(NSString *)title forDataSource:(WebDataSource *)dataSource;
+- (void)receivedPageIcon:(NSImage *)image forDataSource:(WebDataSource *)dataSource;
-- (void)locationChangeDone: (WebError *)error forDataSource: (WebDataSource *)dataSource;
+- (void)serverRedirectTo:(NSURL *)URL forDataSource:(WebDataSource *)dataSource;
-- (void)receivedPageTitle: (NSString *)title forDataSource: (WebDataSource *)dataSource;
+- (void)clientRedirectTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date forDataSource:(WebDataSource *)dataSource;
+- (void)clientRedirectCancelledForDataSource:(WebDataSource *)dataSource;
-- (void)receivedPageIcon: (NSImage *)image forDataSource: (WebDataSource *)dataSource;
+ at end
-- (void)serverRedirectTo: (NSURL *)url forDataSource: (WebDataSource *)dataSource;
+// The WebLocationChangeHandler class responds to all WebLocationChangeHandler protocol
+// methods by doing nothing. It's provided for the convenience of clients who only want
+// to implement some of the above methods and ignore others.
+ at interface WebLocationChangeHandler : NSObject <WebLocationChangeHandler>
+{
+}
@end
diff --git a/WebKit/WebView.subproj/WebFramePrivate.m b/WebKit/WebView.subproj/WebFramePrivate.m
index 7473b93..22eff5e 100644
--- a/WebKit/WebView.subproj/WebFramePrivate.m
+++ b/WebKit/WebView.subproj/WebFramePrivate.m
@@ -683,7 +683,7 @@ static const char * const stateNames[6] = {
[backForwardList goBack];
else
[NSException raise:NSInvalidArgumentException format:@"WebFrameLoadType incorrect"];
- [[_private->dataSource _bridge] gotoAnchor: [item anchor]];
+ [[_private->dataSource _bridge] scrollToAnchor: [item anchor]];
}
else {
dataSource = [[WebDataSource alloc] initWithURL:itemURL];
diff --git a/WebKit/WebView.subproj/WebLocationChangeDelegate.h b/WebKit/WebView.subproj/WebLocationChangeDelegate.h
index e82bd71..2313b50 100644
--- a/WebKit/WebView.subproj/WebLocationChangeDelegate.h
+++ b/WebKit/WebView.subproj/WebLocationChangeDelegate.h
@@ -1,6 +1,6 @@
/*
WebLocationChangeHandler.h
- Copyright 2001, Apple, Inc. All rights reserved.
+ Copyright 2001, 2002, Apple, Inc. All rights reserved.
Public header file.
*/
@@ -23,9 +23,10 @@
A location change that results in changing a frame's document will trigger the
following messages, sent in order:
- - (void)locationChangeStarted;
- - (void)locationChangeCommitted; // Only sent for the WebContentPolicyShow policy.
- - (void)locationChangeDone: (WebError *)error;
+ - (void)locationChangeStartedForDataSource:(WebDataSource *)dataSource;
+ - (void)locationChangeCommittedForDataSource:(WebDataSource *)dataSource;
+ // Only sent for the WebContentPolicyShow policy.
+ - (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource;
None of the WebLocationChangeHandler methods should block for any extended period
of time.
@@ -35,16 +36,25 @@
@protocol WebLocationChangeHandler <NSObject>
-- (void)locationChangeStartedForDataSource: (WebDataSource *)dataSource;
+- (void)locationChangeStartedForDataSource:(WebDataSource *)dataSource;
+- (void)locationChangeCommittedForDataSource:(WebDataSource *)dataSource;
+- (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource;
-- (void)locationChangeCommittedForDataSource: (WebDataSource *)dataSource;
+- (void)receivedPageTitle:(NSString *)title forDataSource:(WebDataSource *)dataSource;
+- (void)receivedPageIcon:(NSImage *)image forDataSource:(WebDataSource *)dataSource;
-- (void)locationChangeDone: (WebError *)error forDataSource: (WebDataSource *)dataSource;
+- (void)serverRedirectTo:(NSURL *)URL forDataSource:(WebDataSource *)dataSource;
-- (void)receivedPageTitle: (NSString *)title forDataSource: (WebDataSource *)dataSource;
+- (void)clientRedirectTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date forDataSource:(WebDataSource *)dataSource;
+- (void)clientRedirectCancelledForDataSource:(WebDataSource *)dataSource;
-- (void)receivedPageIcon: (NSImage *)image forDataSource: (WebDataSource *)dataSource;
+ at end
-- (void)serverRedirectTo: (NSURL *)url forDataSource: (WebDataSource *)dataSource;
+// The WebLocationChangeHandler class responds to all WebLocationChangeHandler protocol
+// methods by doing nothing. It's provided for the convenience of clients who only want
+// to implement some of the above methods and ignore others.
+ at interface WebLocationChangeHandler : NSObject <WebLocationChangeHandler>
+{
+}
@end
diff --git a/WebKit/WebView.subproj/WebLocationChangeDelegate.m b/WebKit/WebView.subproj/WebLocationChangeDelegate.m
new file mode 100644
index 0000000..20c597d
--- /dev/null
+++ b/WebKit/WebView.subproj/WebLocationChangeDelegate.m
@@ -0,0 +1,22 @@
+/*
+ WebLocationChangeHandler.m
+ Copyright 2002, Apple, Inc. All rights reserved.
+*/
+
+#import "WebLocationChangeHandler.h"
+
+ at implementation WebLocationChangeHandler
+
+- (void)locationChangeStartedForDataSource:(WebDataSource *)dataSource { }
+- (void)locationChangeCommittedForDataSource:(WebDataSource *)dataSource { }
+- (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource { }
+
+- (void)receivedPageTitle:(NSString *)title forDataSource:(WebDataSource *)dataSource { }
+- (void)receivedPageIcon:(NSImage *)image forDataSource:(WebDataSource *)dataSource { }
+
+- (void)serverRedirectTo:(NSURL *)URL forDataSource:(WebDataSource *)dataSource { }
+
+- (void)clientRedirectTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date forDataSource:(WebDataSource *)dataSource { }
+- (void)clientRedirectCancelledForDataSource:(WebDataSource *)dataSource { }
+
+ at end
diff --git a/WebKit/WebView.subproj/WebLocationChangeHandler.h b/WebKit/WebView.subproj/WebLocationChangeHandler.h
index e82bd71..2313b50 100644
--- a/WebKit/WebView.subproj/WebLocationChangeHandler.h
+++ b/WebKit/WebView.subproj/WebLocationChangeHandler.h
@@ -1,6 +1,6 @@
/*
WebLocationChangeHandler.h
- Copyright 2001, Apple, Inc. All rights reserved.
+ Copyright 2001, 2002, Apple, Inc. All rights reserved.
Public header file.
*/
@@ -23,9 +23,10 @@
A location change that results in changing a frame's document will trigger the
following messages, sent in order:
- - (void)locationChangeStarted;
- - (void)locationChangeCommitted; // Only sent for the WebContentPolicyShow policy.
- - (void)locationChangeDone: (WebError *)error;
+ - (void)locationChangeStartedForDataSource:(WebDataSource *)dataSource;
+ - (void)locationChangeCommittedForDataSource:(WebDataSource *)dataSource;
+ // Only sent for the WebContentPolicyShow policy.
+ - (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource;
None of the WebLocationChangeHandler methods should block for any extended period
of time.
@@ -35,16 +36,25 @@
@protocol WebLocationChangeHandler <NSObject>
-- (void)locationChangeStartedForDataSource: (WebDataSource *)dataSource;
+- (void)locationChangeStartedForDataSource:(WebDataSource *)dataSource;
+- (void)locationChangeCommittedForDataSource:(WebDataSource *)dataSource;
+- (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource;
-- (void)locationChangeCommittedForDataSource: (WebDataSource *)dataSource;
+- (void)receivedPageTitle:(NSString *)title forDataSource:(WebDataSource *)dataSource;
+- (void)receivedPageIcon:(NSImage *)image forDataSource:(WebDataSource *)dataSource;
-- (void)locationChangeDone: (WebError *)error forDataSource: (WebDataSource *)dataSource;
+- (void)serverRedirectTo:(NSURL *)URL forDataSource:(WebDataSource *)dataSource;
-- (void)receivedPageTitle: (NSString *)title forDataSource: (WebDataSource *)dataSource;
+- (void)clientRedirectTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date forDataSource:(WebDataSource *)dataSource;
+- (void)clientRedirectCancelledForDataSource:(WebDataSource *)dataSource;
-- (void)receivedPageIcon: (NSImage *)image forDataSource: (WebDataSource *)dataSource;
+ at end
-- (void)serverRedirectTo: (NSURL *)url forDataSource: (WebDataSource *)dataSource;
+// The WebLocationChangeHandler class responds to all WebLocationChangeHandler protocol
+// methods by doing nothing. It's provided for the convenience of clients who only want
+// to implement some of the above methods and ignore others.
+ at interface WebLocationChangeHandler : NSObject <WebLocationChangeHandler>
+{
+}
@end
diff --git a/WebKit/WebView.subproj/WebLocationChangeHandler.m b/WebKit/WebView.subproj/WebLocationChangeHandler.m
new file mode 100644
index 0000000..20c597d
--- /dev/null
+++ b/WebKit/WebView.subproj/WebLocationChangeHandler.m
@@ -0,0 +1,22 @@
+/*
+ WebLocationChangeHandler.m
+ Copyright 2002, Apple, Inc. All rights reserved.
+*/
+
+#import "WebLocationChangeHandler.h"
+
+ at implementation WebLocationChangeHandler
+
+- (void)locationChangeStartedForDataSource:(WebDataSource *)dataSource { }
+- (void)locationChangeCommittedForDataSource:(WebDataSource *)dataSource { }
+- (void)locationChangeDone:(WebError *)error forDataSource:(WebDataSource *)dataSource { }
+
+- (void)receivedPageTitle:(NSString *)title forDataSource:(WebDataSource *)dataSource { }
+- (void)receivedPageIcon:(NSImage *)image forDataSource:(WebDataSource *)dataSource { }
+
+- (void)serverRedirectTo:(NSURL *)URL forDataSource:(WebDataSource *)dataSource { }
+
+- (void)clientRedirectTo:(NSURL *)URL delay:(NSTimeInterval)seconds fireDate:(NSDate *)date forDataSource:(WebDataSource *)dataSource { }
+- (void)clientRedirectCancelledForDataSource:(WebDataSource *)dataSource { }
+
+ at end
diff --git a/WebKit/WebView.subproj/WebPolicyDelegatePrivate.h b/WebKit/WebView.subproj/WebPolicyDelegatePrivate.h
index fe04d55..e3ddc65 100644
--- a/WebKit/WebView.subproj/WebPolicyDelegatePrivate.h
+++ b/WebKit/WebView.subproj/WebPolicyDelegatePrivate.h
@@ -2,8 +2,8 @@
* WebControllerPolicyHandlerPrivate.h
* WebKit
*
- * Created by Christopher Blumenberg on Thu Jul 25 2002.
- * Copyright (c) 2002 __MyCompanyName__. All rights reserved.
+ * Created by Chris Blumenberg on Thu Jul 25 2002.
+ * Copyright (c) 2002 Apple Computer, Inc. All rights reserved.
*
*/
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list