Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(566)

Unified Diff: src/xml/SkXMLWriter.cpp

Issue 940283002: [SVGDevice] Text whitespace unittest (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: more win warnings Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/xml/SkDOM.cpp ('k') | tests/SVGDeviceTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/xml/SkXMLWriter.cpp
diff --git a/src/xml/SkXMLWriter.cpp b/src/xml/SkXMLWriter.cpp
index 62e96687feb8f2213a405289dad5e25e40976682..7a1b04277ef81d4ac14b9c79137445f77af92854 100644
--- a/src/xml/SkXMLWriter.cpp
+++ b/src/xml/SkXMLWriter.cpp
@@ -169,7 +169,14 @@ static void write_dom(const SkDOM& dom, const SkDOM::Node* node, SkXMLWriter* w,
{
if (!skipRoot)
{
- w->startElement(dom.getName(node));
+ const char* elem = dom.getName(node);
+ if (dom.getType(node) == SkDOM::kText_Type) {
+ SkASSERT(dom.countChildren(node) == 0);
+ w->addText(elem, strlen(elem));
+ return;
+ }
+
+ w->startElement(elem);
SkDOM::AttrIter iter(dom, node);
const char* name;
« no previous file with comments | « src/xml/SkDOM.cpp ('k') | tests/SVGDeviceTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698