[evolution/wip/webkit2] EHTMLEditorSelection - Get CSSStyleDeclaration from element instead of DOMWindow
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/webkit2] EHTMLEditorSelection - Get CSSStyleDeclaration from element instead of DOMWindow
- Date: Thu, 25 Feb 2016 16:45:16 +0000 (UTC)
commit c266e0e8cfc1e4c8e2aa02a9faf7933e0bdce8e0
Author: Tomas Popela <tpopela redhat com>
Date: Thu Feb 25 17:19:51 2016 +0100
EHTMLEditorSelection - Get CSSStyleDeclaration from element instead of DOMWindow
.../e-html-editor-selection-dom-functions.c | 14 ++------------
1 files changed, 2 insertions(+), 12 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 9767ea2..f387d51 100644
--- a/web-extensions/composer/e-html-editor-selection-dom-functions.c
+++ b/web-extensions/composer/e-html-editor-selection-dom-functions.c
@@ -801,14 +801,8 @@ dom_get_alignment_from_node (WebKitDOMNode *node)
EHTMLEditorSelectionAlignment alignment;
gchar *value;
WebKitDOMCSSStyleDeclaration *style;
- WebKitDOMDocument *document;
- WebKitDOMDOMWindow *dom_window;
-
- document = webkit_dom_node_get_owner_document (node);
- dom_window = webkit_dom_document_get_default_view (document);
- style = webkit_dom_dom_window_get_computed_style (
- dom_window, WEBKIT_DOM_ELEMENT (node), NULL);
+ style = webkit_dom_element_get_style (WEBKIT_DOM_ELEMENT (node));
value = webkit_dom_css_style_declaration_get_property_value (style, "text-align");
if (!value || !*value ||
@@ -822,7 +816,6 @@ dom_get_alignment_from_node (WebKitDOMNode *node)
alignment = E_HTML_EDITOR_SELECTION_ALIGNMENT_LEFT;
}
- g_object_unref (dom_window);
g_object_unref (style);
g_free (value);
@@ -5377,7 +5370,6 @@ dom_selection_get_alignment (WebKitDOMDocument *document,
EHTMLEditorSelectionAlignment alignment;
gchar *value;
WebKitDOMCSSStyleDeclaration *style;
- WebKitDOMDOMWindow *dom_window;
WebKitDOMElement *element;
WebKitDOMNode *node;
WebKitDOMRange *range;
@@ -5396,8 +5388,7 @@ dom_selection_get_alignment (WebKitDOMDocument *document,
else
element = webkit_dom_node_get_parent_element (node);
- dom_window = webkit_dom_document_get_default_view (document);
- style = webkit_dom_dom_window_get_computed_style (dom_window, element, NULL);
+ style = webkit_dom_element_get_style (element);
value = webkit_dom_css_style_declaration_get_property_value (style, "text-align");
if (!value || !*value ||
@@ -5412,7 +5403,6 @@ dom_selection_get_alignment (WebKitDOMDocument *document,
}
g_object_unref (style);
- g_object_unref (dom_window);
g_free (value);
return alignment;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]