[librsvg: 19/48] Some documentation for XmlState
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 19/48] Some documentation for XmlState
- Date: Sat, 17 Nov 2018 10:21:37 +0000 (UTC)
commit ad725cc1acb43c05984a93d5adb769120b04a40c
Author: Federico Mena Quintero <federico gnome org>
Date: Fri Sep 7 15:05:57 2018 -0500
Some documentation for XmlState
rsvg_internals/src/xml.rs | 12 ++++++++++++
1 file changed, 12 insertions(+)
---
diff --git a/rsvg_internals/src/xml.rs b/rsvg_internals/src/xml.rs
index fa49f5a0..5e005fad 100644
--- a/rsvg_internals/src/xml.rs
+++ b/rsvg_internals/src/xml.rs
@@ -132,6 +132,18 @@ struct Context {
// A *const RsvgXmlState is just the type that we export to C
pub enum RsvgXmlState {}
+/// Holds the state used for XML processing
+///
+/// These methods are called when an XML event is parsed out of the XML stream: `start_element`,
+/// `end_element`, `characters`.
+///
+/// When an element starts, we push a corresponding `Context` into the `context_stack`. Within
+/// that context, all XML events will be forwarded to it, and processed in one of the `XmlHandler`
+/// trait objects. Normally the context refers to a `NodeCreationContext` implementation which is
+/// what creates normal graphical elements.
+///
+/// When we get to a `<style>` element, we push a `StyleContext`, which processes its contents
+/// specially.
struct XmlState {
tree: Option<Box<Tree>>,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]