Not a bug (or, *if* it is a bug according to the CSS standard, we'll not
fix it).
Please don't use "display:list-item;" to do complicated things. Instead
please use "display:marker;" and "content: XXX;" as this allows you to
precisely control what you do.
---
List {
display: block;
}
ListItem {
display: block;
margin-left: 4ex;
}
List > ListItem:before {
display: marker;
content: disc;
}
List[listStyle=number] > ListItem:before {
content: simple-counter(n);
}
---
If you want to display attribute "type", you may do this:
---
ListItem:after { /*NOTE: after*/
content: " (" attr(type) ")";
color: gray;
display: inline;
}
---
OR this:
---
List[type] > ListItem:before {
display: inline; /*NOTE: inline*/
content: disc " (" attr(type) ")";
}
List[type][listStyle=number] > ListItem:before {
content: simple-counter(n) " (" attr(type) ")";
}
---
Santy, Michael wrote:
> I believe that I have potentially uncovered a rendering bug in XXE. I
> have contrived a simple example to illustrate the problem.
>
> Suppose that I have an XML input like so:
>
> <List listStyle="numbered">
> <ListItem type="defect">This is a defect wrapping multiple
> lines</ListItem>
> <ListItem type="enhancement">This is an enhancement wrapping multiple
> lines</ListItem>
> </List>
>
> styled with:
>
> List {
> display: block;
> }
>
> ListItem {
> display: list-item;
> }
>
> ListItem:before {
> content: "(" attr(type) ")";
> }
>
> List > ListItem,
> List[listStyle=bullet] > ListItem {
> list-style-type: disc;
> }
>
> List[listStyle=number] > ListItem {
> list-style-type: decimal;
> }
>
> I would expect this to be rendered as:
>
> 1. (defect) This is a defect wrapping
> wrapping multiple lines
> 2. (enhancement) This is an enhancement
> wrapping multiple lines
>
> But instead the ListItem:before selector is overwriting the list-item
> marker and is rendering as:
>
> (defect) This is a defect
> wrapping multiple lines
> (enhancement) This is an enhancement
> wrapping multiple lines
>
> Is this behavior intentional or is this a defect? If this behavior is
> intentional, is there any other way that I can accomplish what I'm
> asking. Keep in mind that the "type" attribute can be any arbitrary
> string, so the lengths of it will vary.
>