[librsvg: 44/48] Make xi:fallback work for the <xi:include parse="text"> case
- From: Federico Mena Quintero <federico src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [librsvg: 44/48] Make xi:fallback work for the <xi:include parse="text"> case
- Date: Sat, 17 Nov 2018 10:23:43 +0000 (UTC)
commit 37ba693f2d0d7d70cdb324169ca2efdf20383528
Author: Federico Mena Quintero <federico gnome org>
Date: Sat Nov 17 02:55:50 2018 -0600
Make xi:fallback work for the <xi:include parse="text"> case
rsvg_internals/src/xml.rs | 8 +++++---
tests/fixtures/loading/include-fallback.svg | 10 ++++++++++
2 files changed, 15 insertions(+), 3 deletions(-)
---
diff --git a/rsvg_internals/src/xml.rs b/rsvg_internals/src/xml.rs
index ace253b7..992e13e4 100644
--- a/rsvg_internals/src/xml.rs
+++ b/rsvg_internals/src/xml.rs
@@ -276,7 +276,8 @@ impl XmlState {
}
fn inside_xinclude_start_element(&self, ctx: &XIncludeContext, name: &str) -> Context {
- if name == "xi:fallback" {
+ // FIXME: we aren't using the xi: namespace
+ if name == "fallback" {
Context {
element_name: name.to_string(),
kind: ContextKind::XIncludeFallback(ctx.clone()),
@@ -294,7 +295,8 @@ impl XmlState {
pbag: &PropertyBag,
) -> Context {
if ctx.need_fallback {
- if name == "xi:include" {
+ // FIXME: we aren't using the xi: namespace
+ if name == "include" {
self.xinclude_start_element(handle, name, pbag)
} else {
self.element_creation_start_element(handle, name, pbag)
@@ -309,7 +311,7 @@ impl XmlState {
fn xinclude_fallback_characters(&mut self, ctx: &XIncludeContext, text: &str) {
if ctx.need_fallback {
- self.characters(text);
+ self.element_creation_characters(text);
}
}
diff --git a/tests/fixtures/loading/include-fallback.svg b/tests/fixtures/loading/include-fallback.svg
new file mode 100644
index 00000000..a471d83d
--- /dev/null
+++ b/tests/fixtures/loading/include-fallback.svg
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ width="320" height="240">
+ <text x="10" y="100">
+ <xi:include href="nonexistent.txt" parse="text" encoding="UTF-8">
+ <xi:fallback>Hello fallback!</xi:fallback>
+ </xi:include>
+ </text>
+</svg>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]