Title: [167876] trunk/Source/WebCore
- Revision
- 167876
- Author
- [email protected]
- Date
- 2014-04-28 01:06:54 -0700 (Mon, 28 Apr 2014)
Log Message
[GTK] TextTrack kind and mode attributes are enums since r166180
https://bugs.webkit.org/show_bug.cgi?id=132228
Reviewed by Martin Robinson.
We don't support enum values yet in GObject DOM bindings, but they
are internally strings anyway, so we can keep the old
implementations using strings as custom functions until we
properly support enums.
* bindings/gobject/WebKitDOMCustom.cpp:
(webkit_dom_text_track_get_kind):
(webkit_dom_text_track_get_mode):
(webkit_dom_text_track_set_mode):
* bindings/gobject/WebKitDOMCustom.h:
* bindings/gobject/WebKitDOMCustom.symbols:
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (167875 => 167876)
--- trunk/Source/WebCore/ChangeLog 2014-04-28 08:03:00 UTC (rev 167875)
+++ trunk/Source/WebCore/ChangeLog 2014-04-28 08:06:54 UTC (rev 167876)
@@ -1,5 +1,24 @@
2014-04-28 Carlos Garcia Campos <[email protected]>
+ [GTK] TextTrack kind and mode attributes are enums since r166180
+ https://bugs.webkit.org/show_bug.cgi?id=132228
+
+ Reviewed by Martin Robinson.
+
+ We don't support enum values yet in GObject DOM bindings, but they
+ are internally strings anyway, so we can keep the old
+ implementations using strings as custom functions until we
+ properly support enums.
+
+ * bindings/gobject/WebKitDOMCustom.cpp:
+ (webkit_dom_text_track_get_kind):
+ (webkit_dom_text_track_get_mode):
+ (webkit_dom_text_track_set_mode):
+ * bindings/gobject/WebKitDOMCustom.h:
+ * bindings/gobject/WebKitDOMCustom.symbols:
+
+2014-04-28 Carlos Garcia Campos <[email protected]>
+
[GTK] TextTrack::addCue can raise an exception since r163974
https://bugs.webkit.org/show_bug.cgi?id=132227
Modified: trunk/Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp (167875 => 167876)
--- trunk/Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp 2014-04-28 08:03:00 UTC (rev 167875)
+++ trunk/Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp 2014-04-28 08:06:54 UTC (rev 167876)
@@ -28,6 +28,11 @@
#include "WebKitDOMPrivate.h"
#include "gobject/ConvertToUTF8String.h"
+#if ENABLE(VIDEO)
+#include "TextTrack.h"
+#include "WebKitDOMTextTrackPrivate.h"
+#endif
+
using namespace WebKit;
gboolean webkit_dom_html_text_area_element_is_edited(WebKitDOMHTMLTextAreaElement* area)
@@ -56,4 +61,47 @@
#endif /* ENABLE(VIDEO) */
}
+// WebKitDOMTextTrack:kind and WebKitDOMTextTrack:mode were converted into enums in r166180.
+// Since we don't support enums in our bindings yet, keep these implementation here as custom until
+// we add proper support for enums.
+gchar* webkit_dom_text_track_get_kind(WebKitDOMTextTrack* self)
+{
+#if ENABLE(VIDEO_TRACK)
+ WebCore::JSMainThreadNullState state;
+ g_return_val_if_fail(WEBKIT_DOM_IS_TEXT_TRACK(self), 0);
+ WebCore::TextTrack* item = WebKit::core(self);
+ gchar* result = convertToUTF8String(item->kind());
+ return result;
+#else
+ WEBKIT_WARN_FEATURE_NOT_PRESENT("Video Track")
+ return 0;
+#endif /* ENABLE(VIDEO_TRACK) */
+}
+gchar* webkit_dom_text_track_get_mode(WebKitDOMTextTrack* self)
+{
+#if ENABLE(VIDEO_TRACK)
+ WebCore::JSMainThreadNullState state;
+ g_return_val_if_fail(WEBKIT_DOM_IS_TEXT_TRACK(self), 0);
+ WebCore::TextTrack* item = WebKit::core(self);
+ gchar* result = convertToUTF8String(item->mode());
+ return result;
+#else
+ WEBKIT_WARN_FEATURE_NOT_PRESENT("Video Track")
+ return 0;
+#endif /* ENABLE(VIDEO_TRACK) */
+}
+
+void webkit_dom_text_track_set_mode(WebKitDOMTextTrack* self, const gchar* value)
+{
+#if ENABLE(VIDEO_TRACK)
+ WebCore::JSMainThreadNullState state;
+ g_return_if_fail(WEBKIT_DOM_IS_TEXT_TRACK(self));
+ g_return_if_fail(value);
+ WebCore::TextTrack* item = WebKit::core(self);
+ WTF::String convertedValue = WTF::String::fromUTF8(value);
+ item->setMode(convertedValue);
+#else
+ WEBKIT_WARN_FEATURE_NOT_PRESENT("Video Track")
+#endif /* ENABLE(VIDEO_TRACK) */
+}
Modified: trunk/Source/WebCore/bindings/gobject/WebKitDOMCustom.h (167875 => 167876)
--- trunk/Source/WebCore/bindings/gobject/WebKitDOMCustom.h 2014-04-28 08:03:00 UTC (rev 167875)
+++ trunk/Source/WebCore/bindings/gobject/WebKitDOMCustom.h 2014-04-28 08:06:54 UTC (rev 167876)
@@ -50,6 +50,33 @@
*/
WEBKIT_API gboolean webkit_dom_html_input_element_is_edited(WebKitDOMHTMLInputElement* input);
+/**
+ * webkit_dom_text_track_get_kind:
+ * @self: A #WebKitDOMTextTrack
+ *
+ * Returns: A #gchar
+ */
+WEBKIT_API gchar*
+webkit_dom_text_track_get_kind(WebKitDOMTextTrack* self);
+
+/**
+ * webkit_dom_text_track_get_mode:
+ * @self: A #WebKitDOMTextTrack
+ *
+ * Returns: A #gchar
+ */
+WEBKIT_API gchar*
+webkit_dom_text_track_get_mode(WebKitDOMTextTrack* self);
+
+/**
+ * webkit_dom_text_track_set_mode:
+ * @self: A #WebKitDOMTextTrack
+ * @value: A #gchar
+ *
+ */
+WEBKIT_API void
+webkit_dom_text_track_set_mode(WebKitDOMTextTrack* self, const gchar* value);
+
G_END_DECLS
#endif
Modified: trunk/Source/WebCore/bindings/gobject/WebKitDOMCustom.symbols (167875 => 167876)
--- trunk/Source/WebCore/bindings/gobject/WebKitDOMCustom.symbols 2014-04-28 08:03:00 UTC (rev 167875)
+++ trunk/Source/WebCore/bindings/gobject/WebKitDOMCustom.symbols 2014-04-28 08:06:54 UTC (rev 167876)
@@ -1,3 +1,6 @@
gboolean webkit_dom_html_text_area_element_is_edited(WebKitDOMHTMLTextAreaElement*)
gboolean webkit_dom_html_input_element_is_edited(WebKitDOMHTMLInputElement*)
void webkit_dom_html_media_element_set_current_time(WebKitDOMHTMLMediaElement*, gdouble, GError**)
+void webkit_dom_text_track_set_mode(WebKitDOMTextTrack*, const gchar*)
+gchar* webkit_dom_text_track_get_mode(WebKitDOMTextTrack*)
+gchar* webkit_dom_text_track_get_kind(WebKitDOMTextTrack*)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes