Bug 1218706 - Make 'unicode-bidi: isolate' the default for elements with a dir attribute. r=dbaron,jfkthame

This commit is contained in:
Xidorn Quan 2016-02-17 08:39:54 +08:00
parent a6b66b0d36
commit ad3d3d3712
6 changed files with 65 additions and 98 deletions

View File

@ -5,6 +5,6 @@
<title>Inline blocks shouldn't end the paragraph</title>
</head>
<body>
<p>&#x202e;אני אוהב--&gt; 4 xoferiF--&gt;8 ימים בשבוע</p>
<p>&#x202e;ימים בשבוע 8&lt;-- 4 xoferiF&lt;--אני אוהב</p>
</body>
</html>

View File

@ -5,6 +5,6 @@
<title>Facebook</title>
</head>
<body dir="rtl">
<div style="font-size: 18pt; letter-spacing: 2pt;">Winnie the Pooh commented on his own קישור on Christopher Robin's wall: "Lorem ipsum dolor sit amet"</div>
<div style="font-size: 18pt; letter-spacing: 2pt;"><bdi>Winnie the Pooh</bdi> commented on his own קישור on <bdi>Christopher Robin</bdi>'s <bdi>wall</bdi>: "<bdi>Lorem ipsum dolor sit amet</bdi>"</div>
</body>
</html>

View File

@ -1,33 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Bidirectional Text Test 2 - HTML</title>
<style>
p { font-family: monospace; text-align: left; }
.embed { unicode-bidi: embed; }
.override { unicode-bidi: bidi-override; }
.rtl { direction: rtl; }
.ltr { direction: ltr; }
</style>
</head>
<!-- Testcases based on http://dbaron.org/css/test/bidi2_html by L. David Baron. -->
<body>
<p>&#x05D0;&#x05D1;&#x05D2;</p>
<p class="embed">&#x05D0;&#x05D1;&#x05D2;</p>
<p class="override">&#x05D0;&#x05D1;&#x05D2;</p>
<p>&#x05D0;&#x05D1;&#x05D2; ABC &#x05D3;&#x05D4;&#x05D5;</p>
<p class="rtl">&#x05D0;&#x05D1;&#x05D2; ABC &#x05D3;&#x05D4;&#x05D5;</p>
<p>&#x05D0;&#x05D1;&#x05D2; ABC &#x05D3;&#x05D4;&#x05D5; DEF &#x05D6;&#x05D7;&#x05D8;</p>
<p>&#x05D0;&#x05D1;&#x05D2; <span>ABC &#x05D3;&#x05D4;&#x05D5;</span> DEF &#x05D6;&#x05D7;&#x05D8;</p>
<p>&#x05D0;&#x05D1;&#x05D2; <span dir="ltr">ABC &#x05D3;&#x05D4;&#x05D5; DEF</span> &#x05D6;&#x05D7;&#x05D8;</p>
<p>&#x05D0;&#x05D1;&#x05D2; <span dir="rtl">ABC &#x05D3;&#x05D4;&#x05D5; DEF</span> &#x05D6;&#x05D7;&#x05D8;</p>
<p>&#x05D0;&#x05D1;&#x05D2; <span dir="rtl">ABC &#x05D3;&#x05D4;&#x05D5;</span> DEF &#x05D6;&#x05D7;&#x05D8;</p>
<p>&#x05D0;&#x05D1;&#x05D2; <bdo dir="rtl">ABC &#x05D3;&#x05D4;&#x05D5;</bdo> DEF &#x05D6;&#x05D7;&#x05D8;</p>
<p>&#x05D0;&#x05D1;&#x05D2; <bdo dir="ltr">ABC &#x05D3;&#x05D4;&#x05D5;</bdo> DEF &#x05D6;&#x05D7;&#x05D8;</p>
<p class="rtl">&#x05D0;&#x05D1;&#x05D2; <bdo dir="ltr">ABC &#x05D3;&#x05D4;&#x05D5;</bdo> DEF &#x05D6;&#x05D7;&#x05D8;</p>
<p>&#x05D0;&#x05D1;&#x05D2; ABC &#x05D3;&#x05D4;&#x05D5; DEF GHI &#x05D6;&#x05D7;&#x05D8;</p>
<p>&#x05D0;&#x05D1;&#x05D2; <bdo dir="rtl">ABC &#x05D3;&#x05D4;&#x05D5; DEF</bdo> GHI &#x05D6;&#x05D7;&#x05D8;</p>
<p>&#x05D0;&#x05D1;&#x05D2; ABC <bdo dir="rtl">&#x05D3;&#x05D4;&#x05D5; DEF</bdo> GHI &#x05D6;&#x05D7;&#x05D8;</p>
</body>
</html>

View File

