[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

mihaip at chromium.org mihaip at chromium.org
Wed Dec 22 13:35:20 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 6b40a77bbe59bcea7c64bb7163f12dcd76d19779
Author: mihaip at chromium.org <mihaip at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Sep 21 00:22:13 2010 +0000

    2010-09-20  Mihai Parparita  <mihaip at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            Hashchange event is no longer a simple event, needs to be its own interface
            https://bugs.webkit.org/show_bug.cgi?id=36335
    
            Add explicit test for newURL and oldURL properties of hashchange events.
            Add HashChangeEvent to expected global objects.
            Update stateobjects tests to also check newURL on the hashchange event.
    
            The original version of this patch was written by
            Steven Lai <s3lance at hotmail.com>.
    
            * fast/dom/Window/window-properties-expected.txt:
            * fast/dom/prototype-inheritance-expected.txt:
            * fast/js/global-constructors-expected.txt:
            * fast/loader/hashchange-event-properties-expected.txt: Added.
            * fast/loader/hashchange-event-properties.html: Added.
            * fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html:
            * fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html:
    2010-09-20  Mihai Parparita  <mihaip at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            Hashchange event is no longer a simple event, needs to be its own interface
            https://bugs.webkit.org/show_bug.cgi?id=36335
    
            Add HashChangeEvent.idl and supporting files/changes.
    
            Test: fast/loader/hashchange-event-properties.html
    
            The original version of this patch was written by
            Steven Lai <s3lance at hotmail.com>.
    
            * CMakeLists.txt:
            * DerivedSources.cpp:
            * DerivedSources.make:
            * GNUmakefile.am:
            * WebCore.gypi:
            * WebCore.pri:
            * WebCore.vcproj/WebCore.vcproj:
            * WebCore.xcodeproj/project.pbxproj:
            * bindings/js/JSEventCustom.cpp:
            (WebCore::toJS):
            * bindings/v8/custom/V8EventCustom.cpp:
            (WebCore::toV8):
            * dom/Document.cpp:
            (WebCore::Document::enqueueHashchangeEvent):
            * dom/Event.cpp:
            (WebCore::Event::isHashChangeEvent):
            * dom/Event.h:
            * dom/HashChangeEvent.h: Added.
            (WebCore::HashChangeEvent::isHashChangeEvent):
            (WebCore::HashChangeEvent::create):
            (WebCore::HashChangeEvent::initHashChangeEvent):
            (WebCore::HashChangeEvent::oldURL):
            (WebCore::HashChangeEvent::newURL):
            (WebCore::HashChangeEvent::HashChangeEvent):
            * dom/HashChangeEvent.idl: Added.
            * page/DOMWindow.idl:
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@67898 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index a8de138..7dc396d 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,25 @@
+2010-09-20  Mihai Parparita  <mihaip at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Hashchange event is no longer a simple event, needs to be its own interface
+        https://bugs.webkit.org/show_bug.cgi?id=36335
+        
+        Add explicit test for newURL and oldURL properties of hashchange events.
+        Add HashChangeEvent to expected global objects.
+        Update stateobjects tests to also check newURL on the hashchange event.
+
+        The original version of this patch was written by
+        Steven Lai <s3lance at hotmail.com>.
+
+        * fast/dom/Window/window-properties-expected.txt:
+        * fast/dom/prototype-inheritance-expected.txt:
+        * fast/js/global-constructors-expected.txt:
+        * fast/loader/hashchange-event-properties-expected.txt: Added.
+        * fast/loader/hashchange-event-properties.html: Added.
+        * fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html:
+        * fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html:
+
 2010-09-20  Andrew Wilson  <atwilson at chromium.org>
 
         Revert r67892 (expectations update) as the expectations are out-of-date due to r67879.
diff --git a/LayoutTests/fast/dom/Window/window-properties-expected.txt b/LayoutTests/fast/dom/Window/window-properties-expected.txt
index e553bec..d484cfe 100644
--- a/LayoutTests/fast/dom/Window/window-properties-expected.txt
+++ b/LayoutTests/fast/dom/Window/window-properties-expected.txt
@@ -1079,6 +1079,8 @@ window.HTMLUListElement [object HTMLUListElementConstructor]
 window.HTMLUListElement.prototype [printed above as window.Element.prototype]
 window.HTMLVideoElement [object HTMLVideoElementConstructor]
 window.HTMLVideoElement.prototype [printed above as window.Element.prototype]
+window.HashChangeEvent [object HashChangeEventConstructor]
+window.HashChangeEvent.prototype [printed above as window.Event.prototype]
 window.Image [object ImageConstructor]
 window.Image.prototype [printed above as window.Element.prototype]
 window.ImageData [object ImageDataConstructor]
diff --git a/LayoutTests/fast/dom/prototype-inheritance-expected.txt b/LayoutTests/fast/dom/prototype-inheritance-expected.txt
index 6e8f1c8..3b45ce8 100644
--- a/LayoutTests/fast/dom/prototype-inheritance-expected.txt
+++ b/LayoutTests/fast/dom/prototype-inheritance-expected.txt
@@ -239,6 +239,8 @@ PASS inner.HTMLUListElement.isInner is true
 PASS inner.HTMLUListElement.constructor.isInner is true
 PASS inner.HTMLVideoElement.isInner is true
 PASS inner.HTMLVideoElement.constructor.isInner is true
+PASS inner.HashChangeEvent.isInner is true
+PASS inner.HashChangeEvent.constructor.isInner is true
 PASS inner.Image.isInner is true
 PASS inner.Image.constructor.isInner is true
 PASS inner.ImageData.isInner is true
diff --git a/LayoutTests/fast/js/global-constructors-expected.txt b/LayoutTests/fast/js/global-constructors-expected.txt
index 5aa0d28..97893da 100644
--- a/LayoutTests/fast/js/global-constructors-expected.txt
+++ b/LayoutTests/fast/js/global-constructors-expected.txt
@@ -115,6 +115,7 @@ PASS HTMLTextAreaElement.toString() is '[object HTMLTextAreaElementConstructor]'
 PASS HTMLTitleElement.toString() is '[object HTMLTitleElementConstructor]'
 PASS HTMLUListElement.toString() is '[object HTMLUListElementConstructor]'
 PASS HTMLVideoElement.toString() is '[object HTMLVideoElementConstructor]'
+PASS HashChangeEvent.toString() is '[object HashChangeEventConstructor]'
 PASS Image.toString() is '[object ImageConstructor]'
 PASS ImageData.toString() is '[object ImageDataConstructor]'
 PASS KeyboardEvent.toString() is '[object KeyboardEventConstructor]'
diff --git a/LayoutTests/fast/loader/hashchange-event-properties-expected.txt b/LayoutTests/fast/loader/hashchange-event-properties-expected.txt
new file mode 100644
index 0000000..eeb6f52
--- /dev/null
+++ b/LayoutTests/fast/loader/hashchange-event-properties-expected.txt
@@ -0,0 +1,12 @@
+Tests that hashchange events have the expected newURL and oldURL properties.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+hashchange fired with oldURL hash "[none]" and newURL hash "#state1"
+hashchange fired with oldURL hash "#state1" and newURL hash "#state2"
+hashchange fired with oldURL hash "#state2" and newURL hash "#state1"
+hashchange fired with oldURL hash "#state1" and newURL hash "[none]"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/loader/hashchange-event-properties.html b/LayoutTests/fast/loader/hashchange-event-properties.html
new file mode 100644
index 0000000..5ca9d06
--- /dev/null
+++ b/LayoutTests/fast/loader/hashchange-event-properties.html
@@ -0,0 +1,53 @@
+<!DOCTYPE html>
+<html>
+<body>
+<link rel="stylesheet" href="../js/resources/js-test-style.css" type="text/css">
+<script src="../js/resources/js-test-pre.js"></script>
+<div id="description"></div>
+<pre id="console"></pre>
+<script>
+description('Tests that hashchange events have the expected newURL and oldURL properties.');
+
+function hashOf(url)
+{
+    var hashIndex = url.lastIndexOf('#');
+    return hashIndex != -1 ? url.substring(hashIndex) : '[none]';
+}
+
+var goingForward = true;
+
+onload = function()
+{
+    setTimeout(function() {location.href = '#state1';}, 0);
+};
+
+onhashchange = function(event)
+{
+    debug('hashchange fired with oldURL hash "' + hashOf(event.oldURL) + '" and newURL hash "' + hashOf(event.newURL) + '"');
+    
+    switch (hashOf(event.newURL)) {
+        case '#state1':
+            if (goingForward)
+                location.href = '#state2';
+            else
+                history.back();
+            break;
+        case '#state2':
+            if (goingForward) {
+                goingForward = false;
+                history.back();
+            } else {
+                testFailed('should always be going forward at #state2');
+            }
+            break;
+        case '[none]':
+            finishJSTest();
+            break;
+    }
+};
+
+var successfullyParsed = true;
+var jsTestIsAsync = true;
+</script>
+<script src="../js/resources/js-test-post.js"></script>
+</html>
diff --git a/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html b/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html
index da500ab..11f348f 100644
--- a/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html
+++ b/LayoutTests/fast/loader/stateobjects/document-destroyed-navigate-back-with-fragment-scroll.html
@@ -9,11 +9,16 @@ if (window.layoutTestController) {
     layoutTestController.waitUntilDone();
 }
 
-function lastPathComponent()
+function lastPathComponent(url)
 {
-    return window.location.href.split('/').pop();
+    return url.split('/').pop();
 }
 
+function hashOf(url)
+{
+    return url.substring(url.lastIndexOf('#'));
+}
+ 
 function runFirstStageOfTest()
 {   
     history.replaceState("FirstEntry", null, "#FirstEntry");
@@ -23,7 +28,7 @@ function runFirstStageOfTest()
 
 function runSecondStageOfTest()
 {
-    alert("Last path component of location is " + lastPathComponent());
+    alert("Last path component of location is " + lastPathComponent(location.href));
     setTimeout("history.back();", 0);
 }
 
@@ -45,7 +50,7 @@ function runTest()
 
 var beganTest = false;
 
-function statePopped()
+onpopstate = function()
 {
     // The first time popstate fires, it's because the page has finished loading.
     // Only then can we begin the test.
@@ -79,10 +84,10 @@ function statePopped()
     }, 0);
 }
 
