Changeset 64020 in webkit
- Timestamp:
- Jul 25, 2010 12:56:34 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r64014 r64020 1 2010-07-25 Alexey Proskuryakov <ap@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 https://bugs.webkit.org/show_bug.cgi?id=42193 6 Support layoutTestController.dumpEditingDelegates in WebKitTestRunner 7 8 Step 2 - add the rest of editing delegates. 9 10 * platform/mac-wk2/Skipped: Changed the bug tracking why the tests are skipped - the delegates 11 are now implemented, but one of them isn't called for some reason. 12 1 13 2010-07-24 Chris Fleizach <cfleizach@apple.com> 2 14 -
trunk/LayoutTests/platform/mac-wk2/Skipped
r63906 r64020 98 98 compositing/animation/animation-compositing.html 99 99 100 # Support layoutTestController.dumpEditingCallbacks in WebKitTestRunner101 # <https://bugs.webkit.org/show_bug.cgi?id=42 193>100 # WebEditorClient::didBeginEditing is never called in WebKit2 101 # <https://bugs.webkit.org/show_bug.cgi?id=42939> 102 102 editing/deleting/4845371.html 103 103 editing/deleting/5546763.html -
trunk/WebKit2/ChangeLog
r63968 r64020 1 2010-07-25 Alexey Proskuryakov <ap@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 https://bugs.webkit.org/show_bug.cgi?id=42193 6 Support layoutTestController.dumpEditingDelegates in WebKitTestRunner 7 8 Step 2 - add the rest of editing delegates. 9 10 * WebProcess/InjectedBundle/API/c/WKBundleAPICast.h: 11 * WebProcess/InjectedBundle/API/c/WKBundleBase.h: 12 Added enums for EditorInsertAction and EAffinity. Also added a dummy type for 13 CSSStyleDeclaration - neither DumpRenderTree not WebKitTestRunner actually use that. 14 15 * WebProcess/InjectedBundle/API/c/WKBundlePage.h: 16 * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp: 17 (WebKit::InjectedBundlePageEditorClient::shouldBeginEditing): 18 (WebKit::InjectedBundlePageEditorClient::shouldEndEditing): 19 (WebKit::InjectedBundlePageEditorClient::shouldInsertNode): 20 (WebKit::InjectedBundlePageEditorClient::shouldInsertText): 21 (WebKit::InjectedBundlePageEditorClient::shouldDeleteRange): 22 (WebKit::InjectedBundlePageEditorClient::shouldChangeSelectedRange): 23 (WebKit::InjectedBundlePageEditorClient::shouldApplyStyle): 24 (WebKit::InjectedBundlePageEditorClient::didBeginEditing): 25 (WebKit::InjectedBundlePageEditorClient::didEndEditing): 26 (WebKit::InjectedBundlePageEditorClient::didChange): 27 (WebKit::InjectedBundlePageEditorClient::didChangeSelection): 28 * WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h: 29 * WebProcess/WebCoreSupport/WebEditorClient.cpp: 30 (WebKit::WebEditorClient::shouldDeleteRange): 31 (WebKit::WebEditorClient::shouldEndEditing): 32 (WebKit::WebEditorClient::shouldInsertNode): 33 (WebKit::WebEditorClient::shouldInsertText): 34 (WebKit::WebEditorClient::shouldChangeSelectedRange): 35 (WebKit::WebEditorClient::shouldApplyStyle): 36 (WebKit::WebEditorClient::didBeginEditing): 37 (WebKit::WebEditorClient::respondToChangedContents): 38 (WebKit::WebEditorClient::respondToChangedSelection): 39 (WebKit::WebEditorClient::didEndEditing): 40 Added remaining delagates that are needed for WebKitTestRunner. 41 1 42 2010-07-19 Balazs Kelemen <kb@inf.u-szeged.hu> 2 43 -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleAPICast.h
r63930 r64020 28 28 29 29 #include "WKBundleBase.h" 30 #include "WKBundlePage.h" 31 #include <WebCore/EditorInsertAction.h> 32 #include <WebCore/TextAffinity.h> 30 33 31 34 namespace WebCore { 35 class CSSStyleDeclaration; 32 36 class Node; 33 37 class Range; … … 41 45 42 46 template<typename APIType> struct BundleAPITypeInfo { }; 43 template<> struct BundleAPITypeInfo<WKBundleFrameRef> { typedef WebFrame* ImplType; }; 44 template<> struct BundleAPITypeInfo<WKBundleNodeRef> { typedef WebCore::Node* ImplType; }; 45 template<> struct BundleAPITypeInfo<WKBundlePageRef> { typedef WebPage* ImplType; }; 46 template<> struct BundleAPITypeInfo<WKBundleRangeRef> { typedef WebCore::Range* ImplType; }; 47 template<> struct BundleAPITypeInfo<WKBundleRef> { typedef InjectedBundle* ImplType; }; 47 template<> struct BundleAPITypeInfo<WKBundleCSSStyleDeclarationRef> { typedef WebCore::CSSStyleDeclaration* ImplType; }; 48 template<> struct BundleAPITypeInfo<WKBundleFrameRef> { typedef WebFrame* ImplType; }; 49 template<> struct BundleAPITypeInfo<WKBundleNodeRef> { typedef WebCore::Node* ImplType; }; 50 template<> struct BundleAPITypeInfo<WKBundlePageRef> { typedef WebPage* ImplType; }; 51 template<> struct BundleAPITypeInfo<WKBundleRangeRef> { typedef WebCore::Range* ImplType; }; 52 template<> struct BundleAPITypeInfo<WKBundleRef> { typedef InjectedBundle* ImplType; }; 48 53 49 54 template<typename ImplType> struct BundleImplTypeInfo { }; 50 template<> struct BundleImplTypeInfo<InjectedBundle*> { typedef WKBundleRef APIType; }; 51 template<> struct BundleImplTypeInfo<WebCore::Node*> { typedef WKBundleNodeRef APIType; }; 52 template<> struct BundleImplTypeInfo<WebCore::Range*> { typedef WKBundleRangeRef APIType; }; 53 template<> struct BundleImplTypeInfo<WebFrame*> { typedef WKBundleFrameRef APIType; }; 54 template<> struct BundleImplTypeInfo<WebPage*> { typedef WKBundlePageRef APIType; }; 55 template<> struct BundleImplTypeInfo<InjectedBundle*> { typedef WKBundleRef APIType; }; 56 template<> struct BundleImplTypeInfo<WebCore::CSSStyleDeclaration*> { typedef WKBundleCSSStyleDeclarationRef APIType; }; 57 template<> struct BundleImplTypeInfo<WebCore::Node*> { typedef WKBundleNodeRef APIType; }; 58 template<> struct BundleImplTypeInfo<WebCore::Range*> { typedef WKBundleRangeRef APIType; }; 59 template<> struct BundleImplTypeInfo<WebFrame*> { typedef WKBundleFrameRef APIType; }; 60 template<> struct BundleImplTypeInfo<WebPage*> { typedef WKBundlePageRef APIType; }; 55 61 56 62 } // namespace WebKit … … 70 76 } 71 77 78 inline WKInsertActionType toWK(WebCore::EditorInsertAction action) 79 { 80 switch (action) { 81 case WebCore::EditorInsertActionTyped: 82 return kWKInsertActionTyped; 83 break; 84 case WebCore::EditorInsertActionPasted: 85 return kWKInsertActionPasted; 86 break; 87 case WebCore::EditorInsertActionDropped: 88 return kWKInsertActionDropped; 89 break; 90 } 91 ASSERT_NOT_REACHED(); 92 return kWKInsertActionTyped; 93 } 94 95 inline WKAffinityType toWK(WebCore::EAffinity affinity) 96 { 97 switch (affinity) { 98 case WebCore::UPSTREAM: 99 return kWKAffinityUpstream; 100 break; 101 case WebCore::DOWNSTREAM: 102 return kWKAffinityDownstream; 103 break; 104 } 105 ASSERT_NOT_REACHED(); 106 return kWKAffinityUpstream; 107 } 108 72 109 #endif // WKBundleAPICast_h -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundleBase.h
r63930 r64020 28 28 29 29 typedef struct OpaqueWKBundle* WKBundleRef; 30 typedef struct OpaqueWKBundleDOMCSSStyleDeclaration* WKBundleCSSStyleDeclarationRef; 30 31 typedef struct OpaqueWKBundleFrame* WKBundleFrameRef; 31 32 typedef struct OpaqueWKBundleNode* WKBundleNodeRef; -
trunk/WebKit2/WebProcess/InjectedBundle/API/c/WKBundlePage.h
r63930 r64020 35 35 extern "C" { 36 36 #endif 37 38 enum { 39 kWKInsertActionTyped = 0, 40 kWKInsertActionPasted = 1, 41 kWKInsertActionDropped = 2 42 }; 43 typedef uint32_t WKInsertActionType; 44 45 enum { 46 kWKAffinityUpstream, 47 kWKAffinityDownstream 48 }; 49 typedef uint32_t WKAffinityType; 37 50 38 51 // Loader Client … … 79 92 80 93 // Editor client 94 // FIXME: Objective-C API provides a WebView pointer in callbacks, what should the injected bundle API do? 81 95 typedef bool (*WKBundlePageShouldBeginEditingCallback)(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo); 96 typedef bool (*WKBundlePageShouldEndEditingCallback)(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo); 97 typedef bool (*WKBundlePageShouldInsertNodeCallback)(WKBundlePageRef page, WKBundleNodeRef node, WKBundleRangeRef rangeToReplace, WKInsertActionType action, const void* clientInfo); 98 typedef bool (*WKBundlePageShouldInsertTextCallback)(WKBundlePageRef page, WKStringRef string, WKBundleRangeRef rangeToReplace, WKInsertActionType action, const void* clientInfo); 99 typedef bool (*WKBundlePageShouldDeleteRangeCallback)(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo); 100 typedef bool (*WKBundlePageShouldChangeSelectedRange)(WKBundlePageRef page, WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType affinity, bool stillSelecting, const void* clientInfo); 101 typedef bool (*WKBundlePageShouldApplyStyle)(WKBundlePageRef page, WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range, const void* clientInfo); 102 typedef void (*WKBundlePageEditingNotification)(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo); 103 82 104 struct WKBundlePageEditorClient { 83 105 int version; 84 106 const void * clientInfo; 85 107 WKBundlePageShouldBeginEditingCallback shouldBeginEditing; 108 WKBundlePageShouldEndEditingCallback shouldEndEditing; 109 WKBundlePageShouldInsertNodeCallback shouldInsertNode; 110 WKBundlePageShouldInsertTextCallback shouldInsertText; 111 WKBundlePageShouldDeleteRangeCallback shouldDeleteRange; 112 WKBundlePageShouldChangeSelectedRange shouldChangeSelectedRange; 113 WKBundlePageShouldApplyStyle shouldApplyStyle; 114 WKBundlePageEditingNotification didBeginEditing; 115 WKBundlePageEditingNotification didEndEditing; 116 WKBundlePageEditingNotification didChange; 117 WKBundlePageEditingNotification didChangeSelection; 86 118 }; 87 119 typedef struct WKBundlePageEditorClient WKBundlePageEditorClient; -
trunk/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.cpp
r63930 r64020 47 47 } 48 48 49 bool InjectedBundlePageEditorClient::shouldBeginEditing(WebPage* page, WebCore::Range* range)49 bool InjectedBundlePageEditorClient::shouldBeginEditing(WebPage* page, Range* range) 50 50 { 51 51 if (m_client.shouldBeginEditing) … … 54 54 } 55 55 56 bool InjectedBundlePageEditorClient::shouldEndEditing(WebPage* page, Range* range) 57 { 58 if (m_client.shouldEndEditing) 59 return m_client.shouldEndEditing(toRef(page), toRef(range), m_client.clientInfo); 60 return true; 61 } 62 63 bool InjectedBundlePageEditorClient::shouldInsertNode(WebPage* page, Node* node, Range* rangeToReplace, EditorInsertAction action) 64 { 65 if (m_client.shouldInsertNode) 66 return m_client.shouldInsertNode(toRef(page), toRef(node), toRef(rangeToReplace), toWK(action), m_client.clientInfo); 67 return true; 68 } 69 70 bool InjectedBundlePageEditorClient::shouldInsertText(WebPage* page, StringImpl* text, Range* rangeToReplace, EditorInsertAction action) 71 { 72 if (m_client.shouldInsertText) 73 return m_client.shouldInsertText(toRef(page), toRef(text), toRef(rangeToReplace), toWK(action), m_client.clientInfo); 74 return true; 75 } 76 77 bool InjectedBundlePageEditorClient::shouldDeleteRange(WebPage* page, Range* range) 78 { 79 if (m_client.shouldDeleteRange) 80 return m_client.shouldDeleteRange(toRef(page), toRef(range), m_client.clientInfo); 81 return true; 82 } 83 84 bool InjectedBundlePageEditorClient::shouldChangeSelectedRange(WebPage* page, Range* fromRange, Range* toRange, EAffinity affinity, bool stillSelecting) 85 { 86 if (m_client.shouldChangeSelectedRange) 87 return m_client.shouldChangeSelectedRange(toRef(page), toRef(fromRange), toRef(toRange), toWK(affinity), stillSelecting, m_client.clientInfo); 88 return true; 89 } 90 91 bool InjectedBundlePageEditorClient::shouldApplyStyle(WebPage* page, CSSStyleDeclaration* style, Range* range) 92 { 93 if (m_client.shouldApplyStyle) 94 return m_client.shouldApplyStyle(toRef(page), toRef(style), toRef(range), m_client.clientInfo); 95 return true; 96 } 97 98 void InjectedBundlePageEditorClient::didBeginEditing(WebPage* page, StringImpl* notificationName) 99 { 100 if (m_client.didBeginEditing) 101 m_client.didBeginEditing(toRef(page), toRef(notificationName), m_client.clientInfo); 102 } 103 104 void InjectedBundlePageEditorClient::didEndEditing(WebPage* page, StringImpl* notificationName) 105 { 106 if (m_client.didEndEditing) 107 m_client.didEndEditing(toRef(page), toRef(notificationName), m_client.clientInfo); 108 } 109 110 void InjectedBundlePageEditorClient::didChange(WebPage* page, StringImpl* notificationName) 111 { 112 if (m_client.didChange) 113 m_client.didChange(toRef(page), toRef(notificationName), m_client.clientInfo); 114 } 115 116 void InjectedBundlePageEditorClient::didChangeSelection(WebPage* page, StringImpl* notificationName) 117 { 118 if (m_client.didChangeSelection) 119 m_client.didChangeSelection(toRef(page), toRef(notificationName), m_client.clientInfo); 120 } 121 56 122 } // namespace WebKit -
trunk/WebKit2/WebProcess/InjectedBundle/InjectedBundlePageEditorClient.h
r63930 r64020 28 28 29 29 #include "WKBundlePage.h" 30 #include <WebCore/EditorInsertAction.h> 31 #include <WebCore/TextAffinity.h> 30 32 31 33 namespace WebCore { 34 class CSSStyleDeclaration; 35 class Node; 32 36 class Range; 37 class StringImpl; 33 38 } 34 39 … … 44 49 45 50 bool shouldBeginEditing(WebPage*, WebCore::Range*); 51 bool shouldEndEditing(WebPage*, WebCore::Range*); 52 bool shouldInsertNode(WebPage*, WebCore::Node*, WebCore::Range* rangeToReplace, WebCore::EditorInsertAction); 53 bool shouldInsertText(WebPage*, WebCore::StringImpl*, WebCore::Range* rangeToReplace, WebCore::EditorInsertAction); 54 bool shouldDeleteRange(WebPage*, WebCore::Range*); 55 bool shouldChangeSelectedRange(WebPage*, WebCore::Range* fromRange, WebCore::Range* toRange, WebCore::EAffinity affinity, bool stillSelecting); 56 bool shouldApplyStyle(WebPage*, WebCore::CSSStyleDeclaration*, WebCore::Range*); 57 void didBeginEditing(WebPage*, WebCore::StringImpl* notificationName); 58 void didEndEditing(WebPage*, WebCore::StringImpl* notificationName); 59 void didChange(WebPage*, WebCore::StringImpl* notificationName); 60 void didChangeSelection(WebPage*, WebCore::StringImpl* notificationName); 46 61 47 62 private: -
trunk/WebKit2/WebProcess/WebCoreSupport/WebEditorClient.cpp
r63930 r64020 43 43 } 44 44 45 bool WebEditorClient::shouldDeleteRange(Range*) 46 { 47 notImplemented(); 48 return true; 45 bool WebEditorClient::shouldDeleteRange(Range* range) 46 { 47 bool result = m_page->injectedBundleEditorClient().shouldDeleteRange(m_page, range); 48 notImplemented(); 49 return result; 49 50 } 50 51 … … 110 111 } 111 112 112 bool WebEditorClient::shouldEndEditing(Range*) 113 bool WebEditorClient::shouldEndEditing(Range* range) 114 { 115 bool result = m_page->injectedBundleEditorClient().shouldEndEditing(m_page, range); 116 notImplemented(); 117 return result; 118 } 119 120 bool WebEditorClient::shouldInsertNode(Node* node, Range* rangeToReplace, EditorInsertAction action) 121 { 122 bool result = m_page->injectedBundleEditorClient().shouldInsertNode(m_page, node, rangeToReplace, action); 123 notImplemented(); 124 return result; 125 } 126 127 bool WebEditorClient::shouldInsertText(const String& text, Range* rangeToReplace, EditorInsertAction action) 128 { 129 bool result = m_page->injectedBundleEditorClient().shouldInsertText(m_page, text.impl(), rangeToReplace, action); 130 notImplemented(); 131 return result; 132 } 133 134 bool WebEditorClient::shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity affinity, bool stillSelecting) 135 { 136 bool result = m_page->injectedBundleEditorClient().shouldChangeSelectedRange(m_page, fromRange, toRange, affinity, stillSelecting); 137 notImplemented(); 138 return result; 139 } 140 141 bool WebEditorClient::shouldApplyStyle(CSSStyleDeclaration* style, Range* range) 142 { 143 bool result = m_page->injectedBundleEditorClient().shouldApplyStyle(m_page, style, range); 144 notImplemented(); 145 return result; 146 } 147 148 bool WebEditorClient::shouldMoveRangeAfterDelete(Range*, Range*) 113 149 { 114 150 notImplemented(); … … 116 152 } 117 153 118 bool WebEditorClient::shouldInsertNode(Node*, Range*, EditorInsertAction)119 {120 notImplemented();121 return true;122 }123 124 bool WebEditorClient::shouldInsertText(const String&, Range*, EditorInsertAction)125 {126 return true;127 }128 129 bool WebEditorClient::shouldChangeSelectedRange(Range* fromRange, Range* toRange, EAffinity, bool stillSelecting)130 {131 return true;132 }133 134 bool WebEditorClient::shouldApplyStyle(CSSStyleDeclaration*, Range*)135 {136 notImplemented();137 return true;138 }139 140 bool WebEditorClient::shouldMoveRangeAfterDelete(Range*, Range*)141 {142 notImplemented();143 return true;144 }145 146 154 void WebEditorClient::didBeginEditing() 147 155 { 156 // FIXME: What good is a notification name, if it's always the same? 157 static const String WebViewDidBeginEditingNotification = "WebViewDidBeginEditingNotification"; 158 m_page->injectedBundleEditorClient().didBeginEditing(m_page, WebViewDidBeginEditingNotification.impl()); 148 159 notImplemented(); 149 160 } … … 151 162 void WebEditorClient::respondToChangedContents() 152 163 { 164 static const String WebViewDidChangeNotification = "WebViewDidChangeNotification"; 165 m_page->injectedBundleEditorClient().didChange(m_page, WebViewDidChangeNotification.impl()); 153 166 notImplemented(); 154 167 } … … 156 169 void WebEditorClient::respondToChangedSelection() 157 170 { 171 static const String WebViewDidChangeSelectionNotification = "WebViewDidChangeSelectionNotification"; 172 m_page->injectedBundleEditorClient().didChangeSelection(m_page, WebViewDidChangeSelectionNotification.impl()); 158 173 notImplemented(); 159 174 } … … 161 176 void WebEditorClient::didEndEditing() 162 177 { 178 static const String WebViewDidEndEditingNotification = "WebViewDidEndEditingNotification"; 179 m_page->injectedBundleEditorClient().didEndEditing(m_page, WebViewDidEndEditingNotification.impl()); 163 180 notImplemented(); 164 181 } -
trunk/WebKitTools/ChangeLog
r64014 r64020 1 2010-07-25 Alexey Proskuryakov <ap@apple.com> 2 3 Reviewed by Sam Weinig. 4 5 https://bugs.webkit.org/show_bug.cgi?id=42193 6 Support layoutTestController.dumpEditingDelegates in WebKitTestRunner 7 8 Step 2 - add the rest of editing delegates. 9 10 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp: 11 (WTR::operator<<): Fixed to not crash when range is null. 12 (WTR::InjectedBundlePage::InjectedBundlePage): 13 (WTR::InjectedBundlePage::_shouldEndEditing): 14 (WTR::InjectedBundlePage::_shouldInsertNode): 15 (WTR::InjectedBundlePage::_shouldInsertText): 16 (WTR::InjectedBundlePage::_shouldDeleteRange): 17 (WTR::InjectedBundlePage::_shouldChangeSelectedRange): 18 (WTR::InjectedBundlePage::_shouldApplyStyle): 19 (WTR::InjectedBundlePage::_didBeginEditing): 20 (WTR::InjectedBundlePage::_didEndEditing): 21 (WTR::InjectedBundlePage::_didChange): 22 (WTR::InjectedBundlePage::_didChangeSelection): 23 (WTR::InjectedBundlePage::shouldEndEditing): 24 (WTR::InjectedBundlePage::shouldInsertNode): 25 (WTR::InjectedBundlePage::shouldInsertText): 26 (WTR::InjectedBundlePage::shouldDeleteRange): 27 (WTR::InjectedBundlePage::shouldChangeSelectedRange): 28 (WTR::InjectedBundlePage::shouldApplyStyle): 29 (WTR::InjectedBundlePage::didBeginEditing): 30 (WTR::InjectedBundlePage::didEndEditing): 31 (WTR::InjectedBundlePage::didChange): 32 (WTR::InjectedBundlePage::didChangeSelection): 33 * WebKitTestRunner/InjectedBundle/InjectedBundlePage.h: 34 1 35 2010-07-24 Chris Fleizach <cfleizach@apple.com> 2 36 -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
r63949 r64020 102 102 static ostream& operator<<(ostream& out, WKBundleRangeRef rangeRef) 103 103 { 104 out << "range from " << WKBundleRangeGetStartOffset(rangeRef) << " of " << dumpPath(WKBundleRangeGetStartContainer(rangeRef)) << " to " << WKBundleRangeGetEndOffset(rangeRef) << " of " << dumpPath(WKBundleRangeGetEndContainer(rangeRef)); 104 if (rangeRef) 105 out << "range from " << WKBundleRangeGetStartOffset(rangeRef) << " of " << dumpPath(WKBundleRangeGetStartContainer(rangeRef)) << " to " << WKBundleRangeGetEndOffset(rangeRef) << " of " << dumpPath(WKBundleRangeGetEndContainer(rangeRef)); 106 else 107 out << "(null)"; 108 109 return out; 110 } 111 112 static ostream& operator<<(ostream& out, WKBundleCSSStyleDeclarationRef style) 113 { 114 // DumpRenderTree calls -[DOMCSSStyleDeclaration description], which just dumps class name and object address. 115 // No existing tests actually hit this code path at the time of this writing, because WebCore doesn't call 116 // the editing client if the styling operation source is CommandFromDOM or CommandFromDOMWithUserInterface. 117 out << "<DOMCSSStyleDeclaration ADDRESS>"; 105 118 return out; 106 119 } … … 139 152 this, 140 153 _shouldBeginEditing, 154 _shouldEndEditing, 155 _shouldInsertNode, 156 _shouldInsertText, 157 _shouldDeleteRange, 158 _shouldChangeSelectedRange, 159 _shouldApplyStyle, 160 _didBeginEditing, 161 _didEndEditing, 162 _didChange, 163 _didChangeSelection 141 164 }; 142 165 WKBundlePageSetEditorClient(m_page, &editorClient); … … 428 451 } 429 452 453 bool InjectedBundlePage::_shouldEndEditing(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo) 454 { 455 return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldEndEditing(range); 456 } 457 458 bool InjectedBundlePage::_shouldInsertNode(WKBundlePageRef page, WKBundleNodeRef node, WKBundleRangeRef rangeToReplace, WKInsertActionType action, const void* clientInfo) 459 { 460 return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldInsertNode(node, rangeToReplace, action); 461 } 462 463 bool InjectedBundlePage::_shouldInsertText(WKBundlePageRef page, WKStringRef text, WKBundleRangeRef rangeToReplace, WKInsertActionType action, const void* clientInfo) 464 { 465 return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldInsertText(text, rangeToReplace, action); 466 } 467 468 bool InjectedBundlePage::_shouldDeleteRange(WKBundlePageRef page, WKBundleRangeRef range, const void* clientInfo) 469 { 470 return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldDeleteRange(range); 471 } 472 473 bool InjectedBundlePage::_shouldChangeSelectedRange(WKBundlePageRef page, WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType affinity, bool stillSelecting, const void* clientInfo) 474 { 475 return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldChangeSelectedRange(fromRange, toRange, affinity, stillSelecting); 476 } 477 478 bool InjectedBundlePage::_shouldApplyStyle(WKBundlePageRef page, WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range, const void* clientInfo) 479 { 480 return static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->shouldApplyStyle(style, range); 481 } 482 483 void InjectedBundlePage::_didBeginEditing(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo) 484 { 485 static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didBeginEditing(notificationName); 486 } 487 488 void InjectedBundlePage::_didEndEditing(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo) 489 { 490 static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didEndEditing(notificationName); 491 } 492 493 void InjectedBundlePage::_didChange(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo) 494 { 495 static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didChange(notificationName); 496 } 497 498 void InjectedBundlePage::_didChangeSelection(WKBundlePageRef page, WKStringRef notificationName, const void* clientInfo) 499 { 500 static_cast<InjectedBundlePage*>(const_cast<void*>(clientInfo))->didChangeSelection(notificationName); 501 } 502 430 503 bool InjectedBundlePage::shouldBeginEditing(WKBundleRangeRef range) 431 504 { … … 435 508 } 436 509 510 bool InjectedBundlePage::shouldEndEditing(WKBundleRangeRef range) 511 { 512 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 513 InjectedBundle::shared().os() << "EDITING DELEGATE: shouldEndEditingInDOMRange:" << range << "\n"; 514 return InjectedBundle::shared().layoutTestController()->acceptsEditing(); 515 } 516 517 bool InjectedBundlePage::shouldInsertNode(WKBundleNodeRef node, WKBundleRangeRef rangeToReplace, WKInsertActionType action) 518 { 519 static const char *insertactionstring[] = { 520 "WebViewInsertActionTyped", 521 "WebViewInsertActionPasted", 522 "WebViewInsertActionDropped", 523 }; 524 525 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 526 InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertNode:" << dumpPath(node) << " replacingDOMRange:" << rangeToReplace << " givenAction:" << insertactionstring[action] << "\n"; 527 return InjectedBundle::shared().layoutTestController()->acceptsEditing(); 528 } 529 530 bool InjectedBundlePage::shouldInsertText(WKStringRef text, WKBundleRangeRef rangeToReplace, WKInsertActionType action) 531 { 532 static const char *insertactionstring[] = { 533 "WebViewInsertActionTyped", 534 "WebViewInsertActionPasted", 535 "WebViewInsertActionDropped", 536 }; 537 538 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 539 InjectedBundle::shared().os() << "EDITING DELEGATE: shouldInsertText:" << text << " replacingDOMRange:" << rangeToReplace << " givenAction:" << insertactionstring[action] << "\n"; 540 return InjectedBundle::shared().layoutTestController()->acceptsEditing(); 541 } 542 543 bool InjectedBundlePage::shouldDeleteRange(WKBundleRangeRef range) 544 { 545 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 546 InjectedBundle::shared().os() << "EDITING DELEGATE: shouldDeleteDOMRange:" << range << "\n"; 547 return InjectedBundle::shared().layoutTestController()->acceptsEditing(); 548 } 549 550 bool InjectedBundlePage::shouldChangeSelectedRange(WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType affinity, bool stillSelecting) 551 { 552 static const char *affinitystring[] = { 553 "NSSelectionAffinityUpstream", 554 "NSSelectionAffinityDownstream" 555 }; 556 static const char *boolstring[] = { 557 "FALSE", 558 "TRUE" 559 }; 560 561 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 562 InjectedBundle::shared().os() << "EDITING DELEGATE: shouldChangeSelectedDOMRange:" << fromRange << " toDOMRange:" << toRange << " affinity:" << affinitystring[affinity] << " stillSelecting:" << boolstring[stillSelecting] << "\n"; 563 return InjectedBundle::shared().layoutTestController()->acceptsEditing(); 564 } 565 566 bool InjectedBundlePage::shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range) 567 { 568 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 569 InjectedBundle::shared().os() << "EDITING DELEGATE: shouldApplyStyle:" << style << " toElementsInDOMRange:" << range << "\n"; 570 return InjectedBundle::shared().layoutTestController()->acceptsEditing(); 571 } 572 573 void InjectedBundlePage::didBeginEditing(WKStringRef notificationName) 574 { 575 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 576 InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidBeginEditing:" << notificationName << "\n"; 577 } 578 579 void InjectedBundlePage::didEndEditing(WKStringRef notificationName) 580 { 581 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 582 InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidEndEditing:" << notificationName << "\n"; 583 } 584 585 void InjectedBundlePage::didChange(WKStringRef notificationName) 586 { 587 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 588 InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidChange:" << notificationName << "\n"; 589 } 590 591 void InjectedBundlePage::didChangeSelection(WKStringRef notificationName) 592 { 593 if (InjectedBundle::shared().layoutTestController()->shouldDumpEditingCallbacks()) 594 InjectedBundle::shared().os() << "EDITING DELEGATE: webViewDidChangeSelection:" << notificationName << "\n"; 595 } 596 597 437 598 } // namespace WTR -
trunk/WebKitTools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.h
r63930 r64020 74 74 // Editor client 75 75 static bool _shouldBeginEditing(WKBundlePageRef, WKBundleRangeRef, const void* clientInfo); 76 static bool _shouldEndEditing(WKBundlePageRef, WKBundleRangeRef, const void* clientInfo); 77 static bool _shouldInsertNode(WKBundlePageRef, WKBundleNodeRef, WKBundleRangeRef rangeToReplace, WKInsertActionType, const void* clientInfo); 78 static bool _shouldInsertText(WKBundlePageRef, WKStringRef, WKBundleRangeRef rangeToReplace, WKInsertActionType, const void* clientInfo); 79 static bool _shouldDeleteRange(WKBundlePageRef, WKBundleRangeRef, const void* clientInfo); 80 static bool _shouldChangeSelectedRange(WKBundlePageRef, WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType, bool stillSelecting, const void* clientInfo); 81 static bool _shouldApplyStyle(WKBundlePageRef, WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range, const void* clientInfo); 82 static void _didBeginEditing(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo); 83 static void _didEndEditing(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo); 84 static void _didChange(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo); 85 static void _didChangeSelection(WKBundlePageRef, WKStringRef notificationName, const void* clientInfo); 76 86 bool shouldBeginEditing(WKBundleRangeRef); 87 bool shouldEndEditing(WKBundleRangeRef); 88 bool shouldInsertNode(WKBundleNodeRef, WKBundleRangeRef rangeToReplace, WKInsertActionType); 89 bool shouldInsertText(WKStringRef, WKBundleRangeRef rangeToReplace, WKInsertActionType); 90 bool shouldDeleteRange(WKBundleRangeRef); 91 bool shouldChangeSelectedRange(WKBundleRangeRef fromRange, WKBundleRangeRef toRange, WKAffinityType, bool stillSelecting); 92 bool shouldApplyStyle(WKBundleCSSStyleDeclarationRef style, WKBundleRangeRef range); 93 void didBeginEditing(WKStringRef notificationName); 94 void didEndEditing(WKStringRef notificationName); 95 void didChange(WKStringRef notificationName); 96 void didChangeSelection(WKStringRef notificationName); 77 97 78 98 void dumpAllFramesText();
Note: See TracChangeset
for help on using the changeset viewer.