Changeset 67898 in webkit
- Timestamp:
- Sep 20, 2010 5:22:13 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 4 added
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r67897 r67898 1 2010-09-20 Mihai Parparita <mihaip@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 Hashchange event is no longer a simple event, needs to be its own interface 6 https://bugs.webkit.org/show_bug.cgi?id=36335 7 8 Add explicit test for newURL and oldURL properties of hashchange events. 9 Add HashChangeEvent to expected global objects. 10 Update stateobjects tests to also check newURL on the hashchange event. 11 12 The original version of this patch was written by 13 Steven Lai <s3lance@hotmail.com>. 14 15 * fast/dom/Window/window-properties-expected.txt: 16 * fast/dom/prototype-inheritance-expected.txt: 17 * fast/js/global-constructors-expected.txt: 18 * fast/loader/hashchange-event-properties-expected.txt: Added. 19 * fast/loader/hashchange-event-properties.html: Added. 20 * fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html: 21 * fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html: 22 1 23 2010-09-20 Andrew Wilson <atwilson@chromium.org> 2 24 -
trunk/LayoutTests/fast/dom/Window/window-properties-expected.txt
r66251 r67898 1080 1080 window.HTMLVideoElement [object HTMLVideoElementConstructor] 1081 1081 window.HTMLVideoElement.prototype [printed above as window.Element.prototype] 1082 window.HashChangeEvent [object HashChangeEventConstructor] 1083 window.HashChangeEvent.prototype [printed above as window.Event.prototype] 1082 1084 window.Image [object ImageConstructor] 1083 1085 window.Image.prototype [printed above as window.Element.prototype] -
trunk/LayoutTests/fast/dom/prototype-inheritance-expected.txt
r63880 r67898 240 240 PASS inner.HTMLVideoElement.isInner is true 241 241 PASS inner.HTMLVideoElement.constructor.isInner is true 242 PASS inner.HashChangeEvent.isInner is true 243 PASS inner.HashChangeEvent.constructor.isInner is true 242 244 PASS inner.Image.isInner is true 243 245 PASS inner.Image.constructor.isInner is true -
trunk/LayoutTests/fast/js/global-constructors-expected.txt
r62880 r67898 116 116 PASS HTMLUListElement.toString() is '[object HTMLUListElementConstructor]' 117 117 PASS HTMLVideoElement.toString() is '[object HTMLVideoElementConstructor]' 118 PASS HashChangeEvent.toString() is '[object HashChangeEventConstructor]' 118 119 PASS Image.toString() is '[object ImageConstructor]' 119 120 PASS ImageData.toString() is '[object ImageDataConstructor]' -
trunk/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html
r66628 r67898 10 10 } 11 11 12 function lastPathComponent( )12 function lastPathComponent(url) 13 13 { 14 return window.location.href.split('/').pop();14 return url.split('/').pop(); 15 15 } 16 16 17 function hashOf(url) 18 { 19 return url.substring(url.lastIndexOf('#')); 20 } 21 17 22 function runFirstStageOfTest() 18 23 { … … 24 29 function runSecondStageOfTest() 25 30 { 26 alert("Last path component of location is " + lastPathComponent( ));31 alert("Last path component of location is " + lastPathComponent(location.href)); 27 32 setTimeout("history.back();", 0); 28 33 } … … 46 51 var beganTest = false; 47 52 48 function statePopped()53 onpopstate = function() 49 54 { 50 55 // The first time popstate fires, it's because the page has finished loading. … … 80 85 } 81 86 82 function hashChanged()87 onhashchange = function(event) 83 88 { 84 alert("hashChanged - Last path component of location is " + lastPathComponent());85 if (window.location.hash== "#FirstEntryWillLaterBeReactivated") {89 alert("hashChanged - Last path component of location is " + lastPathComponent(event.newURL)); 90 if (hashOf(event.newURL) == "#FirstEntryWillLaterBeReactivated") { 86 91 alert("Test complete"); 87 92 sessionStorage.clear(); … … 92 97 93 98 </script> 94 <body on popstate="statePopped();" onhashchange="hashChanged();" onunload="/* disable page cache */">99 <body onunload="/* disable page cache */"> 95 100 <pre> 96 101 This test: -
trunk/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html
r66628 r67898 40 40 } 41 41 42 function lastPathComponent( )42 function lastPathComponent(url) 43 43 { 44 return window.location.href.split('/').pop();44 return url.split('/').pop(); 45 45 } 46 46 … … 57 57 } 58 58 59 log("State popped with event " + event.state + " (type " + typeof event.state + ") and last path component " + lastPathComponent( ));59 log("State popped with event " + event.state + " (type " + typeof event.state + ") and last path component " + lastPathComponent(location.href)); 60 60 if (event.state != "OriginalEntry") 61 61 setTimeout("history.back();", 0); … … 64 64 } 65 65 66 onhashchange = function( )66 onhashchange = function(event) 67 67 { 68 log("Hash change fired and last path component is " + lastPathComponent( ));68 log("Hash change fired and last path component is " + lastPathComponent(event.newURL)); 69 69 } 70 70 -
trunk/WebCore/CMakeLists.txt
r67785 r67898 165 165 dom/EventException.idl 166 166 dom/Event.idl 167 dom/HashChangeEvent.idl 167 168 dom/KeyboardEvent.idl 168 169 dom/MessageChannel.idl -
trunk/WebCore/ChangeLog
r67890 r67898 1 2010-09-20 Mihai Parparita <mihaip@chromium.org> 2 3 Reviewed by Dimitri Glazkov. 4 5 Hashchange event is no longer a simple event, needs to be its own interface 6 https://bugs.webkit.org/show_bug.cgi?id=36335 7 8 Add HashChangeEvent.idl and supporting files/changes. 9 10 Test: fast/loader/hashchange-event-properties.html 11 12 The original version of this patch was written by 13 Steven Lai <s3lance@hotmail.com>. 14 15 * CMakeLists.txt: 16 * DerivedSources.cpp: 17 * DerivedSources.make: 18 * GNUmakefile.am: 19 * WebCore.gypi: 20 * WebCore.pri: 21 * WebCore.vcproj/WebCore.vcproj: 22 * WebCore.xcodeproj/project.pbxproj: 23 * bindings/js/JSEventCustom.cpp: 24 (WebCore::toJS): 25 * bindings/v8/custom/V8EventCustom.cpp: 26 (WebCore::toV8): 27 * dom/Document.cpp: 28 (WebCore::Document::enqueueHashchangeEvent): 29 * dom/Event.cpp: 30 (WebCore::Event::isHashChangeEvent): 31 * dom/Event.h: 32 * dom/HashChangeEvent.h: Added. 33 (WebCore::HashChangeEvent::isHashChangeEvent): 34 (WebCore::HashChangeEvent::create): 35 (WebCore::HashChangeEvent::initHashChangeEvent): 36 (WebCore::HashChangeEvent::oldURL): 37 (WebCore::HashChangeEvent::newURL): 38 (WebCore::HashChangeEvent::HashChangeEvent): 39 * dom/HashChangeEvent.idl: Added. 40 * page/DOMWindow.idl: 41 1 42 2010-09-20 Andy Estes <aestes@apple.com> 2 43 -
trunk/WebCore/DerivedSources.cpp
r67159 r67898 119 119 #include "JSGeolocation.cpp" 120 120 #include "JSGeoposition.cpp" 121 #include "JSHashChangeEvent.cpp" 121 122 #include "JSHistory.cpp" 122 123 #include "JSHTMLAllCollection.cpp" -
trunk/WebCore/DerivedSources.make
r67251 r67898 165 165 Geolocation \ 166 166 Geoposition \ 167 HashChangeEvent \ 168 History \ 167 169 HTMLAllCollection \ 168 170 HTMLAnchorElement \ … … 237 239 HTMLUListElement \ 238 240 HTMLVideoElement \ 239 History \240 241 IDBAny \ 241 242 IDBCursor \ -
trunk/WebCore/GNUmakefile.am
r67705 r67898 247 247 DerivedSources/WebCore/JSGeoposition.cpp \ 248 248 DerivedSources/WebCore/JSGeoposition.h \ 249 DerivedSources/WebCore/JSHashChangeEvent.cpp \ 250 DerivedSources/WebCore/JSHashChangeEvent.h \ 249 251 DerivedSources/WebCore/JSHistory.cpp \ 250 252 DerivedSources/WebCore/JSHistory.h \ … … 1127 1129 WebCore/dom/InputElement.cpp \ 1128 1130 WebCore/dom/InputElement.h \ 1131 WebCore/dom/HashChangeEvent.h \ 1129 1132 WebCore/dom/KeyboardEvent.cpp \ 1130 1133 WebCore/dom/KeyboardEvent.h \ -
trunk/WebCore/WebCore.gypi
r67704 r67898 57 57 'dom/EventListener.idl', 58 58 'dom/EventTarget.idl', 59 'dom/HashChangeEvent.idl', 59 60 'dom/KeyboardEvent.idl', 60 61 'dom/MessageChannel.idl', … … 1204 1205 'dom/InputElement.cpp', 1205 1206 'dom/InputElement.h', 1207 'dom/HashChangeEvent.h', 1206 1208 'dom/KeyboardEvent.cpp', 1207 1209 'dom/KeyboardEvent.h', -
trunk/WebCore/WebCore.pri
r67309 r67898 124 124 # dom/EventListener.idl \ 125 125 # dom/EventTarget.idl \ 126 dom/HashChangeEvent.idl \ 126 127 dom/KeyboardEvent.idl \ 127 128 dom/MouseEvent.idl \ -
trunk/WebCore/WebCore.vcproj/WebCore.vcproj
r67704 r67898 5301 5301 > 5302 5302 </File> 5303 <File 5304 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSHashChangeEvent.cpp" 5305 > 5306 <FileConfiguration 5307 Name="Debug|Win32" 5308 ExcludedFromBuild="true" 5309 > 5310 <Tool 5311 Name="VCCLCompilerTool" 5312 /> 5313 </FileConfiguration> 5314 <FileConfiguration 5315 Name="Release|Win32" 5316 ExcludedFromBuild="true" 5317 > 5318 <Tool 5319 Name="VCCLCompilerTool" 5320 /> 5321 </FileConfiguration> 5322 <FileConfiguration 5323 Name="Debug_Internal|Win32" 5324 ExcludedFromBuild="true" 5325 > 5326 <Tool 5327 Name="VCCLCompilerTool" 5328 /> 5329 </FileConfiguration> 5330 <FileConfiguration 5331 Name="Debug_Cairo|Win32" 5332 ExcludedFromBuild="true" 5333 > 5334 <Tool 5335 Name="VCCLCompilerTool" 5336 /> 5337 </FileConfiguration> 5338 <FileConfiguration 5339 Name="Release_Cairo|Win32" 5340 ExcludedFromBuild="true" 5341 > 5342 <Tool 5343 Name="VCCLCompilerTool" 5344 /> 5345 </FileConfiguration> 5346 <FileConfiguration 5347 Name="Debug_All|Win32" 5348 ExcludedFromBuild="true" 5349 > 5350 <Tool 5351 Name="VCCLCompilerTool" 5352 /> 5353 </FileConfiguration> 5354 </File> 5355 <File 5356 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSHashChangeEvent.h" 5357 > 5358 </File> 5303 5359 <File 5304 5360 RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSHistory.cpp" … … 33918 33974 </File> 33919 33975 <File 33976 RelativePath="..\dom\HashChangeEvent.cpp" 33977 > 33978 </File> 33979 <File 33920 33980 RelativePath="..\dom\KeyboardEvent.cpp" 33921 33981 > -
trunk/WebCore/WebCore.xcodeproj/project.pbxproj
r67818 r67898 1489 1489 84801954108BAFB300CB2B1F /* FEGaussianBlur.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84801952108BAFB300CB2B1F /* FEGaussianBlur.cpp */; }; 1490 1490 84801955108BAFB300CB2B1F /* FEGaussianBlur.h in Headers */ = {isa = PBXBuildFile; fileRef = 84801953108BAFB300CB2B1F /* FEGaussianBlur.h */; }; 1491 8482B7461198C35400BFB005 /* HashChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2442BBF81194C9D300D49469 /* HashChangeEvent.h */; }; 1492 8482B7511198CB6B00BFB005 /* JSHashChangeEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8482B74F1198CB6B00BFB005 /* JSHashChangeEvent.cpp */; }; 1493 8482B7521198CB6B00BFB005 /* JSHashChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 8482B7501198CB6B00BFB005 /* JSHashChangeEvent.h */; }; 1491 1494 8485227B1190162C006EDC7F /* JSSVGHKernElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 848522771190162C006EDC7F /* JSSVGHKernElement.cpp */; }; 1492 1495 8485227C1190162C006EDC7F /* JSSVGHKernElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 848522781190162C006EDC7F /* JSSVGHKernElement.h */; }; … … 6497 6500 200B190811C277D900DCCD3A /* ScriptBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptBreakpoint.cpp; sourceTree = "<group>"; }; 6498 6501 228C284410D82500009D0D0E /* ScriptWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptWrappable.h; sourceTree = "<group>"; }; 6502 2442BBF81194C9D300D49469 /* HashChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashChangeEvent.h; sourceTree = "<group>"; }; 6499 6503 24F54EAA101FE914000AE741 /* ApplicationCacheHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplicationCacheHost.cpp; sourceTree = "<group>"; }; 6500 6504 24F54EAB101FE914000AE741 /* ApplicationCacheHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationCacheHost.h; sourceTree = "<group>"; }; … … 7448 7452 84801952108BAFB300CB2B1F /* FEGaussianBlur.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEGaussianBlur.cpp; path = filters/FEGaussianBlur.cpp; sourceTree = "<group>"; }; 7449 7453 84801953108BAFB300CB2B1F /* FEGaussianBlur.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEGaussianBlur.h; path = filters/FEGaussianBlur.h; sourceTree = "<group>"; }; 7454 8482B7441198C32E00BFB005 /* HashChangeEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HashChangeEvent.idl; sourceTree = "<group>"; }; 7455 8482B74F1198CB6B00BFB005 /* JSHashChangeEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHashChangeEvent.cpp; sourceTree = "<group>"; }; 7456 8482B7501198CB6B00BFB005 /* JSHashChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHashChangeEvent.h; sourceTree = "<group>"; }; 7450 7457 848522771190162C006EDC7F /* JSSVGHKernElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGHKernElement.cpp; sourceTree = "<group>"; }; 7451 7458 848522781190162C006EDC7F /* JSSVGHKernElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGHKernElement.h; sourceTree = "<group>"; }; … … 15230 15237 BC60D9BD0D2A269A00B9918F /* JSEventException.cpp */, 15231 15238 BC60D9BE0D2A269A00B9918F /* JSEventException.h */, 15239 8482B74F1198CB6B00BFB005 /* JSHashChangeEvent.cpp */, 15240 8482B7501198CB6B00BFB005 /* JSHashChangeEvent.h */, 15232 15241 A86629CE09DA2B47009633A5 /* JSKeyboardEvent.cpp */, 15233 15242 A86629CD09DA2B47009633A5 /* JSKeyboardEvent.h */, … … 17610 17619 935FBCF109BA143B00E230B1 /* ExceptionCode.h */, 17611 17620 A853123C11D0471B00D4D077 /* FragmentScriptingPermission.h */, 17621 8482B7441198C32E00BFB005 /* HashChangeEvent.idl */, 17622 2442BBF81194C9D300D49469 /* HashChangeEvent.h */, 17612 17623 08700BE60F086C5300919419 /* InputElement.cpp */, 17613 17624 08591AA40F085C4E009BACB1 /* InputElement.h */, … … 18999 19010 C50B561712119D23008B46E0 /* GroupSettings.h in Headers */, 19000 19011 7693BAD2106C2DCA007B0823 /* HaltablePlugin.h in Headers */, 19012 8482B7461198C35400BFB005 /* HashChangeEvent.h in Headers */, 19001 19013 BC94D1540C275C8B006BC617 /* History.h in Headers */, 19002 19014 97DCE20210807C750057D394 /* HistoryController.h in Headers */, … … 19329 19341 FE80DA640E9C4703000D6F75 /* JSGeolocation.h in Headers */, 19330 19342 FE80DA660E9C4703000D6F75 /* JSGeoposition.h in Headers */, 19343 8482B7521198CB6B00BFB005 /* JSHashChangeEvent.h in Headers */, 19331 19344 BC94D14F0C275C68006BC617 /* JSHistory.h in Headers */, 19332 19345 BC97E413109154FA0010D361 /* JSHTMLAllCollection.h in Headers */, … … 21860 21873 FE80D7AB0E9C1ED2000D6F75 /* JSGeolocationCustom.cpp in Sources */, 21861 21874 FE80DA650E9C4703000D6F75 /* JSGeoposition.cpp in Sources */, 21875 8482B7511198CB6B00BFB005 /* JSHashChangeEvent.cpp in Sources */, 21862 21876 BC94D14E0C275C68006BC617 /* JSHistory.cpp in Sources */, 21863 21877 BCE7B1930D4E86960075A539 /* JSHistoryCustom.cpp in Sources */, -
trunk/WebCore/bindings/js/JSEventCustom.cpp
r64845 r67898 43 43 #include "JSDeviceOrientationEvent.h" 44 44 #include "JSErrorEvent.h" 45 #include "JSHashChangeEvent.h" 45 46 #include "JSKeyboardEvent.h" 46 47 #include "JSMessageEvent.h" … … 59 60 #include "BeforeLoadEvent.h" 60 61 #include "ErrorEvent.h" 62 #include "HashChangeEvent.h" 61 63 #include "KeyboardEvent.h" 62 64 #include "MessageEvent.h" … … 171 173 wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, ErrorEvent, event); 172 174 #endif 175 else if (event->isHashChangeEvent()) 176 wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, HashChangeEvent, event); 173 177 else if (event->isPopStateEvent()) 174 178 wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, PopStateEvent, event); -
trunk/WebCore/bindings/v8/custom/V8EventCustom.cpp
r65071 r67898 44 44 #include "V8DeviceOrientationEvent.h" 45 45 #include "V8ErrorEvent.h" 46 #include "V8HashChangeEvent.h" 46 47 #include "V8IDBErrorEvent.h" 47 48 #include "V8IDBSuccessEvent.h" … … 121 122 return toV8(static_cast<UIEvent*>(impl)); 122 123 } 124 if (impl->isHashChangeEvent()) 125 return toV8(static_cast<HashChangeEvent*>(impl)); 123 126 if (impl->isMutationEvent()) 124 127 return toV8(static_cast<MutationEvent*>(impl)); -
trunk/WebCore/dom/Document.cpp
r67762 r67898 66 66 #include "FrameTree.h" 67 67 #include "FrameView.h" 68 #include "HashChangeEvent.h" 68 69 #include "HTMLAllCollection.h" 69 70 #include "HTMLAnchorElement.h" … … 4639 4640 } 4640 4641 4641 void Document::enqueueHashchangeEvent(const String& /*oldURL*/, const String& /*newURL*/) 4642 { 4643 // FIXME: https://bugs.webkit.org/show_bug.cgi?id=36335 Hashchange event is now its own interface and takes two 4644 // URL arguments which we need to pass in here. 4645 enqueueEvent(Event::create(eventNames().hashchangeEvent, false, false)); 4642 void Document::enqueueHashchangeEvent(const String& oldURL, const String& newURL) 4643 { 4644 enqueueEvent(HashChangeEvent::create(oldURL, newURL)); 4646 4645 } 4647 4646 -
trunk/WebCore/dom/Event.cpp
r65077 r67898 173 173 } 174 174 175 bool Event::isHashChangeEvent() const 176 { 177 return false; 178 } 179 175 180 #if ENABLE(SVG) 176 181 bool Event::isSVGZoomEvent() const -
trunk/WebCore/dom/Event.h
r65077 r67898 124 124 virtual bool isWebKitTransitionEvent() const; 125 125 virtual bool isBeforeLoadEvent() const; 126 virtual bool isHashChangeEvent() const; 126 127 #if ENABLE(SVG) 127 128 virtual bool isSVGZoomEvent() const; -
trunk/WebCore/page/DOMWindow.idl
r67734 r67898 498 498 attribute EventConstructor Event; 499 499 attribute BeforeLoadEventConstructor BeforeLoadEvent; 500 attribute HashChangeEventConstructor HashChangeEvent; 500 501 attribute KeyboardEventConstructor KeyboardEvent; 501 502 attribute MouseEventConstructor MouseEvent;
Note: See TracChangeset
for help on using the changeset viewer.