[evolution/wip/webkit2] Bug 757348 - Endless loop in webkit_dom_node_append_child(): assertion 'WEBKIT_DOM_IS_NODE(self)' fa



commit 04b8ec4805aca802d196640063ca6b0bc2a8df32
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Mar 2 15:38:58 2016 +0100

    Bug 757348 - Endless loop in webkit_dom_node_append_child(): assertion 'WEBKIT_DOM_IS_NODE(self)' failed

 .../e-html-editor-selection-dom-functions.c        |    4 ++++
 .../composer/e-html-editor-view-dom-functions.c    |   12 ++++++++++++
 2 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/web-extensions/composer/e-html-editor-selection-dom-functions.c 
b/web-extensions/composer/e-html-editor-selection-dom-functions.c
index 0824372..957ec6f 100644
--- a/web-extensions/composer/e-html-editor-selection-dom-functions.c
+++ b/web-extensions/composer/e-html-editor-selection-dom-functions.c
@@ -2792,6 +2792,8 @@ dom_remove_wrapping_from_element (WebKitDOMElement *element)
        WebKitDOMNodeList *list;
        gint ii, length;
 
+       g_return_if_fail (element != NULL);
+
        list = webkit_dom_element_query_selector_all (
                element, "br.-x-evo-wrap-br", NULL);
        length = webkit_dom_node_list_get_length (list);
@@ -2833,6 +2835,8 @@ dom_remove_quoting_from_element (WebKitDOMElement *element)
        gint ii, length;
        WebKitDOMNodeList *list;
 
+       g_return_if_fail (element != NULL);
+
        list = webkit_dom_element_query_selector_all (
                element, "span.-x-evo-quoted", NULL);
        length = webkit_dom_node_list_get_length (list);
diff --git a/web-extensions/composer/e-html-editor-view-dom-functions.c 
b/web-extensions/composer/e-html-editor-view-dom-functions.c
index 437451f..0b83b23 100644
--- a/web-extensions/composer/e-html-editor-view-dom-functions.c
+++ b/web-extensions/composer/e-html-editor-view-dom-functions.c
@@ -2632,6 +2632,16 @@ remove_empty_blocks (WebKitDOMDocument *document)
                g_object_unref (node);
        }
 
+       list = webkit_dom_document_query_selector_all (
+               document, "blockquote[type=cite]:empty", NULL);
+
+       length = webkit_dom_node_list_get_length (list);
+       for  (ii = 0; ii < length; ii++) {
+               WebKitDOMNode *node = webkit_dom_node_list_item (list, ii);
+               remove_node (node);
+               g_object_unref (node);
+       }
+
        g_object_unref (list);
 }
 
@@ -9053,6 +9063,8 @@ key_press_event_process_delete_or_backspace_key (WebKitDOMDocument *document,
                        return FALSE;
                }
 
+               remove_empty_blocks (document);
+
                block = get_parent_block_node_from_child (
                        WEBKIT_DOM_NODE (selection_start_marker));
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]