[librsvg] Rename methods to set styles from a pbag



commit ca897b691385ad5af9c1ebb600c183c3c964f226
Author: Federico Mena Quintero <federico gnome org>
Date:   Fri Sep 14 09:41:19 2018 -0500

    Rename methods to set styles from a pbag

 rsvg_internals/src/load.rs      | 4 ++--
 rsvg_internals/src/node.rs      | 9 ++-------
 rsvg_internals/src/structure.rs | 4 ++--
 3 files changed, 6 insertions(+), 11 deletions(-)
---
diff --git a/rsvg_internals/src/load.rs b/rsvg_internals/src/load.rs
index 235d23cd..c0c9f610 100644
--- a/rsvg_internals/src/load.rs
+++ b/rsvg_internals/src/load.rs
@@ -332,7 +332,7 @@ pub extern "C" fn rsvg_load_set_node_atts(
     // attributes until the end, when sax_end_element_cb() calls
     // rsvg_node_svg_apply_atts()
     if node.get_type() != NodeType::Svg {
-        node.parse_style_attributes(handle, tag, pbag);
+        node.set_style(handle, tag, pbag);
     }
 
     node.set_overridden_properties();
@@ -351,6 +351,6 @@ pub extern "C" fn rsvg_load_set_svg_node_atts(
     }
 
     node.with_impl(|svg: &NodeSvg| {
-        svg.parse_style_attributes(node, handle);
+        svg.set_delayed_style(node, handle);
     });
 }
diff --git a/rsvg_internals/src/node.rs b/rsvg_internals/src/node.rs
index b7b650c7..d0df06ca 100644
--- a/rsvg_internals/src/node.rs
+++ b/rsvg_internals/src/node.rs
@@ -414,14 +414,9 @@ impl Node {
         Ok(())
     }
 
-    // Sets the node's state from the attributes in the pbag.  Also applies
+    // Sets the node's state from the style-related attributes in the pbag.  Also applies
     // CSS rules in our limited way based on the node's tag/class/id.
-    pub fn parse_style_attributes(
-        &self,
-        handle: *const RsvgHandle,
-        tag: &str,
-        pbag: &PropertyBag<'_>,
-    ) {
+    pub fn set_style(&self, handle: *const RsvgHandle, tag: &str, pbag: &PropertyBag<'_>) {
         {
             let mut state = self.state.borrow_mut();
             match state.parse_presentation_attributes(pbag) {
diff --git a/rsvg_internals/src/structure.rs b/rsvg_internals/src/structure.rs
index 2173265f..e2a7c2a5 100644
--- a/rsvg_internals/src/structure.rs
+++ b/rsvg_internals/src/structure.rs
@@ -116,10 +116,10 @@ impl NodeSvg {
         }
     }
 
-    pub fn parse_style_attributes(&self, node: &RsvgNode, handle: *const RsvgHandle) {
+    pub fn set_delayed_style(&self, node: &RsvgNode, handle: *const RsvgHandle) {
         if let Some(owned_pbag) = self.pbag.borrow().as_ref() {
             let pbag = PropertyBag::from_owned(owned_pbag);
-            node.parse_style_attributes(handle, "svg", &pbag);
+            node.set_style(handle, "svg", &pbag);
         }
     }
 }


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