Re: Issue 101 Resolution

On Tue, Oct 5, 2010 at 6:58 PM, Alan Gresley <alan@css-class.com> wrote:
> The test cases for rule three (left and right) happen since the browsers are
> honoring computed negative margin values. Normally a designer would avoid
> this since it causes inline content to render above floats and not be
> displaced by them. Take this test case.

I don't understand what you mean.  Take the first broken testcase for rule 3:

<!doctype html>
<div id=container>
 <div id=rightfloat></div>
 <div id=leftparent>
   <div id=leftfloat></div>
 </div>
</div>
<style>
#container {
 width: 600px;
 height: 400px;
 background: yellow;
}
#rightfloat {
 width: 200px;
 height: 100px;
 background: green;
 float: right;
}
#leftfloat {
 width: 450px;
 height: 100px;
 background: blue;
 float: left;
}
#leftparent {
 width: 390px;
 height: 250px;
 border: 3px dotted black;
}
</style>

"getComputedStyle(document.getElementById('leftfloat')).marginRight"
return "0px", exactly as it should.  The computed value of the right
margin is definitely not negative.  (Neither is the left margin, for
that matter.)


>> Suggested Change
>> ================
>>
>> Current text:
>>
>> # The right outer edge of a left-floating box may not
>> # be to the right of the left outer edge of any
>> # right-floating box that is to the right of it.
>> # Analogous rules hold for right-floating elements.
>>
>> Suggested text:
>>
>> | The right outer edge of a left-floating box may not
>> | be to the right of the left outer edge of any
>> | right-floating box that is to the right of it and
>> | that intersects the left-floating box's parent box.
>> | Analogous rules hold for right-floating elements.
>
>
> The below test removes the unambiguity of any parents elements. The right
> float does not drop until the viewport is narrower than 200px.
>
>
> <!DOCTYPE html>
>
> <div
> style="float:left;margin-right:-100px;width:200px;background:lime;">FL</div>
> <div
> style="float:right;margin-left:-100px;width:200px;background:red;">FR</div>

I don't understand what this is attempting to demonstrate.  Yes,
margins affect the "outer edge" that is used in the defined
constraints.  But that has nothing to do with the failure that all
browsers exhibit, which happens even with all margins in the document
set to 0.


> So this would lead to making outer edge margin edge. Suggested text:
>
>
>  | The right margin edge of a left-floating box may not
>  | be to the right of the left margin edge of any
>  | right-floating box that is to the right of it. The
>  | computed margin edge for either floats may be a negative
>  | value. Analogous rules hold for right-floating elements.

The definition of "outer edge" includes margins already.  All of the
places where an outer edge is mentioned link to the definition of the
term, at <http://www.w3.org/TR/CSS2/box.html#outer-edge>.

~TJ

Received on Wednesday, 6 October 2010 02:35:02 UTC