>On Tue, Mar 11, 2014 at 3:25 PM, Andrei Bucur <abu...@adobe.com> wrote: > >> Could you give me an example of that situation? It¹s not very clear to >>me >> what case you are talking about so I can only speculate. To elaborate a >> bit what I said in my previous email: >> 1. Two fragments overlap during the layout (e.g. negative margins). This >> case is handled correctly because layout is the step when fragmentation >> actually occurs. Pagination struts and other techniques are applied to >> actually construct the fragments internally. >> 2. Two fragments overlap at paint time because they¹ve been shifted >> somehow from their layout positions (e.g. relative positioning, >>transforms >> etc.). In WebKit, this implies the shifting objects get a so called >> self-painting layer. These kind of objects know how to paint themselves >>as >> groups. Using the clipping information computed during the layout, the >> layers can contain their fragments correctly. >> > >Suppose I have a font with very long descenders (e.g. Zapfino) and I have >content like this: ><div style="font-family:Zapfino;">piffle<br>ooof</div> >where the descenders of the p and f would normally overlap the second >line, >but there's a fragment break between the lines. How do you stop the first >line's descenders being drawn in the second fragment?
Lines have a containing region assigned to them, determined during layout. A line is painted only inside its containing region so no overlapping is possible with lines in different fragments. > >Also, we have the so called concept of a region range. This range is >> associated with an element and it represents the regions that element is >> flowed into. For monolithic elements (images, videos etc.) that range >>has >> a length of one. During paint time, we apply paint rejection outside of >> that range so even though a monolithic element is taller than the region >> it belongs to, it will not be painted in the following regions. This way >> we avoid content slicing. >> > >OK, this sounds like how I think things should work. If this approach >works >I wonder why you bother with clipping at all. Clipping is need to correctly contain fragments of non-monolithic elements inside the fragment containers. As a more advanced example, consider this element: <div id="content" style="height: 300px; background-color: red;"><img style="height: 150px;"/></div> If "content" is flowed inside a region 100px tall, the image will overflow it with 50px. The problem is we need to clip the background of the first fragment of "content" to 100px so red is not visible in the 50px area below the region. The rest of 200px of "content" should continue in the following regions. > >Rob >-- >Jtehsauts tshaei dS,o n" Wohfy Mdaon yhoaus eanuttehrotraiitny eovni >le atrhtohu gthot sf oirng iyvoeu rs ihnesa.r"t sS?o Whhei csha iids >teoa >stiheer :p atroa lsyazye,d 'mYaonu,r "sGients uapr,e tfaokreg >iyvoeunr, >'m aotr atnod sgaoy ,h o'mGee.t" uTph eann dt hwea lmka'n? gBoutt uIp >waanndt wyeonut thoo mken.o w >_______________________________________________ >dev-servo mailing list >dev-servo@lists.mozilla.org >https://lists.mozilla.org/listinfo/dev-servo Thanks, Andrei. _______________________________________________ dev-servo mailing list dev-servo@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-servo