Re: [csswg-drafts] [css-break] box-decoration-break and multi-box inline elements

A proposal:

 - Invariant: the box tree respects the element tree parentage. That is, if E1 and E2 are elements such that E2 is a descendant of E1 (in the element tree) and both generate boxes, then all the boxes generated by E2 are descendants of (at least) the principal box generated by E1 (in the box tree).
 - Therefore, `<main><span>Lorem ipsum<div></div>Lorem ipsum</span></main>` initially produces this box tree:

    ```
    main: block box
      └ span: inline box
          └ div: block box
    ```

 - The definition of [inline box](https://www.w3.org/TR/CSS21/visuren.html#inline-box) is changed to

    > An *inline box* is one that is inline-level, whose inline-level contents participate in its containing inline formatting context, and whose in-flow block-level contents participate in its nearest block formatting context ancestor.
    > Note: an inline box is guaranteed to have at least one block formatting context ancestor.

    Of course this breaks the invariant "an in-flow non-root box participates in the nearest formatting context established by an ancestor box". But I don't think it's a big problem because inline formatting contexts are "weak" (like ruby ones, but those inlinify), so they can be the exception.

 - Then #1617 is approved and element-generated block containers never establish an inline formatting context. Instead, sequences of inline-level boxes generate an anonymous parent.

    ```
    main: block box, BFC or no FC
      └ anonymous: block box, IFC root
         └ span: inline box, no FC
             └ div: block box, no FC
    ```

 - And finally CSS Break says that a block box breaks all its immediate ancestors that are inline boxes or anonymous blocks. So the fragment "tree" becomes

    ```
    first&last fragment of main
      └ first fragment of anonymous
         └ first fragment of span
      └ first&last fragment of div
      └ last fragment of anonymous
         └ last fragment of span
    ```

    All the mess is moved into the fragment "tree", which I don't think it's a well-defined tree, so more handwaving shouldn't be a problem.

-- 
GitHub Notification of comment by Loirooriol
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1706#issuecomment-323552127 using your GitHub account

Received on Saturday, 19 August 2017 22:50:36 UTC