Skip to content
Permalink
Browse files
Unreviewed. Fix GObject DOM API breaks after r190120.
Source/WebCore:

EntityReference has been removed from the DOM spec. Generate an
empy GObject implementation to keep API and ABI
compatibility. also add a deprecated impementation for the methods
using WebKitEntityReference.

* PlatformGTK.cmake: Do not generate bindings for EntityReference.idl.
* bindings/gobject/WebKitDOMDeprecated.cpp:
(webkit_dom_entity_reference_init):
(webkit_dom_entity_reference_class_init):
(webkit_dom_node_iterator_get_expand_entity_references):
(webkit_dom_tree_walker_get_expand_entity_references):
(webkit_dom_document_create_entity_reference):
* bindings/gobject/WebKitDOMDeprecated.h:
* bindings/gobject/WebKitDOMDeprecated.symbols:
* bindings/scripts/CodeGeneratorGObject.pm:
(SkipFunction): Remove FIXME.
* dom/Document.idl: Do not generate createEntityReference for GObject.
* dom/EntityReference.idl: Do not generate empty files for GObject.

Tools:

Bring back code removed in r169931 to handle documentation of
deleted classes.

* gtk/webkitdom.py:
(WebKitDOMDocGenerator):
(WebKitDOMDocGenerator.write_deleted_classes):
(WebKitDOMDocGenerator.generate):
(write_deleted_classes):
(WebKitDOMDocGeneratorSections._deleted_class):
(WebKitDOMDocGeneratorSections._deleted_class.in):
(WebKitDOMDocGeneratorSections.write_deleted_classes):
(WebKitDOMDocGeneratorSections.write_deleted_classes.with):

Canonical link: https://commits.webkit.org/167622@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@190199 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
carlosgcampos committed Sep 24, 2015
1 parent f7f7616 commit c35d429203ba1b0f83eaaf883efa59621efd4e77
@@ -1,3 +1,26 @@
2015-09-24 Carlos Garcia Campos <cgarcia@igalia.com>

Unreviewed. Fix GObject DOM API breaks after r190120.

EntityReference has been removed from the DOM spec. Generate an
empy GObject implementation to keep API and ABI
compatibility. also add a deprecated impementation for the methods
using WebKitEntityReference.

* PlatformGTK.cmake: Do not generate bindings for EntityReference.idl.
* bindings/gobject/WebKitDOMDeprecated.cpp:
(webkit_dom_entity_reference_init):
(webkit_dom_entity_reference_class_init):
(webkit_dom_node_iterator_get_expand_entity_references):
(webkit_dom_tree_walker_get_expand_entity_references):
(webkit_dom_document_create_entity_reference):
* bindings/gobject/WebKitDOMDeprecated.h:
* bindings/gobject/WebKitDOMDeprecated.symbols:
* bindings/scripts/CodeGeneratorGObject.pm:
(SkipFunction): Remove FIXME.
* dom/Document.idl: Do not generate createEntityReference for GObject.
* dom/EntityReference.idl: Do not generate empty files for GObject.

2015-09-24 Youenn Fablet <youenn.fablet@crf.canon.fr>

