On 2/13/14 4:54 PM, Robert O'Callahan wrote:
On Fri, Feb 14, 2014 at 1:43 PM, Boris Zbarsky <bzbar...@mit.edu> wrote:
On 2/13/14 5:56 PM, Robert O'Callahan wrote:
2) Fragmentation. With something like overflow:fragments, absolute
positioning can affect the number of fragments you generate, which can
affect the size of the container of the fragments.
Ugh. I thought one of the points of absolute positioning was to not
affect the layout of anything.... If that's not the case anymore, that's
_really_ annoying.
Well, I'm not 100% sure. I wonder what David thinks.
So I just looked at the relevant piece of this spec and I'm confused:
http://dev.w3.org/csswg/css-overflow-3/#fragment-pseudo-element
Suppose that I have a document like this:
<style>
.a { position: relative; }
.b {
position: absolute;
overflow: fragments;
top: 5%;
bottom: 5%;
right: 0;
width: 100px;
}
.b::nth-fragment(2) { position: static; }
</style>
<div class=a>
Foo
<div class=b>
Four score and seven years ago blah blah blah...
</div>
</div>
So we lay out `a` to determine its height. Now we know the height of
`b`. Then we lay out `b`. Because there isn't enough room for its
multiple lines to fit given its height limit, we create some fragments.
Fragment 2 has `position: static` (which is explicitly allowed by the
spec), so now it has to be inserted as a block kid of `a`. So we go to
reflow `a` again. Now it has a different, taller height, which of course
affects `b`. Now `b` has a larger height--suppose that it's now tall
enough to not generate any fragments! So we remove the static kid of
`a`, making `a` is shorter. We go to reflow it again, and we're back
where we started. The layout seems nonterminating...
Is there something I'm missing?
Patrick
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo