W3C home > Mailing lists > Public > www-style@w3.org > April 2010

A review on CSS3 module dependencies

From: Eduard Pascual <herenvardo@gmail.com>
Date: Sun, 11 Apr 2010 23:56:27 +0200
Message-ID: <z2v6ea53251004111456he279f09eo1cd938ee4fbd189@mail.gmail.com>
To: CSS <www-style@w3.org>

I have been looking at dependencies between CSS3 modules for a while,
and found out that they form a rather complex graph with several
inconsistencies and circular dependencies.

After taking a deeper look (and plotting the actual graph with the
help of GraphViz), I have managed to find some points where the
dependencies could be simplified. So I'm suggesting a series of
changes here for the WG's consideration:

(Note: I'm taking as dependencies everything listed under a
"Dependencies on other modules" section at the beginning of a draft,
and/or the "Normative references" listed by the end. Manually
harvesting data from ~40 specs with several dependencies each plus
some modules that have no public drafts yet means that it's very
likely there will be some oversights.)

For convenience, I'm using the notation "A -> B" to mean "Dependency
of module A on module B".

No brainers (this should be treated as Editorial changes):
- Remove: css3-ruby -> CSS2
- Remove: css3-tv -> CSS2
- Remove: css3-tv -> CSS1
- Add: css3-ruby -> CSS21
- Add: css-tv -> CSS21
These only mean updating dependencies on CSS 1 and CSS 2 to CSS 2.1.
The dependencies on CSS1 seem pointless for a module that also depends
on CSS2; and updating -> CSS2 to -> CSS21 seems the right thing to do,
since CSS 2.1 is essentially the errata'ed/corrected/revised version
of CSS 2.

Inconsistencies (Text Module):
- Add: css3-text -> css3-values
- Add: css3-text -> css3-color ?
On 6.1, the definition for text-align relies on the type <string>,
which is defined by css3-values. On 8.3 the definition for text-shadow
relies on <length>, also defined by css3-values.
Both 8.1 and 8.3 rely on <color>: while this would be implicitly
covered with the dependency on css3-values; I'm on the opinion that
anything that relies on colors should directly depend on the Color
Module (and also think that the "core" modules should *not* depend on
Color). Anyway, this is subjective, so I won't insist too much on it.

Inconsistencies (Fonts Module):
- Add: css3-fonts -> css3-values
- Add: css3-fonts -> css3-cascade
Several features of the Fonts module rely on the <length>, <number>,
<string>, and <uri> types, defined in css3-values. Also, relative
values for some properties (lighter/bolder for font-weight,
wider/narrower for font-stretch, and larger/smaller for font-size)
heavily depend on inheritance, which is fully detailed on

Unneeded dependencies:
- Remove: css3-values -> css3-fonts ?
- Remove: css3-values -> css3-text ?
- Remove: css3-values -> css3-color ?
Is there a real need for Values and Units to depend on these modules?
Sure, they define some types of values, but so do most CSS3 modules.
Other modules depending on these types should define a direct
dependency on them (like the case css3-text -> css3-color I suggested
above); so all the references to these modules from CSS3 Values and
Units could easily be made informative. Indirect dependencies across
the graph are a hint that something's inherently wrong; like the case
css3-speech -> css3-syntax -> css3-values -> css3-color: how can the
Speech module depend on Color? A shorter example could be css3-grid ->
css3-syntax -> css3-color.

For now, these are the only changes I'm suggesting, but some more are
probably needed.
Just in case it's useful, I'm attaching a SVG version of GraphViz's
output, with several hightlights as follow:
- Arrows labeled with a red "?" are the dependencies I'm proposing to remove.
- Red arrows denote direct circular dependencies (ie: something in the
form A -> B -> A).
- Orange arrows denote indirect circular dependencies (ie: in the form
A -> B -> ... -> A).
- Dashed arrows are the dependencies I'm proposing to add (dashed red
and dashed orange denote that the addition would create a direct or
indirect circular dependency if it were the only change applied).
- Modules shaped with a pale red background are those that are
depended upon, but have no publicly available draft yet (or the draft
is unreachable from the CSS Current Work[1] page).
- Some modules are shaped in a yellow background. Based on my sole
subjective opinion, these are the core of CSS3 (ie: the minimum that
need to be implemented by most implementations), and hence end up
being a kind of dependency-blackholes.
- Some arrows seem to have weird shapes: GraphViz's algorithms are
nice, but not perfect: they will most often yield a readable plotting
of most kinds of structures, but there is no guarantee this will be
the "best" possible plotting.

I'd like to highlight two areas of the graph:
1) There are a lot of red arrows around cascade/values/syntax; but I
tink these are Ok: these three conceptually form a kind of "CSS3 Core
Module" and are inherently tied to each other; their separation is
only a practical and/or bureaucratic detail.
2) Box/Content/Lists have 3 cyclic dependency paths. I don't think
these are as "ok" as the previous ones; but my understanding of these
modules is not deep enough (yet) to suggest any action.

Eduard Pascual
[1] http://www.w3.org/Style/CSS/current-work

(image/svg+xml attachment: cssdeps.svg)

Received on Sunday, 11 April 2010 21:57:28 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:26 GMT