Changeset 188854 in webkit
- Timestamp:
- Aug 24, 2015 3:19:39 AM (9 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r188853 r188854 1 2015-08-24 Carlos Garcia Campos <cgarcia@igalia.com> 2 3 Unreviewed. Fix GTK+ build after r188809. 4 5 document.getElementsByTagName returns an HTMLCollection since 6 r188809. So, rename it as 7 webkit_dom_document_get_elements_by_tag_name_as_html_collection, 8 and deprecate the old methods returning a NodeList. 9 10 * bindings/gobject/WebKitDOMDeprecated.cpp: 11 (webkit_dom_document_get_elements_by_tag_name): Use the 12 implementation returning a NodeList. 13 (webkit_dom_document_get_elements_by_tag_name_ns): Ditto. 14 * bindings/gobject/WebKitDOMDeprecated.h: 15 * bindings/gobject/WebKitDOMDeprecated.symbols: Add new symbols. 16 * bindings/gobject/webkitdom.symbols: Ditto. 17 * bindings/scripts/CodeGeneratorGObject.pm: 18 (GetEffectiveFunctionName): Bring back this method, now that we 19 have deprecated API again and add the checks for 20 getElementsByTagName methods. 21 (GenerateFunction): Use GetEffectiveFunctionName(). 22 1 23 2015-08-24 Myles C. Maxfield <mmaxfield@apple.com> 2 24 -
trunk/Source/WebCore/bindings/gobject/WebKitDOMDeprecated.cpp
r184623 r188854 20 20 #include "WebKitDOMDeprecated.h" 21 21 22 #include "Document.h" 23 #include "JSMainThreadExecState.h" 24 #include "WebKitDOMDocumentPrivate.h" 22 25 #include "WebKitDOMHTMLElement.h" 26 #include "WebKitDOMNodeListPrivate.h" 27 #include <wtf/GetPtr.h> 28 #include <wtf/RefPtr.h> 29 #include <wtf/text/WTFString.h> 23 30 24 31 gchar* webkit_dom_html_element_get_inner_html(WebKitDOMHTMLElement* self) … … 51 58 return webkit_dom_element_get_children(WEBKIT_DOM_ELEMENT(self)); 52 59 } 60 61 WebKitDOMNodeList* webkit_dom_document_get_elements_by_tag_name(WebKitDOMDocument* self, const gchar* tagName) 62 { 63 g_return_val_if_fail(WEBKIT_DOM_IS_DOCUMENT(self), nullptr); 64 g_return_val_if_fail(tagName, nullptr); 65 66 WebCore::JSMainThreadNullState state; 67 WebCore::Document* document = WebKit::core(self); 68 RefPtr<WebCore::NodeList> nodeList = WTF::getPtr(document->getElementsByTagNameForObjC(String::fromUTF8(tagName))); 69 return WebKit::kit(nodeList.get()); 70 } 71 72 WebKitDOMNodeList* webkit_dom_document_get_elements_by_tag_name_ns(WebKitDOMDocument* self, const gchar* namespaceURI, const gchar* tagName) 73 { 74 g_return_val_if_fail(WEBKIT_DOM_IS_DOCUMENT(self), nullptr); 75 g_return_val_if_fail(namespaceURI, nullptr); 76 g_return_val_if_fail(tagName, nullptr); 77 78 WebCore::JSMainThreadNullState state; 79 WebCore::Document* document = WebKit::core(self); 80 RefPtr<WebCore::NodeList> nodeList = WTF::getPtr(document->getElementsByTagNameNSForObjC(String::fromUTF8(namespaceURI), String::fromUTF8(tagName))); 81 return WebKit::kit(nodeList.get()); 82 } -
trunk/Source/WebCore/bindings/gobject/WebKitDOMDeprecated.h
r184623 r188854 82 82 webkit_dom_html_element_get_children(WebKitDOMHTMLElement* self); 83 83 84 /** 85 * webkit_dom_document_get_elements_by_tag_name: 86 * @self: A #WebKitDOMDocument 87 * @tag_name: a #gchar with the tag name 88 * 89 * Returns: (transfer full): a #WebKitDOMNodeList 90 * 91 * Deprecated: 2.12: Use webkit_dom_document_get_elements_by_tag_name_as_html_collection() instead. 92 */ 93 WEBKIT_DEPRECATED_FOR(webkit_dom_document_get_elements_by_tag_name_as_html_collection) WebKitDOMNodeList* 94 webkit_dom_document_get_elements_by_tag_name(WebKitDOMDocument* self, const gchar* tag_name); 95 96 /** 97 * webkit_dom_document_get_elements_by_tag_name_ns: 98 * @self: A #WebKitDOMDocument 99 * @namespace_uri: a #gchar with the namespace URI 100 * @tag_name: a #gchar with the tag name 101 * 102 * Returns: (transfer full): a #WebKitDOMNodeList 103 * 104 * Deprecated: 2.12: Use webkit_dom_document_get_elements_by_tag_name_ns_as_html_collection() instead. 105 */ 106 WEBKIT_DEPRECATED_FOR(webkit_dom_document_get_elements_by_tag_name_as_html_collection) WebKitDOMNodeList* 107 webkit_dom_document_get_elements_by_tag_name_ns(WebKitDOMDocument* self, const gchar* namespace_uri, const gchar* tag_name); 108 84 109 G_END_DECLS 85 110 -
trunk/Source/WebCore/bindings/gobject/WebKitDOMDeprecated.symbols
r184623 r188854 4 4 void webkit_dom_html_element_set_outer_html(WebKitDOMHTMLElement*, const gchar*, GError**) 5 5 WebKitDOMHTMLCollection* webkit_dom_html_element_get_children(WebKitDOMHTMLElement*) 6 WebKitDOMNodeList* webkit_dom_document_get_elements_by_tag_name(WebKitDOMDocument*, const gchar*) 7 WebKitDOMNodeList* webkit_dom_document_get_elements_by_tag_name_ns(WebKitDOMDocument*, const gchar*, const gchar*) -
trunk/Source/WebCore/bindings/gobject/webkitdom.symbols
r184623 r188854 86 86 WebKitDOMNodeList* webkit_dom_document_get_elements_by_name(WebKitDOMDocument*, const gchar*) 87 87 WebKitDOMNodeList* webkit_dom_document_get_elements_by_tag_name(WebKitDOMDocument*, const gchar*) 88 WebKitDOMHTMLCollection* webkit_dom_document_get_elements_by_tag_name_as_html_collection(WebKitDOMDocument*, const gchar*)@2.12 88 89 WebKitDOMNodeList* webkit_dom_document_get_elements_by_tag_name_ns(WebKitDOMDocument*, const gchar*, const gchar*) 90 WebKitDOMHTMLCollection* webkit_dom_document_get_elements_by_tag_name_ns_as_html_collection(WebKitDOMDocument*, const gchar*, const gchar*)@2.12 89 91 WebKitDOMNodeList* webkit_dom_document_get_elements_by_class_name(WebKitDOMDocument*, const gchar*) 90 92 WebKitDOMElement* webkit_dom_document_element_from_point(WebKitDOMDocument*, glong, glong) -
trunk/Source/WebCore/bindings/scripts/CodeGeneratorGObject.pm
r188119 r188854 994 994 } 995 995 996 sub GetEffectiveFunctionName { 997 my $functionName = shift; 998 999 # Rename webkit_dom_document_get_elements_by_tag_name* functions since they were changed to return a 1000 # WebKitDOMHTMLCollection instead of a WebKitDOMNodeList in r188809. The old methods are now manually 1001 # added as deprecated. 1002 if ($functionName eq "webkit_dom_document_get_elements_by_tag_name" || $functionName eq "webkit_dom_document_get_elements_by_tag_name_ns") { 1003 return $functionName . "_as_html_collection"; 1004 } 1005 1006 return $functionName; 1007 } 1008 996 1009 sub GenerateFunction { 997 1010 my ($object, $interfaceName, $function, $prefix, $parentNode) = @_; … … 1005 1018 my $functionSigType = $prefix eq "set_" ? "void" : $function->signature->type; 1006 1019 my $functionSigName = GetFunctionSignatureName($interfaceName, $function); 1007 my $functionName = "webkit_dom_" . $decamelize . "_" . $prefix . $functionSigName;1020 my $functionName = GetEffectiveFunctionName("webkit_dom_" . $decamelize . "_" . $prefix . $functionSigName); 1008 1021 my $returnType = GetGlibTypeName($functionSigType); 1009 1022 my $returnValueIsGDOMType = IsGDOMClassType($functionSigType);
Note: See TracChangeset
for help on using the changeset viewer.