[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:29:34 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 40554edbb6d834cae141491831f671f666c704e2
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Tue Aug 6 17:13:57 2002 +0000
WebCore:
- fixed 2948805 -- Need WebKit API for larger/smaller font feature
* khtml/khtml_part.cpp:
(KHTMLPart::clear): Head in the direction of using the m_frames and
m_objects arrays, by turning some APPLE_CHANGES code on.
(KHTMLPart::checkCompleted): More code turned on here.
(KHTMLPart::checkEmitLoadEvent): And more code turned on here.
(KHTMLPart::parentPart): Remove APPLE_CHANGES version. We can use the original now.
(KHTMLPart::setZoomFactor): Remove APPLE_CHANGES. We want this function now.
* khtml/khtml_part.h: Remove some APPLE_CHANGES to make xmlDocImpl public.
No longer needed.
* khtml/khtmlpart_p.h: Remove a bunch of APPLE_CHANGES.
* kwq/KWQKHTMLPartImpl.h: Remove parentPart(), add getDocument() and getRenderer().
* kwq/KWQKHTMLPartImpl.mm:
(KWQKHTMLPartImpl::urlSelected): Use parentPart() instead of [bridge parent].
(KWQKHTMLPartImpl::requestFrame): Set up a ChildFrame in the m_frames array.
(KWQKHTMLPartImpl::layout): Use getRenderer().
(KWQKHTMLPartImpl::getDocument): Added.
(KWQKHTMLPartImpl::getRenderer): Added.
* kwq/WebCoreBridge.h: Add [setParent:], remove [parent].
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge setParent:]): Added.
(-[WebCoreBridge reapplyStyles]): Use getDocument().
(-[WebCoreBridge forceLayout]): Use getRenderer().
(-[WebCoreBridge drawRect:withPainter:]): Use getRenderer().
(-[WebCoreBridge copyDOMTree:]): Use getDocument().
(-[WebCoreBridge copyRenderTree:]): Use getRenderer().
(-[WebCoreBridge completeURLForDOMString:]): Use getDocument().
(-[WebCoreBridge elementAtPoint:]): Use getRenderer().
(-[WebCoreBridge setTextSizeMultiplier:]):
* kwq/khtml/khtml_ext.h: Add dummy setEnabled function to make khtml_part.cpp compile.
* kwq/kparts/part.h: Add real parent() and setParent() implementation.
WebKit:
* WebCoreSupport.subproj/WebBridge.m: (-[WebBridge dataSourceChanged]): Call setParent:.
* WebView.subproj/WebControllerPrivate.m:
(-[WebControllerPrivate init]): Initialize the text size multiplier to 1.
* WebView.subproj/WebDataSource.h: Removed [redirectedURL], deprecated [inputURL], added [URL].
* WebView.subproj/WebDataSource.m:
(-[WebDataSource URL]): Added. Returns current URL, without requiring separate logic for the
redirected and not-yet-redirected cases.
* WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadIcon]): Use [WebDataSource URL].
* WebView.subproj/WebDefaultContextMenuHandler.m:
(-[WebDefaultContextMenuHandler openFrameInNewWindow:]): Use [WebDataSource URL].
WebBrowser:
* BrowserDocument.m:
(-[BrowserDocument currentURL]): Use [WebDataSource URL].
(-[BrowserDocument provisionalURL]): Use [WebDataSource URL].
* BrowserWebController.m:
(-[BrowserWebController contentPolicyForMIMEType:dataSource:]): Use [WebDataSource URL].
* DownloadMonitor.m:
(-[DownloadMonitor receivedProgress:forResourceHandle:fromDataSource:complete:]): Use [WebDataSource URL].
* FrameProgressEntry.m: (-[FrameProgressEntry URL]): Use [WebDataSource URL].
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@1749 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index e2b8c0d..ec9b396 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,38 @@
+2002-08-06 Darin Adler <darin at apple.com>
+
+ - fixed 2948805 -- Need WebKit API for larger/smaller font feature
+
+ * khtml/khtml_part.cpp:
+ (KHTMLPart::clear): Head in the direction of using the m_frames and
+ m_objects arrays, by turning some APPLE_CHANGES code on.
+ (KHTMLPart::checkCompleted): More code turned on here.
+ (KHTMLPart::checkEmitLoadEvent): And more code turned on here.
+ (KHTMLPart::parentPart): Remove APPLE_CHANGES version. We can use the original now.
+ (KHTMLPart::setZoomFactor): Remove APPLE_CHANGES. We want this function now.
+ * khtml/khtml_part.h: Remove some APPLE_CHANGES to make xmlDocImpl public.
+ No longer needed.
+ * khtml/khtmlpart_p.h: Remove a bunch of APPLE_CHANGES.
+ * kwq/KWQKHTMLPartImpl.h: Remove parentPart(), add getDocument() and getRenderer().
+ * kwq/KWQKHTMLPartImpl.mm:
+ (KWQKHTMLPartImpl::urlSelected): Use parentPart() instead of [bridge parent].
+ (KWQKHTMLPartImpl::requestFrame): Set up a ChildFrame in the m_frames array.
+ (KWQKHTMLPartImpl::layout): Use getRenderer().
+ (KWQKHTMLPartImpl::getDocument): Added.
+ (KWQKHTMLPartImpl::getRenderer): Added.
+ * kwq/WebCoreBridge.h: Add [setParent:], remove [parent].
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge setParent:]): Added.
+ (-[WebCoreBridge reapplyStyles]): Use getDocument().
+ (-[WebCoreBridge forceLayout]): Use getRenderer().
+ (-[WebCoreBridge drawRect:withPainter:]): Use getRenderer().
+ (-[WebCoreBridge copyDOMTree:]): Use getDocument().
+ (-[WebCoreBridge copyRenderTree:]): Use getRenderer().
+ (-[WebCoreBridge completeURLForDOMString:]): Use getDocument().
+ (-[WebCoreBridge elementAtPoint:]): Use getRenderer().
+ (-[WebCoreBridge setTextSizeMultiplier:]):
+ * kwq/khtml/khtml_ext.h: Add dummy setEnabled function to make khtml_part.cpp compile.
+ * kwq/kparts/part.h: Add real parent() and setParent() implementation.
+
2002-08-05 Maciej Stachowiak <mjs at apple.com>
Fixed crashers and leaks that come up when changing the view
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index e2b8c0d..ec9b396 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,38 @@
+2002-08-06 Darin Adler <darin at apple.com>
+
+ - fixed 2948805 -- Need WebKit API for larger/smaller font feature
+
+ * khtml/khtml_part.cpp:
+ (KHTMLPart::clear): Head in the direction of using the m_frames and
+ m_objects arrays, by turning some APPLE_CHANGES code on.
+ (KHTMLPart::checkCompleted): More code turned on here.
+ (KHTMLPart::checkEmitLoadEvent): And more code turned on here.
+ (KHTMLPart::parentPart): Remove APPLE_CHANGES version. We can use the original now.
+ (KHTMLPart::setZoomFactor): Remove APPLE_CHANGES. We want this function now.
+ * khtml/khtml_part.h: Remove some APPLE_CHANGES to make xmlDocImpl public.
+ No longer needed.
+ * khtml/khtmlpart_p.h: Remove a bunch of APPLE_CHANGES.
+ * kwq/KWQKHTMLPartImpl.h: Remove parentPart(), add getDocument() and getRenderer().
+ * kwq/KWQKHTMLPartImpl.mm:
+ (KWQKHTMLPartImpl::urlSelected): Use parentPart() instead of [bridge parent].
+ (KWQKHTMLPartImpl::requestFrame): Set up a ChildFrame in the m_frames array.
+ (KWQKHTMLPartImpl::layout): Use getRenderer().
+ (KWQKHTMLPartImpl::getDocument): Added.
+ (KWQKHTMLPartImpl::getRenderer): Added.
+ * kwq/WebCoreBridge.h: Add [setParent:], remove [parent].
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge setParent:]): Added.
+ (-[WebCoreBridge reapplyStyles]): Use getDocument().
+ (-[WebCoreBridge forceLayout]): Use getRenderer().
+ (-[WebCoreBridge drawRect:withPainter:]): Use getRenderer().
+ (-[WebCoreBridge copyDOMTree:]): Use getDocument().
+ (-[WebCoreBridge copyRenderTree:]): Use getRenderer().
+ (-[WebCoreBridge completeURLForDOMString:]): Use getDocument().
+ (-[WebCoreBridge elementAtPoint:]): Use getRenderer().
+ (-[WebCoreBridge setTextSizeMultiplier:]):
+ * kwq/khtml/khtml_ext.h: Add dummy setEnabled function to make khtml_part.cpp compile.
+ * kwq/kparts/part.h: Add real parent() and setParent() implementation.
+
2002-08-05 Maciej Stachowiak <mjs at apple.com>
Fixed crashers and leaks that come up when changing the view
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index e2b8c0d..ec9b396 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,38 @@
+2002-08-06 Darin Adler <darin at apple.com>
+
+ - fixed 2948805 -- Need WebKit API for larger/smaller font feature
+
+ * khtml/khtml_part.cpp:
+ (KHTMLPart::clear): Head in the direction of using the m_frames and
+ m_objects arrays, by turning some APPLE_CHANGES code on.
+ (KHTMLPart::checkCompleted): More code turned on here.
+ (KHTMLPart::checkEmitLoadEvent): And more code turned on here.
+ (KHTMLPart::parentPart): Remove APPLE_CHANGES version. We can use the original now.
+ (KHTMLPart::setZoomFactor): Remove APPLE_CHANGES. We want this function now.
+ * khtml/khtml_part.h: Remove some APPLE_CHANGES to make xmlDocImpl public.
+ No longer needed.
+ * khtml/khtmlpart_p.h: Remove a bunch of APPLE_CHANGES.
+ * kwq/KWQKHTMLPartImpl.h: Remove parentPart(), add getDocument() and getRenderer().
+ * kwq/KWQKHTMLPartImpl.mm:
+ (KWQKHTMLPartImpl::urlSelected): Use parentPart() instead of [bridge parent].
+ (KWQKHTMLPartImpl::requestFrame): Set up a ChildFrame in the m_frames array.
+ (KWQKHTMLPartImpl::layout): Use getRenderer().
+ (KWQKHTMLPartImpl::getDocument): Added.
+ (KWQKHTMLPartImpl::getRenderer): Added.
+ * kwq/WebCoreBridge.h: Add [setParent:], remove [parent].
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge setParent:]): Added.
+ (-[WebCoreBridge reapplyStyles]): Use getDocument().
+ (-[WebCoreBridge forceLayout]): Use getRenderer().
+ (-[WebCoreBridge drawRect:withPainter:]): Use getRenderer().
+ (-[WebCoreBridge copyDOMTree:]): Use getDocument().
+ (-[WebCoreBridge copyRenderTree:]): Use getRenderer().
+ (-[WebCoreBridge completeURLForDOMString:]): Use getDocument().
+ (-[WebCoreBridge elementAtPoint:]): Use getRenderer().
+ (-[WebCoreBridge setTextSizeMultiplier:]):
+ * kwq/khtml/khtml_ext.h: Add dummy setEnabled function to make khtml_part.cpp compile.
+ * kwq/kparts/part.h: Add real parent() and setParent() implementation.
+
2002-08-05 Maciej Stachowiak <mjs at apple.com>
Fixed crashers and leaks that come up when changing the view
diff --git a/WebCore/khtml/khtml_part.cpp b/WebCore/khtml/khtml_part.cpp
index 673b65c..71ca9b3 100644
--- a/WebCore/khtml/khtml_part.cpp
+++ b/WebCore/khtml/khtml_part.cpp
@@ -945,10 +945,10 @@ void KHTMLPart::clear()
}
}
}
+#endif
d->m_frames.clear();
d->m_objects.clear();
-#endif
#ifndef Q_WS_QWS
delete d->m_javaContext;
@@ -1585,14 +1585,12 @@ void KHTMLPart::checkCompleted()
d->m_focusNodeRestored = true;
}
-#ifndef APPLE_CHANGES
// Any frame that hasn't completed yet ?
ConstFrameIt it = d->m_frames.begin();
ConstFrameIt end = d->m_frames.end();
for (; it != end; ++it )
if ( !(*it).m_bCompleted )
return;
-#endif
// Are we still parsing - or have we done the completed stuff already ?
if ( d->m_bComplete || (d->m_doc && d->m_doc->parsing()) )
@@ -1664,7 +1662,6 @@ void KHTMLPart::checkEmitLoadEvent()
{
if ( d->m_bLoadEventEmitted || !d->m_doc || d->m_doc->parsing() ) return;
-#ifndef APPLE_CHANGES
ConstFrameIt it = d->m_frames.begin();
ConstFrameIt end = d->m_frames.end();
for (; it != end; ++it )
@@ -1694,7 +1691,6 @@ void KHTMLPart::checkEmitLoadEvent()
}
}
}
-#endif
d->m_bLoadEventEmitted = true;
if (d->m_doc)
@@ -3373,14 +3369,10 @@ bool KHTMLPart::frameExists( const QString &frameName )
KHTMLPart *KHTMLPart::parentPart()
{
-#ifdef APPLE_CHANGES
- return impl->parentPart();
-#else
if ( !parent() || !parent()->inherits( "KHTMLPart" ) )
return 0L;
return (KHTMLPart *)parent();
-#endif
}
#ifndef APPLE_CHANGES
@@ -3744,7 +3736,6 @@ void KHTMLPart::slotDecZoom()
void KHTMLPart::setZoomFactor (int percent)
{
-#ifndef APPLE_CHANGES
if (percent < minZoom) percent = minZoom;
if (percent > maxZoom) percent = maxZoom;
if (d->m_zoomFactor == percent) return;
@@ -3768,7 +3759,6 @@ void KHTMLPart::setZoomFactor (int percent)
d->m_paDecZoomFactor->setEnabled( d->m_zoomFactor > minZoom );
d->m_paIncZoomFactor->setEnabled( d->m_zoomFactor < maxZoom );
-#endif
}
void KHTMLPart::setJSStatusBarText( const QString &text )
diff --git a/WebCore/khtml/khtml_part.h b/WebCore/khtml/khtml_part.h
index 7cda941..66a2f77 100644
--- a/WebCore/khtml/khtml_part.h
+++ b/WebCore/khtml/khtml_part.h
@@ -1061,13 +1061,7 @@ private:
DOM::EventListener *createHTMLEventListener( QString code );
DOM::HTMLDocumentImpl *docImpl() const;
-#ifdef APPLE_CHANGES
-public:
-#endif
DOM::DocumentImpl *xmlDocImpl() const;
-#ifdef APPLE_CHANGES
-private:
-#endif
khtml::ChildFrame *frame( const QObject *obj );
khtml::ChildFrame *recursiveFrameRequest( const KURL &url, const KParts::URLArgs &args, bool callParent = true );
diff --git a/WebCore/khtml/khtmlpart_p.h b/WebCore/khtml/khtmlpart_p.h
index edaa18b..62be355 100644
--- a/WebCore/khtml/khtmlpart_p.h
+++ b/WebCore/khtml/khtmlpart_p.h
@@ -48,8 +48,6 @@ namespace KIO
class TransferJob;
};
-#ifndef APPLE_CHANGES
-
namespace khtml
{
struct ChildFrame
@@ -58,7 +56,9 @@ namespace khtml
ChildFrame() { m_bCompleted = false; m_bPreloaded = false; m_type = Frame; m_bNotify = false; }
+#ifndef APPLE_CHANGES
~ChildFrame() { if (m_run) m_run->abort(); }
+#endif
QGuardedPtr<khtml::RenderPart> m_frame;
QGuardedPtr<KParts::ReadOnlyPart> m_part;
@@ -69,7 +69,9 @@ namespace khtml
bool m_bCompleted;
QString m_name;
KParts::URLArgs m_args;
+#ifndef APPLE_CHANGES
QGuardedPtr<KHTMLRun> m_run;
+#endif
bool m_bPreloaded;
KURL m_workingURL;
Type m_type;
@@ -88,8 +90,6 @@ public:
typedef FrameList::ConstIterator ConstFrameIt;
typedef FrameList::Iterator FrameIt;
-#endif // APPLE_CHANGES
-
static int khtml_part_dcop_counter = 0;
class KHTMLPartPrivate
@@ -152,7 +152,6 @@ public:
m_bPendingChildRedirection = false;
-#ifndef APPLE_CHANGES
// inherit settings from parent
if(parent && parent->inherits("KHTMLPart"))
{
@@ -171,7 +170,6 @@ public:
m_zoomFactor = part->d->m_zoomFactor;
}
}
-#endif
m_focusNodeNumber = -1;
m_focusNodeRestored = false;
@@ -194,10 +192,8 @@ public:
#endif
}
-#ifndef APPLE_CHANGES
FrameList m_frames;
QValueList<khtml::ChildFrame> m_objects;
-#endif
QGuardedPtr<KHTMLView> m_view;
KHTMLPartBrowserExtension *m_extension;
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index f7139d7..a46dfe8 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -40,6 +40,7 @@ namespace KParts {
namespace DOM {
class DOMString;
+ class DocumentImpl;
}
namespace khtml {
@@ -77,8 +78,6 @@ public:
KHTMLPart *findFrame(const QString &frameName);
QPtrList<KParts::ReadOnlyPart> frames() const;
- KHTMLPart *parentPart();
-
void urlSelected(const QString &url, int button, int state, const QString &_target, KParts::URLArgs);
bool requestFrame(khtml::RenderPart *frame, const QString &url, const QString &frameName, const QStringList ¶ms, bool isIFrame);
bool requestObject(khtml::RenderPart *frame, const QString &url, const QString &serviceType, const QStringList &args);
@@ -98,10 +97,17 @@ public:
void overURL(const QString &url, const QString &target, int modifierState);
- void redirectionTimerStartedOrStopped();
-
void layout();
+
+ // Incoming calls, used by the bridge.
+
+ DOM::DocumentImpl *getDocument();
+ khtml::RenderObject *getRenderer();
+
+ // Used internally, but need to be public because they are used by non-member functions.
+ void redirectionTimerStartedOrStopped();
+
private:
KHTMLPart *part;
KHTMLPartPrivate *d;
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 54003c0..507a139 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -42,6 +42,7 @@
#undef _KWQ_TIMING
+using khtml::ChildFrame;
using khtml::Decoder;
using khtml::RenderObject;
using khtml::RenderPart;
@@ -154,9 +155,8 @@ void KWQKHTMLPartImpl::urlSelected( const QString &url, int button, int state, c
WebCoreBridge *frame;
if (_target.isEmpty()) {
// If we're the only frame in a frameset then pop the frame.
- if ([[[bridge parent] childFrames] count] == 1) {
- frame = [bridge parent];
- } else {
+ frame = part->parentPart()->impl->bridge;
+ if ([[frame childFrames] count] != 1) {
frame = bridge;
}
} else {
@@ -189,6 +189,13 @@ bool KWQKHTMLPartImpl::requestFrame( RenderPart *frame, const QString &url, cons
marginWidth:o->getMarginWidth() marginHeight:o->getMarginHeight()]) {
return false;
}
+
+ ChildFrame childFrame;
+ childFrame.m_name = frameName;
+ childFrame.m_type = isIFrame ? khtml::ChildFrame::IFrame : khtml::ChildFrame::Frame;
+ childFrame.m_frame = frame;
+ childFrame.m_params = params;
+ d->m_frames.append(childFrame);
#ifdef _SUPPORT_JAVASCRIPT_URL_
if ( url.find( QString::fromLatin1( "javascript:" ), 0, false ) == 0 && !isIFrame )
@@ -374,12 +381,6 @@ void KWQKHTMLPartImpl::setStatusBarText(const QString &status)
[bridge setStatusText:status.getNSString()];
}
-
-KHTMLPart *KWQKHTMLPartImpl::parentPart()
-{
- return [[bridge parent] part];
-}
-
bool KWQKHTMLPartImpl::openedByJS()
{
return [bridge openedByScript];
@@ -510,8 +511,18 @@ 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());
+ if (getRenderer()) {
+ moveWidgetsAside(getRenderer());
}
}
+
+DocumentImpl *KWQKHTMLPartImpl::getDocument()
+{
+ return part->xmlDocImpl();
+}
+
+RenderObject *KWQKHTMLPartImpl::getRenderer()
+{
+ DocumentImpl *doc = part->xmlDocImpl();
+ return doc ? doc->renderer() : 0;
+}
diff --git a/WebCore/kwq/KWQKHTMLPartBrowserExtension.h b/WebCore/kwq/KWQKHTMLPartBrowserExtension.h
index ad504e5..9069422 100644
--- a/WebCore/kwq/KWQKHTMLPartBrowserExtension.h
+++ b/WebCore/kwq/KWQKHTMLPartBrowserExtension.h
@@ -62,4 +62,7 @@ public:
KHTMLPartBrowserHostExtension(KHTMLPart *) { }
};
-class KHTMLZoomFactorAction { };
+class KHTMLZoomFactorAction {
+public:
+ void setEnabled(bool) { }
+};
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.h b/WebCore/kwq/KWQKHTMLPartImpl.h
index f7139d7..a46dfe8 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.h
+++ b/WebCore/kwq/KWQKHTMLPartImpl.h
@@ -40,6 +40,7 @@ namespace KParts {
namespace DOM {
class DOMString;
+ class DocumentImpl;
}
namespace khtml {
@@ -77,8 +78,6 @@ public:
KHTMLPart *findFrame(const QString &frameName);
QPtrList<KParts::ReadOnlyPart> frames() const;
- KHTMLPart *parentPart();
-
void urlSelected(const QString &url, int button, int state, const QString &_target, KParts::URLArgs);
bool requestFrame(khtml::RenderPart *frame, const QString &url, const QString &frameName, const QStringList ¶ms, bool isIFrame);
bool requestObject(khtml::RenderPart *frame, const QString &url, const QString &serviceType, const QStringList &args);
@@ -98,10 +97,17 @@ public:
void overURL(const QString &url, const QString &target, int modifierState);
- void redirectionTimerStartedOrStopped();
-
void layout();
+
+ // Incoming calls, used by the bridge.
+
+ DOM::DocumentImpl *getDocument();
+ khtml::RenderObject *getRenderer();
+
+ // Used internally, but need to be public because they are used by non-member functions.
+ void redirectionTimerStartedOrStopped();
+
private:
KHTMLPart *part;
KHTMLPartPrivate *d;
diff --git a/WebCore/kwq/KWQKHTMLPartImpl.mm b/WebCore/kwq/KWQKHTMLPartImpl.mm
index 54003c0..507a139 100644
--- a/WebCore/kwq/KWQKHTMLPartImpl.mm
+++ b/WebCore/kwq/KWQKHTMLPartImpl.mm
@@ -42,6 +42,7 @@
#undef _KWQ_TIMING
+using khtml::ChildFrame;
using khtml::Decoder;
using khtml::RenderObject;
using khtml::RenderPart;
@@ -154,9 +155,8 @@ void KWQKHTMLPartImpl::urlSelected( const QString &url, int button, int state, c
WebCoreBridge *frame;
if (_target.isEmpty()) {
// If we're the only frame in a frameset then pop the frame.
- if ([[[bridge parent] childFrames] count] == 1) {
- frame = [bridge parent];
- } else {
+ frame = part->parentPart()->impl->bridge;
+ if ([[frame childFrames] count] != 1) {
frame = bridge;
}
} else {
@@ -189,6 +189,13 @@ bool KWQKHTMLPartImpl::requestFrame( RenderPart *frame, const QString &url, cons
marginWidth:o->getMarginWidth() marginHeight:o->getMarginHeight()]) {
return false;
}
+
+ ChildFrame childFrame;
+ childFrame.m_name = frameName;
+ childFrame.m_type = isIFrame ? khtml::ChildFrame::IFrame : khtml::ChildFrame::Frame;
+ childFrame.m_frame = frame;
+ childFrame.m_params = params;
+ d->m_frames.append(childFrame);
#ifdef _SUPPORT_JAVASCRIPT_URL_
if ( url.find( QString::fromLatin1( "javascript:" ), 0, false ) == 0 && !isIFrame )
@@ -374,12 +381,6 @@ void KWQKHTMLPartImpl::setStatusBarText(const QString &status)
[bridge setStatusText:status.getNSString()];
}
-
-KHTMLPart *KWQKHTMLPartImpl::parentPart()
-{
- return [[bridge parent] part];
-}
-
bool KWQKHTMLPartImpl::openedByJS()
{
return [bridge openedByScript];
@@ -510,8 +511,18 @@ 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());
+ if (getRenderer()) {
+ moveWidgetsAside(getRenderer());
}
}
+
+DocumentImpl *KWQKHTMLPartImpl::getDocument()
+{
+ return part->xmlDocImpl();
+}
+
+RenderObject *KWQKHTMLPartImpl::getRenderer()
+{
+ DocumentImpl *doc = part->xmlDocImpl();
+ return doc ? doc->renderer() : 0;
+}
diff --git a/WebCore/kwq/KWQKPartsPart.h b/WebCore/kwq/KWQKPartsPart.h
index d79e0c9..993d800 100644
--- a/WebCore/kwq/KWQKPartsPart.h
+++ b/WebCore/kwq/KWQKPartsPart.h
@@ -62,14 +62,18 @@ private:
class ReadOnlyPart : public Part {
public:
- ReadOnlyPart(QObject * = 0, const char * = 0) { }
+ ReadOnlyPart(QObject * = 0, const char * = 0) : m_parent(0) { }
KURL url() const { return m_url; }
KURL m_url;
void setXMLFile(const char *) { }
- QObject *parent() const { return 0; }
+ void setParent(QObject *parent) { m_parent = parent; }
+ QObject *parent() const { return m_parent; }
void setInstance(KInstance *, bool) { }
+
+private:
+ QObject *m_parent;
};
class GUIActivateEvent { };
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index c6f997c..918b321 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -79,6 +79,8 @@ typedef khtml::RenderPart KHTMLRenderPart;
- (KHTMLPart *)part;
+- (void)setParent:(WebCoreBridge *)parent;
+
- (void)openURL:(NSURL *)URL;
- (void)addData:(NSData *)data withEncoding:(NSString *)encoding;
- (void)closeURL;
@@ -124,8 +126,6 @@ typedef khtml::RenderPart KHTMLRenderPart;
@protocol WebCoreBridge
-- (WebCoreBridge *)parent;
-
- (NSArray *)childFrames; // WebCoreBridge objects
- (WebCoreBridge *)descendantFrameNamed:(NSString *)name;
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index 0ece8df..271c4c1 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -33,18 +33,19 @@
#import <render_root.h>
#import <render_frames.h>
#import <kwqdebug.h>
-#include <html/html_documentimpl.h>
-#include <xml/dom_nodeimpl.h>
-#include <htmlattrs.h>
-#include <htmltags.h>
-#include <csshelper.h>
-#include <KWQDOMNode.h>
-#include <WebCoreImageRenderer.h>
-
-#include <WebFoundation/WebNSURLExtras.h>
-
-using namespace DOM;
-using namespace khtml;
+#import <html/html_documentimpl.h>
+#import <xml/dom_nodeimpl.h>
+#import <htmlattrs.h>
+#import <htmltags.h>
+#import <csshelper.h>
+#import <KWQDOMNode.h>
+#import <WebCoreImageRenderer.h>
+#import <WebFoundation/WebNSURLExtras.h>
+
+using khtml::parseURL;
+using khtml::RenderImage;
+using khtml::RenderObject;
+using khtml::RenderPart;
@implementation WebCoreBridge
@@ -89,6 +90,10 @@ using namespace khtml;
return renderPart;
}
+- (void)setParent:(WebCoreBridge *)parent
+{
+ part->setParent([parent part]);
+}
- (void)openURL:(NSURL *)URL
{
@@ -155,7 +160,7 @@ using namespace khtml;
- (void)reapplyStyles
{
- DOM::DocumentImpl *doc = part->xmlDocImpl();
+ DOM::DocumentImpl *doc = part->impl->getDocument();
if (doc && doc->renderer()) {
doc->updateStyleSelector();
}
@@ -163,12 +168,9 @@ using namespace khtml;
- (void)forceLayout
{
- DOM::DocumentImpl *doc = part->xmlDocImpl();
- if (doc) {
- khtml::RenderObject *renderer = doc->renderer();
- if (renderer) {
- renderer->setLayouted(false);
- }
+ RenderObject *renderer = part->impl->getRenderer();
+ if (renderer) {
+ renderer->setLayouted(false);
}
KHTMLView *view = part->impl->getView();
if (view) {
@@ -178,13 +180,10 @@ using namespace khtml;
- (void)drawRect:(NSRect)rect withPainter:(QPainter *)p
{
- DOM::DocumentImpl *doc = part->xmlDocImpl();
- if (doc) {
- RenderObject *renderer = doc->renderer();
- if (renderer) {
- renderer->print(p, (int)rect.origin.x, (int)rect.origin.y, (int)rect.size.width, (int)rect.size.height, 0, 0);
- }
- }
+ RenderObject *renderer = part->impl->getRenderer();
+ if (renderer) {
+ renderer->print(p, (int)rect.origin.x, (int)rect.origin.y, (int)rect.size.width, (int)rect.size.height, 0, 0);
+ }
}
- (void)drawRect:(NSRect)rect
@@ -221,23 +220,23 @@ using namespace khtml;
- (NSObject *)copyDOMTree:(id <WebCoreDOMTreeCopier>)copier
{
- DOM::DocumentImpl *doc = part->xmlDocImpl();
+ DOM::DocumentImpl *doc = part->impl->getDocument();
if (!doc) {
return nil;
}
return [self copyDOMNode:doc copier:copier];
}
-- (NSObject *)copyRenderNode:(khtml::RenderObject *)node copier:(id <WebCoreRenderTreeCopier>)copier
+- (NSObject *)copyRenderNode:(RenderObject *)node copier:(id <WebCoreRenderTreeCopier>)copier
{
NSMutableArray *children = [[NSMutableArray alloc] init];
- for (khtml::RenderObject *child = node->firstChild(); child; child = child->nextSibling()) {
+ for (RenderObject *child = node->firstChild(); child; child = child->nextSibling()) {
[children addObject:[self copyRenderNode:child copier:copier]];
}
NSString *name = [[NSString alloc] initWithUTF8String:node->renderName()];
- khtml::RenderPart *nodeRenderPart = dynamic_cast<khtml::RenderPart *>(node);
+ RenderPart *nodeRenderPart = dynamic_cast<RenderPart *>(node);
QWidget *widget = nodeRenderPart ? nodeRenderPart->widget() : 0;
NSView *view = widget ? widget->getView() : nil;
@@ -254,11 +253,7 @@ using namespace khtml;
- (NSObject *)copyRenderTree:(id <WebCoreRenderTreeCopier>)copier
{
- DOM::DocumentImpl *doc = part->xmlDocImpl();
- if (!doc) {
- return nil;
- }
- khtml::RenderObject *renderer = doc->renderer();
+ RenderObject *renderer = part->impl->getRenderer();
if (!renderer) {
return nil;
}
@@ -381,50 +376,44 @@ using namespace khtml;
}
}
-- (NSURL *)completeURLForDOMString:(DOMString &)s
+- (NSURL *)completeURLForDOMString:(const DOMString &)s
{
- NSString *URLString = part->xmlDocImpl()->completeURL(s.string()).getNSString();
+ NSString *URLString = part->impl->getDocument()->completeURL(s.string()).getNSString();
return [NSURL _web_URLWithString:URLString];
}
- (NSDictionary *)elementAtPoint:(NSPoint)point
{
- NSMutableDictionary *elementInfo = [NSMutableDictionary dictionary];
RenderObject::NodeInfo nodeInfo(true, true);
- NodeImpl *node, *URLNode;
- DOMString domURL;
- NSURL *URL;
-
- part->xmlDocImpl()->renderer()->nodeAtPoint(nodeInfo, (int)point.x, (int)point.y, 0, 0);
+ part->impl->getRenderer()->nodeAtPoint(nodeInfo, (int)point.x, (int)point.y, 0, 0);
- node = nodeInfo.innerNode();
- URLNode = nodeInfo.URLElement();
-
- if(URLNode){
+ NSMutableDictionary *elementInfo = [NSMutableDictionary dictionary];
+
+ NodeImpl *URLNode = nodeInfo.URLElement();
+ if (URLNode) {
ElementImpl* e = static_cast<ElementImpl*>(URLNode);
- domURL = khtml::parseURL(e->getAttribute(ATTR_HREF));
- URL = [self completeURLForDOMString:domURL];
- if(URL){
- [elementInfo setObject: URL forKey: WebCoreContextLinkURL];
+ NSURL *URL = [self completeURLForDOMString:parseURL(e->getAttribute(ATTR_HREF))];
+ if (URL) {
+ [elementInfo setObject:URL forKey:WebCoreContextLinkURL];
}
}
- if(isImage(node)){
+ NodeImpl *node = nodeInfo.innerNode();
+ if (isImage(node)) {
ElementImpl* i = static_cast<ElementImpl*>(node);
- domURL = khtml::parseURL(i->getAttribute(ATTR_SRC));
- URL = [self completeURLForDOMString:domURL];
- if(URL){
- [elementInfo setObject: URL forKey: WebCoreContextImageURL];
+ NSURL *URL = [self completeURLForDOMString:parseURL(i->getAttribute(ATTR_SRC))];
+ if (URL) {
+ [elementInfo setObject:URL forKey:WebCoreContextImageURL];
RenderImage *r = (RenderImage *)node->renderer();
id <WebCoreImageRenderer> image = r->pixmap().image();
- if(image){
- [elementInfo setObject: image forKey: WebCoreContextImage];
+ if (image) {
+ [elementInfo setObject:image forKey:WebCoreContextImage];
}
}
}
- if(part->hasSelection()){
- [elementInfo setObject: [self selectedText] forKey: WebCoreContextString];
+ if (part->hasSelection()) {
+ [elementInfo setObject:[self selectedText] forKey:WebCoreContextString];
}
return elementInfo;
diff --git a/WebCore/kwq/khtml/khtml_ext.h b/WebCore/kwq/khtml/khtml_ext.h
index ad504e5..9069422 100644
--- a/WebCore/kwq/khtml/khtml_ext.h
+++ b/WebCore/kwq/khtml/khtml_ext.h
@@ -62,4 +62,7 @@ public:
KHTMLPartBrowserHostExtension(KHTMLPart *) { }
};
-class KHTMLZoomFactorAction { };
+class KHTMLZoomFactorAction {
+public:
+ void setEnabled(bool) { }
+};
diff --git a/WebCore/kwq/kparts/part.h b/WebCore/kwq/kparts/part.h
index d79e0c9..993d800 100644
--- a/WebCore/kwq/kparts/part.h
+++ b/WebCore/kwq/kparts/part.h
@@ -62,14 +62,18 @@ private:
class ReadOnlyPart : public Part {
public:
- ReadOnlyPart(QObject * = 0, const char * = 0) { }
+ ReadOnlyPart(QObject * = 0, const char * = 0) : m_parent(0) { }
KURL url() const { return m_url; }
KURL m_url;
void setXMLFile(const char *) { }
- QObject *parent() const { return 0; }
+ void setParent(QObject *parent) { m_parent = parent; }
+ QObject *parent() const { return m_parent; }
void setInstance(KInstance *, bool) { }
+
+private:
+ QObject *m_parent;
};
class GUIActivateEvent { };
diff --git a/WebKit/ChangeLog b/WebKit/ChangeLog
index 023db58..7f180de 100644
--- a/WebKit/ChangeLog
+++ b/WebKit/ChangeLog
@@ -1,3 +1,16 @@
+2002-08-06 Darin Adler <darin at apple.com>
+
+ * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge dataSourceChanged]): Call setParent:.
+ * WebView.subproj/WebControllerPrivate.m:
+ (-[WebControllerPrivate init]): Initialize the text size multiplier to 1.
+ * WebView.subproj/WebDataSource.h: Removed [redirectedURL], deprecated [inputURL], added [URL].
+ * WebView.subproj/WebDataSource.m:
+ (-[WebDataSource URL]): Added. Returns current URL, without requiring separate logic for the
+ redirected and not-yet-redirected cases.
+ * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadIcon]): Use [WebDataSource URL].
+ * WebView.subproj/WebDefaultContextMenuHandler.m:
+ (-[WebDefaultContextMenuHandler openFrameInNewWindow:]): Use [WebDataSource URL].
+
2002-08-06 John Sullivan <sullivan at apple.com>
WebKit part of fix for 3017539 -- Replace Serif and Sans-serif
diff --git a/WebKit/ChangeLog-2002-12-03 b/WebKit/ChangeLog-2002-12-03
index 023db58..7f180de 100644
--- a/WebKit/ChangeLog-2002-12-03
+++ b/WebKit/ChangeLog-2002-12-03
@@ -1,3 +1,16 @@
+2002-08-06 Darin Adler <darin at apple.com>
+
+ * WebCoreSupport.subproj/WebBridge.m: (-[WebBridge dataSourceChanged]): Call setParent:.
+ * WebView.subproj/WebControllerPrivate.m:
+ (-[WebControllerPrivate init]): Initialize the text size multiplier to 1.
+ * WebView.subproj/WebDataSource.h: Removed [redirectedURL], deprecated [inputURL], added [URL].
+ * WebView.subproj/WebDataSource.m:
+ (-[WebDataSource URL]): Added. Returns current URL, without requiring separate logic for the
+ redirected and not-yet-redirected cases.
+ * WebView.subproj/WebDataSourcePrivate.m: (-[WebDataSource _loadIcon]): Use [WebDataSource URL].
+ * WebView.subproj/WebDefaultContextMenuHandler.m:
+ (-[WebDefaultContextMenuHandler openFrameInNewWindow:]): Use [WebDataSource URL].
+
2002-08-06 John Sullivan <sullivan at apple.com>
WebKit part of fix for 3017539 -- Replace Serif and Sans-serif
diff --git a/WebKit/WebCoreSupport.subproj/WebBridge.m b/WebKit/WebCoreSupport.subproj/WebBridge.m
index 7a817d2..584ebaa 100644
--- a/WebKit/WebCoreSupport.subproj/WebBridge.m
+++ b/WebKit/WebCoreSupport.subproj/WebBridge.m
@@ -41,11 +41,6 @@
[super dealloc];
}
-- (WebCoreBridge *)parent
-{
- return [[[self dataSource] parent] _bridge];
-}
-
- (NSArray *)childFrames
{
NSArray *frames = [[self dataSource] children];
@@ -222,8 +217,8 @@
- (void)dataSourceChanged
{
- [self openURL:[[self dataSource] redirectedURL] == nil
- ? [[self dataSource] inputURL] : [[self dataSource] redirectedURL]];
+ [self setParent:[[[self dataSource] parent] _bridge]];
+ [self openURL:[[self dataSource] URL]];
}
- (WebDataSource *)dataSource
diff --git a/WebKit/WebView.subproj/WebControllerPrivate.m b/WebKit/WebView.subproj/WebControllerPrivate.m
index 977aa0d..b684a9c 100644
--- a/WebKit/WebView.subproj/WebControllerPrivate.m
+++ b/WebKit/WebView.subproj/WebControllerPrivate.m
@@ -28,6 +28,7 @@
mainFrame = nil;
backForwardList = [[WebBackForwardList alloc] init];
defaultContextMenuHandler = [[WebDefaultContextMenuHandler alloc] init];
+ textSizeMultiplier = 1;
return self;
}
diff --git a/WebKit/WebView.subproj/WebDataSource.h b/WebKit/WebView.subproj/WebDataSource.h
index 8521006..ccb1851 100644
--- a/WebKit/WebView.subproj/WebDataSource.h
+++ b/WebKit/WebView.subproj/WebDataSource.h
@@ -91,18 +91,11 @@
- (WebController *)controller;
// May return nil if not initialized with a URL.
-- (NSURL *)inputURL;
-
-// redirectedURL returns the URL that was actually used if there was a redirect.
-// The value of redirectedURL will change if more than one redirect occurs. If no
-// redirect occurs the value of redirectedURL will be nil. To monitor change in
-// the value of the redirected URL override the <WebLocationChangeHandler>
+// The value of URL will change if a redirect occurs.
+// To monitor change in the URL, override the <WebLocationChangeHandler>
// serverRedirectTo:forDataSource: method.
-- (NSURL *)redirectedURL;
-
-// Returns true if the inputURL has been redirected by the server,
-// i.e. inputURL != finalURL.
-- (BOOL)wasRedirected;
+- (NSURL *)URL;
+- (NSURL *)inputURL; // deprecated
// Start actually getting (if initialized with a URL) and parsing data. If the data source
// is still performing a previous load it will be stopped.
diff --git a/WebKit/WebView.subproj/WebDataSource.m b/WebKit/WebView.subproj/WebDataSource.m
index 1e51760..c53a1cd 100644
--- a/WebKit/WebView.subproj/WebDataSource.m
+++ b/WebKit/WebView.subproj/WebDataSource.m
@@ -164,27 +164,16 @@
// May return nil if not initialized with a URL.
-- (NSURL *)inputURL
+- (NSURL *)URL
{
- return _private->inputURL;
+ return _private->finalURL ? _private->finalURL : _private->inputURL;
}
-// finalURL returns the URL that was actually used. The final URL
-// may be different than the inputURL if the server redirects.
-// <WebLocationChangedHandler> includes a message that is sent when
-// a redirect is processed
-- (NSURL *)redirectedURL
-{
- return _private->finalURL;
-}
-
-
-// Returns true if the inputURL has been redirected by the server,
-// i.e. inputURL != redirectedURL.
-- (BOOL)wasRedirected
+// May return nil if not initialized with a URL.
+- (NSURL *)inputURL
{
- return [self redirectedURL] != nil && ![_private->inputURL isEqual: [self redirectedURL]];
+ return _private->inputURL;
}
diff --git a/WebKit/WebView.subproj/WebDataSourcePrivate.m b/WebKit/WebView.subproj/WebDataSourcePrivate.m
index 332b371..1e56824 100644
--- a/WebKit/WebView.subproj/WebDataSourcePrivate.m
+++ b/WebKit/WebView.subproj/WebDataSourcePrivate.m
@@ -438,7 +438,7 @@
// If no icon URL has been set using the LINK tag, use the icon at the server's root directory
// If it is file URL, return its icon provided by NSWorkspace.
if(_private->iconURL == nil){
- NSURL *dataSourceURL = [self wasRedirected] ? [self redirectedURL] : [self inputURL];
+ NSURL *dataSourceURL = [self URL];
if([dataSourceURL isFileURL]){
NSImage *icon = [[NSWorkspace sharedWorkspace] iconForFile:[dataSourceURL path]];
diff --git a/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m b/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
index 087fbb0..0436f58 100644
--- a/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
+++ b/WebKit/WebView.subproj/WebDefaultContextMenuDelegate.m
@@ -151,7 +151,7 @@
{
WebFrame *webFrame = [element objectForKey:WebContextFrame];
WebDataSource *dataSource = [webFrame dataSource];
- NSURL *URL = [dataSource wasRedirected] ? [dataSource redirectedURL] : [dataSource inputURL];
+ NSURL *URL = [dataSource URL];
[self openNewWindowWithURL:URL];
}
diff --git a/WebKit/WebView.subproj/WebDefaultContextMenuHandler.m b/WebKit/WebView.subproj/WebDefaultContextMenuHandler.m
index 087fbb0..0436f58 100644
--- a/WebKit/WebView.subproj/WebDefaultContextMenuHandler.m
+++ b/WebKit/WebView.subproj/WebDefaultContextMenuHandler.m
@@ -151,7 +151,7 @@
{
WebFrame *webFrame = [element objectForKey:WebContextFrame];
WebDataSource *dataSource = [webFrame dataSource];
- NSURL *URL = [dataSource wasRedirected] ? [dataSource redirectedURL] : [dataSource inputURL];
+ NSURL *URL = [dataSource URL];
[self openNewWindowWithURL:URL];
}
diff --git a/WebKit/WebView.subproj/WebViewPrivate.m b/WebKit/WebView.subproj/WebViewPrivate.m
index 977aa0d..b684a9c 100644
--- a/WebKit/WebView.subproj/WebViewPrivate.m
+++ b/WebKit/WebView.subproj/WebViewPrivate.m
@@ -28,6 +28,7 @@
mainFrame = nil;
backForwardList = [[WebBackForwardList alloc] init];
defaultContextMenuHandler = [[WebDefaultContextMenuHandler alloc] init];
+ textSizeMultiplier = 1;
return self;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list