[Streams API] Add support for JS builtins constructor
@@ -583,7 +583,6 @@ list(APPEND GObjectDOMBindingsStable_IDL_FILES
dom/DocumentFragment.idl
dom/DocumentType.idl
dom/Element.idl
dom/EntityReference.idl
dom/Event.idl
dom/KeyboardEvent.idl
dom/MouseEvent.idl
@@ -127,3 +127,31 @@ WebKitDOMNodeList* webkit_dom_element_get_elements_by_class_name(WebKitDOMElemen
RefPtr<WebCore::NodeList> nodeList = WTF::getPtr(element->getElementsByClassNameForObjC(String::fromUTF8(className)));
return WebKit::kit(nodeList.get());
}

G_DEFINE_TYPE(WebKitDOMEntityReference, webkit_dom_entity_reference, WEBKIT_DOM_TYPE_NODE)

static void webkit_dom_entity_reference_init(WebKitDOMEntityReference*)
{
}

static void webkit_dom_entity_reference_class_init(WebKitDOMEntityReferenceClass*)
{
}

gboolean webkit_dom_node_iterator_get_expand_entity_references(WebKitDOMNodeIterator*)
{
g_warning("%s: EntityReference has been removed from DOM spec, this function does nothing.", __func__);
return FALSE;
}

gboolean webkit_dom_tree_walker_get_expand_entity_references(WebKitDOMTreeWalker*)
{
g_warning("%s: EntityReference has been removed from DOM spec, this function does nothing.", __func__);
return FALSE;
}

WebKitDOMEntityReference* webkit_dom_document_create_entity_reference(WebKitDOMDocument*, const gchar*, GError**)
{
g_warning("%s: EntityReference has been removed from DOM spec, this function does nothing.", __func__);
return nullptr;
}
@@ -22,6 +22,7 @@
#if !defined(WEBKIT_DISABLE_DEPRECATED)

#include <glib.h>
#include <webkitdom/WebKitDOMNode.h>
#include <webkitdom/webkitdomdefines.h>

G_BEGIN_DECLS
@@ -157,6 +158,64 @@ webkit_dom_element_get_elements_by_tag_name_ns(WebKitDOMElement* self, const gch
WEBKIT_DEPRECATED_FOR(webkit_dom_element_get_elements_by_class_name_as_html_collection) WebKitDOMNodeList*
webkit_dom_element_get_elements_by_class_name(WebKitDOMElement* self, const gchar* class_name);


#define WEBKIT_DOM_TYPE_ENTITY_REFERENCE (webkit_dom_entity_reference_get_type())
#define WEBKIT_DOM_ENTITY_REFERENCE(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), WEBKIT_DOM_TYPE_ENTITY_REFERENCE, WebKitDOMEntityReference))
#define WEBKIT_DOM_ENTITY_REFERENCE_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST((klass), WEBKIT_DOM_TYPE_ENTITY_REFERENCE, WebKitDOMEntityReferenceClass)
#define WEBKIT_DOM_IS_ENTITY_REFERENCE(obj) (G_TYPE_CHECK_INSTANCE_TYPE((obj), WEBKIT_DOM_TYPE_ENTITY_REFERENCE))
#define WEBKIT_DOM_IS_ENTITY_REFERENCE_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE((klass), WEBKIT_DOM_TYPE_ENTITY_REFERENCE))
#define WEBKIT_DOM_ENTITY_REFERENCE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), WEBKIT_DOM_TYPE_ENTITY_REFERENCE, WebKitDOMEntityReferenceClass))

typedef struct _WebKitDOMEntityReference WebKitDOMEntityReference;
typedef struct _WebKitDOMEntityReferenceClass WebKitDOMEntityReferenceClass;

struct _WebKitDOMEntityReference {
WebKitDOMNode parent_instance;
};

struct _WebKitDOMEntityReferenceClass {
WebKitDOMNodeClass parent_class;
};

WEBKIT_DEPRECATED GType webkit_dom_entity_reference_get_type(void);

/**
* webkit_dom_node_iterator_get_expand_entity_references:
* @self: A #WebKitDOMNodeIterator
*
* This function has been removed from the DOM spec and it just returns %FALSE.
*
* Returns: A #gboolean *
* Deprecated: 2.12
*/
WEBKIT_DEPRECATED gboolean webkit_dom_node_iterator_get_expand_entity_references(WebKitDOMNodeIterator* self);

/**
* webkit_dom_tree_walker_get_expand_entity_references:
* @self: A #WebKitDOMTreeWalker
*
* This function has been removed from the DOM spec and it just returns %FALSE.
*
* Returns: A #gboolean
*
* Deprecated: 2.12
*/
WEBKIT_DEPRECATED gboolean webkit_dom_tree_walker_get_expand_entity_references(WebKitDOMTreeWalker* self);

/**
* webkit_dom_document_create_entity_reference:
* @self: A #WebKitDOMDocument
* @name: (allow-none): A #gchar
* @error: #GError
*
* This function has been removed from the DOM spec and it just returns %NULL.
*
* Returns: (transfer none): A #WebKitDOMEntityReference
*
* Deprecated: 2.12
*/
WEBKIT_DEPRECATED WebKitDOMEntityReference* webkit_dom_document_create_entity_reference(WebKitDOMDocument* self, const gchar* name, GError** error);

G_END_DECLS

#endif /* WEBKIT_DISABLE_DEPRECATED */
@@ -9,3 +9,7 @@ WebKitDOMNodeList* webkit_dom_document_get_elements_by_tag_name_ns(WebKitDOMDocu
WebKitDOMNodeList* webkit_dom_element_get_elements_by_tag_name(WebKitDOMElement*, const gchar*)
WebKitDOMNodeList* webkit_dom_element_get_elements_by_tag_name_ns(WebKitDOMElement*, const gchar*, const gchar*)
WebKitDOMNodeList* webkit_dom_element_get_elements_by_class_name(WebKitDOMElement*, const gchar*)
GType webkit_dom_entity_reference_get_type(void)
gboolean webkit_dom_tree_walker_get_expand_entity_references(WebKitDOMTreeWalker*)
WebKitDOMEntityReference* webkit_dom_document_create_entity_reference(WebKitDOMDocument*, const gchar*, GError**)
gboolean webkit_dom_node_iterator_get_expand_entity_references(WebKitDOMNodeIterator*)
@@ -290,12 +290,6 @@ sub SkipFunction {
# Static methods are unsupported
return 1 if $function->isStatic;

# FIXME: This is skipped because I don't know how to fix the build any better way.
# https://bugs.webkit.org/show_bug.cgi?id=149348
if ($functionName eq "webkit_dom_document_create_entity_reference") {
return 1;
}

if (($isCustomFunction || $isUnsupportedCallWith) &&
$functionName ne "webkit_dom_node_replace_child" &&
$functionName ne "webkit_dom_node_insert_before" &&
@@ -40,7 +40,7 @@
[Default=Undefined] optional DOMString data);
[NewObject, RaisesException] Attr createAttribute([Default=Undefined] optional DOMString name);

#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C || defined(LANGUAGE_GOBJECT) && LANGUAGE_GOBJECT
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C
[RaisesException] EntityReference createEntityReference([Default=Undefined] optional DOMString name);
#endif

@@ -17,7 +17,7 @@
* Boston, MA 02110-1301, USA.
*/

#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C || defined(LANGUAGE_GOBJECT) && LANGUAGE_GOBJECT
#if defined(LANGUAGE_OBJECTIVE_C) && LANGUAGE_OBJECTIVE_C

[
NoInterfaceObject,
@@ -1,3 +1,20 @@
2015-09-24 Carlos Garcia Campos <cgarcia@igalia.com>

Unreviewed. Fix GObject DOM API breaks after r190120.

Bring back code removed in r169931 to handle documentation of
deleted classes.

* gtk/webkitdom.py:
(WebKitDOMDocGenerator):
(WebKitDOMDocGenerator.write_deleted_classes):
(WebKitDOMDocGenerator.generate):
(write_deleted_classes):
(WebKitDOMDocGeneratorSections._deleted_class):
(WebKitDOMDocGeneratorSections._deleted_class.in):
(WebKitDOMDocGeneratorSections.write_deleted_classes):
(WebKitDOMDocGeneratorSections.write_deleted_classes.with):

2015-09-23 Myles C. Maxfield <mmaxfield@apple.com>

[Cocoa] [Font Features] Implement font-variant-*
@@ -27,6 +27,8 @@

class WebKitDOMDocGenerator(object):

DELETED_CLASSES = ["WebKitDOMEntityReference"]

def __init__(self, symbol_files, file_handle):
self._symbol_files = symbol_files
self._file_handle = file_handle
@@ -37,6 +39,9 @@ def write_header(self):
def write_section(self, symbol_file):
raise NotImplementedError

def write_deleted_classes(self):
raise NotImplementedError

def write_footer(self):
pass

@@ -53,6 +58,7 @@ def generate(self):
if WebKitDOMDocGenerator.is_deprecated_symbol_file(symbol_file):
continue
self.write_section(symbol_file)
self.write_deleted_classes()
self.write_footer()


@@ -77,6 +83,10 @@ def write_section(self, symbol_file):
basename = os.path.basename(symbol_file)
self.write(' <xi:include href="xml/%s"/>\n' % basename.replace(".symbols", ".xml"))

def write_deleted_classes(self):
for class_name in self.DELETED_CLASSES:
self.write(' <xi:include href="xml/%s.xml"/>\n' % class_name)

def write_footer(self):
self.write(''' </chapter>
@@ -129,6 +139,13 @@ def _dom_class_decamelize(self, class_name):

return retval

def _deleted_class(self, function):
for deleted_class in self.DELETED_CLASSES:
decamelized = 'webkit_dom_%s' % self._dom_class_decamelize(deleted_class).lower()
if function.startswith(decamelized):
return deleted_class
return None

def _find_deprecated_symbols(self, symbol_file):
retval = {}
f = open(symbol_file, 'r')
@@ -199,6 +216,27 @@ def write_section(self, symbol_file):
self.write('webkit_dom_%s_get_type\n' % dom_class.lower())
self.write('</SECTION>\n\n')

def write_deleted_classes(self):
for class_name in self.DELETED_CLASSES:
self.write('<SECTION>\n')
self.write('<FILE>%s</FILE>\n<TITLE>%s</TITLE>\n' % (class_name, class_name))
try:
self.write('\n'.join([name for name in self._deprecated_symbols[class_name] if not name.endswith('get_type')]) + '\n')
except KeyError:
# A deleted class with no public methods doesn't have deprecated symbols.
pass
self.write('\n<SUBSECTION Standard>\n')
dom_class = self._dom_class_decamelize(class_name).upper()
self.write('WEBKIT_DOM_TYPE_%s\n' % dom_class)
self.write('WEBKIT_DOM_%s\n' % dom_class)
self.write('WEBKIT_DOM_IS_%s\n' % dom_class)
self.write('WEBKIT_DOM_%s_CLASS\n' % dom_class)
self.write('WEBKIT_DOM_IS_%s_CLASS\n' % dom_class)
self.write('WEBKIT_DOM_%s_GET_CLASS\n' % dom_class)
self.write('\n<SUBSECTION Private>\n')
self.write('webkit_dom_%s_get_type\n' % self._dom_class_decamelize(class_name).lower())
self.write('</SECTION>\n\n')

def write_footer(self):
self.write('<SECTION>\n')
self.write('<FILE>webkitdomdefines</FILE>\n<TITLE>WebKitDOMDefines</TITLE>\n')

0 comments on commit c35d429

Please sign in to comment.