-function hashChanged()
+onhashchange = function(event)
 {
-    alert("hashChanged - Last path component of location is " + lastPathComponent());
-    if (window.location.hash == "#FirstEntryWillLaterBeReactivated") {
+   alert("hashChanged - Last path component of location is " + lastPathComponent(event.newURL));
+   if (hashOf(event.newURL) == "#FirstEntryWillLaterBeReactivated") {
         alert("Test complete");
         sessionStorage.clear();
         if (window.layoutTestController)
@@ -91,7 +96,7 @@ function hashChanged()
 }
 
 </script>
-<body onpopstate="statePopped();" onhashchange="hashChanged();" onunload="/* disable page cache */">
+<body onunload="/* disable page cache */">
 <pre>
 This test:
 -Builds up a list of state object entries with fragment URLs.
diff --git a/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html b/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html
index a92d7cc..07c784d 100644
--- a/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html
+++ b/LayoutTests/fast/loader/stateobjects/pushstate-with-fragment-urls-and-hashchange.html
@@ -39,9 +39,9 @@ function runTest()
     history.back();
 }
 
-function lastPathComponent()
+function lastPathComponent(url)
 {
-    return window.location.href.split('/').pop();
+    return url.split('/').pop();
 }
 
 var beganTest = false;
@@ -56,16 +56,16 @@ onpopstate = function(event)
         return;
     }
 
