axr / specification

This is where we work on the specification for AXR
spec.axrproject.org
13 stars 0 forks source link

Should we put the parent's content before or after children? #74

Closed aabizri closed 11 years ago

aabizri commented 12 years ago

This behavior has not been specified in the specifications already: when we have content in the root element, and children themselves have content, in which order should the content be sorted?

Should there be new argument/objects to specify this?

What he means is this:

<root>
  //should the content of the root element's content property go here
  <child>text</child>
  //or here
</root>
aabizri commented 12 years ago

Arguments for having it before

Why will you ask me ?
  1. Most of the time , the content property will be used to specify a title with : content: attr(title of root) And titles generally comes first , as you know.
  2. When you want to create new tags with for example #new it might be because you want several attributes while keeping content in root, for example:

    <root title="Study of marsupilamis behaviors." authors="Jake. McGormic Kate ORemy">

    root {
       #new title { content: attr(title of root)}
       #new authors { content: attr(authors of root)}
    }

    In this case , there is no use for it being either before or after , but the logic goes that as the case 1 will be quite common , case 2 fulfill the same needs but scaled to a greater extent , the two should behave the same.

What if I want to choose between the two in my stylesheet?

Proposition for choosing between both, using an object:

content: @content {
    order: first | last;
    content: no | (content) | <string>;
};
jakepetroules commented 12 years ago

I prefer the option to choose between either, but what about #move, how would that relate to this?

Mouvedia commented 11 years ago

The generated content will appear after the children (rendering wise) and by default before them (source wise). This is motivated by the fact that the content should be treated hierarchically. You can discuss the future syntax on #76.