[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

darin at chromium.org darin at chromium.org
Thu Apr 8 01:02:41 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit 8ad1ac0ebdcd823cf58ae8f24cb6808e3d0e9e9c
Author: darin at chromium.org <darin at chromium.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Jan 12 21:28:07 2010 +0000

    2010-01-12  Darin Fisher  <darin at chromium.org>
    
            Reviewed by Dimitri Glazkov.
    
            Add V8 bindings for PopStateEvent.
            https://bugs.webkit.org/show_bug.cgi?id=33546
    
            This is covered by existing tests for PopStateEvent.
    
            * WebCore.gypi:
            * bindings/v8/DOMObjectsInclude.h:
            * bindings/v8/DerivedSourcesAllInOne.cpp:
            * bindings/v8/V8DOMWrapper.cpp:
            (WebCore::V8DOMWrapper::convertEventToV8Object):
            * bindings/v8/V8Index.cpp:
            * bindings/v8/V8Index.h:
            * bindings/v8/custom/V8PopStateEventCustom.cpp: Added.
            (WebCore::V8PopStateEvent::initPopStateEventCallback):
            (WebCore::V8PopStateEvent::stateAccessorGetter):
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@53161 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 04de9f0..ba3bc5f 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,23 @@
+2010-01-12  Darin Fisher  <darin at chromium.org>
+
+        Reviewed by Dimitri Glazkov.
+
+        Add V8 bindings for PopStateEvent.
+        https://bugs.webkit.org/show_bug.cgi?id=33546
+        
+        This is covered by existing tests for PopStateEvent.
+
+        * WebCore.gypi:
+        * bindings/v8/DOMObjectsInclude.h:
+        * bindings/v8/DerivedSourcesAllInOne.cpp:
+        * bindings/v8/V8DOMWrapper.cpp:
+        (WebCore::V8DOMWrapper::convertEventToV8Object):
+        * bindings/v8/V8Index.cpp:
+        * bindings/v8/V8Index.h:
+        * bindings/v8/custom/V8PopStateEventCustom.cpp: Added.
+        (WebCore::V8PopStateEvent::initPopStateEventCallback):
+        (WebCore::V8PopStateEvent::stateAccessorGetter):
+
 2010-01-12  Kelly Norton  <knorton at google.com>
 
         Reviewed by Timothy Hatcher.
diff --git a/WebCore/WebCore.gypi b/WebCore/WebCore.gypi
index 0cab6be..912a7e9 100644
--- a/WebCore/WebCore.gypi
+++ b/WebCore/WebCore.gypi
@@ -724,6 +724,7 @@
             'bindings/v8/custom/V8NodeIteratorCustom.cpp',
             'bindings/v8/custom/V8NodeListCustom.cpp',
             'bindings/v8/custom/V8NotificationCenterCustom.cpp',
+            'bindings/v8/custom/V8PopStateEventCustom.cpp',
             'bindings/v8/custom/V8StorageCustom.cpp',
             'bindings/v8/custom/V8SQLResultSetRowListCustom.cpp',
             'bindings/v8/custom/V8SQLTransactionCustom.cpp',
diff --git a/WebCore/bindings/v8/DOMObjectsInclude.h b/WebCore/bindings/v8/DOMObjectsInclude.h
index 9941aeb..8a8a1b1 100644
--- a/WebCore/bindings/v8/DOMObjectsInclude.h
+++ b/WebCore/bindings/v8/DOMObjectsInclude.h
@@ -128,6 +128,7 @@
 #include "PageTransitionEvent.h"
 #include "Plugin.h"
 #include "PluginArray.h"
+#include "PopStateEvent.h"
 #include "ProcessingInstruction.h"
 #include "ProgressEvent.h"
 #include "Range.h"
diff --git a/WebCore/bindings/v8/DerivedSourcesAllInOne.cpp b/WebCore/bindings/v8/DerivedSourcesAllInOne.cpp
index bd2bb7b..007e0bb 100644
--- a/WebCore/bindings/v8/DerivedSourcesAllInOne.cpp
+++ b/WebCore/bindings/v8/DerivedSourcesAllInOne.cpp
@@ -202,6 +202,7 @@
 #include "bindings/V8PageTransitionEvent.cpp"
 #include "bindings/V8Plugin.cpp"
 #include "bindings/V8PluginArray.cpp"
+#include "bindings/V8PopStateEvent.cpp"
 #include "bindings/V8PositionError.cpp"
 #include "bindings/V8ProcessingInstruction.cpp"
 #include "bindings/V8ProgressEvent.cpp"
diff --git a/WebCore/bindings/v8/V8DOMWrapper.cpp b/WebCore/bindings/v8/V8DOMWrapper.cpp
index c404f61..a5de061 100644
--- a/WebCore/bindings/v8/V8DOMWrapper.cpp
+++ b/WebCore/bindings/v8/V8DOMWrapper.cpp
@@ -1177,6 +1177,8 @@ v8::Handle<v8::Value> V8DOMWrapper::convertEventToV8Object(Event* event)
         type = V8ClassIndex::MESSAGEEVENT;
     else if (event->isPageTransitionEvent())
         type = V8ClassIndex::PAGETRANSITIONEVENT;
+    else if (event->isPopStateEvent())
+        type = V8ClassIndex::POPSTATEEVENT;
     else if (event->isProgressEvent()) {
         if (event->isXMLHttpRequestProgressEvent())
             type = V8ClassIndex::XMLHTTPREQUESTPROGRESSEVENT;
diff --git a/WebCore/bindings/v8/V8Index.cpp b/WebCore/bindings/v8/V8Index.cpp
index 5716ebd..3089f8e 100644
--- a/WebCore/bindings/v8/V8Index.cpp
+++ b/WebCore/bindings/v8/V8Index.cpp
@@ -154,6 +154,7 @@
 #include "V8NodeList.h"
 #include "V8NodeFilter.h"
 #include "V8Notation.h"
+#include "V8PopStateEvent.h"
 #include "V8ProcessingInstruction.h"
 #include "V8ProgressEvent.h"
 #include "V8StyleSheet.h"
diff --git a/WebCore/bindings/v8/V8Index.h b/WebCore/bindings/v8/V8Index.h
index 2d00fe3..2c6948b 100644
--- a/WebCore/bindings/v8/V8Index.h
+++ b/WebCore/bindings/v8/V8Index.h
@@ -388,6 +388,7 @@ typedef v8::Persistent<v8::FunctionTemplate> (*FunctionTemplateFactory)();
     V(PAGETRANSITIONEVENT, PageTransitionEvent)                         \
     V(PLUGIN, Plugin)                                                   \
     V(PLUGINARRAY, PluginArray)                                         \
+    V(POPSTATEEVENT, PopStateEvent)                                     \
     V(PROGRESSEVENT, ProgressEvent)                                     \
     V(RANGE, Range)                                                     \
     V(RANGEEXCEPTION, RangeException)                                   \
diff --git a/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp b/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp
new file mode 100644
index 0000000..14fa5a0
--- /dev/null
+++ b/WebCore/bindings/v8/custom/V8PopStateEventCustom.cpp
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2010 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "V8PopStateEvent.h"
+
+#include "PopStateEvent.h"
+#include "SerializedScriptValue.h"
+
+namespace WebCore {
+
+v8::Handle<v8::Value> V8PopStateEvent::initPopStateEventCallback(const v8::Arguments& args)
+{
+    INC_STATS("DOM.PopStateEvent.initPopStateEvent");
+
+    String typeArg = v8ValueToWebCoreString(args[0]);
+    bool canBubbleArg = args[1]->BooleanValue();
+    bool cancelableArg = args[2]->BooleanValue();
+    RefPtr<SerializedScriptValue> stateArg = SerializedScriptValue::create(v8ValueToWebCoreString(args[3]));
+
+    PopStateEvent* event = V8DOMWrapper::convertToNativeObject<PopStateEvent>(V8ClassIndex::POPSTATEEVENT, args.Holder());
+    event->initPopStateEvent(typeArg, canBubbleArg, cancelableArg, stateArg.release());
+
+    return v8::Undefined();
+}
+
+v8::Handle<v8::Value> V8PopStateEvent::stateAccessorGetter(v8::Local<v8::String> name, const v8::AccessorInfo& info)
+{
+    INC_STATS("DOM.PopStateEvent.state");
+
+    PopStateEvent* event = V8DOMWrapper::convertToNativeObject<PopStateEvent>(V8ClassIndex::POPSTATEEVENT, info.Holder());
+    SerializedScriptValue* state = event->state();
+    if (!state)
+        return v8::Null();
+
+    return v8StringOrNull(state->toString());
+}
+
+} // namespace WebCore

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list