-    log("State popped with event " + event.state + " (type " + typeof event.state + ") and last path component " + lastPathComponent());
+    log("State popped with event " + event.state + " (type " + typeof event.state + ") and last path component " + lastPathComponent(location.href));
     if (event.state != "OriginalEntry")
         setTimeout("history.back();", 0);
     else if (window.layoutTestController)
         layoutTestController.notifyDone();
 }
 
-onhashchange = function()
+onhashchange = function(event)
 {
-    log("Hash change fired and last path component is " + lastPathComponent());
+    log("Hash change fired and last path component is " + lastPathComponent(event.newURL));
 }
 
 </script>
diff --git a/WebCore/CMakeLists.txt b/WebCore/CMakeLists.txt
index 2fb7d39..eeb88b1 100644
--- a/WebCore/CMakeLists.txt
+++ b/WebCore/CMakeLists.txt
@@ -164,6 +164,7 @@ SET(WebCore_IDL_FILES
     dom/ErrorEvent.idl
     dom/EventException.idl
     dom/Event.idl
+    dom/HashChangeEvent.idl
     dom/KeyboardEvent.idl
     dom/MessageChannel.idl
     dom/MessageEvent.idl
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index ccb594e..26c7ed0 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,44 @@
+2010-09-20  Mihai Parparita  <mihaip at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Hashchange event is no longer a simple event, needs to be its own interface
+        https://bugs.webkit.org/show_bug.cgi?id=36335
+        
+        Add HashChangeEvent.idl and supporting files/changes.
+
+        Test: fast/loader/hashchange-event-properties.html
+
+        The original version of this patch was written by
+        Steven Lai <s3lance at hotmail.com>.
+
+        * CMakeLists.txt:
+        * DerivedSources.cpp:
+        * DerivedSources.make:
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pri:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/JSEventCustom.cpp:
+        (WebCore::toJS):
+        * bindings/v8/custom/V8EventCustom.cpp:
+        (WebCore::toV8):
+        * dom/Document.cpp:
+        (WebCore::Document::enqueueHashchangeEvent):
+        * dom/Event.cpp:
+        (WebCore::Event::isHashChangeEvent):
+        * dom/Event.h:
+        * dom/HashChangeEvent.h: Added.
+        (WebCore::HashChangeEvent::isHashChangeEvent):
+        (WebCore::HashChangeEvent::create):
+        (WebCore::HashChangeEvent::initHashChangeEvent):
+        (WebCore::HashChangeEvent::oldURL):
+        (WebCore::HashChangeEvent::newURL):
+        (WebCore::HashChangeEvent::HashChangeEvent):
+        * dom/HashChangeEvent.idl: Added.
+        * page/DOMWindow.idl:
+
 2010-09-20  Andy Estes  <aestes at apple.com>
 
         Reviewed by Adam Barth.
diff --git a/WebCore/DerivedSources.cpp b/WebCore/DerivedSources.cpp
index 7a0c2fd..bab8109 100644
--- a/WebCore/DerivedSources.cpp
+++ b/WebCore/DerivedSources.cpp
@@ -118,6 +118,7 @@
 #include "JSFlags.cpp"
 #include "JSGeolocation.cpp"
 #include "JSGeoposition.cpp"
+#include "JSHashChangeEvent.cpp"
 #include "JSHistory.cpp"
 #include "JSHTMLAllCollection.cpp"
 #include "JSHTMLAnchorElement.cpp"
diff --git a/WebCore/DerivedSources.make b/WebCore/DerivedSources.make
index ea301b8..adbd30c 100644
--- a/WebCore/DerivedSources.make
+++ b/WebCore/DerivedSources.make
@@ -164,6 +164,8 @@ DOM_CLASSES = \
     Flags \
     Geolocation \
     Geoposition \
+    HashChangeEvent \
+    History \
     HTMLAllCollection \
     HTMLAnchorElement \
     HTMLAppletElement \
@@ -236,7 +238,6 @@ DOM_CLASSES = \
     HTMLTitleElement \
     HTMLUListElement \
     HTMLVideoElement \
-    History \
     IDBAny \
     IDBCursor \
     IDBDatabaseError \
diff --git a/WebCore/GNUmakefile.am b/WebCore/GNUmakefile.am
index 33dee94..1a0a754 100644
--- a/WebCore/GNUmakefile.am
+++ b/WebCore/GNUmakefile.am
@@ -246,6 +246,8 @@ webcore_built_sources += \
 	DerivedSources/WebCore/JSGeolocation.h \
 	DerivedSources/WebCore/JSGeoposition.cpp \
 	DerivedSources/WebCore/JSGeoposition.h \
+	DerivedSources/WebCore/JSHashChangeEvent.cpp \
+	DerivedSources/WebCore/JSHashChangeEvent.h \
 	DerivedSources/WebCore/JSHistory.cpp \
 	DerivedSources/WebCore/JSHistory.h \
 	DerivedSources/WebCore/JSHTMLAllCollection.cpp \
@@ -1126,6 +1128,7 @@ webcore_sources += \
 	WebCore/dom/FragmentScriptingPermission.h \
 	WebCore/dom/InputElement.cpp \
 	WebCore/dom/InputElement.h \
+	WebCore/dom/HashChangeEvent.h \
 	WebCore/dom/KeyboardEvent.cpp \
 	WebCore/dom/KeyboardEvent.h \
 	WebCore/dom/MappedAttributeEntry.h \
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 1ded06f..528dc3c 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -56,6 +56,7 @@
             'dom/EventException.idl',
             'dom/EventListener.idl',
             'dom/EventTarget.idl',
+            'dom/HashChangeEvent.idl',
             'dom/KeyboardEvent.idl',
             'dom/MessageChannel.idl',
             'dom/MessageEvent.idl',
@@ -1203,6 +1204,7 @@
             'dom/FragmentScriptingPermission.h',
             'dom/InputElement.cpp',
             'dom/InputElement.h',
+            'dom/HashChangeEvent.h',
             'dom/KeyboardEvent.cpp',
             'dom/KeyboardEvent.h',
             'dom/MappedAttributeEntry.h',
diff --git a/WebCore/WebCore.pri b/WebCore/WebCore.pri
index 9470ffd..37bb205 100644
--- a/WebCore/WebCore.pri
+++ b/WebCore/WebCore.pri
@@ -123,6 +123,7 @@ IDL_BINDINGS += \
     dom/EventException.idl \
 #    dom/EventListener.idl \
 #    dom/EventTarget.idl \
+    dom/HashChangeEvent.idl \
     dom/KeyboardEvent.idl \
     dom/MouseEvent.idl \
     dom/MessageChannel.idl \
diff --git a/WebCore/WebCore.vcproj/WebCore.vcproj b/WebCore/WebCore.vcproj/WebCore.vcproj
index 0c360ce..e5158e2 100644
--- a/WebCore/WebCore.vcproj/WebCore.vcproj
+++ b/WebCore/WebCore.vcproj/WebCore.vcproj
@@ -5300,6 +5300,62 @@
 				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSGeoposition.h"
 				>
 			</File>
+ 			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSHashChangeEvent.cpp"
+				>
+				<FileConfiguration
+					Name="Debug|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_Internal|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_Cairo|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release_Cairo|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Debug_All|Win32"
+					ExcludedFromBuild="true"
+					>
+					<Tool
+						Name="VCCLCompilerTool"
+					/>
+				</FileConfiguration>
+			</File>
+			<File
+				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSHashChangeEvent.h"
+				>
+			</File>
 			<File
 				RelativePath="$(WebKitOutputDir)\obj\$(ProjectName)\DerivedSources\JSHistory.cpp"
 				>
@@ -33917,6 +33973,10 @@
 				>
 			</File>
 			<File
+				RelativePath="..\dom\HashChangeEvent.cpp"
+				>
+			</File>
+			<File
 				RelativePath="..\dom\KeyboardEvent.cpp"
 				>
 			</File>
diff --git a/WebCore/WebCore.xcodeproj/project.pbxproj b/WebCore/WebCore.xcodeproj/project.pbxproj
index 5601d9f..735e9d5 100644
--- a/WebCore/WebCore.xcodeproj/project.pbxproj
+++ b/WebCore/WebCore.xcodeproj/project.pbxproj
@@ -1488,6 +1488,9 @@
 		8476C9F011DF6A5800555B02 /* SVGPathParser.h in Headers */ = {isa = PBXBuildFile; fileRef = 8476C9EE11DF6A5800555B02 /* SVGPathParser.h */; };
 		84801954108BAFB300CB2B1F /* FEGaussianBlur.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 84801952108BAFB300CB2B1F /* FEGaussianBlur.cpp */; };
 		84801955108BAFB300CB2B1F /* FEGaussianBlur.h in Headers */ = {isa = PBXBuildFile; fileRef = 84801953108BAFB300CB2B1F /* FEGaussianBlur.h */; };
