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 695162 - Style element ignored if no type attribute is specified
Style element ignored if no type attribute is specified
Status: RESOLVED OBSOLETE
Product: librsvg
Classification: Core
Component: general
2.36.x
Other Linux
: Normal normal
: ---
Assigned To: librsvg maintainers
librsvg maintainers
: 738118 738627 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2013-03-04 22:47 UTC by Craig Barnes
Modified: 2017-12-13 17:58 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Styles are ignored in librsvg 2.36.4 / eog 3.6.2. Adding type="text/css" to the style element fixes it. (684 bytes, image/svg+xml)
2013-03-04 22:55 UTC, Craig Barnes
  Details
Better follow the W3C spec regarding <style> elements (3.45 KB, patch)
2015-12-05 04:10 UTC, Ricordisamoa
none Details | Review
Better follow the W3C spec regarding <style> elements (6.43 KB, patch)
2015-12-09 08:53 UTC, Ricordisamoa
none Details | Review

Description Craig Barnes 2013-03-04 22:47:59 UTC
I just noticed that if I remove type="text/css" from a style element in an SVG file, eog fails to apply the styles it contains.

This doesn't seem to comply with the SVG spec at http://www.w3.org/TR/SVG/styling.html#StyleElementTypeAttribute:

"If a ‘type’ is not provided, the value of ‘contentStyleType’ on the ‘svg’ element shall be used, which in turn defaults to "text/css" [RFC2046]."
Comment 1 Craig Barnes 2013-03-04 22:55:28 UTC
Created attachment 238058 [details]
Styles are ignored in librsvg 2.36.4 / eog 3.6.2. Adding type="text/css" to the style element fixes it.
Comment 2 itsupport 2013-09-23 06:25:36 UTC
I have also noticed this problem. I had been using <style> with no type specified, and was having to workaround this bug by changing styling to use inline attributes. It's good to know that the lack of type="text/css" was the problem, and I hope this bug gets fixed soon.
Comment 3 mik@gmx.org 2015-10-15 17:27:23 UTC
*** Bug 738627 has been marked as a duplicate of this bug. ***
Comment 4 mik@gmx.org 2015-10-15 17:29:46 UTC
Back reference: https://phabricator.wikimedia.org/T68672
Comment 5 Ricordisamoa 2015-12-05 04:10:54 UTC
Created attachment 316798 [details] [review]
Better follow the W3C spec regarding <style> elements

The SVG 1.1 Recommendation published by the World Wide Web Consortium
at http://www.w3.org/TR/SVG/styling.html#StyleElementTypeAttribute
prescribes:
 If a ‘type’ is not provided, the value of ‘contentStyleType’ on the
 ‘svg’ element shall be used, which in turn defaults to "text/css"

Instead, librsvg completely ignores any <style> element without the
‘type’ attribute explicitly set to "text/css".

This patch adds a content_style_type property to RsvgNodeSvg set to the
value of its ‘contentStyleType’ attribute, or "text/css". The ‘type’
attribute of every <style> will fall back to the content_style_type of
the root <svg>.
Comment 6 Ricordisamoa 2015-12-05 04:28:58 UTC
I don't yet understand whether all <svg>s should support ‘contentStyleType’, or the root one only.
By the way, I have some test images to update the patch with if you tell me where to put them. Thanks in advance.
Comment 7 André Klapper 2015-12-05 13:12:13 UTC
(In reply to Ricordisamoa from comment #6)
> By the way, I have some test images to update the patch with if you tell me
> where to put them. Thanks in advance.

If they are less than 3 MB and free content you could upload them here as an attachment, or just provide links to them?
Comment 8 mik@gmx.org 2015-12-05 14:10:56 UTC
(In reply to André Klapper from comment #7)
> (In reply to Ricordisamoa from comment #6)
> > By the way, I have some test images to update the patch with if you tell me
> > where to put them. Thanks in advance.
> 
> If they are less than 3 MB and free content you could upload them here as an
> attachment, or just provide links to them?

@Ricoridamoa

You may also add them to subfolder ./tests/bugs of your patch. Take existing files as examples.

Execute "make test" to execute a test and check for integration into test schema.
Comment 9 Ricordisamoa 2015-12-09 08:53:18 UTC
Created attachment 317008 [details] [review]
Better follow the W3C spec regarding <style> elements

The SVG 1.1 Recommendation published by the World Wide Web Consortium
at http://www.w3.org/TR/SVG/styling.html#StyleElementTypeAttribute
prescribes:
 If a ‘type’ is not provided, the value of ‘contentStyleType’ on the
 ‘svg’ element shall be used, which in turn defaults to "text/css"

Instead, librsvg completely ignores any <style> element without the
‘type’ attribute explicitly set to "text/css".

This patch adds a content_style_type property to RsvgNodeSvg set to the
value of its ‘contentStyleType’ attribute, or "text/css". The ‘type’
attribute of every <style> will fall back to the content_style_type of
the root <svg>.
Comment 10 Ricordisamoa 2015-12-09 08:55:12 UTC
I don't think I got them in the right location...
Comment 11 Ricordisamoa 2016-01-13 14:26:20 UTC
Please also check for unwanted performance regressions / memory leaks.
Comment 12 André Klapper 2016-03-09 22:45:42 UTC
*** Bug 738118 has been marked as a duplicate of this bug. ***
Comment 13 GNOME Infrastructure Team 2017-12-13 17:58:55 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/librsvg/issues/74.