[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:58:55 UTC 2009
The following commit has been merged in the debian/unstable branch:
commit 0e8c0cecdb3d3b36055ea75a65001de64026f16d
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date: Mon Nov 11 19:04:35 2002 +0000
- fixed 3092421 -- javascript: URL that opens window crashes Alex if typed into empty window
* kwq/KWQKHTMLPart.h:
* kwq/KWQKHTMLPart.mm:
(KWQKHTMLPart::KWQKHTMLPart): Set _ownsView to false.
(KWQKHTMLPart::~KWQKHTMLPart): Delete the view if we own it. Also release
_currentEvent to fix a leak.
(KWQKHTMLPart::setView): Delete the old view if we own it. Also, set the
_ownsView flag.
(KWQKHTMLPart::createDummyDocument): Create a dummy view too.
* kwq/KWQDummyView.h: Added.
* kwq/KWQDummyView.m: Added.
* WebCore.pbproj/project.pbxproj: Added KWQDummyView.
* kwq/WebCoreBridge.h: Remove bridgeOwnsKHTMLView and currentEvent.
* kwq/WebCoreBridge.mm:
(-[WebCoreBridge createKHTMLViewWithNSView:marginWidth:marginHeight:]):
Pass true to setView instead of setting bridgeOwnsKHTMLView.
(-[WebCoreBridge removeFromFrame]): Just call setView on the part. It
knows how to handle ownership now.
(-[WebCoreBridge installInFrame:]): Call setOwnsView instead of setting
bridgeOwnsKHTMLView.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@2625 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/WebCore/ChangeLog-2002-12-03 b/WebCore/ChangeLog-2002-12-03
index 89cef97..29e23c0 100644
--- a/WebCore/ChangeLog-2002-12-03
+++ b/WebCore/ChangeLog-2002-12-03
@@ -1,3 +1,29 @@
+2002-11-11 Darin Adler <darin at apple.com>
+
+ - fixed 3092421 -- javascript: URL that opens window crashes Alex if typed into empty window
+
+ * kwq/KWQKHTMLPart.h:
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::KWQKHTMLPart): Set _ownsView to false.
+ (KWQKHTMLPart::~KWQKHTMLPart): Delete the view if we own it. Also release
+ _currentEvent to fix a leak.
+ (KWQKHTMLPart::setView): Delete the old view if we own it. Also, set the
+ _ownsView flag.
+ (KWQKHTMLPart::createDummyDocument): Create a dummy view too.
+
+ * kwq/KWQDummyView.h: Added.
+ * kwq/KWQDummyView.m: Added.
+ * WebCore.pbproj/project.pbxproj: Added KWQDummyView.
+
+ * kwq/WebCoreBridge.h: Remove bridgeOwnsKHTMLView and currentEvent.
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge createKHTMLViewWithNSView:marginWidth:marginHeight:]):
+ Pass true to setView instead of setting bridgeOwnsKHTMLView.
+ (-[WebCoreBridge removeFromFrame]): Just call setView on the part. It
+ knows how to handle ownership now.
+ (-[WebCoreBridge installInFrame:]): Call setOwnsView instead of setting
+ bridgeOwnsKHTMLView.
+
2002-11-11 Trey Matteson <trey at apple.com>
* khtml/khtml_part.cpp:
diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index 89cef97..29e23c0 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,29 @@
+2002-11-11 Darin Adler <darin at apple.com>
+
+ - fixed 3092421 -- javascript: URL that opens window crashes Alex if typed into empty window
+
+ * kwq/KWQKHTMLPart.h:
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::KWQKHTMLPart): Set _ownsView to false.
+ (KWQKHTMLPart::~KWQKHTMLPart): Delete the view if we own it. Also release
+ _currentEvent to fix a leak.
+ (KWQKHTMLPart::setView): Delete the old view if we own it. Also, set the
+ _ownsView flag.
+ (KWQKHTMLPart::createDummyDocument): Create a dummy view too.
+
+ * kwq/KWQDummyView.h: Added.
+ * kwq/KWQDummyView.m: Added.
+ * WebCore.pbproj/project.pbxproj: Added KWQDummyView.
+
+ * kwq/WebCoreBridge.h: Remove bridgeOwnsKHTMLView and currentEvent.
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge createKHTMLViewWithNSView:marginWidth:marginHeight:]):
+ Pass true to setView instead of setting bridgeOwnsKHTMLView.
+ (-[WebCoreBridge removeFromFrame]): Just call setView on the part. It
+ knows how to handle ownership now.
+ (-[WebCoreBridge installInFrame:]): Call setOwnsView instead of setting
+ bridgeOwnsKHTMLView.
+
2002-11-11 Trey Matteson <trey at apple.com>
* khtml/khtml_part.cpp:
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 89cef97..29e23c0 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,29 @@
+2002-11-11 Darin Adler <darin at apple.com>
+
+ - fixed 3092421 -- javascript: URL that opens window crashes Alex if typed into empty window
+
+ * kwq/KWQKHTMLPart.h:
+ * kwq/KWQKHTMLPart.mm:
+ (KWQKHTMLPart::KWQKHTMLPart): Set _ownsView to false.
+ (KWQKHTMLPart::~KWQKHTMLPart): Delete the view if we own it. Also release
+ _currentEvent to fix a leak.
+ (KWQKHTMLPart::setView): Delete the old view if we own it. Also, set the
+ _ownsView flag.
+ (KWQKHTMLPart::createDummyDocument): Create a dummy view too.
+
+ * kwq/KWQDummyView.h: Added.
+ * kwq/KWQDummyView.m: Added.
+ * WebCore.pbproj/project.pbxproj: Added KWQDummyView.
+
+ * kwq/WebCoreBridge.h: Remove bridgeOwnsKHTMLView and currentEvent.
+ * kwq/WebCoreBridge.mm:
+ (-[WebCoreBridge createKHTMLViewWithNSView:marginWidth:marginHeight:]):
+ Pass true to setView instead of setting bridgeOwnsKHTMLView.
+ (-[WebCoreBridge removeFromFrame]): Just call setView on the part. It
+ knows how to handle ownership now.
+ (-[WebCoreBridge installInFrame:]): Call setOwnsView instead of setting
+ bridgeOwnsKHTMLView.
+
2002-11-11 Trey Matteson <trey at apple.com>
* khtml/khtml_part.cpp:
diff --git a/WebCore/WebCore.pbproj/project.pbxproj b/WebCore/WebCore.pbproj/project.pbxproj
index 0d5fb20..fec0c5d 100644
--- a/WebCore/WebCore.pbproj/project.pbxproj
+++ b/WebCore/WebCore.pbproj/project.pbxproj
@@ -472,6 +472,7 @@
F5EDAAFA035345D901A80180,
93386B92037045B3008635CE,
517FA6B30370BD6100CA2D3A,
+ 931C8A180380288B008635CE,
);
isa = PBXHeadersBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -703,6 +704,7 @@
F565A27B0352675C01A80180,
93386B93037045B3008635CE,
517FA6B70370C7ED00CA2D3A,
+ 931C8A190380288B008635CE,
);
isa = PBXSourcesBuildPhase;
runOnlyForDeploymentPostprocessing = 0;
@@ -854,6 +856,30 @@
//932
//933
//934
+ 931C8A160380288B008635CE = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = KWQDummyView.h;
+ refType = 4;
+ };
+ 931C8A170380288B008635CE = {
+ fileEncoding = 4;
+ isa = PBXFileReference;
+ path = KWQDummyView.m;
+ refType = 4;
+ };
+ 931C8A180380288B008635CE = {
+ fileRef = 931C8A160380288B008635CE;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
+ 931C8A190380288B008635CE = {
+ fileRef = 931C8A170380288B008635CE;
+ isa = PBXBuildFile;
+ settings = {
+ };
+ };
93386B90037045B3008635CE = {
fileEncoding = 4;
isa = PBXFileReference;
@@ -1027,6 +1053,8 @@
F58784DA02DE375901EA4122,
354F248902EE28590ACA2ACA,
354F248A02EE28590ACA2ACA,
+ 931C8A160380288B008635CE,
+ 931C8A170380288B008635CE,
93CCF7D4033BD43C008635CE,
93CCF7D5033BD43C008635CE,
F58784EE02DE375901EA4122,
diff --git a/WebCore/kwq/KWQKLibrary.h b/WebCore/kwq/KWQDummyView.h
similarity index 90%
copy from WebCore/kwq/KWQKLibrary.h
copy to WebCore/kwq/KWQDummyView.h
index e169eec..7aa4e16 100644
--- a/WebCore/kwq/KWQKLibrary.h
+++ b/WebCore/kwq/KWQDummyView.h
@@ -23,10 +23,11 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include "KWQKIOGlobal.h"
+#import <Cocoa/Cocoa.h>
-class KLibrary
+ at interface KWQDummyView : NSView
{
-public:
- void unload() { }
-};
+ NSWindow *_hardCodedWindow;
+}
+- (id)initWithWindow:(NSWindow *)window;
+ at end
diff --git a/WebCore/kwq/WebCoreTestController.m b/WebCore/kwq/KWQDummyView.m
similarity index 86%
copy from WebCore/kwq/WebCoreTestController.m
copy to WebCore/kwq/KWQDummyView.m
index b4d1172..50d8c0d 100644
--- a/WebCore/kwq/WebCoreTestController.m
+++ b/WebCore/kwq/KWQDummyView.m
@@ -23,12 +23,20 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#import "WebCoreTestController.h"
+#import "KWQDummyView.h"
- at implementation WebCoreTestController
+ at implementation KWQDummyView
-+ (void)setDrawingObserver:(id <WebCoreDrawingObserver>)observer
+- (id)initWithWindow:(NSWindow *)window;
{
+ self = [self init];
+ _hardCodedWindow = window;
+ return self;
+}
+
+- (NSWindow *)window
+{
+ return _hardCodedWindow;
}
@end
diff --git a/WebCore/kwq/KWQKHTMLPart.h b/WebCore/kwq/KWQKHTMLPart.h
index bc94070..450a991 100644
--- a/WebCore/kwq/KWQKHTMLPart.h
+++ b/WebCore/kwq/KWQKHTMLPart.h
@@ -74,7 +74,8 @@ public:
void setBridge(WebCoreBridge *p) { _bridge = p; }
WebCoreBridge *bridge() const { return _bridge; }
- void setView(KHTMLView *view);
+ void setView(KHTMLView *view, bool weOwnIt);
+ void setOwnsView(bool weOwnIt) { _ownsView = weOwnIt; }
KHTMLView *view() const;
void openURL(const KURL &);
@@ -146,6 +147,7 @@ public:
DOM::NodeImpl *selectionEnd() const;
void setCurrentEvent(NSEvent *event);
+
private:
void setPolicyBaseURL(const DOM::DOMString &);
@@ -167,6 +169,7 @@ private:
KWQSignal _completedWithBool;
bool _needsToSetWidgetsAside;
+ bool _ownsView;
NSEvent *_currentEvent;
diff --git a/WebCore/kwq/KWQKHTMLPart.mm b/WebCore/kwq/KWQKHTMLPart.mm
index 83947b5..4fa30f2 100644
--- a/WebCore/kwq/KWQKHTMLPart.mm
+++ b/WebCore/kwq/KWQKHTMLPart.mm
@@ -36,6 +36,7 @@
#import "WebCoreBridge.h"
#import "WebCoreViewFactory.h"
+#import "KWQDummyView.h"
#import "KWQLogging.h"
#undef _KWQ_TIMING
@@ -93,8 +94,8 @@ KWQKHTMLPart::KWQKHTMLPart(KHTMLPart *p)
, _completed(p, SIGNAL(completed()))
, _completedWithBool(p, SIGNAL(completed(bool)))
, _needsToSetWidgetsAside(false)
- , _currentEvent(NULL)
-
+ , _ownsView(false)
+ , _currentEvent(nil)
{
Cache::init();
mutableInstances().prepend(this);
@@ -104,6 +105,10 @@ KWQKHTMLPart::KWQKHTMLPart(KHTMLPart *p)
KWQKHTMLPart::~KWQKHTMLPart()
{
mutableInstances().remove(this);
+ if (_ownsView) {
+ delete d->m_view;
+ }
+ [_currentEvent release];
}
WebCoreBridge *KWQKHTMLPart::bridgeForFrameName(const QString &frameName)
@@ -231,10 +236,14 @@ void KWQKHTMLPart::submitForm(const KURL &u, const URLArgs &args)
}
}
-void KWQKHTMLPart::setView(KHTMLView *view)
+void KWQKHTMLPart::setView(KHTMLView *view, bool weOwnIt)
{
+ if (_ownsView) {
+ delete d->m_view;
+ }
d->m_view = view;
part->setWidget(view);
+ _ownsView = weOwnIt;
}
KHTMLView *KWQKHTMLPart::view() const
@@ -530,10 +539,19 @@ bool KWQKHTMLPart::runJavaScriptPrompt(const QString &prompt, const QString &def
void KWQKHTMLPart::createDummyDocument()
{
if (d->m_doc) {
- return;
+ ASSERT(d->m_view);
+ } else {
+ d->m_doc = DOMImplementationImpl::instance()->createHTMLDocument(d->m_view);
+ d->m_doc->ref();
+
+ ASSERT(d->m_view == 0);
+ KHTMLView *kview = new KHTMLView(part, 0);
+ setView(kview, true);
+
+ NSView *view = [[KWQDummyView alloc] initWithWindow:[_bridge window]];
+ kview->setView(view);
+ [view release];
}
- d->m_doc = DOMImplementationImpl::instance()->createHTMLDocument(d->m_view);
- d->m_doc->ref();
}
void KWQKHTMLPart::setCurrentEvent(NSEvent *event)
diff --git a/WebCore/kwq/WebCoreBridge.h b/WebCore/kwq/WebCoreBridge.h
index bd4c72f..9f682e7 100644
--- a/WebCore/kwq/WebCoreBridge.h
+++ b/WebCore/kwq/WebCoreBridge.h
@@ -80,10 +80,8 @@ enum FrameBorderStyle {
@interface WebCoreBridge : NSObject
{
- KHTMLPart *part;
- KHTMLRenderPart *renderPart;
- BOOL bridgeOwnsKHTMLView;
- NSEvent *currentEvent;
+ KHTMLPart *_part;
+ KHTMLRenderPart *_renderPart;
}
- (void)setRenderPart:(KHTMLRenderPart *)renderPart;
diff --git a/WebCore/kwq/WebCoreBridge.mm b/WebCore/kwq/WebCoreBridge.mm
index efb88d9..6fed3ff 100644
--- a/WebCore/kwq/WebCoreBridge.mm
+++ b/WebCore/kwq/WebCoreBridge.mm
@@ -65,8 +65,8 @@ using khtml::RenderPart;
{
[super init];
- part = new KHTMLPart;
- part->kwq->setBridge(self);
+ _part = new KHTMLPart;
+ _part->kwq->setBridge(self);
return self;
}
@@ -75,62 +75,62 @@ using khtml::RenderPart;
{
[self removeFromFrame];
- if (renderPart) {
- renderPart->deref();
+ if (_renderPart) {
+ _renderPart->deref();
}
- part->kwq->setBridge(nil);
- part->deref();
+ _part->kwq->setBridge(nil);
+ _part->deref();
[super dealloc];
}
- (KHTMLPart *)part
{
- return part;
+ return _part;
}
- (void)setRenderPart:(KHTMLRenderPart *)newPart;
{
newPart->ref();
- if (renderPart) {
- renderPart->deref();
+ if (_renderPart) {
+ _renderPart->deref();
}
- renderPart = newPart;
+ _renderPart = newPart;
}
- (KHTMLRenderPart *)renderPart
{
- return renderPart;
+ return _renderPart;
}
- (void)setParent:(WebCoreBridge *)parent
{
- part->setParent([parent part]);
+ _part->setParent([parent part]);
}
- (void)openURL:(NSURL *)URL
{
- part->openURL([[URL absoluteString] cString]);
+ _part->openURL([[URL absoluteString] cString]);
}
- (void)addData:(NSData *)data withEncoding:(NSString *)encoding
{
- part->kwq->slotData(encoding, NO, (const char *)[data bytes], [data length], NO);
+ _part->kwq->slotData(encoding, NO, (const char *)[data bytes], [data length], NO);
}
- (void)addData:(NSData *)data withOverrideEncoding:(NSString *)encoding
{
- part->kwq->slotData(encoding, YES, (const char *)[data bytes], [data length], NO);
+ _part->kwq->slotData(encoding, YES, (const char *)[data bytes], [data length], NO);
}
- (void)closeURL
{
- part->closeURL();
+ _part->closeURL();
}
- (void)saveDocumentState
{
- DocumentImpl *doc = part->kwq->document();
+ DocumentImpl *doc = _part->kwq->document();
if (doc != 0){
QStringList list = doc->docState();
NSMutableArray *documentState = [[[NSMutableArray alloc] init] autorelease];
@@ -145,7 +145,7 @@ using khtml::RenderPart;
- (void)restoreDocumentState
{
- DocumentImpl *doc = part->kwq->document();
+ DocumentImpl *doc = _part->kwq->document();
if (doc != 0){
NSArray *documentState = [self documentState];
@@ -162,59 +162,57 @@ using khtml::RenderPart;
- (void)end
{
- part->end();
+ _part->end();
}
- (void)createKHTMLViewWithNSView:(NSView *)view marginWidth:(int)mw marginHeight:(int)mh
{
- // If we own the view, delete the old one - otherwise the render part will take care of deleting the view.
+ // If we own the view, delete the old one - otherwise the render _part will take care of deleting the view.
[self removeFromFrame];
- KHTMLView *kview = new KHTMLView(part, 0);
- part->kwq->setView(kview);
+ KHTMLView *kview = new KHTMLView(_part, 0);
+ _part->kwq->setView(kview, true);
kview->setView(view);
if (mw >= 0)
kview->setMarginWidth(mw);
if (mh >= 0)
kview->setMarginHeight(mh);
-
- bridgeOwnsKHTMLView = YES;
}
- (void)scrollToAnchor:(NSString *)a
{
- part->gotoAnchor(QString::fromNSString(a));
+ _part->gotoAnchor(QString::fromNSString(a));
}
- (NSString *)selectedText
{
- return [[part->selectedText().getNSString() copy] autorelease];
+ return [[_part->selectedText().getNSString() copy] autorelease];
}
- (void)selectAll
{
- part->selectAll();
+ _part->selectAll();
}
- (BOOL)isFrameSet
{
- return part->kwq->isFrameSet();
+ return _part->kwq->isFrameSet();
}
- (void)reapplyStyles
{
- return part->reparseConfiguration();
+ return _part->reparseConfiguration();
}
- (void)forceLayout
{
- part->kwq->forceLayout();
+ _part->kwq->forceLayout();
}
- (void)drawRect:(NSRect)rect withPainter:(QPainter *)p
{
- part->kwq->paint(p, QRect(rect));
+ _part->kwq->paint(p, QRect(rect));
}
- (void)drawRect:(NSRect)rect
@@ -251,7 +249,7 @@ using khtml::RenderPart;
- (NSObject *)copyDOMTree:(id <WebCoreDOMTreeCopier>)copier
{
- DocumentImpl *doc = part->kwq->document();
+ DocumentImpl *doc = _part->kwq->document();
if (!doc) {
return nil;
}
@@ -287,7 +285,7 @@ using khtml::RenderPart;
- (NSObject *)copyRenderTree:(id <WebCoreRenderTreeCopier>)copier
{
- RenderObject *renderer = part->kwq->renderer();
+ RenderObject *renderer = _part->kwq->renderer();
if (!renderer) {
return nil;
}
@@ -296,24 +294,20 @@ using khtml::RenderPart;
- (void)removeFromFrame
{
- if (bridgeOwnsKHTMLView) {
- delete part->kwq->view();
- }
- bridgeOwnsKHTMLView = NO;
+ _part->kwq->setView(0, false);
}
- (void)installInFrame:(NSView *)view
{
- part->kwq->view()->setView(view);
-
- // If this isn't the main frame, it must have a render part set, or it
+ // If this isn't the main frame, it must have a render _part set, or it
// won't ever get installed in the view hierarchy.
- ASSERT(self == [self mainFrame] || renderPart != nil);
+ ASSERT(self == [self mainFrame] || _renderPart != nil);
- if (renderPart) {
- renderPart->setWidget(part->kwq->view());
- // Now that the render part is holding the widget, we don't own it any more.
- bridgeOwnsKHTMLView = NO;
+ _part->kwq->view()->setView(view);
+ if (_renderPart) {
+ _renderPart->setWidget(_part->kwq->view());
+ // Now the render part owns the view, so we don't any more.
+ _part->kwq->setOwnsView(false);
}
}
@@ -357,7 +351,7 @@ using khtml::RenderPart;
}
state |= [self stateForEvent:event];
- if (part->kwq->view()) {
+ if (_part->kwq->view()) {
int clickCount = [event clickCount];
// Our behavior here is a little different that Qt. Qt always sends
@@ -367,15 +361,15 @@ using khtml::RenderPart;
// viewportMouseDoubleClickEvent.
if (clickCount > 0 && clickCount % 2 == 0) {
QMouseEvent doubleClickEvent(QEvent::MouseButtonDblClick, QPoint(p), button, state, clickCount);
- part->kwq->setCurrentEvent(event);
- part->kwq->view()->viewportMouseDoubleClickEvent(&doubleClickEvent);
- part->kwq->setCurrentEvent(nil);
+ _part->kwq->setCurrentEvent(event);
+ _part->kwq->view()->viewportMouseDoubleClickEvent(&doubleClickEvent);
+ _part->kwq->setCurrentEvent(nil);
}
else {
QMouseEvent releaseEvent(QEvent::MouseButtonRelease, QPoint(p), button, state, clickCount);
- part->kwq->setCurrentEvent(event);
- part->kwq->view()->viewportMouseReleaseEvent(&releaseEvent);
- part->kwq->setCurrentEvent(nil);
+ _part->kwq->setCurrentEvent(event);
+ _part->kwq->view()->viewportMouseReleaseEvent(&releaseEvent);
+ _part->kwq->setCurrentEvent(nil);
}
}
}
@@ -401,9 +395,9 @@ using khtml::RenderPart;
}
state |= [self stateForEvent:event];
- if (part->kwq->view()) {
+ if (_part->kwq->view()) {
QMouseEvent kEvent(QEvent::MouseButtonPress, QPoint(p), button, state, [event clickCount]);
- part->kwq->view()->viewportMousePressEvent(&kEvent);
+ _part->kwq->view()->viewportMousePressEvent(&kEvent);
}
}
@@ -412,8 +406,8 @@ using khtml::RenderPart;
NSPoint p = [event locationInWindow];
QMouseEvent kEvent(QEvent::MouseMove, QPoint(p), 0, [self stateForEvent:event]);
- if (part->kwq->view()) {
- part->kwq->view()->viewportMouseMoveEvent(&kEvent);
+ if (_part->kwq->view()) {
+ _part->kwq->view()->viewportMouseMoveEvent(&kEvent);
}
}
@@ -422,19 +416,19 @@ using khtml::RenderPart;
NSPoint p = [event locationInWindow];
QMouseEvent kEvent(QEvent::MouseMove, QPoint(p), Qt::LeftButton, Qt::LeftButton);
- if (part->kwq->view()) {
- part->kwq->view()->viewportMouseMoveEvent(&kEvent);
+ if (_part->kwq->view()) {
+ _part->kwq->view()->viewportMouseMoveEvent(&kEvent);
}
}
- (NSURL *)completeURLForDOMString:(const DOMString &)s
{
- return KURL(part->kwq->document()->completeURL(s.string())).getNSURL();
+ return KURL(_part->kwq->document()->completeURL(s.string())).getNSURL();
}
- (NSDictionary *)elementAtPoint:(NSPoint)point
{
- RenderObject *renderer = part->kwq->renderer();
+ RenderObject *renderer = _part->kwq->renderer();
if (!renderer) {
return nil;
}
@@ -468,8 +462,8 @@ using khtml::RenderPart;
}
DOMString target = e->getAttribute(ATTR_TARGET);
- if (target.isEmpty() && part->kwq->document()) {
- target = part->kwq->document()->baseTarget();
+ if (target.isEmpty() && _part->kwq->document()) {
+ target = _part->kwq->document()->baseTarget();
}
if (!target.isEmpty()) {
[elementInfo setObject:target.string().getNSString() forKey:WebCoreElementLinkTarget];
@@ -494,7 +488,7 @@ using khtml::RenderPart;
}
}
- if (part->hasSelection()) {
+ if (_part->hasSelection()) {
[elementInfo setObject:[self selectedText] forKey:WebCoreElementString];
}
@@ -503,21 +497,21 @@ using khtml::RenderPart;
- (BOOL)searchFor:(NSString *)string direction:(BOOL)forward caseSensitive:(BOOL)caseFlag
{
- return part->findTextNext(QString::fromNSString(string), forward, caseFlag, FALSE);
+ return _part->findTextNext(QString::fromNSString(string), forward, caseFlag, FALSE);
}
- (void)jumpToSelection
{
- part->kwq->jumpToSelection();
+ _part->kwq->jumpToSelection();
}
- (void)setTextSizeMultiplier:(float)multiplier
{
int newZoomFactor = (int)rint(multiplier * 100);
- if (part->zoomFactor() == newZoomFactor) {
+ if (_part->zoomFactor() == newZoomFactor) {
return;
}
- part->setZoomFactor(newZoomFactor);
+ _part->setZoomFactor(newZoomFactor);
// setZoomFactor will trigger a timed layout, but we want to do the layout before
// we do any drawing. This takes care of that. Without this we redraw twice.
[self setNeedsLayout];
@@ -525,43 +519,43 @@ using khtml::RenderPart;
- (CFStringEncoding)textEncoding
{
- return KWQCFStringEncodingFromIANACharsetName(part->encoding().getCFString());
+ return KWQCFStringEncodingFromIANACharsetName(_part->encoding().getCFString());
}
- (NSView *)nextKeyView
{
- return part->kwq->nextKeyView(0, KWQSelectingNext);
+ return _part->kwq->nextKeyView(0, KWQSelectingNext);
}
- (NSView *)previousKeyView
{
- return part->kwq->nextKeyView(0, KWQSelectingPrevious);
+ return _part->kwq->nextKeyView(0, KWQSelectingPrevious);
}
- (NSView *)nextKeyViewInsideWebViews
{
- return part->kwq->nextKeyViewInFrameHierarchy(0, KWQSelectingNext);
+ return _part->kwq->nextKeyViewInFrameHierarchy(0, KWQSelectingNext);
}
- (NSView *)previousKeyViewInsideWebViews
{
- return part->kwq->nextKeyViewInFrameHierarchy(0, KWQSelectingPrevious);
+ return _part->kwq->nextKeyViewInFrameHierarchy(0, KWQSelectingPrevious);
}
- (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)string
{
- part->kwq->createDummyDocument();
- return part->executeScript(QString::fromNSString(string)).asString().getNSString();
+ _part->kwq->createDummyDocument();
+ return _part->executeScript(QString::fromNSString(string)).asString().getNSString();
}
- (id<WebDOMDocument>)DOMDocument
{
- return [WebCoreDOMDocument documentWithImpl:part->kwq->document()];
+ return [WebCoreDOMDocument documentWithImpl:_part->kwq->document()];
}
- (void)setSelectionFrom:(id<WebDOMNode>)start startOffset:(int)startOffset to:(id<WebDOMNode>)end endOffset:(int) endOffset
{
- part->kwq->document()->setSelection([(WebCoreDOMNode *)start impl], startOffset, [(WebCoreDOMNode *)end impl], endOffset);
+ _part->kwq->document()->setSelection([(WebCoreDOMNode *)start impl], startOffset, [(WebCoreDOMNode *)end impl], endOffset);
}
static NSAttributedString *attributedString(DOM::NodeImpl *_startNode, int startOffset, DOM::NodeImpl *endNode, int endOffset)
@@ -726,7 +720,7 @@ static NSAttributedString *attributedString(DOM::NodeImpl *_startNode, int start
- (NSAttributedString *)selectedAttributedString
{
- return attributedString (part->kwq->selectionStart(), part->kwq->selectionStartOffset(), part->kwq->selectionEnd(), part->kwq->selectionEndOffset());
+ return attributedString (_part->kwq->selectionStart(), _part->kwq->selectionStartOffset(), _part->kwq->selectionEnd(), _part->kwq->selectionEndOffset());
}
- (NSAttributedString *)attributedStringFrom: (id<WebDOMNode>)startNode startOffset: (int)startOffset to: (id<WebDOMNode>)endNode endOffset: (int)endOffset
@@ -737,56 +731,56 @@ static NSAttributedString *attributedString(DOM::NodeImpl *_startNode, int start
- (id<WebDOMNode>)selectionStart
{
- return [WebCoreDOMNode nodeWithImpl: part->kwq->selectionStart()];
+ return [WebCoreDOMNode nodeWithImpl: _part->kwq->selectionStart()];
}
- (int)selectionStartOffset
{
- return part->kwq->selectionStartOffset();
+ return _part->kwq->selectionStartOffset();
}
- (id<WebDOMNode>)selectionEnd
{
- return [WebCoreDOMNode nodeWithImpl: part->kwq->selectionEnd()];
+ return [WebCoreDOMNode nodeWithImpl: _part->kwq->selectionEnd()];
}
- (int)selectionEndOffset
{
- return part->kwq->selectionEndOffset();
+ return _part->kwq->selectionEndOffset();
}
- (void)setContentType:(NSString*)contentType
{
- KParts::URLArgs args( part->browserExtension()->urlArgs() );
+ KParts::URLArgs args( _part->browserExtension()->urlArgs() );
args.serviceType = QString::fromNSString(contentType);
- part->browserExtension()->setURLArgs(args);
+ _part->browserExtension()->setURLArgs(args);
}
- (void)setName:(NSString *)name
{
- part->setName(QString::fromNSString(name));
+ _part->setName(QString::fromNSString(name));
}
- (NSString *)name
{
- return part->name().getNSString();
+ return _part->name().getNSString();
}
- (NSURL *)URL
{
- return part->url().getNSURL();
+ return _part->url().getNSURL();
}
- (NSString *)referrer
{
- return part->kwq->referrer().getNSString();
+ return _part->kwq->referrer().getNSString();
}
- (int)frameBorderStyle
{
- if (part->kwq->view()->frameStyle() & QFrame::Sunken)
+ if (_part->kwq->view()->frameStyle() & QFrame::Sunken)
return SunkenFrameBorder;
- if (part->kwq->view()->frameStyle() & QFrame::Plain)
+ if (_part->kwq->view()->frameStyle() & QFrame::Plain)
return PlainFrameBorder;
return NoFrameBorder;
}
--
WebKit Debian packaging
More information about the Pkg-webkit-commits
mailing list