On Fri, Nov 6, 2015 at 12:53 PM, Martin Robinson <mrobin...@igalia.com>
wrote:

> By way of example:
>
> <div style="font-size: 100px; line-height: 50px;">
>     <div style="background: pink; width: 50px; height: 50px; transform:
> translateY(100px) translateX(50px);"></div>
>     <span style="background: blue; opacity: 0.99;">Line 1</span><br/>
>     <span style="background: green;">Line 2</span>
>     <div style="background: red; width: 50px; height: 50px; transform:
> translateY(-40px) translateX(-10px);"></div>
> </div>
>
> The two spans are inline, so normally "Line 1" would stack underneath
> "Line 2" due to tree order. Since "Line 1" establishes a stacking
> context (via the opacity style property), it stacks in tree order with
> the divs (which also establish stacking contexts via their transform
> style properties). The way I implement this is to always insert inline
> stacking contexts into the positioned content section of the display list.
>

That's right.


> The issue I'm having now is that I cannot figure out where or how this
> behavior is described in the spec [1][2]. Both the divs and the first
> span seem to be treated as "positioned descendants" as described in
> Section E.2.8.
>
> I still plan to implement the same behavior as Gecko and Chrome, but I
> would be very grateful is someone could help shed light on how this
> relates to the spec. Thanks!
>

Yeah, it's not in Appendix E, though it probably should be. For 'opacity'
this is described in the CSS3 Color spec:
http://www.w3.org/TR/css3-color/#transparency

> If an element with opacity less than 1 is not positioned, implementations
> must paint the layer it creates, within its parent stacking context, at the
> same stacking order that would be used if it were a positioned element with
> ‘z-index: 0’ and ‘opacity: 1’.
>
All properties that induce a stacking context behave this way.

Rob
-- 
lbir ye,ea yer.tnietoehr  rdn rdsme,anea lurpr  edna e hnysnenh hhe uresyf
toD
selthor  stor  edna  siewaoeodm  or v sstvr  esBa  kbvted,t
rdsme,aoreseoouoto
o l euetiuruewFa  kbn e hnystoivateweh uresyf tulsa rehr  rdm  or rnea
lurpr
.a war hsrer holsa rodvted,t  nenh hneireseoouot.tniesiewaoeivatewt sstvr
esn
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo

Reply via email to