Re: CSS-Transformation mechanism and modularizing CSS

On Tue, 5 Oct 1999, Sjoerd Visscher wrote:

>> the 'content' property DOES NOT change the contents of the element
>> as far as the DOM is concerned, it only changes the presentation of
>> the element.
> I think this is also the best way for attributes.

Well, how would that help then? In the New World, the only effect
attributes have on rendering is that caused by attribute selectors.

Things like the 'src' attribute of <img> are going to be dealt with by
the CSS (or at the same time as CSS, if the issues are not yet dealt
with by a particular CSS spec). In other words, the mapping of
attributes to rendering is dealt with generically by the style code.
This has to be the case, because with the exception of a few
hard-specified attributes such as the XLink attributes, XML documents
can use whatever they like as attribute names.


> Chris Wilson wrote:
>> Except the content property, in CSS2, only applies to
>> pseudo-elements, which are not exposed in the DOM as part of the
>> content tree.
> But in the Paged Media Properties for CSS3 Working Draft I found
> this:
>    A[HREF] { content: "page " target-counter(HREF, page) }
> So the content property seems to apply to all elements in CSS3.

Yes, but they don't modify the DOM. They just change the rendering.

Remember, CSS does decoration, not transformation.

 
> But if you're asking me how to implement this:
> I'd start with a copy of the DOM tree.
> To this tree I'd apply the CSS rules, calculating the properties,
> and creating real element nodes for the pseudo-elements.
> In this tree I'd also truly apply the content and attribute changes.

But who is going to look at the attributes of the second tree? The
`src' attribute, for example, is mapped to generating a replaced
element at some point during the application of the CSS to the
original DOM. So including attributes in your second tree will have no
effect on rendering.


I fail to see how changing the attributes on a _copy_ of the DOM helps
at all. I can see how changing the attributes on the original DOM tree
can be useful, although I do not believe it is the correct way to do
things (STTS, XSL, and BECSS being the correct ways). But why change
the `post-CSS' DOM...?

-- 
Ian Hickson, confused....
"I take a Professor Bullett approach to my answers. There's a high
probability that they may be right."
  -- Dr Snow; Mechanics Lecturer at Bath University; 1999-03-04

Received on Tuesday, 5 October 1999 18:30:28 UTC