[GTK] Implement sizes attribute for link tag
authorcarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Dec 2014 10:31:28 +0000 (10:31 +0000)
committercarlosgc@webkit.org <carlosgc@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 11 Dec 2014 10:31:28 +0000 (10:31 +0000)
https://bugs.webkit.org/show_bug.cgi?id=125775

Reviewed by Martin Robinson.

* bindings/gobject/WebKitDOMCustom.cpp:
(webkit_dom_html_link_element_set_sizes): Add custom setter implementation.
* bindings/gobject/WebKitDOMCustomUnstable.h:
* bindings/js/JSHTMLLinkElementCustom.cpp:
(WebCore::JSHTMLLinkElement::sizes): Remove custom getter implementation.
* bindings/scripts/CodeGeneratorGObject.pm:
(HasUnstableCustomAPI): Mark WebKitDOMHTMLLinkElement as having custom unstable API.
* html/HTMLLinkElement.idl: Mark sizes attribute as CustomSetter
instead of Custom, since the getter can be autogenerated, and make
it available to the GObject DOM bindings too.

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

Source/WebCore/ChangeLog
Source/WebCore/bindings/gobject/WebKitDOMCustom.cpp
Source/WebCore/bindings/gobject/WebKitDOMCustomUnstable.h
Source/WebCore/bindings/js/JSHTMLLinkElementCustom.cpp
Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
Source/WebCore/html/HTMLLinkElement.idl

index a6fb653..7269888 100644 (file)
@@ -1,3 +1,21 @@
+2014-12-11  Carlos Garcia Campos  <cgarcia@igalia.com>
+
+        [GTK] Implement sizes attribute for link tag
+        https://bugs.webkit.org/show_bug.cgi?id=125775
+
+        Reviewed by Martin Robinson.
+
+        * bindings/gobject/WebKitDOMCustom.cpp:
+        (webkit_dom_html_link_element_set_sizes): Add custom setter implementation.
+        * bindings/gobject/WebKitDOMCustomUnstable.h:
+        * bindings/js/JSHTMLLinkElementCustom.cpp:
+        (WebCore::JSHTMLLinkElement::sizes): Remove custom getter implementation.
+        * bindings/scripts/CodeGeneratorGObject.pm:
+        (HasUnstableCustomAPI): Mark WebKitDOMHTMLLinkElement as having custom unstable API.
+        * html/HTMLLinkElement.idl: Mark sizes attribute as CustomSetter
+        instead of Custom, since the getter can be autogenerated, and make
+        it available to the GObject DOM bindings too.
+
 2014-12-10  Chris Dumez  <cdumez@apple.com>
 
         http://omfgdogs.info/ only animates when you resize the window
index cfdb132..7cfc2df 100644 (file)
 
 #include "JSMainThreadExecState.h"
 #include "SerializedScriptValue.h"
+#include "WebKitDOMDOMSettableTokenListPrivate.h"
 #include "WebKitDOMDOMWindowPrivate.h"
 #include "WebKitDOMHTMLInputElement.h"
 #include "WebKitDOMHTMLInputElementPrivate.h"
+#include "WebKitDOMHTMLLinkElementPrivate.h"
 #include "WebKitDOMHTMLTextAreaElement.h"
 #include "WebKitDOMHTMLTextAreaElementPrivate.h"
 #include "WebKitDOMPrivate.h"
@@ -87,3 +89,11 @@ gboolean webkit_dom_dom_window_webkit_message_handlers_post_message(WebKitDOMDOM
     handler->postMessage(WebCore::SerializedScriptValue::create(String::fromUTF8(message)));
     return TRUE;
 }
+
+void webkit_dom_html_link_element_set_sizes(WebKitDOMHTMLLinkElement* linkElement, const gchar* value)
+{
+    g_return_if_fail(WEBKIT_DOM_IS_HTML_LINK_ELEMENT(linkElement));
+    g_return_if_fail(value);
+
+    core(linkElement)->setSizes(String::fromUTF8(value));
+}
index 79d0f56..ce1695d 100644 (file)
@@ -50,6 +50,17 @@ webkit_dom_dom_window_get_webkit_namespace(WebKitDOMDOMWindow* self);
 WEBKIT_API WebKitDOMUserMessageHandler *
 webkit_dom_user_message_handlers_namespace_get_handler(WebKitDOMUserMessageHandlersNamespace* self, const gchar* name);
 
+/**
+ * webkit_dom_html_link_element_set_sizes:
+ * @self: A #WebKitDOMHTMLLinkElement
+ * @value: a #gchar
+ *
+ * Stability: Unstable
+ * Since: 2.8
+ */
+WEBKIT_API void
+webkit_dom_html_link_element_set_sizes(WebKitDOMHTMLLinkElement* self, const gchar* value);
+
 G_END_DECLS
 
 #endif /* WEBKIT_DOM_USE_UNSTABLE_API */
index d3a4b54..0467a82 100644 (file)
@@ -36,11 +36,6 @@ using namespace JSC;
 
 namespace WebCore {
 
-JSValue JSHTMLLinkElement::sizes(ExecState* exec) const
-{
-    return toJS(exec, globalObject(), impl().sizes());
-}
-
 void JSHTMLLinkElement::setSizes(ExecState* exec, JSValue value)
 {
     impl().setSizes(valueToStringWithNullCheck(exec, value));
index 5559685..f88741c 100644 (file)
@@ -1595,7 +1595,7 @@ sub Generate {
 sub HasUnstableCustomAPI {
     my $domClassName = shift;
 
-    return scalar(grep {$_ eq $domClassName} qw(WebKitDOMDOMWindow WebKitDOMUserMessageHandlersNamespace));
+    return scalar(grep {$_ eq $domClassName} qw(WebKitDOMDOMWindow WebKitDOMUserMessageHandlersNamespace WebKitDOMHTMLLinkElement));
 }
 
 sub WriteData {
index 95a641c..33e76cc 100644 (file)
@@ -27,8 +27,8 @@ interface HTMLLinkElement : HTMLElement {
     [Reflect] attribute DOMString media;
     [Reflect] attribute DOMString rel;
     [Reflect] attribute DOMString rev;
-#if defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT
-    [Custom] attribute DOMSettableTokenList sizes;
+#if (defined(LANGUAGE_JAVASCRIPT) && LANGUAGE_JAVASCRIPT) || (defined(LANGUAGE_GOBJECT) || LANGUAGE_GOBJECT)
+    [CustomSetter] attribute DOMSettableTokenList sizes;
 #endif
     [Reflect] attribute DOMString target;
     [Reflect] attribute DOMString type;