[evolution/gnome-3-18] EHTMLEditorSelection - Font formats are reported wrongly if the are nested FONT elements



commit c4cef4d971c85cf31c3706113371518377f4c3dd
Author: Tomas Popela <tpopela redhat com>
Date:   Fri Oct 2 13:24:57 2015 +0200

    EHTMLEditorSelection - Font formats are reported wrongly if the are nested FONT elements

 e-util/e-html-editor-selection.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/e-util/e-html-editor-selection.c b/e-util/e-html-editor-selection.c
index 00eb81b..c70f3d7 100644
--- a/e-util/e-html-editor-selection.c
+++ b/e-util/e-html-editor-selection.c
@@ -220,6 +220,12 @@ get_font_property (EHTMLEditorSelection *selection,
        node = webkit_dom_range_get_common_ancestor_container (range, NULL);
        g_object_unref (range);
        element = e_html_editor_dom_node_find_parent_element (node, "FONT");
+       while (element && !WEBKIT_DOM_IS_HTML_BODY_ELEMENT (element) &&
+              !webkit_dom_element_has_attribute (element, font_property)) {
+               element = e_html_editor_dom_node_find_parent_element (
+                       webkit_dom_node_get_parent_node (WEBKIT_DOM_NODE (element)), "FONT");
+       }
+
        if (!element)
                return NULL;
 


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