After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 514306 - Many Metacity themes contain invalid XML
Many Metacity themes contain invalid XML
Status: RESOLVED OBSOLETE
Product: website
Classification: Infrastructure
Component: art.gnome.org (obsolete)
current
Other Linux
: Normal normal
: ---
Assigned To: art.gnome.org maintainers
art.gnome.org maintainers
Depends on:
Blocks:
 
 
Reported: 2008-02-04 14:38 UTC by Thomas Thurman
Modified: 2015-02-09 23:05 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Chiro patch (1.25 KB, patch)
2010-09-30 00:47 UTC, Julio Lajara
none Details | Review
c2 patch (1.20 KB, patch)
2010-09-30 00:48 UTC, Julio Lajara
none Details | Review
Vista Basic patch (13.63 KB, patch)
2010-09-30 00:49 UTC, Julio Lajara
none Details | Review
Metagrip patch (919 bytes, patch)
2010-09-30 00:50 UTC, Julio Lajara
none Details | Review
VistaBasic w/ patch applied (18.76 KB, application/x-gzip)
2010-09-30 00:50 UTC, Julio Lajara
  Details
MetaGrip w/patch applied (4.65 KB, application/x-gzip)
2010-09-30 00:51 UTC, Julio Lajara
  Details
Chiro w/ patch applied (4.20 KB, application/x-gzip)
2010-09-30 00:51 UTC, Julio Lajara
  Details
C2 w/ patch applied (14.28 KB, application/x-gzip)
2010-09-30 00:51 UTC, Julio Lajara
  Details

Description Thomas Thurman 2008-02-04 14:38:23 UTC
Bear with me while I explain the background a little:

Metacity themes ("metacity-theme-1.xml") are theoretically XML files. In practice Metacity parses them using GMarkup, which isn't a fully-featured XML parser; in particular it allows some things as valid which are not valid XML.

Even among people who understand XML, it is not always well-known that two hyphens appearing in sequence in a comment will cause havoc. (This is because XML comments are in fact SGML processing instructions, which begin with "<!" and end with ">"; within these, there can be comments delimited with "--", so the full result is that "<!--" ... "-->" will allow you to add comments to an XML file.) However, GMarkup, not being a fully-featured XML parser, does not work this way, and believes that comments begin at "<!--" and go on until the next "-->". Arguably, this may be considered a bug in GMarkup, but GMarkup is not supposed to be a complete XML implementation anyway.

So, to the point: there are at least five themes on a.g.o (c2, Chiro, MetaGrip, Vista Basic) which use a double hyphen inside a comment. c2 and Chiro do so merely in order to draw a line across their markup, thus:

<!------------------------------------------------------------------>

The others do so in order to nest comments, which is clearly illegal.

The point of this bug is that it is unhelpful for these files to be invalid XML. It means it is very hard to write tests and editors, as I'm trying to do as a Metacity maintainer. The fixes for each test would be trivial and I'm entirely willing to provide patches. But perhaps, on the other hand, theme authors don't want their themes messed with, and we could say that any theme which Metacity can interpret is a valid theme.
Comment 1 Thomas Thurman 2008-02-04 14:42:49 UTC
FWIW, GMarkup's policy is that invalid XML is invalid GMarkup even if GMarkup can parse it.

http://library.gnome.org/devel/glib/unstable/glib-Simple-XML-Subset-Parser.html#ftn.wellformed
Comment 2 Steve Frécinaux 2008-02-14 07:26:43 UTC
GtkSourceView 2.0 uses libxml and relax-ng validation on runtime to spit out warnings at runtime when using a malformed syntax file.

I'm not sure validating a file each time you use it is the best way to do things, but at least we don't have invalid lang files in gsv2 ;-)
Comment 3 Wouter Bolsterlee (uws) 2008-02-14 11:22:06 UTC
So, which ones need patches? And in which modules do those live?
Comment 4 Thomas Thurman 2008-02-14 12:24:37 UTC
c2 and Chiro contain decorations of the form
<!------------------------------------------------------------------>

MetaGrip and Sloth contain nested comments.

I will provide patches this evening.
Comment 5 Chris Sherlock 2009-02-20 09:57:08 UTC
Surely it would be easy to fix this?
Comment 6 Thomas Wood 2009-02-20 10:26:09 UTC
Chris: are you volunteering?
Comment 7 Chris Sherlock 2009-02-20 10:51:59 UTC
Sure. How hard can it be to remove lines like the following:

<!------------------------------------------------------------------>

How do I start?
Comment 8 Thomas Wood 2009-02-21 20:35:13 UTC
Chris: the easiest thing to do would be if you could download the broken themes, fix them, then upload the fixed themes as attachments to this bug. I can then upload them to art.gnome.org from here.
Comment 9 Thomas Wood 2009-11-27 23:44:58 UTC
Anyone looking into fixing these themes? Seems fairly trivial to fix, so adding gnome-love keyword.
Comment 10 Julio Lajara 2010-09-12 07:55:11 UTC
http://github.com/ju2wheels/metacitythemepatches
Comment 11 Julio Lajara 2010-09-30 00:47:54 UTC
Created attachment 171385 [details] [review]
Chiro patch
Comment 12 Julio Lajara 2010-09-30 00:48:18 UTC
Created attachment 171386 [details] [review]
c2 patch
Comment 13 Julio Lajara 2010-09-30 00:49:19 UTC
Created attachment 171387 [details] [review]
Vista Basic patch
Comment 14 Julio Lajara 2010-09-30 00:50:11 UTC
Created attachment 171388 [details] [review]
Metagrip patch
Comment 15 Julio Lajara 2010-09-30 00:50:37 UTC
Created attachment 171389 [details]
VistaBasic w/ patch applied
Comment 16 Julio Lajara 2010-09-30 00:51:05 UTC
Created attachment 171390 [details]
MetaGrip w/patch applied
Comment 17 Julio Lajara 2010-09-30 00:51:33 UTC
Created attachment 171391 [details]
Chiro w/ patch applied
Comment 18 Julio Lajara 2010-09-30 00:51:55 UTC
Created attachment 171392 [details]
C2 w/ patch applied
Comment 19 André Klapper 2015-02-09 23:05:28 UTC
art.gnome.org is not under development anymore. 
Closing this report as OBSOLETE.