+		8482B7461198C35400BFB005 /* HashChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 2442BBF81194C9D300D49469 /* HashChangeEvent.h */; };
+		8482B7511198CB6B00BFB005 /* JSHashChangeEvent.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 8482B74F1198CB6B00BFB005 /* JSHashChangeEvent.cpp */; };
+		8482B7521198CB6B00BFB005 /* JSHashChangeEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 8482B7501198CB6B00BFB005 /* JSHashChangeEvent.h */; };
 		8485227B1190162C006EDC7F /* JSSVGHKernElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 848522771190162C006EDC7F /* JSSVGHKernElement.cpp */; };
 		8485227C1190162C006EDC7F /* JSSVGHKernElement.h in Headers */ = {isa = PBXBuildFile; fileRef = 848522781190162C006EDC7F /* JSSVGHKernElement.h */; };
 		8485227D1190162C006EDC7F /* JSSVGVKernElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 848522791190162C006EDC7F /* JSSVGVKernElement.cpp */; };
@@ -6496,6 +6499,7 @@
 		1CFAE3220A6D6A3F0032593D /* libobjc.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; name = libobjc.dylib; path = /usr/lib/libobjc.dylib; sourceTree = "<absolute>"; };
 		200B190811C277D900DCCD3A /* ScriptBreakpoint.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptBreakpoint.cpp; sourceTree = "<group>"; };
 		228C284410D82500009D0D0E /* ScriptWrappable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptWrappable.h; sourceTree = "<group>"; };
+		2442BBF81194C9D300D49469 /* HashChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HashChangeEvent.h; sourceTree = "<group>"; };
 		24F54EAA101FE914000AE741 /* ApplicationCacheHost.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ApplicationCacheHost.cpp; sourceTree = "<group>"; };
 		24F54EAB101FE914000AE741 /* ApplicationCacheHost.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ApplicationCacheHost.h; sourceTree = "<group>"; };
 		2542F4D81166C25A00E89A86 /* UserGestureIndicator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = UserGestureIndicator.cpp; sourceTree = "<group>"; };
@@ -7447,6 +7451,9 @@
 		8476C9EE11DF6A5800555B02 /* SVGPathParser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGPathParser.h; sourceTree = "<group>"; };
 		84801952108BAFB300CB2B1F /* FEGaussianBlur.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = FEGaussianBlur.cpp; path = filters/FEGaussianBlur.cpp; sourceTree = "<group>"; };
 		84801953108BAFB300CB2B1F /* FEGaussianBlur.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = FEGaussianBlur.h; path = filters/FEGaussianBlur.h; sourceTree = "<group>"; };
+		8482B7441198C32E00BFB005 /* HashChangeEvent.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = HashChangeEvent.idl; sourceTree = "<group>"; };
+		8482B74F1198CB6B00BFB005 /* JSHashChangeEvent.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSHashChangeEvent.cpp; sourceTree = "<group>"; };
+		8482B7501198CB6B00BFB005 /* JSHashChangeEvent.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSHashChangeEvent.h; sourceTree = "<group>"; };
 		848522771190162C006EDC7F /* JSSVGHKernElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGHKernElement.cpp; sourceTree = "<group>"; };
 		848522781190162C006EDC7F /* JSSVGHKernElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSSVGHKernElement.h; sourceTree = "<group>"; };
 		848522791190162C006EDC7F /* JSSVGVKernElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = JSSVGVKernElement.cpp; sourceTree = "<group>"; };
@@ -15229,6 +15236,8 @@
 				14E8378D09F85D4F00B85AE4 /* JSEvent.h */,
 				BC60D9BD0D2A269A00B9918F /* JSEventException.cpp */,
 				BC60D9BE0D2A269A00B9918F /* JSEventException.h */,
