Title: [153921] trunk/Source/WebCore
- Revision
- 153921
- Author
- [email protected]
- Date
- 2013-08-10 08:45:23 -0700 (Sat, 10 Aug 2013)
Log Message
[GObject] Wrap KeyboardEvent
https://bugs.webkit.org/show_bug.cgi?id=119651
Reviewed by Christophe Dumez.
This exposes KeyboardEvent to our GObject API. It is required for handling
keyboard events, such as keydown, keypress, and so on.
* bindings/gobject/GNUmakefile.am:
* bindings/gobject/WebKitDOMPrivate.cpp:
(WebKit::wrap): make sure we create a WebKitDOMKeyboardEvent for a DOM event that
is a KeyboardEvent.
* bindings/scripts/CodeGeneratorGObject.pm:
(GetBaseClass): make WebKitDOMEvent be WebKitDOMKeyboardEvent's parent, like we do
for WebKitDOMMouseEvent.
* dom/KeyboardEvent.idl: generate a single initialization method.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (153920 => 153921)
--- trunk/Source/WebCore/ChangeLog 2013-08-10 03:29:16 UTC (rev 153920)
+++ trunk/Source/WebCore/ChangeLog 2013-08-10 15:45:23 UTC (rev 153921)
@@ -1,3 +1,22 @@
+2013-08-09 Gustavo Noronha Silva <[email protected]>
+
+ [GObject] Wrap KeyboardEvent
+ https://bugs.webkit.org/show_bug.cgi?id=119651
+
+ Reviewed by Christophe Dumez.
+
+ This exposes KeyboardEvent to our GObject API. It is required for handling
+ keyboard events, such as keydown, keypress, and so on.
+
+ * bindings/gobject/GNUmakefile.am:
+ * bindings/gobject/WebKitDOMPrivate.cpp:
+ (WebKit::wrap): make sure we create a WebKitDOMKeyboardEvent for a DOM event that
+ is a KeyboardEvent.
+ * bindings/scripts/CodeGeneratorGObject.pm:
+ (GetBaseClass): make WebKitDOMEvent be WebKitDOMKeyboardEvent's parent, like we do
+ for WebKitDOMMouseEvent.
+ * dom/KeyboardEvent.idl: generate a single initialization method.
+
2013-08-09 Jer Noble <[email protected]>
Crash in com.apple.WebKit.WebContent at com.apple.MediaToolbox.
Modified: trunk/Source/WebCore/bindings/gobject/GNUmakefile.am (153920 => 153921)
--- trunk/Source/WebCore/bindings/gobject/GNUmakefile.am 2013-08-10 03:29:16 UTC (rev 153920)
+++ trunk/Source/WebCore/bindings/gobject/GNUmakefile.am 2013-08-10 15:45:23 UTC (rev 153921)
@@ -203,6 +203,8 @@
DerivedSources/webkitdom/WebKitDOMHTMLTitleElementPrivate.h \
DerivedSources/webkitdom/WebKitDOMHTMLUListElement.cpp \
DerivedSources/webkitdom/WebKitDOMHTMLUListElementPrivate.h \
+ DerivedSources/webkitdom/WebKitDOMKeyboardEvent.cpp \
+ DerivedSources/webkitdom/WebKitDOMKeyboardEventPrivate.h \
DerivedSources/webkitdom/WebKitDOMLocation.cpp \
DerivedSources/webkitdom/WebKitDOMLocationPrivate.h \
DerivedSources/webkitdom/WebKitDOMMediaError.cpp \
@@ -305,6 +307,7 @@
DerivedSources/webkitdom/WebKitDOMElement.h \
DerivedSources/webkitdom/WebKitDOMEntityReference.h \
DerivedSources/webkitdom/WebKitDOMEvent.h \
+ DerivedSources/webkitdom/WebKitDOMKeyboardEvent.h \
DerivedSources/webkitdom/WebKitDOMMessagePort.h \
DerivedSources/webkitdom/WebKitDOMMouseEvent.h \
DerivedSources/webkitdom/WebKitDOMNamedNodeMap.h \
Modified: trunk/Source/WebCore/bindings/gobject/WebKitDOMPrivate.cpp (153920 => 153921)
--- trunk/Source/WebCore/bindings/gobject/WebKitDOMPrivate.cpp 2013-08-10 03:29:16 UTC (rev 153920)
+++ trunk/Source/WebCore/bindings/gobject/WebKitDOMPrivate.cpp 2013-08-10 15:45:23 UTC (rev 153921)
@@ -33,6 +33,7 @@
#include "File.h"
#include "HTMLElement.h"
#include "HTMLNames.h"
+#include "KeyboardEvent.h"
#include "MouseEvent.h"
#include "StyleSheet.h"
#include "UIEvent.h"
@@ -54,6 +55,7 @@
#include "WebKitDOMHTMLDocumentPrivate.h"
#include "WebKitDOMHTMLOptionsCollectionPrivate.h"
#include "WebKitDOMHTMLPrivate.h"
+#include "WebKitDOMKeyboardEventPrivate.h"
#include "WebKitDOMMouseEventPrivate.h"
#include "WebKitDOMNodePrivate.h"
#include "WebKitDOMProcessingInstructionPrivate.h"
@@ -112,6 +114,9 @@
if (event->isMouseEvent())
return WEBKIT_DOM_EVENT(wrapMouseEvent(static_cast<MouseEvent*>(event)));
+ if (event->isKeyboardEvent())
+ return WEBKIT_DOM_EVENT(wrapKeyboardEvent(static_cast<KeyboardEvent*>(event)));
+
if (event->isUIEvent())
return WEBKIT_DOM_EVENT(wrapUIEvent(static_cast<UIEvent*>(event)));
Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm (153920 => 153921)
--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm 2013-08-10 03:29:16 UTC (rev 153920)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm 2013-08-10 15:45:23 UTC (rev 153921)
@@ -109,9 +109,10 @@
sub GetBaseClass
{
$parent = shift;
+ $interface = shift;
return $parent if $parent eq "Object" or IsBaseType($parent);
- return "Event" if $parent eq "UIEvent" or $parent eq "MouseEvent";
+ return "Event" if $codeGenerator->InheritsInterface($interface, "Event");
return "CSSValue" if $parent eq "SVGColor" or $parent eq "CSSValueList";
return "Node";
}
@@ -1271,7 +1272,7 @@
my $clsCaps = uc($decamelize);
my $lowerCaseIfaceName = "webkit_dom_$decamelize";
my $parentImplClassName = GetParentImplClassName($interface);
- my $baseClassName = GetBaseClass($parentImplClassName);
+ my $baseClassName = GetBaseClass($parentImplClassName, $interface);
# Add a private struct only for direct subclasses of Object so that we can use RefPtr
# for the WebCore wrapped object and make sure we only increment the reference counter once.
@@ -1414,7 +1415,7 @@
my $parentGObjType = GetParentGObjType($interface);
my $interfaceName = $interface->name;
my $parentImplClassName = GetParentImplClassName($interface);
- my $baseClassName = GetBaseClass($parentImplClassName);
+ my $baseClassName = GetBaseClass($parentImplClassName, $interface);
# Add the default impl header template
@cPrefix = split("\r", $licenceTemplate);
Modified: trunk/Source/WebCore/dom/KeyboardEvent.idl (153920 => 153921)
--- trunk/Source/WebCore/dom/KeyboardEvent.idl 2013-08-10 03:29:16 UTC (rev 153920)
+++ trunk/Source/WebCore/dom/KeyboardEvent.idl 2013-08-10 15:45:23 UTC (rev 153921)
@@ -58,7 +58,7 @@
[Default=Undefined] optional boolean altGraphKey);
// WebKit Extensions
-#if !defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT
+#if (!defined(LANGUAGE_JAVASCRIPT) || !LANGUAGE_JAVASCRIPT) && (!defined(LANGUAGE_GOBJECT) || !LANGUAGE_GOBJECT)
readonly attribute long keyCode;
readonly attribute long charCode;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes