Skip to content

Commit

Permalink
[css-layout-api] Fix layout() linking, and remove inline-layout()
Browse files Browse the repository at this point in the history
  • Loading branch information
bfgeek committed Jul 29, 2017
1 parent a6df616 commit 60ff1c2
Showing 1 changed file with 12 additions and 21 deletions.
33 changes: 12 additions & 21 deletions css-layout-api/Overview.bs
Original file line number Diff line number Diff line change
Expand Up @@ -88,21 +88,18 @@ Layout API Containers {#layout-api-containers}
==============================================

<pre class="propdef">
Name: display
New values: layout(<<ident>>) | inline-layout(<<ident>>)
Name: <<display-inside>>
New values: layout(<<ident>>)
</pre>

<dl dfn-for="display" dfn-type=value>
<dt><dfn>layout()</dfn>
<dd>
This value causes an element to generate a block-level <a>layout API container</a> box.
<dt><dfn>inline-layout()</dfn>
<dd>
This value causes an element to generate an inline-level <a>layout API container</a> box.
This value causes an element to generate a <a>layout API container</a> box.
</dl>

A <dfn>layout API container</dfn> is the box generated by an element with a computed 'display' of
''layout()'' or ''inline-layout()''.
A <dfn>layout API container</dfn> is the box generated by an element with a <<display-inside>>
<a>computed value</a> ''layout()''.

A <a>layout API container</a> establishes a new <dfn>layout API formatting context</dfn> for its
contents. This is the same as establishing a block formatting context, except that the layout
Expand All @@ -124,12 +121,6 @@ As the layout is entirely up to the author, properties which are used in other l
flex, block) may not apply. For example an author may not call respect the 'width' or 'height'
properties.

If an element's specified 'display' is ''inline-layout()'', then its 'display' property computes to
''layout()'' in certain circumstances: the table in <a
href="https://www.w3.org/TR/CSS2/visuren.html#dis-pos-flo">CSS 2.1 Section 9.7</a> is amended to
contain an additional row, with ''inline-layout()'' in the "Specified Value" column and ''layout()''
in the "Computed Value" column.

A <a>layout API container</a> has a <dfn>layout instance</dfn>, initially this is set to null. This
is an instance of the author defined layout class (see [[#registering-layout]]). If the <a>box</a>'s
<a>computed value</a> of 'display' changes, this must be reset to null.
Expand Down Expand Up @@ -785,9 +776,9 @@ TODO comments. <dfn>intrinsic sizes valid flag</dfn>. <dfn>intrinsic-sizes-valid
Issue: The above flag is too restrictive on user agents, change.

When the computed style for a |box| changes, the user agent must run the following steps:
1. Let |layoutFunction| be the <<layout()>> or <<inline-layout()>> function of the 'display'
property on the computed style for the |box| if it exists. If it is a different type of
value (e.g. ''grid'') then abort all these steps.
1. Let |layoutFunction| be the ''layout()'' function of the 'display' property on the computed
style for the |box| if it exists. If it is a different type of value (e.g. ''grid'') then
abort all these steps.

2. Let |name| be the first argument of the |layoutFunction|.

Expand Down Expand Up @@ -816,7 +807,7 @@ Concepts {#concepts}

A <dfn>layout definition</dfn> is a <a>struct</a> which describes the information needed by the
{{LayoutWorkletGlobalScope}} about hte author defined layout (which can be referenced by the
<<layout()>> function). It consists of:
''layout()'' function). It consists of:

- <dfn for="layout definition">class constructor</dfn> which is the class <a>constructor</a>.

Expand All @@ -837,7 +828,7 @@ A <dfn>layout definition</dfn> is a <a>struct</a> which describes the informatio
- <dfn for="layout definition">child display</dfn> a {{ChildDisplayType}}.

A <dfn>document layout definition</dfn> is a <a>struct</a> which describes the information needed by
the <a>document</a> about the author defined layout (which can be referenced by the <<layout()>>
the <a>document</a> about the author defined layout (which can be referenced by the ''layout()''
function). It consists of:

- <dfn for="document layout definition">input properties</dfn> which is a <a>list</a> of
Expand Down Expand Up @@ -1158,7 +1149,7 @@ Note: The <a>determine the intrinsic sizes</a> algorithm allows for user agents
When the user agent wants to <dfn>determine the intrinsic sizes</dfn> of a <a>layout API formatting
context</a> for a given |box|, |childBoxes| it <em>must</em> run the following steps:

1. Let |layoutFunction| be the <<layout()>> for the <a>computed value</a> of <<display-inside>>
1. Let |layoutFunction| be the ''layout()'' for the <a>computed value</a> of <<display-inside>>
for |box|.

2. If the <a>intrinsic sizes valid flag</a> for the |layoutFunction| is
Expand Down Expand Up @@ -1275,7 +1266,7 @@ When the user agent wants to <dfn>generate a fragment</dfn> of a <a>layout API f
context</a> for a given |box|, |childBoxes|, |internalConstraintSpace|, and an optional
|internalBreakToken| it <em>must</em> run the following steps:

1. Let |layoutFunction| be the <<layout()>> for the <a>computed value</a> of <<display-inside>>
1. Let |layoutFunction| be the ''layout()'' for the <a>computed value</a> of <<display-inside>>
for |box|.

2. If the <a>layout valid flag</a> for the |layoutFunction| is <a>layout-valid</a> the user
Expand Down

0 comments on commit 60ff1c2

Please sign in to comment.