+				8482B74F1198CB6B00BFB005 /* JSHashChangeEvent.cpp */,
+				8482B7501198CB6B00BFB005 /* JSHashChangeEvent.h */,
 				A86629CE09DA2B47009633A5 /* JSKeyboardEvent.cpp */,
 				A86629CD09DA2B47009633A5 /* JSKeyboardEvent.h */,
 				E107400B0E77BDC00033AF24 /* JSMessageChannel.cpp */,
@@ -17609,6 +17618,8 @@
 				93831B560D087D6000E5C984 /* ExceptionCode.cpp */,
 				935FBCF109BA143B00E230B1 /* ExceptionCode.h */,
 				A853123C11D0471B00D4D077 /* FragmentScriptingPermission.h */,
+				8482B7441198C32E00BFB005 /* HashChangeEvent.idl */,
+				2442BBF81194C9D300D49469 /* HashChangeEvent.h */,
 				08700BE60F086C5300919419 /* InputElement.cpp */,
 				08591AA40F085C4E009BACB1 /* InputElement.h */,
 				85031B2D0A44EFC700F992E0 /* KeyboardEvent.cpp */,
@@ -18998,6 +19009,7 @@
 				B2A015AB0AF6CD53006BCE0E /* GraphicsTypes.h in Headers */,
 				C50B561712119D23008B46E0 /* GroupSettings.h in Headers */,
 				7693BAD2106C2DCA007B0823 /* HaltablePlugin.h in Headers */,
+				8482B7461198C35400BFB005 /* HashChangeEvent.h in Headers */,
 				BC94D1540C275C8B006BC617 /* History.h in Headers */,
 				97DCE20210807C750057D394 /* HistoryController.h in Headers */,
 				51741D110B07259A00ED442C /* HistoryItem.h in Headers */,
@@ -19328,6 +19340,7 @@
 				49EECF03105070C400099FAB /* JSFloat32Array.h in Headers */,
 				FE80DA640E9C4703000D6F75 /* JSGeolocation.h in Headers */,
 				FE80DA660E9C4703000D6F75 /* JSGeoposition.h in Headers */,
+				8482B7521198CB6B00BFB005 /* JSHashChangeEvent.h in Headers */,
 				BC94D14F0C275C68006BC617 /* JSHistory.h in Headers */,
 				BC97E413109154FA0010D361 /* JSHTMLAllCollection.h in Headers */,
 				1A4A2DF00A1B852A00C807F8 /* JSHTMLAnchorElement.h in Headers */,
@@ -21859,6 +21872,7 @@
 				FE80DA630E9C4703000D6F75 /* JSGeolocation.cpp in Sources */,
 				FE80D7AB0E9C1ED2000D6F75 /* JSGeolocationCustom.cpp in Sources */,
 				FE80DA650E9C4703000D6F75 /* JSGeoposition.cpp in Sources */,
+				8482B7511198CB6B00BFB005 /* JSHashChangeEvent.cpp in Sources */,
 				BC94D14E0C275C68006BC617 /* JSHistory.cpp in Sources */,
 				BCE7B1930D4E86960075A539 /* JSHistoryCustom.cpp in Sources */,
 				BC97E412109154FA0010D361 /* JSHTMLAllCollection.cpp in Sources */,
diff --git a/WebCore/bindings/js/JSEventCustom.cpp b/WebCore/bindings/js/JSEventCustom.cpp
index 7479020..d2e9d61 100644
--- a/WebCore/bindings/js/JSEventCustom.cpp
+++ b/WebCore/bindings/js/JSEventCustom.cpp
@@ -42,6 +42,7 @@
 #include "JSDeviceMotionEvent.h"
 #include "JSDeviceOrientationEvent.h"
 #include "JSErrorEvent.h"
+#include "JSHashChangeEvent.h"
 #include "JSKeyboardEvent.h"
 #include "JSMessageEvent.h"
 #include "JSMouseEvent.h"
@@ -58,6 +59,7 @@
 #include "JSXMLHttpRequestProgressEvent.h"
 #include "BeforeLoadEvent.h"
 #include "ErrorEvent.h"
+#include "HashChangeEvent.h"
 #include "KeyboardEvent.h"
 #include "MessageEvent.h"
 #include "MouseEvent.h"
@@ -170,6 +172,8 @@ JSValue toJS(ExecState* exec, JSDOMGlobalObject* globalObject, Event* event)
     else if (event->isErrorEvent())
         wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, ErrorEvent, event);
 #endif
+    else if (event->isHashChangeEvent())
+        wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, HashChangeEvent, event);
     else if (event->isPopStateEvent())
         wrapper = CREATE_DOM_OBJECT_WRAPPER(exec, globalObject, PopStateEvent, event);
     else if (event->isCustomEvent())
diff --git a/WebCore/bindings/v8/custom/V8EventCustom.cpp b/WebCore/bindings/v8/custom/V8EventCustom.cpp
index e0bb02b..f96ba7a 100644
--- a/WebCore/bindings/v8/custom/V8EventCustom.cpp
+++ b/WebCore/bindings/v8/custom/V8EventCustom.cpp
@@ -43,6 +43,7 @@
 #include "V8DeviceMotionEvent.h"
 #include "V8DeviceOrientationEvent.h"
 #include "V8ErrorEvent.h"
+#include "V8HashChangeEvent.h"
 #include "V8IDBErrorEvent.h"
 #include "V8IDBSuccessEvent.h"
 #include "V8KeyboardEvent.h"
@@ -120,6 +121,8 @@ v8::Handle<v8::Value> toV8(Event* impl)
 #endif
         return toV8(static_cast<UIEvent*>(impl));
     }
+    if (impl->isHashChangeEvent())
+        return toV8(static_cast<HashChangeEvent*>(impl));
     if (impl->isMutationEvent())
         return toV8(static_cast<MutationEvent*>(impl));
     if (impl->isOverflowEvent())
diff --git a/WebCore/dom/Document.cpp b/WebCore/dom/Document.cpp
index 06bd755..194d4e1 100644
--- a/WebCore/dom/Document.cpp
+++ b/WebCore/dom/Document.cpp
@@ -65,6 +65,7 @@
 #include "FrameLoader.h"
 #include "FrameTree.h"
 #include "FrameView.h"
+#include "HashChangeEvent.h"
 #include "HTMLAllCollection.h"
 #include "HTMLAnchorElement.h"
 #include "HTMLBodyElement.h"
@@ -4638,11 +4639,9 @@ void Document::enqueuePageshowEvent(PageshowEventPersistence persisted)
     dispatchWindowEvent(PageTransitionEvent::create(eventNames().pageshowEvent, persisted), this);
 }
 
