Fix GTK build after r209733
authorsvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Dec 2016 10:23:25 +0000 (10:23 +0000)
committersvillar@igalia.com <svillar@igalia.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 13 Dec 2016 10:23:25 +0000 (10:23 +0000)
https://bugs.webkit.org/show_bug.cgi?id=165794

Document::visibilityState() now returns an IDL string enumeration.

Reviewed by Žan Doberšek.

* WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
(webkit_dom_document_get_visibility_state):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@209753 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp

index d750054..b2ea7f9 100644 (file)
@@ -1,3 +1,15 @@
+2016-12-13  Sergio Villar Senin  <svillar@igalia.com>
+
+        Fix GTK build after r209733
+        https://bugs.webkit.org/show_bug.cgi?id=165794
+
+        Document::visibilityState() now returns an IDL string enumeration.
+
+        Reviewed by Žan Doberšek.
+
+        * WebProcess/InjectedBundle/API/gtk/DOM/WebKitDOMDocument.cpp:
+        (webkit_dom_document_get_visibility_state):
+
 2016-12-12  Dean Jackson  <dino@apple.com>
 
         [iOS] MediaDocument "Done" button should navigate the page back
index 34b30c9..2d4c723 100644 (file)
@@ -1917,8 +1917,16 @@ gchar* webkit_dom_document_get_visibility_state(WebKitDOMDocument* self)
     WebCore::JSMainThreadNullState state;
     g_return_val_if_fail(WEBKIT_DOM_IS_DOCUMENT(self), 0);
     WebCore::Document* item = WebKit::core(self);
-    gchar* result = convertToUTF8String(item->visibilityState());
-    return result;
+    switch (item->visibilityState()) {
+    case WebCore::Document::VisibilityState::Hidden:
+        return convertToUTF8String("hidden");
+    case WebCore::Document::VisibilityState::Visible:
+        return convertToUTF8String("visible");
+    case WebCore::Document::VisibilityState::Prerender:
+        return convertToUTF8String("prerender");
+    }
+    ASSERT_NOT_REACHED();
+    return nullptr;
 }
 
 gboolean webkit_dom_document_get_hidden(WebKitDOMDocument* self)