Skip to content

Commit 2297b7b

Browse files
committed
[css-ruby][css-display][css-tables] Layout-internal replaced elements
Layout-internal replaced elements behave as inline, while the outer ruby or table elements behave according to their outer display type. This addresses #6000 and refactors the edits made to implement #508 from css-table to css-display, so that they can be shared between css-ruby and css-tables.
1 parent 8ca4fe8 commit 2297b7b

File tree

3 files changed

+38
-13
lines changed

3 files changed

+38
-13
lines changed

css-display-3/Overview.bs

+11
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,8 @@ Outer Display Roles for Flow Layout: the ''block'', ''inline'', and ''run-in'' k
400400
See [[#run-in-layout]] for details.
401401
</dl>
402402

403+
Note: [=Outer display types=] do affect [=replaced elements=].
404+
403405
If a <<display-outside>> value is specified but <<display-inside>> is omitted,
404406
the element's <a>inner display type</a> defaults to ''flow''.
405407

@@ -510,6 +512,15 @@ Layout-Internal Display Types: the ''table-*'' and ''ruby-*'' keywords</h3>
510512
of elements using these 'display' values
511513
are set to the given keyword.
512514

515+
When the 'display' property of a [=replaced element=] computes to
516+
one of the [=layout-internal=] values,
517+
it is handled as having a used value of ''display/inline''.
518+
White space collapsing and anonymous box generation must happen around those replaced elements
519+
based on that ''display/inline'' value,
520+
as if they never had a [=layout-internal=] display value applied to them.
521+
522+
Advisement: Authors should not assign a [=layout-internal=] display value to [=replaced elements=].
523+
513524
The <<display-internal>> keywords are defined as follows:
514525

515526
<dl export dfn-type=value dfn-for="display, <display-internal>">

css-ruby-1/Overview.bs

+12
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,18 @@ Ruby-specific 'display' Values</h3>
241241
Using the correct markup ensures that screen readers
242242
and non-CSS renderers can interpret the ruby structures.
243243

244+
Note: [=Replaced elements=] with a 'display' value of
245+
''ruby-base'',
246+
''ruby-text'',
247+
''ruby-base-container'',
248+
and ''ruby-text-container''
249+
are treated as [=inline-level boxes=],
250+
as per [[css-display-3#layout-specific-display]];
251+
[=replaced elements=] with a 'display' value of ''ruby'' or ''inline ruby''
252+
behave according to their [=outer display type=],
253+
as per [[css-display-3#outer-role]].
254+
(See also [[#block-ruby]].)
255+
244256
<h4 id="formatting-context">
245257
The Ruby Formatting Context</h4>
246258

css-tables-3/Overview.bs

+15-13
Original file line numberDiff line numberDiff line change
@@ -212,19 +212,21 @@ spec:css-sizing-3; type:property; text:box-sizing
212212
Table captions are positioned between the table margins and its borders.
213213
</dl>
214214

215-
<p class="advisement">
216-
Authors should not assign a display type from the previous list to replaced elements (eg: input fields or images).
217-
When the 'display' property of a replaced element computes to one of these values,
218-
it is handled instead as though the author had declared either
219-
<code>block</code> (for <a>table</a> display) or
220-
<code>inline</code> (for all other values).
221-
Whitespace collapsing and box generation must happen around those replaced elements
222-
like if they never had any table-internal display value applied to them,
223-
and had always been block or inline.
224-
<br/>
225-
</p>
226-
227-
ISSUE(508): This is a breaking change from css 2.1 but matches implementations
215+
Note: [=Replaced elements=] with a 'display' value of
216+
''table-row'',
217+
''table-row-group '',
218+
''table-header-group'',
219+
''table-footer-group'',
220+
''table-column'',
221+
''table-column-group'',
222+
''table-cell'',
223+
and ''table-caption''
224+
are treated as [=inline-level boxes=],
225+
as per [[css-display-3#layout-specific-display]];
226+
[=replaced elements=] with a 'display' value of ''table'' or ''inline-table''
227+
behave according to their [=outer display type=],
228+
as per [[css-display-3#outer-role]].
229+
<strong>This is a breaking change from CSS 2.1 but matches implementations.</strong>
228230

229231
<h4 id="terminology">Terminology</h2>
230232

0 commit comments

Comments
 (0)