Changeset 29051 in webkit
- Timestamp:
- Dec 31, 2007 4:18:16 PM (16 years ago)
- Location:
- trunk
- Files:
-
- 8 added
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r29044 r29051 1 2007-12-31 Henry Mason <hmason@mac.com> 2 3 Reviewed by Darin. 4 5 Test for http://bugs.webkit.org/show_bug.cgi?id=14994 6 Support for MessageEvent and cross-domain messaging 7 8 * fast/dom/Window/window-properties-expected.txt: 9 * http/tests/messaging: Added. 10 * http/tests/messaging/cross-domain-message-send-expected.txt: Added. 11 * http/tests/messaging/cross-domain-message-send.html: Added. 12 * http/tests/messaging/resources: Added. 13 * http/tests/messaging/resources/cross-domain-message-receive.html: Added. 14 1 15 2007-12-30 Sam Weinig <sam@webkit.org> 2 16 -
trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt
r29041 r29051 705 705 window.MediaList.prototype.deleteMedium [function] 706 706 window.MediaList.prototype.item [function] 707 window.MessageEvent [object MessageEventConstructor] 708 window.MessageEvent.prototype [printed above as window.Event.prototype] 707 709 window.MouseEvent [object MouseEventConstructor] 708 710 window.MouseEvent.prototype [printed above as window.Event.prototype] … … 1255 1257 window.personalbar [object BarInfo] 1256 1258 window.personalbar.visible [boolean] 1259 window.postMessage [function] 1257 1260 window.print [function] 1258 1261 window.prompt [function] -
trunk/WebCore/ChangeLog
r29050 r29051 1 2007-12-31 Henry Mason <hmason@mac.com> 2 3 Reviewed by Darin. 4 5 Patch for http://bugs.webkit.org/show_bug.cgi?id=14994 6 Support for MessageEvent and cross-domain messaging 7 8 Test: http/tests/messaging/cross-domain-message-send.html 9 10 * DerivedSources.make: 11 * WebCore.pro: 12 * WebCore.vcproj/WebCore.vcproj: 13 * WebCore.xcodeproj/project.pbxproj: 14 * WebCoreSources.bkl: 15 * bindings/js/JSDOMWindowCustom.cpp: 16 (WebCore::JSDOMWindow::customGetOwnPropertySlot): Allow cross-domain access to the 17 postMessage function. 18 (WebCore::JSDOMWindow::postMessage): 19 * bindings/js/JSEventCustom.cpp: 20 (WebCore::toJS): 21 * dom/Event.cpp: 22 (WebCore::Event::isMessageEvent): 23 * dom/Event.h: 24 * dom/EventNames.h: New event name 25 * dom/MessageEvent.cpp: Added. 26 * dom/MessageEvent.h: Added. 27 * dom/MessageEvent.idl: Added. 28 * page/DOMWindow.cpp: 29 (WebCore::DOMWindow::postMessage): Added. 30 * page/DOMWindow.h: 31 * page/DOMWindow.idl: 32 1 33 2007-12-31 Darin Adler <darin@apple.com> 2 34 -
trunk/WebCore/DerivedSources.make
r29012 r29051 134 134 DOMHTMLUListElement.h \ 135 135 DOMKeyboardEvent.h \ 136 DOMMessageEvent.h \ 136 137 DOMMediaList.h \ 137 138 DOMMouseEvent.h \ … … 416 417 JSMediaError.h \ 417 418 JSMediaList.h \ 419 JSMessageEvent.h \ 418 420 JSMouseEvent.h \ 419 421 JSMutationEvent.h \ -
trunk/WebCore/WebCore.pro
r29012 r29051 282 282 # dom/EventTarget.idl \ 283 283 dom/KeyboardEvent.idl \ 284 dom/MessageEvent.idl \ 284 285 dom/MouseEvent.idl \ 285 286 dom/MutationEvent.idl \ … … 499 500 dom/KeyboardEvent.cpp \ 500 501 dom/MappedAttribute.cpp \ 502 dom/MessageEvent.cpp \ 501 503 dom/MouseEvent.cpp \ 502 504 dom/MouseRelatedEvent.cpp \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r29050 r29051 1177 1177 > 1178 1178 </File> 1179 <File 1180 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSMessageEvent.cpp" 1181 > 1182 </File> 1183 <File 1184 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSMessageEvent.h" 1185 > 1186 </File> 1179 1187 <File 1180 1188 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSMouseEvent.cpp" … … 6053 6061 > 6054 6062 </File> 6063 <File 6064 RelativePath="..\dom\MessageEvent.cpp" 6065 > 6066 </File> 6067 <File 6068 RelativePath="..\dom\MessageEvent.h" 6069 > 6070 </File> 6055 6071 <File 6056 6072 RelativePath="..\dom\MouseEvent.cpp" -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r29041 r29051 541 541 65DF326109D1E199000BE325 /* UserAgentStyleSheetsData.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 656581AF09D14EE6000E61D7 /* UserAgentStyleSheetsData.cpp */; }; 542 542 65FEA86909833ADE00BED4AB /* Page.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 65FEA86809833ADE00BED4AB /* Page.cpp */; }; 543 75793E830D0CE0B3007FC0AC /* MessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */; }; 544 75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793E810D0CE0B3007FC0AC /* MessageEvent.h */; }; 545 75793E850D0CE0B3007FC0AC /* MessageEvent.idl in Resources */ = {isa = PBXBuildFile; fileRef = 75793E820D0CE0B3007FC0AC /* MessageEvent.idl */; }; 546 75793EC80D0CE72D007FC0AC /* JSMessageEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 75793EC60D0CE72D007FC0AC /* JSMessageEvent.cpp */; }; 547 75793EC90D0CE72D007FC0AC /* JSMessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793EC70D0CE72D007FC0AC /* JSMessageEvent.h */; }; 548 75793ED30D0CE85B007FC0AC /* DOMMessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED00D0CE85B007FC0AC /* DOMMessageEvent.h */; }; 549 75793ED40D0CE85B007FC0AC /* DOMMessageEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */; }; 550 75793ED50D0CE85B007FC0AC /* DOMMessageEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */; }; 543 551 7E6FEED80898582300C44C3F /* WebCoreScriptDebugger.h in Headers */ = {isa = PBXBuildFile; fileRef = 7E6FEED60898582300C44C3F /* WebCoreScriptDebugger.h */; settings = {ATTRIBUTES = (Private, ); }; }; 544 552 7E6FEED90898582300C44C3F /* WebCoreScriptDebugger.mm in Sources */ = {isa = PBXBuildFile; fileRef = 7E6FEED70898582300C44C3F /* WebCoreScriptDebugger.mm */; }; … … 4938 4946 65F80697054D9F86008BF776 /* BlockExceptions.mm */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = BlockExceptions.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 4939 4947 65FEA86809833ADE00BED4AB /* Page.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = Page.cpp; sourceTree = "<group>"; }; 4948 75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; name = MessageEvent.cpp; path = dom/MessageEvent.cpp; sourceTree = SOURCE_ROOT; }; 4949 75793E810D0CE0B3007FC0AC /* MessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = MessageEvent.h; path = dom/MessageEvent.h; sourceTree = SOURCE_ROOT; }; 4950 75793E820D0CE0B3007FC0AC /* MessageEvent.idl */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text; name = MessageEvent.idl; path = dom/MessageEvent.idl; sourceTree = SOURCE_ROOT; }; 4951 75793EC60D0CE72D007FC0AC /* JSMessageEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = JSMessageEvent.cpp; sourceTree = "<group>"; }; 4952 75793EC70D0CE72D007FC0AC /* JSMessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = JSMessageEvent.h; sourceTree = "<group>"; }; 4953 75793ED00D0CE85B007FC0AC /* DOMMessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEvent.h; sourceTree = "<group>"; }; 4954 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMMessageEvent.mm; sourceTree = "<group>"; }; 4955 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEventInternal.h; sourceTree = "<group>"; }; 4940 4956 7E6FEED60898582300C44C3F /* WebCoreScriptDebugger.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebCoreScriptDebugger.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; 4941 4957 7E6FEED70898582300C44C3F /* WebCoreScriptDebugger.mm */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebCoreScriptDebugger.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; }; … … 9260 9276 85FF31580AAFBFCB00374F38 /* DOMKeyboardEvent.h */, 9261 9277 85FF31590AAFBFCB00374F38 /* DOMKeyboardEvent.mm */, 9278 75793ED00D0CE85B007FC0AC /* DOMMessageEvent.h */, 9279 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */, 9280 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */, 9262 9281 857E0B2B0AB043FC0036E447 /* DOMMouseEventPrivate.h */, 9263 9282 857E0B230AB043460036E447 /* DOMMouseEvent.h */, … … 10610 10629 A86629CE09DA2B47009633A5 /* JSKeyboardEvent.cpp */, 10611 10630 A86629CD09DA2B47009633A5 /* JSKeyboardEvent.h */, 10631 75793EC60D0CE72D007FC0AC /* JSMessageEvent.cpp */, 10632 75793EC70D0CE72D007FC0AC /* JSMessageEvent.h */, 10612 10633 A86629CC09DA2B47009633A5 /* JSMouseEvent.cpp */, 10613 10634 A86629CB09DA2B47009633A5 /* JSMouseEvent.h */, … … 12307 12328 A8C4A7F309D563270003AC8D /* MappedAttribute.h */, 12308 12329 A8C4A84B09D5649D0003AC8D /* MappedAttributeEntry.h */, 12330 75793E800D0CE0B3007FC0AC /* MessageEvent.cpp */, 12331 75793E810D0CE0B3007FC0AC /* MessageEvent.h */, 12332 75793E820D0CE0B3007FC0AC /* MessageEvent.idl */, 12309 12333 85031B2F0A44EFC700F992E0 /* MouseEvent.cpp */, 12310 12334 85031B300A44EFC700F992E0 /* MouseEvent.h */, … … 14246 14270 BCA379150D163E5500B793D6 /* JSLocation.h in Headers */, 14247 14271 BCA3793F0D1647E000B793D6 /* JSLocation.lut.h in Headers */, 14272 75793E840D0CE0B3007FC0AC /* MessageEvent.h in Headers */, 14273 75793EC90D0CE72D007FC0AC /* JSMessageEvent.h in Headers */, 14274 75793ED30D0CE85B007FC0AC /* DOMMessageEvent.h in Headers */, 14275 75793ED50D0CE85B007FC0AC /* DOMMessageEventInternal.h in Headers */, 14248 14276 BC7FA6210D1F0CBD00DB22A9 /* DynamicNodeList.h in Headers */, 14249 14277 BC7FA62D0D1F0EFF00DB22A9 /* StaticNodeList.h in Headers */, … … 14472 14500 B255996B0D00D8BA00BB825C /* WKSpotLightFilter.cikernel in Resources */, 14473 14501 B255996E0D00D8BA00BB825C /* WKTableTransferFilter.cikernel in Resources */, 14502 75793E850D0CE0B3007FC0AC /* MessageEvent.idl in Resources */, 14474 14503 46F9D5DD0B0D60170028EE36 /* aliasCursor.png in Resources */, 14475 14504 46D4F2490AF97E810035385A /* cellCursor.png in Resources */, … … 15968 15997 93309E1D099E64920056E581 /* visible_units.cpp in Sources */, 15969 15998 BCA379140D163E5500B793D6 /* JSLocation.cpp in Sources */, 15999 75793E830D0CE0B3007FC0AC /* MessageEvent.cpp in Sources */, 16000 75793EC80D0CE72D007FC0AC /* JSMessageEvent.cpp in Sources */, 16001 75793ED40D0CE85B007FC0AC /* DOMMessageEvent.mm in Sources */, 15970 16002 B2A1F2AA0CEF0ABF00442F6A /* SVGFontElement.cpp in Sources */, 15971 16003 B2A1F2AD0CEF0ABF00442F6A /* SVGGlyphElement.cpp in Sources */, -
trunk/WebCore/WebCoreSources.bkl
r28989 r29051 246 246 DerivedSources/WebCore/JSKeyboardEvent.cpp 247 247 DerivedSources/WebCore/JSMediaList.cpp 248 DerivedSources/WebCore/JSMessageEvent.cpp 248 249 DerivedSources/WebCore/JSMouseEvent.cpp 249 250 DerivedSources/WebCore/JSMutationEvent.cpp … … 314 315 dom/KeyboardEvent.cpp 315 316 dom/MappedAttribute.cpp 317 dom/MessageEvent.cpp 316 318 dom/MouseEvent.cpp 317 319 dom/MouseRelatedEvent.cpp -
trunk/WebCore/bindings/js/JSDOMWindowCustom.cpp
r28884 r29051 21 21 #include "JSDOMWindow.h" 22 22 23 #include "Document.h" 24 #include "DOMWindow.h" 25 #include "ExceptionCode.h" 23 26 #include "kjs_window.h" 24 #include "DOMWindow.h" 27 #include "kjs/object.h" 28 #include "kjs/value.h" 25 29 26 30 namespace WebCore { … … 71 75 if (entry->value.functionValue == &JSDOMWindowPrototypeFunctionFocus::create 72 76 || entry->value.functionValue == &JSDOMWindowPrototypeFunctionBlur::create 73 || entry->value.functionValue == &JSDOMWindowPrototypeFunctionClose::create) 77 || entry->value.functionValue == &JSDOMWindowPrototypeFunctionClose::create 78 || entry->value.functionValue == &JSDOMWindowPrototypeFunctionPostMessage::create) 74 79 slot.setStaticEntry(this, entry, KJS::staticFunctionGetter); 75 80 else { … … 109 114 } 110 115 116 KJS::JSValue* JSDOMWindow::postMessage(KJS::ExecState* exec, const KJS::List& args) 117 { 118 DOMWindow* window = impl(); 119 120 DOMWindow* source = static_cast<JSDOMWindow*>(exec->dynamicGlobalObject())->impl(); 121 String domain = source->document()->securityOrigin()->domain(); 122 String uri = source->document()->documentURI(); 123 String message = args[0]->toString(exec); 124 125 if (exec->hadException()) 126 return KJS::jsUndefined(); 127 128 window->postMessage(message, domain, uri, source); 129 130 return KJS::jsUndefined(); 131 } 132 111 133 } // namespace WebCore -
trunk/WebCore/bindings/js/JSEventCustom.cpp
r28468 r29051 33 33 #include "Event.h" 34 34 #include "JSKeyboardEvent.h" 35 #include "JSMessageEvent.h" 35 36 #include "JSMouseEvent.h" 36 37 #include "JSMutationEvent.h" … … 41 42 #include "JSWheelEvent.h" 42 43 #include "KeyboardEvent.h" 44 #include "MessageEvent.h" 43 45 #include "MouseEvent.h" 44 46 #include "MutationEvent.h" … … 85 87 else if (event->isOverflowEvent()) 86 88 ret = new JSOverflowEvent(exec, static_cast<OverflowEvent*>(event)); 89 else if (event->isMessageEvent()) 90 ret = new JSMessageEvent(exec, static_cast<MessageEvent*>(event)); 87 91 else if (event->isProgressEvent()) 88 92 ret = new JSProgressEvent(exec, static_cast<ProgressEvent*>(event)); -
trunk/WebCore/dom/Event.cpp
r27277 r29051 111 111 } 112 112 113 bool Event::isMessageEvent() const 114 { 115 return false; 116 } 117 113 118 bool Event::isBeforeTextInsertedEvent() const 114 119 { -
trunk/WebCore/dom/Event.h
r27776 r29051 107 107 virtual bool isDragEvent() const; // a subset of mouse events 108 108 virtual bool isClipboardEvent() const; 109 virtual bool isMessageEvent() const; 109 110 virtual bool isWheelEvent() const; 110 111 virtual bool isBeforeTextInsertedEvent() const; -
trunk/WebCore/dom/EventNames.h
r27277 r29051 55 55 macro(keyup) \ 56 56 macro(load) \ 57 macro(message) \ 57 58 macro(mousedown) \ 58 59 macro(mousemove) \ -
trunk/WebCore/page/DOMWindow.cpp
r29033 r29051 42 42 #include "FrameView.h" 43 43 #include "History.h" 44 #include "MessageEvent.h" 44 45 #include "Page.h" 45 46 #include "PlatformScreen.h" … … 220 221 } 221 222 223 void DOMWindow::postMessage(const String& message, const String& domain, const String& uri, DOMWindow* source) const 224 { 225 ExceptionCode ec; 226 document()->dispatchEvent(new MessageEvent(message, domain, uri, source), ec, true); 227 } 228 222 229 DOMSelection* DOMWindow::getSelection() 223 230 { -
trunk/WebCore/page/DOMWindow.h
r28570 r29051 142 142 143 143 Console* console() const; 144 145 void postMessage(const String& message, const String& domain, const String& uri, DOMWindow* source) const; 144 146 145 147 void scrollBy(int x, int y) const; -
trunk/WebCore/page/DOMWindow.idl
r29041 r29051 125 125 126 126 attribute [Replaceable] Console console; 127 128 // cross-document messaging 129 [DoNotCheckDomainSecurity, Custom] void postMessage(in DOMString message); 127 130 128 131 #if defined(LANGUAGE_JAVASCRIPT) … … 241 244 242 245 attribute EventConstructor Event; 246 attribute MessageEventConstructor MessageEvent; 243 247 attribute KeyboardEventConstructor KeyboardEvent; 244 248 attribute MouseEventConstructor MouseEvent;
Note: See TracChangeset
for help on using the changeset viewer.