Reviewed by Maciej.
This is the initial foundation for the EditingController class and
everything else it needs to work. The idea is that the Frame has an
EditingController object that it calls to handle editing commands, the
most simple examples being copy/paste. This controller will handle
these editing commands in WebCore, and only hand off to WebKit to call
editing delegates (to the let the app intercept editing actions if it
wants to). Thus we need a platform-specific client to which the
EditingController hands off the delegate calls,
WebCoreEditingControllerClient. On the WebCore side this is an
abstract base class, and on the WebKit(Mac) side this is an ObjC++
subclass, WebEditingControllerClient. How does the EditingController
get a handle to its platform-specific client? In WebKit, the creator
of a platform-specific Frame creates the client (which is ref-counted)
and passes it down the chain of constructors until it gets back to the
EditingController, which then refs it in its constructor and derefs in
its destructor.
No Layout tests needed.
* WebCore.xcodeproj/project.pbxproj:
Added files and made DomRangeInternal.h and EditingClient.h private headers, necessary for WebKit to compile
* bridge/EditorClient.h: Added.
(WebCore::EditorClient::~EditorClient):
* bridge/mac/FrameMac.h:
Added an EditingClient to the constructor, to pass down to Frame constructor
* bridge/mac/FrameMac.mm:
(WebCore::FrameMac::FrameMac):
Passed client down to Frame constructor
* bridge/mac/WebCoreFrameBridge.h:
Added an EditingClient to the constructor, to pass down to FrameMac constructor
* bridge/mac/WebCoreFrameBridge.mm:
(-[WebCoreFrameBridge initMainFrameWithPage:withEditorClient:]):
(-[WebCoreFrameBridge initSubframeWithOwnerElement:withEditorClient:]):
Passed client down to FrameMac constructor
* editing/Editor.cpp: Added.
Mostly stuf implementations of the following functions, except for a couple. These are all needed by cut, copy, paste, delete.
(WebCore::generalPasteboard):
(WebCore::Editor::canCopy):
(WebCore::Editor::canCut):
(WebCore::Editor::canDelete):
(WebCore::Editor::canDeleteRange):
(WebCore::Editor::canPaste):
(WebCore::Editor::canSmartCopyOrDelete):
(WebCore::Editor::deleteSelection):
(WebCore::Editor::deleteSelectionWithSmartDelete):
(WebCore::Editor::isSelectionRichlyEditable):
(WebCore::Editor::pasteAsPlainTextWithPasteboard):
(WebCore::Editor::pasteWithPasteboard):
(WebCore::Editor::selectedRange):
(WebCore::Editor::shouldDeleteRange):
(WebCore::Editor::tryDHTMLCopy):
(WebCore::Editor::tryDHTMLCut):
(WebCore::Editor::tryDHTMLPaste):
(WebCore::Editor::writeSelectionToPasteboard):
(WebCore::Editor::Editor):
(WebCore::Editor::~Editor):
(WebCore::Editor::cut):
(WebCore::Editor::copy):
(WebCore::Editor::paste):
(WebCore::Editor::performDelete):
* editing/Editor.h: Added.
* page/Frame.h:
Added an EditingClient to the constructor, to pass down to Editor constructor
* page/Frame.cpp:
(WebCore::Frame::Frame):
Passed down to Editor constructor
(WebCore::Frame::editor):
Accessfor for Editor stored in FramePrivate
* page/FramePrivate.h:
(WebCore::FramePrivate::FramePrivate):
Added an Editor object to the FramePrivate data
* platform/Sound.h: Added.
Made a platform-independent accessor to a beep function
* platform/mac/SoundMac.mm: Added.
(WebCore::systemBeep):
calls mac system beep
WebKit:
Reviewed by Maciej.
Adding knowledge of EditorClient to WebKit
* WebCoreSupport/WebEditorClient.h: Added.
* WebCoreSupport/WebEditorClient.mm: Added.
(WebEditorClient::WebEditorClient):
(WebEditorClient::~WebEditorClient):
(WebEditorClient::shouldDeleteRange):
Implementation of mac EditorClient
* WebCoreSupport/WebFrameBridge.m:
(-[WebFrameBridge initMainFrameWithPage:frameName:view:]):
(-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]):
create an editor client to pass down the chain of constructors
* WebKit.xcodeproj/project.pbxproj:
Added related EditorClient files
* WebKitPrefix.h:
Added tiger build flag in order to make certain private headers from webcore compile successfully
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17179
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2006-10-20 Alice Liu <alice.liu@apple.com>
+
+ Reviewed by Maciej.
+
+ This is the initial foundation for the EditingController class and
+ everything else it needs to work. The idea is that the Frame has an
+ EditingController object that it calls to handle editing commands, the
+ most simple examples being copy/paste. This controller will handle
+ these editing commands in WebCore, and only hand off to WebKit to call
+ editing delegates (to the let the app intercept editing actions if it
+ wants to). Thus we need a platform-specific client to which the
+ EditingController hands off the delegate calls,
+ WebCoreEditingControllerClient. On the WebCore side this is an
+ abstract base class, and on the WebKit(Mac) side this is an ObjC++
+ subclass, WebEditingControllerClient. How does the EditingController
+ get a handle to its platform-specific client? In WebKit, the creator
+ of a platform-specific Frame creates the client (which is ref-counted)
+ and passes it down the chain of constructors until it gets back to the
+ EditingController, which then refs it in its constructor and derefs in
+ its destructor.
+
+ No Layout tests needed.
+
+ * WebCore.xcodeproj/project.pbxproj:
+ Added files and made DomRangeInternal.h and EditingClient.h private headers, necessary for WebKit to compile
+
+ * bridge/EditorClient.h: Added.
+ (WebCore::EditorClient::~EditorClient):
+
+ * bridge/mac/FrameMac.h:
+ Added an EditingClient to the constructor, to pass down to Frame constructor
+
+ * bridge/mac/FrameMac.mm:
+ (WebCore::FrameMac::FrameMac):
+ Passed client down to Frame constructor
+
+ * bridge/mac/WebCoreFrameBridge.h:
+ Added an EditingClient to the constructor, to pass down to FrameMac constructor
+
+ * bridge/mac/WebCoreFrameBridge.mm:
+ (-[WebCoreFrameBridge initMainFrameWithPage:withEditorClient:]):
+ (-[WebCoreFrameBridge initSubframeWithOwnerElement:withEditorClient:]):
+ Passed client down to FrameMac constructor
+
+ * editing/Editor.cpp: Added.
+ Mostly stuf implementations of the following functions, except for a couple. These are all needed by cut, copy, paste, delete.
+ (WebCore::generalPasteboard):
+ (WebCore::Editor::canCopy):
+ (WebCore::Editor::canCut):
+ (WebCore::Editor::canDelete):
+ (WebCore::Editor::canDeleteRange):
+ (WebCore::Editor::canPaste):
+ (WebCore::Editor::canSmartCopyOrDelete):
+ (WebCore::Editor::deleteSelection):
+ (WebCore::Editor::deleteSelectionWithSmartDelete):
+ (WebCore::Editor::isSelectionRichlyEditable):
+ (WebCore::Editor::pasteAsPlainTextWithPasteboard):
+ (WebCore::Editor::pasteWithPasteboard):
+ (WebCore::Editor::selectedRange):
+ (WebCore::Editor::shouldDeleteRange):
+ (WebCore::Editor::tryDHTMLCopy):
+ (WebCore::Editor::tryDHTMLCut):
+ (WebCore::Editor::tryDHTMLPaste):
+ (WebCore::Editor::writeSelectionToPasteboard):
+ (WebCore::Editor::Editor):
+ (WebCore::Editor::~Editor):
+ (WebCore::Editor::cut):
+ (WebCore::Editor::copy):
+ (WebCore::Editor::paste):
+ (WebCore::Editor::performDelete):
+
+ * editing/Editor.h: Added.
+
+ * page/Frame.h:
+ Added an EditingClient to the constructor, to pass down to Editor constructor
+
+ * page/Frame.cpp:
+ (WebCore::Frame::Frame):
+ Passed down to Editor constructor
+ (WebCore::Frame::editor):
+ Accessfor for Editor stored in FramePrivate
+
+ * page/FramePrivate.h:
+ (WebCore::FramePrivate::FramePrivate):
+ Added an Editor object to the FramePrivate data
+
+ * platform/Sound.h: Added.
+ Made a platform-independent accessor to a beep function
+
+ * platform/mac/SoundMac.mm: Added.
+ (WebCore::systemBeep):
+ calls mac system beep
+
2006-10-20 David Hyatt <hyatt@apple.com>
Make sure to support the "encoding" property on form elements for
448A29BF0A46D9CB0030759F /* JSHTMLOptionsCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 448A29BD0A46D9CB0030759F /* JSHTMLOptionsCollection.h */; };
448A29C00A46D9CB0030759F /* JSHTMLOptionsCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 448A29BE0A46D9CB0030759F /* JSHTMLOptionsCollection.cpp */; };
448AD27C0A48137A0023D179 /* JSHTMLOptionsCollectionCustom.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 448AD27A0A4813790023D179 /* JSHTMLOptionsCollectionCustom.cpp */; };
+ 4B3043B60AE0363200A82647 /* EditorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3043B50AE0363200A82647 /* EditorClient.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 4B3043C70AE0370300A82647 /* Sound.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3043C60AE0370300A82647 /* Sound.h */; };
+ 4B3043C90AE0371D00A82647 /* SoundMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4B3043C80AE0371D00A82647 /* SoundMac.mm */; };
+ 4B3043CC0AE0373B00A82647 /* Editor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4B3043CA0AE0373B00A82647 /* Editor.cpp */; };
+ 4B3043CD0AE0373B00A82647 /* Editor.h in Headers */ = {isa = PBXBuildFile; fileRef = 4B3043CB0AE0373B00A82647 /* Editor.h */; };
4BBDBF7D0ACC9290005F6E97 /* CommandByName.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4BBDBF7B0ACC9290005F6E97 /* CommandByName.cpp */; };
4BBDBF7E0ACC9290005F6E97 /* CommandByName.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BBDBF7C0ACC9290005F6E97 /* CommandByName.h */; };
4E1959210A39DABA00220FE5 /* MediaFeatureNames.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 4E19591F0A39DABA00220FE5 /* MediaFeatureNames.cpp */; };
8538F0300AD71CDB006A81D1 /* DOMAbstractView.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8538F0160AD718D8006A81D1 /* DOMAbstractView.h */; };
8538F05B0AD722F1006A81D1 /* DOMRange.h in Headers */ = {isa = PBXBuildFile; fileRef = 8538F0580AD722F1006A81D1 /* DOMRange.h */; };
8538F05C0AD722F1006A81D1 /* DOMRange.mm in Sources */ = {isa = PBXBuildFile; fileRef = 8538F0590AD722F1006A81D1 /* DOMRange.mm */; };
- 8538F05D0AD722F1006A81D1 /* DOMRangeInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 8538F05A0AD722F1006A81D1 /* DOMRangeInternal.h */; };
+ 8538F05D0AD722F1006A81D1 /* DOMRangeInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 8538F05A0AD722F1006A81D1 /* DOMRangeInternal.h */; settings = {ATTRIBUTES = (Private, ); }; };
8538F0850AD72CB6006A81D1 /* DOMRanges.h in Headers */ = {isa = PBXBuildFile; fileRef = 8538F0840AD72CB6006A81D1 /* DOMRanges.h */; settings = {ATTRIBUTES = (Private, ); }; };
8538F08C0AD72E0A006A81D1 /* DOMRange.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = 8538F0580AD722F1006A81D1 /* DOMRange.h */; };
853BF4DB0ABB6B55008647BB /* DOMNode.h in Headers */ = {isa = PBXBuildFile; fileRef = 853BF4D90ABB6B55008647BB /* DOMNode.h */; };
448A29BD0A46D9CB0030759F /* JSHTMLOptionsCollection.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSHTMLOptionsCollection.h; sourceTree = "<group>"; };
448A29BE0A46D9CB0030759F /* JSHTMLOptionsCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLOptionsCollection.cpp; sourceTree = "<group>"; };
448AD27A0A4813790023D179 /* JSHTMLOptionsCollectionCustom.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHTMLOptionsCollectionCustom.cpp; sourceTree = "<group>"; };
+ 4B3043B50AE0363200A82647 /* EditorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = EditorClient.h; sourceTree = "<group>"; };
+ 4B3043C60AE0370300A82647 /* Sound.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Sound.h; sourceTree = "<group>"; };
+ 4B3043C80AE0371D00A82647 /* SoundMac.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = SoundMac.mm; sourceTree = "<group>"; };
+ 4B3043CA0AE0373B00A82647 /* Editor.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Editor.cpp; sourceTree = "<group>"; };
+ 4B3043CB0AE0373B00A82647 /* Editor.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = Editor.h; sourceTree = "<group>"; };
4BBDBF7B0ACC9290005F6E97 /* CommandByName.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = CommandByName.cpp; sourceTree = "<group>"; };
4BBDBF7C0ACC9290005F6E97 /* CommandByName.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = CommandByName.h; sourceTree = "<group>"; };
4E19591F0A39DABA00220FE5 /* MediaFeatureNames.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = MediaFeatureNames.cpp; sourceTree = "<group>"; };
9353676A09AED88B00D35CD6 /* ScrollViewMac.mm */,
93309E9F099EB78C0056E581 /* SharedTimerMac.cpp */,
BC86FB8E061F5C23006BB822 /* SliderMac.mm */,
+ 4B3043C80AE0371D00A82647 /* SoundMac.mm */,
84B2B24F056BF15F00D2B771 /* SSLKeyGeneratorMac.mm */,
93B0FD880A759BED0080AD44 /* StringImplMac.mm */,
93B0FD890A759BED0080AD44 /* StringMac.mm */,
65BF02350974819000C43196 /* mac */,
55998A5C052B59CC0017A6C1 /* AXObjectCache.h */,
BCEA4943097F0F5C0094C9E4 /* BrowserExtension.h */,
+ 4B3043B50AE0363200A82647 /* EditorClient.h */,
935C475C09AC4CA000A6AAB4 /* History.h */,
14FD6DFC0AE5EA1B00AD67AD /* WindowFeatures.h */,
);
93309D93099E64910056E581 /* EditAction.h */,
93309D94099E64910056E581 /* EditCommand.cpp */,
93309D95099E64910056E581 /* EditCommand.h */,
+ 4B3043CA0AE0373B00A82647 /* Editor.cpp */,
+ 4B3043CB0AE0373B00A82647 /* Editor.h */,
93309D98099E64910056E581 /* htmlediting.cpp */,
93309D99099E64910056E581 /* htmlediting.h */,
93309D96099E64910056E581 /* HTMLInterchange.cpp */,
BCFB2E830979FD4F00BA703D /* Shared.h */,
93309EA0099EB78C0056E581 /* SharedTimer.h */,
BC86FB8D061F5C23006BB822 /* Slider.h */,
+ 4B3043C60AE0370300A82647 /* Sound.h */,
F587866202DE3B1101EA4122 /* SSLKeyGenerator.h */,
9352071709BD3BA500F2038D /* StaticConstructors.h */,
657BD74909AFDC54005A2056 /* StreamingTextDecoder.cpp */,
93B77B1D0ADDA10700EA4B81 /* UChar.h in Headers */,
0668E18B0ADD9624004128E0 /* PopupMenu.h in Headers */,
6563A9A70ADF4094000ED2CD /* LoaderNSURLRequestExtras.h in Headers */,
+ 4B3043B60AE0363200A82647 /* EditorClient.h in Headers */,
+ 4B3043C70AE0370300A82647 /* Sound.h in Headers */,
+ 4B3043CD0AE0373B00A82647 /* Editor.h in Headers */,
14FFE31D0AE1963300136BF5 /* HTMLFrameElementBase.h in Headers */,
658436860AE01B7400E53753 /* FrameLoadRequest.h in Headers */,
14FD6DFD0AE5EA1B00AD67AD /* WindowFeatures.h in Headers */,
656D37490ADBA5DE00A4554D /* WebSubresourceLoader.mm in Sources */,
0668E1900ADD9640004128E0 /* PopupMenuMac.mm in Sources */,
6563A9A80ADF4094000ED2CD /* LoaderNSURLRequestExtras.m in Sources */,
+ 4B3043C90AE0371D00A82647 /* SoundMac.mm in Sources */,
+ 4B3043CC0AE0373B00A82647 /* Editor.cpp in Sources */,
14FFE31E0AE1963300136BF5 /* HTMLFrameElementBase.cpp in Sources */,
8542A7940AE5C94000DF58DF /* JSSVGRect.cpp in Sources */,
8542A7960AE5C94200DF58DF /* JSSVGPoint.cpp in Sources */,
--- /dev/null
+/*
+ * Copyright (C) 2006 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.
+ */
+
+#ifndef Editor_Client_h__
+#define Editor_Client_h__
+
+#include "Shared.h"
+
+namespace WebCore {
+
+class Range;
+
+class EditorClient : public Shared<EditorClient>{
+public:
+ virtual ~EditorClient() { }
+
+ virtual bool shouldDeleteRange(Range *range) = 0;
+// virtual bool shouldBeginEditingInRange(Range *range) = 0;
+// virtual bool shouldEndEditingInRange(Range *range) = 0;
+// virtual bool shouldInsertNode(Node *node, Range* replacingRange, WebViewInsertAction givenAction) = 0;
+// virtual bool shouldInsertText(NSString *text, Range *replacingRange, WebViewInsertAction givenAction) = 0;
+// virtual bool shouldChangeSelectedRange(Range *currentRange, Range *toProposedRange, NSSelectionAffinity selectionAffinity, bool stillSelecting) = 0;
+// virtual bool shouldApplyStyle(CSSStyleDeclaration *style, Range *toElementsInDOMRange) = 0;
+// virtual bool shouldChangeTypingStyle(CSSStyleDeclaration *currentStyle, CSSStyleDeclaration *toProposedStyle) = 0;
+// virtual bool doCommandBySelector(SEL selector) = 0;
+//
+// virtual void webViewDidBeginEditing:(NSNotification *)notification = 0;
+// virtual void webViewDidChange:(NSNotification *)notification = 0;
+// virtual void webViewDidEndEditing:(NSNotification *)notification = 0;
+// virtual void webViewDidChangeTypingStyle:(NSNotification *)notification = 0;
+// virtual void webViewDidChangeSelection:(NSNotification *)notification = 0;
+// virtual NSUndoManager* undoManagerForWebView:(WebView *)webView = 0;
+
+};
+
+}
+
+#endif // Editor_Client_h__
namespace WebCore {
class DocumentFragment;
+class EditorClient;
class FramePrivate;
class HTMLTableCellElement;
class RenderObject;
class FrameMac : public Frame
{
public:
- FrameMac(Page*, Element*);
+ FrameMac(Page*, Element*, EditorClient*);
~FrameMac();
void clear();
return selector;
}
-FrameMac::FrameMac(Page* page, Element* ownerElement)
- : Frame(page, ownerElement)
+FrameMac::FrameMac(Page* page, Element* ownerElement, EditorClient* client)
+ : Frame(page, ownerElement, client)
, _bridge(nil)
, _mouseDownView(nil)
, _sendingEventToSubview(false)
namespace WebCore {
class FrameMac;
class Element;
+ class EditorClient;
}
typedef WebCore::FrameMac WebCoreMacFrame;
typedef WebCore::Element WebCoreElement;
+typedef WebCore::EditorClient WebCoreEditorClient;
#else
@class NSMenu;
@class WebCoreMacFrame;
@class WebCoreElement;
+@class WebCoreEditorClient;
#endif
+ (WebCoreFrameBridge *)bridgeForDOMDocument:(DOMDocument *)document;
-- (id)initMainFrameWithPage:(WebCorePageBridge *)page;
-- (id)initSubframeWithOwnerElement:(WebCoreElement *)ownerElement;
+- (id)initMainFrameWithPage:(WebCorePageBridge *)page withEditorClient:(WebCoreEditorClient *)client;
+- (id)initSubframeWithOwnerElement:(WebCoreElement *)ownerElement withEditorClient:(WebCoreEditorClient *)client;
- (void)close;
#import "DocLoader.h"
#import "DocumentFragment.h"
#import "DocumentType.h"
+#import "EditorClient.h"
#import "FloatRect.h"
#import "FoundationExtras.h"
#import "FrameMac.h"
return bridge([document _document]->frame());
}
-- (id)initMainFrameWithPage:(WebCorePageBridge *)page
+- (id)initMainFrameWithPage:(WebCorePageBridge *)page withEditorClient:(WebCoreEditorClient *)client
{
if (!initializedKJS) {
mainThread = pthread_self();
if (!(self = [super init]))
return nil;
- m_frame = new FrameMac([page impl], 0);
+ m_frame = new FrameMac([page impl], 0, client);
m_frame->setBridge(self);
_shouldCreateRenderers = YES;
return self;
}
-- (id)initSubframeWithOwnerElement:(Element *)ownerElement
+- (id)initSubframeWithOwnerElement:(Element *)ownerElement withEditorClient:(WebCoreEditorClient *)client
{
if (!(self = [super init]))
return nil;
- m_frame = new FrameMac(ownerElement->document()->frame()->page(), ownerElement);
+ m_frame = new FrameMac(ownerElement->document()->frame()->page(), ownerElement, client);
m_frame->setBridge(self);
_shouldCreateRenderers = YES;
--- /dev/null
+/*
+ * Copyright (C) 2006 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.
+ */
+
+#include "config.h"
+#include "Editor.h"
+
+#include "Frame.h"
+#include "Range.h"
+#include "Sound.h"
+#include "EditorClient.h"
+
+namespace WebCore {
+
+// implement as platform-specific
+Pasteboard generalPasteboard()
+{
+ return 0;
+}
+
+bool Editor::canCopy()
+{ return false; }
+
+bool Editor::canCut()
+{ return false; }
+
+bool Editor::canDelete()
+{ return false; }
+
+bool Editor::canDeleteRange(Range* range)
+{
+ ExceptionCode ec = 0;
+ Node *startContainer = range->startContainer(ec);
+ Node *endContainer = range->endContainer(ec);
+ if (!startContainer || !endContainer)
+ return false;
+
+ if (!startContainer->isContentEditable() || !endContainer->isContentEditable())
+ return false;
+
+ if (range->collapsed(ec)) {
+ VisiblePosition start(startContainer, range->startOffset(ec), DOWNSTREAM);
+ VisiblePosition previous = start.previous();
+ // FIXME: We sometimes allow deletions at the start of editable roots, like when the caret is in an empty list item.
+ if (previous.isNull() || previous.deepEquivalent().node()->rootEditableElement() != startContainer->rootEditableElement())
+ return false;
+ }
+ return true;
+}
+
+bool Editor::canPaste()
+{ return false; }
+
+bool Editor::canSmartCopyOrDelete()
+{ return false; }
+
+void Editor::deleteSelection()
+{}
+
+void Editor::deleteSelectionWithSmartDelete(bool enabled)
+{}
+
+bool Editor::isSelectionRichlyEditable()
+{ return false; }
+
+void Editor::pasteAsPlainTextWithPasteboard(Pasteboard pasteboard)
+{}
+
+void Editor::pasteWithPasteboard(Pasteboard pasteboard, bool allowPlainText)
+{}
+
+Range* Editor::selectedRange()
+{ return NULL; }
+
+bool Editor::shouldDeleteRange(Range* range)
+{
+ ExceptionCode ec;
+ if (!range || range->collapsed(ec))
+ return false;
+
+ if (!canDeleteRange(range))
+ return false;
+
+ return m_client->shouldDeleteRange(range);
+ }
+
+bool Editor::tryDHTMLCopy()
+{
+ bool handled = false;
+ return handled;
+}
+
+bool Editor::tryDHTMLCut()
+{
+ bool handled = false;
+ return handled;
+}
+
+bool Editor::tryDHTMLPaste()
+{
+ bool handled = false;
+ return handled;
+}
+
+void Editor::writeSelectionToPasteboard(Pasteboard pasteboard)
+{}
+
+// =============================================================================
+//
+// public editing commands
+//
+// =============================================================================
+
+Editor::Editor(Frame* frame, EditorClient* client)
+ : m_frame(frame)
+ , m_client(client)
+{
+ m_client->ref();
+}
+
+Editor::~Editor()
+{
+ m_client->deref();
+}
+
+void Editor::cut()
+{
+ if (tryDHTMLCut())
+ return; // DHTML did the whole operation
+ if (!canCut()) {
+ systemBeep();
+ return;
+ }
+
+ if (shouldDeleteRange(selectedRange())) {
+ writeSelectionToPasteboard(generalPasteboard());
+ deleteSelectionWithSmartDelete(canSmartCopyOrDelete());
+ }
+}
+
+void Editor::copy()
+{
+
+ if (tryDHTMLCopy())
+ return; // DHTML did the whole operation
+ if (!canCopy()) {
+ systemBeep();
+ return;
+ }
+ writeSelectionToPasteboard(generalPasteboard());
+}
+
+void Editor::paste()
+{
+ if (tryDHTMLPaste())
+ return; // DHTML did the whole operation
+ if (!canPaste())
+ return;
+ if (isSelectionRichlyEditable())
+ pasteWithPasteboard(generalPasteboard(), true);
+ else
+ pasteAsPlainTextWithPasteboard(generalPasteboard());
+}
+
+void Editor::performDelete()
+{
+ if (!canDelete()) {
+ systemBeep();
+ return;
+ }
+ deleteSelection();
+}
+
+} // namespace WebCore
--- /dev/null
+/*
+ * Copyright (C) 2006 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.
+ */
+
+#ifndef editor_h__
+#define editor_h__
+
+namespace WebCore {
+
+class Frame;
+class Range;
+class EditorClient;
+
+// make platform-specific and implement - this is temporary placeholder
+typedef int Pasteboard;
+
+class Editor {
+public:
+ Editor(Frame* frame, EditorClient* client);
+ ~Editor();
+
+ void cut();
+ void copy();
+ void paste();
+ void performDelete();
+
+private:
+ Frame* m_frame;
+ EditorClient* m_client;
+
+ bool canCopy();
+ bool canCut();
+ bool canDelete();
+ bool canDeleteRange(Range* range);
+ bool canPaste();
+ bool canSmartCopyOrDelete();
+ bool isSelectionRichlyEditable();
+ Range* selectedRange();
+ bool shouldDeleteRange(Range* range);
+ bool tryDHTMLCopy();
+ bool tryDHTMLCut();
+ bool tryDHTMLPaste();
+ void deleteSelection();
+ void deleteSelectionWithSmartDelete(bool enabled);
+ void pasteAsPlainTextWithPasteboard(Pasteboard pasteboard);
+ void pasteWithPasteboard(Pasteboard pasteboard, bool allowPlainText);
+ void writeSelectionToPasteboard(Pasteboard pasteboard);
+
+};
+
+} // namespace WebCore
+
+#endif // editor_h__
return ownerElement->document()->frame();
}
-Frame::Frame(Page* page, Element* ownerElement)
- : d(new FramePrivate(page, parentFromOwnerElement(ownerElement), this, ownerElement))
+Frame::Frame(Page* page, Element* ownerElement, EditorClient* client)
+ : d(new FramePrivate(page, parentFromOwnerElement(ownerElement), this, ownerElement, client))
{
AtomicString::init();
EventNames::init();
return &(d->m_selectionController);
}
+Editor* Frame::editor() const
+{
+ return &(d->m_editor);
+}
+
CommandByName* Frame::command() const
{
return &(d->m_command);
class DrawContentsEvent;
class DOMWindow;
class EditCommand;
+class Editor;
+class EditorClient;
class FormData;
class FramePrivate;
class FrameLoadRequest;
public:
enum { NoXPosForVerticalArrowNavigation = INT_MIN };
- Frame(Page*, Element*);
+ Frame(Page*, Element*, EditorClient*);
virtual ~Frame();
virtual bool openURL(const KURL&);
SelectionController* selectionController() const;
SelectionController* dragCaretController() const;
DOMWindow* domWindow() const;
-
+ Editor* editor() const;
CommandByName* command() const;
private:
friend class FramePrivate;
#include "DOMWindow.h"
#include "Decoder.h"
#include "EditCommand.h"
+#include "Editor.h"
#include "FormData.h"
#include "Frame.h"
#include "FrameTree.h"
class FramePrivate {
public:
- FramePrivate(Page* page, Frame* parent, Frame* thisFrame, Element* ownerElement)
+ FramePrivate(Page* page, Frame* parent, Frame* thisFrame, Element* ownerElement, EditorClient* client)
: m_page(page)
, m_treeNode(thisFrame, parent)
, m_ownerElement(ownerElement)
, m_bMousePressed(false)
, m_selectionController(thisFrame)
, m_caretBlinkTimer(thisFrame, &Frame::caretBlinkTimerFired)
+ , m_editor(thisFrame, client)
, m_command(thisFrame)
, m_caretVisible(false)
, m_caretPaint(true)
SelectionController m_selectionController;
Selection m_mark;
Timer<Frame> m_caretBlinkTimer;
-
+ Editor m_editor;
CommandByName m_command;
bool m_caretVisible : 1;
--- /dev/null
+/*
+ * Copyright (C) 2006 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.
+ */
+
+#ifndef WebCoreSound_h
+#define WebCoreSound_h
+
+namespace WebCore {
+
+ void systemBeep();
+
+} // namespace WebCore
+
+#endif // WebCoreSound_h
--- /dev/null
+/*
+ * Copyright (C) 2006 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 "config.h"
+#import "Sound.h"
+
+namespace WebCore {
+
+void systemBeep() { NSBeep(); }
+
+} // namespace WebCore
+2006-10-20 Alice Liu <alice.liu@apple.com>
+
+ Reviewed by Maciej.
+
+ Adding knowledge of EditorClient to WebKit
+
+ * WebCoreSupport/WebEditorClient.h: Added.
+
+ * WebCoreSupport/WebEditorClient.mm: Added.
+ (WebEditorClient::WebEditorClient):
+ (WebEditorClient::~WebEditorClient):
+ (WebEditorClient::shouldDeleteRange):
+ Implementation of mac EditorClient
+
+ * WebCoreSupport/WebFrameBridge.m:
+ (-[WebFrameBridge initMainFrameWithPage:frameName:view:]):
+ (-[WebFrameBridge initSubframeWithOwnerElement:frameName:view:]):
+ create an editor client to pass down the chain of constructors
+
+ * WebKit.xcodeproj/project.pbxproj:
+ Added related EditorClient files
+
+ * WebKitPrefix.h:
+ Added tiger build flag in order to make certain private headers from webcore compile successfully
+
2006-10-20 Darin Adler <darin@apple.com>
- rolled out my loader change; caused world leak and possibly a plug-in crash
--- /dev/null
+/*
+ * Copyright (C) 2006 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 <WebCore/EditorClient.h>
+
+@class WebView;
+
+class WebEditorClient : public WebCore::EditorClient
+{
+public:
+ WebEditorClient(WebView* webView);
+ ~WebEditorClient();
+
+ bool shouldDeleteRange(WebCore::Range *range);
+// bool shouldBeginEditingInRange(Range *range);
+// bool shouldEndEditingInRange(Range *range);
+// bool shouldInsertNode(Node *node, Range* replacingRange, WebViewInsertAction givenAction);
+// bool shouldInsertText(NSString *text, Range *replacingRange, WebViewInsertActiongivenAction);
+// bool shouldChangeSelectedRange(Range *currentRange, Range *toProposedRange, NSSelectionAffinity selectionAffinity, bool stillSelecting);
+// bool shouldApplyStyle(CSSStyleDeclaration *style, Range *toElementsInDOMRange);
+// bool shouldChangeTypingStyle(CSSStyleDeclaration *currentStyle, CSSStyleDeclaration *toProposedStyle);
+// bool doCommandBySelector(SEL selector);
+
+// void webViewDidBeginEditing:(NSNotification *)notification;
+// void webViewDidChange:(NSNotification *)notification;
+// void webViewDidEndEditing:(NSNotification *)notification;
+// void webViewDidChangeTypingStyle:(NSNotification *)notification;
+// void webViewDidChangeSelection:(NSNotification *)notification;
+// NSUndoManager* undoManagerForWebView:(WebView *)webView;
+
+private:
+ WebView *m_webView;
+};
--- /dev/null
+/*
+ * Copyright (C) 2006 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.
+ * 3. Neither the name of Apple Computer, Inc. ("Apple") nor the names of
+ * its contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE AND ITS CONTRIBUTORS "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 OR ITS 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 "WebEditorClient.h"
+
+#import "WebView.h"
+#import "WebViewInternal.h"
+#import <WebCore/DOMRangeInternal.h>
+#import "WebEditingDelegate.h"
+
+using namespace WebCore;
+
+WebEditorClient::WebEditorClient(WebView* webView)
+ : m_webView(webView)
+{
+ [m_webView retain];
+}
+
+WebEditorClient::~WebEditorClient()
+{
+ [m_webView release];
+}
+
+bool WebEditorClient::shouldDeleteRange(Range *range)
+{
+ return [[m_webView _editingDelegateForwarder] webView:m_webView shouldDeleteDOMRange:[DOMRange _rangeWith:range]];
+}
+
+/*
+bool WebEditorClient::shouldBeginEditingInRange(Range *range) { return false; }
+bool WebEditorClient::shouldEndEditingInRange(Range *range) { return false; }
+bool WebEditorClient::shouldInsertNode(Node *node, Range* replacingRange, WebViewInsertAction givenAction) { return false; }
+bool WebEditorClient::shouldInsertText(NSString *text, Range *replacingRange, WebViewInsertActiongivenAction) { return false; }
+bool WebEditorClient::shouldChangeSelectedRange(Range *currentRange, Range *toProposedRange, NSSelectionAffinity selectionAffinity, bool stillSelecting) { return false; }
+bool WebEditorClient::shouldApplyStyle(CSSStyleDeclaration *style, Range *toElementsInDOMRange) { return false; }
+bool WebEditorClient::shouldChangeTypingStyle(CSSStyleDeclaration *currentStyle, CSSStyleDeclaration *toProposedStyle) { return false; }
+bool WebEditorClient::doCommandBySelector(SEL selector) { return false; }
+
+void WebEditorClient::webViewDidBeginEditing:(NSNotification *)notification { }
+void WebEditorClient::webViewDidChange:(NSNotification *)notification { }
+void WebEditorClient::webViewDidEndEditing:(NSNotification *)notification { }
+void WebEditorClient::webViewDidChangeTypingStyle:(NSNotification *)notification { }
+void WebEditorClient::webViewDidChangeSelection:(NSNotification *)notification { }
+NSUndoManager* WebEditorClient::undoManagerForWebView:(WebView *)webView { return NULL; }
+*/
#import "WebDataSourceInternal.h"
#import "WebDefaultUIDelegate.h"
#import "WebEditingDelegate.h"
+#import "WebEditorClient.h"
#import "WebFormDelegate.h"
#import "WebFrameInternal.h"
#import "WebFrameLoadDelegate.h"
- (id)initMainFrameWithPage:(WebPageBridge *)page frameName:(NSString *)name view:(WebFrameView *)view
{
- self = [super initMainFrameWithPage:page];
+ self = [super initMainFrameWithPage:page withEditorClient:new WebEditorClient([view _webView])];
_frame = [[WebFrame alloc] _initWithWebFrameView:view webView:[self webView] bridge:self];
++WebBridgeCount;
- (id)initSubframeWithOwnerElement:(WebCoreElement *)ownerElement frameName:(NSString *)name view:(WebFrameView *)view
{
- self = [super initSubframeWithOwnerElement:ownerElement];
+ self = [super initSubframeWithOwnerElement:ownerElement withEditorClient:new WebEditorClient([view _webView])];
_frame = [[WebFrame alloc] _initWithWebFrameView:view webView:[self webView] bridge:self];
++WebBridgeCount;
22E42A4F0A5B9F620003275B /* OpenGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22E42A4E0A5B9F620003275B /* OpenGL.framework */; };
22E42A9A0A5BA4D00003275B /* AGL.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 22E42A990A5BA4D00003275B /* AGL.framework */; };
22F219CC08D236730030E078 /* WebBackForwardListPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 22F219CB08D236730030E078 /* WebBackForwardListPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
+ 4BF99F900AE050BC00815C2B /* WebEditorClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */; };
+ 4BF99F910AE050BC00815C2B /* WebEditorClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */; };
51B2A1000ADB15D0002A9BEE /* WebIconDatabaseDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 51B2A0FF0ADB15D0002A9BEE /* WebIconDatabaseDelegate.h */; };
51E4D3990A886B5E00ECEE2C /* WebIconDatabaseBridge.h in Headers */ = {isa = PBXBuildFile; fileRef = 51E4D3970A886B5E00ECEE2C /* WebIconDatabaseBridge.h */; };
51E4D39A0A886B5E00ECEE2C /* WebIconDatabaseBridge.m in Sources */ = {isa = PBXBuildFile; fileRef = 51E4D3980A886B5E00ECEE2C /* WebIconDatabaseBridge.m */; };
3944607E020F50ED0ECA1767 /* WebBackForwardList.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebBackForwardList.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
3944607F020F50ED0ECA1767 /* WebHistoryItem.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHistoryItem.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
39446080020F50ED0ECA1767 /* WebHistoryItem.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebHistoryItem.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
+ 4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebEditorClient.h; sourceTree = "<group>"; };
+ 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebEditorClient.mm; sourceTree = "<group>"; };
513D422E034CF55A00CA2ACD /* WebResourceLoadDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebResourceLoadDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51443F9A0429392B00CA2D3A /* WebPolicyDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebPolicyDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
51443F9B0429392B00CA2D3A /* WebPolicyDelegate.m */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 30; indentWidth = 4; path = WebPolicyDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
F5B36B400281DE87018635CB /* WebCoreSupport */ = {
isa = PBXGroup;
children = (
+ 4BF99F8E0AE050BC00815C2B /* WebEditorClient.h */,
+ 4BF99F8F0AE050BC00815C2B /* WebEditorClient.mm */,
51E4D3970A886B5E00ECEE2C /* WebIconDatabaseBridge.h */,
51E4D3980A886B5E00ECEE2C /* WebIconDatabaseBridge.m */,
65C7F42A0979DE640022E453 /* WebPageBridge.h */,
65FFB7FC0AD0B7D30048CD05 /* WebDocumentLoaderMac.h in Headers */,
658BA6FC0ADB39DE00AEB387 /* WebPolicyDeciderMac.h in Headers */,
51B2A1000ADB15D0002A9BEE /* WebIconDatabaseDelegate.h in Headers */,
+ 4BF99F900AE050BC00815C2B /* WebEditorClient.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
1C0D40880AC1C8F40009C113 /* WebKitVersionChecks.m in Sources */,
65FFB7FD0AD0B7D30048CD05 /* WebDocumentLoaderMac.m in Sources */,
658BA6FD0ADB39DE00AEB387 /* WebPolicyDeciderMac.m in Sources */,
+ 4BF99F910AE050BC00815C2B /* WebEditorClient.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_4
+#define BUILDING_ON_TIGER 1
+#endif
#endif
#include <JavaScriptCore/Platform.h>