@ -52,7 +52,6 @@ random-if(cocoaWidget) == with-first-letter-2b.html with-first-letter-2-ref.html
== 83958-1c.html 83958-1-ref.html
fuzzy-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated&&!azureSkia,111,7) == 83958-2a.html 83958-2-ref.html
fuzzy-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated&&!azureSkia,111,7) == 83958-2b.html 83958-2-ref.html
fuzzy-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated&&!azureSkia,111,7) == 83958-2c.html 83958-2-ref.html
== 115921-1.html 115921-1-ref.html
== 115921-2.html 115921-2-ref.html
== 151407-1.html 151407-1-ref.html
@ -74,7 +73,7 @@ fuzzy-if(/^Windows\x20NT\x206\.1/.test(http.oscpu)&&!layersGPUAccelerated&&!azur
== 263359-1a.html 263359-1-ref.html
!= 263359-1b.html 263359-1-ref.html
== 263359-2.html 263359-2-ref.html
== 263359-3.html 263359-3-ref.html
fails == 263359-3.html 263359-3-ref.html # bug 1230455
== 263359-4.html 263359-4-ref.html
random-if(winWidget) fuzzy-if(skiaContent,1,1700) == 267459-1.html 267459-1-ref.html # depends on windows version, see bug 590101
fuzzy-if(skiaContent,1,1100) == 267459-2.html 267459-2-ref.html

View File

@ -7,13 +7,14 @@
/* bidi */
[dir] {
unicode-bidi: -moz-isolate;
}
[dir="rtl"] {
direction: rtl;
unicode-bidi: embed;
}
[dir="ltr"] {
direction: ltr;
unicode-bidi: embed;
}
bdi:-moz-dir(ltr), [dir="auto"]:-moz-dir(ltr) { direction: ltr; }
@ -30,62 +31,62 @@ bdi:-moz-dir(rtl), [dir="auto"]:-moz-dir(rtl) { direction: rtl; }
* and the rules in http://dev.w3.org/html5/spec/rendering.html#rendering
*/
address, address[dir],
article, article[dir],
aside, aside[dir],
blockquote, blockquote[dir],
body, body[dir],
caption, caption[dir],
center, center[dir],
col, col[dir],
colgroup, colgroup[dir],
dd, dd[dir],
dir, dir[dir],
div, div[dir],
dl, dl[dir],
dt, dt[dir],
fieldset, fieldset[dir],
figcaption, figcaption[dir],
figure, figure[dir],
footer, footer[dir],
form, form[dir],
h1, h1[dir],
h2, h2[dir],
h3, h3[dir],
h4, h4[dir],
h5, h5[dir],
h6, h6[dir],
header, header[dir],
hgroup, hgroup[dir],
hr, hr[dir],
html, html[dir],
legend, legend[dir],
li, li[dir],
listing, listing[dir],
main, main[dir],
marquee, marquee[dir],
menu, menu[dir],
nav, nav[dir],
noframes, noframes[dir],
ol, ol[dir],
p, p[dir],
plaintext, plaintext[dir],
pre, pre[dir],
section, section[dir],
summary, summary[dir],
table, table[dir],
tbody, tbody[dir],
td, td[dir],
tfoot, tfoot[dir],
th, th[dir],
thead, thead[dir],
tr, tr[dir],
ul, ul[dir],
xmp, xmp[dir] {
address,
article,
aside,
blockquote,
body,
caption,
center,
col,
colgroup,
dd,
dir,
div,
dl,
dt,
fieldset,
figcaption,
figure,
footer,
form,
h1,
h2,
h3,
h4,
h5,
h6,
header,
hgroup,
hr,
html,
legend,
li,
listing,
main,
marquee,
menu,
nav,
noframes,
ol,
p,
plaintext,
pre,
section,
summary,
table,
tbody,
td,
tfoot,
th,
thead,
tr,
ul,
xmp {
unicode-bidi: -moz-isolate;
}
bdi, bdi[dir], output, output[dir], [dir="auto"] {
bdi, output {
unicode-bidi: -moz-isolate;
}
bdo, bdo[dir] {

View File

@ -32,10 +32,10 @@ var tests = [
['div', {'dir': ''}, 'ltr', '-moz-isolate'],
['span', {}, 'ltr', 'normal'],
['span', {'dir': 'ltr'}, 'ltr', 'embed'],
['span', {'dir': 'rtl'}, 'rtl', 'embed'],
['span', {'dir': 'ltr'}, 'ltr', '-moz-isolate'],
['span', {'dir': 'rtl'}, 'rtl', '-moz-isolate'],
['span', {'dir': 'auto'}, 'ltr', '-moz-isolate'],
['span', {'dir': ''}, 'ltr', 'normal'],
['span', {'dir': ''}, 'ltr', '-moz-isolate'],
['bdi', {}, 'ltr', '-moz-isolate'],
['bdi', {'dir': 'ltr'}, 'ltr', '-moz-isolate'],
@ -56,10 +56,10 @@ var tests = [
['bdo', {'dir': ''}, 'ltr', 'bidi-override'],
['textarea', {}, 'ltr', 'normal'],
['textarea', {'dir': 'ltr'}, 'ltr', 'embed'],
['textarea', {'dir': 'rtl'}, 'rtl', 'embed'],
['textarea', {'dir': 'ltr'}, 'ltr', '-moz-isolate'],
['textarea', {'dir': 'rtl'}, 'rtl', '-moz-isolate'],
['textarea', {'dir': 'auto'}, 'ltr', '-moz-plaintext'],
['textarea', {'dir': ''}, 'ltr', 'normal'],
['textarea', {'dir': ''}, 'ltr', '-moz-isolate'],
['pre', {}, 'ltr', '-moz-isolate'],
['pre', {'dir': 'ltr'}, 'ltr', '-moz-isolate'],