RE: [RC4] margin-left-001 invalid

Le Lun 10 janvier 2011 17:51, Arron Eicholz a écrit :
> On Monday, January 10, 2011 5:27 PM Gérard Talbot wrote:
>> Le Lun 10 janvier 2011 16:17, Arron Eicholz a écrit :
>> > http://test.csswg.org/suites/css2.1/20101210/html4/margin-left-001.htm
>> >
>> > The HR element is by default per HTML4.01 set with align=center this
>> > has no mapping in CSS 2.1
>>
>> Consider that HR element is a block-level element and it's empty by
>> design: it has no inline boxes. So, the attribute specification
>> align=center can
>> not be mapped to and should not be mapped to
>> 'text-align: center' in CSS. It has to be with 'margin-left: auto' and
>> 'margin-right: auto'.
>
> You are making an assumption that there are no inline boxes. There is
> nothing saying you can't create inline boxes. At this point the
> implementation can chose to implement HR however it sees fit. Now
> granted I am not saying that creating inline boxes is the right thing to
> do. I just saying, off the top of my head, I can't think of any
> clarification in CSS saying you can't create them in this case.
>
>>
>> HTML4 states it is aligned "with respect to the surrounding context".
>> http://www.w3.org/TR/html4/present/graphics.html#h-15.3
>
> I understand what HTML4 says but there is nothing in CSS 2.1 that
> requires CSS to apply to the HR's align attribute in any way. The
> closest text is section 6.4.4 and even that is only a suggestion.
>
>> > and thus setting margin-left on the HR element still may do nothing
>> if
>> > the align attribute isn't overridden which can be the case.
>> >
>> > This case should be removed from the CSS 2.1 test suite because it
>> is
>> > testing an assumption of how HR elements are handled in CSS which
>> > isn't clear.
>>
>> Where should the following <div> go in this example?
>>
>> div
>> {
>> border: 1px inset;
>> margin-left: 0px;
>> width: 33%;
>> }
>>
>> <body>
>>  <div></div>
>> </body>
>
> The div should be aligned left.
>
>> Now, why should it be any different for <hr> then?
>
> The HR may be aligned left it may be aligned center CSS doesn't say how
> you override HTML attributes in all cases. And it doesn't in this
> specific case.

It seems to me that HTML5 states how the align HTML attribute for <hr>
can be overriden by CSS style rules and how they are :

"
@namespace url(http://www.w3.org/1999/xhtml);

hr { color: gray; border-style: inset; border-width: 1px; margin: 0.5em
auto; }

The following rules are also expected to apply, as presentational hints:

@namespace url(http://www.w3.org/1999/xhtml);

hr[align=left] { margin-left: 0; margin-right: auto; } /*
case-insensitive */
hr[align=right] { margin-left: auto; margin-right: 0; } /*
case-insensitive */
hr[align=center] { margin-left: auto; margin-right: auto; } /*
case-insensitive */
hr[color], hr[noshade] { border-style: solid; }
"

http://www.whatwg.org/specs/web-apps/current-work/multipage/rendering.html#the-hr-element-0


We can leave things as they are but then, such margin-left-001 testcase
may and can eventually resurface when there will be an HTML5 test suite
or anyone with a list of HTML5 bugs.

regards, Gérard

>
> Section 6.4.4 states that presentational attributes "may" be overridden
> by CSS but it doesn't say that they have to for every case.
>
> After rereading section 6.4.4 I am even more convinced that this case is
> invalid as it stands. At the very least this case should have a "may"
> flag and less strict pass conditions to allow it to pass if the HR is
> centered or left aligned.
>
> --
> Thanks,
> Arron Eicholz


-- 
Contributions to the CSS 2.1 test suite:
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

CSS 2.1 test suite (RC5; January 11th 2011):
http://test.csswg.org/suites/css2.1/20110111/html4/toc.html

CSS 2.1 test suite contributors:
http://test.csswg.org/source/contributors/

Received on Sunday, 20 February 2011 16:43:12 UTC