- From: Juergen Roethig <roethig@dhbw-karlsruhe.de>
- Date: Wed, 12 Nov 2014 13:55:26 +0100
- To: "www-svg@w3.org" <www-svg@w3.org>
Tab Atkins Jr. wrote:
> On Sat, Nov 8, 2014 at 12:12 AM, Juergen Roethig
> <roethig@dhbw-karlsruhe.de> wrote:
>> As I just remembered, I would like to add that this is another perfect
>> example for the sillyness of the precedence of CSS properties over
>> presentation attribute values. If you now carefully realize all the
>> negations at the inputs and outputs of the gates via markers at the start or
>> end of the respective connectors (lines, polylines, paths, whatever) given
>> by presentation attributes "marker-start" and/or "marker-end", one simple
>> CSS rule
>> * { marker-start: none; marker-end: none }
>> (even when given in the user style sheet (!) of someones browser) will
>> override all those nice negations given in the SVG source code ... you might
>> try it by yourself! But this is another topic, the battle "breakage of
>> useful content by bad design" vs. "breakage of silly content by removing
>> silly rules" - so far, the latter seems to be a more important issue which
>> needs to be avoided in any case.
>
> No, if that rule shows up in the user stylesheet, the attribute wins;
> presentational attributes are placed in the "author" origin, which
> auto-wins against "user".
Well, we might read what is given in the specification of CSS 2.1:
http://www.w3.org/TR/2011/REC-CSS2-20110607/cascade.html#preshint
"For other languages [i.e. non HTML], all document language-based
styling [i.e. values given by presentation attributes] must be
translated to the corresponding CSS and either enter the cascade at the
user agent level or, as with HTML presentational hints, be treated as
author level rules with a specificity of zero placed at the start of the
author style sheet."
So, SVG is an "other language", and thus, the values of the presentation
attributes should be placed in the "user agent level" which auto-loses
against "user level".
But, re-reading all the texts, SVG 1.1 indeed gives another statement:
http://www.w3.org/TR/2011/REC-SVG11-20110816/styling.html#UsingPresentationAttributes
"For user agents that support CSS, the presentation attributes must be
translated to corresponding CSS style rules according to rules described
in Precedence of non-CSS presentational hints ([CSS2], section 6.4.4),
with the additional clarification that the presentation attributes are
conceptually inserted into a new author style sheet which is the first
in the author style sheet collection."
But if we compare with CSS3 (which is not at all relevant for SVG 1.1,
since SVG 1.1 explicitly mentions CSS2):
http://www.w3.org/TR/css-cascade-3/#preshint
"All document language-based styling must be translated to corresponding
CSS rules and either enter the cascade at the user agent level or be
treated as author level rules with a specificity of zero placed at the
start of the author style sheet. A document language may define whether
a presentational hint enters at the UA or author level of the cascade;
if so, the UA must behave accordingly. For example, [SVG11] maps its
presentation attributes into the author level."
This time, we have a "clear" statement saying that the document language
might specify this or that ;-)
So, we have different statements which might be applicable but
contradict themselves - which one is (more) relevant? Let's see what the
browsers do ... I tried it with one browser who very easily allows
specifying user stylesheets, i.e. Opera. And in two very different
instances (one rather old "12.02" dated 2012 running on Debian Linux as
well as the actual Opera running on windows), both let the user style
sheet override the values of presentation attributes. Thus, Opera agrees
with CSS2.1, and disagrees with both SVG1.1 and CSS3. If someone else
wants to try another browser and give the results - volunteers welcome!
Independent from that, my opinion on the precedence of presentation
attributes is that they should have the same priority as values given by
style attributes - the way of usage is similar for both, as presentation
attributes are given for specific tags like the style attribute, so all
those values should override general rules given in an author style sheet.
> SVG attributes being classes as "presentational attributes" is just
> for consistency with HTML, though the two serve different purposes -
> the placement of HTML presentational attributes in the cascade is
> purposeful, as they're a legacy feature that shouldn't be used, which
> isn't true of SVG's presentational attributes, but consistency was
> deemed more important than coming up with something slightly more
> sensible; you can always use the style attribute to specify styles at
> a higher point in the cascade than author rules.
And the proclaimed "consistency" is falsified by the given statement
from the CSS 2.1 spec, since HTML is mentioned as an _exception_ to all
the other languages, placing presentational hints at author level
instead of user agent level. That's a perfect inconsistency ... as well
as the inconsistency of the various specs on that topic.
Btw, someone named "Tab Atkins Jr. (Google, Inc.)" is listed in that
CSS2.1 specification from above as a "Working Group member[s] active
during the development of this specification". I am so glad that even
those "experts" who are responsible for the deliverables do not know the
content of their own specs ;-)
Juergen Roethig
Received on Wednesday, 12 November 2014 12:56:26 UTC