Skip to content

Commit cd64ae1

Browse files
committed
[css-ui] Add example of bidi and text-overflow
Closes #2125
1 parent d219169 commit cd64ae1

File tree

2 files changed

+68
-3
lines changed

2 files changed

+68
-3
lines changed

css-ui-3/Overview.bs

+34-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
<style>
22
dt[style*="cursor"] * { cursor: inherit; }
33
</style>
4-
<style>#awesome-table td {padding:5px}</style>
4+
<style>
5+
.awesome-table td {padding:5px}
6+
.awesome-table {color:#000;background:#fff;margin: auto;}
7+
</style>
58

69
<pre class='metadata'>
710
Title: CSS Basic User Interface Module Level 3 (CSS3 UI)
@@ -683,6 +686,35 @@ atomic inline-level element</a>
683686
on a line
684687
must be clipped rather than ellipsed.
685688

689+
<div class=example>
690+
<h4 id="bidi-ellipsis" class="no-num no-toc">Bidi ellipsis examples</h4>
691+
These examples demonstrate which characters get hidden
692+
to make room for the ellipsis in a bidi situation:
693+
those visually at the end edge of the line.
694+
695+
Sample CSS:
696+
<pre><code highlight=css>
697+
div {
698+
font-family: monospace;
699+
white-space: pre;
700+
overflow: hidden;
701+
width: 9ch;
702+
text-overflow: ellipsis;
703+
}
704+
</code></pre>
705+
706+
Sample HTML fragments, renderings, and your browser:
707+
<table class="awesome-table data">
708+
<thead><th>HTML<th>Reference rendering<th>Your Browser</thead>
709+
<tr>
710+
<td><code highlight=html>&ltdiv>שלום 123456&lt;/div></code><td><div style="font-family:monospace">123456 ם…</div><td><div style="font-family: monospace; white-space: pre; overflow: hidden; width: 9ch; text-overflow: ellipsis">שלום 123456</div>
711+
<tr><td><code highlight=html>&ltdiv dir=rtl>שלום 123456&lt;/div></code><td><div style="font-family:monospace">…456 שלום</div><td><div style="font-family: monospace; white-space: pre; overflow: hidden; width: 9ch; text-overflow: ellipsis" dir=rtl>שלום 123456</div>
712+
713+
</table>
714+
715+
716+
</div>
717+
686718
<h4 id="ellipsing-details" class="no-num no-toc">ellipsing details</h4>
687719
<ul>
688720
<li>
@@ -728,7 +760,7 @@ sample CSS for a div:
728760
}</code></pre>
729761

730762
sample HTML fragments, renderings, and your browser:
731-
<table style="color:#000;background:#fff" id="awesome-table"><tbody>
763+
<table class="awesome-table"><tbody>
732764
<tr><th>HTML</th><th>sample rendering</th><th>your browser</th></tr>
733765
<tr>
734766
<td><pre><code class="lang-markup">&lt;div&gt;

css-ui-4/Overview.bs

+34-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,10 @@ spec:css-color-4; type:value; text:currentcolor
8080
url: https://www.w3.org/TR/CSS21/box.html#border-edge; type: dfn; spec: CSS21; text: border edge
8181
</pre>
8282

83+
<style>
84+
.awesome-table td {padding:5px}
85+
.awesome-table {color:#000;background:#fff;margin: auto;}
86+
</style>
8387

8488
<h2 id="intro">Introduction</h2>
8589

@@ -811,6 +815,35 @@ atomic inline-level element</a>
811815
on a line
812816
must be clipped rather than ellipsed.
813817

818+
<div class=example>
819+
<h4 id="bidi-ellipsis" class="no-num no-toc">Bidi ellipsis examples</h4>
820+
These examples demonstrate which characters get hidden
821+
to make room for the ellipsis in a bidi situation:
822+
those visually at the edge of the line.
823+
824+
Sample CSS:
825+
<pre><code highlight=css>
826+
div {
827+
font-family: monospace;
828+
white-space: pre;
829+
overflow: hidden;
830+
width: 9ch;
831+
text-overflow: ellipsis;
832+
}
833+
</code></pre>
834+
835+
Sample HTML fragments, renderings, and your browser:
836+
<table class="awesome-table data">
837+
<thead><th>HTML<th>Reference rendering<th>Your Browser</thead>
838+
<tr>
839+
<td><code highlight=html>&ltdiv>שלום 123456&lt;/div></code><td><div style="font-family:monospace">123456 ם…</div><td><div style="font-family: monospace; white-space: pre; overflow: hidden; width: 9ch; text-overflow: ellipsis">שלום 123456</div>
840+
<tr><td><code highlight=html>&ltdiv dir=rtl>שלום 123456&lt;/div></code><td><div style="font-family:monospace">…456 שלום</div><td><div style="font-family: monospace; white-space: pre; overflow: hidden; width: 9ch; text-overflow: ellipsis" dir=rtl>שלום 123456</div>
841+
842+
</table>
843+
844+
845+
</div>
846+
814847

815848
<h4 id="ellipsing-details" class="no-num no-toc">ellipsing details</h4>
816849

@@ -868,7 +901,7 @@ must be clipped rather than ellipsed.
868901
</code></pre>
869902

870903
sample HTML fragments, renderings, and your browser:
871-
<table style="color:#000;background:#fff" id="awesome-table"><tbody>
904+
<table class="awesome-table"><tbody>
872905
<tr>
873906
<th>HTML
874907
<th>sample rendering

0 commit comments

Comments
 (0)