-void Document::enqueueHashchangeEvent(const String& /*oldURL*/, const String& /*newURL*/)
+void Document::enqueueHashchangeEvent(const String& oldURL, const String& newURL)
 {
-    // FIXME: https://bugs.webkit.org/show_bug.cgi?id=36335 Hashchange event is now its own interface and takes two
-    //   URL arguments which we need to pass in here.
-    enqueueEvent(Event::create(eventNames().hashchangeEvent, false, false));
+    enqueueEvent(HashChangeEvent::create(oldURL, newURL));
 }
 
 void Document::enqueuePopstateEvent(PassRefPtr<SerializedScriptValue> stateObject)
diff --git a/WebCore/dom/Event.cpp b/WebCore/dom/Event.cpp
index c76f951..bb404fa 100644
--- a/WebCore/dom/Event.cpp
+++ b/WebCore/dom/Event.cpp
@@ -172,6 +172,11 @@ bool Event::isBeforeLoadEvent() const
     return false;
 }
 
+bool Event::isHashChangeEvent() const
+{
+    return false;
+}
+
 #if ENABLE(SVG)
 bool Event::isSVGZoomEvent() const
 {
diff --git a/WebCore/dom/Event.h b/WebCore/dom/Event.h
index b992237..2a00eee 100644
--- a/WebCore/dom/Event.h
+++ b/WebCore/dom/Event.h
@@ -123,6 +123,7 @@ namespace WebCore {
         virtual bool isWebKitAnimationEvent() const;
         virtual bool isWebKitTransitionEvent() const;
         virtual bool isBeforeLoadEvent() const;
+        virtual bool isHashChangeEvent() const;
 #if ENABLE(SVG)
         virtual bool isSVGZoomEvent() const;
 #endif
diff --git a/WebCore/dom/HashChangeEvent.h b/WebCore/dom/HashChangeEvent.h
new file mode 100644
index 0000000..f1fa6af
--- /dev/null
+++ b/WebCore/dom/HashChangeEvent.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef HashChangeEvent_h
+#define HashChangeEvent_h
+
+#include "Event.h"
+#include "EventNames.h"
+
+namespace WebCore {
+
+class HashChangeEvent : public Event {
+public:
+    virtual bool isHashChangeEvent() const { return true; }
+
+    static PassRefPtr<HashChangeEvent> create(const String& oldURL, const String& newURL)
+    {
+        return adoptRef(new HashChangeEvent(oldURL, newURL));
+    }
+
+    void initHashChangeEvent(const AtomicString& eventType, bool canBubble, bool cancelable, const String& oldURL, const String& newURL)
+    {
+        if (dispatched())
+            return;
+
+        initEvent(eventType, canBubble, cancelable);
+
+        m_oldURL = oldURL;
+        m_newURL = newURL;
+    }
+
+    const String& oldURL() const { return m_oldURL; }
+    const String& newURL() const { return m_newURL; }
+
+private:
+    HashChangeEvent(const String& oldURL, const String& newURL)
+        : Event(eventNames().hashchangeEvent, false, false)
+        , m_oldURL(oldURL)
+        , m_newURL(newURL)
+    {}
+
+    String m_oldURL;
+    String m_newURL;
+};
+
+} // namespace WebCore
+
+#endif // HashChangeEvent_h
diff --git a/WebCore/dom/HashChangeEvent.idl b/WebCore/dom/HashChangeEvent.idl
new file mode 100644
index 0000000..63073c4
--- /dev/null
+++ b/WebCore/dom/HashChangeEvent.idl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this library; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+module events {
+
+    // Introduced in http://www.whatwg.org/specs/web-apps/current-work/multipage/history.html#event-hashchange
+    interface [
+        GenerateConstructor
+    ] HashChangeEvent : Event {
+        void initHashChangeEvent(in DOMString type, 
+                                 in boolean canBubble, 
+                                 in boolean cancelable, 
+                                 in DOMString oldURL, 
+                                 in DOMString newURL); 
+        readonly attribute DOMString oldURL;
+        readonly attribute DOMString newURL;
+    };
+
+}
diff --git a/WebCore/page/DOMWindow.idl b/WebCore/page/DOMWindow.idl
index 23508be..72ca36a 100644
--- a/WebCore/page/DOMWindow.idl
+++ b/WebCore/page/DOMWindow.idl
@@ -497,6 +497,7 @@ module window {
 
         attribute EventConstructor Event;
         attribute BeforeLoadEventConstructor BeforeLoadEvent;
+        attribute HashChangeEventConstructor HashChangeEvent;
         attribute KeyboardEventConstructor KeyboardEvent;
         attribute MouseEventConstructor MouseEvent;
         attribute MutationEventConstructor MutationEvent;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list